From f3c22acd8583e5311c9981710a241e7b2ac1abdb Mon Sep 17 00:00:00 2001 From: Tao Pan Date: Fri, 1 Feb 2019 14:06:34 +0800 Subject: [PATCH] rebuild --- ext/config.m4 | 2 +- ext/config.w32 | 1 - ext/configure.ac | 5 +- ext/install | 2 +- ext/kernel/array.c | 1456 ++-- ext/kernel/array.h | 81 +- ext/kernel/backtrace.c | 9 +- ext/kernel/concat.c | 1173 ++-- ext/kernel/concat.h | 191 +- ext/kernel/debug.c | 294 +- ext/kernel/debug.h | 47 +- ext/kernel/exception.c | 138 +- ext/kernel/exception.h | 27 +- ext/kernel/exit.c | 4 +- ext/kernel/extended/fcall.c | 1373 ---- ext/kernel/extended/fcall.h | 43 - ext/kernel/fcall.c | 1072 +-- ext/kernel/fcall.h | 541 +- ext/kernel/file.c | 453 +- ext/kernel/file.h | 31 +- ext/kernel/filter.c | 116 +- ext/kernel/filter.h | 11 +- ext/kernel/globals.h | 24 +- ext/kernel/iterator.c | 14 +- ext/kernel/iterator.h | 49 +- ext/kernel/main.c | 515 +- ext/kernel/main.h | 625 +- ext/kernel/math.c | 110 +- ext/kernel/math.h | 29 +- ext/kernel/memory.c | 646 +- ext/kernel/memory.h | 267 +- ext/kernel/object.c | 1826 ++--- ext/kernel/object.h | 191 +- ext/kernel/operators.c | 770 +-- ext/kernel/operators.h | 266 +- ext/kernel/output.c | 86 - ext/kernel/output.h | 34 - ext/kernel/require.c | 106 +- ext/kernel/require.h | 41 +- ext/kernel/session.c | 88 - ext/kernel/session.h | 32 - ext/kernel/string.c | 1870 +++-- ext/kernel/string.h | 77 +- ext/kernel/time.c | 23 +- ext/kernel/time.h | 2 +- ext/kernel/variables.c | 92 +- ext/kernel/variables.h | 11 +- ext/phalcon.c | 35 +- ext/phalcon/0__closure.zep.c | 5 +- ext/phalcon/1__closure.zep.c | 15 +- ext/phalcon/2__closure.zep.c | 15 +- ext/phalcon/acl.zep.c | 4 +- ext/phalcon/acl/adapter.zep.c | 31 +- ext/phalcon/acl/adapter.zep.h | 49 +- ext/phalcon/acl/adapter/memory.zep.c | 1167 ++-- ext/phalcon/acl/adapter/memory.zep.h | 121 +- ext/phalcon/acl/adapterinterface.zep.h | 147 +- ext/phalcon/acl/resource.zep.c | 37 +- ext/phalcon/acl/resource.zep.h | 35 +- ext/phalcon/acl/resourceaware.zep.h | 9 +- ext/phalcon/acl/resourceinterface.zep.h | 27 +- ext/phalcon/acl/role.zep.c | 37 +- ext/phalcon/acl/role.zep.h | 35 +- ext/phalcon/acl/roleaware.zep.h | 9 +- ext/phalcon/acl/roleinterface.zep.h | 27 +- ext/phalcon/annotations/adapter.zep.c | 200 +- ext/phalcon/annotations/adapter.zep.h | 63 +- ext/phalcon/annotations/adapter/apc.zep.c | 83 +- ext/phalcon/annotations/adapter/apc.zep.h | 8 + ext/phalcon/annotations/adapter/apcu.zep.c | 83 +- ext/phalcon/annotations/adapter/apcu.zep.h | 8 + ext/phalcon/annotations/adapter/files.zep.c | 101 +- ext/phalcon/annotations/adapter/files.zep.h | 8 + ext/phalcon/annotations/adapter/memory.zep.c | 51 +- ext/phalcon/annotations/adapter/memory.zep.h | 8 + ext/phalcon/annotations/adapter/xcache.zep.c | 68 +- ext/phalcon/annotations/adapter/xcache.zep.h | 8 + .../annotations/adapterinterface.zep.h | 63 +- ext/phalcon/annotations/annotation.zep.c | 248 +- ext/phalcon/annotations/annotation.zep.h | 32 +- ext/phalcon/annotations/collection.zep.c | 241 +- ext/phalcon/annotations/collection.zep.h | 66 +- ext/phalcon/annotations/factory.zep.c | 13 +- ext/phalcon/annotations/factory.zep.h | 6 +- ext/phalcon/annotations/reader.zep.c | 168 +- ext/phalcon/annotations/reader.zep.h | 20 +- ext/phalcon/annotations/readerinterface.zep.h | 20 +- ext/phalcon/annotations/reflection.zep.c | 210 +- ext/phalcon/annotations/reflection.zep.h | 6 +- ext/phalcon/application.zep.c | 135 +- ext/phalcon/application.zep.h | 59 +- ext/phalcon/assets/collection.zep.c | 555 +- ext/phalcon/assets/collection.zep.h | 207 +- ext/phalcon/assets/filterinterface.zep.h | 10 +- ext/phalcon/assets/filters/cssmin.zep.c | 15 +- ext/phalcon/assets/filters/cssmin.zep.h | 10 +- ext/phalcon/assets/filters/jsmin.zep.c | 15 +- ext/phalcon/assets/filters/jsmin.zep.h | 10 +- ext/phalcon/assets/filters/none.zep.c | 15 +- ext/phalcon/assets/filters/none.zep.h | 10 +- ext/phalcon/assets/inline.zep.c | 82 +- ext/phalcon/assets/inline.zep.h | 74 +- ext/phalcon/assets/inline/css.zep.c | 30 +- ext/phalcon/assets/inline/css.zep.h | 8 + ext/phalcon/assets/inline/js.zep.c | 30 +- ext/phalcon/assets/inline/js.zep.h | 8 + ext/phalcon/assets/manager.zep.c | 1074 +-- ext/phalcon/assets/manager.zep.h | 210 +- ext/phalcon/assets/resource.zep.c | 314 +- ext/phalcon/assets/resource.zep.h | 176 +- ext/phalcon/assets/resource/css.zep.c | 40 +- ext/phalcon/assets/resource/css.zep.h | 12 + ext/phalcon/assets/resource/js.zep.c | 27 +- ext/phalcon/assets/resourceinterface.zep.h | 62 +- ext/phalcon/cache/backend.zep.c | 105 +- ext/phalcon/cache/backend.zep.h | 31 +- ext/phalcon/cache/backend/apc.zep.c | 353 +- ext/phalcon/cache/backend/apc.zep.h | 65 +- ext/phalcon/cache/backend/apcu.zep.c | 376 +- ext/phalcon/cache/backend/apcu.zep.h | 65 +- ext/phalcon/cache/backend/factory.zep.c | 66 +- ext/phalcon/cache/backend/factory.zep.h | 10 +- ext/phalcon/cache/backend/file.zep.c | 706 +- ext/phalcon/cache/backend/file.zep.h | 89 +- ext/phalcon/cache/backend/libmemcached.zep.c | 621 +- ext/phalcon/cache/backend/libmemcached.zep.h | 55 +- ext/phalcon/cache/backend/memcache.zep.c | 643 +- ext/phalcon/cache/backend/memcache.zep.h | 73 +- ext/phalcon/cache/backend/memory.zep.c | 345 +- ext/phalcon/cache/backend/memory.zep.h | 82 +- ext/phalcon/cache/backend/mongo.zep.c | 607 +- ext/phalcon/cache/backend/mongo.zep.h | 73 +- ext/phalcon/cache/backend/redis.zep.c | 716 +- ext/phalcon/cache/backend/redis.zep.h | 73 +- ext/phalcon/cache/backend/xcache.zep.c | 469 +- ext/phalcon/cache/backend/xcache.zep.h | 67 +- ext/phalcon/cache/backendinterface.zep.h | 64 +- ext/phalcon/cache/frontend/base64.zep.c | 51 +- ext/phalcon/cache/frontend/base64.zep.h | 24 +- ext/phalcon/cache/frontend/data.zep.c | 51 +- ext/phalcon/cache/frontend/data.zep.h | 18 +- ext/phalcon/cache/frontend/factory.zep.c | 55 +- ext/phalcon/cache/frontend/factory.zep.h | 10 +- ext/phalcon/cache/frontend/igbinary.zep.c | 51 +- ext/phalcon/cache/frontend/igbinary.zep.h | 24 +- ext/phalcon/cache/frontend/json.zep.c | 51 +- ext/phalcon/cache/frontend/json.zep.h | 24 +- ext/phalcon/cache/frontend/msgpack.zep.c | 58 +- ext/phalcon/cache/frontend/msgpack.zep.h | 33 +- ext/phalcon/cache/frontend/none.zep.c | 25 +- ext/phalcon/cache/frontend/none.zep.h | 18 +- ext/phalcon/cache/frontend/output.zep.c | 77 +- ext/phalcon/cache/frontend/output.zep.h | 24 +- ext/phalcon/cache/frontendinterface.zep.h | 18 +- ext/phalcon/cache/multiple.zep.c | 219 +- ext/phalcon/cache/multiple.zep.h | 27 +- ext/phalcon/cli/console.zep.c | 519 +- ext/phalcon/cli/console.zep.h | 16 +- ext/phalcon/cli/dispatcher.zep.c | 257 +- ext/phalcon/cli/dispatcher.zep.h | 70 +- ext/phalcon/cli/dispatcherinterface.zep.h | 39 +- ext/phalcon/cli/router.zep.c | 624 +- ext/phalcon/cli/router.zep.h | 101 +- ext/phalcon/cli/router/route.zep.c | 656 +- ext/phalcon/cli/router/route.zep.h | 124 +- ext/phalcon/cli/router/routeinterface.zep.h | 72 +- ext/phalcon/cli/routerinterface.zep.h | 110 +- ext/phalcon/cli/task.zep.c | 4 +- ext/phalcon/config.zep.c | 394 +- ext/phalcon/config.zep.h | 65 +- ext/phalcon/config/adapter/grouped.zep.c | 86 +- ext/phalcon/config/adapter/grouped.zep.h | 4 + ext/phalcon/config/adapter/ini.zep.c | 265 +- ext/phalcon/config/adapter/ini.zep.h | 14 +- ext/phalcon/config/adapter/json.zep.c | 28 +- ext/phalcon/config/adapter/json.zep.h | 4 + ext/phalcon/config/adapter/php.zep.c | 20 +- ext/phalcon/config/adapter/php.zep.h | 4 + ext/phalcon/config/adapter/yaml.zep.c | 76 +- ext/phalcon/config/adapter/yaml.zep.h | 4 + ext/phalcon/config/factory.zep.c | 149 +- ext/phalcon/config/factory.zep.h | 10 +- ext/phalcon/crypt.zep.c | 962 +-- ext/phalcon/crypt.zep.h | 209 +- ext/phalcon/cryptinterface.zep.h | 95 +- ext/phalcon/db.zep.c | 57 +- ext/phalcon/db/adapter.zep.c | 2045 +++--- ext/phalcon/db/adapter.zep.h | 540 +- ext/phalcon/db/adapter/pdo.zep.c | 934 +-- ext/phalcon/db/adapter/pdo.zep.h | 133 +- ext/phalcon/db/adapter/pdo/factory.zep.c | 13 +- ext/phalcon/db/adapter/pdo/factory.zep.h | 6 +- ext/phalcon/db/adapter/pdo/mysql.zep.c | 865 ++- ext/phalcon/db/adapter/pdo/mysql.zep.h | 56 +- ext/phalcon/db/adapter/pdo/postgresql.zep.c | 697 +- ext/phalcon/db/adapter/pdo/postgresql.zep.h | 75 +- ext/phalcon/db/adapter/pdo/sqlite.zep.c | 841 ++- ext/phalcon/db/adapter/pdo/sqlite.zep.h | 66 +- ext/phalcon/db/adapterinterface.zep.h | 562 +- ext/phalcon/db/column.zep.c | 315 +- ext/phalcon/db/column.zep.h | 127 +- ext/phalcon/db/columninterface.zep.h | 15 +- ext/phalcon/db/dialect.zep.c | 1978 +++--- ext/phalcon/db/dialect.zep.h | 399 +- ext/phalcon/db/dialect/mysql.zep.c | 1587 +++-- ext/phalcon/db/dialect/mysql.zep.h | 351 +- ext/phalcon/db/dialect/postgresql.zep.c | 1512 +++-- ext/phalcon/db/dialect/postgresql.zep.h | 338 +- ext/phalcon/db/dialect/sqlite.zep.c | 1270 ++-- ext/phalcon/db/dialect/sqlite.zep.h | 364 +- ext/phalcon/db/dialectinterface.zep.h | 382 +- ext/phalcon/db/index.zep.c | 73 +- ext/phalcon/db/index.zep.h | 37 +- ext/phalcon/db/indexinterface.zep.h | 6 +- ext/phalcon/db/profiler.zep.c | 113 +- ext/phalcon/db/profiler.zep.h | 60 +- ext/phalcon/db/profiler/item.zep.c | 72 +- ext/phalcon/db/profiler/item.zep.h | 66 +- ext/phalcon/db/rawvalue.zep.c | 34 +- ext/phalcon/db/rawvalue.zep.h | 18 +- ext/phalcon/db/reference.zep.c | 140 +- ext/phalcon/db/reference.zep.h | 64 +- ext/phalcon/db/referenceinterface.zep.h | 6 +- ext/phalcon/db/result/pdo.zep.c | 312 +- ext/phalcon/db/result/pdo.zep.h | 47 +- ext/phalcon/db/resultinterface.zep.h | 14 +- ext/phalcon/debug.zep.c | 1140 ++-- ext/phalcon/debug.zep.h | 155 +- ext/phalcon/debug/dump.zep.c | 1144 ++-- ext/phalcon/debug/dump.zep.h | 84 +- ext/phalcon/di.zep.c | 651 +- ext/phalcon/di.zep.h | 144 +- ext/phalcon/di/factorydefault.zep.c | 415 +- ext/phalcon/di/factorydefault/cli.zep.c | 209 +- ext/phalcon/di/injectable.zep.c | 115 +- ext/phalcon/di/injectable.zep.h | 22 +- ext/phalcon/di/injectionawareinterface.zep.h | 9 +- ext/phalcon/di/service.zep.c | 252 +- ext/phalcon/di/service.zep.h | 59 +- ext/phalcon/di/service/builder.zep.c | 417 +- ext/phalcon/di/service/builder.zep.h | 10 +- ext/phalcon/di/serviceinterface.zep.h | 29 +- ext/phalcon/diinterface.zep.h | 96 +- ext/phalcon/dispatcher.zep.c | 1227 ++-- ext/phalcon/dispatcher.zep.h | 180 +- ext/phalcon/dispatcherinterface.zep.h | 66 +- ext/phalcon/escaper.zep.c | 208 +- ext/phalcon/escaper.zep.h | 91 +- ext/phalcon/escaperinterface.zep.h | 67 +- ext/phalcon/events/event.zep.c | 89 +- ext/phalcon/events/event.zep.h | 60 +- ext/phalcon/events/eventinterface.zep.h | 43 +- ext/phalcon/events/eventsawareinterface.zep.h | 9 +- ext/phalcon/events/manager.zep.c | 537 +- ext/phalcon/events/manager.zep.h | 64 +- ext/phalcon/events/managerinterface.zep.h | 20 + ext/phalcon/factory.zep.c | 30 +- ext/phalcon/factory.zep.h | 4 + ext/phalcon/filter.zep.c | 321 +- ext/phalcon/filter.zep.h | 27 +- ext/phalcon/filterinterface.zep.h | 19 +- ext/phalcon/flash.zep.c | 310 +- ext/phalcon/flash.zep.h | 103 +- ext/phalcon/flash/direct.zep.c | 46 +- ext/phalcon/flash/direct.zep.h | 14 +- ext/phalcon/flash/session.zep.c | 224 +- ext/phalcon/flash/session.zep.h | 44 +- ext/phalcon/flashinterface.zep.h | 8 + ext/phalcon/forms/element.zep.c | 511 +- ext/phalcon/forms/element.zep.h | 228 +- ext/phalcon/forms/element/check.zep.c | 18 +- ext/phalcon/forms/element/check.zep.h | 6 +- ext/phalcon/forms/element/date.zep.c | 12 +- ext/phalcon/forms/element/date.zep.h | 6 +- ext/phalcon/forms/element/email.zep.c | 12 +- ext/phalcon/forms/element/email.zep.h | 6 +- ext/phalcon/forms/element/file.zep.c | 12 +- ext/phalcon/forms/element/file.zep.h | 6 +- ext/phalcon/forms/element/hidden.zep.c | 12 +- ext/phalcon/forms/element/hidden.zep.h | 6 +- ext/phalcon/forms/element/numeric.zep.c | 12 +- ext/phalcon/forms/element/numeric.zep.h | 6 +- ext/phalcon/forms/element/password.zep.c | 12 +- ext/phalcon/forms/element/password.zep.h | 6 +- ext/phalcon/forms/element/radio.zep.c | 18 +- ext/phalcon/forms/element/radio.zep.h | 6 +- ext/phalcon/forms/element/select.zep.c | 82 +- ext/phalcon/forms/element/select.zep.h | 22 +- ext/phalcon/forms/element/submit.zep.c | 12 +- ext/phalcon/forms/element/submit.zep.h | 6 +- ext/phalcon/forms/element/text.zep.c | 12 +- ext/phalcon/forms/element/text.zep.h | 6 +- ext/phalcon/forms/element/textarea.zep.c | 12 +- ext/phalcon/forms/element/textarea.zep.h | 6 +- ext/phalcon/forms/elementinterface.zep.h | 213 +- ext/phalcon/forms/form.zep.c | 1074 +-- ext/phalcon/forms/form.zep.h | 204 +- ext/phalcon/forms/manager.zep.c | 84 +- ext/phalcon/forms/manager.zep.h | 40 +- ext/phalcon/http/cookie.zep.c | 692 +- ext/phalcon/http/cookie.zep.h | 203 +- ext/phalcon/http/cookieinterface.zep.h | 138 +- ext/phalcon/http/request.zep.c | 2403 ++++--- ext/phalcon/http/request.zep.h | 584 +- ext/phalcon/http/request/file.zep.c | 135 +- ext/phalcon/http/request/file.zep.h | 91 +- ext/phalcon/http/request/fileinterface.zep.h | 55 +- ext/phalcon/http/requestinterface.zep.h | 356 +- ext/phalcon/http/response.zep.c | 914 +-- ext/phalcon/http/response.zep.h | 270 +- ext/phalcon/http/response/cookies.zep.c | 405 +- ext/phalcon/http/response/cookies.zep.h | 124 +- .../http/response/cookiesinterface.zep.h | 97 +- ext/phalcon/http/response/headers.zep.c | 229 +- ext/phalcon/http/response/headers.zep.h | 46 +- .../http/response/headersinterface.zep.h | 31 +- ext/phalcon/http/responseinterface.zep.h | 169 +- ext/phalcon/image.zep.c | 18 +- ext/phalcon/image/adapter.zep.c | 662 +- ext/phalcon/image/adapter.zep.h | 258 +- ext/phalcon/image/adapter/gd.zep.c | 2049 +++--- ext/phalcon/image/adapter/gd.zep.h | 165 +- ext/phalcon/image/adapter/imagick.zep.c | 1822 ++--- ext/phalcon/image/adapter/imagick.zep.h | 188 +- ext/phalcon/image/adapterinterface.zep.h | 124 + ext/phalcon/image/factory.zep.c | 77 +- ext/phalcon/image/factory.zep.h | 10 +- ext/phalcon/kernel.zep.c | 13 +- ext/phalcon/kernel.zep.h | 4 + ext/phalcon/loader.zep.c | 793 ++- ext/phalcon/loader.zep.h | 161 +- ext/phalcon/logger.zep.c | 22 +- ext/phalcon/logger/adapter.zep.c | 457 +- ext/phalcon/logger/adapter.zep.h | 149 +- ext/phalcon/logger/adapter/blackhole.zep.c | 35 +- ext/phalcon/logger/adapter/blackhole.zep.h | 30 +- ext/phalcon/logger/adapter/file.zep.c | 161 +- ext/phalcon/logger/adapter/file.zep.h | 34 +- ext/phalcon/logger/adapter/firephp.zep.c | 138 +- ext/phalcon/logger/adapter/firephp.zep.h | 30 +- ext/phalcon/logger/adapter/stream.zep.c | 116 +- ext/phalcon/logger/adapter/stream.zep.h | 34 +- ext/phalcon/logger/adapter/syslog.zep.c | 105 +- ext/phalcon/logger/adapter/syslog.zep.h | 30 +- ext/phalcon/logger/adapterinterface.zep.h | 146 +- ext/phalcon/logger/factory.zep.c | 64 +- ext/phalcon/logger/factory.zep.h | 10 +- ext/phalcon/logger/formatter.zep.c | 80 +- ext/phalcon/logger/formatter.zep.h | 14 +- ext/phalcon/logger/formatter/firephp.zep.c | 217 +- ext/phalcon/logger/formatter/firephp.zep.h | 66 +- ext/phalcon/logger/formatter/json.zep.c | 51 +- ext/phalcon/logger/formatter/json.zep.h | 18 +- ext/phalcon/logger/formatter/line.zep.c | 129 +- ext/phalcon/logger/formatter/line.zep.h | 44 +- ext/phalcon/logger/formatter/syslog.zep.c | 20 +- ext/phalcon/logger/formatter/syslog.zep.h | 14 +- ext/phalcon/logger/formatterinterface.zep.h | 12 + ext/phalcon/logger/item.zep.c | 39 +- ext/phalcon/logger/item.zep.h | 21 +- ext/phalcon/logger/multiple.zep.c | 373 +- ext/phalcon/logger/multiple.zep.h | 36 + ext/phalcon/mvc/application.zep.c | 442 +- ext/phalcon/mvc/application.zep.h | 34 +- ext/phalcon/mvc/collection.zep.c | 1930 +++--- ext/phalcon/mvc/collection.zep.h | 313 +- ext/phalcon/mvc/collection/behavior.zep.c | 87 +- ext/phalcon/mvc/collection/behavior.zep.h | 22 +- .../mvc/collection/behavior/softdelete.zep.c | 78 +- .../mvc/collection/behavior/softdelete.zep.h | 4 + .../collection/behavior/timestampable.zep.c | 87 +- .../collection/behavior/timestampable.zep.h | 4 + .../mvc/collection/behaviorinterface.zep.h | 8 + ext/phalcon/mvc/collection/document.zep.c | 60 +- ext/phalcon/mvc/collection/document.zep.h | 10 +- ext/phalcon/mvc/collection/manager.zep.c | 463 +- ext/phalcon/mvc/collection/manager.zep.h | 71 +- .../mvc/collection/managerinterface.zep.h | 49 +- ext/phalcon/mvc/collectioninterface.zep.h | 109 +- ext/phalcon/mvc/controller.zep.c | 4 +- .../mvc/controller/bindmodelinterface.zep.h | 9 +- ext/phalcon/mvc/dispatcher.zep.c | 192 +- ext/phalcon/mvc/dispatcher.zep.h | 83 +- ext/phalcon/mvc/dispatcherinterface.zep.h | 39 +- ext/phalcon/mvc/entityinterface.zep.h | 8 + ext/phalcon/mvc/micro.zep.c | 1350 ++-- ext/phalcon/mvc/micro.zep.h | 200 +- ext/phalcon/mvc/micro/collection.zep.c | 335 +- ext/phalcon/mvc/micro/collection.zep.h | 138 +- .../mvc/micro/collectioninterface.zep.h | 74 +- ext/phalcon/mvc/micro/lazyloader.zep.c | 116 +- ext/phalcon/mvc/micro/lazyloader.zep.h | 12 + ext/phalcon/mvc/model.zep.c | 5850 +++++++++------- ext/phalcon/mvc/model.zep.h | 605 +- ext/phalcon/mvc/model/behavior.zep.c | 87 +- ext/phalcon/mvc/model/behavior.zep.h | 22 +- .../mvc/model/behavior/softdelete.zep.c | 103 +- .../mvc/model/behavior/softdelete.zep.h | 4 + .../mvc/model/behavior/timestampable.zep.c | 87 +- .../mvc/model/behavior/timestampable.zep.h | 4 + ext/phalcon/mvc/model/behaviorinterface.zep.h | 8 + ext/phalcon/mvc/model/binder.zep.c | 390 +- ext/phalcon/mvc/model/binder.zep.h | 60 +- ext/phalcon/mvc/model/binderinterface.zep.h | 34 +- ext/phalcon/mvc/model/criteria.zep.c | 1348 ++-- ext/phalcon/mvc/model/criteria.zep.h | 331 +- ext/phalcon/mvc/model/criteriainterface.zep.h | 164 +- ext/phalcon/mvc/model/manager.zep.c | 2626 +++++--- ext/phalcon/mvc/model/manager.zep.h | 434 +- ext/phalcon/mvc/model/managerinterface.zep.h | 185 +- ext/phalcon/mvc/model/message.zep.c | 135 +- ext/phalcon/mvc/model/message.zep.h | 101 +- ext/phalcon/mvc/model/messageinterface.zep.h | 23 +- ext/phalcon/mvc/model/metadata.zep.c | 674 +- ext/phalcon/mvc/model/metadata.zep.h | 127 +- ext/phalcon/mvc/model/metadata/apc.zep.c | 111 +- ext/phalcon/mvc/model/metadata/apc.zep.h | 16 +- ext/phalcon/mvc/model/metadata/apcu.zep.c | 111 +- ext/phalcon/mvc/model/metadata/apcu.zep.h | 16 +- ext/phalcon/mvc/model/metadata/files.zep.c | 140 +- ext/phalcon/mvc/model/metadata/files.zep.h | 10 +- .../mvc/model/metadata/libmemcached.zep.c | 185 +- .../mvc/model/metadata/libmemcached.zep.h | 16 +- ext/phalcon/mvc/model/metadata/memcache.zep.c | 210 +- ext/phalcon/mvc/model/metadata/memcache.zep.h | 16 +- ext/phalcon/mvc/model/metadata/memory.zep.c | 71 +- ext/phalcon/mvc/model/metadata/memory.zep.h | 10 +- ext/phalcon/mvc/model/metadata/redis.zep.c | 210 +- ext/phalcon/mvc/model/metadata/redis.zep.h | 16 +- ext/phalcon/mvc/model/metadata/session.zep.c | 75 +- ext/phalcon/mvc/model/metadata/session.zep.h | 8 + .../model/metadata/strategy/annotations.zep.c | 730 +- .../model/metadata/strategy/annotations.zep.h | 12 +- .../metadata/strategy/introspection.zep.c | 300 +- .../metadata/strategy/introspection.zep.h | 12 +- ext/phalcon/mvc/model/metadata/xcache.zep.c | 111 +- ext/phalcon/mvc/model/metadata/xcache.zep.h | 10 +- ext/phalcon/mvc/model/metadatainterface.zep.h | 60 +- ext/phalcon/mvc/model/query.zep.c | 5991 ++++++++++------- ext/phalcon/mvc/model/query.zep.h | 281 +- ext/phalcon/mvc/model/query/builder.zep.c | 2490 ++++--- ext/phalcon/mvc/model/query/builder.zep.h | 394 +- .../mvc/model/query/builderinterface.zep.c | 4 +- .../mvc/model/query/builderinterface.zep.h | 72 +- ext/phalcon/mvc/model/query/lang.zep.c | 15 +- ext/phalcon/mvc/model/query/lang.zep.h | 4 + ext/phalcon/mvc/model/query/status.zep.c | 36 +- ext/phalcon/mvc/model/query/status.zep.h | 31 +- .../mvc/model/query/statusinterface.zep.h | 27 +- ext/phalcon/mvc/model/queryinterface.zep.h | 4 + ext/phalcon/mvc/model/relation.zep.c | 185 +- ext/phalcon/mvc/model/relation.zep.h | 66 +- ext/phalcon/mvc/model/relationinterface.zep.h | 62 +- ext/phalcon/mvc/model/resultinterface.zep.h | 4 + ext/phalcon/mvc/model/resultset.zep.c | 496 +- ext/phalcon/mvc/model/resultset.zep.h | 125 +- ext/phalcon/mvc/model/resultset/complex.zep.c | 367 +- ext/phalcon/mvc/model/resultset/complex.zep.h | 18 +- ext/phalcon/mvc/model/resultset/simple.zep.c | 345 +- ext/phalcon/mvc/model/resultset/simple.zep.h | 19 +- .../mvc/model/resultsetinterface.zep.h | 31 +- ext/phalcon/mvc/model/row.zep.c | 64 +- ext/phalcon/mvc/model/row.zep.h | 38 +- ext/phalcon/mvc/model/transaction.zep.c | 192 +- ext/phalcon/mvc/model/transaction.zep.h | 76 +- .../mvc/model/transaction/failed.zep.c | 40 +- .../mvc/model/transaction/failed.zep.h | 22 +- .../mvc/model/transaction/manager.zep.c | 350 +- .../mvc/model/transaction/manager.zep.h | 76 +- .../model/transaction/managerinterface.zep.h | 19 +- .../mvc/model/transactioninterface.zep.h | 62 +- ext/phalcon/mvc/model/validationfailed.zep.c | 36 +- ext/phalcon/mvc/model/validationfailed.zep.h | 18 +- ext/phalcon/mvc/model/validator.zep.c | 149 +- ext/phalcon/mvc/model/validator.zep.h | 29 +- ext/phalcon/mvc/model/validator/email.zep.c | 70 +- ext/phalcon/mvc/model/validator/email.zep.h | 6 +- .../mvc/model/validator/exclusionin.zep.c | 89 +- .../mvc/model/validator/exclusionin.zep.h | 6 +- .../mvc/model/validator/inclusionin.zep.c | 117 +- .../mvc/model/validator/inclusionin.zep.h | 6 +- ext/phalcon/mvc/model/validator/ip.zep.c | 149 +- ext/phalcon/mvc/model/validator/ip.zep.h | 6 +- .../mvc/model/validator/numericality.zep.c | 65 +- .../mvc/model/validator/numericality.zep.h | 6 +- .../mvc/model/validator/presenceof.zep.c | 57 +- .../mvc/model/validator/presenceof.zep.h | 6 +- ext/phalcon/mvc/model/validator/regex.zep.c | 97 +- ext/phalcon/mvc/model/validator/regex.zep.h | 6 +- .../mvc/model/validator/stringlength.zep.c | 147 +- .../mvc/model/validator/stringlength.zep.h | 6 +- .../mvc/model/validator/uniqueness.zep.c | 343 +- .../mvc/model/validator/uniqueness.zep.h | 6 +- ext/phalcon/mvc/model/validator/url.zep.c | 70 +- ext/phalcon/mvc/model/validator/url.zep.h | 6 +- .../mvc/model/validatorinterface.zep.h | 6 +- ext/phalcon/mvc/modelinterface.zep.h | 105 +- ext/phalcon/mvc/router.zep.c | 1564 +++-- ext/phalcon/mvc/router.zep.h | 330 +- ext/phalcon/mvc/router/annotations.zep.c | 740 +- ext/phalcon/mvc/router/annotations.zep.h | 75 +- ext/phalcon/mvc/router/group.zep.c | 363 +- ext/phalcon/mvc/router/group.zep.h | 149 +- ext/phalcon/mvc/router/groupinterface.zep.h | 139 +- ext/phalcon/mvc/router/route.zep.c | 617 +- ext/phalcon/mvc/router/route.zep.h | 169 +- ext/phalcon/mvc/router/routeinterface.zep.h | 97 +- ext/phalcon/mvc/routerinterface.zep.h | 217 +- ext/phalcon/mvc/url.zep.c | 370 +- ext/phalcon/mvc/url.zep.h | 88 +- ext/phalcon/mvc/urlinterface.zep.h | 42 +- ext/phalcon/mvc/view.zep.c | 1784 +++-- ext/phalcon/mvc/view.zep.h | 446 +- ext/phalcon/mvc/view/engine.zep.c | 51 +- ext/phalcon/mvc/view/engine.zep.h | 28 +- ext/phalcon/mvc/view/engine/php.zep.c | 61 +- ext/phalcon/mvc/view/engine/php.zep.h | 8 + ext/phalcon/mvc/view/engine/volt.zep.c | 317 +- ext/phalcon/mvc/view/engine/volt.zep.h | 72 +- .../mvc/view/engine/volt/compiler.zep.c | 3862 ++++++----- .../mvc/view/engine/volt/compiler.zep.h | 343 +- .../mvc/view/engine/volt/exception.zep.c | 53 +- .../mvc/view/engine/volt/exception.zep.h | 19 +- ext/phalcon/mvc/view/engineinterface.zep.h | 27 +- ext/phalcon/mvc/view/simple.zep.c | 727 +- ext/phalcon/mvc/view/simple.zep.h | 142 +- ext/phalcon/mvc/viewbaseinterface.zep.h | 47 +- ext/phalcon/mvc/viewinterface.zep.h | 117 +- ext/phalcon/paginator/adapter.zep.c | 21 +- ext/phalcon/paginator/adapter.zep.h | 29 +- ext/phalcon/paginator/adapter/model.zep.c | 134 +- ext/phalcon/paginator/adapter/model.zep.h | 18 +- .../paginator/adapter/nativearray.zep.c | 131 +- .../paginator/adapter/nativearray.zep.h | 18 +- .../paginator/adapter/querybuilder.zep.c | 352 +- .../paginator/adapter/querybuilder.zep.h | 42 +- ext/phalcon/paginator/adapterinterface.zep.h | 26 +- ext/phalcon/paginator/factory.zep.c | 13 +- ext/phalcon/paginator/factory.zep.h | 6 +- ext/phalcon/queue/beanstalk.zep.c | 855 ++- ext/phalcon/queue/beanstalk.zep.h | 84 +- ext/phalcon/queue/beanstalk/job.zep.c | 204 +- ext/phalcon/queue/beanstalk/job.zep.h | 64 +- ext/phalcon/registry.zep.c | 182 +- ext/phalcon/registry.zep.h | 55 +- ext/phalcon/security.zep.c | 636 +- ext/phalcon/security.zep.h | 194 +- ext/phalcon/security/random.zep.c | 464 +- ext/phalcon/security/random.zep.h | 97 +- ext/phalcon/session/adapter.zep.c | 347 +- ext/phalcon/session/adapter.zep.h | 126 +- .../session/adapter/libmemcached.zep.c | 284 +- .../session/adapter/libmemcached.zep.h | 57 +- ext/phalcon/session/adapter/memcache.zep.c | 238 +- ext/phalcon/session/adapter/memcache.zep.h | 59 +- ext/phalcon/session/adapter/redis.zep.c | 238 +- ext/phalcon/session/adapter/redis.zep.h | 55 +- ext/phalcon/session/adapterinterface.zep.h | 78 +- ext/phalcon/session/bag.zep.c | 346 +- ext/phalcon/session/bag.zep.h | 93 +- ext/phalcon/session/baginterface.zep.h | 36 +- ext/phalcon/session/factory.zep.c | 13 +- ext/phalcon/session/factory.zep.h | 6 +- ext/phalcon/tag.zep.c | 2031 +++--- ext/phalcon/tag.zep.h | 368 +- ext/phalcon/tag/select.zep.c | 396 +- ext/phalcon/text.zep.c | 692 +- ext/phalcon/text.zep.h | 173 +- ext/phalcon/translate/adapter.zep.c | 127 +- ext/phalcon/translate/adapter.zep.h | 42 +- ext/phalcon/translate/adapter/csv.zep.c | 184 +- ext/phalcon/translate/adapter/csv.zep.h | 22 +- ext/phalcon/translate/adapter/gettext.zep.c | 325 +- ext/phalcon/translate/adapter/gettext.zep.h | 105 +- .../translate/adapter/nativearray.zep.c | 72 +- .../translate/adapter/nativearray.zep.h | 20 +- ext/phalcon/translate/adapterinterface.zep.h | 30 +- ext/phalcon/translate/factory.zep.c | 13 +- ext/phalcon/translate/factory.zep.h | 6 +- .../interpolator/associativearray.zep.c | 60 +- .../interpolator/associativearray.zep.h | 10 +- .../translate/interpolator/indexedarray.zep.c | 29 +- .../translate/interpolator/indexedarray.zep.h | 10 +- .../translate/interpolatorinterface.zep.h | 10 +- ext/phalcon/validation.zep.c | 890 +-- ext/phalcon/validation.zep.h | 94 +- ext/phalcon/validation/message.zep.c | 119 +- ext/phalcon/validation/message.zep.h | 90 +- ext/phalcon/validation/message/group.zep.c | 244 +- ext/phalcon/validation/message/group.zep.h | 54 +- ext/phalcon/validation/messageinterface.zep.h | 63 +- ext/phalcon/validation/validator.zep.c | 235 +- ext/phalcon/validation/validator.zep.h | 64 +- ext/phalcon/validation/validator/alnum.zep.c | 61 +- ext/phalcon/validation/validator/alnum.zep.h | 10 +- ext/phalcon/validation/validator/alpha.zep.c | 74 +- ext/phalcon/validation/validator/alpha.zep.h | 10 +- .../validation/validator/between.zep.c | 91 +- .../validation/validator/between.zep.h | 10 +- .../validation/validator/callback.zep.c | 80 +- .../validation/validator/callback.zep.h | 10 +- .../validation/validator/confirmation.zep.c | 149 +- .../validation/validator/confirmation.zep.h | 24 +- .../validation/validator/creditcard.zep.c | 133 +- .../validation/validator/creditcard.zep.h | 16 +- ext/phalcon/validation/validator/date.zep.c | 106 +- ext/phalcon/validation/validator/date.zep.h | 16 +- ext/phalcon/validation/validator/digit.zep.c | 63 +- ext/phalcon/validation/validator/digit.zep.h | 10 +- ext/phalcon/validation/validator/email.zep.c | 63 +- ext/phalcon/validation/validator/email.zep.h | 10 +- .../validation/validator/exclusionin.zep.c | 117 +- .../validation/validator/exclusionin.zep.h | 10 +- ext/phalcon/validation/validator/file.zep.c | 640 +- ext/phalcon/validation/validator/file.zep.h | 20 +- .../validation/validator/identical.zep.c | 114 +- .../validation/validator/identical.zep.h | 10 +- .../validation/validator/inclusionin.zep.c | 117 +- .../validation/validator/inclusionin.zep.h | 10 +- .../validation/validator/numericality.zep.c | 82 +- .../validation/validator/numericality.zep.h | 10 +- .../validation/validator/presenceof.zep.c | 60 +- .../validation/validator/presenceof.zep.h | 10 +- ext/phalcon/validation/validator/regex.zep.c | 88 +- ext/phalcon/validation/validator/regex.zep.h | 10 +- .../validation/validator/stringlength.zep.c | 165 +- .../validation/validator/stringlength.zep.h | 10 +- .../validation/validator/uniqueness.zep.c | 882 +-- .../validation/validator/uniqueness.zep.h | 22 +- ext/phalcon/validation/validator/url.zep.c | 63 +- ext/phalcon/validation/validator/url.zep.h | 10 +- .../validation/validatorinterface.zep.h | 24 +- ext/phalcon/validationinterface.zep.h | 79 +- ext/phalcon/version.zep.c | 181 +- ext/phalcon/version.zep.h | 47 +- ext/php_phalcon.h | 11 +- 636 files changed, 86940 insertions(+), 55066 deletions(-) delete mode 100644 ext/kernel/extended/fcall.c delete mode 100644 ext/kernel/extended/fcall.h delete mode 100644 ext/kernel/output.c delete mode 100644 ext/kernel/output.h delete mode 100644 ext/kernel/session.c delete mode 100644 ext/kernel/session.h diff --git a/ext/config.m4 b/ext/config.m4 index 6a994fd85d8..e3447853684 100644 --- a/ext/config.m4 +++ b/ext/config.m4 @@ -9,7 +9,7 @@ if test "$PHP_PHALCON" = "yes"; then fi AC_DEFINE(HAVE_PHALCON, 1, [Whether you have Phalcon]) - phalcon_sources="phalcon.c kernel/main.c kernel/memory.c kernel/exception.c kernel/debug.c kernel/backtrace.c kernel/object.c kernel/array.c kernel/string.c kernel/fcall.c kernel/extended/fcall.c kernel/require.c kernel/file.c kernel/operators.c kernel/math.c kernel/concat.c kernel/variables.c kernel/filter.c kernel/iterator.c kernel/time.c kernel/exit.c phalcon/di/injectionawareinterface.zep.c + phalcon_sources="phalcon.c kernel/main.c kernel/memory.c kernel/exception.c kernel/debug.c kernel/backtrace.c kernel/object.c kernel/array.c kernel/string.c kernel/fcall.c kernel/require.c kernel/file.c kernel/operators.c kernel/math.c kernel/concat.c kernel/variables.c kernel/filter.c kernel/iterator.c kernel/time.c kernel/exit.c phalcon/di/injectionawareinterface.zep.c phalcon/exception.zep.c phalcon/events/eventsawareinterface.zep.c phalcon/validation/validatorinterface.zep.c diff --git a/ext/config.w32 b/ext/config.w32 index 0858e75ed8d..64811423bed 100644 --- a/ext/config.w32 +++ b/ext/config.w32 @@ -3,7 +3,6 @@ ARG_ENABLE("phalcon", "enable phalcon", "no"); if (PHP_PHALCON != "no") { EXTENSION("phalcon", "phalcon.c", null, "-I"+configure_module_dirname); ADD_SOURCES(configure_module_dirname + "/kernel", "main.c memory.c exception.c debug.c backtrace.c object.c array.c string.c fcall.c require.c file.c operators.c math.c concat.c variables.c filter.c iterator.c exit.c time.c", "phalcon"); - ADD_SOURCES(configure_module_dirname + "/kernel/extended", "fcall.c", "phalcon"); /* PCRE is always included on WIN32 */ AC_DEFINE("ZEPHIR_USE_PHP_PCRE", 1, "Whether PHP pcre extension is present at compile time"); if (PHP_JSON != "no") { diff --git a/ext/configure.ac b/ext/configure.ac index 1094e2812c8..8496518c758 100644 --- a/ext/configure.ac +++ b/ext/configure.ac @@ -6,7 +6,7 @@ ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], []) PHP_CONFIG_NICE(config.nice) -dnl +dnl AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl AC_DEFUN([PHP_EXT_DIR],[""])dnl AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl @@ -45,7 +45,7 @@ phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null` INCLUDES=`$PHP_CONFIG --includes 2>/dev/null` EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null` PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null` - + if test -z "$prefix"; then AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH]) fi @@ -195,7 +195,6 @@ PHP_GEN_BUILD_DIRS PHP_GEN_GLOBAL_MAKEFILE test -d modules || $php_shtool mkdir modules -touch .deps AC_CONFIG_HEADER(config.h) diff --git a/ext/install b/ext/install index 06248ad4f5a..611306b4b69 100755 --- a/ext/install +++ b/ext/install @@ -3,7 +3,7 @@ export CC="gcc" export CFLAGS="-O2 -Wall -fvisibility=hidden -flto -DZEPHIR_RELEASE=1" -phpize_bin=$(which phpize 2> /dev/null || which phpize5 2> /dev/null) +phpize_bin=$(which phpize 2> /dev/null) if [ -z $(which sudo 2> /dev/null) ]; then alias sudo="" diff --git a/ext/kernel/array.c b/ext/kernel/array.c index 6acef72e1cf..707f62765e3 100644 --- a/ext/kernel/array.c +++ b/ext/kernel/array.c @@ -34,154 +34,160 @@ #include "kernel/operators.h" #include "kernel/backtrace.h" -static zval zephir_get_current_key_w(const HashTable *hash_table, HashPosition *hash_position) +void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, uint size, int initialize) { - Bucket *p; - zval result; - - INIT_ZVAL(result); - p = hash_position ? (*hash_position) : hash_table->pInternalPointer; + uint i; + zval null_value; + HashTable *hashTable; + ZVAL_NULL(&null_value); - if (p) { - if (p->nKeyLength) { - ZVAL_STRINGL(&result, (char *) p->arKey, p->nKeyLength - 1, 0); - } else { - ZVAL_LONG(&result, p->h); + array_init_size(return_value, size); + hashTable = Z_ARRVAL_P(return_value); + if (size > 0) { + zend_hash_real_init(hashTable, 0); + if (initialize) { + for (i = 0; i < size; i++) { + zend_hash_next_index_insert(hashTable, &null_value); + } } } - - return result; } /** - * @brief Fetches @a index if it exists from the array @a arr - * @param[out] fetched &$arr[$index]; @a fetched is modified only when the function returns 1 - * @param arr Array - * @param index Index - * @return isset($arr[$index]) - * @retval 0 Not exists, @a arr is not an array or @a index is of not supported type - * @retval 1 Exists - * @note @c index will be handled as follows: @c NULL is treated as an empty string, @c double values are cast to @c integer, @c bool or @c resource are treated as @c integer - * @note $arr[$index] is returned as is: no copying occurs, reference copunt is not updated - * @throw E_WARNING if @a offset is not a scalar - */ -int zephir_array_isset_fetch(zval **fetched, const zval *arr, zval *index, int readonly TSRMLS_DC) { + * Simple convenience function which ensures that you are dealing with an array and you can + * eliminate noise from your code. + * + * It's a bit strange but the refcount for an empty array is always zero somehow. + * There is another strange phenomenon: these zvals does not have any type_flag value. + * Thus we should recreate a new empty array so that it has correct refcount + * value and type_flag. This magic behavior was introduced since PHP 7.3. + * + * Steps to reproduce: + * + * Userland: + * $object->method([10 => []]); + * + * Zephir: + * public function method(array p) + * { + * let p[10]["str"] = "foo"; + * } + */ +void +ZEPHIR_FASTCALL zephir_ensure_array(zval *zv) +{ + if ( + Z_TYPE_P(zv) == IS_ARRAY && + zend_hash_num_elements(Z_ARRVAL_P(zv)) == 0 && + (!Z_REFCOUNTED_P(zv) || Z_REFCOUNT_P(zv) < 1) + ) { + zephir_create_array(zv, 0, 0); + } +} +int zephir_array_isset_fetch(zval *fetched, const zval *arr, zval *index, int readonly) +{ HashTable *h; - zval **val; - int result; + zval *result; + + if (UNEXPECTED(Z_TYPE_P(arr) != IS_ARRAY)) { + ZVAL_NULL(fetched); - if (Z_TYPE_P(arr) != IS_ARRAY) { - *fetched = ZEPHIR_GLOBAL(global_null); - if (!readonly) { - Z_ADDREF_P(*fetched); - } return 0; } h = Z_ARRVAL_P(arr); switch (Z_TYPE_P(index)) { case IS_NULL: - result = zend_hash_find(h, SS(""), (void**)&val); + result = zend_hash_str_find(h, SL("")); break; case IS_DOUBLE: - result = zend_hash_index_find(h, (ulong)Z_DVAL_P(index), (void**)&val); + result = zend_hash_index_find(h, (ulong)Z_DVAL_P(index)); break; case IS_LONG: - case IS_BOOL: case IS_RESOURCE: - result = zend_hash_index_find(h, Z_LVAL_P(index), (void**)&val); + result = zend_hash_index_find(h, Z_LVAL_P(index)); + break; + + case IS_TRUE: + case IS_FALSE: + result = zend_hash_index_find(h, Z_TYPE_P(index) == IS_TRUE ? 1 : 0); break; case IS_STRING: - result = zend_symtable_find(h, (Z_STRLEN_P(index) ? Z_STRVAL_P(index) : ""), Z_STRLEN_P(index)+1, (void**)&val); + result = zend_symtable_str_find(h, (Z_STRLEN_P(index) ? Z_STRVAL_P(index) : ""), Z_STRLEN_P(index)); break; default: - zend_error(E_WARNING, "Illegal offset type"); - *fetched = ZEPHIR_GLOBAL(global_null); - if (!readonly) { - Z_ADDREF_P(*fetched); - } + zend_error(E_WARNING, "Illegal offset type %d", Z_TYPE_P(index)); return 0; } - if (result == SUCCESS) { - *fetched = *val; + if (result != NULL) { + zephir_ensure_array(result); + if (!readonly) { - Z_ADDREF_P(*fetched); + ZVAL_COPY(fetched, result); + } else { + ZVAL_COPY_VALUE(fetched, result); } + return 1; } - *fetched = ZEPHIR_GLOBAL(global_null); - if (!readonly) { - Z_ADDREF_P(*fetched); - } + ZVAL_NULL(fetched); + return 0; } -int zephir_array_isset_quick_string_fetch(zval **fetched, zval *arr, char *index, uint index_length, unsigned long key, int readonly TSRMLS_DC) { - - zval **zv; +int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index, uint index_length, int readonly) +{ + zval *zv; if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) { - if (zend_hash_quick_find(Z_ARRVAL_P(arr), index, index_length, key, (void**) &zv) == SUCCESS) { - *fetched = *zv; + if ((zv = zend_hash_str_find(Z_ARRVAL_P(arr), index, index_length)) != NULL) { + zephir_ensure_array(zv); + if (!readonly) { - Z_ADDREF_P(*fetched); + ZVAL_COPY(fetched, zv); + } else { + ZVAL_COPY_VALUE(fetched, zv); } return 1; } } - *fetched = ZEPHIR_GLOBAL(global_null); - if (!readonly) { - Z_ADDREF_P(*fetched); - } - return 0; -} + ZVAL_NULL(fetched); -int zephir_array_isset_string_fetch(zval **fetched, zval *arr, char *index, uint index_length, int readonly TSRMLS_DC) { - - return zephir_array_isset_quick_string_fetch(fetched, arr, index, index_length, zend_inline_hash_func(index, index_length), readonly TSRMLS_CC); + return 0; } -int zephir_array_isset_long_fetch(zval **fetched, zval *arr, unsigned long index, int readonly TSRMLS_DC) { - - zval **zv; +int zephir_array_isset_long_fetch(zval *fetched, const zval *arr, unsigned long index, int readonly) +{ + zval *zv; if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) { - if (zend_hash_index_find(Z_ARRVAL_P(arr), index, (void**)&zv) == SUCCESS) { - *fetched = *zv; + if ((zv = zend_hash_index_find(Z_ARRVAL_P(arr), index)) != NULL) { + zephir_ensure_array(zv); + if (!readonly) { - Z_ADDREF_P(*fetched); + ZVAL_COPY(fetched, zv); + } else { + ZVAL_COPY_VALUE(fetched, zv); } return 1; } } - *fetched = ZEPHIR_GLOBAL(global_null); - if (!readonly) { - Z_ADDREF_P(*fetched); - } + ZVAL_NULL(fetched); + return 0; } -/** - * @brief Checks whether @a index exists in array @a arr - * @param arr Array - * @param index Index - * @return isset($arr[$index]) - * @retval 0 Not exists, @a arr is not an array or @a index is of not supported type - * @retval 1 Exists - * @note @c index will be handled as follows: @c NULL is treated as an empty string, @c double values are cast to @c integer, @c bool or @c resource are treated as @c integer - * @throw E_WARNING if @a offset is not a scalar - */ -int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index) { - +int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index) +{ HashTable *h; if (UNEXPECTED(!arr || Z_TYPE_P(arr) != IS_ARRAY)) { @@ -191,18 +197,21 @@ int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index) { h = Z_ARRVAL_P(arr); switch (Z_TYPE_P(index)) { case IS_NULL: - return zend_hash_exists(h, SS("")); + return zend_hash_str_exists(h, SL("")); case IS_DOUBLE: return zend_hash_index_exists(h, (ulong)Z_DVAL_P(index)); - case IS_BOOL: + case IS_TRUE: + case IS_FALSE: + return zend_hash_index_exists(h, Z_TYPE_P(index) == IS_TRUE ? 1 : 0); + case IS_LONG: case IS_RESOURCE: return zend_hash_index_exists(h, Z_LVAL_P(index)); case IS_STRING: - return zend_symtable_exists(h, Z_STRVAL_P(index), Z_STRLEN_P(index)+1); + return zend_symtable_str_exists(h, Z_STRVAL_P(index), Z_STRLEN_P(index)); default: zend_error(E_WARNING, "Illegal offset type"); @@ -210,51 +219,17 @@ int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index) { } } -/** - * @brief Checks whether string @a index exists in array @a arr - * @param arr Array - * @param index Index - * @param index_length strlen(index)+1 - * @return isset($arr[$index]) - * @retval 0 Not exists, @a arr is not an array - * @retval 1 Exists - * @note The function is a wrapper around zephir_array_isset_quick_string() - * @see zephir_array_isset_quick_string() - */ -int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index, uint index_length) { - - return zephir_array_isset_quick_string(arr, index, index_length, zend_inline_hash_func(index, index_length)); -} - -/** - * @brief Checks whether string @a index exists in array @a arr using a precomputed key @a key - * @param arr Array - * @param index Index - * @param index_length strlen(index)+1 - * @param key Precomputed key - * @return isset($arr[$index]) - * @retval 0 Not exists or @a arr is not an array - * @retval 1 Exists - */ -int ZEPHIR_FASTCALL zephir_array_isset_quick_string(const zval *arr, const char *index, uint index_length, unsigned long key) { - +int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index, uint index_length) +{ if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) { - return zend_hash_quick_exists(Z_ARRVAL_P(arr), index, index_length, key); + return zend_hash_str_exists(Z_ARRVAL_P(arr), index, index_length); } return 0; } -/** - * @brief Checks whether numeric @a index exists in array @a arr using a precomputed key @a key - * @param arr Array - * @param index Index - * @return isset($arr[$index]) - * @retval 0 Not exists or @a arr is not an array - * @retval 1 Exists - */ -int ZEPHIR_FASTCALL zephir_array_isset_long(const zval *arr, unsigned long index) { - +int ZEPHIR_FASTCALL zephir_array_isset_long(const zval *arr, unsigned long index) +{ if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) { return zend_hash_index_exists(Z_ARRVAL_P(arr), index); } @@ -262,22 +237,11 @@ int ZEPHIR_FASTCALL zephir_array_isset_long(const zval *arr, unsigned long index return 0; } -/** - * @brief Unsets @a index from array @a arr - * @param[in,out] arr Array - * @param index Index - * @param flags Flags (@c PH_SEPARATE: separate array if its reference count is greater than 1; @c arr will contain the separated array) - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array or @a index is of not supported type - * @retval @c SUCCESS Success - * @note @c index will be handled as follows: @c NULL is treated as an empty string, @c double values are cast to @c integer, @c bool or @c resource are treated as @c integer - * @throw @c E_WARNING if @a offset is not a scalar - */ -int ZEPHIR_FASTCALL zephir_array_unset(zval **arr, zval *index, int flags) { - +int ZEPHIR_FASTCALL zephir_array_unset(zval *arr, zval *index, int flags) +{ HashTable *ht; - if (Z_TYPE_PP(arr) != IS_ARRAY) { + if (Z_TYPE_P(arr) != IS_ARRAY) { return FAILURE; } @@ -285,22 +249,27 @@ int ZEPHIR_FASTCALL zephir_array_unset(zval **arr, zval *index, int flags) { SEPARATE_ZVAL_IF_NOT_REF(arr); } - ht = Z_ARRVAL_PP(arr); + ht = Z_ARRVAL_P(arr); switch (Z_TYPE_P(index)) { case IS_NULL: - return (zend_hash_del(ht, "", 1) == SUCCESS); + return (zend_hash_str_del(ht, "", 1) == SUCCESS); case IS_DOUBLE: return (zend_hash_index_del(ht, (ulong)Z_DVAL_P(index)) == SUCCESS); + case IS_TRUE: + return (zend_hash_index_del(ht, 1) == SUCCESS); + + case IS_FALSE: + return (zend_hash_index_del(ht, 0) == SUCCESS); + case IS_LONG: - case IS_BOOL: case IS_RESOURCE: return (zend_hash_index_del(ht, Z_LVAL_P(index)) == SUCCESS); case IS_STRING: - return (zend_symtable_del(ht, Z_STRVAL_P(index), Z_STRLEN_P(index)+1) == SUCCESS); + return (zend_symtable_del(ht, Z_STR_P(index)) == SUCCESS); default: zend_error(E_WARNING, "Illegal offset type"); @@ -308,19 +277,9 @@ int ZEPHIR_FASTCALL zephir_array_unset(zval **arr, zval *index, int flags) { } } -/** - * @brief Unsets string @a index from array @a arr - * @param[in,out] arr Array - * @param index Index - * @param index_length strlen(index)+1 - * @param flags Flags (@c PH_SEPARATE: separate array if its reference count is greater than 1; @c arr will contain the separated array) - * @return Whether the operation succeeded - * @retval @c FAILURE Failure or @a arr is not an array - * @retval @c SUCCESS Success - */ -int ZEPHIR_FASTCALL zephir_array_unset_string(zval **arr, const char *index, uint index_length, int flags) { - - if (Z_TYPE_PP(arr) != IS_ARRAY) { +int ZEPHIR_FASTCALL zephir_array_unset_string(zval *arr, const char *index, uint index_length, int flags) +{ + if (Z_TYPE_P(arr) != IS_ARRAY) { return 0; } @@ -328,21 +287,12 @@ int ZEPHIR_FASTCALL zephir_array_unset_string(zval **arr, const char *index, uin SEPARATE_ZVAL_IF_NOT_REF(arr); } - return zend_hash_del(Z_ARRVAL_PP(arr), index, index_length); + return zend_hash_str_del(Z_ARRVAL_P(arr), index, index_length); } -/** - * @brief Unsets numeric @a index from array @a arr - * @param[in,out] arr Array - * @param index Index - * @param flags Flags (@c PH_SEPARATE: separate array if its reference count is greater than 1; @c arr will contain the separated array) - * @return Whether the operation succeeded - * @retval @c FAILURE Failure or @a arr is not an array - * @retval @c SUCCESS Success - */ -int ZEPHIR_FASTCALL zephir_array_unset_long(zval **arr, unsigned long index, int flags) { - - if (Z_TYPE_PP(arr) != IS_ARRAY) { +int ZEPHIR_FASTCALL zephir_array_unset_long(zval *arr, unsigned long index, int flags) +{ + if (Z_TYPE_P(arr) != IS_ARRAY) { return 0; } @@ -350,474 +300,29 @@ int ZEPHIR_FASTCALL zephir_array_unset_long(zval **arr, unsigned long index, int SEPARATE_ZVAL_IF_NOT_REF(arr); } - return zend_hash_index_del(Z_ARRVAL_PP(arr), index); -} - -/** - * @brief Pushes @a value onto the end of @a arr - * @param[in,out] arr Array - * @param[in,out] value Value to add; reference counter of @c *value will be incrememnted - * @param flags Flags (@c PH_SEPARATE: separate array if its reference count is greater than 1; @c arr will contain the separated array) - * @return Whether the operation succeeded - * @retval @c FAILURE Failure or @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a is not an array - */ -int zephir_array_append(zval **arr, zval *value, int flags ZEPHIR_DEBUG_PARAMS) { - - if (Z_TYPE_PP(arr) != IS_ARRAY) { - zend_error(E_WARNING, "Cannot use a scalar value as an array in %s on line %d", file, line); - return FAILURE; - } - - if ((flags & PH_SEPARATE) == PH_SEPARATE) { - SEPARATE_ZVAL_IF_NOT_REF(arr); - } - - Z_ADDREF_P(value); - return add_next_index_zval(*arr, value); -} - -/** - * @brief Appends a long integer @a value to @a arr - * @param[in,out] arr Array - * @param value Value - * @param separate Flags (@c PH_SEPARATE: separate array if its reference count is greater than 1; @c arr will contain the separated array) - * @return Whether the operation succeeded - * @retval @c FAILURE Failure or @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a is not an array - * @see zephir_array_append() - * - * Equivalent to $arr[] = $value in PHP, where @c $value is an integer. - */ -int zephir_array_append_long(zval **arr, long value, int separate) { - - zval *zvalue; - - ALLOC_INIT_ZVAL(zvalue); - Z_SET_REFCOUNT_P(zvalue, 0); - ZVAL_LONG(zvalue, value); - - return zephir_array_append(arr, zvalue, separate ZEPHIR_DEBUG_PARAMS_DUMMY); -} - -/** - * @brief Appends a string @a value to @a arr - * @param[in,out] arr Array - * @param value Value - * @param value_length Length of the value (usually strlen(value)) - * @param separate Flags (@c PH_SEPARATE: separate array if its reference count is greater than 1; @c arr will contain the separated array) - * @return Whether the operation succeeded - * @retval @c FAILURE Failure or @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a is not an array - * @see zephir_array_append() - * - * Equivalent to $arr[] = $value in PHP, where @c $value is a string. - */ -int zephir_array_append_string(zval **arr, char *value, uint value_length, int separate) { - - zval *zvalue; - - ALLOC_INIT_ZVAL(zvalue); - Z_SET_REFCOUNT_P(zvalue, 0); - ZVAL_STRINGL(zvalue, value, value_length, 1); - - return zephir_array_append(arr, zvalue, separate ZEPHIR_DEBUG_PARAMS_DUMMY); -} - -/** - * @brief Updates value in @a arr at position @a index with @a value - * @param[in,out] arr Array - * @param index Index - * @param[in,out] value Value - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array or @a index is of not supported type - * @retval @c SUCCESS Success - * @note @c index will be handled as follows: @c NULL is treated as an empty string, @c double values are cast to @c integer, @c bool or @c resource are treated as @c integer - * @throw @c E_WARNING if @a offset is not a scalar or @c arr is not an array - * - * Equivalent to $arr[$index] = $value in PHP. - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy; @c *value will be updated with the newly constructed value - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on @c **value - */ -int zephir_array_update_zval(zval **arr, zval *index, zval **value, int flags) { - - HashTable *ht; - - if (Z_TYPE_PP(arr) != IS_ARRAY) { - zend_error(E_WARNING, "Cannot use a scalar value as an array (2)"); - return FAILURE; - } - - if ((flags & PH_CTOR) == PH_CTOR) { - zval *new_zv; - Z_DELREF_PP(value); - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, *value); - *value = new_zv; - zval_copy_ctor(new_zv); - } - - if ((flags & PH_SEPARATE) == PH_SEPARATE) { - SEPARATE_ZVAL_IF_NOT_REF(arr); - } - - if ((flags & PH_COPY) == PH_COPY) { - Z_ADDREF_PP(value); - } - - ht = Z_ARRVAL_PP(arr); - - switch (Z_TYPE_P(index)) { - case IS_NULL: - return zend_symtable_update(ht, "", 1, value, sizeof(zval*), NULL); - - case IS_DOUBLE: - return zend_hash_index_update(ht, (ulong)Z_DVAL_P(index), value, sizeof(zval*), NULL); - - case IS_LONG: - case IS_BOOL: - case IS_RESOURCE: - return zend_hash_index_update(ht, Z_LVAL_P(index), value, sizeof(zval*), NULL); - - case IS_STRING: - return zend_symtable_update(ht, Z_STRVAL_P(index), Z_STRLEN_P(index)+1, value, sizeof(zval*), NULL); - - default: - zend_error(E_WARNING, "Illegal offset type"); - return FAILURE; - } -} - -/** - * @brief Updates value in @a arr at position @a index with boolean @a value - * @param[in,out] arr Array - * @param index Index - * @param value Value - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array or @a index is of not supported type - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a arr is not an array - * @see zephir_array_update_zval() - * - * Equivalent to $arr[$index] = $value in PHP, where @c $value is a boolean. - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on the internally constructed value - * - * Only @c PH_SEPARATE is meaningful with this function - */ -int zephir_array_update_zval_bool(zval **arr, zval *index, int value, int flags) { - - zval *zvalue; - - ALLOC_INIT_ZVAL(zvalue); - ZVAL_BOOL(zvalue, value); - - return zephir_array_update_zval(arr, index, &zvalue, flags); -} - -/** - * @brief Updates value in @a arr at position @a index with boolean @a value - * @param[in,out] arr Array - * @param index Index - * @param value Value - * @param value_length Length of value (usually strlen(value)) - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array or @a index is of not supported type - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a arr is not an array - * @see zephir_array_update_zval() - * - * Equivalent to $arr[$index] = $value in PHP, where @c $value is a string. - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on the internally constructed value - * - * Only @c PH_SEPARATE is meaningful with this function - */ -int zephir_array_update_zval_string(zval **arr, zval *index, char *value, uint value_length, int flags) { - - zval *zvalue; - - ALLOC_INIT_ZVAL(zvalue); - ZVAL_STRINGL(zvalue, value, value_length, 1); - - return zephir_array_update_zval(arr, index, &zvalue, flags); + return zend_hash_index_del(Z_ARRVAL_P(arr), index); } -/** - * @brief Updates value in @a arr at position @a index with long integer @a value - * @param[in,out] arr Array - * @param index Index - * @param value Value - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array or @a index is of not supported type - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a arr is not an array - * @see zephir_array_update_zval() - * - * Equivalent to $arr[$index] = $value in PHP, where @c $value is an integer. - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on the internally constructed value - * - * Only @c PH_SEPARATE is meaningful with this function. - */ -int zephir_array_update_zval_long(zval **arr, zval *index, long value, int flags) { - - zval *zvalue; - - ALLOC_INIT_ZVAL(zvalue); - ZVAL_LONG(zvalue, value); - - return zephir_array_update_zval(arr, index, &zvalue, flags); -} - -/** - * @brief Updates value in @a arr at position @a index with @a value using the precomputed hash @a key - * @param[in,out] arr Array - * @param index Index - * @param index_length Length of the index, should include the trailing zero - * @param key Precomputed hash of @c value - * @param value Value - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a arr is not an array - * - * Equivalent to $arr[$index] = $value in PHP. - * - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy; @c *value will be updated with the newly constructed value - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on @c **value - */ -int zephir_array_update_quick_string(zval **arr, const char *index, uint index_length, unsigned long key, zval **value, int flags){ - - if (Z_TYPE_PP(arr) != IS_ARRAY) { - zend_error(E_WARNING, "Cannot use a scalar value as an array (3)"); - return FAILURE; - } - - if ((flags & PH_CTOR) == PH_CTOR) { - zval *new_zv; - Z_DELREF_PP(value); - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, *value); - *value = new_zv; - zval_copy_ctor(new_zv); - } - - if ((flags & PH_SEPARATE) == PH_SEPARATE) { - SEPARATE_ZVAL_IF_NOT_REF(arr); - } - - if ((flags & PH_COPY) == PH_COPY) { - Z_ADDREF_PP(value); - } - - return zend_hash_quick_update(Z_ARRVAL_PP(arr), index, index_length, key, value, sizeof(zval *), NULL); -} - -/** - * @brief Updates value in @a arr at position @a index with @a value - * @param[in,out] arr Array - * @param index Index - * @param index_length Length of the index, should include the trailing zero - * @param value Value - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a arr is not an array - * @see zephir_array_update_quick_string() - * - * The function is a wrapper over @c zephir_array_update_quick_string() - * - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy; @c *value will be updated with the newly constructed value - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on @c **value - */ -int zephir_array_update_string(zval **arr, const char *index, uint index_length, zval **value, int flags) { - - return zephir_array_update_quick_string(arr, index, index_length + 1, zend_inline_hash_func(index, index_length + 1), value, flags); -} - -/** - * @brief Updates value in @a arr at position @a index with boolean @a value - * @param[in,out] arr Array - * @param index Index - * @param index_length Length of the index, should include the trailing zero - * @param value Value - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a arr is not an array - * @see zephir_array_update_string() - * - * Equivalent to $arr[$index] = $value in PHP, where @c $index is a string key and $value is a boolean. - * - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on the internally constructed value - * - * Only @c PH_SEPARATE is meaningful with this function. - */ -int zephir_array_update_string_bool(zval **arr, const char *index, uint index_length, int value, int flags){ - - zval *zvalue; - - ALLOC_INIT_ZVAL(zvalue); - ZVAL_BOOL(zvalue, value); - - return zephir_array_update_string(arr, index, index_length, &zvalue, flags); -} - -/** - * @brief Updates value in @a arr at position @a index with integer @a value - * @param[in,out] arr Array - * @param index Index - * @param index_length Length of the index, should include the trailing zero - * @param value Value - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a arr is not an array - * @see zephir_array_update_string() - * - * Equivalent to $arr[$index] = $value in PHP, where @c $index is a string key and $value is an integer. - * - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on the internally constructed value - * - * Only @c PH_SEPARATE is meaningful with this function. - */ -int zephir_array_update_string_long(zval **arr, const char *index, uint index_length, long value, int flags){ - - zval *zvalue; - - ALLOC_INIT_ZVAL(zvalue); - ZVAL_LONG(zvalue, value); - - return zephir_array_update_string(arr, index, index_length, &zvalue, flags); -} - -/** - * @brief Updates value in @a arr at position @a index with string @a value - * @param[in,out] arr Array - * @param index Index - * @param index_length Length of the index, should include the trailing zero - * @param value Value - * @param value_length Length of the @a value; usually @c strlen() - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @a arr is not an array - * @see zephir_array_update_string() - * - * Equivalent to $arr[$index] = $value in PHP, where @c $index is a string key and $value is a boolean. - * - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on the internally constructed value - * - * Only @c PH_SEPARATE is meaningful with this function. - */ -int zephir_array_update_string_string(zval **arr, const char *index, uint index_length, char *value, uint value_length, int flags){ - - zval *zvalue; - - ALLOC_INIT_ZVAL(zvalue); - ZVAL_STRINGL(zvalue, value, value_length, 1); - - return zephir_array_update_string(arr, index, index_length, &zvalue, flags); -} - -/** - * @brief Updates value in @a arr at position @a index with @a value - * @param[in,out] arr Array - * @param index Index - * @param[in,out] value Value - * @param flags Flags - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @c arr is not an array - * - * Equivalent to $arr[$index] = $value in PHP where @c $index is an integer. - * Flags may be a bitwise OR of the following values: - * @arg @c PH_CTOR: create a copy of @a value and work with that copy; @c *value will be updated with the newly constructed value - * @arg @c PH_SEPARATE: separate @a arr if its reference count is greater than 1; @c *arr will contain the separated version - * @arg @c PH_COPY: increment the reference count on @c **value - */ -int zephir_array_update_long(zval **arr, unsigned long index, zval **value, int flags ZEPHIR_DEBUG_PARAMS){ - - if (Z_TYPE_PP(arr) != IS_ARRAY) { +int zephir_array_append(zval *arr, zval *value, int flags ZEPHIR_DEBUG_PARAMS) +{ + 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; } - if ((flags & PH_CTOR) == PH_CTOR) { - zval *new_zv; - Z_DELREF_PP(value); - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, *value); - *value = new_zv; - zval_copy_ctor(new_zv); - } - if ((flags & PH_SEPARATE) == PH_SEPARATE) { SEPARATE_ZVAL_IF_NOT_REF(arr); } - if ((flags & PH_COPY) == PH_COPY) { - Z_ADDREF_PP(value); - } - - return zend_hash_index_update(Z_ARRVAL_PP(arr), index, value, sizeof(zval *), NULL); + Z_TRY_ADDREF_P(value); + return add_next_index_zval(arr, value); } -/** - * @brief Reads an item from @a arr at position @a index and stores it to @a return_value - * @param return_value[out] Return value - * @param arr Array - * @param index Index - * @param silent 0 to suppress all warnings, @c PH_NOISY to enable - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @c arr is not an array and @c silent = @c PH_NOISY - * @throw @c E_WARNING if @c index is not of the supported type and @c silent = @c PH_NOISY - * @throw @c E_NOTICE if @c index does not exist and @c silent = @c PH_NOISY - * @warning @c *return_value should be either @c NULL (preferred) or point to not initialized memory; if @c *return_value points to a valid variable, mmemory leak is possible - * @note @c index will be handled as follows: @c NULL is treated as an empty string, @c double values are cast to @c integer, @c bool or @c resource are treated as @c integer - */ -int zephir_array_fetch(zval **return_value, zval *arr, zval *index, int flags ZEPHIR_DEBUG_PARAMS TSRMLS_DC){ - - zval **zv; +int zephir_array_fetch(zval *return_value, zval *arr, zval *index, int flags ZEPHIR_DEBUG_PARAMS) +{ + zval *zv; HashTable *ht; - int result; + int result = SUCCESS, found = 0; ulong uidx = 0; char *sidx = NULL; @@ -825,25 +330,34 @@ int zephir_array_fetch(zval **return_value, zval *arr, zval *index, int flags ZE ht = Z_ARRVAL_P(arr); switch (Z_TYPE_P(index)) { case IS_NULL: - result = zend_hash_find(ht, SS(""), (void**) &zv); + found = (zv = zend_hash_str_find(ht, SL(""))) != NULL; sidx = ""; break; case IS_DOUBLE: uidx = (ulong)Z_DVAL_P(index); - result = zend_hash_index_find(ht, uidx, (void**) &zv); + found = (zv = zend_hash_index_find(ht, uidx)) != NULL; break; case IS_LONG: - case IS_BOOL: case IS_RESOURCE: uidx = Z_LVAL_P(index); - result = zend_hash_index_find(ht, uidx, (void**) &zv); + found = (zv = zend_hash_index_find(ht, uidx)) != NULL; + break; + + case IS_FALSE: + uidx = 0; + found = (zv = zend_hash_index_find(ht, uidx)) != NULL; + break; + + case IS_TRUE: + uidx = 1; + found = (zv = zend_hash_index_find(ht, uidx)) != NULL; break; case IS_STRING: sidx = Z_STRLEN_P(index) ? Z_STRVAL_P(index) : ""; - result = zend_symtable_find(ht, Z_STRVAL_P(index), Z_STRLEN_P(index)+1, (void**) &zv); + found = (zv = zend_symtable_str_find(ht, Z_STRVAL_P(index), Z_STRLEN_P(index))) != NULL; break; default: @@ -854,10 +368,11 @@ int zephir_array_fetch(zval **return_value, zval *arr, zval *index, int flags ZE break; } - if (result != FAILURE) { - *return_value = *zv; - if ((flags & PH_READONLY) != PH_READONLY) { - Z_ADDREF_PP(return_value); + if (result != FAILURE && found == 1) { + if ((flags & PH_READONLY) == PH_READONLY) { + ZVAL_COPY_VALUE(return_value, zv); + } else { + ZVAL_COPY(return_value, zv); } return SUCCESS; } @@ -871,37 +386,21 @@ int zephir_array_fetch(zval **return_value, zval *arr, zval *index, int flags ZE } } - *return_value = ZEPHIR_GLOBAL(global_null); - if ((flags & PH_READONLY) != PH_READONLY) { - Z_ADDREF_PP(return_value); - } + ZVAL_NULL(return_value); return FAILURE; } -/** - * @brief Reads an item from @a arr at position @a index using the precomputed hash @c key and stores it to @a return_value - * @param return_value[out] Return value - * @param arr Array - * @param index Index - * @param index Index length; must contain the trailing zero, if any - * @param key Precomputed hash of @c index - * @param silent 0 to suppress all warnings, @c PH_NOISY to enable - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @c arr is not an array and @c silent = @c PH_NOISY - * @throw @c E_NOTICE if @c index does not exist and @c silent = @c PH_NOISY - * @warning @c *return_value should be either @c NULL (preferred) or point to not initialized memory; if @c *return_value points to a valid variable, mmemory leak is possible - */ -int zephir_array_fetch_quick_string(zval **return_value, zval *arr, const char *index, uint index_length, unsigned long key, int flags ZEPHIR_DEBUG_PARAMS TSRMLS_DC){ - - zval **zv; +int zephir_array_fetch_string(zval *return_value, zval *arr, const char *index, uint index_length, int flags ZEPHIR_DEBUG_PARAMS) +{ + zval *zv; if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) { - if (zend_hash_quick_find(Z_ARRVAL_P(arr), index, index_length, key, (void**) &zv) == SUCCESS) { - *return_value = *zv; - if ((flags & PH_READONLY) != PH_READONLY) { - Z_ADDREF_PP(return_value); + if ((zv = zend_hash_str_find(Z_ARRVAL_P(arr), index, index_length)) != NULL) { + + if ((flags & PH_READONLY) == PH_READONLY) { + ZVAL_COPY_VALUE(return_value, zv); + } else { + ZVAL_COPY(return_value, zv); } return SUCCESS; } @@ -914,75 +413,44 @@ int zephir_array_fetch_quick_string(zval **return_value, zval *arr, const char * } } - *return_value = ZEPHIR_GLOBAL(global_null); - if ((flags & PH_READONLY) != PH_READONLY) { - Z_ADDREF_PP(return_value); + if (return_value == NULL) { + zend_error(E_ERROR, "No return value passed to zephir_array_fetch_string"); + return FAILURE; } - return FAILURE; -} - -/** - * @brief Reads an item from @a arr at position @a index and stores it to @a return_value - * @param return_value[out] Return value - * @param arr Array - * @param index Index - * @param index Index length; must contain the trailing zero, if any - * @param silent 0 to suppress all warnings, @c PH_NOISY to enable - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @c arr is not an array and @c silent = @c PH_NOISY - * @throw @c E_NOTICE if @c index does not exist and @c silent = @c PH_NOISY - * @warning @c *return_value should be either @c NULL (preferred) or point to not initialized memory; if @c *return_value points to a valid variable, mmemory leak is possible - * @see zephir_array_fetch_quick_string() - * - * The function is a wrapper over @c zephir_array_fetch_quick_string() - */ -int zephir_array_fetch_string(zval **return_value, zval *arr, const char *index, uint index_length, int flags ZEPHIR_DEBUG_PARAMS TSRMLS_DC){ - return zephir_array_fetch_quick_string(return_value, arr, index, index_length + 1, zend_inline_hash_func(index, index_length + 1), flags, file, line TSRMLS_CC); + ZVAL_NULL(return_value); + return FAILURE; } -/** - * @brief Reads an item from @a arr at position @a index and stores it to @a return_value - * @param return_value[out] Return value - * @param arr Array - * @param index Index - * @param silent 0 to suppress all warnings, @c PH_NOISY to enable - * @return Whether the operation succeeded - * @retval @c FAILURE Failure, @a arr is not an array - * @retval @c SUCCESS Success - * @throw @c E_WARNING if @c arr is not an array and @c silent = @c PH_NOISY - * @throw @c E_NOTICE if @c index does not exist and @c silent = @c PH_NOISY - * @warning @c *return_value should be either @c NULL (preferred) or point to not initialized memory; if @c *return_value points to a valid variable, mmemory leak is possible - */ -int zephir_array_fetch_long(zval **return_value, zval *arr, unsigned long index, int flags ZEPHIR_DEBUG_PARAMS TSRMLS_DC){ - - zval **zv; +int zephir_array_fetch_long(zval *return_value, zval *arr, unsigned long index, int flags ZEPHIR_DEBUG_PARAMS) +{ + zval *zv; if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) { - if (zend_hash_index_find(Z_ARRVAL_P(arr), index, (void**)&zv) == SUCCESS) { - *return_value = *zv; - if ((flags & PH_READONLY) != PH_READONLY) { - Z_ADDREF_PP(return_value); + if ((zv = zend_hash_index_find(Z_ARRVAL_P(arr), index)) != NULL) { + + if ((flags & PH_READONLY) == PH_READONLY) { + ZVAL_COPY_VALUE(return_value, zv); + } else { + ZVAL_COPY(return_value, zv); } return SUCCESS; } - if ((flags & PH_NOISY) == PH_NOISY) { - zend_error(E_NOTICE, "Undefined index: %lu in %s on line %d", index, file, line); + zend_error(E_NOTICE, "Undefined index: %lu", index); } - } - else { + } else { if ((flags & PH_NOISY) == PH_NOISY) { zend_error(E_NOTICE, "Cannot use a scalar value as an array in %s on line %d", file, line); } } - *return_value = ZEPHIR_GLOBAL(global_null); - if ((flags & PH_READONLY) != PH_READONLY) { - Z_ADDREF_PP(return_value); + if (return_value == NULL) { + zend_error(E_ERROR, "No return value passed to zephir_array_fetch_string"); + return FAILURE; } + + ZVAL_NULL(return_value); return FAILURE; } @@ -991,10 +459,7 @@ int zephir_array_fetch_long(zval **return_value, zval *arr, unsigned long index, */ void zephir_merge_append(zval *left, zval *values) { - - zval **tmp; - HashTable *arr_values; - HashPosition pos; + zval *tmp; if (Z_TYPE_P(left) != IS_ARRAY) { zend_error(E_NOTICE, "First parameter of zephir_merge_append must be an array"); @@ -1003,247 +468,165 @@ void zephir_merge_append(zval *left, zval *values) if (Z_TYPE_P(values) == IS_ARRAY) { - arr_values = Z_ARRVAL_P(values); - zend_hash_internal_pointer_reset_ex(arr_values, &pos); - - while (zend_hash_get_current_data_ex(arr_values, (void **) &tmp, &pos) == SUCCESS) { + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(values), tmp) { - Z_ADDREF_PP(tmp); - add_next_index_zval(left, *tmp); + Z_TRY_ADDREF_P(tmp); + add_next_index_zval(left, tmp); - zend_hash_move_forward_ex(arr_values, &pos); - } + } ZEND_HASH_FOREACH_END(); } else { - Z_ADDREF_P(values); + Z_TRY_ADDREF_P(values); add_next_index_zval(left, values); } } -/** - * Gets the current element in a zval hash - */ -void zephir_array_get_current(zval *return_value, zval *array){ +int zephir_array_update_zval(zval *arr, zval *index, zval *value, int flags) +{ + HashTable *ht; + zval *ret = NULL; - zval **entry; + if (Z_TYPE_P(arr) != IS_ARRAY) { + zend_error(E_WARNING, "Cannot use a scalar value as an array (2)"); + return FAILURE; + } - if (Z_TYPE_P(array) == IS_ARRAY) { - if (zend_hash_get_current_data(Z_ARRVAL_P(array), (void **) &entry) == FAILURE) { - RETURN_FALSE; - } - RETURN_ZVAL(*entry, 1, 0); + if ((flags & PH_CTOR) == PH_CTOR) { + zval new_zv; + //Z_TRY_DELREF_P(value); //? + ZVAL_DUP(&new_zv, value); + value = &new_zv; } - RETURN_FALSE; -} + if ((flags & PH_SEPARATE) == PH_SEPARATE) { + SEPARATE_ZVAL_IF_NOT_REF(arr); + } -/** - * Gets the current element in a zval hash - */ -void zephir_array_next(zval *array){ - if (Z_TYPE_P(array) == IS_ARRAY) { - zend_hash_move_forward(Z_ARRVAL_P(array)); + if ((flags & PH_COPY) == PH_COPY) { + Z_TRY_ADDREF_P(value); } -} -/** - * Fast in_array function - */ -int zephir_fast_in_array(zval *needle, zval *haystack TSRMLS_DC) { + ht = Z_ARRVAL_P(arr); - zval **tmp; - HashTable *arr; - HashPosition pos; - unsigned int numelems; + switch (Z_TYPE_P(index)) { + case IS_NULL: + ret = zend_symtable_str_update(ht, "", 1, value); + break; - if (Z_TYPE_P(haystack) != IS_ARRAY) { - return 0; - } + case IS_DOUBLE: + ret = zend_hash_index_update(ht, (ulong)Z_DVAL_P(index), value); + break; - arr = Z_ARRVAL_P(haystack); - numelems = zend_hash_num_elements(arr); + case IS_LONG: + case IS_RESOURCE: + ret = zend_hash_index_update(ht, Z_LVAL_P(index), value); + break; - if (numelems == 0) { - return 0; - } + case IS_TRUE: + case IS_FALSE: + ret = zend_hash_index_update(ht, Z_TYPE_P(index) == IS_TRUE ? 1 : 0, value); + break; - zend_hash_internal_pointer_reset_ex(arr, &pos); + case IS_STRING: + ret = zend_symtable_str_update(ht, Z_STRVAL_P(index), Z_STRLEN_P(index), value); + break; - while (zend_hash_get_current_data_ex(arr, (void **) &tmp, &pos) == SUCCESS) { - if (ZEPHIR_IS_EQUAL(needle, *tmp)) { - return 1; - } - zend_hash_move_forward_ex(arr, &pos); + default: + zend_error(E_WARNING, "Illegal offset type"); + return FAILURE; } - return 0; + return ret != NULL ? FAILURE : SUCCESS; } -/** - * Fast array merge - */ -void zephir_fast_array_merge(zval *return_value, zval **array1, zval **array2 TSRMLS_DC) { - - int init_size, num; +int zephir_array_update_string(zval *arr, const char *index, uint index_length, zval *value, int flags) +{ - if (Z_TYPE_PP(array1) != IS_ARRAY) { - zend_error(E_WARNING, "First argument is not an array"); - RETURN_NULL(); + if (Z_TYPE_P(arr) != IS_ARRAY) { + zend_error(E_WARNING, "Cannot use a scalar value as an array (3)"); + return FAILURE; } - if (Z_TYPE_PP(array2) != IS_ARRAY) { - zend_error(E_WARNING, "Second argument is not an array"); - RETURN_NULL(); - } + if ((flags & PH_CTOR) == PH_CTOR) { + zval new_value; - init_size = zend_hash_num_elements(Z_ARRVAL_PP(array1)); - num = zend_hash_num_elements(Z_ARRVAL_PP(array2)); - if (num > init_size) { - init_size = num; + ZVAL_DUP(&new_value, value); + value = &new_value; + } else if ((flags & PH_COPY) == PH_COPY) { + Z_TRY_ADDREF_P(value); } - array_init_size(return_value, init_size); - - php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(array1), 0 TSRMLS_CC); + if ((flags & PH_SEPARATE) == PH_SEPARATE) { + SEPARATE_ZVAL_IF_NOT_REF(arr); + } - php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(array2), 0 TSRMLS_CC); + return zend_hash_str_update(Z_ARRVAL_P(arr), index, index_length, value) ? SUCCESS : FAILURE; } -/** - * @brief Merge @a a1 and @a a2 recursively preserving all keys - * @warning Both @a a1 and @a a2 are assumed to be arrays, no checks are performed - * @param[in,out] a1 LHS operand - * @param a2 RHS operand - * - * Equivalent to $a1 = array_merge_recursive($a1, $a2) in PHP with the only exception - * that Phalcon's version preserves numeric keys - */ -void zephir_array_merge_recursive_n(zval **a1, zval *a2 TSRMLS_DC) +int zephir_array_update_long(zval *arr, unsigned long index, zval *value, int flags ZEPHIR_DEBUG_PARAMS) { - HashPosition hp; - zval **value, key, *tmp1, *tmp2; - - assert(Z_TYPE_PP(a1) == IS_ARRAY); - assert(Z_TYPE_P(a2) == IS_ARRAY); - - for ( - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(a2), &hp); - zend_hash_get_current_data_ex(Z_ARRVAL_P(a2), (void**) &value, &hp) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(a2), &hp) - ) { - key = zephir_get_current_key_w(Z_ARRVAL_P(a2), &hp); - - if (!zephir_array_isset(*a1, &key) || Z_TYPE_PP(value) != IS_ARRAY) { - zephir_array_update_zval(a1, &key, value, PH_COPY | PH_SEPARATE); - } else { - zephir_array_fetch(&tmp1, *a1, &key, PH_NOISY ZEPHIR_DEBUG_PARAMS_DUMMY TSRMLS_CC); - zephir_array_fetch(&tmp2, a2, &key, PH_NOISY ZEPHIR_DEBUG_PARAMS_DUMMY TSRMLS_CC); - zephir_array_merge_recursive_n(&tmp1, tmp2 TSRMLS_CC); - zval_ptr_dtor(&tmp1); - zval_ptr_dtor(&tmp2); - } + 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; } -} -/** - * @brief array_unshift($arr, $arg) - * @param arr - * @param arg - * @note Reference count of @c arg will be incremented - */ -void zephir_array_unshift(zval *arr, zval *arg TSRMLS_DC) -{ - if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) { - - zval** args[1] = { &arg }; - - #if PHP_VERSION_ID < 50600 - HashTable oldhash; - HashTable *newhash = Z_ARRVAL_P(arr); - newhash = php_splice(newhash, 0, 0, args, 1, NULL); + if ((flags & PH_CTOR) == PH_CTOR) { + zval new_value; - oldhash = *Z_ARRVAL_P(arr); - if (Z_ARRVAL_P(arr) == &EG(symbol_table)) { - zend_reset_all_cv(&EG(symbol_table) TSRMLS_CC); - } - *Z_ARRVAL_P(arr) = *newhash; + ZVAL_DUP(&new_value, value); + value = &new_value; + } else if ((flags & PH_COPY) == PH_COPY) { + Z_TRY_ADDREF_P(value); + } - FREE_HASHTABLE(newhash); - zend_hash_destroy(&oldhash); - #else - php_splice(Z_ARRVAL_P(arr), 0, 0, args, 1, NULL TSRMLS_CC); - #endif + if ((flags & PH_SEPARATE) == PH_SEPARATE) { + SEPARATE_ZVAL_IF_NOT_REF(arr); } + + return zend_hash_index_update(Z_ARRVAL_P(arr), index, value) ? SUCCESS : FAILURE; } -void zephir_array_keys(zval *return_value, zval *input TSRMLS_DC) +void zephir_array_keys(zval *return_value, zval *input) { - - zval *new_val, **entry; - char *string_key; - uint string_key_len; - ulong num_key; - HashPosition pos; + zval *entry, new_val; + zend_ulong num_idx; + zend_string *str_idx; if (EXPECTED(Z_TYPE_P(input) == IS_ARRAY)) { - array_init_size(return_value, zend_hash_num_elements(Z_ARRVAL_P(input))); - - /* Go through input array and add keys to the return array */ - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(input), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(input), (void **)&entry, &pos) == SUCCESS) { - - MAKE_STD_ZVAL(new_val); - - switch (zend_hash_get_current_key_ex(Z_ARRVAL_P(input), &string_key, &string_key_len, &num_key, 1, &pos)) { - case HASH_KEY_IS_STRING: - ZVAL_STRINGL(new_val, string_key, string_key_len - 1, 0); - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &new_val, sizeof(zval *), NULL); - break; - - case HASH_KEY_IS_LONG: - Z_TYPE_P(new_val) = IS_LONG; - Z_LVAL_P(new_val) = num_key; - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &new_val, sizeof(zval *), NULL); - break; - } - - zend_hash_move_forward_ex(Z_ARRVAL_P(input), &pos); - } + zend_hash_real_init(Z_ARRVAL_P(return_value), 1); + ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(return_value)) { + /* Go through input array and add keys to the return array */ + ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(input), num_idx, str_idx, entry) { + if (str_idx) { + ZVAL_STR_COPY(&new_val, str_idx); + } else { + ZVAL_LONG(&new_val, num_idx); + } + ZEND_HASH_FILL_ADD(&new_val); + } ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FILL_END(); } -} -void zephir_array_values(zval *return_value, zval *arr) -{ - if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) { - zval **entry; - HashPosition pos; - - array_init_size(return_value, zend_hash_num_elements(Z_ARRVAL_P(arr))); - for ( - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **)&entry, &pos) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos) - ) { - Z_ADDREF_PP(entry); - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), entry, sizeof(zval*), NULL); - } - } + entry = NULL; + str_idx = NULL; + num_idx = 0; + ZVAL_UNDEF(&new_val); } -int zephir_array_key_exists(zval *arr, zval *key TSRMLS_DC) +int zephir_array_key_exists(zval *arr, zval *key) { - HashTable *h = HASH_OF(arr); + HashTable *h = Z_ARRVAL_P(arr); if (h) { switch (Z_TYPE_P(key)) { case IS_STRING: - return zend_symtable_exists(h, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1); + return zend_symtable_exists(h, Z_STR_P(key)); case IS_LONG: return zend_hash_index_exists(h, Z_LVAL_P(key)); case IS_NULL: - return zend_hash_exists(h, "", 1); + return zend_hash_str_exists(h, "", 1); default: zend_error(E_WARNING, "The key should be either a string or an integer"); @@ -1254,56 +637,39 @@ int zephir_array_key_exists(zval *arr, zval *key TSRMLS_DC) return 0; } -int zephir_array_is_associative(zval *arr) { - - if (EXPECTED(Z_TYPE_P(arr) == IS_ARRAY)) { - HashPosition pos; - zval **entry; - char *skey; - uint skey_len; - ulong nkey; - ulong expected = 0; - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void**) &entry, &pos) == SUCCESS) { - - if (HASH_KEY_IS_LONG == zend_hash_get_current_key_ex(Z_ARRVAL_P(arr), &skey, &skey_len, &nkey, 1, &pos)) { - if (expected != nkey) { - return 1; - } - } else { - return 1; - } - - ++expected; - zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos); - } - } - - return 0; -} - /** * Implementation of Multiple array-offset update */ -void zephir_array_update_multi_ex(zval **arr, zval **value, const char *types, int types_length, int types_count, va_list ap TSRMLS_DC) +void zephir_array_update_multi_ex(zval *arr, zval *value, const char *types, int types_length, int types_count, va_list ap) { long old_l[ZEPHIR_MAX_ARRAY_LEVELS], old_ll[ZEPHIR_MAX_ARRAY_LEVELS]; char *s, *old_s[ZEPHIR_MAX_ARRAY_LEVELS], old_type[ZEPHIR_MAX_ARRAY_LEVELS]; - zval *fetched, *tmp, *p, *item, *old_item[ZEPHIR_MAX_ARRAY_LEVELS], *old_p[ZEPHIR_MAX_ARRAY_LEVELS]; + zval *item, *old_item[ZEPHIR_MAX_ARRAY_LEVELS]; + zval pzv; + zend_array *p, *old_p[ZEPHIR_MAX_ARRAY_LEVELS]; + zval tmp; int i, j, l, ll, re_update, must_continue, wrap_tmp; assert(types_length < ZEPHIR_MAX_ARRAY_LEVELS); + ZVAL_UNDEF(&tmp); + ZVAL_UNDEF(&pzv); - p = *arr; + if (Z_TYPE_P(arr) != IS_ARRAY) { + zend_error(E_ERROR, "Cannot use a scalar value as an array (multi)"); + return; + } + p = Z_ARRVAL_P(arr); for (i = 0; i < types_length; ++i) { + zval fetched; + ZVAL_UNDEF(&fetched); re_update = 0; must_continue = 0; wrap_tmp = 0; old_p[i] = p; + ZVAL_ARR(&pzv, p); switch (types[i]) { case 's': @@ -1311,31 +677,34 @@ void zephir_array_update_multi_ex(zval **arr, zval **value, const char *types, i l = va_arg(ap, int); old_s[i] = s; old_l[i] = l; - if (zephir_array_isset_string_fetch(&fetched, p, s, l + 1, 0 TSRMLS_CC)) { - if (Z_TYPE_P(fetched) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&fetched, &pzv, s, l, 1)) { + if (Z_TYPE(fetched) == IS_ARRAY) { if (i == (types_length - 1)) { - re_update = Z_REFCOUNT_P(p) > 1 && !Z_ISREF_P(p); - zephir_array_update_string(&p, s, l, value, PH_COPY | PH_SEPARATE); + re_update = !Z_REFCOUNTED(pzv) || (Z_REFCOUNT(pzv) > 1 && !Z_ISREF(pzv)); + zephir_array_update_string(&pzv, s, l, value, PH_COPY | PH_SEPARATE); + p = Z_ARRVAL(pzv); } else { - p = fetched; + p = Z_ARRVAL(fetched); + Z_TRY_ADDREF(fetched); } must_continue = 1; } - } else { - Z_DELREF_P(fetched); } + if (!must_continue) { - re_update = Z_REFCOUNT_P(p) > 1 && !Z_ISREF_P(p); + ZVAL_ARR(&pzv, p); + re_update = !Z_REFCOUNTED(pzv) || (Z_REFCOUNT(pzv) > 1 && !Z_ISREF(pzv)); if (i == (types_length - 1)) { - zephir_array_update_string(&p, s, l, value, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&pzv, s, l, value, PH_COPY | PH_SEPARATE); + p = Z_ARRVAL(pzv); } else { - MAKE_STD_ZVAL(tmp); - array_init(tmp); - zephir_array_update_string(&p, s, l, &tmp, PH_SEPARATE); + array_init(&tmp); + zephir_array_update_string(&pzv, s, l, &tmp, PH_SEPARATE); + p = Z_ARRVAL(pzv); if (re_update) { wrap_tmp = 1; } else { - p = tmp; + p = Z_ARRVAL(tmp); } } } @@ -1344,31 +713,34 @@ void zephir_array_update_multi_ex(zval **arr, zval **value, const char *types, i case 'l': ll = va_arg(ap, long); old_ll[i] = ll; - if (zephir_array_isset_long_fetch(&fetched, p, ll, 0 TSRMLS_CC)) { - if (Z_TYPE_P(fetched) == IS_ARRAY) { + if (zephir_array_isset_long_fetch(&fetched, &pzv, ll, 1)) { + if (Z_TYPE(fetched) == IS_ARRAY) { if (i == (types_length - 1)) { - re_update = Z_REFCOUNT_P(p) > 1 && !Z_ISREF_P(p); - zephir_array_update_long(&p, ll, value, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + re_update = !Z_REFCOUNTED(pzv) || (Z_REFCOUNT(pzv) > 1 && !Z_ISREF(pzv)); + zephir_array_update_long(&pzv, ll, value, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + p = Z_ARRVAL(pzv); } else { - p = fetched; + p = Z_ARRVAL(fetched); + Z_TRY_ADDREF(fetched); } must_continue = 1; } - } else { - Z_DELREF_P(fetched); } + if (!must_continue) { - re_update = Z_REFCOUNT_P(p) > 1 && !Z_ISREF_P(p); + ZVAL_ARR(&pzv, p); + re_update = !Z_REFCOUNTED(pzv) || (Z_REFCOUNT(pzv) > 1 && !Z_ISREF(pzv)); if (i == (types_length - 1)) { - zephir_array_update_long(&p, ll, value, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(&pzv, ll, value, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + p = Z_ARRVAL(pzv); } else { - MAKE_STD_ZVAL(tmp); - array_init(tmp); - zephir_array_update_long(&p, ll, &tmp, PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + array_init(&tmp); + zephir_array_update_long(&pzv, ll, &tmp, PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + p = Z_ARRVAL(pzv); if (re_update) { wrap_tmp = 1; } else { - p = tmp; + p = Z_ARRVAL(tmp); } } } @@ -1377,90 +749,80 @@ void zephir_array_update_multi_ex(zval **arr, zval **value, const char *types, i case 'z': item = va_arg(ap, zval*); old_item[i] = item; - if (zephir_array_isset_fetch(&fetched, p, item, 0 TSRMLS_CC)) { - if (Z_TYPE_P(fetched) == IS_ARRAY) { + if (zephir_array_isset_fetch(&fetched, &pzv, item, 1)) { + if (Z_TYPE(fetched) == IS_ARRAY) { if (i == (types_length - 1)) { - re_update = Z_REFCOUNT_P(p) > 1 && !Z_ISREF_P(p); - zephir_array_update_zval(&p, item, value, PH_COPY | PH_SEPARATE); + re_update = !Z_REFCOUNTED(pzv) || (Z_REFCOUNT(pzv) > 1 && !Z_ISREF(pzv)); + zephir_array_update_zval(&pzv, item, value, PH_COPY | PH_SEPARATE); + p = Z_ARRVAL(pzv); } else { - p = fetched; + p = Z_ARRVAL(fetched); + Z_TRY_ADDREF(fetched); } must_continue = 1; } - } else { - Z_DELREF_P(fetched); } + if (!must_continue) { - re_update = Z_REFCOUNT_P(p) > 1 && !Z_ISREF_P(p); + ZVAL_ARR(&pzv, p); + re_update = !Z_REFCOUNTED(pzv) || (Z_REFCOUNT(pzv) > 1 && !Z_ISREF(pzv)); if (i == (types_length - 1)) { - zephir_array_update_zval(&p, item, value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&pzv, item, value, PH_COPY | PH_SEPARATE); + p = Z_ARRVAL(pzv); } else { - MAKE_STD_ZVAL(tmp); - array_init(tmp); - zephir_array_update_zval(&p, item, &tmp, PH_SEPARATE); + array_init(&tmp); + zephir_array_update_zval(&pzv, item, &tmp, PH_SEPARATE); + p = Z_ARRVAL(pzv); if (re_update) { wrap_tmp = 1; } else { - p = tmp; + p = Z_ARRVAL(tmp); } } } break; case 'a': - re_update = Z_REFCOUNT_P(p) > 1 && !Z_ISREF_P(p); - zephir_array_append(&p, *value, PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + re_update = !Z_REFCOUNTED(pzv) || (Z_REFCOUNT(pzv) > 1 && !Z_ISREF(pzv)); + zephir_array_append(&pzv, value, PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + p = Z_ARRVAL(pzv); break; } if (re_update) { - for (j = i - 1; j >= 0; j--) { + zval old_pzv; if (!re_update) { break; } - re_update = Z_REFCOUNT_P(old_p[j]) > 1 && !Z_ISREF_P(old_p[j]); - switch (old_type[j]) { + ZVAL_ARR(&pzv, old_p[j]); + re_update = !Z_REFCOUNTED(pzv) || (Z_REFCOUNT(pzv) > 1 && !Z_ISREF(pzv)); + if (j == i - 1) { + ZVAL_ARR(&old_pzv, p); + } else { + ZVAL_ARR(&old_pzv, old_p[j + 1]); + } + + switch (old_type[j]) + { case 's': - if (j == i - 1) { - zephir_array_update_string(&(old_p[j]), old_s[j], old_l[j], &p, PH_SEPARATE); - } else { - zephir_array_update_string(&(old_p[j]), old_s[j], old_l[j], &old_p[j+1], PH_SEPARATE); - } - if (wrap_tmp) { - p = tmp; - wrap_tmp = 0; - } + zephir_array_update_string(&pzv, old_s[j], old_l[j], &old_pzv, PH_SEPARATE); break; - case 'l': - if (j == i - 1) { - zephir_array_update_long(&(old_p[j]), old_ll[j], &p, PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - } else { - zephir_array_update_long(&(old_p[j]), old_ll[j], &old_p[j+1], PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - } - if (wrap_tmp) { - p = tmp; - wrap_tmp = 0; - } + zephir_array_update_long(&pzv, old_ll[j], &old_pzv, PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); break; - case 'z': - if (j == i - 1) { - zephir_array_update_zval(&(old_p[j]), old_item[j], &p, PH_SEPARATE); - } else { - zephir_array_update_zval(&(old_p[j]), old_item[j], &old_p[j+1], PH_SEPARATE); - } - if (wrap_tmp) { - p = tmp; - wrap_tmp = 0; - } + zephir_array_update_zval(&pzv, old_item[j], &old_pzv, PH_SEPARATE); break; } - + old_p[j] = Z_ARRVAL(pzv); + if (wrap_tmp) { + p = Z_ARRVAL(tmp); + wrap_tmp = 0; + } } } @@ -1470,52 +832,74 @@ void zephir_array_update_multi_ex(zval **arr, zval **value, const char *types, i } } -int zephir_array_update_multi(zval **arr, zval **value TSRMLS_DC, const char *types, int types_length, int types_count, ...) +int zephir_array_update_multi(zval *arr, zval *value, const char *types, int types_length, int types_count, ...) { va_list ap; - va_start(ap, types_count); SEPARATE_ZVAL_IF_NOT_REF(arr); -/* - memset(old_type, '\0', ZEPHIR_MAX_ARRAY_LEVELS); - memset(old_s, '\0', ZEPHIR_MAX_ARRAY_LEVELS); - memset(old_p, '\0', ZEPHIR_MAX_ARRAY_LEVELS); - memset(old_item, '\0', ZEPHIR_MAX_ARRAY_LEVELS); -*/ - - zephir_array_update_multi_ex(arr, value, types, types_length, types_count, ap TSRMLS_CC); + zephir_array_update_multi_ex(arr, value, types, types_length, types_count, ap); va_end(ap); return 0; } -void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, uint size, int initialize TSRMLS_DC) { - - uint i; - zval *null_value; - HashTable *hashTable; +/** + * Fast in_array function + */ +int zephir_fast_in_array(zval *value, zval *haystack) +{ + zval *entry; + zend_ulong num_idx; + zend_string *str_idx; - if (size > 0) { + if (Z_TYPE_P(haystack) != IS_ARRAY) { + return 0; + } - hashTable = (HashTable *) emalloc(sizeof(HashTable)); - zend_hash_init(hashTable, size, NULL, ZVAL_PTR_DTOR, 0); + if (Z_TYPE_P(value) == IS_STRING) { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(haystack), num_idx, str_idx, entry) { + if (fast_equal_check_string(value, entry)) { + return 1; + } + } ZEND_HASH_FOREACH_END(); + } else { + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(haystack), num_idx, str_idx, entry) { + if (fast_equal_check_function(value, entry)) { + return 1; + } + } ZEND_HASH_FOREACH_END(); + } - if (initialize) { + return 0; +} - MAKE_STD_ZVAL(null_value); - ZVAL_NULL(null_value); - Z_SET_REFCOUNT_P(null_value, size); +/** + * Fast array merge + */ +void zephir_fast_array_merge(zval *return_value, zval *array1, zval *array2) +{ + int init_size, num; - for (i = 0; i < size; i++) { - zend_hash_next_index_insert(hashTable, &null_value, sizeof(zval *), NULL); - } - } + if (Z_TYPE_P(array1) != IS_ARRAY) { + zend_error(E_WARNING, "First argument is not an array"); + RETURN_NULL(); + } - Z_ARRVAL_P(return_value) = hashTable; - Z_TYPE_P(return_value) = IS_ARRAY; + if (Z_TYPE_P(array2) != IS_ARRAY) { + zend_error(E_WARNING, "Second argument is not an array"); + RETURN_NULL(); + } - } else { - array_init(return_value); + init_size = zend_hash_num_elements(Z_ARRVAL_P(array1)); + num = zend_hash_num_elements(Z_ARRVAL_P(array2)); + if (num > init_size) { + init_size = num; } + + array_init_size(return_value, init_size); + + php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(array1)); + + php_array_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_P(array2)); } diff --git a/ext/kernel/array.h b/ext/kernel/array.h index 926fa0d36fa..b61c0ed5bc3 100644 --- a/ext/kernel/array.h +++ b/ext/kernel/array.h @@ -27,69 +27,60 @@ #include "kernel/globals.h" #include "kernel/main.h" +void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, uint size, int initialize); + +/** + * Simple convenience function which ensures that you are dealing with an array and you can + * eliminate noise from your code. + */ +void ZEPHIR_FASTCALL zephir_ensure_array(zval *probable_array); + /** Combined isset/fetch */ -int zephir_array_isset_fetch(zval **fetched, const zval *arr, zval *index, int readonly TSRMLS_DC); -int zephir_array_isset_quick_string_fetch(zval **fetched, zval *arr, char *index, uint index_length, unsigned long key, int readonly TSRMLS_DC); -int zephir_array_isset_string_fetch(zval **fetched, zval *arr, char *index, uint index_length, int readonly TSRMLS_DC); -int zephir_array_isset_long_fetch(zval **fetched, zval *arr, unsigned long index, int readonly TSRMLS_DC); +int zephir_array_isset_fetch(zval *fetched, const zval *arr, zval *index, int readonly); +int zephir_array_isset_string_fetch(zval *fetched, const zval *arr, char *index, uint index_length, int readonly); +int zephir_array_isset_long_fetch(zval *fetched, const zval *arr, unsigned long index, int readonly); /** Check for index existence */ int ZEPHIR_FASTCALL zephir_array_isset(const zval *arr, zval *index); int ZEPHIR_FASTCALL zephir_array_isset_long(const zval *arr, unsigned long index); int ZEPHIR_FASTCALL zephir_array_isset_string(const zval *arr, const char *index, uint index_length); -/** Fast index existence checking */ -int ZEPHIR_FASTCALL zephir_array_isset_quick_string(const zval *arr, const char *index, uint index_length, unsigned long key); - /** Unset existing indexes */ -int ZEPHIR_FASTCALL zephir_array_unset(zval **arr, zval *index, int flags); -int ZEPHIR_FASTCALL zephir_array_unset_long(zval **arr, unsigned long index, int flags); -int ZEPHIR_FASTCALL zephir_array_unset_string(zval **arr, const char *index, uint index_length, int flags); - -/** Append elements to arrays */ -int zephir_array_append(zval **arr, zval *value, int separate ZEPHIR_DEBUG_PARAMS); -int zephir_array_append_long(zval **arr, long value, int separate); -int zephir_array_append_string(zval **arr, char *value, uint value_length, int separate); - -/** Modify arrays */ -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); -int zephir_array_update_long(zval **arr, unsigned long index, zval **value, int flags ZEPHIR_DEBUG_PARAMS); +int ZEPHIR_FASTCALL zephir_array_unset(zval *arr, zval *index, int flags); +int ZEPHIR_FASTCALL zephir_array_unset_long(zval *arr, unsigned long index, int flags); +int ZEPHIR_FASTCALL zephir_array_unset_string(zval *arr, const char *index, uint index_length, int flags); /** Fetch items from arrays */ -int zephir_array_fetch(zval **return_value, zval *arr, zval *index, int flags ZEPHIR_DEBUG_PARAMS TSRMLS_DC); -int zephir_array_fetch_string(zval **return_value, zval *arr, const char *index, uint index_length, int flags ZEPHIR_DEBUG_PARAMS TSRMLS_DC); -int zephir_array_fetch_long(zval **return_value, zval *arr, unsigned long index, int flags ZEPHIR_DEBUG_PARAMS TSRMLS_DC); +int zephir_array_fetch(zval *return_value, zval *arr, zval *index, int flags ZEPHIR_DEBUG_PARAMS); +int zephir_array_fetch_string(zval *return_value, zval *arr, const char *index, uint index_length, int flags ZEPHIR_DEBUG_PARAMS); +int zephir_array_fetch_long(zval *return_value, zval *arr, unsigned long index, int flags ZEPHIR_DEBUG_PARAMS); -/** Merge+Append */ +/** Append elements to arrays */ +int zephir_array_append(zval *arr, zval *value, int separate ZEPHIR_DEBUG_PARAMS); void zephir_merge_append(zval *left, zval *values); -/* Traversing Arays */ -void zephir_array_get_current(zval *return_value, zval *array); -void zephir_array_next(zval *array); +/** Modify array */ +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); +int zephir_array_update_long(zval *arr, unsigned long index, zval *value, int flags ZEPHIR_DEBUG_PARAMS); -/* In Array */ -int zephir_fast_in_array(zval *needle, zval *haystack TSRMLS_DC); - -/** Fast Array Merge */ -void zephir_fast_array_merge(zval *return_value, zval **array1, zval **array2 TSRMLS_DC); +void zephir_array_keys(zval *return_value, zval *arr); +int zephir_array_key_exists(zval *arr, zval *key); -/** Recursive merge */ -void zephir_array_merge_recursive_n(zval **a1, zval *a2 TSRMLS_DC); +/* Update array using multiple keys */ +void zephir_array_update_multi_ex(zval *arr, zval *value, const char *types, int types_length, int types_count, va_list ap); +int zephir_array_update_multi(zval *arr, zval *value, const char *types, int types_length, int types_count, ...); -void zephir_array_unshift(zval *arr, zval *arg TSRMLS_DC); -void zephir_array_keys(zval *return_value, zval *arr TSRMLS_DC); -void zephir_array_values(zval *return_value, zval *arr); -int zephir_array_key_exists(zval *arr, zval *key TSRMLS_DC); -int zephir_array_is_associative(zval *arr); - -void zephir_array_update_multi_ex(zval **arr, zval **value, const char *types, int types_length, int types_count, va_list ap TSRMLS_DC); -int zephir_array_update_multi(zval **arr, zval **value TSRMLS_DC, const char *types, int types_length, int types_count, ...); +/** Fast Array Merge */ +void zephir_fast_array_merge(zval *return_value, zval *array1, zval *array2); -void ZEPHIR_FASTCALL zephir_create_array(zval *return_value, uint size, int initialize TSRMLS_DC); +/* In Array */ +int zephir_fast_in_array(zval *needle, zval *haystack); #define zephir_array_fast_append(arr, value) \ - Z_ADDREF_P(value); \ - zend_hash_next_index_insert(Z_ARRVAL_P(arr), &value, sizeof(zval *), NULL); + do { \ + Z_TRY_ADDREF_P(value); \ + zend_hash_next_index_insert(Z_ARRVAL_P(arr), value); \ + } while (0) #endif /* ZEPHIR_KERNEL_ARRAY_H */ diff --git a/ext/kernel/backtrace.c b/ext/kernel/backtrace.c index 527ebdbb0ed..5713899730f 100644 --- a/ext/kernel/backtrace.c +++ b/ext/kernel/backtrace.c @@ -23,7 +23,8 @@ #include #include -#include +#include +#include /** * A buffer for backtrace. It is better to have it allocated statically @@ -37,9 +38,7 @@ void zephir_print_backtrace(void) int stack_size = backtrace(backtrace_buf, sizeof(backtrace_buf) / sizeof(void*)); char **stack_symbols = backtrace_symbols(backtrace_buf, stack_size); char buf[50]; - smart_str s; - - s.c = NULL; + smart_str s = {0}; for (i = 0; i < stack_size; ++i) { snprintf(buf, sizeof(buf), "#%d %p [", i, backtrace_buf[i]); @@ -50,7 +49,7 @@ void zephir_print_backtrace(void) smart_str_0(&s); - fprintf(stderr, "%s\n", s.c); + fprintf(stderr, "%s\n", ZSTR_VAL(s.s)); smart_str_free(&s); } diff --git a/ext/kernel/concat.c b/ext/kernel/concat.c index 938e1e33d67..1ddb7f610e7 100644 --- a/ext/kernel/concat.c +++ b/ext/kernel/concat.c @@ -2,24 +2,22 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif - #include #include "php_ext.h" #include #include "ext.h" - #include "kernel/main.h" #include "kernel/memory.h" #include "kernel/concat.h" -void zephir_concat_sv(zval **result, const char *op1, zend_uint op1_len, zval *op2, int self_var TSRMLS_DC){ +void zephir_concat_sv(zval *result, const char *op1, zend_uint op1_len, zval *op2, int self_var){ zval result_copy, op2_copy; int use_copy = 0, use_copy2 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } @@ -28,27 +26,25 @@ void zephir_concat_sv(zval **result, const char *op1, zend_uint op1_len, zval *o length = op1_len + Z_STRLEN_P(op2); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -59,14 +55,14 @@ void zephir_concat_sv(zval **result, const char *op1, zend_uint op1_len, zval *o } -void zephir_concat_svs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, int self_var TSRMLS_DC){ +void zephir_concat_svs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, int self_var){ zval result_copy, op2_copy; int use_copy = 0, use_copy2 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } @@ -75,28 +71,26 @@ void zephir_concat_svs(zval **result, const char *op1, zend_uint op1_len, zval * length = op1_len + Z_STRLEN_P(op2) + op3_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -107,28 +101,28 @@ void zephir_concat_svs(zval **result, const char *op1, zend_uint op1_len, zval * } -void zephir_concat_svssvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, int self_var TSRMLS_DC){ +void zephir_concat_svssvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, int self_var){ zval result_copy, op2_copy, op5_copy, op7_copy; int use_copy = 0, use_copy2 = 0, use_copy5 = 0, use_copy7 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op5) != IS_STRING) { - zend_make_printable_zval(op5, &op5_copy, &use_copy5); + use_copy5 = zend_make_printable_zval(op5, &op5_copy); if (use_copy5) { op5 = &op5_copy; } } if (Z_TYPE_P(op7) != IS_STRING) { - zend_make_printable_zval(op7, &op7_copy, &use_copy7); + use_copy7 = zend_make_printable_zval(op7, &op7_copy); if (use_copy7) { op7 = &op7_copy; } @@ -137,33 +131,31 @@ void zephir_concat_svssvsvs(zval **result, const char *op1, zend_uint op1_len, z length = op1_len + Z_STRLEN_P(op2) + op3_len + op4_len + Z_STRLEN_P(op5) + op6_len + Z_STRLEN_P(op7) + op8_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, op4, op4_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + op4_len, Z_STRVAL_P(op5), Z_STRLEN_P(op5)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + op4_len + Z_STRLEN_P(op5), op6, op6_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + op4_len + Z_STRLEN_P(op5) + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + op4_len + Z_STRLEN_P(op5) + op6_len + Z_STRLEN_P(op7), op8, op8_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, op4, op4_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + op4_len, Z_STRVAL_P(op5), Z_STRLEN_P(op5)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + op4_len + Z_STRLEN_P(op5), op6, op6_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + op4_len + Z_STRLEN_P(op5) + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + op4_len + Z_STRLEN_P(op5) + op6_len + Z_STRLEN_P(op7), op8, op8_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -182,21 +174,21 @@ void zephir_concat_svssvsvs(zval **result, const char *op1, zend_uint op1_len, z } -void zephir_concat_svsv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, int self_var TSRMLS_DC){ +void zephir_concat_svsv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, int self_var){ zval result_copy, op2_copy, op4_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } @@ -205,29 +197,27 @@ void zephir_concat_svsv(zval **result, const char *op1, zend_uint op1_len, zval length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -242,21 +232,21 @@ void zephir_concat_svsv(zval **result, const char *op1, zend_uint op1_len, zval } -void zephir_concat_svsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, int self_var TSRMLS_DC){ +void zephir_concat_svsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, int self_var){ zval result_copy, op2_copy, op4_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } @@ -265,30 +255,28 @@ void zephir_concat_svsvs(zval **result, const char *op1, zend_uint op1_len, zval length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -303,35 +291,35 @@ void zephir_concat_svsvs(zval **result, const char *op1, zend_uint op1_len, zval } -void zephir_concat_svsvssvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, zval *op9, const char *op10, zend_uint op10_len, int self_var TSRMLS_DC){ +void zephir_concat_svsvssvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, zval *op9, const char *op10, zend_uint op10_len, int self_var){ zval result_copy, op2_copy, op4_copy, op7_copy, op9_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0, use_copy7 = 0, use_copy9 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op7) != IS_STRING) { - zend_make_printable_zval(op7, &op7_copy, &use_copy7); + use_copy7 = zend_make_printable_zval(op7, &op7_copy); if (use_copy7) { op7 = &op7_copy; } } if (Z_TYPE_P(op9) != IS_STRING) { - zend_make_printable_zval(op9, &op9_copy, &use_copy9); + use_copy9 = zend_make_printable_zval(op9, &op9_copy); if (use_copy9) { op9 = &op9_copy; } @@ -340,35 +328,33 @@ void zephir_concat_svsvssvsvs(zval **result, const char *op1, zend_uint op1_len, length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + op6_len + Z_STRLEN_P(op7) + op8_len + Z_STRLEN_P(op9) + op10_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, op6, op6_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + op6_len + Z_STRLEN_P(op7), op8, op8_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + op6_len + Z_STRLEN_P(op7) + op8_len, Z_STRVAL_P(op9), Z_STRLEN_P(op9)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + op6_len + Z_STRLEN_P(op7) + op8_len + Z_STRLEN_P(op9), op10, op10_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, op6, op6_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + op6_len + Z_STRLEN_P(op7), op8, op8_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + op6_len + Z_STRLEN_P(op7) + op8_len, Z_STRVAL_P(op9), Z_STRLEN_P(op9)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + op6_len + Z_STRLEN_P(op7) + op8_len + Z_STRLEN_P(op9), op10, op10_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -391,28 +377,28 @@ void zephir_concat_svsvssvsvs(zval **result, const char *op1, zend_uint op1_len, } -void zephir_concat_svsvsv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, int self_var TSRMLS_DC){ +void zephir_concat_svsvsv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, int self_var){ zval result_copy, op2_copy, op4_copy, op6_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0, use_copy6 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op6) != IS_STRING) { - zend_make_printable_zval(op6, &op6_copy, &use_copy6); + use_copy6 = zend_make_printable_zval(op6, &op6_copy); if (use_copy6) { op6 = &op6_copy; } @@ -421,31 +407,29 @@ void zephir_concat_svsvsv(zval **result, const char *op1, zend_uint op1_len, zva length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -464,28 +448,28 @@ void zephir_concat_svsvsv(zval **result, const char *op1, zend_uint op1_len, zva } -void zephir_concat_svsvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, int self_var TSRMLS_DC){ +void zephir_concat_svsvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, int self_var){ zval result_copy, op2_copy, op4_copy, op6_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0, use_copy6 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op6) != IS_STRING) { - zend_make_printable_zval(op6, &op6_copy, &use_copy6); + use_copy6 = zend_make_printable_zval(op6, &op6_copy); if (use_copy6) { op6 = &op6_copy; } @@ -494,32 +478,30 @@ void zephir_concat_svsvsvs(zval **result, const char *op1, zend_uint op1_len, zv length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), op7, op7_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), op7, op7_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -538,35 +520,35 @@ void zephir_concat_svsvsvs(zval **result, const char *op1, zend_uint op1_len, zv } -void zephir_concat_svsvsvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, int self_var TSRMLS_DC){ +void zephir_concat_svsvsvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, int self_var){ zval result_copy, op2_copy, op4_copy, op6_copy, op8_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0, use_copy6 = 0, use_copy8 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op6) != IS_STRING) { - zend_make_printable_zval(op6, &op6_copy, &use_copy6); + use_copy6 = zend_make_printable_zval(op6, &op6_copy); if (use_copy6) { op6 = &op6_copy; } } if (Z_TYPE_P(op8) != IS_STRING) { - zend_make_printable_zval(op8, &op8_copy, &use_copy8); + use_copy8 = zend_make_printable_zval(op8, &op8_copy); if (use_copy8) { op8 = &op8_copy; } @@ -575,34 +557,32 @@ void zephir_concat_svsvsvsvs(zval **result, const char *op1, zend_uint op1_len, length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8) + op9_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), op7, op7_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len, Z_STRVAL_P(op8), Z_STRLEN_P(op8)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8), op9, op9_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), op7, op7_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len, Z_STRVAL_P(op8), Z_STRLEN_P(op8)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8), op9, op9_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -625,42 +605,42 @@ void zephir_concat_svsvsvsvs(zval **result, const char *op1, zend_uint op1_len, } -void zephir_concat_svsvsvsvsv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, zval *op10, int self_var TSRMLS_DC){ +void zephir_concat_svsvsvsvsv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, zval *op10, int self_var){ zval result_copy, op2_copy, op4_copy, op6_copy, op8_copy, op10_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0, use_copy6 = 0, use_copy8 = 0, use_copy10 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op6) != IS_STRING) { - zend_make_printable_zval(op6, &op6_copy, &use_copy6); + use_copy6 = zend_make_printable_zval(op6, &op6_copy); if (use_copy6) { op6 = &op6_copy; } } if (Z_TYPE_P(op8) != IS_STRING) { - zend_make_printable_zval(op8, &op8_copy, &use_copy8); + use_copy8 = zend_make_printable_zval(op8, &op8_copy); if (use_copy8) { op8 = &op8_copy; } } if (Z_TYPE_P(op10) != IS_STRING) { - zend_make_printable_zval(op10, &op10_copy, &use_copy10); + use_copy10 = zend_make_printable_zval(op10, &op10_copy); if (use_copy10) { op10 = &op10_copy; } @@ -669,35 +649,33 @@ void zephir_concat_svsvsvsvsv(zval **result, const char *op1, zend_uint op1_len, length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8) + op9_len + Z_STRLEN_P(op10); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), op7, op7_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len, Z_STRVAL_P(op8), Z_STRLEN_P(op8)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8), op9, op9_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8) + op9_len, Z_STRVAL_P(op10), Z_STRLEN_P(op10)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), op7, op7_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len, Z_STRVAL_P(op8), Z_STRLEN_P(op8)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8), op9, op9_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8) + op9_len, Z_STRVAL_P(op10), Z_STRLEN_P(op10)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -724,42 +702,42 @@ void zephir_concat_svsvsvsvsv(zval **result, const char *op1, zend_uint op1_len, } -void zephir_concat_svsvsvsvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, zval *op10, const char *op11, zend_uint op11_len, int self_var TSRMLS_DC){ +void zephir_concat_svsvsvsvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, zval *op10, const char *op11, zend_uint op11_len, int self_var){ zval result_copy, op2_copy, op4_copy, op6_copy, op8_copy, op10_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0, use_copy6 = 0, use_copy8 = 0, use_copy10 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op6) != IS_STRING) { - zend_make_printable_zval(op6, &op6_copy, &use_copy6); + use_copy6 = zend_make_printable_zval(op6, &op6_copy); if (use_copy6) { op6 = &op6_copy; } } if (Z_TYPE_P(op8) != IS_STRING) { - zend_make_printable_zval(op8, &op8_copy, &use_copy8); + use_copy8 = zend_make_printable_zval(op8, &op8_copy); if (use_copy8) { op8 = &op8_copy; } } if (Z_TYPE_P(op10) != IS_STRING) { - zend_make_printable_zval(op10, &op10_copy, &use_copy10); + use_copy10 = zend_make_printable_zval(op10, &op10_copy); if (use_copy10) { op10 = &op10_copy; } @@ -768,36 +746,34 @@ void zephir_concat_svsvsvsvsvs(zval **result, const char *op1, zend_uint op1_len length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8) + op9_len + Z_STRLEN_P(op10) + op11_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), op7, op7_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len, Z_STRVAL_P(op8), Z_STRLEN_P(op8)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8), op9, op9_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8) + op9_len, Z_STRVAL_P(op10), Z_STRLEN_P(op10)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8) + op9_len + Z_STRLEN_P(op10), op11, op11_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), op5, op5_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), op7, op7_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len, Z_STRVAL_P(op8), Z_STRLEN_P(op8)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8), op9, op9_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8) + op9_len, Z_STRVAL_P(op10), Z_STRLEN_P(op10)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + op7_len + Z_STRLEN_P(op8) + op9_len + Z_STRLEN_P(op10), op11, op11_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -824,28 +800,28 @@ void zephir_concat_svsvsvsvsvs(zval **result, const char *op1, zend_uint op1_len } -void zephir_concat_svsvv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, int self_var TSRMLS_DC){ +void zephir_concat_svsvv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, int self_var){ zval result_copy, op2_copy, op4_copy, op5_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0, use_copy5 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op5) != IS_STRING) { - zend_make_printable_zval(op5, &op5_copy, &use_copy5); + use_copy5 = zend_make_printable_zval(op5, &op5_copy); if (use_copy5) { op5 = &op5_copy; } @@ -854,30 +830,28 @@ void zephir_concat_svsvv(zval **result, const char *op1, zend_uint op1_len, zval length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), Z_STRVAL_P(op5), Z_STRLEN_P(op5)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), Z_STRVAL_P(op5), Z_STRLEN_P(op5)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -896,35 +870,35 @@ void zephir_concat_svsvv(zval **result, const char *op1, zend_uint op1_len, zval } -void zephir_concat_svsvvsv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, const char *op6, zend_uint op6_len, zval *op7, int self_var TSRMLS_DC){ +void zephir_concat_svsvvsv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, const char *op6, zend_uint op6_len, zval *op7, int self_var){ zval result_copy, op2_copy, op4_copy, op5_copy, op7_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0, use_copy5 = 0, use_copy7 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op5) != IS_STRING) { - zend_make_printable_zval(op5, &op5_copy, &use_copy5); + use_copy5 = zend_make_printable_zval(op5, &op5_copy); if (use_copy5) { op5 = &op5_copy; } } if (Z_TYPE_P(op7) != IS_STRING) { - zend_make_printable_zval(op7, &op7_copy, &use_copy7); + use_copy7 = zend_make_printable_zval(op7, &op7_copy); if (use_copy7) { op7 = &op7_copy; } @@ -933,32 +907,30 @@ void zephir_concat_svsvvsv(zval **result, const char *op1, zend_uint op1_len, zv length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5) + op6_len + Z_STRLEN_P(op7); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), Z_STRVAL_P(op5), Z_STRLEN_P(op5)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5), op6, op6_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5) + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), Z_STRVAL_P(op5), Z_STRLEN_P(op5)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5), op6, op6_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5) + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -981,35 +953,35 @@ void zephir_concat_svsvvsv(zval **result, const char *op1, zend_uint op1_len, zv } -void zephir_concat_svsvvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, int self_var TSRMLS_DC){ +void zephir_concat_svsvvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, int self_var){ zval result_copy, op2_copy, op4_copy, op5_copy, op7_copy; int use_copy = 0, use_copy2 = 0, use_copy4 = 0, use_copy5 = 0, use_copy7 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op5) != IS_STRING) { - zend_make_printable_zval(op5, &op5_copy, &use_copy5); + use_copy5 = zend_make_printable_zval(op5, &op5_copy); if (use_copy5) { op5 = &op5_copy; } } if (Z_TYPE_P(op7) != IS_STRING) { - zend_make_printable_zval(op7, &op7_copy, &use_copy7); + use_copy7 = zend_make_printable_zval(op7, &op7_copy); if (use_copy7) { op7 = &op7_copy; } @@ -1018,33 +990,31 @@ void zephir_concat_svsvvsvs(zval **result, const char *op1, zend_uint op1_len, z length = op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5) + op6_len + Z_STRLEN_P(op7) + op8_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), Z_STRVAL_P(op5), Z_STRLEN_P(op5)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5), op6, op6_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5) + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5) + op6_len + Z_STRLEN_P(op7), op8, op8_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4), Z_STRVAL_P(op5), Z_STRLEN_P(op5)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5), op6, op6_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5) + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4) + Z_STRLEN_P(op5) + op6_len + Z_STRLEN_P(op7), op8, op8_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -1067,21 +1037,21 @@ void zephir_concat_svsvvsvs(zval **result, const char *op1, zend_uint op1_len, z } -void zephir_concat_svv(zval **result, const char *op1, zend_uint op1_len, zval *op2, zval *op3, int self_var TSRMLS_DC){ +void zephir_concat_svv(zval *result, const char *op1, zend_uint op1_len, zval *op2, zval *op3, int self_var){ zval result_copy, op2_copy, op3_copy; int use_copy = 0, use_copy2 = 0, use_copy3 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } @@ -1090,28 +1060,26 @@ void zephir_concat_svv(zval **result, const char *op1, zend_uint op1_len, zval * length = op1_len + Z_STRLEN_P(op2) + Z_STRLEN_P(op3); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -1126,21 +1094,21 @@ void zephir_concat_svv(zval **result, const char *op1, zend_uint op1_len, zval * } -void zephir_concat_svvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, zval *op3, const char *op4, zend_uint op4_len, int self_var TSRMLS_DC){ +void zephir_concat_svvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, zval *op3, const char *op4, zend_uint op4_len, int self_var){ zval result_copy, op2_copy, op3_copy; int use_copy = 0, use_copy2 = 0, use_copy3 = 0; uint offset = 0, length; if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } @@ -1149,29 +1117,27 @@ void zephir_concat_svvs(zval **result, const char *op1, zend_uint op1_len, zval length = op1_len + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + op4_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, op1, op1_len); - memcpy(Z_STRVAL_PP(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - memcpy(Z_STRVAL_PP(result) + offset + op1_len + Z_STRLEN_P(op2) + Z_STRLEN_P(op3), op4, op4_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, op1, op1_len); + memcpy(Z_STRVAL_P(result) + offset + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + memcpy(Z_STRVAL_P(result) + offset + op1_len + Z_STRLEN_P(op2) + Z_STRLEN_P(op3), op4, op4_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy2) { zval_dtor(op2); } @@ -1186,14 +1152,14 @@ void zephir_concat_svvs(zval **result, const char *op1, zend_uint op1_len, zval } -void zephir_concat_vs(zval **result, zval *op1, const char *op2, zend_uint op2_len, int self_var TSRMLS_DC){ +void zephir_concat_vs(zval *result, zval *op1, const char *op2, zend_uint op2_len, int self_var){ zval result_copy, op1_copy; int use_copy = 0, use_copy1 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } @@ -1202,27 +1168,25 @@ void zephir_concat_vs(zval **result, zval *op1, const char *op2, zend_uint op2_l length = Z_STRLEN_P(op1) + op2_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), op2, op2_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), op2, op2_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1233,21 +1197,21 @@ void zephir_concat_vs(zval **result, zval *op1, const char *op2, zend_uint op2_l } -void zephir_concat_vsv(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, int self_var TSRMLS_DC){ +void zephir_concat_vsv(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, int self_var){ zval result_copy, op1_copy, op3_copy; int use_copy = 0, use_copy1 = 0, use_copy3 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } @@ -1256,28 +1220,26 @@ void zephir_concat_vsv(zval **result, zval *op1, const char *op2, zend_uint op2_ length = Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), op2, op2_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), op2, op2_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1292,21 +1254,21 @@ void zephir_concat_vsv(zval **result, zval *op1, const char *op2, zend_uint op2_ } -void zephir_concat_vsvs(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, int self_var TSRMLS_DC){ +void zephir_concat_vsvs(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, int self_var){ zval result_copy, op1_copy, op3_copy; int use_copy = 0, use_copy1 = 0, use_copy3 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } @@ -1315,29 +1277,27 @@ void zephir_concat_vsvs(zval **result, zval *op1, const char *op2, zend_uint op2 length = Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), op2, op2_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), op4, op4_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), op2, op2_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), op4, op4_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1352,28 +1312,28 @@ void zephir_concat_vsvs(zval **result, zval *op1, const char *op2, zend_uint op2 } -void zephir_concat_vsvsv(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, int self_var TSRMLS_DC){ +void zephir_concat_vsvsv(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, int self_var){ zval result_copy, op1_copy, op3_copy, op5_copy; int use_copy = 0, use_copy1 = 0, use_copy3 = 0, use_copy5 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } } if (Z_TYPE_P(op5) != IS_STRING) { - zend_make_printable_zval(op5, &op5_copy, &use_copy5); + use_copy5 = zend_make_printable_zval(op5, &op5_copy); if (use_copy5) { op5 = &op5_copy; } @@ -1382,30 +1342,28 @@ void zephir_concat_vsvsv(zval **result, zval *op1, const char *op2, zend_uint op length = Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len + Z_STRLEN_P(op5); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), op2, op2_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), op4, op4_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len, Z_STRVAL_P(op5), Z_STRLEN_P(op5)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), op2, op2_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), op4, op4_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len, Z_STRVAL_P(op5), Z_STRLEN_P(op5)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1424,28 +1382,28 @@ void zephir_concat_vsvsv(zval **result, zval *op1, const char *op2, zend_uint op } -void zephir_concat_vsvsvs(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, int self_var TSRMLS_DC){ +void zephir_concat_vsvsvs(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, int self_var){ zval result_copy, op1_copy, op3_copy, op5_copy; int use_copy = 0, use_copy1 = 0, use_copy3 = 0, use_copy5 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } } if (Z_TYPE_P(op5) != IS_STRING) { - zend_make_printable_zval(op5, &op5_copy, &use_copy5); + use_copy5 = zend_make_printable_zval(op5, &op5_copy); if (use_copy5) { op5 = &op5_copy; } @@ -1454,31 +1412,29 @@ void zephir_concat_vsvsvs(zval **result, zval *op1, const char *op2, zend_uint o length = Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len + Z_STRLEN_P(op5) + op6_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), op2, op2_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), op4, op4_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len, Z_STRVAL_P(op5), Z_STRLEN_P(op5)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len + Z_STRLEN_P(op5), op6, op6_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), op2, op2_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), op4, op4_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len, Z_STRVAL_P(op5), Z_STRLEN_P(op5)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len + Z_STRLEN_P(op5), op6, op6_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1497,35 +1453,35 @@ void zephir_concat_vsvsvs(zval **result, zval *op1, const char *op2, zend_uint o } -void zephir_concat_vsvsvsv(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, zval *op7, int self_var TSRMLS_DC){ +void zephir_concat_vsvsvsv(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, zval *op7, int self_var){ zval result_copy, op1_copy, op3_copy, op5_copy, op7_copy; int use_copy = 0, use_copy1 = 0, use_copy3 = 0, use_copy5 = 0, use_copy7 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } } if (Z_TYPE_P(op5) != IS_STRING) { - zend_make_printable_zval(op5, &op5_copy, &use_copy5); + use_copy5 = zend_make_printable_zval(op5, &op5_copy); if (use_copy5) { op5 = &op5_copy; } } if (Z_TYPE_P(op7) != IS_STRING) { - zend_make_printable_zval(op7, &op7_copy, &use_copy7); + use_copy7 = zend_make_printable_zval(op7, &op7_copy); if (use_copy7) { op7 = &op7_copy; } @@ -1534,32 +1490,30 @@ void zephir_concat_vsvsvsv(zval **result, zval *op1, const char *op2, zend_uint length = Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len + Z_STRLEN_P(op5) + op6_len + Z_STRLEN_P(op7); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), op2, op2_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), op4, op4_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len, Z_STRVAL_P(op5), Z_STRLEN_P(op5)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len + Z_STRLEN_P(op5), op6, op6_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len + Z_STRLEN_P(op5) + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), op2, op2_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), op4, op4_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len, Z_STRVAL_P(op5), Z_STRLEN_P(op5)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len + Z_STRLEN_P(op5), op6, op6_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + op4_len + Z_STRLEN_P(op5) + op6_len, Z_STRVAL_P(op7), Z_STRLEN_P(op7)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1582,28 +1536,28 @@ void zephir_concat_vsvsvsv(zval **result, zval *op1, const char *op2, zend_uint } -void zephir_concat_vsvv(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, zval *op4, int self_var TSRMLS_DC){ +void zephir_concat_vsvv(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, zval *op4, int self_var){ zval result_copy, op1_copy, op3_copy, op4_copy; int use_copy = 0, use_copy1 = 0, use_copy3 = 0, use_copy4 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } @@ -1612,29 +1566,27 @@ void zephir_concat_vsvv(zval **result, zval *op1, const char *op2, zend_uint op2 length = Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3) + Z_STRLEN_P(op4); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), op2, op2_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), op2, op2_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len, Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + op2_len + Z_STRLEN_P(op3), Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1653,21 +1605,21 @@ void zephir_concat_vsvv(zval **result, zval *op1, const char *op2, zend_uint op2 } -void zephir_concat_vv(zval **result, zval *op1, zval *op2, int self_var TSRMLS_DC){ +void zephir_concat_vv(zval *result, zval *op1, zval *op2, int self_var){ zval result_copy, op1_copy, op2_copy; int use_copy = 0, use_copy1 = 0, use_copy2 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } @@ -1676,27 +1628,25 @@ void zephir_concat_vv(zval **result, zval *op1, zval *op2, int self_var TSRMLS_D length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1711,21 +1661,21 @@ void zephir_concat_vv(zval **result, zval *op1, zval *op2, int self_var TSRMLS_D } -void zephir_concat_vvs(zval **result, zval *op1, zval *op2, const char *op3, zend_uint op3_len, int self_var TSRMLS_DC){ +void zephir_concat_vvs(zval *result, zval *op1, zval *op2, const char *op3, zend_uint op3_len, int self_var){ zval result_copy, op1_copy, op2_copy; int use_copy = 0, use_copy1 = 0, use_copy2 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } @@ -1734,28 +1684,26 @@ void zephir_concat_vvs(zval **result, zval *op1, zval *op2, const char *op3, zen length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + op3_len; if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), op3, op3_len); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), op3, op3_len); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1770,28 +1718,28 @@ void zephir_concat_vvs(zval **result, zval *op1, zval *op2, const char *op3, zen } -void zephir_concat_vvsv(zval **result, zval *op1, zval *op2, const char *op3, zend_uint op3_len, zval *op4, int self_var TSRMLS_DC){ +void zephir_concat_vvsv(zval *result, zval *op1, zval *op2, const char *op3, zend_uint op3_len, zval *op4, int self_var){ zval result_copy, op1_copy, op2_copy, op4_copy; int use_copy = 0, use_copy1 = 0, use_copy2 = 0, use_copy4 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } @@ -1800,29 +1748,27 @@ void zephir_concat_vvsv(zval **result, zval *op1, zval *op2, const char *op3, ze length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + op3_len + Z_STRLEN_P(op4); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), op3, op3_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), op3, op3_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + op3_len, Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1841,28 +1787,28 @@ void zephir_concat_vvsv(zval **result, zval *op1, zval *op2, const char *op3, ze } -void zephir_concat_vvv(zval **result, zval *op1, zval *op2, zval *op3, int self_var TSRMLS_DC){ +void zephir_concat_vvv(zval *result, zval *op1, zval *op2, zval *op3, int self_var){ zval result_copy, op1_copy, op2_copy, op3_copy; int use_copy = 0, use_copy1 = 0, use_copy2 = 0, use_copy3 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } @@ -1871,28 +1817,26 @@ void zephir_concat_vvv(zval **result, zval *op1, zval *op2, zval *op3, int self_ length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1911,35 +1855,35 @@ void zephir_concat_vvv(zval **result, zval *op1, zval *op2, zval *op3, int self_ } -void zephir_concat_vvvv(zval **result, zval *op1, zval *op2, zval *op3, zval *op4, int self_var TSRMLS_DC){ +void zephir_concat_vvvv(zval *result, zval *op1, zval *op2, zval *op3, zval *op4, int self_var){ zval result_copy, op1_copy, op2_copy, op3_copy, op4_copy; int use_copy = 0, use_copy1 = 0, use_copy2 = 0, use_copy3 = 0, use_copy4 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } @@ -1948,29 +1892,27 @@ void zephir_concat_vvvv(zval **result, zval *op1, zval *op2, zval *op3, zval *op length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3), Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3), Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -1993,49 +1935,49 @@ void zephir_concat_vvvv(zval **result, zval *op1, zval *op2, zval *op3, zval *op } -void zephir_concat_vvvvsvv(zval **result, zval *op1, zval *op2, zval *op3, zval *op4, const char *op5, zend_uint op5_len, zval *op6, zval *op7, int self_var TSRMLS_DC){ +void zephir_concat_vvvvsvv(zval *result, zval *op1, zval *op2, zval *op3, zval *op4, const char *op5, zend_uint op5_len, zval *op6, zval *op7, int self_var){ zval result_copy, op1_copy, op2_copy, op3_copy, op4_copy, op6_copy, op7_copy; int use_copy = 0, use_copy1 = 0, use_copy2 = 0, use_copy3 = 0, use_copy4 = 0, use_copy6 = 0, use_copy7 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op6) != IS_STRING) { - zend_make_printable_zval(op6, &op6_copy, &use_copy6); + use_copy6 = zend_make_printable_zval(op6, &op6_copy); if (use_copy6) { op6 = &op6_copy; } } if (Z_TYPE_P(op7) != IS_STRING) { - zend_make_printable_zval(op7, &op7_copy, &use_copy7); + use_copy7 = zend_make_printable_zval(op7, &op7_copy); if (use_copy7) { op7 = &op7_copy; } @@ -2044,32 +1986,30 @@ void zephir_concat_vvvvsvv(zval **result, zval *op1, zval *op2, zval *op3, zval length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6) + Z_STRLEN_P(op7); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); - } - - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3), Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4), op5, op5_len); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), Z_STRVAL_P(op7), Z_STRLEN_P(op7)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + ZVAL_STR(result, zend_string_alloc(length, 0)); + } + + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3), Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4), op5, op5_len); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4) + op5_len, Z_STRVAL_P(op6), Z_STRLEN_P(op6)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4) + op5_len + Z_STRLEN_P(op6), Z_STRVAL_P(op7), Z_STRLEN_P(op7)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -2100,42 +2040,42 @@ void zephir_concat_vvvvsvv(zval **result, zval *op1, zval *op2, zval *op3, zval } -void zephir_concat_vvvvv(zval **result, zval *op1, zval *op2, zval *op3, zval *op4, zval *op5, int self_var TSRMLS_DC){ +void zephir_concat_vvvvv(zval *result, zval *op1, zval *op2, zval *op3, zval *op4, zval *op5, int self_var){ zval result_copy, op1_copy, op2_copy, op3_copy, op4_copy, op5_copy; int use_copy = 0, use_copy1 = 0, use_copy2 = 0, use_copy3 = 0, use_copy4 = 0, use_copy5 = 0; uint offset = 0, length; if (Z_TYPE_P(op1) != IS_STRING) { - zend_make_printable_zval(op1, &op1_copy, &use_copy1); + use_copy1 = zend_make_printable_zval(op1, &op1_copy); if (use_copy1) { op1 = &op1_copy; } } if (Z_TYPE_P(op2) != IS_STRING) { - zend_make_printable_zval(op2, &op2_copy, &use_copy2); + use_copy2 = zend_make_printable_zval(op2, &op2_copy); if (use_copy2) { op2 = &op2_copy; } } if (Z_TYPE_P(op3) != IS_STRING) { - zend_make_printable_zval(op3, &op3_copy, &use_copy3); + use_copy3 = zend_make_printable_zval(op3, &op3_copy); if (use_copy3) { op3 = &op3_copy; } } if (Z_TYPE_P(op4) != IS_STRING) { - zend_make_printable_zval(op4, &op4_copy, &use_copy4); + use_copy4 = zend_make_printable_zval(op4, &op4_copy); if (use_copy4) { op4 = &op4_copy; } } if (Z_TYPE_P(op5) != IS_STRING) { - zend_make_printable_zval(op5, &op5_copy, &use_copy5); + use_copy5 = zend_make_printable_zval(op5, &op5_copy); if (use_copy5) { op5 = &op5_copy; } @@ -2144,30 +2084,28 @@ void zephir_concat_vvvvv(zval **result, zval *op1, zval *op2, zval *op3, zval *o length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4) + Z_STRLEN_P(op5); if (self_var) { - if (Z_TYPE_PP(result) != IS_STRING) { - zend_make_printable_zval(*result, &result_copy, &use_copy); + if (Z_TYPE_P(result) != IS_STRING) { + use_copy = zend_make_printable_zval(result, &result_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*result, (&result_copy)); + ZEPHIR_CPY_WRT_CTOR(result, (&result_copy)); } } - offset = Z_STRLEN_PP(result); + offset = Z_STRLEN_P(result); length += offset; - Z_STRVAL_PP(result) = (char *) str_erealloc(Z_STRVAL_PP(result), length + 1); + Z_STR_P(result) = zend_string_realloc(Z_STR_P(result), length, 0); } else { - Z_STRVAL_PP(result) = (char *) emalloc(length + 1); + ZVAL_STR(result, zend_string_alloc(length, 0)); } - memcpy(Z_STRVAL_PP(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3), Z_STRVAL_P(op4), Z_STRLEN_P(op4)); - memcpy(Z_STRVAL_PP(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4), Z_STRVAL_P(op5), Z_STRLEN_P(op5)); - Z_STRVAL_PP(result)[length] = 0; - Z_TYPE_PP(result) = IS_STRING; - Z_STRLEN_PP(result) = length; - + memcpy(Z_STRVAL_P(result) + offset, Z_STRVAL_P(op1), Z_STRLEN_P(op1)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2), Z_STRVAL_P(op3), Z_STRLEN_P(op3)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3), Z_STRVAL_P(op4), Z_STRLEN_P(op4)); + memcpy(Z_STRVAL_P(result) + offset + Z_STRLEN_P(op1) + Z_STRLEN_P(op2) + Z_STRLEN_P(op3) + Z_STRLEN_P(op4), Z_STRVAL_P(op5), Z_STRLEN_P(op5)); + Z_STRVAL_P(result)[length] = 0; + zend_string_forget_hash_val(Z_STR_P(result)); if (use_copy1) { zval_dtor(op1); } @@ -2194,9 +2132,10 @@ void zephir_concat_vvvvv(zval **result, zval *op1, zval *op2, zval *op3, zval *o } -void _zephir_concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) +void zephir_concat_function(zval *result, zval *op1, zval *op2) { - zval *tmp; + zval tmp; + SEPARATE_ZVAL_IF_NOT_REF(result); /* res == op1 == op2: won't leak @@ -2204,17 +2143,15 @@ void _zephir_concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) res == op2 != op1: will leak */ if (result == op2 && result != op1) { - ALLOC_INIT_ZVAL(tmp); - ZVAL_ZVAL(tmp, result, 1, 0); - if (1 == Z_REFCOUNT_P(result)) { - zval_dtor(result); - } - - op2 = tmp; + ZVAL_COPY_VALUE(&tmp, result); + ZVAL_NULL(result); + op2 = &tmp; } - - concat_function(result, op1, op2 TSRMLS_CC); - if (tmp) { - zval_ptr_dtor(&tmp); + else { + ZVAL_UNDEF(&tmp); } -} + + concat_function(result, op1, op2); + assert(!Z_REFCOUNTED(tmp) || 1 == Z_REFCOUNT(tmp)); + zval_dtor(&tmp); +} \ No newline at end of file diff --git a/ext/kernel/concat.h b/ext/kernel/concat.h index 12bac81bcc6..5af706822fc 100644 --- a/ext/kernel/concat.h +++ b/ext/kernel/concat.h @@ -1,194 +1,189 @@ #ifndef ZEPHIR_KERNEL_CONCAT_H #define ZEPHIR_KERNEL_CONCAT_H - #include #include - #include "kernel/main.h" - #define ZEPHIR_CONCAT_SV(result, op1, op2) \ - zephir_concat_sv(&result, op1, sizeof(op1)-1, op2, 0 TSRMLS_CC); + zephir_concat_sv(result, op1, sizeof(op1)-1, op2, 0); #define ZEPHIR_SCONCAT_SV(result, op1, op2) \ - zephir_concat_sv(&result, op1, sizeof(op1)-1, op2, 1 TSRMLS_CC); + zephir_concat_sv(result, op1, sizeof(op1)-1, op2, 1); #define ZEPHIR_CONCAT_SVS(result, op1, op2, op3) \ - zephir_concat_svs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, 0 TSRMLS_CC); + zephir_concat_svs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, 0); #define ZEPHIR_SCONCAT_SVS(result, op1, op2, op3) \ - zephir_concat_svs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, 1 TSRMLS_CC); + zephir_concat_svs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, 1); #define ZEPHIR_CONCAT_SVSSVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8) \ - zephir_concat_svssvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, 0 TSRMLS_CC); + zephir_concat_svssvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, 0); #define ZEPHIR_SCONCAT_SVSSVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8) \ - zephir_concat_svssvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, 1 TSRMLS_CC); + zephir_concat_svssvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, 1); #define ZEPHIR_CONCAT_SVSV(result, op1, op2, op3, op4) \ - zephir_concat_svsv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, 0 TSRMLS_CC); + zephir_concat_svsv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, 0); #define ZEPHIR_SCONCAT_SVSV(result, op1, op2, op3, op4) \ - zephir_concat_svsv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, 1 TSRMLS_CC); + zephir_concat_svsv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, 1); #define ZEPHIR_CONCAT_SVSVS(result, op1, op2, op3, op4, op5) \ - zephir_concat_svsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, 0 TSRMLS_CC); + zephir_concat_svsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, 0); #define ZEPHIR_SCONCAT_SVSVS(result, op1, op2, op3, op4, op5) \ - zephir_concat_svsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, 1 TSRMLS_CC); + zephir_concat_svsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, 1); #define ZEPHIR_CONCAT_SVSVSSVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8, op9, op10) \ - zephir_concat_svsvssvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, op9, op10, sizeof(op10)-1, 0 TSRMLS_CC); + zephir_concat_svsvssvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, op9, op10, sizeof(op10)-1, 0); #define ZEPHIR_SCONCAT_SVSVSSVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8, op9, op10) \ - zephir_concat_svsvssvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, op9, op10, sizeof(op10)-1, 1 TSRMLS_CC); + zephir_concat_svsvssvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, op9, op10, sizeof(op10)-1, 1); #define ZEPHIR_CONCAT_SVSVSV(result, op1, op2, op3, op4, op5, op6) \ - zephir_concat_svsvsv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, 0 TSRMLS_CC); + zephir_concat_svsvsv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, 0); #define ZEPHIR_SCONCAT_SVSVSV(result, op1, op2, op3, op4, op5, op6) \ - zephir_concat_svsvsv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, 1 TSRMLS_CC); + zephir_concat_svsvsv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, 1); #define ZEPHIR_CONCAT_SVSVSVS(result, op1, op2, op3, op4, op5, op6, op7) \ - zephir_concat_svsvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, 0 TSRMLS_CC); + zephir_concat_svsvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, 0); #define ZEPHIR_SCONCAT_SVSVSVS(result, op1, op2, op3, op4, op5, op6, op7) \ - zephir_concat_svsvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, 1 TSRMLS_CC); + zephir_concat_svsvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, 1); #define ZEPHIR_CONCAT_SVSVSVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8, op9) \ - zephir_concat_svsvsvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, 0 TSRMLS_CC); + zephir_concat_svsvsvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, 0); #define ZEPHIR_SCONCAT_SVSVSVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8, op9) \ - zephir_concat_svsvsvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, 1 TSRMLS_CC); + zephir_concat_svsvsvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, 1); #define ZEPHIR_CONCAT_SVSVSVSVSV(result, op1, op2, op3, op4, op5, op6, op7, op8, op9, op10) \ - zephir_concat_svsvsvsvsv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, op10, 0 TSRMLS_CC); + zephir_concat_svsvsvsvsv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, op10, 0); #define ZEPHIR_SCONCAT_SVSVSVSVSV(result, op1, op2, op3, op4, op5, op6, op7, op8, op9, op10) \ - zephir_concat_svsvsvsvsv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, op10, 1 TSRMLS_CC); + zephir_concat_svsvsvsvsv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, op10, 1); #define ZEPHIR_CONCAT_SVSVSVSVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8, op9, op10, op11) \ - zephir_concat_svsvsvsvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, op10, op11, sizeof(op11)-1, 0 TSRMLS_CC); + zephir_concat_svsvsvsvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, op10, op11, sizeof(op11)-1, 0); #define ZEPHIR_SCONCAT_SVSVSVSVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8, op9, op10, op11) \ - zephir_concat_svsvsvsvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, op10, op11, sizeof(op11)-1, 1 TSRMLS_CC); + zephir_concat_svsvsvsvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, sizeof(op5)-1, op6, op7, sizeof(op7)-1, op8, op9, sizeof(op9)-1, op10, op11, sizeof(op11)-1, 1); #define ZEPHIR_CONCAT_SVSVV(result, op1, op2, op3, op4, op5) \ - zephir_concat_svsvv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, 0 TSRMLS_CC); + zephir_concat_svsvv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, 0); #define ZEPHIR_SCONCAT_SVSVV(result, op1, op2, op3, op4, op5) \ - zephir_concat_svsvv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, 1 TSRMLS_CC); + zephir_concat_svsvv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, 1); #define ZEPHIR_CONCAT_SVSVVSV(result, op1, op2, op3, op4, op5, op6, op7) \ - zephir_concat_svsvvsv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, op6, sizeof(op6)-1, op7, 0 TSRMLS_CC); + zephir_concat_svsvvsv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, op6, sizeof(op6)-1, op7, 0); #define ZEPHIR_SCONCAT_SVSVVSV(result, op1, op2, op3, op4, op5, op6, op7) \ - zephir_concat_svsvvsv(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, op6, sizeof(op6)-1, op7, 1 TSRMLS_CC); + zephir_concat_svsvvsv(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, op6, sizeof(op6)-1, op7, 1); #define ZEPHIR_CONCAT_SVSVVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8) \ - zephir_concat_svsvvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, 0 TSRMLS_CC); + zephir_concat_svsvvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, 0); #define ZEPHIR_SCONCAT_SVSVVSVS(result, op1, op2, op3, op4, op5, op6, op7, op8) \ - zephir_concat_svsvvsvs(&result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, 1 TSRMLS_CC); + zephir_concat_svsvvsvs(result, op1, sizeof(op1)-1, op2, op3, sizeof(op3)-1, op4, op5, op6, sizeof(op6)-1, op7, op8, sizeof(op8)-1, 1); #define ZEPHIR_CONCAT_SVV(result, op1, op2, op3) \ - zephir_concat_svv(&result, op1, sizeof(op1)-1, op2, op3, 0 TSRMLS_CC); + zephir_concat_svv(result, op1, sizeof(op1)-1, op2, op3, 0); #define ZEPHIR_SCONCAT_SVV(result, op1, op2, op3) \ - zephir_concat_svv(&result, op1, sizeof(op1)-1, op2, op3, 1 TSRMLS_CC); + zephir_concat_svv(result, op1, sizeof(op1)-1, op2, op3, 1); #define ZEPHIR_CONCAT_SVVS(result, op1, op2, op3, op4) \ - zephir_concat_svvs(&result, op1, sizeof(op1)-1, op2, op3, op4, sizeof(op4)-1, 0 TSRMLS_CC); + zephir_concat_svvs(result, op1, sizeof(op1)-1, op2, op3, op4, sizeof(op4)-1, 0); #define ZEPHIR_SCONCAT_SVVS(result, op1, op2, op3, op4) \ - zephir_concat_svvs(&result, op1, sizeof(op1)-1, op2, op3, op4, sizeof(op4)-1, 1 TSRMLS_CC); + zephir_concat_svvs(result, op1, sizeof(op1)-1, op2, op3, op4, sizeof(op4)-1, 1); #define ZEPHIR_CONCAT_VS(result, op1, op2) \ - zephir_concat_vs(&result, op1, op2, sizeof(op2)-1, 0 TSRMLS_CC); + zephir_concat_vs(result, op1, op2, sizeof(op2)-1, 0); #define ZEPHIR_SCONCAT_VS(result, op1, op2) \ - zephir_concat_vs(&result, op1, op2, sizeof(op2)-1, 1 TSRMLS_CC); + zephir_concat_vs(result, op1, op2, sizeof(op2)-1, 1); #define ZEPHIR_CONCAT_VSV(result, op1, op2, op3) \ - zephir_concat_vsv(&result, op1, op2, sizeof(op2)-1, op3, 0 TSRMLS_CC); + zephir_concat_vsv(result, op1, op2, sizeof(op2)-1, op3, 0); #define ZEPHIR_SCONCAT_VSV(result, op1, op2, op3) \ - zephir_concat_vsv(&result, op1, op2, sizeof(op2)-1, op3, 1 TSRMLS_CC); + zephir_concat_vsv(result, op1, op2, sizeof(op2)-1, op3, 1); #define ZEPHIR_CONCAT_VSVS(result, op1, op2, op3, op4) \ - zephir_concat_vsvs(&result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, 0 TSRMLS_CC); + zephir_concat_vsvs(result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, 0); #define ZEPHIR_SCONCAT_VSVS(result, op1, op2, op3, op4) \ - zephir_concat_vsvs(&result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, 1 TSRMLS_CC); + zephir_concat_vsvs(result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, 1); #define ZEPHIR_CONCAT_VSVSV(result, op1, op2, op3, op4, op5) \ - zephir_concat_vsvsv(&result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, 0 TSRMLS_CC); + zephir_concat_vsvsv(result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, 0); #define ZEPHIR_SCONCAT_VSVSV(result, op1, op2, op3, op4, op5) \ - zephir_concat_vsvsv(&result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, 1 TSRMLS_CC); + zephir_concat_vsvsv(result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, 1); #define ZEPHIR_CONCAT_VSVSVS(result, op1, op2, op3, op4, op5, op6) \ - zephir_concat_vsvsvs(&result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, 0 TSRMLS_CC); + zephir_concat_vsvsvs(result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, 0); #define ZEPHIR_SCONCAT_VSVSVS(result, op1, op2, op3, op4, op5, op6) \ - zephir_concat_vsvsvs(&result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, 1 TSRMLS_CC); + zephir_concat_vsvsvs(result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, 1); #define ZEPHIR_CONCAT_VSVSVSV(result, op1, op2, op3, op4, op5, op6, op7) \ - zephir_concat_vsvsvsv(&result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, op7, 0 TSRMLS_CC); + zephir_concat_vsvsvsv(result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, op7, 0); #define ZEPHIR_SCONCAT_VSVSVSV(result, op1, op2, op3, op4, op5, op6, op7) \ - zephir_concat_vsvsvsv(&result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, op7, 1 TSRMLS_CC); + zephir_concat_vsvsvsv(result, op1, op2, sizeof(op2)-1, op3, op4, sizeof(op4)-1, op5, op6, sizeof(op6)-1, op7, 1); #define ZEPHIR_CONCAT_VSVV(result, op1, op2, op3, op4) \ - zephir_concat_vsvv(&result, op1, op2, sizeof(op2)-1, op3, op4, 0 TSRMLS_CC); + zephir_concat_vsvv(result, op1, op2, sizeof(op2)-1, op3, op4, 0); #define ZEPHIR_SCONCAT_VSVV(result, op1, op2, op3, op4) \ - zephir_concat_vsvv(&result, op1, op2, sizeof(op2)-1, op3, op4, 1 TSRMLS_CC); + zephir_concat_vsvv(result, op1, op2, sizeof(op2)-1, op3, op4, 1); #define ZEPHIR_CONCAT_VV(result, op1, op2) \ - zephir_concat_vv(&result, op1, op2, 0 TSRMLS_CC); + zephir_concat_vv(result, op1, op2, 0); #define ZEPHIR_SCONCAT_VV(result, op1, op2) \ - zephir_concat_vv(&result, op1, op2, 1 TSRMLS_CC); + zephir_concat_vv(result, op1, op2, 1); #define ZEPHIR_CONCAT_VVS(result, op1, op2, op3) \ - zephir_concat_vvs(&result, op1, op2, op3, sizeof(op3)-1, 0 TSRMLS_CC); + zephir_concat_vvs(result, op1, op2, op3, sizeof(op3)-1, 0); #define ZEPHIR_SCONCAT_VVS(result, op1, op2, op3) \ - zephir_concat_vvs(&result, op1, op2, op3, sizeof(op3)-1, 1 TSRMLS_CC); + zephir_concat_vvs(result, op1, op2, op3, sizeof(op3)-1, 1); #define ZEPHIR_CONCAT_VVSV(result, op1, op2, op3, op4) \ - zephir_concat_vvsv(&result, op1, op2, op3, sizeof(op3)-1, op4, 0 TSRMLS_CC); + zephir_concat_vvsv(result, op1, op2, op3, sizeof(op3)-1, op4, 0); #define ZEPHIR_SCONCAT_VVSV(result, op1, op2, op3, op4) \ - zephir_concat_vvsv(&result, op1, op2, op3, sizeof(op3)-1, op4, 1 TSRMLS_CC); + zephir_concat_vvsv(result, op1, op2, op3, sizeof(op3)-1, op4, 1); #define ZEPHIR_CONCAT_VVV(result, op1, op2, op3) \ - zephir_concat_vvv(&result, op1, op2, op3, 0 TSRMLS_CC); + zephir_concat_vvv(result, op1, op2, op3, 0); #define ZEPHIR_SCONCAT_VVV(result, op1, op2, op3) \ - zephir_concat_vvv(&result, op1, op2, op3, 1 TSRMLS_CC); + zephir_concat_vvv(result, op1, op2, op3, 1); #define ZEPHIR_CONCAT_VVVV(result, op1, op2, op3, op4) \ - zephir_concat_vvvv(&result, op1, op2, op3, op4, 0 TSRMLS_CC); + zephir_concat_vvvv(result, op1, op2, op3, op4, 0); #define ZEPHIR_SCONCAT_VVVV(result, op1, op2, op3, op4) \ - zephir_concat_vvvv(&result, op1, op2, op3, op4, 1 TSRMLS_CC); + zephir_concat_vvvv(result, op1, op2, op3, op4, 1); #define ZEPHIR_CONCAT_VVVVSVV(result, op1, op2, op3, op4, op5, op6, op7) \ - zephir_concat_vvvvsvv(&result, op1, op2, op3, op4, op5, sizeof(op5)-1, op6, op7, 0 TSRMLS_CC); + zephir_concat_vvvvsvv(result, op1, op2, op3, op4, op5, sizeof(op5)-1, op6, op7, 0); #define ZEPHIR_SCONCAT_VVVVSVV(result, op1, op2, op3, op4, op5, op6, op7) \ - zephir_concat_vvvvsvv(&result, op1, op2, op3, op4, op5, sizeof(op5)-1, op6, op7, 1 TSRMLS_CC); + zephir_concat_vvvvsvv(result, op1, op2, op3, op4, op5, sizeof(op5)-1, op6, op7, 1); #define ZEPHIR_CONCAT_VVVVV(result, op1, op2, op3, op4, op5) \ - zephir_concat_vvvvv(&result, op1, op2, op3, op4, op5, 0 TSRMLS_CC); + zephir_concat_vvvvv(result, op1, op2, op3, op4, op5, 0); #define ZEPHIR_SCONCAT_VVVVV(result, op1, op2, op3, op4, op5) \ - zephir_concat_vvvvv(&result, op1, op2, op3, op4, op5, 1 TSRMLS_CC); - - -void zephir_concat_sv(zval **result, const char *op1, zend_uint op1_len, zval *op2, int self_var TSRMLS_DC); -void zephir_concat_svs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, int self_var TSRMLS_DC); -void zephir_concat_svssvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, int self_var TSRMLS_DC); -void zephir_concat_svsv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, int self_var TSRMLS_DC); -void zephir_concat_svsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, int self_var TSRMLS_DC); -void zephir_concat_svsvssvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, zval *op9, const char *op10, zend_uint op10_len, int self_var TSRMLS_DC); -void zephir_concat_svsvsv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, int self_var TSRMLS_DC); -void zephir_concat_svsvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, int self_var TSRMLS_DC); -void zephir_concat_svsvsvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, int self_var TSRMLS_DC); -void zephir_concat_svsvsvsvsv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, zval *op10, int self_var TSRMLS_DC); -void zephir_concat_svsvsvsvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, zval *op10, const char *op11, zend_uint op11_len, int self_var TSRMLS_DC); -void zephir_concat_svsvv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, int self_var TSRMLS_DC); -void zephir_concat_svsvvsv(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, const char *op6, zend_uint op6_len, zval *op7, int self_var TSRMLS_DC); -void zephir_concat_svsvvsvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, int self_var TSRMLS_DC); -void zephir_concat_svv(zval **result, const char *op1, zend_uint op1_len, zval *op2, zval *op3, int self_var TSRMLS_DC); -void zephir_concat_svvs(zval **result, const char *op1, zend_uint op1_len, zval *op2, zval *op3, const char *op4, zend_uint op4_len, int self_var TSRMLS_DC); -void zephir_concat_vs(zval **result, zval *op1, const char *op2, zend_uint op2_len, int self_var TSRMLS_DC); -void zephir_concat_vsv(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, int self_var TSRMLS_DC); -void zephir_concat_vsvs(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, int self_var TSRMLS_DC); -void zephir_concat_vsvsv(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, int self_var TSRMLS_DC); -void zephir_concat_vsvsvs(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, int self_var TSRMLS_DC); -void zephir_concat_vsvsvsv(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, zval *op7, int self_var TSRMLS_DC); -void zephir_concat_vsvv(zval **result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, zval *op4, int self_var TSRMLS_DC); -void zephir_concat_vv(zval **result, zval *op1, zval *op2, int self_var TSRMLS_DC); -void zephir_concat_vvs(zval **result, zval *op1, zval *op2, const char *op3, zend_uint op3_len, int self_var TSRMLS_DC); -void zephir_concat_vvsv(zval **result, zval *op1, zval *op2, const char *op3, zend_uint op3_len, zval *op4, int self_var TSRMLS_DC); -void zephir_concat_vvv(zval **result, zval *op1, zval *op2, zval *op3, int self_var TSRMLS_DC); -void zephir_concat_vvvv(zval **result, zval *op1, zval *op2, zval *op3, zval *op4, int self_var TSRMLS_DC); -void zephir_concat_vvvvsvv(zval **result, zval *op1, zval *op2, zval *op3, zval *op4, const char *op5, zend_uint op5_len, zval *op6, zval *op7, int self_var TSRMLS_DC); -void zephir_concat_vvvvv(zval **result, zval *op1, zval *op2, zval *op3, zval *op4, zval *op5, int self_var TSRMLS_DC); -#define zephir_concat_function(d, l, r) _zephir_concat_function(d, l, r TSRMLS_CC) -void _zephir_concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - + zephir_concat_vvvvv(result, op1, op2, op3, op4, op5, 1); + + +void zephir_concat_sv(zval *result, const char *op1, zend_uint op1_len, zval *op2, int self_var); +void zephir_concat_svs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, int self_var); +void zephir_concat_svssvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, int self_var); +void zephir_concat_svsv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, int self_var); +void zephir_concat_svsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, int self_var); +void zephir_concat_svsvssvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, zval *op9, const char *op10, zend_uint op10_len, int self_var); +void zephir_concat_svsvsv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, int self_var); +void zephir_concat_svsvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, int self_var); +void zephir_concat_svsvsvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, int self_var); +void zephir_concat_svsvsvsvsv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, zval *op10, int self_var); +void zephir_concat_svsvsvsvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, const char *op5, zend_uint op5_len, zval *op6, const char *op7, zend_uint op7_len, zval *op8, const char *op9, zend_uint op9_len, zval *op10, const char *op11, zend_uint op11_len, int self_var); +void zephir_concat_svsvv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, int self_var); +void zephir_concat_svsvvsv(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, const char *op6, zend_uint op6_len, zval *op7, int self_var); +void zephir_concat_svsvvsvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, const char *op3, zend_uint op3_len, zval *op4, zval *op5, const char *op6, zend_uint op6_len, zval *op7, const char *op8, zend_uint op8_len, int self_var); +void zephir_concat_svv(zval *result, const char *op1, zend_uint op1_len, zval *op2, zval *op3, int self_var); +void zephir_concat_svvs(zval *result, const char *op1, zend_uint op1_len, zval *op2, zval *op3, const char *op4, zend_uint op4_len, int self_var); +void zephir_concat_vs(zval *result, zval *op1, const char *op2, zend_uint op2_len, int self_var); +void zephir_concat_vsv(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, int self_var); +void zephir_concat_vsvs(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, int self_var); +void zephir_concat_vsvsv(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, int self_var); +void zephir_concat_vsvsvs(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, int self_var); +void zephir_concat_vsvsvsv(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, const char *op4, zend_uint op4_len, zval *op5, const char *op6, zend_uint op6_len, zval *op7, int self_var); +void zephir_concat_vsvv(zval *result, zval *op1, const char *op2, zend_uint op2_len, zval *op3, zval *op4, int self_var); +void zephir_concat_vv(zval *result, zval *op1, zval *op2, int self_var); +void zephir_concat_vvs(zval *result, zval *op1, zval *op2, const char *op3, zend_uint op3_len, int self_var); +void zephir_concat_vvsv(zval *result, zval *op1, zval *op2, const char *op3, zend_uint op3_len, zval *op4, int self_var); +void zephir_concat_vvv(zval *result, zval *op1, zval *op2, zval *op3, int self_var); +void zephir_concat_vvvv(zval *result, zval *op1, zval *op2, zval *op3, zval *op4, int self_var); +void zephir_concat_vvvvsvv(zval *result, zval *op1, zval *op2, zval *op3, zval *op4, const char *op5, zend_uint op5_len, zval *op6, zval *op7, int self_var); +void zephir_concat_vvvvv(zval *result, zval *op1, zval *op2, zval *op3, zval *op4, zval *op5, int self_var); +void zephir_concat_function(zval *result, zval *op1, zval *op2); #endif /* ZEPHIR_KERNEL_CONCAT_H */ diff --git a/ext/kernel/debug.c b/ext/kernel/debug.c index 186f0ded81c..71ac24c51e9 100644 --- a/ext/kernel/debug.c +++ b/ext/kernel/debug.c @@ -29,288 +29,24 @@ #ifndef ZEPHIR_RELEASE -FILE *zephir_log = NULL; -int zephir_debug_trace = 0; -static zephir_debug_entry *start = NULL; -static zephir_debug_entry *active = NULL; - -/** - * Stars debug on file pipe - */ -int zephir_start_debug(){ - if(!zephir_log){ - zephir_log = stderr; - } - return SUCCESS; -} - -/** - * Stops debug process - */ -int zephir_stop_debug(){ - zephir_debug_entry *ptr = active; - zephir_debug_entry *this_entry = NULL; - while(ptr){ - this_entry = ptr; - ptr = ptr->prev; - efree(this_entry); - } - - zephir_log = NULL; - return SUCCESS; -} - -/** - * Executes a print_r on an interal zval - */ -int zephir_print_r(zval *userval TSRMLS_DC){ - zend_print_zval_r(userval, 0 TSRMLS_CC); - return SUCCESS; -} - -/** - * Internal fast zval dump - */ -int zephir_vdump(zval *uservar TSRMLS_DC){ - zephir_start_debug(); - if(!uservar){ - fprintf(zephir_log, "Null pointer\n"); - return SUCCESS; - } - switch(Z_TYPE_P(uservar)){ - case IS_NULL: - fprintf(zephir_log, "NULL \n"); - break; - case IS_BOOL: - fprintf(zephir_log, "Boolean: %s\n", Z_LVAL_P(uservar) ? "TRUE" : "FALSE"); - break; - case IS_LONG: - fprintf(zephir_log, "Long: %ld at %p, refcount=%d\n", Z_LVAL_P(uservar), uservar, Z_REFCOUNT_P(uservar)); - break; - case IS_DOUBLE: - fprintf(zephir_log, "Double: %f\n", Z_DVAL_P(uservar)); - break; - case IS_STRING: - fprintf(zephir_log, "String: %s(%d) at %p, refcount=%d\n", Z_STRVAL_P(uservar), Z_STRLEN_P(uservar), uservar, Z_REFCOUNT_P(uservar)); - break; - case IS_RESOURCE: - fprintf(zephir_log, "Resource\n"); - break; - case IS_ARRAY: - fprintf(zephir_log, "Array at %p, refcount=%d\n", uservar, Z_REFCOUNT_P(uservar)); - break; - case IS_OBJECT: - fprintf(zephir_log, "Object <%s> at %p\n", Z_OBJCE_P(uservar)->name, uservar); - break; - default: - fprintf(zephir_log, "Unknown\n"); +void zephir_vdump(zval *var, const char *func) +{ + if (Z_TYPE_P(var) > IS_CALLABLE) { + fprintf(stderr, "%s: (%p) has invalid type %u\n", func, var, Z_TYPE_P(var)); } - return SUCCESS; -} - -int zephir_dump_ce(zend_class_entry *ce TSRMLS_DC){ - char *message = emalloc(sizeof(char *)*120); - if(ce){ - sprintf(message, "- ClassType => %d", ce->type); - zephir_step_over(message); - if(ce->name){ - sprintf(message, "- ClassName => %s", ce->name); - zephir_step_over(message); - } else { - zephir_step_over("- ClassName => NULL"); - } - } else { - zephir_step_over("- NULL class entry :("); - } - return SUCCESS; -} - -int zephir_class_debug(zval *val TSRMLS_DC){ - char *message = emalloc(sizeof(char *)*120); - zend_class_entry *ce; - if(val){ - ce = Z_OBJCE_P(val); - if(ce){ - sprintf(message, "- MemoryAddress => %p", val); - zephir_step_over(message); - zephir_dump_ce(ce TSRMLS_CC); - } else { - zephir_step_over("- No class entry :("); - } - } else { - zephir_step_over("- this_ptr is null :("); - } - return SUCCESS; -} - -/** - * Append debug information to file - */ -int zephir_debug_str(char *what, char *message){ - fprintf(zephir_log, "%s", what); - fprintf(zephir_log, "%s", message); - fprintf(zephir_log, "\n"); - return SUCCESS; -} - -int zephir_debug_long(char *what, uint vlong){ - fprintf(zephir_log, "%s", what); - fprintf(zephir_log, "%u", vlong); - fprintf(zephir_log, "\n"); - return SUCCESS; -} - -int zephir_debug_screen(char *message){ - zephir_debug_space(); - fprintf(zephir_log, "%s\n", message); - return SUCCESS; -} - -int zephir_debug_method_call(zval *obj, char *method_name TSRMLS_DC){ - if(Z_TYPE_P(obj)==IS_OBJECT){ - zephir_debug_space(); - } else { - zephir_error_space(); - } - if(Z_TYPE_P(obj)==IS_OBJECT){ - fprintf(zephir_log, "Calling method %s::%s on Object at %p\n", Z_OBJCE_P(obj)->name, method_name, obj); - } else { - fprintf(zephir_log, "Calling method %s on non object :(\n", method_name); - } - return SUCCESS; -} - -int zephir_error_space(){ - int i; - fprintf(zephir_log, "[ERROR] "); - for(i=0;i "); - zephir_vdump(param TSRMLS_CC); - return SUCCESS; -} - -int zephir_debug_vdump(char *preffix, zval *value TSRMLS_DC){ - zephir_debug_space(); - fprintf(zephir_log, "%s", preffix); - zephir_vdump(value TSRMLS_CC); - return SUCCESS; -} - -int zephir_debug_assign(char *name, zval *value TSRMLS_DC){ - zephir_debug_space(); - fprintf(zephir_log, "Assign on %s with ", name); - zephir_vdump(value TSRMLS_CC); - return SUCCESS; -} - -int zephir_step_over(char *message){ - zephir_debug_screen(message); - return SUCCESS; -} - -int zephir_step_into(char *message){ - zephir_debug_trace++; - zephir_debug_screen(message); - return SUCCESS; -} - -int zephir_step_out(char *message){ - zephir_debug_screen(message); - zephir_debug_trace--; - return SUCCESS; -} - -/** - * Prints internal debug backtrace - */ -int zephir_debug_backtrace_internal(){ - int step = 0; - char *message; - zephir_debug_entry *ptr = active; - while(ptr){ - zephir_spprintf(&message, 0, "#%d %s::%s", step, ptr->class_name, ptr->method_name); - zephir_debug_screen(message); - efree(message); - ptr = ptr->prev; - step++; - } - return SUCCESS; -} -/** - * Appends a debug entry to internal execution scope - */ -int zephir_step_into_entry(char *class_name, char *method_name, int lineno){ - - char *message; - zephir_debug_entry *entry; - - if (!start) { - start = (zephir_debug_entry *) emalloc(sizeof(zephir_debug_entry)); - start->class_name = "__main__"; - start->method_name = "__init__"; - start->lineno = 0; - start->prev = NULL; - start->next = NULL; - active = start; - } - - zephir_spprintf(&message, 0, "Step Into %s::%s", class_name, method_name); - zephir_debug_screen(message); - efree(message); - - entry = emalloc(sizeof(zephir_debug_entry)); - entry->class_name = class_name; - entry->method_name = method_name; - entry->lineno = lineno; - entry->prev = active; - active->next = entry; - active = entry; - zephir_debug_trace++; - - return SUCCESS; -} - -/** - * Steps out current stack - */ -int zephir_step_out_entry(){ - - char *message; - zephir_debug_entry *prev; - if(active){ - - zephir_debug_trace--; - - zephir_spprintf(&message, 0, "Step out %s::%s", active->class_name, active->method_name); - zephir_debug_screen(message); - efree(message); - - prev = active->prev; - efree(active); - active = prev; + if (!Z_REFCOUNTED_P(var)) { + fprintf(stderr, "%s: (%p) is not reference-counted, type=%d\n", func, var, Z_TYPE_P(var)); + return; + } - } else { - fprintf(zephir_log, "Problem, stack?"); - return FAILURE; - } - return SUCCESS; + if (Z_REFCOUNT_P(var) == 0) { + fprintf(stderr, "%s: (%p) has 0 references, type=%d\n", func, var, Z_TYPE_P(var)); + } else { + if (Z_REFCOUNT_P(var) >= 1000000) { + fprintf(stderr, "%s: (%p) has too many references (%u), type=%d\n", func, var, Z_REFCOUNT_P(var), Z_TYPE_P(var)); + } + } } #endif diff --git a/ext/kernel/debug.h b/ext/kernel/debug.h index f34b86f7e05..c42ad6151fc 100644 --- a/ext/kernel/debug.h +++ b/ext/kernel/debug.h @@ -24,7 +24,9 @@ #include -#define PHV(v) zephir_vdump(v) +void zephir_vdump(zval *var, const char *func); + +#define PHV(v) zephir_vdump(zval *var, const char *func) #define PHPR(v) zephir_print_r(v) typedef struct _zephir_debug_entry { @@ -35,34 +37,23 @@ typedef struct _zephir_debug_entry { int lineno; } zephir_debug_entry; -int zephir_start_debug(); -int zephir_stop_debug(); - -int zephir_print_r(zval *userval TSRMLS_DC); -int zephir_vdump(zval *uservar TSRMLS_DC); -int zephir_debug_assign(char *name, zval *value TSRMLS_DC); -int zephir_vpdump(const zval **uservar TSRMLS_DC); -int zephir_dump_ce(zend_class_entry *ce TSRMLS_DC); -int zephir_class_debug(zval *val TSRMLS_DC); - -int zephir_debug_backtrace_internal(); -int zephir_debug_str(char *what, char *message); -int zephir_debug_long(char *what, uint vlong); -int zephir_debug_screen(char *message); - -int zephir_step_over(char *message); -int zephir_step_into(char *message); -int zephir_step_out(char *message); +/** The zval's reference count dump */ +#define RC_DUMP(zv) \ + do { \ + char *_n = (strrchr((#zv), '&') ? strrchr((#zv), '&') + 1 : (#zv)); \ + char *_f = (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__); \ + zval *_z = (zv); \ + if (Z_REFCOUNTED_P(_z)) { \ + fprintf(stderr, "[DUMP]: %s:%d %s (%p) refcount=%d, type=%d\n", _f, __LINE__, _n, _z, Z_REFCOUNT_P(_z), Z_TYPE_P(_z)); \ + } else { \ + fprintf(stderr, "[DUMP]: %s:%d %s (%p) is not reference-counted, type=%d\n", _f, __LINE__, _n, _z, Z_TYPE_P(_z)); \ + } \ + } while (0) -int zephir_step_into_entry(char *class_name, char *method_name, int lineno); -int zephir_step_out_entry(); -int zephir_debug_method_call(zval *obj, char *method_name TSRMLS_DC); -int zephir_debug_vdump(char *preffix, zval *value TSRMLS_DC); -int zephir_debug_param(zval *param TSRMLS_DC); +#else -int zephir_error_space(); -int zephir_debug_space(); +#define RC_DUMP(zv) -#endif -#endif +#endif /* ZEPHIR_RELEASE */ +#endif /* ZEPHIR_KERNEL_DEBUG_H */ diff --git a/ext/kernel/exception.c b/ext/kernel/exception.c index 13f1d76ca8d..035c8e50af9 100644 --- a/ext/kernel/exception.c +++ b/ext/kernel/exception.c @@ -37,44 +37,38 @@ /** * Throws a zval object as exception */ -void zephir_throw_exception(zval *object TSRMLS_DC){ - Z_ADDREF_P(object); - zend_throw_exception_object(object TSRMLS_CC); -} - -/** - * Throws a zval object as exception - */ -void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line TSRMLS_DC) { - +void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line) +{ zend_class_entry *default_exception_ce; int ZEPHIR_LAST_CALL_STATUS = 0; - zval *curline = NULL; + zval curline; + zval object_copy; + + ZVAL_UNDEF(&curline); ZEPHIR_MM_GROW(); if (Z_TYPE_P(object) != IS_OBJECT) { - zval *arg = object; - ALLOC_INIT_ZVAL(object); - object_init_ex(object, zend_exception_get_default(TSRMLS_C)); - ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, arg); - } - else { - Z_ADDREF_P(object); + ZVAL_COPY_VALUE(&object_copy, object); + object_init_ex(object, zend_exception_get_default()); + ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, &object_copy); + zval_ptr_dtor(&object_copy); } + Z_ADDREF_P(object); + if (line > 0) { ZEPHIR_CALL_METHOD(&curline, object, "getline", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(curline, 0)) { - default_exception_ce = zend_exception_get_default(TSRMLS_C); - zend_update_property_string(default_exception_ce, object, "file", sizeof("file") - 1, file TSRMLS_CC); - zend_update_property_long(default_exception_ce, object, "line", sizeof("line") - 1, line TSRMLS_CC); + if (ZEPHIR_IS_LONG(&curline, 0)) { + default_exception_ce = zend_exception_get_default(); + zend_update_property_string(default_exception_ce, object, SL("file"), file); + zend_update_property_long(default_exception_ce, object, SL("line"), line); } } if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { - zend_throw_exception_object(object TSRMLS_CC); + zend_throw_exception_object(object); } ZEPHIR_MM_RESTORE(); } @@ -82,28 +76,26 @@ void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line /** * Throws an exception with a single string parameter + debug info */ -void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *message, zend_uint message_len, const char *file, zend_uint line TSRMLS_DC) { - - zval *object, *msg; +void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *message, zend_uint message_len, const char *file, zend_uint line) +{ + zval object, msg; int ZEPHIR_LAST_CALL_STATUS = 0; zend_class_entry *default_exception_ce; - ALLOC_INIT_ZVAL(object); - object_init_ex(object, ce); + object_init_ex(&object, ce); - ALLOC_INIT_ZVAL(msg); - ZVAL_STRINGL(msg, message, message_len, 1); + ZVAL_STRINGL(&msg, message, message_len); - ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, msg); + ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); if (line > 0) { - default_exception_ce = zend_exception_get_default(TSRMLS_C); - zend_update_property_string(default_exception_ce, object, "file", sizeof("file")-1, file TSRMLS_CC); - zend_update_property_long(default_exception_ce, object, "line", sizeof("line")-1, line TSRMLS_CC); + default_exception_ce = zend_exception_get_default(); + zend_update_property_string(default_exception_ce, &object, "file", sizeof("file")-1, file); + zend_update_property_long(default_exception_ce, &object, "line", sizeof("line")-1, line); } if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { - zend_throw_exception_object(object TSRMLS_CC); + zend_throw_exception_object(&object); } zval_ptr_dtor(&msg); @@ -112,21 +104,19 @@ void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *messa /** * Throws an exception with a single string parameter */ -void zephir_throw_exception_string(zend_class_entry *ce, const char *message, zend_uint message_len TSRMLS_DC){ - - zval *object, *msg; +void zephir_throw_exception_string(zend_class_entry *ce, const char *message, zend_uint message_len) +{ + zval object, msg; int ZEPHIR_LAST_CALL_STATUS = 0; - ALLOC_INIT_ZVAL(object); - object_init_ex(object, ce); + object_init_ex(&object, ce); - ALLOC_INIT_ZVAL(msg); - ZVAL_STRINGL(msg, message, message_len, 1); + ZVAL_STRINGL(&msg, message, message_len); - ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, msg); + ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { - zend_throw_exception_object(object TSRMLS_CC); + zend_throw_exception_object(&object); } zval_ptr_dtor(&msg); @@ -135,71 +125,27 @@ void zephir_throw_exception_string(zend_class_entry *ce, const char *message, ze /** * Throws an exception with a string format as parameter */ -void zephir_throw_exception_format(zend_class_entry *ce TSRMLS_DC, const char *format, ...) { - - zval *object, *msg; +void zephir_throw_exception_format(zend_class_entry *ce, const char *format, ...) +{ + zval object, msg; int ZEPHIR_LAST_CALL_STATUS = 0, len; char *buffer; va_list args; - ALLOC_INIT_ZVAL(object); - object_init_ex(object, ce); + object_init_ex(&object, ce); va_start(args, format); len = vspprintf(&buffer, 0, format, args); va_end(args); - ALLOC_INIT_ZVAL(msg); - ZVAL_STRINGL(msg, buffer, len, 0); + ZVAL_STRINGL(&msg, buffer, len); + efree(buffer); - ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, msg); + ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { - zend_throw_exception_object(object TSRMLS_CC); + zend_throw_exception_object(&object); } zval_ptr_dtor(&msg); } - -/** - * Throws an exception with a single zval parameter - */ -void zephir_throw_exception_zval_debug(zend_class_entry *ce, zval *message, const char *file, zend_uint line TSRMLS_DC){ - - zval *object; - int ZEPHIR_LAST_CALL_STATUS = 0; - zend_class_entry *default_exception_ce; - - ALLOC_INIT_ZVAL(object); - object_init_ex(object, ce); - - ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, message); - - if (line > 0) { - default_exception_ce = zend_exception_get_default(TSRMLS_C); - zend_update_property_string(default_exception_ce, object, "file", sizeof("file")-1, file TSRMLS_CC); - zend_update_property_long(default_exception_ce, object, "line", sizeof("line")-1, line TSRMLS_CC); - } - - if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { - zend_throw_exception_object(object TSRMLS_CC); - } -} - -/** - * Throws an exception with a single zval parameter - */ -void zephir_throw_exception_zval(zend_class_entry *ce, zval *message TSRMLS_DC){ - - zval *object; - int ZEPHIR_LAST_CALL_STATUS = 0; - - ALLOC_INIT_ZVAL(object); - object_init_ex(object, ce); - - ZEPHIR_CALL_METHOD(NULL, object, "__construct", NULL, 0, message); - - if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { - zend_throw_exception_object(object TSRMLS_CC); - } -} diff --git a/ext/kernel/exception.h b/ext/kernel/exception.h index bfaedd467c5..13759cf810d 100644 --- a/ext/kernel/exception.h +++ b/ext/kernel/exception.h @@ -27,41 +27,38 @@ /** Exceptions */ #define ZEPHIR_THROW_EXCEPTION_STR(class_entry, message) \ do { \ - zephir_throw_exception_string(class_entry, message, strlen(message) TSRMLS_CC); \ + zephir_throw_exception_string(class_entry, message, strlen(message)); \ ZEPHIR_MM_RESTORE(); \ } while (0) #define ZEPHIR_THROW_EXCEPTION_DEBUG_STR(class_entry, message, file, line) \ do { \ - zephir_throw_exception_string_debug(class_entry, message, strlen(message), file, line TSRMLS_CC); \ + zephir_throw_exception_string_debug(class_entry, message, strlen(message), file, line); \ ZEPHIR_MM_RESTORE(); \ } while (0) #define ZEPHIR_THROW_EXCEPTION_ZVAL(class_entry, message) \ do { \ - zephir_throw_exception_zval(class_entry, message TSRMLS_CC); \ + zephir_throw_exception_zval(class_entry, message); \ ZEPHIR_MM_RESTORE(); \ } while (0) #define ZEPHIR_THROW_EXCEPTION_DEBUG_ZVAL(class_entry, message, file, line) \ do { \ - zephir_throw_exception_zval(class_entry, message, file, line TSRMLS_CC); \ + zephir_throw_exception_zval(class_entry, message, file, line); \ ZEPHIR_MM_RESTORE(); \ } while (0) -#define ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(class_entry, message, file, line) zephir_throw_exception_string_debug(class_entry, message, strlen(message), file, line TSRMLS_CC) -#define ZEPHIR_THROW_EXCEPTION_STRW(class_entry, message) zephir_throw_exception_string(class_entry, message, strlen(message) TSRMLS_CC) -#define ZEPHIR_THROW_EXCEPTION_ZVALW(class_entry, message) zephir_throw_exception_zval(class_entry, message TSRMLS_CC) -#define ZEPHIR_THROW_EXCEPTION_DEBUG_ZVALW(class_entry, message, file, line) zephir_throw_exception_zval_debug(class_entry, message, file, line TSRMLS_CC) +#define ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(class_entry, message, file, line) zephir_throw_exception_string_debug(class_entry, message, strlen(message), file, line) +#define ZEPHIR_THROW_EXCEPTION_STRW(class_entry, message) zephir_throw_exception_string(class_entry, message, strlen(message)) +#define ZEPHIR_THROW_EXCEPTION_ZVALW(class_entry, message) zephir_throw_exception_zval(class_entry, message) +#define ZEPHIR_THROW_EXCEPTION_DEBUG_ZVALW(class_entry, message, file, line) zephir_throw_exception_zval_debug(class_entry, message, file, line) /** Throw Exceptions */ -void zephir_throw_exception(zval *object TSRMLS_DC); -void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line TSRMLS_DC); -void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *message, zend_uint message_len, const char *file, zend_uint line TSRMLS_DC); -void zephir_throw_exception_string(zend_class_entry *ce, const char *message, zend_uint message_len TSRMLS_DC); -void zephir_throw_exception_zval(zend_class_entry *ce, zval *message TSRMLS_DC); -void zephir_throw_exception_zval_debug(zend_class_entry *ce, zval *message, const char *file, zend_uint line TSRMLS_DC); -void zephir_throw_exception_format(zend_class_entry *ce TSRMLS_DC, const char *format, ...); +void zephir_throw_exception_string(zend_class_entry *ce, const char *message, zend_uint message_len); +void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line); +void zephir_throw_exception_format(zend_class_entry *ce, const char *format, ...); +void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *message, zend_uint message_len, const char *file, zend_uint line); #endif /* ZEPHIR_KERNEL_EXCEPTIONS_H */ diff --git a/ext/kernel/exit.c b/ext/kernel/exit.c index 1484ff25b50..2a3b722e965 100644 --- a/ext/kernel/exit.c +++ b/ext/kernel/exit.c @@ -31,8 +31,8 @@ void zephir_exit_empty() zend_bailout(); } -void zephir_exit(zval *ptr) { - TSRMLS_FETCH(); +void zephir_exit(zval *ptr) +{ if (Z_TYPE_P(ptr) == IS_LONG) { EG(exit_status) = Z_LVAL_P(ptr); } else { diff --git a/ext/kernel/extended/fcall.c b/ext/kernel/extended/fcall.c deleted file mode 100644 index b17f907fd57..00000000000 --- a/ext/kernel/extended/fcall.c +++ /dev/null @@ -1,1373 +0,0 @@ - -/* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - +------------------------------------------------------------------------+ -*/ - -#include -#include "php_ext.h" - -#include -#include -#include - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "kernel/memory.h" -#include "kernel/string.h" -#include "kernel/operators.h" -#include "kernel/exception.h" -#include "kernel/backtrace.h" - -#if PHP_VERSION_ID >= 50600 - -#if ZEND_MODULE_API_NO >= 20141001 -void zephir_clean_and_cache_symbol_table(zend_array *symbol_table) -{ - if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) { - zend_array_destroy(symbol_table); - } else { - zend_symtable_clean(symbol_table); - *(++EG(symtable_cache_ptr)) = symbol_table; - } -} -#else -void zephir_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) -{ - if (EG(symtable_cache_ptr) >= EG(symtable_cache_limit)) { - zend_hash_destroy(symbol_table); - FREE_HASHTABLE(symbol_table); - } else { - zend_hash_clean(symbol_table); - *(++EG(symtable_cache_ptr)) = symbol_table; - } -} -#endif - -/** - * Latest version of zend_throw_exception_internal - */ -static void zephir_throw_exception_internal(zval *exception TSRMLS_DC) -{ - if (exception != NULL) { - zval *previous = EG(exception); - zend_exception_set_previous(exception, EG(exception) TSRMLS_CC); - EG(exception) = exception; - if (previous) { - return; - } - } - - if (!EG(current_execute_data)) { - if (EG(exception)) { - zend_exception_error(EG(exception), E_ERROR TSRMLS_CC); - } - zend_error(E_ERROR, "Exception thrown without a stack frame"); - } - - if (zend_throw_exception_hook) { - zend_throw_exception_hook(exception TSRMLS_CC); - } - - if (EG(current_execute_data)->opline == NULL || - (EG(current_execute_data)->opline + 1)->opcode == ZEND_HANDLE_EXCEPTION) { - /* no need to rethrow the exception */ - return; - } - - EG(opline_before_exception) = EG(current_execute_data)->opline; - EG(current_execute_data)->opline = EG(exception_op); -} - -int zephir_call_func_aparams_fast(zval **return_value_ptr, zephir_fcall_cache_entry **cache_entry, zend_uint param_count, zval *pparams[] TSRMLS_DC) -{ - zend_uint i; - zval **original_return_value; - HashTable *calling_symbol_table; - zend_op_array *original_op_array; - zend_op **original_opline_ptr; - zend_class_entry *current_scope; - zend_class_entry *current_called_scope; - zend_class_entry *calling_scope = NULL; - zend_class_entry *called_scope = NULL; - zend_execute_data execute_data; - zval ***params, ***params_array = NULL; - zval **static_params_array[10]; - zend_class_entry *old_scope = EG(scope); - zend_function_state *function_state = &EX(function_state); - zend_function *func; - zval *rv = NULL, **retval_ptr_ptr = return_value_ptr ? return_value_ptr : &rv; - - if (retval_ptr_ptr && *retval_ptr_ptr) { - zval_ptr_dtor(retval_ptr_ptr); - *retval_ptr_ptr = NULL; - } - - if (param_count) { - - if (UNEXPECTED(param_count > 10)) { - params_array = (zval***) emalloc(param_count * sizeof(zval**)); - params = params_array; - for (i = 0; i < param_count; ++i) { - params_array[i] = &pparams[i]; - } - } else { - params = static_params_array; - for (i = 0; i < param_count; ++i) { - static_params_array[i] = &pparams[i]; - } - } - } else { - params = NULL; - } - - if (!EG(active)) { - return FAILURE; /* executor is already inactive */ - } - - if (EG(exception)) { - return FAILURE; /* we would result in an instable executor otherwise */ - } - - /* Initialize execute_data */ - if (EG(current_execute_data)) { - execute_data = *EG(current_execute_data); - EX(op_array) = NULL; - EX(opline) = NULL; - EX(object) = NULL; - } else { - /* This only happens when we're called outside any execute()'s - * It shouldn't be strictly necessary to NULL execute_data out, - * but it may make bugs easier to spot - */ - memset(&execute_data, 0, sizeof(zend_execute_data)); - } - -#ifndef ZEPHIR_RELEASE - function_state->function = (*cache_entry)->f; - ++(*cache_entry)->times; -#else - function_state->function = *cache_entry; -#endif - func = function_state->function; - - calling_scope = NULL; - called_scope = NULL; - EX(object) = NULL; - - ZEND_VM_STACK_GROW_IF_NEEDED(param_count + 1); - - for (i = 0; i < param_count; i++) { - zval *param; - - if (ARG_SHOULD_BE_SENT_BY_REF(func, i + 1)) { - if (!PZVAL_IS_REF(*params[i]) && Z_REFCOUNT_PP(params[i]) > 1) { - zval *new_zval; - - if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) { - if (i || UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (EG(argument_stack)->top))) { - /* hack to clean up the stack */ - zend_vm_stack_push((void *) (zend_uintptr_t)i TSRMLS_CC); - zend_vm_stack_clear_multiple(0 TSRMLS_CC); - } - - zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given", - i+1, - func->common.scope ? func->common.scope->name : "", - func->common.scope ? "::" : "", - func->common.function_name); - return FAILURE; - } - - ALLOC_ZVAL(new_zval); - *new_zval = **params[i]; - zval_copy_ctor(new_zval); - Z_SET_REFCOUNT_P(new_zval, 1); - Z_DELREF_PP(params[i]); - *params[i] = new_zval; - } - Z_ADDREF_PP(params[i]); - Z_SET_ISREF_PP(params[i]); - param = *params[i]; - } else if (PZVAL_IS_REF(*params[i]) && (func->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) == 0 ) { - ALLOC_ZVAL(param); - *param = **(params[i]); - INIT_PZVAL(param); - zval_copy_ctor(param); - } else if (*params[i] != &EG(uninitialized_zval)) { - Z_ADDREF_PP(params[i]); - param = *params[i]; - } else { - ALLOC_ZVAL(param); - *param = **(params[i]); - INIT_PZVAL(param); - } - zend_vm_stack_push(param TSRMLS_CC); - } - - function_state->arguments = zend_vm_stack_top(TSRMLS_C); - zend_vm_stack_push((void*)(zend_uintptr_t)param_count TSRMLS_CC); - - current_scope = EG(scope); - EG(scope) = calling_scope; - - current_called_scope = EG(called_scope); - if (called_scope) { - EG(called_scope) = called_scope; - } else if (func->type != ZEND_INTERNAL_FUNCTION) { - EG(called_scope) = NULL; - } - - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = &execute_data; - - if (func->type == ZEND_USER_FUNCTION) { - - calling_symbol_table = EG(active_symbol_table); - EG(scope) = func->common.scope; - EG(active_symbol_table) = NULL; - - original_return_value = EG(return_value_ptr_ptr); - original_op_array = EG(active_op_array); - EG(return_value_ptr_ptr) = retval_ptr_ptr; - EG(active_op_array) = (zend_op_array *) function_state->function; - original_opline_ptr = EG(opline_ptr); - - zend_execute(EG(active_op_array) TSRMLS_CC); - - if (EG(active_symbol_table)) { - zephir_clean_and_cache_symbol_table(EG(active_symbol_table) TSRMLS_CC); - } - EG(active_symbol_table) = calling_symbol_table; - EG(active_op_array) = original_op_array; - EG(return_value_ptr_ptr)=original_return_value; - EG(opline_ptr) = original_opline_ptr; - } else if (func->type == ZEND_INTERNAL_FUNCTION) { - - ALLOC_INIT_ZVAL(*retval_ptr_ptr); - if (func->common.scope) { - EG(scope) = func->common.scope; - } - - func->internal_function.handler(param_count, *retval_ptr_ptr, retval_ptr_ptr, NULL, 1 TSRMLS_CC); - - if (EG(exception) && retval_ptr_ptr) { - zval_ptr_dtor(retval_ptr_ptr); - *retval_ptr_ptr = NULL; - } - - } else { /* ZEND_OVERLOADED_FUNCTION */ - ALLOC_INIT_ZVAL(*retval_ptr_ptr); - - /* Not sure what should be done here if it's a static method */ - zend_error(E_ERROR, "Cannot call overloaded function for non-object"); - - if (func->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - efree((char*)func->common.function_name); - } - efree(function_state->function); - - if (EG(exception) && retval_ptr_ptr) { - zval_ptr_dtor(retval_ptr_ptr); - *retval_ptr_ptr = NULL; - } - } - zend_vm_stack_clear_multiple(0 TSRMLS_CC); - - EG(called_scope) = current_called_scope; - EG(scope) = current_scope; - EG(current_execute_data) = EX(prev_execute_data); - - if (EG(exception)) { - zephir_throw_exception_internal(NULL TSRMLS_CC); - } - - EG(scope) = old_scope; - - if (UNEXPECTED(params_array != NULL)) { - efree(params_array); - } - - if (rv) { - zval_ptr_dtor(&rv); - } - - return SUCCESS; -} - -static int zephir_is_callable_check_class(const char *name, int name_len, zend_fcall_info_cache *fcc, int *strict_class, char **error TSRMLS_DC) /* {{{ */ -{ - int ret = 0; - zend_class_entry **pce; - char *lcname = zend_str_tolower_dup(name, name_len); - - *strict_class = 0; - if (name_len == sizeof("self") - 1 && - !memcmp(lcname, "self", sizeof("self") - 1)) { - if (!EG(scope)) { - if (error) *error = estrdup("cannot access self:: when no class scope is active"); - } else { - fcc->called_scope = EG(called_scope); - fcc->calling_scope = EG(scope); - if (!fcc->object_ptr) { - fcc->object_ptr = EG(This); - } - ret = 1; - } - } else if (name_len == sizeof("parent") - 1 && - !memcmp(lcname, "parent", sizeof("parent") - 1)) { - if (!EG(scope)) { - if (error) *error = estrdup("cannot access parent:: when no class scope is active"); - } else if (!EG(scope)->parent) { - if (error) *error = estrdup("cannot access parent:: when current class scope has no parent"); - } else { - fcc->called_scope = EG(called_scope); - fcc->calling_scope = EG(scope)->parent; - if (!fcc->object_ptr) { - fcc->object_ptr = EG(This); - } - *strict_class = 1; - ret = 1; - } - } else if (name_len == sizeof("static") - 1 && - !memcmp(lcname, "static", sizeof("static") - 1)) { - if (!EG(called_scope)) { - if (error) *error = estrdup("cannot access static:: when no class scope is active"); - } else { - fcc->called_scope = EG(called_scope); - fcc->calling_scope = EG(called_scope); - if (!fcc->object_ptr) { - fcc->object_ptr = EG(This); - } - *strict_class = 1; - ret = 1; - } - } else if (zend_lookup_class_ex(name, name_len, NULL, 1, &pce TSRMLS_CC) == SUCCESS) { - zend_class_entry *scope = EG(active_op_array) ? EG(active_op_array)->scope : NULL; - - fcc->calling_scope = *pce; - if (scope && !fcc->object_ptr && EG(This) && - instanceof_function(Z_OBJCE_P(EG(This)), scope TSRMLS_CC) && - instanceof_function(scope, fcc->calling_scope TSRMLS_CC)) { - fcc->object_ptr = EG(This); - fcc->called_scope = Z_OBJCE_P(fcc->object_ptr); - } else { - fcc->called_scope = fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : fcc->calling_scope; - } - *strict_class = 1; - ret = 1; - } else { - if (error) zephir_spprintf(error, 0, "class '%.*s' not found", name_len, name); - } - efree(lcname); - return ret; -} - -static int zephir_is_callable_check_func(int check_flags, zval *callable, zend_fcall_info_cache *fcc, int strict_class, char **error TSRMLS_DC) /* {{{ */ -{ - zend_class_entry *ce_org = fcc->calling_scope; - int retval = 0; - char *mname, *lmname; - const char *colon; - int clen, mlen; - zend_class_entry *last_scope; - HashTable *ftable; - int call_via_handler = 0; - - if (error) { - *error = NULL; - } - - fcc->calling_scope = NULL; - fcc->function_handler = NULL; - - if (!ce_org) { - /* Skip leading \ */ - if (Z_STRVAL_P(callable)[0] == '\\') { - mlen = Z_STRLEN_P(callable) - 1; - lmname = zend_str_tolower_dup(Z_STRVAL_P(callable) + 1, mlen); - } else { - mlen = Z_STRLEN_P(callable); - lmname = zend_str_tolower_dup(Z_STRVAL_P(callable), mlen); - } - /* Check if function with given name exists. - * This may be a compound name that includes namespace name */ - if (zend_hash_find(EG(function_table), lmname, mlen+1, (void**)&fcc->function_handler) == SUCCESS) { - efree(lmname); - return 1; - } - efree(lmname); - } - - /* Split name into class/namespace and method/function names */ - if ((colon = zend_memrchr(Z_STRVAL_P(callable), ':', Z_STRLEN_P(callable))) != NULL && - colon > Z_STRVAL_P(callable) && - *(colon-1) == ':' - ) { - colon--; - clen = colon - Z_STRVAL_P(callable); - mlen = Z_STRLEN_P(callable) - clen - 2; - - if (colon == Z_STRVAL_P(callable)) { - if (error) zephir_spprintf(error, 0, "invalid function name"); - return 0; - } - - /* This is a compound name. - * Try to fetch class and then find static method. */ - last_scope = EG(scope); - if (ce_org) { - EG(scope) = ce_org; - } - - if (!zephir_is_callable_check_class(Z_STRVAL_P(callable), clen, fcc, &strict_class, error TSRMLS_CC)) { - EG(scope) = last_scope; - return 0; - } - EG(scope) = last_scope; - - ftable = &fcc->calling_scope->function_table; - if (ce_org && !instanceof_function(ce_org, fcc->calling_scope TSRMLS_CC)) { - if (error) zephir_spprintf(error, 0, "class '%s' is not a subclass of '%s'", ce_org->name, fcc->calling_scope->name); - return 0; - } - mname = Z_STRVAL_P(callable) + clen + 2; - } else if (ce_org) { - /* Try to fetch find static method of given class. */ - mlen = Z_STRLEN_P(callable); - mname = Z_STRVAL_P(callable); - ftable = &ce_org->function_table; - fcc->calling_scope = ce_org; - } else { - /* We already checked for plain function before. */ - if (error && !(check_flags & IS_CALLABLE_CHECK_SILENT)) { - zephir_spprintf(error, 0, "function '%s' not found or invalid function name", Z_STRVAL_P(callable)); - } - return 0; - } - - lmname = zend_str_tolower_dup(mname, mlen); - if (strict_class && - fcc->calling_scope && - mlen == sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1 && - !memcmp(lmname, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME) - 1)) { - fcc->function_handler = fcc->calling_scope->constructor; - if (fcc->function_handler) { - retval = 1; - } - } else if (zend_hash_find(ftable, lmname, mlen+1, (void**)&fcc->function_handler) == SUCCESS) { - retval = 1; - if ((fcc->function_handler->op_array.fn_flags & ZEND_ACC_CHANGED) && - !strict_class && EG(scope) && - instanceof_function(fcc->function_handler->common.scope, EG(scope) TSRMLS_CC)) { - zend_function *priv_fbc; - - if (zend_hash_find(&EG(scope)->function_table, lmname, mlen+1, (void **) &priv_fbc)==SUCCESS - && priv_fbc->common.fn_flags & ZEND_ACC_PRIVATE - && priv_fbc->common.scope == EG(scope)) { - fcc->function_handler = priv_fbc; - } - } - } else { - if (fcc->object_ptr && fcc->calling_scope == ce_org) { - if (strict_class && ce_org->__call) { - fcc->function_handler = emalloc(sizeof(zend_internal_function)); - fcc->function_handler->internal_function.type = ZEND_INTERNAL_FUNCTION; - fcc->function_handler->internal_function.module = (ce_org->type == ZEND_INTERNAL_CLASS) ? ce_org->info.internal.module : NULL; - fcc->function_handler->internal_function.handler = zend_std_call_user_call; - fcc->function_handler->internal_function.arg_info = NULL; - fcc->function_handler->internal_function.num_args = 0; - fcc->function_handler->internal_function.scope = ce_org; - fcc->function_handler->internal_function.fn_flags = ZEND_ACC_CALL_VIA_HANDLER; - fcc->function_handler->internal_function.function_name = estrndup(mname, mlen); - call_via_handler = 1; - retval = 1; - } else if (Z_OBJ_HT_P(fcc->object_ptr)->get_method) { - fcc->function_handler = Z_OBJ_HT_P(fcc->object_ptr)->get_method(&fcc->object_ptr, mname, mlen, NULL TSRMLS_CC); - if (fcc->function_handler) { - if (strict_class && - (!fcc->function_handler->common.scope || - !instanceof_function(ce_org, fcc->function_handler->common.scope TSRMLS_CC))) { - if ((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - } else { - retval = 1; - call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0; - } - } - } - } else if (fcc->calling_scope) { - if (fcc->calling_scope->get_static_method) { - fcc->function_handler = fcc->calling_scope->get_static_method(fcc->calling_scope, mname, mlen TSRMLS_CC); - } else { - fcc->function_handler = zend_std_get_static_method(fcc->calling_scope, mname, mlen, NULL TSRMLS_CC); - } - if (fcc->function_handler) { - retval = 1; - call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0; - if (call_via_handler && !fcc->object_ptr && EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - instanceof_function(Z_OBJCE_P(EG(This)), fcc->calling_scope TSRMLS_CC)) { - fcc->object_ptr = EG(This); - } - } - } - } - - if (retval) { - if (fcc->calling_scope && !call_via_handler) { - if (!fcc->object_ptr && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) { - if (error) { - zephir_spprintf(error, 0, "cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name); - retval = 0; - } else { - zend_error(E_ERROR, "Cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name); - } - } else if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) { - int severity; - char *verb; - if (fcc->function_handler->common.fn_flags & ZEND_ACC_ALLOW_STATIC) { - severity = E_STRICT; - verb = "should not"; - } else { - /* An internal function assumes $this is present and won't check that. So PHP would crash by allowing the call. */ - severity = E_ERROR; - verb = "cannot"; - } - if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC) != 0) { - retval = 0; - } - if (EG(This) && instanceof_function(Z_OBJCE_P(EG(This)), fcc->calling_scope TSRMLS_CC)) { - fcc->object_ptr = EG(This); - if (error) { - zephir_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name, fcc->function_handler->common.function_name, verb, Z_OBJCE_P(EG(This))->name); - if (severity == E_ERROR) { - retval = 0; - } - } else if (retval) { - zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name, fcc->function_handler->common.function_name, verb, Z_OBJCE_P(EG(This))->name); - } - } else { - if (error) { - zephir_spprintf(error, 0, "non-static method %s::%s() %s be called statically", fcc->calling_scope->name, fcc->function_handler->common.function_name, verb); - if (severity == E_ERROR) { - retval = 0; - } - } else if (retval) { - zend_error(severity, "Non-static method %s::%s() %s be called statically", fcc->calling_scope->name, fcc->function_handler->common.function_name, verb); - } - } - } - } - } else if (error && !(check_flags & IS_CALLABLE_CHECK_SILENT)) { - if (fcc->calling_scope) { - if (error) zephir_spprintf(error, 0, "class '%s' does not have a method '%s'", fcc->calling_scope->name, mname); - } else { - if (error) zephir_spprintf(error, 0, "function '%s' does not exist", mname); - } - } - efree(lmname); - - if (fcc->object_ptr) { - fcc->called_scope = Z_OBJCE_P(fcc->object_ptr); - } - if (retval) { - fcc->initialized = 1; - } - return retval; -} - -static zend_bool zephir_is_callable_ex(zval *callable, zval *object_ptr, uint check_flags, char **callable_name, int *callable_name_len, zend_fcall_info_cache *fcc, char **error TSRMLS_DC) /* {{{ */ -{ - zend_bool ret; - int callable_name_len_local; - zend_fcall_info_cache fcc_local; - - if (callable_name) { - *callable_name = NULL; - } - if (callable_name_len == NULL) { - callable_name_len = &callable_name_len_local; - } - if (fcc == NULL) { - fcc = &fcc_local; - } - if (error) { - *error = NULL; - } - - fcc->initialized = 0; - fcc->calling_scope = NULL; - fcc->called_scope = NULL; - fcc->function_handler = NULL; - fcc->object_ptr = NULL; - - if (object_ptr && Z_TYPE_P(object_ptr) != IS_OBJECT) { - object_ptr = NULL; - } - if (object_ptr && - (!EG(objects_store).object_buckets || - !EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(object_ptr)].valid)) { - return 0; - } - - switch (Z_TYPE_P(callable)) { - - case IS_STRING: - if (object_ptr) { - fcc->object_ptr = object_ptr; - fcc->calling_scope = Z_OBJCE_P(object_ptr); - if (callable_name) { - char *ptr; - - *callable_name_len = fcc->calling_scope->name_length + Z_STRLEN_P(callable) + sizeof("::") - 1; - ptr = *callable_name = emalloc(*callable_name_len + 1); - memcpy(ptr, fcc->calling_scope->name, fcc->calling_scope->name_length); - ptr += fcc->calling_scope->name_length; - memcpy(ptr, "::", sizeof("::") - 1); - ptr += sizeof("::") - 1; - memcpy(ptr, Z_STRVAL_P(callable), Z_STRLEN_P(callable) + 1); - } - } else if (callable_name) { - *callable_name = estrndup(Z_STRVAL_P(callable), Z_STRLEN_P(callable)); - *callable_name_len = Z_STRLEN_P(callable); - } - if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY) { - fcc->called_scope = fcc->calling_scope; - return 1; - } - - ret = zephir_is_callable_check_func(check_flags, callable, fcc, 0, error TSRMLS_CC); - if (fcc == &fcc_local && - fcc->function_handler && - ((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION && - (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER)) || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - return ret; - - case IS_ARRAY: - { - zval **method = NULL; - zval **obj = NULL; - int strict_class = 0; - - if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2) { - zend_hash_index_find(Z_ARRVAL_P(callable), 0, (void **) &obj); - zend_hash_index_find(Z_ARRVAL_P(callable), 1, (void **) &method); - } - if (obj && method && - (Z_TYPE_PP(obj) == IS_OBJECT || - Z_TYPE_PP(obj) == IS_STRING) && - Z_TYPE_PP(method) == IS_STRING) { - - if (Z_TYPE_PP(obj) == IS_STRING) { - if (callable_name) { - char *ptr; - - *callable_name_len = Z_STRLEN_PP(obj) + Z_STRLEN_PP(method) + sizeof("::") - 1; - ptr = *callable_name = emalloc(*callable_name_len + 1); - memcpy(ptr, Z_STRVAL_PP(obj), Z_STRLEN_PP(obj)); - ptr += Z_STRLEN_PP(obj); - memcpy(ptr, "::", sizeof("::") - 1); - ptr += sizeof("::") - 1; - memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1); - } - - if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY) { - return 1; - } - - if (!zephir_is_callable_check_class(Z_STRVAL_PP(obj), Z_STRLEN_PP(obj), fcc, &strict_class, error TSRMLS_CC)) { - return 0; - } - - } else { - if (!EG(objects_store).object_buckets || - !EG(objects_store).object_buckets[Z_OBJ_HANDLE_PP(obj)].valid) { - return 0; - } - - fcc->calling_scope = Z_OBJCE_PP(obj); /* TBFixed: what if it's overloaded? */ - - fcc->object_ptr = *obj; - - if (callable_name) { - char *ptr; - - *callable_name_len = fcc->calling_scope->name_length + Z_STRLEN_PP(method) + sizeof("::") - 1; - ptr = *callable_name = emalloc(*callable_name_len + 1); - memcpy(ptr, fcc->calling_scope->name, fcc->calling_scope->name_length); - ptr += fcc->calling_scope->name_length; - memcpy(ptr, "::", sizeof("::") - 1); - ptr += sizeof("::") - 1; - memcpy(ptr, Z_STRVAL_PP(method), Z_STRLEN_PP(method) + 1); - } - - if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY) { - fcc->called_scope = fcc->calling_scope; - return 1; - } - } - - ret = zephir_is_callable_check_func(check_flags, *method, fcc, strict_class, error TSRMLS_CC); - if (fcc == &fcc_local && - fcc->function_handler && - ((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION && - (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER)) || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - return ret; - - } else { - if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2) { - if (!obj || (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT)) { - if (error) zephir_spprintf(error, 0, "first array member is not a valid class name or object"); - } else { - if (error) zephir_spprintf(error, 0, "second array member is not a valid method"); - } - } else { - if (error) zephir_spprintf(error, 0, "array must have exactly two members"); - } - if (callable_name) { - *callable_name = estrndup("Array", sizeof("Array")-1); - *callable_name_len = sizeof("Array") - 1; - } - } - } - return 0; - - case IS_OBJECT: - if (Z_OBJ_HANDLER_P(callable, get_closure) && Z_OBJ_HANDLER_P(callable, get_closure)(callable, &fcc->calling_scope, &fcc->function_handler, &fcc->object_ptr TSRMLS_CC) == SUCCESS) { - fcc->called_scope = fcc->calling_scope; - if (callable_name) { - zend_class_entry *ce = Z_OBJCE_P(callable); /* TBFixed: what if it's overloaded? */ - - *callable_name_len = ce->name_length + sizeof("::__invoke") - 1; - *callable_name = emalloc(*callable_name_len + 1); - memcpy(*callable_name, ce->name, ce->name_length); - memcpy((*callable_name) + ce->name_length, "::__invoke", sizeof("::__invoke")); - } - return 1; - } - /* break missing intentionally */ - - default: - if (callable_name) { - zval expr_copy; - int use_copy; - - zend_make_printable_zval(callable, &expr_copy, &use_copy); - *callable_name = estrndup(Z_STRVAL(expr_copy), Z_STRLEN(expr_copy)); - *callable_name_len = Z_STRLEN(expr_copy); - zval_dtor(&expr_copy); - } - if (error) zephir_spprintf(error, 0, "no array or string given"); - return 0; - } -} - -static zend_bool zephir_is_info_dynamic_callable(zephir_fcall_info *info, zend_fcall_info_cache *fcc, zend_class_entry *ce_org, int strict_class TSRMLS_DC) -{ - int call_via_handler = 0, retval = 0; - char *lcname = zend_str_tolower_dup(info->func_name, info->func_length); - - if (fcc->object_ptr && fcc->calling_scope == ce_org) { - if (strict_class && ce_org->__call) { - fcc->function_handler = emalloc(sizeof(zend_internal_function)); - fcc->function_handler->internal_function.type = ZEND_INTERNAL_FUNCTION; - fcc->function_handler->internal_function.module = (ce_org->type == ZEND_INTERNAL_CLASS) ? ce_org->info.internal.module : NULL; - fcc->function_handler->internal_function.handler = zend_std_call_user_call; - fcc->function_handler->internal_function.arg_info = NULL; - fcc->function_handler->internal_function.num_args = 0; - fcc->function_handler->internal_function.scope = ce_org; - fcc->function_handler->internal_function.fn_flags = ZEND_ACC_CALL_VIA_HANDLER; - fcc->function_handler->internal_function.function_name = estrndup(lcname, info->func_length); - call_via_handler = 1; - retval = 1; - } else if (Z_OBJ_HT_P(fcc->object_ptr)->get_method) { - fcc->function_handler = Z_OBJ_HT_P(fcc->object_ptr)->get_method(&fcc->object_ptr, lcname, info->func_length, NULL TSRMLS_CC); - if (fcc->function_handler) { - if (strict_class && - (!fcc->function_handler->common.scope || - !instanceof_function(ce_org, fcc->function_handler->common.scope TSRMLS_CC))) { - if ((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - } else { - call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0; - retval = 1; - } - } - } - } else if (fcc->calling_scope) { - if (fcc->calling_scope->get_static_method) { - fcc->function_handler = fcc->calling_scope->get_static_method(fcc->calling_scope, lcname, info->func_length TSRMLS_CC); - } else { - fcc->function_handler = zend_std_get_static_method(fcc->calling_scope, lcname, info->func_length, NULL TSRMLS_CC); - } - if (fcc->function_handler) { - call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0; - if (call_via_handler && !fcc->object_ptr && EG(This) && - Z_OBJ_HT_P(EG(This))->get_class_entry && - instanceof_function(Z_OBJCE_P(EG(This)), fcc->calling_scope TSRMLS_CC)) { - fcc->object_ptr = EG(This); - } - retval = 1; - } - } - - efree(lcname); - return retval; -} - -static zend_bool zephir_is_info_callable_ex(zephir_fcall_info *info, zend_fcall_info_cache *fcc TSRMLS_DC) -{ - int retval = 0; - zend_class_entry *ce_org = fcc->calling_scope; - zend_fcall_info_cache fcc_local; - - if (fcc == NULL) { - fcc = &fcc_local; - } - - fcc->initialized = 0; - fcc->calling_scope = NULL; - fcc->called_scope = NULL; - fcc->function_handler = NULL; - fcc->object_ptr = NULL; - - switch (info->type) { - - case ZEPHIR_FCALL_TYPE_FUNC: - - if (zend_hash_find(EG(function_table), info->func_name, info->func_length + 1, (void**)&fcc->function_handler) == SUCCESS) { - if (fcc == &fcc_local && - fcc->function_handler && - ((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION && - (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER)) || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - fcc->initialized = 1; - return 1; - } - break; - - case ZEPHIR_FCALL_TYPE_ZVAL_METHOD: - - if (!EG(objects_store).object_buckets || !EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(info->object_ptr)].valid) { - return 0; - } - - fcc->calling_scope = Z_OBJCE_P(info->object_ptr); /* TBFixed: what if it's overloaded? */ - fcc->called_scope = fcc->calling_scope; - fcc->object_ptr = info->object_ptr; - if (!ce_org) { - ce_org = fcc->calling_scope; - } - - if (zend_hash_find(&info->ce->function_table, info->func_name, info->func_length + 1, (void**)&fcc->function_handler) == SUCCESS) { - if (fcc == &fcc_local && - fcc->function_handler && - ((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION && - (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER)) || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - retval = 1; - } - - if (!retval) { - retval = zephir_is_info_dynamic_callable(info, fcc, ce_org, 0 TSRMLS_CC); - } - break; - - case ZEPHIR_FCALL_TYPE_CLASS_SELF_METHOD: - - if (!EG(scope)) { - return 0; // cannot access self:: when no class scope is active - } - - fcc->called_scope = EG(called_scope); - fcc->calling_scope = EG(scope); - if (!fcc->object_ptr) { - fcc->object_ptr = EG(This); - } - - if (zend_hash_find(&fcc->calling_scope->function_table, info->func_name, info->func_length + 1, (void**)&fcc->function_handler) == SUCCESS) { - if (fcc == &fcc_local && - fcc->function_handler && - ((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION && - (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER)) || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - retval = 1; - } - - if (!retval) { - retval = zephir_is_info_dynamic_callable(info, fcc, ce_org, 0 TSRMLS_CC); - } - break; - - case ZEPHIR_FCALL_TYPE_CLASS_PARENT_METHOD: - - if (!EG(scope)) { - return 0; // cannot access parent:: when no class scope is active - } - - if (!EG(scope)->parent) { - return 0; // cannot access parent:: when current class scope has no parent - } - - fcc->called_scope = EG(called_scope); - fcc->calling_scope = EG(scope)->parent; - if (!fcc->object_ptr) { - fcc->object_ptr = EG(This); - } - - if (zend_hash_find(&fcc->calling_scope->function_table, info->func_name, info->func_length + 1, (void**)&fcc->function_handler) == SUCCESS) { - if (fcc == &fcc_local && - fcc->function_handler && - ((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION && - (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER)) || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - retval = 1; - } - - if (!retval) { - retval = zephir_is_info_dynamic_callable(info, fcc, ce_org, 1 TSRMLS_CC); - } - break; - - case ZEPHIR_FCALL_TYPE_CLASS_STATIC_METHOD: - - if (!EG(called_scope)) { - return 0; // cannot access static:: when no class scope is active - } - - fcc->called_scope = EG(called_scope); - fcc->calling_scope = EG(called_scope); - if (!fcc->object_ptr) { - fcc->object_ptr = EG(This); - } - - if (zend_hash_find(&fcc->calling_scope->function_table, info->func_name, info->func_length + 1, (void**)&fcc->function_handler) == SUCCESS) { - if (fcc == &fcc_local && - fcc->function_handler && - ((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION && - (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER)) || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - retval = 1; - } - - if (!retval) { - retval = zephir_is_info_dynamic_callable(info, fcc, ce_org, 1 TSRMLS_CC); - } - break; - - case ZEPHIR_FCALL_TYPE_CE_METHOD: - { - zend_class_entry *scope = EG(active_op_array) ? EG(active_op_array)->scope : NULL; - - fcc->calling_scope = info->ce; - if (scope && !fcc->object_ptr && EG(This) && - instanceof_function(Z_OBJCE_P(EG(This)), scope TSRMLS_CC) && - instanceof_function(scope, fcc->calling_scope TSRMLS_CC)) { - fcc->object_ptr = EG(This); - fcc->called_scope = Z_OBJCE_P(fcc->object_ptr); - } else { - fcc->called_scope = fcc->object_ptr ? Z_OBJCE_P(fcc->object_ptr) : fcc->calling_scope; - } - - if (zend_hash_find(&fcc->calling_scope->function_table, info->func_name, info->func_length + 1, (void**)&fcc->function_handler) == SUCCESS) { - if (fcc == &fcc_local && - fcc->function_handler && - ((fcc->function_handler->type == ZEND_INTERNAL_FUNCTION && - (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER)) || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY || - fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) { - if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) { - efree((char*)fcc->function_handler->common.function_name); - } - efree(fcc->function_handler); - } - retval = 1; - } - - if (!retval) { - retval = zephir_is_info_dynamic_callable(info, fcc, ce_org, 1 TSRMLS_CC); - } - } - break; - } - - if (fcc->object_ptr) { - fcc->called_scope = Z_OBJCE_P(fcc->object_ptr); - } - if (retval) { - fcc->initialized = 1; - } - - return retval; -} - -int zephir_call_function_opt(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache, zephir_fcall_info *info TSRMLS_DC) -{ - zend_uint i; - zval **original_return_value; - HashTable *calling_symbol_table; - zend_op_array *original_op_array; - zend_op **original_opline_ptr; - zend_class_entry *current_scope; - zend_class_entry *current_called_scope; - zend_class_entry *calling_scope = NULL; - zend_class_entry *called_scope = NULL; - zval *current_this; - zend_execute_data execute_data; - zend_fcall_info_cache fci_cache_local; - zend_uint fn_flags; - - *fci->retval_ptr_ptr = NULL; - - if (!EG(active)) { - return FAILURE; /* executor is already inactive */ - } - - if (EG(exception)) { - return FAILURE; /* we would result in an instable executor otherwise */ - } - - /* Initialize execute_data */ - if (EG(current_execute_data)) { - execute_data = *EG(current_execute_data); - EX(op_array) = NULL; - EX(opline) = NULL; - EX(object) = NULL; - } else { - /* This only happens when we're called outside any execute()'s - * It shouldn't be strictly necessary to NULL execute_data out, - * but it may make bugs easier to spot - */ - memset(&execute_data, 0, sizeof(zend_execute_data)); - } - - if (!fci_cache || !fci_cache->initialized) { - char *callable_name; - char *error = NULL; - - if (!fci_cache) { - fci_cache = &fci_cache_local; - } - - if (!info) { - if (!zephir_is_callable_ex(fci->function_name, fci->object_ptr, IS_CALLABLE_CHECK_SILENT, &callable_name, NULL, fci_cache, &error TSRMLS_CC)) { - if (error) { - zend_error(E_WARNING, "Invalid callback %s, %s", callable_name, error); - efree(error); - } - if (callable_name) { - efree(callable_name); - } - return FAILURE; - } else { - if (error) { - zend_error(E_STRICT, "%s", error); - efree(error); - } - } - efree(callable_name); - } else { - if (!zephir_is_info_callable_ex(info, fci_cache TSRMLS_CC)) { - return FAILURE; - } - } - } - -#ifndef ZEPHIR_RELEASE - /*fprintf(stderr, "initialized: %d\n", fci_cache->initialized); - if (fci_cache->function_handler) { - if (fci_cache->function_handler->type == ZEND_INTERNAL_FUNCTION) { - fprintf(stderr, "function handler: %s\n", fci_cache->function_handler->common.function_name); - } else { - fprintf(stderr, "function handler: %s\n", "unknown"); - } - } else { - fprintf(stderr, "function handler: NONE\n"); - } - if (fci_cache->calling_scope) { - fprintf(stderr, "real calling_scope: %s (%p)\n", fci_cache->calling_scope->name, fci_cache->calling_scope); - } else { - fprintf(stderr, "real calling_scope: NONE\n"); - } - if (fci_cache->called_scope) { - fprintf(stderr, "real called_scope: %s (%p)\n", fci_cache->called_scope->name, fci_cache->called_scope); - } else { - fprintf(stderr, "real called_scope: NONE\n"); - }*/ -#endif - - EX(function_state).function = fci_cache->function_handler; - calling_scope = fci_cache->calling_scope; - called_scope = fci_cache->called_scope; - fci->object_ptr = fci_cache->object_ptr; - EX(object) = fci->object_ptr; - - if (fci->object_ptr && Z_TYPE_P(fci->object_ptr) == IS_OBJECT && - (!EG(objects_store).object_buckets || !EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(fci->object_ptr)].valid)) { - return FAILURE; - } - - fn_flags = EX(function_state).function->common.fn_flags; - if (fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { - if (fn_flags & ZEND_ACC_ABSTRACT) { - zend_error(E_ERROR, "Cannot call abstract method %s::%s()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name); - } - if (fn_flags & ZEND_ACC_DEPRECATED) { - zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated", - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", - EX(function_state).function->common.scope ? "::" : "", - EX(function_state).function->common.function_name); - } - } - - ZEND_VM_STACK_GROW_IF_NEEDED(fci->param_count + 1); - - for (i = 0; i < fci->param_count; i++) { - zval *param; - - if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)) { - if (!PZVAL_IS_REF(*fci->params[i]) && Z_REFCOUNT_PP(fci->params[i]) > 1) { - zval *new_zval; - - if (fci->no_separation && - !ARG_MAY_BE_SENT_BY_REF(EX(function_state).function, i + 1)) { - if (i || UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == (EG(argument_stack)->top))) { - /* hack to clean up the stack */ - zend_vm_stack_push((void *) (zend_uintptr_t)i TSRMLS_CC); - zend_vm_stack_clear_multiple(0 TSRMLS_CC); - } - - zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given", - i+1, - EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "", - EX(function_state).function->common.scope ? "::" : "", - EX(function_state).function->common.function_name); - return FAILURE; - } - - ALLOC_ZVAL(new_zval); - *new_zval = **fci->params[i]; - zval_copy_ctor(new_zval); - Z_SET_REFCOUNT_P(new_zval, 1); - Z_DELREF_PP(fci->params[i]); - *fci->params[i] = new_zval; - } - Z_ADDREF_PP(fci->params[i]); - Z_SET_ISREF_PP(fci->params[i]); - param = *fci->params[i]; - } else if (PZVAL_IS_REF(*fci->params[i]) && - /* don't separate references for __call */ - (EX(function_state).function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) == 0 ) { - ALLOC_ZVAL(param); - *param = **(fci->params[i]); - INIT_PZVAL(param); - zval_copy_ctor(param); - } else if (*fci->params[i] != &EG(uninitialized_zval)) { - Z_ADDREF_PP(fci->params[i]); - param = *fci->params[i]; - } else { - ALLOC_ZVAL(param); - *param = **(fci->params[i]); - INIT_PZVAL(param); - } - zend_vm_stack_push(param TSRMLS_CC); - } - - EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C); - zend_vm_stack_push((void*)(zend_uintptr_t)fci->param_count TSRMLS_CC); - - current_scope = EG(scope); - EG(scope) = calling_scope; - - current_this = EG(This); - - current_called_scope = EG(called_scope); - if (called_scope) { - EG(called_scope) = called_scope; - } else if (EX(function_state).function->type != ZEND_INTERNAL_FUNCTION) { - EG(called_scope) = NULL; - } - - if (fci->object_ptr) { - if ((EX(function_state).function->common.fn_flags & ZEND_ACC_STATIC)) { - EG(This) = NULL; - } else { - EG(This) = fci->object_ptr; - - if (!PZVAL_IS_REF(EG(This))) { - Z_ADDREF_P(EG(This)); /* For $this pointer */ - } else { - zval *this_ptr; - - ALLOC_ZVAL(this_ptr); - *this_ptr = *EG(This); - INIT_PZVAL(this_ptr); - zval_copy_ctor(this_ptr); - EG(This) = this_ptr; - } - } - } else { - EG(This) = NULL; - } - - EX(prev_execute_data) = EG(current_execute_data); - EG(current_execute_data) = &execute_data; - - if (EX(function_state).function->type == ZEND_USER_FUNCTION) { - - calling_symbol_table = EG(active_symbol_table); - EG(scope) = EX(function_state).function->common.scope; - if (fci->symbol_table) { - EG(active_symbol_table) = fci->symbol_table; - } else { - EG(active_symbol_table) = NULL; - } - - original_return_value = EG(return_value_ptr_ptr); - original_op_array = EG(active_op_array); - EG(return_value_ptr_ptr) = fci->retval_ptr_ptr; - EG(active_op_array) = (zend_op_array *) EX(function_state).function; - original_opline_ptr = EG(opline_ptr); - - //if (EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) { - // *fci->retval_ptr_ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC); - //} else { - zend_execute(EG(active_op_array) TSRMLS_CC); - //} - - if (!fci->symbol_table && EG(active_symbol_table)) { - zephir_clean_and_cache_symbol_table(EG(active_symbol_table) TSRMLS_CC); - } - EG(active_symbol_table) = calling_symbol_table; - EG(active_op_array) = original_op_array; - EG(return_value_ptr_ptr)=original_return_value; - EG(opline_ptr) = original_opline_ptr; - } else if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) { - int call_via_handler = (EX(function_state).function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0; - ALLOC_INIT_ZVAL(*fci->retval_ptr_ptr); - if (EX(function_state).function->common.scope) { - EG(scope) = EX(function_state).function->common.scope; - } - if (EXPECTED(zend_execute_internal == NULL)) { - /* saves one function call if zend_execute_internal is not used */ - EX(function_state).function->internal_function.handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); - } else { - zend_execute_internal(&execute_data, fci, 1 TSRMLS_CC); - } - /* We shouldn't fix bad extensions here, - because it can break proper ones (Bug #34045) - if (!EX(function_state).function->common.return_reference) - { - INIT_PZVAL(*fci->retval_ptr_ptr); - }*/ - if (EG(exception) && fci->retval_ptr_ptr) { - zval_ptr_dtor(fci->retval_ptr_ptr); - *fci->retval_ptr_ptr = NULL; - } - - if (call_via_handler) { - /* We must re-initialize function again */ - fci_cache->initialized = 0; - } - } else { /* ZEND_OVERLOADED_FUNCTION */ - ALLOC_INIT_ZVAL(*fci->retval_ptr_ptr); - - /* Not sure what should be done here if it's a static method */ - if (fci->object_ptr) { - Z_OBJ_HT_P(fci->object_ptr)->call_method(EX(function_state).function->common.function_name, fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); - } else { - zend_error(E_ERROR, "Cannot call overloaded function for non-object"); - } - - if (EX(function_state).function->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) { - efree((char*)EX(function_state).function->common.function_name); - } - efree(EX(function_state).function); - - if (EG(exception) && fci->retval_ptr_ptr) { - zval_ptr_dtor(fci->retval_ptr_ptr); - *fci->retval_ptr_ptr = NULL; - } - } - zend_vm_stack_clear_multiple(0 TSRMLS_CC); - - if (EG(This)) { - zval_ptr_dtor(&EG(This)); - } - EG(called_scope) = current_called_scope; - EG(scope) = current_scope; - EG(This) = current_this; - EG(current_execute_data) = EX(prev_execute_data); - - if (EG(exception)) { - zephir_throw_exception_internal(NULL TSRMLS_CC); - } - return SUCCESS; -} - -#endif diff --git a/ext/kernel/extended/fcall.h b/ext/kernel/extended/fcall.h deleted file mode 100644 index 7b0feedc38c..00000000000 --- a/ext/kernel/extended/fcall.h +++ /dev/null @@ -1,43 +0,0 @@ - -/* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - +------------------------------------------------------------------------+ -*/ - -#ifndef ZEPHIR_KERNEL_FCALL_EXT_H -#define ZEPHIR_KERNEL_FCALL_EXT_H - -#define ZEPHIR_FCALL_TYPE_UNKNOWN 0 -#define ZEPHIR_FCALL_TYPE_FUNC 1 -#define ZEPHIR_FCALL_TYPE_ZVAL_METHOD 2 -#define ZEPHIR_FCALL_TYPE_CLASS_PARENT_METHOD 3 -#define ZEPHIR_FCALL_TYPE_CLASS_SELF_METHOD 4 -#define ZEPHIR_FCALL_TYPE_CLASS_STATIC_METHOD 5 -#define ZEPHIR_FCALL_TYPE_CE_METHOD 6 - -typedef struct _zephir_fcall_info { - int type; - zend_class_entry *ce; - zval *object_ptr; - const char *class_name; - int class_length; - const char *func_name; - int func_length; -} zephir_fcall_info; - -int zephir_call_function_opt(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache, zephir_fcall_info *info TSRMLS_DC); -int zephir_call_func_aparams_fast(zval **return_value_ptr, zephir_fcall_cache_entry **cache_entry, uint param_count, zval **params TSRMLS_DC); - -#endif diff --git a/ext/kernel/fcall.c b/ext/kernel/fcall.c index 8555ee34c15..1a2f273c3a3 100644 --- a/ext/kernel/fcall.c +++ b/ext/kernel/fcall.c @@ -26,36 +26,17 @@ #include #include "kernel/main.h" -#include "kernel/extended/fcall.h" -#include "kernel/memory.h" #include "kernel/fcall.h" +#include "kernel/memory.h" #include "kernel/operators.h" #include "kernel/exception.h" #include "kernel/backtrace.h" - -static const unsigned char tolower_map[256] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, - 0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, - 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, - 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF, - 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, - 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF -}; +#include "kernel/variables.h" int zephir_has_constructor_ce(const zend_class_entry *ce) { while (ce) { - if (ce->constructor) { + if (ce->constructor != NULL) { return 1; } ce = ce->parent; @@ -63,846 +44,509 @@ int zephir_has_constructor_ce(const zend_class_entry *ce) return 0; } -#if 0 -static inline ulong zephir_update_hash(const char *arKey, uint nKeyLength, ulong hash) -{ - for (; nKeyLength >= 8; nKeyLength -= 8) { - hash = ((hash << 5) + hash) + *arKey++; - hash = ((hash << 5) + hash) + *arKey++; - hash = ((hash << 5) + hash) + *arKey++; - hash = ((hash << 5) + hash) + *arKey++; - hash = ((hash << 5) + hash) + *arKey++; - hash = ((hash << 5) + hash) + *arKey++; - hash = ((hash << 5) + hash) + *arKey++; - hash = ((hash << 5) + hash) + *arKey++; - } - - switch (nKeyLength) { - case 7: hash = ((hash << 5) + hash) + *arKey++; - /* no break */ - case 6: hash = ((hash << 5) + hash) + *arKey++; - /* no break */ - case 5: hash = ((hash << 5) + hash) + *arKey++; - /* no break */ - case 4: hash = ((hash << 5) + hash) + *arKey++; - /* no break */ - case 3: hash = ((hash << 5) + hash) + *arKey++; - /* no break */ - case 2: hash = ((hash << 5) + hash) + *arKey++; - /* no break */ - case 1: hash = ((hash << 5) + hash) + *arKey++; - /* no break */ - default: break; - } - - return hash; -} -#endif - -static char *zephir_fcall_possible_method(zend_class_entry *ce, const char *wrong_name TSRMLS_DC) +/** + * Creates a unique key to cache the current method/function call address for the current scope + */ +static int zephir_make_fcall_key(zend_string* s, zephir_call_type type, zend_class_entry *ce, zval *function, const zend_class_entry* called_scope) { - HashTable *methods; - HashPosition pos; - zend_function *method; - char *possible_method = NULL; - zval *left = NULL, *right = NULL, method_name; - zval *params[1]; - int count; + const zend_class_entry *calling_scope; + unsigned char t; - count = zend_hash_num_elements(&ce->function_table); - if (count > 0) { +#if PHP_VERSION_ID >= 70100 + calling_scope = zend_get_executed_scope(); +#else + calling_scope = EG(scope); +#endif - ZEPHIR_SINIT_VAR(method_name); - ZVAL_STRING(&method_name, wrong_name, 0); + switch (type) { + case zephir_fcall_parent: + if (UNEXPECTED(!calling_scope || !calling_scope->parent)) { + return FAILURE; + } - params[0] = &method_name; - zephir_call_func_aparams(&right, SL("metaphone"), NULL, 0, 1, params TSRMLS_CC); + calling_scope = calling_scope->parent; + break; - methods = &ce->function_table; - zend_hash_internal_pointer_reset_ex(methods, &pos); + case zephir_fcall_static: + calling_scope = called_scope; + if (UNEXPECTED(!calling_scope)) { + return FAILURE; + } - while (zend_hash_get_current_data_ex(methods, (void **) &method, &pos) == SUCCESS) { + break; - ZEPHIR_SINIT_VAR(method_name); - ZVAL_STRING(&method_name, method->common.function_name, 0); + case zephir_fcall_self: + /* EG(scope) */ + break; - if (left) { - zephir_ptr_dtor(&left); + case zephir_fcall_function: + if (Z_TYPE_P(function) == IS_OBJECT) { + return FAILURE; } - left = NULL; - params[0] = &method_name; - zephir_call_func_aparams(&left, SL("metaphone"), NULL, 0, 1, params TSRMLS_CC); + calling_scope = NULL; + called_scope = NULL; + break; - if (zephir_is_equal(left, right TSRMLS_CC)) { - possible_method = (char *) method->common.function_name; - break; - } + case zephir_fcall_ce: + calling_scope = ce; + called_scope = ce; + break; - zend_hash_move_forward_ex(methods, &pos); - } + case zephir_fcall_method: + if (Z_TYPE_P(function) == IS_OBJECT) { + return FAILURE; + } - if (left) { - zephir_ptr_dtor(&left); - } + calling_scope = ce; + called_scope = ce; + break; - if (right) { - zephir_ptr_dtor(&right); - } + default: + return FAILURE; } - return possible_method; -} - -/** - * Creates a unique key to cache the current method/function call address for the current scope - */ -static ulong zephir_make_fcall_key(char **result, size_t *length, const zend_class_entry *obj_ce, zephir_call_type type, zval *function_name TSRMLS_DC) -{ - const zend_class_entry *calling_scope = EG(scope); - char *buf = NULL, *c; - size_t l = 0, len = 0; - const size_t ppzce_size = sizeof(zend_class_entry**); - ulong hash = 5381; - - *result = NULL; - *length = 0; - - if (calling_scope && type == zephir_fcall_parent) { - calling_scope = calling_scope->parent; - if (UNEXPECTED(!calling_scope)) { - return 0; - } + if (called_scope == calling_scope) { + /* Calls within the same scope, this won't trigger magic methods or failures due to restricted visibility */ + t = 0; } - else if (type == zephir_fcall_static) { - calling_scope = EG(called_scope); - if (UNEXPECTED(!calling_scope)) { - return 0; - } + else if (called_scope && calling_scope && (instanceof_function(called_scope, calling_scope) || instanceof_function(calling_scope, called_scope))) { + /* Calls within the same chain of inheritance; can call protected methods */ + t = 1; } - - if ( - calling_scope - && obj_ce - && calling_scope != obj_ce - && !instanceof_function(obj_ce, calling_scope TSRMLS_CC) - && !instanceof_function(calling_scope, obj_ce TSRMLS_CC) - ) { - calling_scope = NULL; - } - - if (Z_TYPE_P(function_name) == IS_STRING) { - l = (size_t)(Z_STRLEN_P(function_name)) + 1; - c = Z_STRVAL_P(function_name); - len = 2 * ppzce_size + l + 1; - buf = emalloc(len); - - memcpy(buf, c, l); - memcpy(buf + l, &calling_scope, ppzce_size); - memcpy(buf + l + ppzce_size, &obj_ce, ppzce_size); - buf[len - 1] = '\0'; - } - else if (Z_TYPE_P(function_name) == IS_ARRAY) { - zval **method; - HashTable *function_hash = Z_ARRVAL_P(function_name); - if ( - function_hash->nNumOfElements == 2 - && zend_hash_index_find(function_hash, 1, (void**)&method) == SUCCESS - && Z_TYPE_PP(method) == IS_STRING - ) { - l = (size_t)(Z_STRLEN_PP(method)) + 1; - c = Z_STRVAL_PP(method); - len = 2 * ppzce_size + l + 1; - buf = emalloc(len); - - memcpy(buf, c, l); - memcpy(buf + l, &calling_scope, ppzce_size); - memcpy(buf + l + ppzce_size, &obj_ce, ppzce_size); - buf[len - 1] = '\0'; - } + else { + /* Can safely call only public methods */ + t = 2; } - if (EXPECTED(buf != NULL)) { - size_t i; - - for (i = 0; i < l; ++i) { - char c = buf[i]; - c = tolower_map[(unsigned char)c]; - - buf[i] = c; - hash = (hash << 5) + hash + c; + { + char* cls = calling_scope ? ZSTR_VAL(calling_scope->name) : ""; + size_t cls_len = calling_scope ? ZSTR_LEN(calling_scope->name) : 0; + char* mth = NULL; + size_t mth_len = 0; + char* buf; + + if (Z_TYPE_P(function) == IS_STRING) { + mth = Z_STRVAL_P(function); + mth_len = Z_STRLEN_P(function); + } + else if (Z_TYPE_P(function) == IS_ARRAY) { + zval *method; + HashTable *function_hash = Z_ARRVAL_P(function); + if ( + function_hash->nNumOfElements == 2 + && ((method = zend_hash_index_find(function_hash, 1)) != NULL) + && Z_TYPE_P(method) == IS_STRING + ) { + mth = Z_STRVAL_P(method); + mth_len = Z_STRLEN_P(method); + } } - for (i = l; i < len; ++i) { - char c = buf[i]; - hash = (hash << 5) + hash + c; + if (cls_len + 1 + mth_len + sizeof(unsigned char) > 255) { + return FAILURE; } + + ZSTR_LEN(s) = cls_len + 1 + mth_len + sizeof(unsigned char); + buf = ZSTR_VAL(s); + zend_str_tolower_copy(buf, cls, cls_len + 1); + zend_str_tolower_copy(buf + cls_len + 1, mth, mth_len); + buf[cls_len + 1 + mth_len] = t; + buf[cls_len + 1 + mth_len + sizeof(t)] = '\0'; } - *result = buf; - *length = len; - return hash; + ZSTR_H(s) = zend_hash_func(ZSTR_VAL(s), ZSTR_LEN(s)); + return SUCCESS; } -/** - * Creates a unique key to cache the current method/function call address for the current scope - */ -static ulong zephir_make_fcall_info_key(char **result, size_t *length, const zend_class_entry *obj_ce, zephir_call_type type, zephir_fcall_info *info TSRMLS_DC) +static void resolve_callable(zval* retval, zephir_call_type type, zend_class_entry *ce, zval *object, zval *function) { - const zend_class_entry *calling_scope = EG(scope); - char *buf = NULL, *c; - size_t l = 0, len = 0; - const size_t ppzce_size = sizeof(zend_class_entry**); - ulong hash = 5381; - - *result = NULL; - *length = 0; - - if (calling_scope && type == zephir_fcall_parent) { - calling_scope = calling_scope->parent; - if (UNEXPECTED(!calling_scope)) { - return 0; - } + if (type == zephir_fcall_function || IS_ARRAY == Z_TYPE_P(function) || IS_OBJECT == Z_TYPE_P(function)) { + ZVAL_COPY(retval, function); + return; } - else if (type == zephir_fcall_static) { - calling_scope = EG(called_scope); - if (UNEXPECTED(!calling_scope)) { - return 0; - } - } - - if ( - calling_scope - && obj_ce - && calling_scope != obj_ce - && !instanceof_function(obj_ce, calling_scope TSRMLS_CC) - && !instanceof_function(calling_scope, obj_ce TSRMLS_CC) - ) { - calling_scope = NULL; - } - - switch (info->type) { - case ZEPHIR_FCALL_TYPE_FUNC: + array_init_size(retval, 2); + zend_hash_real_init(Z_ARRVAL_P(retval), 1); + ZEND_HASH_FILL_PACKED(Z_ARRVAL_P(retval)) { + zval q; + switch (type) { + case zephir_fcall_parent: + zend_string_addref(i_parent); + ZVAL_STR(&q, i_parent); + ZEND_HASH_FILL_ADD(&q); + break; - l = (size_t)(info->func_length) + 1; - c = (char*) info->func_name; - len = 2 * ppzce_size + l + 1; - buf = emalloc(len); + case zephir_fcall_self: + zend_string_addref(i_self); + ZVAL_STR(&q, i_self); + ZEND_HASH_FILL_ADD(&q); + break; - memcpy(buf, c, l); - memcpy(buf + l, &calling_scope, ppzce_size); - memcpy(buf + l + ppzce_size, &obj_ce, ppzce_size); - buf[len - 1] = '\0'; - break; + case zephir_fcall_static: + zend_string_addref(i_static); + ZVAL_STR(&q, i_static); + ZEND_HASH_FILL_ADD(&q); + break; - case ZEPHIR_FCALL_TYPE_CLASS_SELF_METHOD: - case ZEPHIR_FCALL_TYPE_CLASS_STATIC_METHOD: - case ZEPHIR_FCALL_TYPE_CLASS_PARENT_METHOD: - l = (size_t)(info->func_length) + 2; /* reserve 1 char for fcall-type */ - c = (char*) info->func_name; - len = 2 * ppzce_size + l + 1; - buf = emalloc(len); - - buf[0] = info->type; - memcpy(buf + 1, c, l - 1); - memcpy(buf + l, &calling_scope, ppzce_size); - memcpy(buf + l + ppzce_size, &obj_ce, ppzce_size); - buf[len - 1] = '\0'; - break; + case zephir_fcall_ce: + assert(ce); + zend_string_addref(ce->name); + ZVAL_STR(&q, ce->name); + ZEND_HASH_FILL_ADD(&q); + break; - case ZEPHIR_FCALL_TYPE_CE_METHOD: - case ZEPHIR_FCALL_TYPE_ZVAL_METHOD: - l = (size_t)(info->func_length) + 1; - c = (char*) info->func_name; - len = 2 * ppzce_size + l + 1; - buf = emalloc(len); - - memcpy(buf, c, l); - memcpy(buf + l, &calling_scope, ppzce_size); - memcpy(buf + l + ppzce_size, &obj_ce, ppzce_size); - buf[len - 1] = '\0'; - break; - } + default: + assert(object); + Z_TRY_ADDREF_P(object); + ZEND_HASH_FILL_ADD(object); + break; + } - if (EXPECTED(buf != NULL)) { - size_t i; + Z_TRY_ADDREF_P(function); + ZEND_HASH_FILL_ADD(function); + } ZEND_HASH_FILL_END(); +} - for (i = 0; i < l; ++i) { - char c = buf[i]; - c = tolower_map[(unsigned char)c]; +static void populate_fcic(zend_fcall_info_cache* fcic, zephir_call_type type, zend_class_entry* ce, zval *this_ptr, zval *func, zend_class_entry* called_scope) +{ + zend_class_entry* calling_scope; - buf[i] = c; - hash = (hash << 5) + hash + c; - } +#if PHP_VERSION_ID < 70300 + fcic->initialized = 0; +#endif + fcic->function_handler = NULL; - for (i = l; i < len; ++i) { - char c = buf[i]; - hash = (hash << 5) + hash + c; - } + if (type == zephir_fcall_function && Z_TYPE_P(func) == IS_STRING) { +#if PHP_VERSION_ID < 70300 + fcic->initialized = 1; +#endif + fcic->called_scope = NULL; + fcic->calling_scope = NULL; + fcic->object = NULL; + return; } - *result = buf; - *length = len; - return hash; -} + fcic->called_scope = called_scope; -ZEPHIR_ATTR_NONNULL static void zephir_fcall_populate_fci_cache(zend_fcall_info_cache *fcic, zend_fcall_info *fci, zephir_call_type type TSRMLS_DC) -{ +#if PHP_VERSION_ID >= 70100 + calling_scope = zend_get_executed_scope(); +#else + calling_scope = EG(scope); +#endif + + fcic->object = this_ptr ? Z_OBJ_P(this_ptr) : NULL; switch (type) { case zephir_fcall_parent: - if (EG(scope) && EG(scope)->parent) { - fcic->calling_scope = EG(scope)->parent; - fcic->called_scope = EG(called_scope); - fcic->object_ptr = fci->object_ptr ? fci->object_ptr : EG(This); - fcic->initialized = 1; - } - - break; - - case zephir_fcall_self: - if (EG(scope)) { - fcic->calling_scope = EG(scope); - fcic->called_scope = EG(called_scope); - fcic->object_ptr = fci->object_ptr ? fci->object_ptr : EG(This); - fcic->initialized = 1; + if (UNEXPECTED(!calling_scope || !calling_scope->parent)) { + return; } + fcic->calling_scope = calling_scope->parent; break; case zephir_fcall_static: - if (EG(called_scope)) { - fcic->calling_scope = EG(called_scope); - fcic->called_scope = EG(called_scope); - fcic->object_ptr = fci->object_ptr ? fci->object_ptr : EG(This); - fcic->initialized = 1; + fcic->calling_scope = fcic->called_scope; + if (UNEXPECTED(!calling_scope)) { + return; } break; - case zephir_fcall_function: - fcic->calling_scope = NULL; - fcic->called_scope = NULL; - fcic->object_ptr = NULL; - fcic->initialized = 1; + case zephir_fcall_self: + fcic->calling_scope = calling_scope; break; - case zephir_fcall_ce: { - zend_class_entry *scope = EG(active_op_array) ? EG(active_op_array)->scope : NULL; - - fcic->initialized = 1; - fcic->calling_scope = EG(scope); - fcic->object_ptr = NULL; - - if (scope && EG(This) && instanceof_function(Z_OBJCE_P(EG(This)), scope TSRMLS_CC) && instanceof_function(scope, fcic->calling_scope TSRMLS_CC)) { - fcic->object_ptr = EG(This); - fcic->called_scope = Z_OBJCE_P(fcic->object_ptr); - } - else { - fcic->called_scope = fcic->calling_scope; - } - + case zephir_fcall_ce: + fcic->calling_scope = ce; + fcic->called_scope = ce; break; - } + case zephir_fcall_function: case zephir_fcall_method: - fcic->initialized = 1; - fcic->calling_scope = EG(scope); - fcic->object_ptr = fci->object_ptr; - if (fci->object_ptr) { - fcic->called_scope = Z_OBJCE_P(fci->object_ptr); - } - else if (EG(scope) && !(EG(called_scope) && instanceof_function(EG(called_scope), EG(scope) TSRMLS_CC))) { - fcic->called_scope = EG(scope); - } - else { - fcic->called_scope = EG(called_scope); + if (Z_TYPE_P(func) == IS_OBJECT) { + if (Z_OBJ_HANDLER_P(func, get_closure) && Z_OBJ_HANDLER_P(func, get_closure)(func, &fcic->calling_scope, &fcic->function_handler, &fcic->object) == SUCCESS) { + fcic->called_scope = fcic->calling_scope; + break; + } + + return; } + fcic->calling_scope = this_ptr ? Z_OBJCE_P(this_ptr) : NULL; + fcic->called_scope = fcic->calling_scope; break; default: -#ifndef ZEPHIR_RELEASE - fprintf(stderr, "%s: unknown call type (%d)\n", __func__, (int) type); - abort(); -#endif - fcic->initialized = 0; /* not strictly necessary but just to be safe */ - break; + return; } +#if PHP_VERSION_ID < 70300 + fcic->initialized = 1; +#endif } /** * Calls a function/method in the PHP userland */ -int zephir_call_user_function(zval **object_pp, zend_class_entry *obj_ce, zephir_call_type type, - zval *function_name, zval **retval_ptr_ptr, zephir_fcall_cache_entry **cache_entry, int cache_slot, zend_uint param_count, - zval *params[], zephir_fcall_info *info TSRMLS_DC) +int zephir_call_user_function(zval *object_pp, zend_class_entry *obj_ce, zephir_call_type type, + zval *function_name, zval *retval_ptr, zephir_fcall_cache_entry **cache_entry, int cache_slot, zend_uint param_count, + zval *params[]) { - zval ***params_ptr, ***params_array = NULL; - zval **static_params_array[10]; - zval *local_retval_ptr = NULL; + zval local_retval_ptr; int status; zend_fcall_info fci; - zend_fcall_info_cache fcic /* , clone */; + zend_fcall_info_cache fcic; zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - char *fcall_key = NULL; - size_t fcall_key_len; - ulong fcall_key_hash; - zephir_fcall_cache_entry **temp_cache_entry = NULL; - zend_class_entry *old_scope = EG(scope); - int reload_cache = 1; + char fcall_key[sizeof(zend_string) + 256]; + int key_ok = FAILURE; + zephir_fcall_cache_entry *temp_cache_entry = NULL; + zval callable; + zend_class_entry* called_scope = zend_get_called_scope(EG(current_execute_data)); assert(obj_ce || !object_pp); - - if (retval_ptr_ptr && *retval_ptr_ptr) { - zval_ptr_dtor(retval_ptr_ptr); - *retval_ptr_ptr = NULL; - } - - ++zephir_globals_ptr->recursive_lock; - - if (UNEXPECTED(zephir_globals_ptr->recursive_lock > 2048)) { - zend_error(E_ERROR, "Maximum recursion depth exceeded"); - return FAILURE; - } - - if (param_count) { - zend_uint i; - - if (UNEXPECTED(param_count > 10)) { - params_array = (zval***) emalloc(param_count * sizeof(zval**)); - params_ptr = params_array; - for (i = 0; i < param_count; ++i) { - params_array[i] = ¶ms[i]; - } - } else { - params_ptr = static_params_array; - for (i = 0; i < param_count; ++i) { - static_params_array[i] = ¶ms[i]; + ZVAL_UNDEF(&callable); + ZVAL_UNDEF(&local_retval_ptr); + + if ((!cache_entry || !*cache_entry) && zephir_globals_ptr->cache_enabled) { + int reload_cache = 1; + if (cache_slot > 0 && zephir_globals_ptr->scache[cache_slot]) { + reload_cache = 0; + temp_cache_entry = zephir_globals_ptr->scache[cache_slot]; + if (cache_entry) { + *cache_entry = temp_cache_entry; } } - } - else { - params_ptr = NULL; - } - - if (type != zephir_fcall_function && !object_pp) { - object_pp = EG(This) ? &EG(This) : NULL; - if (!obj_ce && object_pp) { - obj_ce = Z_OBJCE_PP(object_pp); - } - } - - if (obj_ce) { - EG(scope) = obj_ce; - } - if (!cache_entry || !*cache_entry) { - if (zephir_globals_ptr->cache_enabled) { + if (reload_cache) { + key_ok = zephir_make_fcall_key((zend_string*)fcall_key, type, (object_pp && type != zephir_fcall_ce ? Z_OBJCE_P(object_pp) : obj_ce), function_name, called_scope); + if (SUCCESS == key_ok) { + zend_string* zs = (zend_string*)fcall_key; - if (cache_slot > 0) { - if (zephir_globals_ptr->scache[cache_slot]) { - reload_cache = 0; - temp_cache_entry = &zephir_globals_ptr->scache[cache_slot]; - if (cache_entry) { - *cache_entry = *temp_cache_entry; - } - } - } + GC_SET_REFCOUNT(zs, 1); + GC_TYPE_INFO(zs) = IS_STRING; - if (reload_cache) { - if (info) { - fcall_key_hash = zephir_make_fcall_info_key(&fcall_key, &fcall_key_len, (object_pp && type != zephir_fcall_ce ? Z_OBJCE_PP(object_pp) : obj_ce), type, info TSRMLS_CC); - } else { - fcall_key_hash = zephir_make_fcall_key(&fcall_key, &fcall_key_len, (object_pp && type != zephir_fcall_ce ? Z_OBJCE_PP(object_pp) : obj_ce), type, function_name TSRMLS_CC); + temp_cache_entry = zend_hash_find_ptr(zephir_globals_ptr->fcache, zs); + if (temp_cache_entry) { + cache_entry = &temp_cache_entry; } } } } fci.size = sizeof(fci); +#if PHP_VERSION_ID < 70100 fci.function_table = obj_ce ? &obj_ce->function_table : EG(function_table); - fci.object_ptr = object_pp ? *object_pp : NULL; - fci.function_name = function_name; - fci.retval_ptr_ptr = retval_ptr_ptr ? retval_ptr_ptr : &local_retval_ptr; + fci.symbol_table = NULL; +#endif + fci.object = object_pp ? Z_OBJ_P(object_pp) : NULL; + fci.retval = retval_ptr ? retval_ptr : &local_retval_ptr; fci.param_count = param_count; - fci.params = params_ptr; + fci.params = NULL; fci.no_separation = 1; - fci.symbol_table = NULL; +#if PHP_VERSION_ID < 70300 fcic.initialized = 0; - fcic.function_handler = NULL; - fcic.calling_scope = NULL; - fcic.called_scope = NULL; - if (!cache_entry || !*cache_entry) { - if (fcall_key && zend_hash_quick_find(zephir_globals_ptr->fcache, fcall_key, fcall_key_len, fcall_key_hash, (void**)&temp_cache_entry) != FAILURE) { - zephir_fcall_populate_fci_cache(&fcic, &fci, type TSRMLS_CC); - -#ifndef ZEPHIR_RELEASE - fcic.function_handler = (*temp_cache_entry)->f; - ++(*temp_cache_entry)->times; -#else - fcic.function_handler = *temp_cache_entry; #endif - /*memcpy(&clone, &fcic, sizeof(clone));*/ + + if (cache_entry && *cache_entry) { + /* We have a cache record, initialize scope */ + populate_fcic(&fcic, type, obj_ce, object_pp, function_name, called_scope); + if (!fcic.function_handler) { + fcic.function_handler = *cache_entry; } - } else { - zephir_fcall_populate_fci_cache(&fcic, &fci, type TSRMLS_CC); -#ifndef ZEPHIR_RELEASE - fcic.function_handler = (*cache_entry)->f; - ++(*cache_entry)->times; -#else - fcic.function_handler = *cache_entry; -#endif + + ZVAL_UNDEF(&fci.function_name); + } + else if ((cache_entry && !*cache_entry) || zephir_globals_ptr->cache_enabled) { + /* The caller is interested in caching OR we have the call cache enabled */ + resolve_callable(&callable, type, (object_pp && type != zephir_fcall_ce ? Z_OBJCE_P(object_pp) : obj_ce), object_pp, function_name); + zend_is_callable_ex(&callable, fci.object, IS_CALLABLE_CHECK_SILENT, NULL, &fcic, NULL); } - /* Xdebug fix */ - //if (fcic.function_handler && fcic.function_handler->type == ZEND_INTERNAL_FUNCTION && fcic.function_handler->op_array) { - // fcic.function_handler->op_array.filename = "?"; - // fcic.function_handler->op_array.line_start = 0; - // fcic.function_handler->op_array.line_end = 0; - //} +#if PHP_VERSION_ID < 70300 + if (!fcic.initialized) { + resolve_callable(&callable, type, (object_pp && type != zephir_fcall_ce ? Z_OBJCE_P(object_pp) : obj_ce), object_pp, function_name); + ZVAL_COPY_VALUE(&fci.function_name, &callable); + } +#endif - /* fcic.initialized = 0; */ -#if PHP_VERSION_ID >= 50600 - status = ZEPHIR_ZEND_CALL_FUNCTION_WRAPPER(&fci, &fcic, info TSRMLS_CC); +#ifdef _MSC_VER + zval *p = emalloc(sizeof(zval) * (fci.param_count + 1)); #else - status = ZEPHIR_ZEND_CALL_FUNCTION_WRAPPER(&fci, &fcic TSRMLS_CC); + zval p[fci.param_count]; #endif + uint32_t i; + for (i = 0; i < fci.param_count; ++i) { + ZVAL_COPY_VALUE(&p[i], params[i]); + } -/* - if (fcic.initialized && cache_entry) { - if (fcic.called_scope != clone.called_scope) { - fprintf(stderr, "real called_scope: %s (%p)\n", fcic.called_scope->name, fcic.called_scope); - fprintf(stderr, "my called_scope: %s (%p)\n", clone.called_scope->name, clone.called_scope); - fprintf(stderr, "type: %d\n", (int)type); - } - - if (fcic.calling_scope != clone.calling_scope) { - fprintf(stderr, "real calling_scope: %s (%p)\n", fcic.calling_scope->name, fcic.calling_scope); - fprintf(stderr, "my calling_scope: %s (%p)\n", clone.calling_scope->name, clone.calling_scope); - fprintf(stderr, "type: %d\n", (int)type); - } - - if (fcic.object_ptr != clone.object_ptr) { - fprintf(stderr, "real object_ptr: %s (%p)\n", (fcic.object_ptr ? Z_OBJCE_P(fcic.object_ptr)->name : ""), fcic.object_ptr); - fprintf(stderr, "my object_ptr: %s (%p)\n", (clone.object_ptr ? Z_OBJCE_P(clone.object_ptr)->name : ""), clone.object_ptr); - fprintf(stderr, "type: %d\n", (int)type); - } + fci.params = p; + status = zend_call_function(&fci, &fcic); +#ifdef _MSC_VER + efree(p); +#endif - if (fcic.function_handler != clone.function_handler) { - fprintf(stderr, "real handler: %p (%s::%s)\n", fcic.function_handler, (fcic.function_handler->common.scope ? fcic.function_handler->common.scope->name : ""), fcic.function_handler->common.function_name); - fprintf(stderr, "my handler: %p (%s::%s)\n", clone.function_handler, (clone.function_handler->common.scope ? clone.function_handler->common.scope->name : ""), clone.function_handler->common.function_name); - fprintf(stderr, "type: %d\n", (int)type); - } + if (Z_TYPE(callable) != IS_UNDEF) { + zval_ptr_dtor(&callable); } -*/ - EG(scope) = old_scope; - if (!cache_entry || !*cache_entry) { - if (EXPECTED(status != FAILURE) && fcall_key && !temp_cache_entry && fcic.initialized) { -#ifndef ZEPHIR_RELEASE - zephir_fcall_cache_entry *cache_entry_temp = malloc(sizeof(zephir_fcall_cache_entry)); - cache_entry_temp->f = fcic.function_handler; - cache_entry_temp->times = 0; -#else - zephir_fcall_cache_entry *cache_entry_temp = fcic.function_handler; + /* Skip caching IF: + * call failed OR there was an exception (to be safe) OR cache key is not defined OR + * fcall cache was deinitialized OR we have a slot cache + */ + int initialized = 1; +#if PHP_VERSION_ID < 70300 + initialized = fcic.initialized; #endif - if (FAILURE == zend_hash_quick_add(zephir_globals_ptr->fcache, fcall_key, fcall_key_len, fcall_key_hash, &cache_entry_temp, sizeof(zephir_fcall_cache_entry*), NULL)) { -#ifndef ZEPHIR_RELEASE - free(temp_cache_entry); -#endif - } else { - if (cache_entry) { - *cache_entry = cache_entry_temp; - if (cache_slot > 0) { - zephir_globals_ptr->scache[cache_slot] = *cache_entry; - } - } + + if (EXPECTED(status != FAILURE) && !EG(exception) && SUCCESS == key_ok && initialized && !temp_cache_entry) { + zephir_fcall_cache_entry *cache_entry_temp = fcic.function_handler; + + if (cache_entry) { + *cache_entry = cache_entry_temp; + if (cache_slot > 0) { + zephir_globals_ptr->scache[cache_slot] = *cache_entry; } } - } - if (fcall_key) { - efree(fcall_key); + if (zephir_globals_ptr->cache_enabled) { + zend_string *zs = (zend_string*)fcall_key; + zend_hash_str_add_ptr(zephir_globals_ptr->fcache, ZSTR_VAL(zs), ZSTR_LEN(zs), cache_entry_temp); + } } - if (UNEXPECTED(params_array != NULL)) { - efree(params_array); + if (!retval_ptr) { + zval_ptr_dtor(&local_retval_ptr); } - - if (!retval_ptr_ptr) { - if (local_retval_ptr) { - zval_ptr_dtor(&local_retval_ptr); - } + else if (FAILURE == status || EG(exception)) { + ZVAL_NULL(retval_ptr); } - --zephir_globals_ptr->recursive_lock; return status; } -int zephir_call_func_aparams(zval **return_value_ptr, const char *func_name, uint func_length, +int zephir_call_func_aparams(zval *return_value_ptr, const char *func_name, uint func_length, zephir_fcall_cache_entry **cache_entry, int cache_slot, - uint param_count, zval **params TSRMLS_DC) + uint param_count, zval **params) { int status; - zval *rv = NULL, **rvp = return_value_ptr ? return_value_ptr : &rv; - zval *func = NULL; -#if PHP_VERSION_ID >= 50600 - zephir_fcall_info info; -#endif + zval rv, *rvp = return_value_ptr ? return_value_ptr : &rv; + + ZVAL_UNDEF(&rv); #ifndef ZEPHIR_RELEASE - if (return_value_ptr && *return_value_ptr) { + if (return_value_ptr != NULL && Z_TYPE_P(return_value_ptr) > IS_NULL) { fprintf(stderr, "%s: *return_value_ptr must be NULL\n", __func__); zephir_print_backtrace(); abort(); } #endif -#if PHP_VERSION_ID >= 50600 - - info.type = ZEPHIR_FCALL_TYPE_FUNC; - info.class_name = NULL; - info.func_name = func_name; - info.func_length = func_length; - - status = zephir_call_user_function(NULL, NULL, zephir_fcall_function, func, rvp, cache_entry, cache_slot, param_count, params, &info TSRMLS_CC); - -#else - - ALLOC_INIT_ZVAL(func); - ZVAL_STRINGL(func, func_name, func_length, 0); - - status = zephir_call_user_function(NULL, NULL, zephir_fcall_function, func, rvp, cache_entry, 0, param_count, params, NULL TSRMLS_CC); - -#endif + zval f; + ZVAL_STRINGL(&f, func_name, func_length); + status = zephir_call_user_function(NULL, NULL, zephir_fcall_function, &f, rvp, cache_entry, cache_slot, param_count, params); + zval_ptr_dtor(&f); if (status == FAILURE && !EG(exception)) { - zephir_throw_exception_format(spl_ce_RuntimeException TSRMLS_CC, "Call to undefined function %s()", func_name); - if (return_value_ptr) { - *return_value_ptr = NULL; - } - } else { - if (EG(exception)) { - status = FAILURE; - if (return_value_ptr) { - *return_value_ptr = NULL; - } - } + zephir_throw_exception_format(spl_ce_RuntimeException, "Call to undefined function %s()", func_name); + } else if (EG(exception)) { + status = FAILURE; } - if (rv) { + if (!return_value_ptr) { zval_ptr_dtor(&rv); } -#if PHP_VERSION_ID < 50600 - if (Z_REFCOUNT_P(func) > 1) { - zval_copy_ctor(func); - } else { - ZVAL_NULL(func); - } - zval_ptr_dtor(&func); -#endif - return status; } -int zephir_call_zval_func_aparams(zval **return_value_ptr, zval *func_name, +int zephir_call_zval_func_aparams(zval *return_value_ptr, zval *func_name, zephir_fcall_cache_entry **cache_entry, int cache_slot, - uint param_count, zval **params TSRMLS_DC) + uint param_count, zval **params) { int status; - zval *rv = NULL, **rvp = return_value_ptr ? return_value_ptr : &rv; + zval rv, *rvp = return_value_ptr ? return_value_ptr : &rv; + + ZVAL_UNDEF(&rv); #ifndef ZEPHIR_RELEASE - if (return_value_ptr && *return_value_ptr) { + if (return_value_ptr != NULL && Z_TYPE_P(return_value_ptr) > IS_NULL) { fprintf(stderr, "%s: *return_value_ptr must be NULL\n", __func__); zephir_print_backtrace(); abort(); } #endif - status = zephir_call_user_function(NULL, NULL, zephir_fcall_function, func_name, rvp, cache_entry, cache_slot, param_count, params, NULL TSRMLS_CC); + status = zephir_call_user_function(NULL, NULL, zephir_fcall_function, func_name, rvp, cache_entry, cache_slot, param_count, params); if (status == FAILURE && !EG(exception)) { - zephir_throw_exception_format(spl_ce_RuntimeException TSRMLS_CC, "Call to undefined function %s()", Z_TYPE_P(func_name) ? Z_STRVAL_P(func_name) : "undefined"); - if (return_value_ptr) { - *return_value_ptr = NULL; - } - } else { - if (EG(exception)) { - status = FAILURE; - if (return_value_ptr) { - *return_value_ptr = NULL; - } - } + zephir_throw_exception_format(spl_ce_RuntimeException, "Call to undefined function %s()", Z_TYPE_P(func_name) ? Z_STRVAL_P(func_name) : "undefined"); + } else if (EG(exception)) { + status = FAILURE; } - if (rv) { + if (!return_value_ptr) { zval_ptr_dtor(&rv); } return status; } -int zephir_call_class_method_aparams(zval **return_value_ptr, zend_class_entry *ce, zephir_call_type type, zval *object, +int zephir_call_class_method_aparams(zval *return_value, zend_class_entry *ce, zephir_call_type type, zval *object, const char *method_name, uint method_len, zephir_fcall_cache_entry **cache_entry, int cache_slot, - uint param_count, zval **params TSRMLS_DC) + uint param_count, zval **params) { - zval *rv = NULL, **rvp = return_value_ptr ? return_value_ptr : &rv; - zval *fn = NULL; -#if PHP_VERSION_ID < 50600 - zval *mn; -#endif int status; -#if PHP_VERSION_ID >= 50600 - zephir_fcall_info info; -#endif #ifndef ZEPHIR_RELEASE - if (return_value_ptr && *return_value_ptr) { - fprintf(stderr, "%s: *return_value_ptr must be NULL\n", __func__); + if (return_value != NULL && Z_TYPE_P(return_value) > IS_NULL) { + fprintf(stderr, "%s: *return_value must be IS_NULL or IS_UNDEF\n", __func__); zephir_print_backtrace(); abort(); } #endif - if (object) { - if (Z_TYPE_P(object) != IS_OBJECT) { - zephir_throw_exception_format(spl_ce_RuntimeException TSRMLS_CC, "Trying to call method %s on a non-object", method_name); - if (return_value_ptr) { - *return_value_ptr = NULL; - } - return FAILURE; - } - } - -#if PHP_VERSION_ID >= 50600 - - if (!cache_entry || !*cache_entry) { - - switch (type) { - - case zephir_fcall_parent: - info.type = ZEPHIR_FCALL_TYPE_CLASS_PARENT_METHOD; - break; - - case zephir_fcall_self: - assert(!ce); - info.type = ZEPHIR_FCALL_TYPE_CLASS_SELF_METHOD; - break; - - case zephir_fcall_static: - assert(!ce); - info.type = ZEPHIR_FCALL_TYPE_CLASS_STATIC_METHOD; - break; - - case zephir_fcall_ce: - assert(ce != NULL); - info.type = ZEPHIR_FCALL_TYPE_CE_METHOD; - info.ce = ce; - break; - - case zephir_fcall_method: - default: - assert(object != NULL); - info.type = ZEPHIR_FCALL_TYPE_ZVAL_METHOD; - info.object_ptr = object; - info.ce = ce; - break; + if (object && Z_TYPE_P(object) != IS_OBJECT) { + zephir_throw_exception_format(spl_ce_RuntimeException, "Trying to call method %s on a non-object", method_name); + if (return_value) { + ZVAL_NULL(return_value); } - - info.func_name = method_name; - info.func_length = method_len; - } - - status = zephir_call_user_function(object ? &object : NULL, ce, type, fn, rvp, cache_entry, cache_slot, param_count, params, &info TSRMLS_CC); - -#else - - ALLOC_INIT_ZVAL(fn); - if (!cache_entry || !*cache_entry) { - - array_init_size(fn, 2); - switch (type) { - case zephir_fcall_parent: add_next_index_stringl(fn, ZEND_STRL("parent"), 1); break; - case zephir_fcall_self: assert(!ce); add_next_index_stringl(fn, ZEND_STRL("self"), 1); break; - case zephir_fcall_static: assert(!ce); add_next_index_stringl(fn, ZEND_STRL("static"), 1); break; - - case zephir_fcall_ce: - assert(ce != NULL); - add_next_index_stringl(fn, ce->name, ce->name_length, 1); - break; - - case zephir_fcall_method: - default: - assert(object != NULL); - Z_ADDREF_P(object); - add_next_index_zval(fn, object); - break; - } - - ALLOC_INIT_ZVAL(mn); - ZVAL_STRINGL(mn, method_name, method_len, 1); - add_next_index_zval(fn, mn); - - } else { - ZVAL_STRINGL(fn, "undefined", sizeof("undefined")-1, 1); + return FAILURE; } - status = zephir_call_user_function(object ? &object : NULL, ce, type, fn, rvp, cache_entry, cache_slot, param_count, params, NULL TSRMLS_CC); - -#endif + zval method; + ZVAL_STRINGL(&method, method_name, method_len); + status = zephir_call_user_function(object, ce, type, &method, return_value, cache_entry, cache_slot, param_count, params); + zval_ptr_dtor(&method); if (status == FAILURE && !EG(exception)) { switch (type) { case zephir_fcall_parent: - zephir_throw_exception_format(spl_ce_RuntimeException TSRMLS_CC, "Call to undefined method parent::%s()", method_name); + zephir_throw_exception_format(spl_ce_RuntimeException, "Call to undefined method parent::%s()", method_name); break; case zephir_fcall_self: - zephir_throw_exception_format(spl_ce_RuntimeException TSRMLS_CC, "Call to undefined method self::%s()", method_name); + zephir_throw_exception_format(spl_ce_RuntimeException, "Call to undefined method self::%s()", method_name); break; case zephir_fcall_static: - zephir_throw_exception_format(spl_ce_RuntimeException TSRMLS_CC, "Call to undefined method static::%s()", method_name); + zephir_throw_exception_format(spl_ce_RuntimeException, "Call to undefined method static::%s()", method_name); break; case zephir_fcall_ce: - zephir_throw_exception_format(spl_ce_RuntimeException TSRMLS_CC, "Call to undefined method %s::%s()", ce->name, method_name); - break; - case zephir_fcall_method: - zephir_throw_exception_format(spl_ce_RuntimeException TSRMLS_CC, "Call to undefined method %s::%s()", ce->name, method_name); + zephir_throw_exception_format(spl_ce_RuntimeException, "Call to undefined method %s::%s()", ce->name, method_name); break; default: - zephir_throw_exception_format(spl_ce_RuntimeException TSRMLS_CC, "Call to undefined method ?::%s()", method_name); - } - - if (return_value_ptr) { - *return_value_ptr = NULL; + zephir_throw_exception_format(spl_ce_RuntimeException, "Call to undefined method ?::%s()", method_name); } - } else { - if (EG(exception)) { - status = FAILURE; - if (return_value_ptr) { - *return_value_ptr = NULL; - } - } - } - - if (rv) { - zval_ptr_dtor(&rv); + } else if (EG(exception)) { + status = FAILURE; } -#if PHP_VERSION_ID < 50600 - zval_ptr_dtor(&fn); -#endif - return status; } @@ -910,9 +554,8 @@ int zephir_call_class_method_aparams(zval **return_value_ptr, zend_class_entry * * Replaces call_user_func_array avoiding function lookup * This function does not return FAILURE if an exception has ocurred */ -int zephir_call_user_func_array_noex(zval *return_value, zval *handler, zval *params TSRMLS_DC){ - - zval *retval_ptr = NULL; +int zephir_call_user_func_array_noex(zval *return_value, zval *handler, zval *params) +{ zend_fcall_info fci; zend_fcall_info_cache fci_cache; char *is_callable_error = NULL; @@ -920,37 +563,26 @@ int zephir_call_user_func_array_noex(zval *return_value, zval *handler, zval *pa if (params && Z_TYPE_P(params) != IS_ARRAY) { ZVAL_NULL(return_value); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for zephir_call_user_func_array_noex()"); + php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for zephir_call_user_func_array_noex()"); return FAILURE; } - if (zend_fcall_info_init(handler, 0, &fci, &fci_cache, NULL, &is_callable_error TSRMLS_CC) == SUCCESS) { - if (is_callable_error) { - zend_error(E_STRICT, "%s", is_callable_error); - efree(is_callable_error); - } - status = SUCCESS; + zend_fcall_info_init(handler, 0, &fci, &fci_cache, NULL, &is_callable_error); + + if (is_callable_error) { + zend_error(E_WARNING, "%s", is_callable_error); + efree(is_callable_error); } else { - if (is_callable_error) { - zend_error(E_WARNING, "%s", is_callable_error); - efree(is_callable_error); - } else { - status = SUCCESS; - } + status = SUCCESS; } if (status == SUCCESS) { + zend_fcall_info_args(&fci, params); - zend_fcall_info_args(&fci, params TSRMLS_CC); - fci.retval_ptr_ptr = &retval_ptr; - - if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && fci.retval_ptr_ptr && *fci.retval_ptr_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, *fci.retval_ptr_ptr); - } + fci.retval = return_value; + zend_call_function(&fci, &fci_cache); - if (fci.params) { - efree(fci.params); - } + zend_fcall_info_args_clear(&fci, 1); } if (EG(exception)) { @@ -964,56 +596,42 @@ int zephir_call_user_func_array_noex(zval *return_value, zval *handler, zval *pa * If a retval_ptr is specified, PHP's implementation of zend_eval_stringl * simply prepends a "return " which causes only the first statement to be executed */ -void zephir_eval_php(zval *str, zval *retval_ptr, char *context TSRMLS_DC) +void zephir_eval_php(zval *str, zval *retval_ptr, char *context) { + zval local_retval; zend_op_array *new_op_array = NULL; - zend_uint original_compiler_options; - zend_op_array *original_active_op_array = EG(active_op_array); + uint32_t original_compiler_options; + + ZVAL_UNDEF(&local_retval); original_compiler_options = CG(compiler_options); CG(compiler_options) = ZEND_COMPILE_DEFAULT_FOR_EVAL; - new_op_array = zend_compile_string(str, context TSRMLS_CC); + new_op_array = zend_compile_string(str, context); CG(compiler_options) = original_compiler_options; if (new_op_array) { - zval *local_retval_ptr = NULL; - zval **original_return_value_ptr_ptr = EG(return_value_ptr_ptr); - zend_op **original_opline_ptr = EG(opline_ptr); - int orig_interactive = CG(interactive); - - EG(return_value_ptr_ptr) = &local_retval_ptr; - EG(active_op_array) = new_op_array; EG(no_extensions) = 1; - if (!EG(active_symbol_table)) { - zend_rebuild_symbol_table(TSRMLS_C); - } - CG(interactive) = 0; - zend_try { - zend_execute(new_op_array TSRMLS_CC); + zend_execute(new_op_array, &local_retval); } zend_catch { - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); zend_bailout(); } zend_end_try(); + EG(no_extensions) = 0; - CG(interactive) = orig_interactive; - if (local_retval_ptr) { + if (Z_TYPE(local_retval) != IS_UNDEF) { if (retval_ptr) { - COPY_PZVAL_TO_ZVAL(*retval_ptr, local_retval_ptr); + ZVAL_COPY_VALUE(retval_ptr, &local_retval); } else { - zval_ptr_dtor(&local_retval_ptr); + zval_ptr_dtor(&local_retval); } } else if (retval_ptr) { - INIT_ZVAL(*retval_ptr); + ZVAL_NULL(retval_ptr); } - EG(no_extensions) = 0; - EG(opline_ptr) = original_opline_ptr; - EG(active_op_array) = original_active_op_array; - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - EG(return_value_ptr_ptr) = original_return_value_ptr_ptr; + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); } } diff --git a/ext/kernel/fcall.h b/ext/kernel/fcall.h index 9850fbda936..5ba275ababe 100644 --- a/ext/kernel/fcall.h +++ b/ext/kernel/fcall.h @@ -25,7 +25,6 @@ #include "kernel/main.h" #include "kernel/memory.h" #include "kernel/fcall_internal.h" -#include "kernel/extended/fcall.h" #include #include @@ -53,219 +52,96 @@ typedef enum _zephir_call_type { #define ZEPHIR_FETCH_VA_ARGS #endif -/** - * @brief Invokes a function @a func_name and returns if the function fails due to an error or exception. - * @param[out] return_value_ptr function return value (zval**); can be @c NULL (in this case it is assumed that the caller is not interested in the return value) - * @param[in] func_name name of the function to call (const char*) - * @param arguments function arguments (zval*) - * @note If the call fails or an exception occurs, the memory frame is @em not restored. - * In this case if @c return_value_ptr is not @c NULL, *return_value_ptr is set to @c NULL - */ -#define ZEPHIR_CALL_FUNCTIONW(return_value_ptr, func_name, cache, cache_slot, ...) \ - do { \ - zephir_fcall_cache_entry **cache_entry_ = cache; \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - if (__builtin_constant_p(func_name)) { \ - if (cache_entry_ && *cache_entry_) { \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams_fast(return_value_ptr, cache, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } else { \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, sizeof(func_name)-1, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } \ - } else { \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, strlen(func_name), ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } \ - } while (0) - -/** - * @brief Invokes a function @a func_name and returns if the function fails due to an error or exception. - * @param[out] return_value_ptr function return value (zval**); can be @c NULL (in this case it is assumed that the caller is not interested in the return value) - * @param[in] func_name name of the function to call (const char*) - * @param arguments function arguments (zval*) - * @note If the call fails or an exception occurs, the memory frame is restored. - * In this case if @c return_value_ptr is not @c NULL, *return_value_ptr is set to @c NULL - */ -#if PHP_VERSION_ID >= 50600 - #define ZEPHIR_CALL_FUNCTION(return_value_ptr, func_name, cache, cache_slot, ...) \ do { \ zephir_fcall_cache_entry **cache_entry_ = cache; \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - if (__builtin_constant_p(func_name)) { \ - if (cache_entry_ && *cache_entry_) { \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams_fast(return_value_ptr, cache, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } else { \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, sizeof(func_name)-1, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } \ - } else { \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, strlen(func_name), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, strlen(func_name), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#else - -#define ZEPHIR_CALL_FUNCTION(return_value_ptr, func_name, cache, cache_slot, ...) \ +#define ZEPHIR_CALL_ZVAL_FUNCTION(return_value_ptr, func_name, cache, cache_slot, ...) \ do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ - ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_func_aparams(return_value_ptr, func_name, strlen(func_name), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ + zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ + ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_zval_func_aparams(return_value_ptr, func_name, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#endif +/* Saves the if pointer, and called/calling scope */ +#define ZEPHIR_BACKUP_THIS_PTR() \ + zend_object *old_this_ptr = Z_OBJ(EG(current_execute_data)->This) ? Z_OBJ(EG(current_execute_data)->This) : NULL; -/** - * @brief Invokes a function @a func_name passing @c return_value and @c return_value_ptr - * as return value address; returns if the function fails due to an error or exception. - * @param[in] func_name name of the function to call (const char*) - * @param arguments function arguments (zval*) - * @note If the call fails or an exception occurs, the memory frame is @em not restored. - * @li if @c return_value_ptr is not @c NULL, @c *return_value_ptr is initialized with @c ALLOC_INIT_ZVAL - * @li otherwise, if @c return_value is not @c NULL, @c return_value and @c *return_value are not changed - */ -#define ZEPHIR_RETURN_CALL_FUNCTIONW(func_name, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_function(return_value, return_value_ptr, func_name, strlen(func_name), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } while (0) +#define ZEPHIR_RESTORE_THIS_PTR() do { \ + if (old_this_ptr) { \ + ZEPHIR_SET_THIS_OBJ(old_this_ptr); \ + } else { \ + ZEPHIR_SET_THIS_EXPLICIT_NULL(); \ + } \ +} while (0) -/** - * @brief Invokes a function @a func_name passing @c return_value and @c return_value_ptr - * as return value address; returns if the function fails due to an error or exception. - * @param[in] func_name name of the function to call (const char*) - * @param arguments function arguments (zval*) - * @note If the call fails or an exception occurs, the memory frame is restored. - * @li if @c return_value_ptr is not @c NULL, @c *return_value_ptr is initialized with @c ALLOC_INIT_ZVAL - * @li otherwise, if @c return_value is not @c NULL, @c return_value and @c *return_value are not changed - */ -#define ZEPHIR_RETURN_CALL_FUNCTION(func_name, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_function(return_value, return_value_ptr, func_name, strlen(func_name), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } while (0) +#define ZEPHIR_SET_THIS(zv) ZEPHIR_SET_THIS_OBJ((zv ? Z_OBJ_P(zv) : NULL)) +#define ZEPHIR_SET_THIS_EXPLICIT_NULL() \ + ZVAL_NULL(&EG(current_execute_data)->This); \ + Z_OBJ(EG(current_execute_data)->This) = NULL; -/** - * @brief Invokes a function @a func_name and returns if the function fails due to an error or exception. - * @param[out] return_value_ptr function return value (zval**); can be @c NULL (in this case it is assumed that the caller is not interested in the return value) - * @param[in] func_name name of the function to call (const char*) - * @param arguments function arguments (zval*) - * @note If the call fails or an exception occurs, the memory frame is restored. - * In this case if @c return_value_ptr is not @c NULL, *return_value_ptr is set to @c NULL - */ -#define ZEPHIR_CALL_ZVAL_FUNCTION(return_value_ptr, func_name, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ - ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_zval_func_aparams(return_value_ptr, func_name, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ - } while (0) +#define ZEPHIR_SET_THIS_OBJ(obj) \ + if (obj) { \ + ZVAL_OBJ(&EG(current_execute_data)->This, obj); \ + } \ + else { ZEPHIR_SET_THIS_EXPLICIT_NULL(); } \ -/** - * @brief Invokes a function @a func_name passing @c return_value and @c return_value_ptr - * as return value address; returns if the function fails due to an error or exception. - * @param[in] func_name name of the function to call (const char*) - * @param arguments function arguments (zval*) - * @note If the call fails or an exception occurs, the memory frame is restored. - * @li if @c return_value_ptr is not @c NULL, @c *return_value_ptr is initialized with @c ALLOC_INIT_ZVAL - * @li otherwise, if @c return_value is not @c NULL, @c return_value and @c *return_value are not changed - */ -#define ZEPHIR_RETURN_CALL_ZVAL_FUNCTION(func_name, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_zval_function(return_value, return_value_ptr, func_name, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } while (0) +#if PHP_VERSION_ID >= 70100 -/** - * @} - */ +#define ZEPHIR_BACKUP_SCOPE() \ + zend_class_entry *old_scope = EG(fake_scope); \ + zend_class_entry *old_called_scope = zend_get_called_scope(EG(current_execute_data)); -/* Saves the if pointer, and called/calling scope */ -#define ZEPHIR_BACKUP_THIS_PTR() \ - zval *old_this_ptr = this_ptr; +#define ZEPHIR_RESTORE_SCOPE() \ + zephir_set_called_scope(EG(current_execute_data), old_called_scope); \ + EG(fake_scope) = old_scope; \ -#define ZEPHIR_RESTORE_THIS_PTR() ZEPHIR_SET_THIS(old_this_ptr) +#define ZEPHIR_SET_SCOPE(_scope, _scope_called) \ + EG(fake_scope) = _scope; \ + zephir_set_called_scope(EG(current_execute_data), _scope_called); \ -#define ZEPHIR_SET_THIS(pzv) EG(This) = pzv; +#else #define ZEPHIR_BACKUP_SCOPE() \ zend_class_entry *old_scope = EG(scope); \ - zend_class_entry *old_called_scope = EG(called_scope); + zend_class_entry *old_called_scope = EG(current_execute_data)->called_scope; #define ZEPHIR_RESTORE_SCOPE() \ - EG(called_scope) = old_called_scope; \ + EG(current_execute_data)->called_scope = old_called_scope; \ EG(scope) = old_scope; \ #define ZEPHIR_SET_SCOPE(_scope, _scope_called) \ EG(scope) = _scope; \ - EG(called_scope) = _scope_called; \ + EG(current_execute_data)->called_scope = _scope_called; \ -/* End internal calls */ +#endif -#define ZEPHIR_CALL_METHODW(return_value_ptr, object, method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } while (0) +/* End internal calls */ -#define ZEPHIR_CALL_METHOD(return_value_ptr, object, method, cache, cache_slot, ...) \ +#define ZEPHIR_RETURN_CALL_ZVAL_FUNCTION(func_name, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ - ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ + ZEPHIR_LAST_CALL_STATUS = zephir_return_call_zval_function(return_value, func_name, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#define ZEPHIR_RETURN_CALL_METHODW(object, method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - if (__builtin_constant_p(method)) { \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method, sizeof(method)-1, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } else { \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } \ - } while (0) - -#define ZEPHIR_RETURN_CALL_METHOD(object, method, cache, cache_slot, ...) \ +#define ZEPHIR_RETURN_CALL_FUNCTION(func_name, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_return_call_function(return_value, func_name, strlen(func_name), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#define ZEPHIR_CALL_METHOD_ZVAL(return_value_ptr, object, method, cache, cache_slot, ...) \ +#define ZEPHIR_CALL_METHOD(return_value_ptr, object, method, cache, cache_slot, ...) \ do { \ - char *method_name; \ - int method_len; \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ - if (Z_TYPE_P(method) == IS_STRING) { \ - method_len = Z_STRLEN_P(method); \ - method_name = zend_str_tolower_dup(Z_STRVAL_P(method), method_len); \ - } else { \ - method_len = 0; \ - method_name = zend_str_tolower_dup("", 0); \ - } \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method_name, method_len, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - efree(method_name); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#define ZEPHIR_RETURN_CALL_METHODW_ZVAL(object, method, cache, cache_slot, ...) \ +#define ZEPHIR_RETURN_CALL_METHOD_ZVAL(object, method, cache, cache_slot, ...) \ do { \ char *method_name; \ int method_len; \ @@ -277,11 +153,11 @@ typedef enum _zephir_call_type { method_len = 0; \ method_name = zend_str_tolower_dup("", 0); \ } \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method_name, method_len, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method_name, method_len, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ efree(method_name); \ } while (0) -#define ZEPHIR_RETURN_CALL_METHOD_ZVAL(object, method, cache, cache_slot, ...) \ +#define ZEPHIR_CALL_METHOD_ZVAL(return_value_ptr, object, method, cache, cache_slot, ...) \ do { \ char *method_name; \ int method_len; \ @@ -293,135 +169,67 @@ typedef enum _zephir_call_type { method_len = 0; \ method_name = zend_str_tolower_dup("", 0); \ } \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method_name, method_len, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - efree(method_name); \ - } while (0) - -#define ZEPHIR_CALL_METHOD_THIS(return_value_ptr, method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, THIS_CE, zephir_fcall_method, getThis(), method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ - } while (0) - -#define ZEPHIR_CALL_PARENTW(return_value_ptr, class_entry, this_ptr, method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method_name, method_len, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ + efree(method_name); \ } while (0) #define ZEPHIR_CALL_PARENT(return_value_ptr, class_entry, this_ptr, method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#define ZEPHIR_RETURN_CALL_PARENTW(class_entry, this_ptr, method, ...) \ +#define ZEPHIR_RETURN_CALL_METHOD(object, method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, Z_TYPE_P(object) == IS_OBJECT ? Z_OBJCE_P(object) : NULL, zephir_fcall_method, object, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#define ZEPHIR_RETURN_CALL_PARENT(class_entry, this_ptr, method, cache, cache_slot, ...) \ +#define ZEPHIR_RETURN_CALL_STATIC(method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) -#define ZEPHIR_CALL_SELFW(return_value_ptr, method, cache, cache_slot, ...) \ +#define ZEPHIR_RETURN_CALL_PARENT(class_entry, this_ptr, method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_self, NULL, method, cache, cache_slot, strlen(method), ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, class_entry, zephir_fcall_parent, this_ptr, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) #define ZEPHIR_CALL_SELF(return_value_ptr, method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ - } while (0) - -#define ZEPHIR_RETURN_CALL_SELFW(method, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) #define ZEPHIR_RETURN_CALL_SELF(method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } while (0) - -#define ZEPHIR_CALL_STATICW(return_value_ptr, method, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, NULL, zephir_fcall_self, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) #define ZEPHIR_CALL_STATIC(return_value_ptr, method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ - } while (0) - -#define ZEPHIR_RETURN_CALL_STATICW(method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - RETURN_ON_FAILURE(zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC)); \ - } while (0) - -#define ZEPHIR_RETURN_CALL_STATIC(method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - } while (0) - -#define ZEPHIR_CALL_CE_STATICW(return_value_ptr, class_entry, method, cache, cache_slot, ...) \ - do { \ - zval *params[] = {__VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, strlen(method), cache, cache_slot, sizeof(params)/sizeof(zval*), params TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, NULL, zephir_fcall_static, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) #define ZEPHIR_CALL_CE_STATIC(return_value_ptr, class_entry, method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ - } while (0) - -#define ZEPHIR_RETURN_CALL_CE_STATICW(class_entry, method, cache, cache_slot, ...) \ - do { \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, strlen(method), ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) #define ZEPHIR_RETURN_CALL_CE_STATIC(class_entry, method, cache, cache_slot, ...) \ do { \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_ce, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, class_entry, zephir_fcall_ce, NULL, method, strlen(method), cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ } while (0) #define ZEPHIR_CALL_CE_STATIC_ZVAL(return_value_ptr, class_entry, method, cache, cache_slot, ...) \ @@ -429,35 +237,15 @@ typedef enum _zephir_call_type { char *method_name; \ int method_len; \ zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - zval** rvp = return_value_ptr; \ - if (Z_TYPE_P(method) == IS_STRING) { \ - method_len = Z_STRLEN_P(method); \ - method_name = zend_str_tolower_dup(Z_STRVAL_P(method), method_len); \ + if (Z_TYPE(method) == IS_STRING) { \ + method_len = Z_STRLEN(method); \ + method_name = zend_str_tolower_dup(Z_STRVAL(method), method_len); \ } else { \ method_len = 0; \ method_name = zend_str_tolower_dup("", 0); \ } \ ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(return_value_ptr); \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_ce, NULL, method_name, method_len, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ - efree(method_name); \ - if (rvp && !*rvp) { \ - ALLOC_INIT_ZVAL(*rvp); \ - } \ - } while (0) - -#define ZEPHIR_RETURN_CALL_CE_STATICW_ZVAL(class_entry, method, cache, cache_slot, ...) \ - do { \ - char *method_name; \ - int method_len; \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - if (Z_TYPE_P(method) == IS_STRING) { \ - method_len = Z_STRLEN_P(method); \ - method_name = zend_str_tolower_dup(Z_STRVAL_P(method), method_len); \ - } else { \ - method_len = 0; \ - method_name = zend_str_tolower_dup("", 0); \ - } \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_ce, NULL, method_name, method_len, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_class_method_aparams(return_value_ptr, class_entry, zephir_fcall_ce, NULL, method_name, method_len, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ efree(method_name); \ } while (0) @@ -465,15 +253,15 @@ typedef enum _zephir_call_type { do { \ char *method_name; \ int method_len; \ - zval *params_[] = {ZEPHIR_FETCH_VA_ARGS __VA_ARGS__}; \ - if (Z_TYPE_P(method) == IS_STRING) { \ - method_len = Z_STRLEN_P(method); \ - method_name = zend_str_tolower_dup(Z_STRVAL_P(method), method_len); \ + zval *params_[] = { ZEPHIR_FETCH_VA_ARGS __VA_ARGS__ }; \ + if (Z_TYPE(method) == IS_STRING) { \ + method_len = Z_STRLEN(method); \ + method_name = zend_str_tolower_dup(Z_STRVAL(method), method_len); \ } else { \ method_len = 0; \ method_name = zend_str_tolower_dup("", 0); \ } \ - ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, return_value_ptr, class_entry, zephir_fcall_ce, NULL, method_name, method_len, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_) TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_return_call_class_method(return_value, class_entry, zephir_fcall_ce, NULL, method_name, method_len, cache, cache_slot, ZEPHIR_CALL_NUM_PARAMS(params_), ZEPHIR_PASS_CALL_PARAMS(params_)); \ efree(method_name); \ } while (0) @@ -481,176 +269,141 @@ typedef enum _zephir_call_type { #define ZEPHIR_CALL_USER_FUNC(return_value, handler) ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, handler, NULL) #define ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, handler, params) \ do { \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_user_func_array(return_value, handler, params TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_user_func_array(return_value, handler, params); \ } while (0) #define ZEPHIR_CALL_USER_FUNC_ARRAY_NOEX(return_value, handler, params) \ do { \ - ZEPHIR_LAST_CALL_STATUS = zephir_call_user_func_array_noex(return_value, handler, params TSRMLS_CC); \ + ZEPHIR_LAST_CALL_STATUS = zephir_call_user_func_array_noex(return_value, handler, params); \ } while (0) -int zephir_call_func_aparams(zval **return_value_ptr, const char *func_name, uint func_length, +int zephir_call_func_aparams(zval *return_value_ptr, const char *func_name, uint func_length, zephir_fcall_cache_entry **cache_entry, int cache_slot, - uint param_count, zval **params TSRMLS_DC); - -int zephir_call_func_aparams_fast(zval **return_value_ptr, zephir_fcall_cache_entry **cache_entry, uint param_count, zval **params TSRMLS_DC); + uint param_count, zval **params); -int zephir_call_zval_func_aparams(zval **return_value_ptr, zval *func_name, +int zephir_call_zval_func_aparams(zval *return_value_ptr, zval *func_name, zephir_fcall_cache_entry **cache_entry, int cache_slot, - uint param_count, zval **params TSRMLS_DC) ZEPHIR_ATTR_WARN_UNUSED_RESULT; + uint param_count, zval **params) ZEPHIR_ATTR_WARN_UNUSED_RESULT; -/** - * @ingroup callfuncs - * @brief Calls a function @a func - * @param return_value Calling function's @c return_value - * @param return_value_ptr Calling function's @c return_value_ptr - * @param func Function name - * @param func_len Length of @a func (strlen(func)) - * @param param_count Number of parameters - */ -ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_return_call_function(zval *return_value, zval **return_value_ptr, - const char *func, uint func_len, zephir_fcall_cache_entry **cache_entry, int cache_slot, uint param_count, zval **params TSRMLS_DC) +int zephir_call_class_method_aparams(zval *return_value_ptr, + zend_class_entry *ce, + zephir_call_type type, + zval *object, + const char *method_name, + uint method_len, + zephir_fcall_cache_entry **cache_entry, + int cache_slot, + uint param_count, + zval **params) ZEPHIR_ATTR_WARN_UNUSED_RESULT; + +ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_return_call_function(zval *return_value, + const char *func, uint func_len, zephir_fcall_cache_entry **cache_entry, int cache_slot, uint param_count, zval **params) { - zval *rv = NULL, **rvp = return_value_ptr ? return_value_ptr : &rv; + zval rv, *rvp = return_value ? return_value : &rv; int status; - if (return_value_ptr) { - zval_ptr_dtor(return_value_ptr); - *return_value_ptr = NULL; + if (return_value) { + zval_ptr_dtor(return_value); + ZVAL_UNDEF(return_value); } - status = zephir_call_func_aparams(rvp, func, func_len, cache_entry, cache_slot, param_count, params TSRMLS_CC); + status = zephir_call_func_aparams(rvp, func, func_len, cache_entry, cache_slot, param_count, params); if (status == FAILURE) { - if (return_value_ptr && EG(exception)) { - ALLOC_INIT_ZVAL(*return_value_ptr); + if (return_value && EG(exception)) { + ZVAL_NULL(return_value); } return FAILURE; } - if (!return_value_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, rv); + if (!return_value) { + zval_ptr_dtor(&rv); } return SUCCESS; } -/** - * @ingroup callfuncs - * @brief Calls a function @a func - * @param return_value Calling function's @c return_value - * @param return_value_ptr Calling function's @c return_value_ptr - * @param func Function name - * @param func_len Length of @a func (strlen(func)) - * @param param_count Number of parameters - */ -ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_return_call_zval_function(zval *return_value, zval **return_value_ptr, - zval *func, zephir_fcall_cache_entry **cache_entry, int cache_slot, uint param_count, zval **params TSRMLS_DC) +ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_return_call_zval_function(zval *return_value, + zval *func, zephir_fcall_cache_entry **cache_entry, int cache_slot, uint param_count, zval **params) { - zval *rv = NULL, **rvp = return_value_ptr ? return_value_ptr : &rv; + zval rv, *rvp = return_value ? return_value : &rv; int status; - if (return_value_ptr) { - zval_ptr_dtor(return_value_ptr); - *return_value_ptr = NULL; + if (return_value) { + zval_ptr_dtor(return_value); + ZVAL_UNDEF(return_value); } - status = zephir_call_zval_func_aparams(rvp, func, cache_entry, cache_slot, param_count, params TSRMLS_CC); + status = zephir_call_zval_func_aparams(rvp, func, cache_entry, cache_slot, param_count, params); if (status == FAILURE) { - if (return_value_ptr && EG(exception)) { - ALLOC_INIT_ZVAL(*return_value_ptr); + if (return_value && EG(exception)) { + ZVAL_NULL(return_value); } return FAILURE; } - if (!return_value_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, rv); + if (!return_value) { + zval_ptr_dtor(&rv); } return SUCCESS; } -int zephir_call_class_method_aparams(zval **return_value_ptr, - zend_class_entry *ce, - zephir_call_type type, - zval *object, - const char *method_name, uint method_len, - zephir_fcall_cache_entry **cache_entry, - int cache_slot, - uint param_count, - zval **params TSRMLS_DC) ZEPHIR_ATTR_WARN_UNUSED_RESULT; - ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_return_call_class_method(zval *return_value, - zval **return_value_ptr, zend_class_entry *ce, zephir_call_type type, zval *object, + zend_class_entry *ce, zephir_call_type type, zval *object, const char *method_name, uint method_len, zephir_fcall_cache_entry **cache_entry, int cache_slot, - uint param_count, zval **params TSRMLS_DC) + uint param_count, zval **params) { - zval *rv = NULL, **rvp = return_value_ptr ? return_value_ptr : &rv; + zval rv, *rvp = return_value ? return_value : &rv; int status; - if (return_value_ptr) { - zval_ptr_dtor(return_value_ptr); - *return_value_ptr = NULL; + ZVAL_UNDEF(&rv); + + if (return_value) { + zval_ptr_dtor(return_value); + ZVAL_UNDEF(return_value); } - status = zephir_call_class_method_aparams(rvp, ce, type, object, method_name, method_len, cache_entry, cache_slot, param_count, params TSRMLS_CC); + status = zephir_call_class_method_aparams(rvp, ce, type, object, method_name, method_len, cache_entry, cache_slot, param_count, params); if (status == FAILURE) { - if (return_value_ptr && EG(exception)) { - ALLOC_INIT_ZVAL(*return_value_ptr); + if (return_value && EG(exception)) { + ZVAL_NULL(return_value); } return FAILURE; } - if (!return_value_ptr) { - COPY_PZVAL_TO_ZVAL(*return_value, rv); + if (!return_value) { + zval_ptr_dtor(&rv); } return SUCCESS; } /** Fast call_user_func_array/call_user_func */ -int zephir_call_user_func_array_noex(zval *return_value, zval *handler, zval *params TSRMLS_DC) ZEPHIR_ATTR_WARN_UNUSED_RESULT; +int zephir_call_user_func_array_noex(zval *return_value, zval *handler, zval *params) ZEPHIR_ATTR_WARN_UNUSED_RESULT; /** * Replaces call_user_func_array avoiding function lookup */ -ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_call_user_func_array(zval *return_value, zval *handler, zval *params TSRMLS_DC) +ZEPHIR_ATTR_WARN_UNUSED_RESULT static inline int zephir_call_user_func_array(zval *return_value, zval *handler, zval *params) { - int status = zephir_call_user_func_array_noex(return_value, handler, params TSRMLS_CC); + int status = zephir_call_user_func_array_noex(return_value, handler, params); return (EG(exception)) ? FAILURE : status; } -/** - * @brief Checks if the class defines a constructor - * @param ce Class entry - * @return Whether the class defines a constructor - */ int zephir_has_constructor_ce(const zend_class_entry *ce) ZEPHIR_ATTR_PURE ZEPHIR_ATTR_NONNULL; -/** - * @brief Checks if an object has a constructor - * @param object Object to check - * @return Whether @a object has a constructor - * @retval 0 @a object is not an object or does not have a constructor - * @retval 1 @a object has a constructor - */ -ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL static inline int zephir_has_constructor(const zval *object TSRMLS_DC) +ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL static inline int zephir_has_constructor(const zval *object) { return Z_TYPE_P(object) == IS_OBJECT ? zephir_has_constructor_ce(Z_OBJCE_P(object)) : 0; } -#if PHP_VERSION_ID >= 50600 -#define ZEPHIR_ZEND_CALL_FUNCTION_WRAPPER zephir_call_function_opt -#else -#define ZEPHIR_ZEND_CALL_FUNCTION_WRAPPER zend_call_function -#endif - #define zephir_check_call_status() \ do { \ if (ZEPHIR_LAST_CALL_STATUS == FAILURE) { \ @@ -660,23 +413,43 @@ ZEPHIR_ATTR_WARN_UNUSED_RESULT ZEPHIR_ATTR_NONNULL static inline int zephir_has_ } while(0) #define zephir_check_call_status_or_jump(label) \ - if (ZEPHIR_LAST_CALL_STATUS == FAILURE) { \ - if (EG(exception)) { \ - goto label; \ - } else { \ - ZEPHIR_MM_RESTORE(); \ - return; \ + do { \ + if (ZEPHIR_LAST_CALL_STATUS == FAILURE) { \ + if (EG(exception)) { \ + goto label; \ + } else { \ + ZEPHIR_MM_RESTORE(); \ + return; \ + } \ } \ - } + } while (0) #ifdef ZEPHIR_RELEASE #define ZEPHIR_TEMP_PARAM_COPY 0 -#define zephir_check_temp_parameter(param) do { if (Z_REFCOUNT_P(param) > 1) zval_copy_ctor(param); else ZVAL_NULL(param); } while(0) +#define zephir_check_temp_parameter(param) do { if (Z_REFCOUNT(param) > 1) zval_copy_ctor(¶m); else ZVAL_NULL(¶m); } while(0) #else #define ZEPHIR_TEMP_PARAM_COPY 1 #define zephir_check_temp_parameter(param) #endif -void zephir_eval_php(zval *str, zval *retval_ptr, char *context TSRMLS_DC); +void zephir_eval_php(zval *str, zval *retval_ptr, char *context); + +static inline void zephir_set_called_scope(zend_execute_data *ex, zend_class_entry *called_scope) +{ + while (ex) { + if (Z_TYPE(ex->This) == IS_OBJECT) { + Z_OBJCE(ex->This) = called_scope; + return; + } else if (Z_CE(ex->This)) { + Z_CE(ex->This) = called_scope; + return; + } else if (ex->func) { + if (ex->func->type != ZEND_INTERNAL_FUNCTION || ex->func->common.scope) { + return; + } + } + ex = ex->prev_execute_data; + } +} #endif /* ZEPHIR_KERNEL_FCALL_H */ diff --git a/ext/kernel/file.c b/ext/kernel/file.c index 8845df50e33..78187b734bd 100644 --- a/ext/kernel/file.c +++ b/ext/kernel/file.c @@ -24,12 +24,12 @@ #include "php.h" #include "php_ext.h" -#include "php_main.h" -#include "main/php_streams.h" -#include "ext/standard/file.h" -#include "ext/standard/php_smart_str.h" -#include "ext/standard/php_filestat.h" -#include "ext/standard/php_string.h" +#include +#include
+#include +#include +#include +#include #include "kernel/main.h" #include "kernel/memory.h" @@ -37,8 +37,9 @@ #include "kernel/operators.h" #include "kernel/file.h" -#include "Zend/zend_exceptions.h" -#include "Zend/zend_interfaces.h" +#include +#include +#include #define PHP_STREAM_TO_ZVAL(stream, arg) \ php_stream_from_zval_no_verify(stream, arg); \ @@ -50,25 +51,32 @@ } \ } +void zephir_basename(zval *return_value, zval *path) +{ + if (EXPECTED(Z_TYPE_P(path) == IS_STRING)) { + zend_string *ret; + ret = php_basename(Z_STRVAL_P(path), Z_STRLEN_P(path), NULL, 0); + ZVAL_STR(return_value, ret); + } else { + ZVAL_FALSE(return_value); + } +} + /** * Checks if a file exist * */ -int zephir_file_exists(zval *filename TSRMLS_DC){ - +int zephir_file_exists(zval *filename) +{ zval return_value; if (Z_TYPE_P(filename) != IS_STRING) { return FAILURE; } - php_stat(Z_STRVAL_P(filename), (php_stat_len) Z_STRLEN_P(filename), FS_EXISTS, &return_value TSRMLS_CC); + php_stat(Z_STRVAL_P(filename), (php_stat_len) Z_STRLEN_P(filename), FS_EXISTS, &return_value); - if (ZEPHIR_IS_FALSE((&return_value))) { - return FAILURE; - } - - if (ZEPHIR_IS_EMPTY((&return_value))) { + if (Z_TYPE(return_value) != IS_TRUE) { return FAILURE; } @@ -78,243 +86,121 @@ int zephir_file_exists(zval *filename TSRMLS_DC){ /** * Compares two file paths returning 1 if the first mtime is greater or equal than the second */ -int zephir_compare_mtime(zval *filename1, zval *filename2 TSRMLS_DC){ +int zephir_compare_mtime(zval *filename1, zval *filename2) +{ php_stream_statbuf statbuffer1, statbuffer2; if (Z_TYPE_P(filename1) != IS_STRING || Z_TYPE_P(filename2) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for compare_mtime()"); + php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for compare_mtime()"); return 0; } if (php_stream_stat_path_ex(Z_STRVAL_P(filename1), 0, &statbuffer1, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mstat failed for %s", Z_STRVAL_P(filename1)); + php_error_docref(NULL, E_WARNING, "mstat failed for %s", Z_STRVAL_P(filename1)); return 0; } if (php_stream_stat_path_ex(Z_STRVAL_P(filename2), 0, &statbuffer2, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "mstat failed for %s", Z_STRVAL_P(filename2)); + php_error_docref(NULL, E_WARNING, "mstat failed for %s", Z_STRVAL_P(filename2)); return 0; } return (int) (statbuffer1.sb.st_mtime >= statbuffer2.sb.st_mtime); } -/** - * Executes the filemtime function without function lookup - */ -void zephir_fast_filemtime(zval *return_value, zval *filename TSRMLS_DC){ - - if (Z_TYPE_P(filename) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for fast_filemtime()"); - return; - } - - php_stat(Z_STRVAL_P(filename), (php_stat_len) Z_STRLEN_P(filename), FS_MTIME, return_value TSRMLS_CC); -} - -/** - * Adds a trailing directory separator if the path doesn't have it - */ -void zephir_fix_path(zval **return_value, zval *path, zval *directory_separator TSRMLS_DC) { +void zephir_fwrite(zval *return_value, zval *stream_zval, zval *data) +{ - if (Z_TYPE_P(path) != IS_STRING || Z_TYPE_P(directory_separator) != IS_STRING) { - return; - } + int num_bytes; + php_stream *stream; - if (Z_STRLEN_P(path) > 0 && Z_STRLEN_P(directory_separator) > 0) { - if (Z_STRVAL_P(path)[Z_STRLEN_P(path) - 1] != Z_STRVAL_P(directory_separator)[0]) { - ZEPHIR_CONCAT_VV(*return_value, path, directory_separator); + if (Z_TYPE_P(stream_zval) != IS_RESOURCE) { + php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for zephir_fwrite()"); + if (return_value) { + RETVAL_FALSE; + } else { return; } } - zval_ptr_dtor(return_value); - *return_value = path; - Z_ADDREF_P(path); -} - -/** - * Replaces directory separators by the virtual separator - */ -void zephir_prepare_virtual_path(zval *return_value, zval *path, zval *virtual_separator TSRMLS_DC) { - - unsigned int i; - unsigned char ch; - smart_str virtual_str = {0}; - - if (Z_TYPE_P(path) != IS_STRING || Z_TYPE_P(virtual_separator) != IS_STRING) { - if (Z_TYPE_P(path) == IS_STRING) { - RETURN_STRINGL(Z_STRVAL_P(path), Z_STRLEN_P(path), 1); + if (Z_TYPE_P(data) != IS_STRING) { + /* @todo convert data to string */ + php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for zephir_fwrite()"); + if (return_value) { + RETVAL_FALSE; } else { - RETURN_EMPTY_STRING(); + return; } - return; } - for (i = 0; i < Z_STRLEN_P(path); i++) { - ch = Z_STRVAL_P(path)[i]; - if (ch == '\0') { - break; - } - if (ch == '/' || ch == '\\' || ch == ':') { - smart_str_appendl(&virtual_str, Z_STRVAL_P(virtual_separator), Z_STRLEN_P(virtual_separator)); - } - else { - smart_str_appendc(&virtual_str, tolower(ch)); + if (!Z_STRLEN_P(data)) { + if (return_value) { + RETURN_LONG(0); + } else { + return; } } - smart_str_0(&virtual_str); + PHP_STREAM_TO_ZVAL(stream, stream_zval); - if (virtual_str.c) { - RETURN_STRINGL(virtual_str.c, virtual_str.len, 0); - } else { - RETURN_EMPTY_STRING(); - } -} - -/** - * Generates a unique id for a path - */ -void zephir_unique_path_key(zval *return_value, zval *path TSRMLS_DC) { - - unsigned long h; - char *strKey; - - if (Z_TYPE_P(path) != IS_STRING) { - return; + num_bytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data)); + if (return_value) { + RETURN_LONG(num_bytes); } - - h = zend_hash_func(Z_STRVAL_P(path), Z_STRLEN_P(path) + 1); - - strKey = emalloc(24); - sprintf(strKey, "v%lu", h); - - RETURN_STRING(strKey, 0); } -/** - * Returns the realpath of a zval filename - * - */ -void zephir_realpath(zval *return_value, zval *filename TSRMLS_DC) { - - char resolved_path_buff[MAXPATHLEN]; +int zephir_feof(zval *stream_zval) +{ - if (Z_TYPE_P(filename) != IS_STRING) { - RETURN_FALSE; - } + php_stream *stream; - if (strlen(Z_STRVAL_P(filename)) != Z_STRLEN_P(filename)) { - RETURN_FALSE; + if (Z_TYPE_P(stream_zval) != IS_RESOURCE) { + php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for zephir_feof()"); + return 0; } - if (VCWD_REALPATH(Z_STRVAL_P(filename), resolved_path_buff)) { - RETURN_STRING(resolved_path_buff, 1); + php_stream_from_zval_no_verify(stream, stream_zval); + if (stream == NULL) { + return 0; } - RETURN_FALSE; + return php_stream_eof(stream); } -/** - * Removes the prefix from a class name, removes malicious characters, replace namespace separator by directory separator - */ -void zephir_possible_autoload_filepath(zval *return_value, zval *prefix, zval *class_name, zval *virtual_separator, zval *separator TSRMLS_DC) { - - unsigned int i, length; - unsigned char ch; - smart_str virtual_str = {0}; - - if (Z_TYPE_P(prefix) != IS_STRING || Z_TYPE_P(class_name) != IS_STRING || Z_TYPE_P(virtual_separator) != IS_STRING) { - RETURN_FALSE; - } - - length = Z_STRLEN_P(prefix); - if (!length) { - RETURN_FALSE; - } +int zephir_fclose(zval *stream_zval) +{ + php_stream *stream; - if (length > Z_STRLEN_P(class_name)) { - RETURN_FALSE; + if (Z_TYPE_P(stream_zval) != IS_RESOURCE) { + php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for zephir_fclose()"); + return 0; } - if (separator) { - if (Z_STRVAL_P(prefix)[Z_STRLEN_P(prefix) - 1] == Z_STRVAL_P(separator)[0]) { - length--; - } + if ((stream = (php_stream*)zend_fetch_resource2(Z_RES_P(stream_zval), "stream", php_file_le_stream(), php_file_le_pstream())) == NULL) { + return 0; } - for (i = length + 1; i < Z_STRLEN_P(class_name); i++) { - - ch = Z_STRVAL_P(class_name)[i]; - - /** - * Anticipated end of string - */ - if (ch == '\0') { - break; - } - - /** - * Replace namespace separator by directory separator - */ - if (ch == '\\') { - smart_str_appendl(&virtual_str, Z_STRVAL_P(virtual_separator), Z_STRLEN_P(virtual_separator)); - continue; - } - - /** - * Replace separator - */ - if (separator) { - if (ch == Z_STRVAL_P(separator)[0]) { - smart_str_appendl(&virtual_str, Z_STRVAL_P(virtual_separator), Z_STRLEN_P(virtual_separator)); - continue; - } - } - - /** - * Basic alphanumeric characters - */ - if ((ch == '_') || (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { - smart_str_appendc(&virtual_str, ch); - continue; - } - - /** - * Multibyte characters? - */ - if (ch > 127) { - smart_str_appendc(&virtual_str, ch); - continue; - } - + if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) { + php_error_docref(NULL, E_WARNING, "%d is not a valid stream resource", stream->res->handle); + return 0; } - smart_str_0(&virtual_str); - - if (virtual_str.len) { - RETURN_STRINGL(virtual_str.c, virtual_str.len, 0); - } else { - smart_str_free(&virtual_str); - RETURN_FALSE; - } + php_stream_free(stream, PHP_STREAM_FREE_KEEP_RSRC | (stream->is_persistent ? PHP_STREAM_FREE_CLOSE_PERSISTENT : PHP_STREAM_FREE_CLOSE)); + return 1; } -void zephir_file_get_contents(zval *return_value, zval *filename TSRMLS_DC) +void zephir_file_get_contents(zval *return_value, zval *filename) { - - char *contents; + zend_string *contents; php_stream *stream; - int len; long maxlen = PHP_STREAM_COPY_ALL; zval *zcontext = NULL; php_stream_context *context = NULL; if (Z_TYPE_P(filename) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for zephir_file_get_contents()"); + php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for zephir_file_get_contents()"); RETVAL_FALSE; return; } @@ -326,14 +212,10 @@ void zephir_file_get_contents(zval *return_value, zval *filename TSRMLS_DC) RETURN_FALSE; } - if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) { - RETVAL_STRINGL(contents, len, 0); + if ((contents = php_stream_copy_to_mem(stream, maxlen, 0)) != NULL) { + RETVAL_STR(contents); } else { - if (len == 0) { - RETVAL_EMPTY_STRING(); - } else { - RETVAL_FALSE; - } + RETVAL_EMPTY_STRING(); } php_stream_close(stream); @@ -342,7 +224,7 @@ void zephir_file_get_contents(zval *return_value, zval *filename TSRMLS_DC) /** * Writes a zval to a stream */ -void zephir_file_put_contents(zval *return_value, zval *filename, zval *data TSRMLS_DC) +void zephir_file_put_contents(zval *return_value, zval *filename, zval *data) { php_stream *stream; int numbytes = 0, use_copy = 0; @@ -351,7 +233,7 @@ void zephir_file_put_contents(zval *return_value, zval *filename, zval *data TSR php_stream_context *context = NULL; if (Z_TYPE_P(filename) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for zephir_file_put_contents()"); + php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for zephir_file_put_contents()"); if (return_value) { RETVAL_FALSE; } @@ -369,13 +251,17 @@ void zephir_file_put_contents(zval *return_value, zval *filename, zval *data TSR } switch (Z_TYPE_P(data)) { - case IS_NULL: case IS_LONG: case IS_DOUBLE: - case IS_BOOL: + case IS_TRUE: + case IS_FALSE: +#if PHP_VERSION_ID < 70300 case IS_CONSTANT: - zend_make_printable_zval(data, ©, &use_copy); +#else + case IS_CONSTANT_AST: +#endif + use_copy = zend_make_printable_zval(data, ©); if (use_copy) { data = © } @@ -385,7 +271,7 @@ void zephir_file_put_contents(zval *return_value, zval *filename, zval *data TSR if (Z_STRLEN_P(data)) { numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data)); if (numbytes != Z_STRLEN_P(data)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only %d of %d bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data)); + php_error_docref(NULL, E_WARNING, "Only %d of %zu bytes written, possibly out of free disk space", numbytes, Z_STRLEN_P(data)); numbytes = -1; } } @@ -415,148 +301,73 @@ void zephir_file_put_contents(zval *return_value, zval *filename, zval *data TSR return; } -void zephir_is_dir(zval *return_value, zval *path TSRMLS_DC) +void zephir_filemtime(zval *return_value, zval *path) { if (EXPECTED(Z_TYPE_P(path) == IS_STRING)) { - php_stat(Z_STRVAL_P(path), (php_stat_len)(Z_STRLEN_P(path)), FS_IS_DIR, return_value TSRMLS_CC); + php_stat(Z_STRVAL_P(path), (php_stat_len)(Z_STRLEN_P(path)), FS_MTIME, return_value); } else { ZVAL_FALSE(return_value); } } -void zephir_unlink(zval *return_value, zval *path TSRMLS_DC) +/** + * Replaces directory separators by the virtual separator + */ +void zephir_prepare_virtual_path(zval *return_value, zval *path, zval *virtual_separator) { - if (EXPECTED(Z_TYPE_P(path) == IS_STRING)) { - php_stream_context *context; - php_stream_wrapper *wrapper; - zval *zctx = NULL; - if (UNEXPECTED(strlen(Z_STRVAL_P(path)) != Z_STRLEN_P(path))) { - ZVAL_FALSE(return_value); - return; - } - - context = php_stream_context_from_zval(zctx, 0); - wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(path), NULL, 0 TSRMLS_CC); + unsigned int i; + unsigned char ch; + smart_str virtual_str = {0}; - if (!wrapper || !wrapper->wops || !wrapper->wops->unlink) { - ZVAL_FALSE(return_value); - return; + if (Z_TYPE_P(path) != IS_STRING || Z_TYPE_P(virtual_separator) != IS_STRING) { + if (Z_TYPE_P(path) == IS_STRING) { + RETURN_STR(zval_get_string(path)); + } else { + RETURN_EMPTY_STRING(); } - - ZVAL_BOOL(return_value, wrapper->wops->unlink(wrapper, Z_STRVAL_P(path), REPORT_ERRORS, context TSRMLS_CC)); return; } - ZVAL_FALSE(return_value); - return; -} - -void zephir_filemtime(zval *return_value, zval *path TSRMLS_DC) -{ - if (EXPECTED(Z_TYPE_P(path) == IS_STRING)) { - php_stat(Z_STRVAL_P(path), (php_stat_len)(Z_STRLEN_P(path)), FS_MTIME, return_value TSRMLS_CC); - } else { - ZVAL_FALSE(return_value); - } -} - -void zephir_basename(zval *return_value, zval *path TSRMLS_DC) -{ - if (EXPECTED(Z_TYPE_P(path) == IS_STRING)) { - char *ret; - size_t ret_len; - - php_basename(Z_STRVAL_P(path), Z_STRLEN_P(path), NULL, 0, &ret, &ret_len TSRMLS_CC); - ZVAL_STRINGL(return_value, ret, (int)ret_len, 0); - } else { - ZVAL_FALSE(return_value); - } -} - -void zephir_fwrite(zval *return_value, zval *stream_zval, zval *data TSRMLS_DC) -{ - - int num_bytes; - php_stream *stream; - - if (Z_TYPE_P(stream_zval) != IS_RESOURCE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for zephir_fwrite()"); - if (return_value) { - RETVAL_FALSE; - } else { - return; + for (i = 0; i < Z_STRLEN_P(path); i++) { + ch = Z_STRVAL_P(path)[i]; + if (ch == '\0') { + break; } - } - - if (Z_TYPE_P(data) != IS_STRING) { - /* @todo convert data to string */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for zephir_fwrite()"); - if (return_value) { - RETVAL_FALSE; - } else { - return; + if (ch == '/' || ch == '\\' || ch == ':') { + smart_str_appendl(&virtual_str, Z_STRVAL_P(virtual_separator), Z_STRLEN_P(virtual_separator)); } - } - - if (!Z_STRLEN_P(data)) { - if (return_value) { - RETURN_LONG(0); - } else { - return; + else { + smart_str_appendc(&virtual_str, tolower(ch)); } } - PHP_STREAM_TO_ZVAL(stream, &stream_zval); - - num_bytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data)); - if (return_value) { - RETURN_LONG(num_bytes); - } -} - -int zephir_feof(zval *stream_zval TSRMLS_DC) -{ - - php_stream *stream; - - if (Z_TYPE_P(stream_zval) != IS_RESOURCE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for zephir_feof()"); - return 0; - } + smart_str_0(&virtual_str); - php_stream_from_zval_no_verify(stream, &stream_zval); - if (stream == NULL) { - return 0; + if (virtual_str.s) { + RETURN_STR(virtual_str.s); + } else { + RETURN_EMPTY_STRING(); } - - return php_stream_eof(stream); } -int zephir_fclose(zval *stream_zval TSRMLS_DC) +/** + * Generates a unique id for a path + */ +void zephir_unique_path_key(zval *return_value, zval *path) { - php_stream *stream; - - if (Z_TYPE_P(stream_zval) != IS_RESOURCE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for zephir_fwrite()"); - return 0; - } + unsigned long h; + char *strKey; - php_stream_from_zval_no_verify(stream, &stream_zval); - if (stream == NULL) { - return 0; + if (Z_TYPE_P(path) != IS_STRING) { + return; } - if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a valid stream resource", stream->rsrc_id); - return 0; - } + h = zend_hash_func(Z_STRVAL_P(path), Z_STRLEN_P(path) + 1); - if (!stream->is_persistent) { - php_stream_close(stream); - } else { - php_stream_pclose(stream); - } + strKey = emalloc(24); + sprintf(strKey, "v%lu", h); - return 1; + RETVAL_STRING(strKey); + efree(strKey); } diff --git a/ext/kernel/file.h b/ext/kernel/file.h index 6a11b171e2c..15572833f97 100644 --- a/ext/kernel/file.h +++ b/ext/kernel/file.h @@ -22,24 +22,19 @@ #include -int zephir_file_exists(zval *filename TSRMLS_DC); -int zephir_compare_mtime(zval *filename1, zval *filename2 TSRMLS_DC); -void zephir_fix_path(zval **return_value, zval *path, zval *directory_separator TSRMLS_DC); -void zephir_prepare_virtual_path(zval *return_value, zval *path, zval *virtual_separator TSRMLS_DC); -void zephir_unique_path_key(zval *return_value, zval *path TSRMLS_DC); -void zephir_realpath(zval *return_value, zval *filename TSRMLS_DC); -void zephir_file_get_contents(zval *return_value, zval *filename TSRMLS_DC); -void zephir_file_put_contents(zval *return_value, zval *filename, zval *data TSRMLS_DC); -void zephir_possible_autoload_filepath(zval *return_value, zval *prefix, zval *class_name, zval *virtual_separator, zval *separator TSRMLS_DC); - -void zephir_is_dir(zval *return_value, zval *path TSRMLS_DC); -void zephir_unlink(zval *return_value, zval *path TSRMLS_DC); -void zephir_filemtime(zval *return_value, zval *path TSRMLS_DC); -void zephir_basename(zval *return_value, zval *path TSRMLS_DC); - -void zephir_fwrite(zval *return_value, zval *stream_zval, zval *data TSRMLS_DC); -int zephir_feof(zval *stream_zval TSRMLS_DC); -int zephir_fclose(zval *stream_zval TSRMLS_DC); +int zephir_file_exists(zval *filename); + +void zephir_fwrite(zval *return_value, zval *stream_zval, zval *data); +int zephir_feof(zval *stream_zval); +int zephir_fclose(zval *stream_zval); +void zephir_file_get_contents(zval *return_value, zval *filename); +void zephir_file_put_contents(zval *return_value, zval *filename, zval *data); + +void zephir_basename(zval *return_value, zval *path); +void zephir_filemtime(zval *return_value, zval *path); +int zephir_compare_mtime(zval *filename1, zval *filename2); +void zephir_prepare_virtual_path(zval *return_value, zval *path, zval *virtual_separator); +void zephir_unique_path_key(zval *return_value, zval *path); #ifdef TSRM_WIN32 #define ZEPHIR_DIRECTORY_SEPARATOR "\\" diff --git a/ext/kernel/filter.c b/ext/kernel/filter.c index 2ddae44a3e2..6dc94e1f13f 100644 --- a/ext/kernel/filter.c +++ b/ext/kernel/filter.c @@ -26,15 +26,16 @@ #include "php.h" #include "php_ext.h" #include "php_main.h" -#include "ext/standard/php_smart_str.h" -#include "ext/standard/php_math.h" -#include "ext/standard/html.h" +#include +#include +#include #include "kernel/main.h" #include "kernel/memory.h" -#include "Zend/zend_exceptions.h" -#include "Zend/zend_interfaces.h" +#include +#include +#include /** * Filter alphanum string @@ -48,7 +49,7 @@ void zephir_filter_alphanum(zval *return_value, zval *param) { int use_copy = 0; if (Z_TYPE_P(param) != IS_STRING) { - zend_make_printable_zval(param, ©, &use_copy); + use_copy = zend_make_printable_zval(param, ©); if (use_copy) { param = © } @@ -70,59 +71,18 @@ void zephir_filter_alphanum(zval *return_value, zval *param) { smart_str_0(&filtered_str); - if (filtered_str.c) { - RETURN_STRINGL(filtered_str.c, filtered_str.len, 0); + if (filtered_str.s) { + RETURN_STR(filtered_str.s); } else { RETURN_EMPTY_STRING(); } } -/** - * Filter identifiers string like variables or database columns/tables - */ -void zephir_filter_identifier(zval *return_value, zval *param){ - - unsigned int i; - unsigned char ch; - zval copy; - smart_str filtered_str = {0}; - int use_copy = 0; - - if (Z_TYPE_P(param) != IS_STRING) { - zend_make_printable_zval(param, ©, &use_copy); - if (use_copy) { - param = © - } - } - - for (i = 0; i < Z_STRLEN_P(param); i++) { - ch = Z_STRVAL_P(param)[i]; - if (ch == '\0') { - break; - } - if (isalnum(ch) || ch == '_') { - smart_str_appendc(&filtered_str, ch); - } - } - - if (use_copy) { - zval_dtor(param); - } - - smart_str_0(&filtered_str); - - if (filtered_str.c) { - RETURN_STRINGL(filtered_str.c, filtered_str.len, 0); - } else { - RETURN_EMPTY_STRING(); - } - -} - /** * Check if a string is encoded with ASCII or ISO-8859-1 */ -void zephir_is_basic_charset(zval *return_value, const zval *param){ +void zephir_is_basic_charset(zval *return_value, const zval *param) +{ unsigned int i; unsigned int ch; @@ -143,10 +103,10 @@ void zephir_is_basic_charset(zval *return_value, const zval *param){ } if (!iso88591) { - RETURN_STRING("ASCII", 1); + RETURN_STRING("ASCII"); } - RETURN_STRING("ISO-8859-1", 1); + RETURN_STRING("ISO-8859-1"); } static long zephir_unpack(char *data, int size, int issigned, int *map) @@ -186,7 +146,8 @@ static inline char *zephir_longtohex(unsigned long value) { /** * Perform escaping of non-alphanumeric characters to different formats */ -void zephir_escape_multi(zval *return_value, zval *param, const char *escape_char, unsigned int escape_length, char escape_extra, int use_whitelist) { +void zephir_escape_multi(zval *return_value, zval *param, const char *escape_char, unsigned int escape_length, char escape_extra, int use_whitelist) +{ unsigned int i; zval copy; @@ -198,7 +159,7 @@ void zephir_escape_multi(zval *return_value, zval *param, const char *escape_cha long value; if (Z_TYPE_P(param) != IS_STRING) { - zend_make_printable_zval(param, ©, &use_copy); + use_copy = zend_make_printable_zval(param, ©); if (use_copy) { param = © } @@ -320,8 +281,8 @@ void zephir_escape_multi(zval *return_value, zval *param, const char *escape_cha smart_str_0(&escaped_str); - if (escaped_str.c) { - RETURN_STRINGL(escaped_str.c, escaped_str.len, 0); + if (escaped_str.s) { + RETURN_STR(escaped_str.s); } else { RETURN_EMPTY_STRING(); } @@ -330,48 +291,15 @@ void zephir_escape_multi(zval *return_value, zval *param, const char *escape_cha /** * Escapes non-alphanumeric characters to \HH+space */ -void zephir_escape_css(zval *return_value, zval *param) { +void zephir_escape_css(zval *return_value, zval *param) +{ zephir_escape_multi(return_value, param, "\\", sizeof("\\")-1, ' ', 0); } /** * Escapes non-alphanumeric characters to \xHH+ */ -void zephir_escape_js(zval *return_value, zval *param) { +void zephir_escape_js(zval *return_value, zval *param) +{ zephir_escape_multi(return_value, param, "\\x", sizeof("\\x")-1, '\0', 1); } - -/** - * Escapes non-alphanumeric characters to &xHH; - */ -void zephir_escape_htmlattr(zval *return_value, zval *param) { - zephir_escape_multi(return_value, param, "&#x", sizeof("&#x")-1, ';', 1); -} - -/** - * Escapes HTML replacing special chars by entities - */ -void zephir_escape_html(zval *return_value, zval *str, zval *quote_style, zval *charset TSRMLS_DC) { - size_t length; - - char *escaped; - - if (Z_TYPE_P(str) != IS_STRING) { - /* Nothing to escape */ - RETURN_ZVAL(str, 1, 0); - } - - if (Z_TYPE_P(quote_style) != IS_LONG) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid quote_style supplied for zephir_escape_html()"); - RETURN_ZVAL(str, 1, 0); - } - - if (Z_TYPE_P(charset) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid charset supplied for zephir_escape_html()"); - RETURN_ZVAL(str, 1, 0); - } - - escaped = php_escape_html_entities((unsigned char*) Z_STRVAL_P(str), Z_STRLEN_P(str), &length, 0, Z_LVAL_P(quote_style), Z_STRVAL_P(charset) TSRMLS_CC); - - RETURN_STRINGL(escaped, length, 0); -} diff --git a/ext/kernel/filter.h b/ext/kernel/filter.h index ed8d794baab..1ca33301605 100644 --- a/ext/kernel/filter.h +++ b/ext/kernel/filter.h @@ -22,17 +22,10 @@ #include -/** Low level filters */ void zephir_filter_alphanum(zval *return_value, zval *param); -void zephir_filter_identifier(zval *return_value, zval *param); - -/** Encoding */ void zephir_is_basic_charset(zval *return_value, const zval *param); - -/** Escaping */ -void zephir_escape_css(zval *return_value, zval *param); +void zephir_escape_multi(zval *return_value, zval *param, const char *escape_char, unsigned int escape_length, char escape_extra, int use_whitelist); void zephir_escape_js(zval *return_value, zval *param); -void zephir_escape_htmlattr(zval *return_value, zval *param); -void zephir_escape_html(zval *return_value, zval *str, zval *quote_style, zval *charset TSRMLS_DC); +void zephir_escape_css(zval *return_value, zval *param); #endif diff --git a/ext/kernel/globals.h b/ext/kernel/globals.h index b4841edf453..60980b3c3fd 100644 --- a/ext/kernel/globals.h +++ b/ext/kernel/globals.h @@ -30,13 +30,10 @@ typedef struct _zephir_memory_entry { size_t pointer; size_t capacity; - zval ***addresses; - size_t alt_pointer; - size_t alt_capacity; - zval **alt_addresses; + zval **addresses; size_t hash_pointer; size_t hash_capacity; - zval ***hash_addresses; + zval **hash_addresses; struct _zephir_memory_entry *prev; struct _zephir_memory_entry *next; #ifndef ZEPHIR_RELEASE @@ -48,7 +45,7 @@ typedef struct _zephir_memory_entry { /** Virtual Symbol Table */ typedef struct _zephir_symbol_table { struct _zephir_memory_entry *scope; - HashTable *symbol_table; + zend_array *symbol_table; struct _zephir_symbol_table *prev; } zephir_symbol_table; @@ -57,19 +54,8 @@ typedef struct _zephir_function_cache { zend_function *func; } zephir_function_cache; -#ifndef ZEPHIR_RELEASE - -typedef struct _zephir_fcall_cache_entry { - zend_function *f; - zend_uint times; -} zephir_fcall_cache_entry; - -#else - typedef zend_function zephir_fcall_cache_entry; -#endif - #define ZEPHIR_INIT_FUNCS(class_functions) static const zend_function_entry class_functions[] = /** Define FASTCALL */ @@ -89,10 +75,6 @@ typedef zend_function zephir_fcall_cache_entry; return FAILURE; \ } -#ifndef HASH_KEY_NON_EXISTENT -# define HASH_KEY_NON_EXISTENT HASH_KEY_NON_EXISTANT -#endif - #if defined(__GNUC__) && (defined(__clang__) || ((__GNUC__ * 100 + __GNUC_MINOR__) >= 405)) # define UNREACHABLE() __builtin_unreachable() # define ASSUME(x) if (x) {} else __builtin_unreachable() diff --git a/ext/kernel/iterator.c b/ext/kernel/iterator.c index b5d0e037d5a..4ff49cfc4af 100644 --- a/ext/kernel/iterator.c +++ b/ext/kernel/iterator.c @@ -31,26 +31,26 @@ /** * Returns an iterator from the object */ -zend_object_iterator *zephir_get_iterator(zval *iterator TSRMLS_DC) { - +zend_object_iterator *zephir_get_iterator(zval *iterator) +{ zend_class_entry *ce; zend_object_iterator *it; - if (Z_TYPE_P(iterator) != IS_OBJECT) { + if (UNEXPECTED(Z_TYPE_P(iterator) != IS_OBJECT)) { return NULL; } ce = Z_OBJCE_P(iterator); - it = ce->get_iterator(ce, iterator, 0 TSRMLS_CC); - if (!it || EG(exception)) { + it = ce->get_iterator(ce, iterator, 0); + if (UNEXPECTED(!it || EG(exception))) { return NULL; } - if (it->funcs->get_current_key == NULL) { + if (UNEXPECTED(it->funcs->get_current_key == NULL)) { return NULL; } - if (it->funcs->rewind == NULL) { + if (UNEXPECTED(it->funcs->rewind == NULL)) { return NULL; } diff --git a/ext/kernel/iterator.h b/ext/kernel/iterator.h index 0969ae53f8c..c2db8994673 100644 --- a/ext/kernel/iterator.h +++ b/ext/kernel/iterator.h @@ -1,21 +1,21 @@ /* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - | Vladimir Kolesnikov | - +------------------------------------------------------------------------+ + +------------------------------------------------------------------------+ + | Zephir Language | + +------------------------------------------------------------------------+ + | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | + +------------------------------------------------------------------------+ + | This source file is subject to the New BSD License that is bundled | + | with this package in the file docs/LICENSE.txt. | + | | + | If you did not receive a copy of the license and are unable to | + | obtain it through the world-wide-web, please send an email | + | to license@zephir-lang.com so we can send you a copy immediately. | + +------------------------------------------------------------------------+ + | Authors: Andres Gutierrez | + | Eduar Carvajal | + | Vladimir Kolesnikov | + +------------------------------------------------------------------------+ */ #ifndef ZEPHIR_KERNEL_ITERATOR_H @@ -24,6 +24,21 @@ #include #include -zend_object_iterator *zephir_get_iterator(zval *iterator TSRMLS_DC); +zend_object_iterator *zephir_get_iterator(zval *iterator); + +#define ZEPHIR_ITERATOR_COPY(var, it) \ + { \ + zval *ZEPHIR_TMP_ITERATOR_PTR; \ + ZEPHIR_TMP_ITERATOR_PTR = it->funcs->get_current_data(it); \ + if (UNEXPECTED(EG(exception) != NULL)) { \ + return; \ + } \ + ZEPHIR_INIT_NVAR(var); \ + if (Z_ISREF_P(var)) { \ + ZVAL_DUP(var, Z_REFVAL_P(var)); \ + } else { \ + ZVAL_COPY(var, ZEPHIR_TMP_ITERATOR_PTR); \ + } \ + } #endif diff --git a/ext/kernel/main.c b/ext/kernel/main.c index 70b976d8772..c940e0e26b4 100644 --- a/ext/kernel/main.c +++ b/ext/kernel/main.c @@ -1,104 +1,118 @@ - /* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - +------------------------------------------------------------------------+ -*/ + * This file is part of the Zephir. + * + * (c) Zephir Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. If you did not receive + * a copy of the license it is available through the world-wide-web at the + * following url: https://docs.zephir-lang.com/en/latest/license + */ #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include "php.h" -#include "php_ext.h" -#include "php_main.h" -#include "ext/spl/spl_exceptions.h" +#include +#include +#include +#include +#include +#include #include "kernel/main.h" #include "kernel/memory.h" #include "kernel/fcall.h" #include "kernel/exception.h" -#include "Zend/zend_exceptions.h" -#include "Zend/zend_interfaces.h" + +zend_string* i_parent = NULL; +zend_string* i_static = NULL; +zend_string* i_self = NULL; + +int zephir_is_iterable_ex(zval *arr, int duplicate) +{ + if (UNEXPECTED(Z_TYPE_P(arr) != IS_ARRAY)) { + return 0; + } + //TODO: duplicate + return 1; +} /** - * Initializes internal interface with extends + * Parses method parameters with minimum overhead */ -zend_class_entry *zephir_register_internal_interface_ex(zend_class_entry *orig_ce, zend_class_entry *parent_ce TSRMLS_DC) { +int zephir_fetch_parameters(int num_args, int required_args, int optional_args, ...) +{ + va_list va; + int arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data)); + zval *arg, **p; + int i; - zend_class_entry *ce; + if (num_args < required_args || (num_args > (required_args + optional_args))) { + zephir_throw_exception_string(spl_ce_BadMethodCallException, SL("Wrong number of parameters")); + return FAILURE; + } - ce = zend_register_internal_interface(orig_ce TSRMLS_CC); - if (parent_ce) { - zend_do_inheritance(ce, parent_ce TSRMLS_CC); + if (num_args > arg_count) { + zephir_throw_exception_string(spl_ce_BadMethodCallException, SL("Could not obtain parameters for parsing")); + return FAILURE; } - return ce; -} + if (!num_args) { + return SUCCESS; + } -/** - * Initilializes super global variables if doesn't - */ -int zephir_init_global(char *global, unsigned int global_length TSRMLS_DC) { - if (PG(auto_globals_jit)) { - return zend_is_auto_global(global, global_length - 1 TSRMLS_CC); + va_start(va, optional_args); + + i = 0; + while (num_args-- > 0) { + arg = ZEND_CALL_ARG(EG(current_execute_data), i + 1); + p = va_arg(va, zval **); + *p = arg; + + i++; } + va_end(va); + return SUCCESS; } /** * Gets the global zval into PG macro */ -int zephir_get_global(zval **arr, const char *global, unsigned int global_length TSRMLS_DC) { - - zval **gv; - +int zephir_get_global(zval **arr, const char *global, unsigned int global_length) +{ + zval *gv; zend_bool jit_initialization = PG(auto_globals_jit); + zend_string *str = zend_string_init(global, global_length, 0); + if (jit_initialization) { - zend_is_auto_global(global, global_length - 1 TSRMLS_CC); + zend_is_auto_global(str); } if (&EG(symbol_table)) { - if (zend_hash_find(&EG(symbol_table), global, global_length, (void **) &gv) == SUCCESS) { - if (Z_TYPE_PP(gv) == IS_ARRAY) { - *arr = *gv; - if (!*arr) { - ZEPHIR_INIT_VAR(*arr); - array_init(*arr); - } - } else { - ZEPHIR_INIT_VAR(*arr); - array_init(*arr); + if ((gv = zend_hash_find_ind(&EG(symbol_table), str)) != NULL) { + ZVAL_DEREF(gv); + if (Z_TYPE_P(gv) == IS_ARRAY) { + *arr = gv; + zend_string_release(str); + return SUCCESS; } - return SUCCESS; } } - ZEPHIR_INIT_VAR(*arr); - array_init(*arr); - - return SUCCESS; + *arr = NULL; + zend_string_release(str); + return FAILURE; } /** * Makes fast count on implicit array types */ -void zephir_fast_count(zval *result, zval *value TSRMLS_DC) { - +void zephir_fast_count(zval *result, zval *value) +{ if (Z_TYPE_P(value) == IS_ARRAY) { ZVAL_LONG(result, zend_hash_num_elements(Z_ARRVAL_P(value))); return; @@ -107,22 +121,22 @@ void zephir_fast_count(zval *result, zval *value TSRMLS_DC) { if (Z_TYPE_P(value) == IS_OBJECT) { #ifdef HAVE_SPL - zval *retval = NULL; + zval retval; #endif if (Z_OBJ_HT_P(value)->count_elements) { ZVAL_LONG(result, 1); - if (SUCCESS == Z_OBJ_HT(*value)->count_elements(value, &Z_LVAL_P(result) TSRMLS_CC)) { + if (SUCCESS == Z_OBJ_HT(*value)->count_elements(value, &Z_LVAL_P(result))) { return; } } #ifdef HAVE_SPL - if (Z_OBJ_HT_P(value)->get_class_entry && instanceof_function(Z_OBJCE_P(value), spl_ce_Countable TSRMLS_CC)) { - zend_call_method_with_0_params(&value, NULL, NULL, "count", &retval); - if (retval) { + if (instanceof_function(Z_OBJCE_P(value), spl_ce_Countable)) { + zend_call_method_with_0_params(value, NULL, NULL, "count", &retval); + if (Z_TYPE(retval) != IS_UNDEF) { convert_to_long_ex(&retval); - ZVAL_LONG(result, Z_LVAL_P(retval)); + ZVAL_LONG(result, Z_LVAL(retval)); zval_ptr_dtor(&retval); } return; @@ -144,9 +158,9 @@ void zephir_fast_count(zval *result, zval *value TSRMLS_DC) { /** * Makes fast count on implicit array types without creating a return zval value */ -int zephir_fast_count_ev(zval *value TSRMLS_DC) { - - long count = 0; +int zephir_fast_count_ev(zval *value) +{ + zend_long count = 0; if (Z_TYPE_P(value) == IS_ARRAY) { return zend_hash_num_elements(Z_ARRVAL_P(value)) > 0; @@ -155,20 +169,20 @@ int zephir_fast_count_ev(zval *value TSRMLS_DC) { if (Z_TYPE_P(value) == IS_OBJECT) { #ifdef HAVE_SPL - zval *retval = NULL; + zval retval; #endif if (Z_OBJ_HT_P(value)->count_elements) { - Z_OBJ_HT(*value)->count_elements(value, &count TSRMLS_CC); + Z_OBJ_HT(*value)->count_elements(value, &count); return (int) count > 0; } #ifdef HAVE_SPL - if (Z_OBJ_HT_P(value)->get_class_entry && instanceof_function(Z_OBJCE_P(value), spl_ce_Countable TSRMLS_CC)) { - zend_call_method_with_0_params(&value, NULL, NULL, "count", &retval); - if (retval) { + if (instanceof_function(Z_OBJCE_P(value), spl_ce_Countable)) { + zend_call_method_with_0_params(value, NULL, NULL, "count", &retval); + if (Z_TYPE(retval) != IS_UNDEF) { convert_to_long_ex(&retval); - count = Z_LVAL_P(retval); + count = Z_LVAL(retval); zval_ptr_dtor(&retval); return (int) count > 0; } @@ -189,9 +203,9 @@ int zephir_fast_count_ev(zval *value TSRMLS_DC) { /** * Makes fast count on implicit array types without creating a return zval value */ -int zephir_fast_count_int(zval *value TSRMLS_DC) { - - long count = 0; +int zephir_fast_count_int(zval *value) +{ + zend_long count = 0; if (Z_TYPE_P(value) == IS_ARRAY) { return zend_hash_num_elements(Z_ARRVAL_P(value)); @@ -200,20 +214,20 @@ int zephir_fast_count_int(zval *value TSRMLS_DC) { if (Z_TYPE_P(value) == IS_OBJECT) { #ifdef HAVE_SPL - zval *retval = NULL; + zval retval; #endif if (Z_OBJ_HT_P(value)->count_elements) { - Z_OBJ_HT(*value)->count_elements(value, &count TSRMLS_CC); + Z_OBJ_HT(*value)->count_elements(value, &count); return (int) count; } #ifdef HAVE_SPL - if (Z_OBJ_HT_P(value)->get_class_entry && instanceof_function(Z_OBJCE_P(value), spl_ce_Countable TSRMLS_CC)) { - zend_call_method_with_0_params(&value, NULL, NULL, "count", &retval); - if (retval) { + if (instanceof_function(Z_OBJCE_P(value), spl_ce_Countable)) { + zend_call_method_with_0_params(value, NULL, NULL, "count", &retval); + if (Z_TYPE(retval) != IS_UNDEF) { convert_to_long_ex(&retval); - count = Z_LVAL_P(retval); + count = Z_LVAL(retval); zval_ptr_dtor(&retval); return (int) count; } @@ -232,49 +246,55 @@ int zephir_fast_count_int(zval *value TSRMLS_DC) { } /** - * Check if a function exists + * Check if a function exists using explicit function length + * + * TODO: Deprecated. Will be removed in future */ -int zephir_function_exists(const zval *function_name TSRMLS_DC) { +int zephir_function_quick_exists_ex(const char *function_name, size_t function_len) +{ + if (zend_hash_str_exists(CG(function_table), function_name, function_len)) { + return SUCCESS; + } - return zephir_function_quick_exists_ex( - Z_STRVAL_P(function_name), - Z_STRLEN_P(function_name) + 1, - zend_inline_hash_func(Z_STRVAL_P(function_name), Z_STRLEN_P(function_name) + 1) TSRMLS_CC - ); + return FAILURE; } /** - * Check if a function exists using explicit char param + * Check if a function exists * * @param function_name - * @param function_len strlen(function_name)+1 + * @return */ -int zephir_function_exists_ex(const char *function_name, unsigned int function_len TSRMLS_DC) { +int zephir_function_exists(const zval *function_name) +{ + if (zend_hash_str_exists(CG(function_table), Z_STRVAL_P(function_name), Z_STRLEN_P(function_name))) { + return SUCCESS; + } - return zephir_function_quick_exists_ex(function_name, function_len, zend_inline_hash_func(function_name, function_len) TSRMLS_CC); + return FAILURE; } /** - * Check if a function exists using explicit char param (using precomputed hash key) + * Check if a function exists using explicit function length + * + * TODO: Deprecated. Will be removed in future + * @param function_name + * @param function_len strlen(function_name) + 1 */ -int zephir_function_quick_exists_ex(const char *method_name, unsigned int method_len, unsigned long key TSRMLS_DC) { - - if (zend_hash_quick_exists(CG(function_table), method_name, method_len, key)) { - return SUCCESS; - } - - return FAILURE; +int zephir_function_exists_ex(const char *function_name, unsigned int function_len) +{ + return zephir_function_quick_exists_ex(function_name, function_len); } /** * Checks if a zval is callable */ -int zephir_is_callable(zval *var TSRMLS_DC) { - +int zephir_is_callable(zval *var) +{ char *error = NULL; zend_bool retval; - retval = zend_is_callable_ex(var, NULL, 0, NULL, NULL, NULL, &error TSRMLS_CC); + retval = zend_is_callable_ex(var, NULL, 0, NULL, NULL, &error); if (error) { efree(error); } @@ -282,10 +302,14 @@ int zephir_is_callable(zval *var TSRMLS_DC) { return (int) retval; } -int zephir_is_scalar(zval *var) { - +/** + * Checks whether a variable has a scalar type + */ +int zephir_is_scalar(zval *var) +{ switch (Z_TYPE_P(var)) { - case IS_BOOL: + case IS_TRUE: + case IS_FALSE: case IS_DOUBLE: case IS_LONG: case IS_STRING: @@ -296,148 +320,133 @@ int zephir_is_scalar(zval *var) { return 0; } -/** - * Initialize an array to start an iteration over it - */ -int zephir_is_iterable_ex(zval *arr, HashTable **arr_hash, HashPosition *hash_position, int duplicate, int reverse) { - - if (UNEXPECTED(Z_TYPE_P(arr) != IS_ARRAY)) { - return 0; - } - - if (duplicate) { - ALLOC_HASHTABLE(*arr_hash); - zend_hash_init(*arr_hash, 0, NULL, NULL, 0); - zend_hash_copy(*arr_hash, Z_ARRVAL_P(arr), NULL, NULL, sizeof(zval*)); - } else { - *arr_hash = Z_ARRVAL_P(arr); - } - - if (reverse) { - if (hash_position) { - *hash_position = (*arr_hash)->pListTail; - } else { - (*arr_hash)->pInternalPointer = (*arr_hash)->pListTail; - } - } else { - if (hash_position) { - *hash_position = (*arr_hash)->pListHead; - } else { - (*arr_hash)->pInternalPointer = (*arr_hash)->pListHead; - } - } - - return 1; -} - -void zephir_safe_zval_ptr_dtor(zval *pzval) -{ - if (pzval) { - zval_ptr_dtor(&pzval); - } -} - -/** - * Parses method parameters with minimum overhead - */ -int zephir_fetch_parameters(int num_args TSRMLS_DC, int required_args, int optional_args, ...) -{ - va_list va; - int arg_count = (int) (zend_uintptr_t) *(zend_vm_stack_top(TSRMLS_C) - 1); - zval **arg, **p; - int i; - - if (num_args < required_args || (num_args > (required_args + optional_args))) { - zephir_throw_exception_string(spl_ce_BadMethodCallException, SL("Wrong number of parameters") TSRMLS_CC); - return FAILURE; - } - - if (num_args > arg_count) { - zephir_throw_exception_string(spl_ce_BadMethodCallException, SL("Could not obtain parameters for parsing") TSRMLS_CC); - return FAILURE; - } - - if (!num_args) { - return SUCCESS; - } - - va_start(va, optional_args); - - i = 0; - while (num_args-- > 0) { - - arg = (zval **) (zend_vm_stack_top(TSRMLS_C) - 1 - (arg_count - i)); - - p = va_arg(va, zval **); - *p = *arg; - - i++; - } - - va_end(va); - - return SUCCESS; -} - /** * Returns the type of a variable as a string */ -void zephir_gettype(zval *return_value, zval *arg TSRMLS_DC) { - +void zephir_gettype(zval *return_value, zval *arg) +{ switch (Z_TYPE_P(arg)) { case IS_NULL: - RETVAL_STRING("NULL", 1); + RETVAL_STRING("NULL"); break; - case IS_BOOL: - RETVAL_STRING("boolean", 1); + case IS_TRUE: + case IS_FALSE: + RETVAL_STRING("boolean"); break; case IS_LONG: - RETVAL_STRING("integer", 1); + RETVAL_STRING("integer"); break; case IS_DOUBLE: - RETVAL_STRING("double", 1); + RETVAL_STRING("double"); break; case IS_STRING: - RETVAL_STRING("string", 1); + RETVAL_STRING("string"); break; case IS_ARRAY: - RETVAL_STRING("array", 1); + RETVAL_STRING("array"); break; case IS_OBJECT: - RETVAL_STRING("object", 1); + RETVAL_STRING("object"); break; case IS_RESOURCE: { - const char *type_name = zend_rsrc_list_get_rsrc_type(Z_LVAL_P(arg) TSRMLS_CC); + const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(arg)); if (type_name) { - RETVAL_STRING("resource", 1); + RETVAL_STRING("resource"); break; } } + /* no break */ default: - RETVAL_STRING("unknown type", 1); + RETVAL_STRING("unknown type"); } } -zend_class_entry* zephir_get_internal_ce(const char *class_name, unsigned int class_name_len TSRMLS_DC) { - zend_class_entry** temp_ce; +zend_class_entry* zephir_get_internal_ce(const char *class_name, unsigned int class_name_len) +{ + zend_class_entry* temp_ce; - if (zend_hash_find(CG(class_table), class_name, class_name_len, (void **)&temp_ce) == FAILURE) { + if ((temp_ce = zend_hash_str_find_ptr(CG(class_table), class_name, class_name_len)) == NULL) { zend_error(E_ERROR, "Class '%s' not found", class_name); return NULL; } - return *temp_ce; + return temp_ce; +} + +/* Declare constants */ +int zephir_declare_class_constant(zend_class_entry *ce, const char *name, size_t name_length, zval *value) +{ +#if PHP_VERSION_ID >= 70100 + int ret; + + zend_string *key = zend_string_init(name, name_length, ce->type & ZEND_INTERNAL_CLASS); + ret = zend_declare_class_constant_ex(ce, key, value, ZEND_ACC_PUBLIC, NULL); + zend_string_release(key); + return ret; +#else + if (Z_CONSTANT_P(value)) { + ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED; + } + ZVAL_NEW_PERSISTENT_REF(value, value); + return zend_hash_str_update(&ce->constants_table, name, name_length, value) ? + SUCCESS : FAILURE; +#endif +} + +int zephir_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length) +{ + zval constant; + + ZVAL_NULL(&constant); + return zephir_declare_class_constant(ce, name, name_length, &constant); +} + +int zephir_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value) +{ + zval constant; + + ZVAL_LONG(&constant, value); + return zephir_declare_class_constant(ce, name, name_length, &constant); +} + +int zephir_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value) +{ + zval constant; + + ZVAL_BOOL(&constant, value); + return zephir_declare_class_constant(ce, name, name_length, &constant); +} + +int zephir_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value) +{ + zval constant; + + ZVAL_DOUBLE(&constant, value); + return zephir_declare_class_constant(ce, name, name_length, &constant); +} + +int zephir_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length) +{ + zval constant; + + ZVAL_NEW_STR(&constant, zend_string_init(value, value_length, ce->type & ZEND_INTERNAL_CLASS)); + return zephir_declare_class_constant(ce, name, name_length, &constant); +} + +int zephir_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value) +{ + return zephir_declare_class_constant_stringl(ce, name, name_length, value, strlen(value)); } /** @@ -466,48 +475,92 @@ int zephir_is_php_version(unsigned int id) return ((php_major + php_minor + php_release) == id ? 1 : 0); } -void zephir_get_args(zval *return_value TSRMLS_DC) +void +zephir_get_args(zval *return_value) { zend_execute_data *ex = EG(current_execute_data); - void **p = ex->function_state.arguments; - int arg_count = (int)(zend_uintptr_t)*p; - int i; + uint32_t arg_count = ZEND_CALL_NUM_ARGS(ex); array_init_size(return_value, arg_count); - for (i=0; ifunc->op_array.num_args; + zval *p = ZEND_CALL_ARG(ex, 1); + uint32_t i = 0; + + if (arg_count > first_extra_arg) { + while (i < first_extra_arg) { + zval *q = p; + + if (Z_TYPE_P(q) != IS_UNDEF) { + ZVAL_DEREF(q); + Z_TRY_ADDREF_P(q); + zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), q); + } + + ++p; + ++i; + } + + p = ZEND_CALL_VAR_NUM(ex, i); } - zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &q, sizeof(zval*), NULL); + while (i < arg_count) { + zval *q = p; + + if (Z_TYPE_P(q) != IS_UNDEF) { + ZVAL_DEREF(q); + Z_TRY_ADDREF_P(q); + zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), q); + } + + ++p; + ++i; + } } } -void zephir_get_arg(zval *return_value, int idx TSRMLS_DC) +void +zephir_get_arg(zval *return_value, zend_long idx) { zend_execute_data *ex = EG(current_execute_data); - void **p = ex->function_state.arguments; - int arg_count = (int)(zend_uintptr_t)*p; + uint32_t arg_count; zval *arg; if (UNEXPECTED(idx < 0)) { - zend_error(E_WARNING, "zephir_get_arg(): The argument number should be >= 0"); + zend_error(E_WARNING, "func_get_arg(): The argument number should be >= 0"); RETURN_FALSE; } + arg_count = ZEND_CALL_NUM_ARGS(ex); +#if PHP_VERSION_ID >= 70100 + if (zend_forbid_dynamic_call("func_get_arg()") == FAILURE) { + RETURN_FALSE; + } +#endif + if (UNEXPECTED((zend_ulong)idx >= arg_count)) { - zend_error(E_WARNING, "zephir_get_arg(): Argument %d not passed to function", idx); + zend_error(E_WARNING, "func_get_arg(): Argument " ZEND_LONG_FMT " not passed to function", idx); RETURN_FALSE; } - arg = *((zval**)(p - arg_count + idx)); - RETURN_ZVAL(arg, 1, 0); + arg = ZEND_CALL_VAR_NUM(ex, idx); + + if (EXPECTED(!Z_ISUNDEF_P(arg))) { + ZVAL_DEREF(arg); + ZVAL_COPY(return_value, arg); + return; + } + + RETURN_NULL(); +} + +void zephir_module_init() +{ + /* Though these strings won't be interned in ZTS, + * we still benefit from using zend_string* instead of char* + * in hash tables + */ + i_parent = zend_new_interned_string(zend_string_init(ZEND_STRL("parent"), 1)); + i_static = zend_new_interned_string(zend_string_init(ZEND_STRL("static"), 1)); + i_self = zend_new_interned_string(zend_string_init(ZEND_STRL("self"), 1)); } diff --git a/ext/kernel/main.h b/ext/kernel/main.h index c93510e68e7..ff553361665 100644 --- a/ext/kernel/main.h +++ b/ext/kernel/main.h @@ -1,30 +1,26 @@ - /* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - +------------------------------------------------------------------------+ -*/ + * This file is part of the Zephir. + * + * (c) Zephir Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. If you did not receive + * a copy of the license it is available through the world-wide-web at the + * following url: https://docs.zephir-lang.com/en/latest/license + */ #ifndef ZEPHIR_KERNEL_MAIN_H #define ZEPHIR_KERNEL_MAIN_H #include -#include #include #include -#include "kernel/exception.h" +#include +#include + +extern zend_string* i_parent; +extern zend_string* i_static; +extern zend_string* i_self; /** Main macros */ #define PH_DEBUG 0 @@ -33,36 +29,19 @@ #define PH_SILENT 1024 #define PH_READONLY 4096 -#define PH_NOISY_CC PH_NOISY TSRMLS_CC -#define PH_SILENT_CC PH_SILENT TSRMLS_CC +#define PH_NOISY_CC PH_NOISY +#define PH_SILENT_CC PH_SILENT #define PH_SEPARATE 256 #define PH_COPY 1024 #define PH_CTOR 4096 #ifndef zend_uint -#define zend_uint uint -#endif - -#ifndef str_erealloc -#define str_erealloc(str, new_len) \ - (IS_INTERNED(str) ? _str_erealloc(str, new_len, INTERNED_LEN(str)) : erealloc(str, new_len)) - -static inline char* _str_erealloc(char *str, size_t new_len, size_t old_len) -{ - char *buf = (char*)emalloc(new_len); - memcpy(buf, str, old_len); - return buf; -} + #define zend_uint uint #endif -#ifndef str_efree -#define str_efree(s) \ - do { \ - if (!IS_INTERNED(s)) { \ - efree(s); \ - } \ - } while (0) +#ifndef ZEND_ACC_FINAL_CLASS + #define ZEND_ACC_FINAL_CLASS ZEND_ACC_FINAL #endif #define SL(str) ZEND_STRL(str) @@ -70,433 +49,216 @@ static inline char* _str_erealloc(char *str, size_t new_len, size_t old_len) #define ISL(str) (zephir_interned_##str), (sizeof(#str)-1) #define ISS(str) (zephir_interned_##str), (sizeof(#str)) -/* Compatibility with PHP 5.3 */ -#ifndef ZVAL_COPY_VALUE - #define ZVAL_COPY_VALUE(z, v)\ - (z)->value = (v)->value;\ - Z_TYPE_P(z) = Z_TYPE_P(v); -#endif - -#ifndef INIT_PZVAL_COPY - #define INIT_PZVAL_COPY(z, v) ZVAL_COPY_VALUE(z, v);\ - Z_SET_REFCOUNT_P(z, 1);\ - Z_UNSET_ISREF_P(z); -#endif - -typedef long zend_long; - -/* Startup functions */ -zend_class_entry *zephir_register_internal_interface_ex(zend_class_entry *orig_ce, zend_class_entry *parent_ce TSRMLS_DC); - -/* Globals functions */ -int zephir_init_global(char *global, unsigned int global_length TSRMLS_DC); -int zephir_get_global(zval **arr, const char *global, unsigned int global_length TSRMLS_DC); - -int zephir_is_callable(zval *var TSRMLS_DC); -int zephir_is_scalar(zval *var); -int zephir_function_exists(const zval *function_name TSRMLS_DC); -int zephir_function_exists_ex(const char *func_name, unsigned int func_len TSRMLS_DC); -int zephir_function_quick_exists_ex(const char *func_name, unsigned int func_len, unsigned long key TSRMLS_DC); -zend_class_entry* zephir_get_internal_ce(const char *class_name, unsigned int class_name_len TSRMLS_DC); - -/* types */ -void zephir_gettype(zval *return_value, zval *arg TSRMLS_DC); - -/* Count */ -void zephir_fast_count(zval *result, zval *array TSRMLS_DC); -int zephir_fast_count_ev(zval *array TSRMLS_DC); -int zephir_fast_count_int(zval *value TSRMLS_DC); - -/* Utils functions */ -static inline int zephir_maybe_separate_zval(zval** z) -{ - if (Z_REFCOUNT_PP(z) > 1 && !Z_ISREF_PP(z)) { - zval *new_zv; - - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, *z); - *z = new_zv; - zval_copy_ctor(new_zv); +#include +#include "kernel/exception.h" - return 1; +/* class/interface registering */ +#define ZEPHIR_REGISTER_CLASS(ns, class_name, lower_ns, name, methods, flags) \ + { \ + zend_class_entry ce; \ + memset(&ce, 0, sizeof(zend_class_entry)); \ + INIT_NS_CLASS_ENTRY(ce, #ns, #class_name, methods); \ + lower_ns## _ ##name## _ce = zend_register_internal_class(&ce); \ + if (UNEXPECTED(!lower_ns## _ ##name## _ce)) { \ + const char *_n = (#ns); \ + const char *_c = (#class_name); \ + zend_error(E_ERROR, "%s\\%s: class registration has failed.", _n, _c); \ + return FAILURE; \ + } \ + lower_ns## _ ##name## _ce->ce_flags |= flags; \ } - return 0; -} - -int zephir_is_iterable_ex(zval *arr, HashTable **arr_hash, HashPosition *hash_position, int duplicate, int reverse); -void zephir_safe_zval_ptr_dtor(zval *pzval); - -/* Fetch Parameters */ -int zephir_fetch_parameters(int num_args TSRMLS_DC, int required_args, int optional_args, ...); - -/** Symbols */ -#define ZEPHIR_READ_SYMBOL(var, auxarr, name) if (EG(active_symbol_table)){ \ - if (zend_hash_find(EG(active_symbol_table), name, sizeof(name), (void **) &auxarr) == SUCCESS) { \ - var = *auxarr; \ - } else { \ - ZVAL_NULL(var); \ +#define ZEPHIR_REGISTER_CLASS_EX(ns, class_name, lower_ns, lcname, parent_ce, methods, flags) \ + { \ + zend_class_entry ce; \ + if (!parent_ce) { \ + fprintf(stderr, "Can't register class %s::%s with null parent\n", #ns, #class_name); \ + return FAILURE; \ + } \ + memset(&ce, 0, sizeof(zend_class_entry)); \ + INIT_NS_CLASS_ENTRY(ce, #ns, #class_name, methods); \ + lower_ns## _ ##lcname## _ce = zend_register_internal_class_ex(&ce, parent_ce); \ + if (!lower_ns## _ ##lcname## _ce) { \ + fprintf(stderr, "Zephir Error: Class to extend '%s' was not found when registering class '%s'\n", (parent_ce ? ZSTR_VAL(parent_ce->name) : "(null)"), ZEND_NS_NAME(#ns, #class_name)); \ + return FAILURE; \ } \ - } else { \ - ZVAL_NULL(var); \ + lower_ns## _ ##lcname## _ce->ce_flags |= flags; \ } -#define RETURN_ON_FAILURE(what) \ - do { \ - if (what == FAILURE) { \ - return; \ - } \ - } while (0) +#define ZEPHIR_REGISTER_INTERFACE(ns, classname, lower_ns, name, methods) \ + { \ + zend_class_entry ce; \ + memset(&ce, 0, sizeof(zend_class_entry)); \ + INIT_NS_CLASS_ENTRY(ce, #ns, #classname, methods); \ + lower_ns## _ ##name## _ce = zend_register_internal_interface(&ce); \ + } -#define RETURN_MM_ON_FAILURE(what) \ - do { \ - if (what == FAILURE) { \ - ZEPHIR_MM_RESTORE(); \ - return; \ +#define ZEPHIR_REGISTER_INTERFACE_EX(ns, classname, lower_ns, lcname, parent_ce, methods) \ + { \ + zend_class_entry ce; \ + if (!parent_ce) { \ + fprintf(stderr, "Can't register interface %s with null parent\n", ZEND_NS_NAME(#ns, #classname)); \ + return FAILURE; \ } \ - } while (0) - -#if PHP_VERSION_ID < 50600 - -/** Return zval checking if it's needed to ctor */ -#define RETURN_CCTOR(var) { \ - *(return_value) = *(var); \ - if (Z_TYPE_P(var) > IS_BOOL) { \ - zephir_copy_ctor(return_value, var); \ + memset(&ce, 0, sizeof(zend_class_entry)); \ + INIT_NS_CLASS_ENTRY(ce, #ns, #classname, methods); \ + lower_ns## _ ##lcname## _ce = zend_register_internal_interface(&ce); \ + if (parent_ce) { \ + zend_do_inheritance(ce, parent_ce); \ } \ - INIT_PZVAL(return_value) \ - } \ - ZEPHIR_MM_RESTORE(); \ - return; - -/** Return zval checking if it's needed to ctor, without restoring the memory stack */ -#define RETURN_CCTORW(var) { \ - *(return_value) = *(var); \ - if (Z_TYPE_P(var) > IS_BOOL) { \ - zephir_copy_ctor(return_value, var); \ + if (!lower_ns## _ ##lcname## _ce) { \ + fprintf(stderr, "Can't register interface %s with parent %s\n", ZEND_NS_NAME(#ns, #classname), (parent_ce ? ZSTR_VAL(parent_ce->name) : "(null)")); \ + return FAILURE; \ } \ - INIT_PZVAL(return_value) \ - } \ - return; + } /** Return zval with always ctor */ -#define RETURN_CTOR(var) { \ +#define RETURN_CTOR(var) \ + do { \ RETVAL_ZVAL(var, 1, 0); \ - } \ - ZEPHIR_MM_RESTORE(); \ - return; + ZEPHIR_MM_RESTORE(); \ + return; \ + } while (0) /** Return zval with always ctor, without restoring the memory stack */ -#define RETURN_CTORW(var) { \ +#define RETURN_CTORW(var) \ + do { \ RETVAL_ZVAL(var, 1, 0); \ - } \ - return; - -/** Return this pointer */ -#define RETURN_THIS() { \ - RETVAL_ZVAL(getThis(), 1, 0); \ - } \ - ZEPHIR_MM_RESTORE(); \ - return; - -/** Return zval with always ctor, without restoring the memory stack */ -#define RETURN_THISW() \ - RETURN_ZVAL(getThis(), 1, 0); - -#else + return; \ + } while (0) /** Return zval checking if it's needed to ctor */ -#define RETURN_CCTOR(var) { \ - RETVAL_ZVAL_FAST(var); \ - } \ - ZEPHIR_MM_RESTORE(); \ - return; +#define RETURN_CCTOR(v) \ + do { \ + ZVAL_DUP(return_value, v); \ + ZEPHIR_MM_RESTORE(); \ + return; \ + } while (0) /** Return zval checking if it's needed to ctor, without restoring the memory stack */ -#define RETURN_CCTORW(var) { \ - RETVAL_ZVAL_FAST(var); \ - } \ - return; - -/** Return zval with always ctor */ -#define RETURN_CTOR(var) { \ - RETVAL_ZVAL_FAST(var); \ - } \ - ZEPHIR_MM_RESTORE(); \ - return; +#define RETURN_CCTORW(v) \ + do { \ + ZVAL_DUP(return_value, v); \ + return; \ + } while (0) /** Return zval with always ctor, without restoring the memory stack */ -#define RETURN_CTORW(var) { \ - RETVAL_ZVAL_FAST(var); \ - } \ - return; +#define RETURN_THISW() \ + RETURN_ZVAL(getThis(), 1, 0); /** Return this pointer */ #define RETURN_THIS() { \ - RETVAL_ZVAL_FAST(getThis()); \ - } \ - ZEPHIR_MM_RESTORE(); \ - return; - -/** Return zval with always ctor, without restoring the memory stack */ -#define RETURN_THISW() \ - RETURN_ZVAL_FAST(getThis()); - -#endif - -/** Returns variables without ctor */ -#define RETURN_NCTOR(var) { \ - *(return_value) = *(var); \ - INIT_PZVAL(return_value) \ - } \ - ZEPHIR_MM_RESTORE(); \ - return; - -/** Returns variables without ctor, without restoring the memory stack */ -#define RETURN_NCTORW(var) { \ - *(return_value) = *(var); \ - INIT_PZVAL(return_value) \ - } \ - return; - -/** Check for ctor on the same return_value */ -#define RETURN_SCTOR() \ - if (Z_TYPE_P(return_value) > IS_BOOL) { \ - zval_copy_ctor(return_value); \ + RETVAL_ZVAL(getThis(), 1, 0); \ } \ ZEPHIR_MM_RESTORE(); \ return; -#define RETURN_LCTOR(var) { \ - zend_uchar is_ref = Z_ISREF_P(return_value); \ - zend_uint refcount = Z_REFCOUNT_P(return_value); \ - (return_value)->value = var.value; \ - Z_TYPE_P(return_value) = Z_TYPE(var); \ - zval_copy_ctor(return_value); \ - Z_SET_ISREF_TO_P(return_value, is_ref); \ - Z_SET_REFCOUNT_P(return_value, refcount); \ - ZEPHIR_MM_RESTORE(); \ - return; \ -} - -#define RETURN_LCTORW(var) { \ - zend_uchar is_ref = Z_ISREF_P(return_value); \ - zend_uint refcount = Z_REFCOUNT_P(return_value); \ - (return_value)->value = var.value; \ - Z_TYPE_P(return_value) = Z_TYPE(var); \ - zval_copy_ctor(return_value); \ - Z_SET_ISREF_TO_P(return_value, is_ref); \ - Z_SET_REFCOUNT_P(return_value, refcount); \ - return; \ -} +#define RETURN_LCTORW(var) RETURN_CCTORW(var); -/** - * Check for ctor on the same return_value, without restoring the memory stack - */ -#define RETURN_SCTORW() \ - if (Z_TYPE_P(return_value) > IS_BOOL) { \ - zval_copy_ctor(return_value); \ - } \ - return; +#define RETURN_LCTOR(var) RETURN_CCTOR(var); /** * Returns a zval in an object member */ #define RETURN_MEMBER(object, member_name) \ - zephir_return_property_quick(return_value, return_value_ptr, object, SL(member_name), zend_inline_hash_func(SS(member_name)) TSRMLS_CC); \ + zephir_return_property(return_value, object, SL(member_name)); \ return; -/** - * Returns a zval in an object member - */ -#define RETURN_MM_MEMBER(object, member_name) \ - zephir_return_property_quick(return_value, return_value_ptr, object, SL(member_name), zend_inline_hash_func(SS(member_name)) TSRMLS_CC); \ - RETURN_MM(); - -/** - * Returns a zval in an object member (quick) - */ -#define RETURN_MEMBER_QUICK(object, member_name, key) \ - zephir_return_property_quick(return_value, NULL, object, SL(member_name), key TSRMLS_CC); \ - return; - -/** - * Returns a zval in an object member (quick) - */ -#define RETURN_MM_MEMBER_QUICK(object, member_name, key) \ - zephir_return_property_quick(return_value, NULL, object, SL(member_name), key TSRMLS_CC); \ - RETURN_MM(); - /** Return without change return_value */ #define RETURN_MM() { ZEPHIR_MM_RESTORE(); return; } /** Return null restoring memory frame */ #define RETURN_MM_BOOL(value) { RETVAL_BOOL(value); ZEPHIR_MM_RESTORE(); return; } -/** Return null restoring memory frame */ -#define RETURN_MM_NULL() { RETVAL_NULL(); ZEPHIR_MM_RESTORE(); return; } - -/** Return bool restoring memory frame */ -#define RETURN_MM_FALSE { RETVAL_FALSE; ZEPHIR_MM_RESTORE(); return; } -#define RETURN_MM_TRUE { RETVAL_TRUE; ZEPHIR_MM_RESTORE(); return; } - /** Return string restoring memory frame */ -#define RETURN_MM_STRING(str, copy) { RETVAL_STRING(str, copy); ZEPHIR_MM_RESTORE(); return; } +#define RETURN_MM_STRING(str) { RETVAL_STRING(str); ZEPHIR_MM_RESTORE(); return; } #define RETURN_MM_EMPTY_STRING() { RETVAL_EMPTY_STRING(); ZEPHIR_MM_RESTORE(); return; } -/** Return empty array */ -#define RETVAL_EMPTY_ARRAY() { array_init(return_value); } -#define RETURN_EMPTY_ARRAY() { RETVAL_EMPTY_ARRAY(); return; } -#define RETURN_MM_EMPTY_ARRAY() { RETVAL_EMPTY_ARRAY(); ZEPHIR_MM_RESTORE(); return; } - /* Return long */ #define RETURN_MM_LONG(value) { RETVAL_LONG(value); ZEPHIR_MM_RESTORE(); return; } /* Return double */ #define RETURN_MM_DOUBLE(value) { RETVAL_DOUBLE(value); ZEPHIR_MM_RESTORE(); return; } -/** Get the current hash key without copying the hash key */ -#define ZEPHIR_GET_HKEY(var, hash, hash_position) \ - zephir_get_current_key(&var, hash, &hash_position TSRMLS_CC); - -/** Get current hash key copying the hash_value if needed */ -#define ZEPHIR_GET_HMKEY(var, hash, hash_pointer) \ - {\ - int hash_type; \ - char *hash_index; \ - uint hash_index_len; \ - ulong hash_num; \ - \ - ZEPHIR_INIT_NVAR(var); \ - hash_type = zend_hash_get_current_key_ex(hash, &hash_index, &hash_index_len, &hash_num, 0, &hash_pointer); \ - if (hash_type == HASH_KEY_IS_STRING) { \ - if (IS_INTERNED(hash_index)) { \ - ZVAL_STRINGL(var, hash_index, hash_index_len - 1, 0); \ - } else { \ - ZVAL_STRINGL(var, hash_index, hash_index_len - 1, 1); \ - } \ - } else { \ - if (hash_type == HASH_KEY_IS_LONG) { \ - ZVAL_LONG(var, hash_num); \ - }\ - }\ - } +/** + * Returns a zval in an object member + */ +#define RETURN_MM_MEMBER(object, member_name) \ + zephir_return_property(return_value, object, SL(member_name)); \ + RETURN_MM(); -/** Get current hash key copying the iterator if needed */ -// TODO: Deprecated. Will be removed in future -#if PHP_VERSION_ID < 50500 - -#define ZEPHIR_GET_IMKEY(var, it) \ - {\ - int key_type; uint str_key_len; \ - ulong int_key; \ - char *str_key; \ - \ - ZEPHIR_INIT_NVAR(var); \ - key_type = it->funcs->get_current_key(it, &str_key, &str_key_len, &int_key TSRMLS_CC); \ - if (key_type == HASH_KEY_IS_STRING) { \ - ZVAL_STRINGL(var, str_key, str_key_len - 1, 1); \ - efree(str_key); \ - } else { \ - if (key_type == HASH_KEY_IS_LONG) { \ - ZVAL_LONG(var, int_key); \ - } else { \ - ZVAL_NULL(var); \ - } \ +#define RETURN_ON_FAILURE(what) \ + do { \ + if (what == FAILURE) { \ + return; \ } \ - } + } while (0) -#else +#define RETURN_MM_ON_FAILURE(what) \ + do { \ + if (what == FAILURE) { \ + ZEPHIR_MM_RESTORE(); \ + return; \ + } \ + } while (0) -#define ZEPHIR_GET_IMKEY(var, it) \ - {\ - ZEPHIR_INIT_NVAR(var); \ - it->funcs->get_current_key(it, var TSRMLS_CC); \ - } +/** Return null restoring memory frame */ +#define RETURN_MM_NULL() { RETVAL_NULL(); ZEPHIR_MM_RESTORE(); return; } -#endif +/* Globals functions */ +int zephir_get_global(zval **arr, const char *global, unsigned int global_length); -/** Foreach */ -#define ZEPHIR_GET_FOREACH_KEY(var, hash, hash_pointer) ZEPHIR_GET_HMKEY(var, hash, hash_pointer) +/* Count */ +void zephir_fast_count(zval *result, zval *array); +int zephir_fast_count_ev(zval *array); +int zephir_fast_count_int(zval *value); -/** Check if an array is iterable or not */ -#define zephir_is_iterable(var, array_hash, hash_pointer, duplicate, reverse, file, line) \ - if (!var || !zephir_is_iterable_ex(var, array_hash, hash_pointer, duplicate, reverse)) { \ - ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(zend_exception_get_default(TSRMLS_C), "The argument is not initialized or iterable()", file, line); \ - ZEPHIR_MM_RESTORE(); \ - return; \ - } +int zephir_is_callable(zval *var); +int zephir_is_scalar(zval *var); -#define ZEPHIR_GET_FOREACH_VALUE(var) \ - ZEPHIR_OBS_NVAR(var); \ - var = *hd; \ - Z_ADDREF_P(var); +int zephir_function_exists(const zval *function_name); +int zephir_function_exists_ex(const char *func_name, unsigned int func_len); -#define ZEPHIR_GET_HVALUE(var, hd) \ - ZEPHIR_OBS_NVAR(var); \ - var = *hd; \ - Z_ADDREF_P(var); +zend_class_entry* zephir_get_internal_ce(const char *class_name, unsigned int class_name_len); -/** class/interface registering */ -#define ZEPHIR_REGISTER_CLASS(ns, class_name, lower_ns, name, methods, flags) \ - { \ - zend_class_entry ce; \ - memset(&ce, 0, sizeof(zend_class_entry)); \ - INIT_NS_CLASS_ENTRY(ce, #ns, #class_name, methods); \ - lower_ns## _ ##name## _ce = zend_register_internal_class(&ce TSRMLS_CC); \ - lower_ns## _ ##name## _ce->ce_flags |= flags; \ - } +/* types */ +void zephir_gettype(zval *return_value, zval *arg); -#define ZEPHIR_REGISTER_CLASS_EX(ns, class_name, lower_ns, lcname, parent_ce, methods, flags) \ - { \ - zend_class_entry ce; \ - if (!parent_ce) { \ - fprintf(stderr, "Can't register class %s::%s with null parent\n", #ns, #class_name); \ - return FAILURE; \ - } \ - memset(&ce, 0, sizeof(zend_class_entry)); \ - INIT_NS_CLASS_ENTRY(ce, #ns, #class_name, methods); \ - lower_ns## _ ##lcname## _ce = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC); \ - if (!lower_ns## _ ##lcname## _ce) { \ - fprintf(stderr, "Zephir Error: Class to extend '%s' was not found when registering class '%s'\n", (parent_ce ? parent_ce->name : "(null)"), ZEND_NS_NAME(#ns, #class_name)); \ - return FAILURE; \ - } \ - lower_ns## _ ##lcname## _ce->ce_flags |= flags; \ +/* Utils functions */ +static inline int zephir_maybe_separate_zval(zval* z) +{ + if (!Z_REFCOUNTED_P(z) || (Z_REFCOUNT_P(z) > 1 && !Z_ISREF_P(z))) { + if (!(Z_COPYABLE_P(z) && !Z_REFCOUNTED_P(z))) { + Z_DELREF_P(z); + } + zval_copy_ctor_func(z); + return 1; } -#define ZEPHIR_MAKE_REF(obj) Z_SET_ISREF_P(obj); -#define ZEPHIR_UNREF(obj) Z_UNSET_ISREF_P(obj); + return 0; +} -#define ZEPHIR_REGISTER_INTERFACE(ns, classname, lower_ns, name, methods) \ - { \ - zend_class_entry ce; \ - memset(&ce, 0, sizeof(zend_class_entry)); \ - INIT_NS_CLASS_ENTRY(ce, #ns, #classname, methods); \ - lower_ns## _ ##name## _ce = zend_register_internal_interface(&ce TSRMLS_CC); \ - } +#define ZEPHIR_SET_SYMBOL(symbol_table, name, value) { \ + Z_TRY_ADDREF_P(value); \ + zend_hash_str_update(symbol_table, name, sizeof(name) - 1, value); \ +} -#define ZEPHIR_REGISTER_INTERFACE_EX(ns, classname, lower_ns, lcname, parent_ce, methods) \ - { \ - zend_class_entry ce; \ - if (!parent_ce) { \ - fprintf(stderr, "Can't register interface %s with null parent\n", ZEND_NS_NAME(#ns, #classname)); \ - return FAILURE; \ - } \ - memset(&ce, 0, sizeof(zend_class_entry)); \ - INIT_NS_CLASS_ENTRY(ce, #ns, #classname, methods); \ - lower_ns## _ ##lcname## _ce = zephir_register_internal_interface_ex(&ce, parent_ce TSRMLS_CC); \ - if (!lower_ns## _ ##lcname## _ce) { \ - fprintf(stderr, "Can't register interface %s with parent %s\n", ZEND_NS_NAME(#ns, #classname), (parent_ce ? parent_ce->name : "(null)")); \ - return FAILURE; \ - } \ +int zephir_is_iterable_ex(zval *arr, int duplicate); + +/** Check if an array is iterable or not */ +#define zephir_is_iterable(var, duplicate, file, line) \ + if (!zephir_is_iterable_ex(var, duplicate)) { \ + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(zend_exception_get_default(), "The argument is not initialized or iterable()", file, line); \ + ZEPHIR_MM_RESTORE(); \ + return; \ } -/** Method declaration for API generation */ -#define ZEPHIR_DOC_METHOD(class_name, method) +/* Fetch Parameters */ +int zephir_fetch_parameters(int num_args, int required_args, int optional_args, ...); /** Low overhead parse/fetch parameters */ #define zephir_fetch_params(memory_grow, required_params, optional_params, ...) \ - if (zephir_fetch_parameters(ZEND_NUM_ARGS() TSRMLS_CC, required_params, optional_params, __VA_ARGS__) == FAILURE) { \ + if (zephir_fetch_parameters(ZEND_NUM_ARGS(), required_params, optional_params, __VA_ARGS__) == FAILURE) { \ if (memory_grow) { \ RETURN_MM_NULL(); \ } else { \ @@ -504,41 +266,40 @@ int zephir_fetch_parameters(int num_args TSRMLS_DC, int required_args, int optio } \ } -#define ZEPHIR_VERIFY_INTERFACE(instance, interface_ce) \ - do { \ - if (Z_TYPE_P(instance) != IS_OBJECT || !instanceof_function_ex(Z_OBJCE_P(instance), interface_ce, 1 TSRMLS_CC)) { \ - char *buf; \ - if (Z_TYPE_P(instance) != IS_OBJECT) { \ - spprintf(&buf, 0, "Unexpected value type: expected object implementing %s, %s given", interface_ce->name, zend_zval_type_name(instance)); \ - } \ - else { \ - spprintf(&buf, 0, "Unexpected value type: expected object implementing %s, object of type %s given", interface_ce->name, Z_OBJCE_P(instance)->name); \ - } \ - ZEPHIR_THROW_EXCEPTION_STR(spl_ce_LogicException, buf); \ - efree(buf); \ - return; \ - } \ - } while (0) +#define ZEPHIR_CREATE_OBJECT(obj, class_type) \ + { \ + zend_object *object = zend_objects_new(class_type); \ + ZVAL_UNDEF(obj); \ + ZVAL_OBJ(obj, object); \ + object_properties_init(object, class_type); \ + } +#define ZEPHIR_MAKE_REF(obj) ZVAL_NEW_REF(obj, obj); +#define ZEPHIR_UNREF(obj) ZVAL_UNREF(obj); -#define ZEPHIR_VERIFY_CLASS(instance, class_ce) \ - do { \ - if (Z_TYPE_P(instance) != IS_OBJECT || !instanceof_function_ex(Z_OBJCE_P(instance), class_ce, 0 TSRMLS_CC)) { \ - char *buf; \ - if (Z_TYPE_P(instance) != IS_OBJECT) { \ - spprintf(&buf, 0, "Unexpected value type: expected object of type %s, %s given", class_ce->name, zend_zval_type_name(instance)); \ - } \ - else { \ - spprintf(&buf, 0, "Unexpected value type: expected object of type %s, object of type %s given", class_ce->name, Z_OBJCE_P(instance)->name); \ - } \ - ZEPHIR_THROW_EXCEPTION_STR(spl_ce_LogicException, buf); \ - efree(buf); \ - return; \ - } \ - } while (0) +#define ZEPHIR_GET_CONSTANT(return_value, const_name) do { \ + zval *_constant_ptr = zend_get_constant_str(SL(const_name)); \ + if (_constant_ptr == NULL) { \ + ZEPHIR_MM_RESTORE(); \ + return; \ + } \ + ZVAL_COPY(return_value, _constant_ptr); \ +} while(0) -#define ZEPHIR_GET_CONSTANT(return_value, const_name) \ - RETURN_MM_ON_FAILURE(zend_get_constant(SL(const_name), return_value TSRMLS_CC)); +#define ZEPHIR_GET_IMKEY(var, it) it->funcs->get_current_key(it, &var); + +/* Declare class constants */ +int zephir_declare_class_constant_null(zend_class_entry *ce, const char *name, size_t name_length); +int zephir_declare_class_constant_long(zend_class_entry *ce, const char *name, size_t name_length, zend_long value); +int zephir_declare_class_constant_bool(zend_class_entry *ce, const char *name, size_t name_length, zend_bool value); +int zephir_declare_class_constant_double(zend_class_entry *ce, const char *name, size_t name_length, double value); +int zephir_declare_class_constant_stringl(zend_class_entry *ce, const char *name, size_t name_length, const char *value, size_t value_length); +int zephir_declare_class_constant_string(zend_class_entry *ce, const char *name, size_t name_length, const char *value); + +int zephir_is_php_version(unsigned int id); + +/** Method declaration for API generation */ +#define ZEPHIR_DOC_METHOD(class_name, method) #ifndef ZEPHIR_RELEASE #define ZEPHIR_DEBUG_PARAMS , const char *file, int line @@ -548,11 +309,9 @@ int zephir_fetch_parameters(int num_args TSRMLS_DC, int required_args, int optio #define ZEPHIR_DEBUG_PARAMS_DUMMY , "", 0 #endif -#define ZEPHIR_CHECK_POINTER(v) if (!v) fprintf(stderr, "%s:%d\n", __PRETTY_FUNCTION__, __LINE__); - -int zephir_is_php_version(unsigned int id); +void zephir_get_args(zval* return_value); +void zephir_get_arg(zval* return_value, zend_long idx); -void zephir_get_args(zval* return_value TSRMLS_DC); -void zephir_get_arg(zval* return_value, int idx TSRMLS_DC); +void zephir_module_init(); #endif /* ZEPHIR_KERNEL_MAIN_H */ diff --git a/ext/kernel/math.c b/ext/kernel/math.c index 8f3cac03ce9..489fb5da9c2 100644 --- a/ext/kernel/math.c +++ b/ext/kernel/math.c @@ -34,21 +34,22 @@ #include "Zend/zend_operators.h" -double zephir_floor(zval *op1 TSRMLS_DC) +double zephir_sqrt(zval *op1) { switch (Z_TYPE_P(op1)) { case IS_LONG: - return (double) Z_LVAL_P(op1); + return sqrt(Z_LVAL_P(op1)); case IS_ARRAY: case IS_OBJECT: case IS_RESOURCE: zend_error(E_WARNING, "Unsupported operand types"); break; } - return floor(zephir_get_numberval(op1)); + + return sqrt(zephir_get_numberval(op1)); } -double zephir_sin(zval *op1 TSRMLS_DC) +double zephir_sin(zval *op1) { switch (Z_TYPE_P(op1)) { case IS_LONG: @@ -63,7 +64,7 @@ double zephir_sin(zval *op1 TSRMLS_DC) return sin(zephir_get_numberval(op1)); } -double zephir_asin(zval *op1 TSRMLS_DC) +double zephir_asin(zval *op1) { switch (Z_TYPE_P(op1)) { case IS_LONG: @@ -78,7 +79,7 @@ double zephir_asin(zval *op1 TSRMLS_DC) return asin(zephir_get_numberval(op1)); } -double zephir_cos(zval *op1 TSRMLS_DC) +double zephir_cos(zval *op1) { switch (Z_TYPE_P(op1)) { case IS_LONG: @@ -93,7 +94,7 @@ double zephir_cos(zval *op1 TSRMLS_DC) return cos(zephir_get_numberval(op1)); } -double zephir_acos(zval *op1 TSRMLS_DC) +double zephir_acos(zval *op1) { switch (Z_TYPE_P(op1)) { case IS_LONG: @@ -108,11 +109,11 @@ double zephir_acos(zval *op1 TSRMLS_DC) return acos(zephir_get_numberval(op1)); } -double zephir_sqrt(zval *op1 TSRMLS_DC) +double zephir_tan(zval *op1) { switch (Z_TYPE_P(op1)) { case IS_LONG: - return sqrt(Z_LVAL_P(op1)); + return tan(Z_LVAL_P(op1)); case IS_ARRAY: case IS_OBJECT: case IS_RESOURCE: @@ -120,26 +121,24 @@ double zephir_sqrt(zval *op1 TSRMLS_DC) break; } - return sqrt(zephir_get_numberval(op1)); + return tan(zephir_get_numberval(op1)); } -double zephir_tan(zval *op1 TSRMLS_DC) +double zephir_floor(zval *op1) { switch (Z_TYPE_P(op1)) { case IS_LONG: - return tan(Z_LVAL_P(op1)); + return (double) Z_LVAL_P(op1); case IS_ARRAY: case IS_OBJECT: case IS_RESOURCE: zend_error(E_WARNING, "Unsupported operand types"); break; } - - return tan(zephir_get_numberval(op1)); + return floor(zephir_get_numberval(op1)); } - -double zephir_ceil(zval *op1 TSRMLS_DC) +double zephir_ceil(zval *op1) { switch (Z_TYPE_P(op1)) { case IS_LONG: @@ -155,13 +154,13 @@ double zephir_ceil(zval *op1 TSRMLS_DC) extern double _php_math_round(double value, int places, int mode); -void zephir_round(zval *return_value, zval *op1, zval *op2, zval *op3 TSRMLS_DC) +void zephir_round(zval *return_value, zval *op1, zval *op2, zval *op3) { int places = 0; long mode = PHP_ROUND_HALF_UP; double return_val; - convert_scalar_to_number_ex(&op1); + convert_scalar_to_number_ex(op1); if (op2) { places = zephir_get_intval_ex(op2); @@ -170,16 +169,16 @@ void zephir_round(zval *return_value, zval *op1, zval *op2, zval *op3 TSRMLS_DC) mode = zephir_get_intval_ex(op3); } - switch (Z_TYPE_PP(&op1)) { + switch (Z_TYPE_P(op1)) { case IS_LONG: /* Simple case - long that doesn't need to be rounded. */ if (places >= 0) { - RETURN_DOUBLE((double) Z_LVAL_PP(&op1)); + RETURN_DOUBLE((double) Z_LVAL_P(op1)); } /* break omitted intentionally */ case IS_DOUBLE: - return_val = (Z_TYPE_PP(&op1) == IS_LONG) ? (double)Z_LVAL_PP(&op1) : Z_DVAL_PP(&op1); + return_val = (Z_TYPE_P(op1) == IS_LONG) ? (double)Z_LVAL_P(op1) : Z_DVAL_P(op1); return_val = _php_math_round(return_val, places, mode); RETURN_DOUBLE(return_val); break; @@ -190,72 +189,37 @@ void zephir_round(zval *return_value, zval *op1, zval *op2, zval *op3 TSRMLS_DC) } } -#if PHP_VERSION_ID < 50600 -#include "Zend/zend_multiply.h" -void zephir_pow_function_ex(zval *return_value, zval *zbase, zval *zexp TSRMLS_DC) +zend_long +zephir_mt_rand(zend_long min, zend_long max) { - /* make sure we're dealing with numbers */ - convert_scalar_to_number(zbase TSRMLS_CC); - convert_scalar_to_number(zexp TSRMLS_CC); - - /* if both base and exponent were longs, we'll try to get a long out */ - if (Z_TYPE_P(zbase) == IS_LONG && Z_TYPE_P(zexp) == IS_LONG && Z_LVAL_P(zexp) >= 0) { - long l1 = 1, l2 = Z_LVAL_P(zbase), i = Z_LVAL_P(zexp); - - if (i == 0) { - RETURN_LONG(1L); - } else if (l2 == 0) { - RETURN_LONG(0); - } - - /* calculate pow(long,long) in O(log exp) operations, bail if overflow */ - while (i >= 1) { - int overflow; - double dval = 0.0; - - if (i % 2) { - --i; - ZEND_SIGNED_MULTIPLY_LONG(l1, l2, l1, dval, overflow); - if (overflow) RETURN_DOUBLE(dval * pow(l2, i)); - } else { - i /= 2; - ZEND_SIGNED_MULTIPLY_LONG(l2, l2, l2, dval,overflow); - if (overflow) RETURN_DOUBLE((double)l1 * pow(dval, i)); - } - if (i == 0) { - RETURN_LONG(l1); - } - } - } - convert_to_double(zbase); - convert_to_double(zexp); - - RETURN_DOUBLE(pow(Z_DVAL_P(zbase), Z_DVAL_P(zexp))); -} -#endif - - - -long zephir_mt_rand(long min, long max TSRMLS_DC) { - - long number; + zend_long number; if (max < min) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "max(%ld) is smaller than min(%ld)", max, min); + php_error_docref(NULL, E_WARNING, "max(%ld) is smaller than min(%ld)", max, min); return 0; } if (!BG(mt_rand_is_seeded)) { - php_mt_srand(GENERATE_SEED() TSRMLS_CC); + php_mt_srand(GENERATE_SEED()); } - number = (long) (php_mt_rand(TSRMLS_C) >> 1); + number = (zend_long) (php_mt_rand() >> 1); + + /** + * The RAND_RANGE() macro has been removed since PHP 7.3. + * php_mt_rand_range() should be used instead. + * However, php_mt_rand_range() has been present since PHP 7.1. + */ +#if PHP_VERSION_ID < 70100 RAND_RANGE(number, min, max, PHP_MT_RAND_MAX); +#else + number = php_mt_rand_range(min, max); +#endif return number; } -double zephir_ldexp(zval *value, zval *expval TSRMLS_DC) +double zephir_ldexp(zval *value, zval *expval) { int exp = (int) zephir_get_numberval(expval); diff --git a/ext/kernel/math.h b/ext/kernel/math.h index 9720bf864e7..6b4272a08cd 100644 --- a/ext/kernel/math.h +++ b/ext/kernel/math.h @@ -23,21 +23,18 @@ #include #include -double zephir_sin(zval *op1 TSRMLS_DC); -double zephir_asin(zval *op1 TSRMLS_DC); -double zephir_tan(zval *op1 TSRMLS_DC); -double zephir_cos(zval *op1 TSRMLS_DC); -double zephir_acos(zval *op1 TSRMLS_DC); -double zephir_sqrt(zval *op1 TSRMLS_DC); - -double zephir_floor(zval *op1 TSRMLS_DC); -double zephir_ceil(zval *op1 TSRMLS_DC); - -void zephir_round(zval *return_value, zval *op1, zval *op2, zval *op3 TSRMLS_DC); -void zephir_pow(zval *return_value, zval *op1, zval *op2 TSRMLS_DC); - -long zephir_mt_rand(long min, long max TSRMLS_DC); - -double zephir_ldexp(zval *value, zval *expval TSRMLS_DC); +double zephir_sin(zval *op1); +double zephir_asin(zval *op1); +double zephir_tan(zval *op1); +double zephir_cos(zval *op1); +double zephir_acos(zval *op1); +double zephir_sqrt(zval *op1); + +double zephir_floor(zval *op1); +zend_long zephir_mt_rand(zend_long min, zend_long max); +double zephir_ceil(zval *op1); +void zephir_round(zval *return_value, zval *op1, zval *op2, zval *op3); + +double zephir_ldexp(zval *value, zval *expval); #endif diff --git a/ext/kernel/memory.c b/ext/kernel/memory.c index 9e4e2c76107..1cb64ad6ede 100644 --- a/ext/kernel/memory.c +++ b/ext/kernel/memory.c @@ -45,6 +45,16 @@ * Not all methods must grow/restore the zephir_memory_entry. */ +static zend_always_inline zend_execute_data* +find_symbol_table(zend_execute_data* ex) +{ + while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->common.type))) { + ex = ex->prev_execute_data; + } + + return ex; +} + static zephir_memory_entry* zephir_memory_grow_stack_common(zend_zephir_globals_def *g) { assert(g->start_memory != NULL); @@ -59,18 +69,6 @@ static zephir_memory_entry* zephir_memory_grow_stack_common(zend_zephir_globals_ assert(g->active_memory >= g->end_memory - 1 || g->active_memory < g->start_memory); #endif zephir_memory_entry *entry = (zephir_memory_entry *) ecalloc(1, sizeof(zephir_memory_entry)); - /* ecalloc() will take care of these members - entry->pointer = 0; - entry->capacity = 0; - entry->addresses = NULL; - entry->alt_pointer = 0; - entry->alt_capacity = 0; - entry->alt_addresses = NULL; - entry->hash_pointer = 0; - entry->hash_capacity = 0; - entry->hash_addresses = NULL; - entry->next = NULL; - */ #ifndef ZEPHIR_RELEASE entry->permanent = 0; entry->func = NULL; @@ -88,7 +86,6 @@ static zephir_memory_entry* zephir_memory_grow_stack_common(zend_zephir_globals_ } assert(g->active_memory->pointer == 0); - assert(g->active_memory->alt_pointer == 0); assert(g->active_memory->hash_pointer == 0); return g->active_memory; @@ -97,11 +94,15 @@ static zephir_memory_entry* zephir_memory_grow_stack_common(zend_zephir_globals_ /** * Restore a memory stack applying GC to all observed variables */ -static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g TSRMLS_DC) +static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g) { size_t i; zephir_memory_entry *prev, *active_memory; zephir_symbol_table *active_symbol_table; + zval *ptr; +#ifndef ZEPHIR_RELEASE + int show_backtrace = 0; +#endif active_memory = g->active_memory; assert(active_memory != NULL); @@ -110,72 +111,75 @@ static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g TSRMLS /* Clean active symbol table */ if (g->active_symbol_table) { active_symbol_table = g->active_symbol_table; - if (active_symbol_table->scope == active_memory) { - zend_hash_destroy(EG(active_symbol_table)); - FREE_HASHTABLE(EG(active_symbol_table)); - EG(active_symbol_table) = active_symbol_table->symbol_table; + while (active_symbol_table && active_symbol_table->scope == active_memory) { + zend_execute_data *ex = find_symbol_table(EG(current_execute_data)); +#ifndef ZEPHIR_RELEASE + if (UNEXPECTED(!ex)) { + fprintf(stderr, "ERROR: unable to find a symbol table"); + zephir_print_backtrace(); + return; + } +#endif + zend_hash_destroy(ex->symbol_table); + efree(ex->symbol_table); + ex->symbol_table = active_symbol_table->symbol_table; + zend_attach_symbol_table(ex); + zend_rebuild_symbol_table(); + g->active_symbol_table = active_symbol_table->prev; efree(active_symbol_table); + active_symbol_table = g->active_symbol_table; } } /* Check for non freed hash key zvals, mark as null to avoid string freeing */ for (i = 0; i < active_memory->hash_pointer; ++i) { - assert(active_memory->hash_addresses[i] != NULL && *(active_memory->hash_addresses[i]) != NULL); - if (Z_REFCOUNT_PP(active_memory->hash_addresses[i]) <= 1) { - ZVAL_NULL(*active_memory->hash_addresses[i]); + assert(active_memory->hash_addresses[i] != NULL); + if (!Z_REFCOUNTED_P(active_memory->hash_addresses[i])) continue; + if (Z_REFCOUNT_P(active_memory->hash_addresses[i]) <= 1) { + ZVAL_NULL(active_memory->hash_addresses[i]); } else { - zval_copy_ctor(*active_memory->hash_addresses[i]); + zval_copy_ctor(active_memory->hash_addresses[i]); } } #ifndef ZEPHIR_RELEASE for (i = 0; i < active_memory->pointer; ++i) { - if (active_memory->addresses[i] != NULL && *(active_memory->addresses[i]) != NULL) { - zval **var = active_memory->addresses[i]; + if (active_memory->addresses[i] != NULL) { + zval *var = active_memory->addresses[i]; + if (Z_TYPE_P(var) > IS_CALLABLE) { + fprintf(stderr, "%s: observed variable #%d (%p) has invalid type %u [%s]\n", __func__, (int)i, var, Z_TYPE_P(var), active_memory->func); + show_backtrace = 1; + } - if (Z_TYPE_PP(var) > IS_CALLABLE) { - fprintf(stderr, "%s: observed variable #%d (%p) has invalid type %u [%s]\n", __func__, (int)i, *var, Z_TYPE_PP(var), active_memory->func); + if (!Z_REFCOUNTED_P(var)) { + continue; } - if (Z_REFCOUNT_PP(var) == 0) { - fprintf(stderr, "%s: observed variable #%d (%p) has 0 references, type=%d [%s]\n", __func__, (int)i, *var, Z_TYPE_PP(var), active_memory->func); + + if (Z_REFCOUNT_P(var) == 0) { + fprintf(stderr, "%s: observed variable #%d (%p) has 0 references, type=%d [%s]\n", __func__, (int)i, var, Z_TYPE_P(var), active_memory->func); + show_backtrace = 1; } - else if (Z_REFCOUNT_PP(var) >= 1000000) { - fprintf(stderr, "%s: observed variable #%d (%p) has too many references (%u), type=%d [%s]\n", __func__, (int)i, *var, Z_REFCOUNT_PP(var), Z_TYPE_PP(var), active_memory->func); + else if (Z_REFCOUNT_P(var) >= 1000000) { + fprintf(stderr, "%s: observed variable #%d (%p) has too many references (%u), type=%d [%s]\n", __func__, (int)i, var, Z_REFCOUNT_P(var), Z_TYPE_P(var), active_memory->func); + show_backtrace = 1; } -#if 0 - /* Skip this check, PDO does return variables with is_ref = 1 and refcount = 1*/ - else if (Z_REFCOUNT_PP(var) == 1 && Z_ISREF_PP(var)) { - fprintf(stderr, "%s: observed variable #%d (%p) is a reference with reference count = 1, type=%d [%s]\n", __func__, (int)i, *var, Z_TYPE_PP(var), active_memory->func); - } -#endif } } #endif /* Traverse all zvals allocated, reduce the reference counting or free them */ for (i = 0; i < active_memory->pointer; ++i) { - zval **ptr = active_memory->addresses[i]; - if (EXPECTED(ptr != NULL && *(ptr) != NULL)) { - if (Z_REFCOUNT_PP(ptr) == 1) { - if (!Z_ISREF_PP(ptr) || Z_TYPE_PP(ptr) == IS_OBJECT) { - zval_ptr_dtor(ptr); - } else { - efree(*ptr); - } + ptr = active_memory->addresses[i]; + if (EXPECTED(ptr != NULL)) { + if (!Z_REFCOUNTED_P(ptr)) continue; + if (Z_REFCOUNT_P(ptr) == 1) { + zval_ptr_dtor(ptr); } else { - Z_DELREF_PP(ptr); + Z_DELREF_P(ptr); } } } - - for (i = 0; i < active_memory->alt_pointer; ++i) { - zval *ptr = active_memory->alt_addresses[i]; - assert(ptr != NULL); - assert(Z_REFCOUNT_P(ptr) == 1); - zval_dtor(ptr); - ZVAL_NULL(ptr); - } } #ifndef ZEPHIR_RELEASE @@ -198,10 +202,6 @@ static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g TSRMLS efree(active_memory->addresses); } - if (active_memory->alt_addresses != NULL) { - efree(active_memory->alt_addresses); - } - efree(g->active_memory); g->active_memory = prev; prev->next = NULL; @@ -210,7 +210,6 @@ static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g TSRMLS assert(g->active_memory->permanent == 1); #endif active_memory->pointer = 0; - active_memory->alt_pointer = 0; active_memory->hash_pointer = 0; g->active_memory = prev; } @@ -227,81 +226,19 @@ static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g TSRMLS } } } -#endif -} - -#ifndef ZEPHIR_RELEASE - -/** - * Dumps a memory frame for debug purposes - */ -void zephir_dump_memory_frame(zephir_memory_entry *active_memory TSRMLS_DC) -{ - size_t i; - - assert(active_memory != NULL); - - fprintf(stderr, "Dump of the memory frame %p (%s)\n", active_memory, active_memory->func); - - if (active_memory->hash_pointer) { - for (i = 0; i < active_memory->hash_pointer; ++i) { - assert(active_memory->hash_addresses[i] != NULL && *(active_memory->hash_addresses[i]) != NULL); - fprintf(stderr, "Hash ptr %lu (%p => %p), type=%u, refcnt=%u\n", (ulong)i, active_memory->hash_addresses[i], *active_memory->hash_addresses[i], Z_TYPE_PP(active_memory->hash_addresses[i]), Z_REFCOUNT_PP(active_memory->hash_addresses[i])); - } - } - - for (i = 0; i < active_memory->pointer; ++i) { - if (EXPECTED(active_memory->addresses[i] != NULL && *(active_memory->addresses[i]) != NULL)) { - zval **var = active_memory->addresses[i]; - fprintf(stderr, "Obs var %lu (%p => %p), type=%u, refcnt=%u; ", (ulong)i, var, *var, Z_TYPE_PP(var), Z_REFCOUNT_PP(var)); - switch (Z_TYPE_PP(var)) { - case IS_NULL: fprintf(stderr, "value=NULL\n"); break; - case IS_LONG: fprintf(stderr, "value=%ld\n", Z_LVAL_PP(var)); break; - case IS_DOUBLE: fprintf(stderr, "value=%E\n", Z_DVAL_PP(var)); break; - case IS_BOOL: fprintf(stderr, "value=(bool)%d\n", Z_BVAL_PP(var)); break; - case IS_ARRAY: fprintf(stderr, "value=array(%p), %d elements\n", Z_ARRVAL_PP(var), zend_hash_num_elements(Z_ARRVAL_PP(var))); break; - case IS_OBJECT: fprintf(stderr, "value=object(%u), %s\n", Z_OBJ_HANDLE_PP(var), Z_OBJCE_PP(var)->name); break; - case IS_STRING: fprintf(stderr, "value=%*s (%p)\n", Z_STRLEN_PP(var), Z_STRVAL_PP(var), Z_STRVAL_PP(var)); break; - case IS_RESOURCE: fprintf(stderr, "value=(resource)%ld\n", Z_LVAL_PP(var)); break; - default: fprintf(stderr, "\n"); break; - } - } - } - - fprintf(stderr, "End of the dump of the memory frame %p\n", active_memory); -} -void zephir_dump_current_frame(TSRMLS_D) -{ - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - - if (UNEXPECTED(zephir_globals_ptr->active_memory == NULL)) { - fprintf(stderr, "WARNING: calling %s() without an active memory frame!\n", __func__); + if (show_backtrace == 1) { zephir_print_backtrace(); - return; - } - - zephir_dump_memory_frame(zephir_globals_ptr->active_memory TSRMLS_CC); -} - -void zephir_dump_all_frames(TSRMLS_D) -{ - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - zephir_memory_entry *active_memory = zephir_globals_ptr->active_memory; - - fprintf(stderr, "*** DUMP START ***\n"); - while (active_memory != NULL) { - zephir_dump_memory_frame(active_memory TSRMLS_CC); - active_memory = active_memory->prev; } +#endif - fprintf(stderr, "*** DUMP END ***\n"); } +#ifndef ZEPHIR_RELEASE /** * Finishes the current memory stack by releasing allocated memory */ -int ZEND_FASTCALL zephir_memory_restore_stack(const char *func TSRMLS_DC) +int ZEPHIR_FASTCALL zephir_memory_restore_stack(const char *func) { zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; @@ -316,21 +253,22 @@ int ZEND_FASTCALL zephir_memory_restore_stack(const char *func TSRMLS_DC) fprintf(stderr, "The frame was created by %s\n", zephir_globals_ptr->active_memory->func); fprintf(stderr, "Calling function: %s\n", func); zephir_print_backtrace(); + return FAILURE; } - zephir_memory_restore_stack_common(zephir_globals_ptr TSRMLS_CC); + zephir_memory_restore_stack_common(zephir_globals_ptr); return SUCCESS; } /** * Adds a memory frame in the current executed method */ -void ZEND_FASTCALL zephir_memory_grow_stack(const char *func TSRMLS_DC) +void ZEPHIR_FASTCALL zephir_memory_grow_stack(const char *func) { zephir_memory_entry *entry; zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; if (g->start_memory == NULL) { - zephir_initialize_memory(g TSRMLS_CC); + zephir_initialize_memory(g); } entry = zephir_memory_grow_stack_common(g); entry->func = func; @@ -341,11 +279,11 @@ void ZEND_FASTCALL zephir_memory_grow_stack(const char *func TSRMLS_DC) /** * Adds a memory frame in the current executed method */ -void ZEND_FASTCALL zephir_memory_grow_stack(TSRMLS_D) +void ZEPHIR_FASTCALL zephir_memory_grow_stack() { zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; if (g->start_memory == NULL) { - zephir_initialize_memory(g TSRMLS_CC); + zephir_initialize_memory(g); } zephir_memory_grow_stack_common(g); } @@ -353,9 +291,9 @@ void ZEND_FASTCALL zephir_memory_grow_stack(TSRMLS_D) /** * Finishes the current memory stack by releasing allocated memory */ -int ZEND_FASTCALL zephir_memory_restore_stack(TSRMLS_D) +int ZEPHIR_FASTCALL zephir_memory_restore_stack() { - zephir_memory_restore_stack_common(ZEPHIR_VGLOBAL TSRMLS_CC); + zephir_memory_restore_stack_common(ZEPHIR_VGLOBAL); return SUCCESS; } @@ -364,7 +302,7 @@ int ZEND_FASTCALL zephir_memory_restore_stack(TSRMLS_D) /** * Pre-allocates memory for further use in execution */ -void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr TSRMLS_DC) +void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr) { zephir_memory_entry *start; size_t i; @@ -372,7 +310,6 @@ void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr TSRMLS start = (zephir_memory_entry *) pecalloc(ZEPHIR_NUM_PREALLOCATED_FRAMES, sizeof(zephir_memory_entry), 1); /* pecalloc() will take care of these members for every frame start->pointer = 0; - start->alt_pointer = 0; start->hash_pointer = 0; start->prev = NULL; start->next = NULL; @@ -382,8 +319,6 @@ void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr TSRMLS start[i].capacity = 24; start[i].hash_addresses = pecalloc(8, sizeof(zval*), 1); start[i].hash_capacity = 8; - start[i].alt_addresses = pecalloc(8, sizeof(zval*), 1); - start[i].alt_capacity = 8; #ifndef ZEPHIR_RELEASE start[i].permanent = 1; @@ -404,69 +339,13 @@ void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr TSRMLS zephir_globals_ptr->fcache = pemalloc(sizeof(HashTable), 1); zend_hash_init(zephir_globals_ptr->fcache, 128, NULL, NULL, 1); // zephir_fcall_cache_dtor - /* 'Allocator sizeof operand mismatch' warning can be safely ignored */ - ALLOC_INIT_ZVAL(zephir_globals_ptr->global_null); - Z_SET_REFCOUNT_P(zephir_globals_ptr->global_null, 2); - - /* 'Allocator sizeof operand mismatch' warning can be safely ignored */ - ALLOC_INIT_ZVAL(zephir_globals_ptr->global_false); - Z_SET_REFCOUNT_P(zephir_globals_ptr->global_false, 2); - ZVAL_FALSE(zephir_globals_ptr->global_false); - - /* 'Allocator sizeof operand mismatch' warning can be safely ignored */ - ALLOC_INIT_ZVAL(zephir_globals_ptr->global_true); - Z_SET_REFCOUNT_P(zephir_globals_ptr->global_true, 2); - ZVAL_TRUE(zephir_globals_ptr->global_true); - zephir_globals_ptr->initialized = 1; } -/** - * Cleans the function/method cache up - */ -int zephir_cleanup_fcache(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) -{ - zephir_fcall_cache_entry **entry = (zephir_fcall_cache_entry**) pDest; - zend_class_entry *scope; - uint len = hash_key->nKeyLength; - - assert(hash_key->arKey != NULL); - assert(hash_key->nKeyLength > 2 * sizeof(zend_class_entry**)); - - memcpy(&scope, &hash_key->arKey[(len -1) - 2 * sizeof(zend_class_entry**)], sizeof(zend_class_entry*)); - -/* -#ifndef ZEPHIR_RELEASE - { - zend_class_entry *cls; - memcpy(&cls, &hash_key->arKey[len - sizeof(zend_class_entry**)], sizeof(zend_class_entry*)); - - fprintf(stderr, "func: %s, cls: %s, scope: %s [%u]\n", (*entry)->f->common.function_name, (cls ? cls->name : "N/A"), (scope ? scope->name : "N/A"), (uint)(*entry)->times); - } -#endif -*/ - -#ifndef ZEPHIR_RELEASE - if ((*entry)->f->type != ZEND_INTERNAL_FUNCTION || (scope && scope->type != ZEND_INTERNAL_CLASS)) { - return ZEND_HASH_APPLY_REMOVE; - } -#else - if ((*entry)->type != ZEND_INTERNAL_FUNCTION || (scope && scope->type != ZEND_INTERNAL_CLASS)) { - return ZEND_HASH_APPLY_REMOVE; - } -#endif - - if (scope && scope->type == ZEND_INTERNAL_CLASS && scope->info.internal.module->type != MODULE_PERSISTENT) { - return ZEND_HASH_APPLY_REMOVE; - } - - return ZEND_HASH_APPLY_KEEP; -} - /** * Deinitializes all the memory allocated by Zephir */ -void zephir_deinitialize_memory(TSRMLS_D) +void zephir_deinitialize_memory() { size_t i; zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; @@ -477,10 +356,26 @@ void zephir_deinitialize_memory(TSRMLS_D) } if (zephir_globals_ptr->start_memory != NULL) { - zephir_clean_restore_stack(TSRMLS_C); - } + zephir_clean_restore_stack(); + } + +// { +// size_t i; +// for (i=0; iscache[i]; +// if (e) { +// free(e); +// } +// } +// zephir_fcall_cache_entry *cache_entry_temp = NULL; +// ZEND_HASH_FOREACH_PTR(zephir_globals_ptr->fcache, cache_entry_temp) { +// free(cache_entry_temp); +// } ZEND_HASH_FOREACH_END(); +// } - zend_hash_apply_with_arguments(zephir_globals_ptr->fcache TSRMLS_CC, zephir_cleanup_fcache, 0); +#if 0 + zend_hash_apply_with_arguments(zephir_globals_ptr->fcache, zephir_cleanup_fcache, 0); +#endif #ifndef ZEPHIR_RELEASE assert(zephir_globals_ptr->start_memory != NULL); @@ -498,59 +393,134 @@ void zephir_deinitialize_memory(TSRMLS_D) pefree(zephir_globals_ptr->fcache, 1); zephir_globals_ptr->fcache = NULL; - for (i = 0; i < 2; i++) { - zval_ptr_dtor(&zephir_globals_ptr->global_null); - zval_ptr_dtor(&zephir_globals_ptr->global_false); - zval_ptr_dtor(&zephir_globals_ptr->global_true); - } - zephir_globals_ptr->initialized = 0; } -ZEPHIR_ATTR_NONNULL static void zephir_reallocate_memory(const zend_zephir_globals_def *g) +/** + * Creates a virtual symbol tables dynamically + */ +void zephir_create_symbol_table() { - zephir_memory_entry *frame = g->active_memory; - int persistent = (frame >= g->start_memory && frame < g->end_memory); - void *buf = perealloc(frame->addresses, sizeof(zval **) * (frame->capacity + 16), persistent); - if (EXPECTED(buf != NULL)) { - frame->capacity += 16; - frame->addresses = buf; - } - else { - zend_error(E_CORE_ERROR, "Memory allocation failed"); + zephir_symbol_table *entry; + zend_zephir_globals_def *gptr = ZEPHIR_VGLOBAL; + zend_array *symbol_table; + +#ifndef ZEPHIR_RELEASE + if (!gptr->active_memory) { + fprintf(stderr, "ERROR: Trying to create a virtual symbol table without a memory frame"); + zephir_print_backtrace(); + return; } +#endif + zend_execute_data* ex = find_symbol_table(EG(current_execute_data)); #ifndef ZEPHIR_RELEASE - assert(frame->permanent == persistent); + if (UNEXPECTED(!ex)) { + fprintf(stderr, "ERROR: unable to find a symbol table"); + zephir_print_backtrace(); + return; + } #endif + + zend_rebuild_symbol_table(); + zend_detach_symbol_table(ex); + + entry = (zephir_symbol_table*)emalloc(sizeof(zephir_symbol_table)); + entry->scope = gptr->active_memory; + entry->symbol_table = ex->symbol_table; + entry->prev = gptr->active_symbol_table; + + symbol_table = (zend_array*)emalloc(sizeof(zend_array)); + zend_hash_init(symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0); + zend_hash_real_init(symbol_table, 0); + + ex->symbol_table = symbol_table; + gptr->active_symbol_table = entry; } -ZEPHIR_ATTR_NONNULL static void zephir_reallocate_memory_alt(const zend_zephir_globals_def *g) +/** + * Exports symbols to the active symbol table + */ +int zephir_set_symbol(zval *key_name, zval *value) { - zephir_memory_entry *frame = g->active_memory; - int persistent = (frame >= g->start_memory && frame < g->end_memory); - void *buf = perealloc(frame->alt_addresses, sizeof(zval **) * (frame->alt_capacity + 4), persistent); - if (EXPECTED(buf != NULL)) { - frame->alt_capacity += 4; - frame->alt_addresses = buf; + zend_array *symbol_table; + + symbol_table = zend_rebuild_symbol_table(); + if (!symbol_table) { + php_error_docref(NULL, E_WARNING, "Cannot find a valid symbol_table"); + return FAILURE; } - else { - zend_error(E_CORE_ERROR, "Memory allocation failed"); + + if (Z_TYPE_P(key_name) == IS_STRING) { + Z_TRY_ADDREF_P(value); + zend_hash_update(symbol_table, Z_STR_P(key_name), value); + } + + return SUCCESS; +} + +/** + * Exports a string symbol to the active symbol table + */ +int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval *value) +{ + zend_array *symbol_table = zend_rebuild_symbol_table(); + + if (!symbol_table) { + php_error_docref(NULL, E_WARNING, "Cannot find a valid symbol_table"); + return FAILURE; } + Z_TRY_ADDREF_P(value); + zend_hash_str_update(symbol_table, key_name, key_length, value); + + return SUCCESS; +} + +/** + * Cleans the function/method cache up + */ +int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key *hash_key) +{ + zephir_fcall_cache_entry **entry = (zephir_fcall_cache_entry**) pDest; + zend_class_entry *scope; + uint len = ZSTR_LEN(hash_key->key); + + assert(hash_key->key != NULL); + assert(len > 2 * sizeof(zend_class_entry**)); + + memcpy(&scope, &ZSTR_VAL(hash_key->key)[(len -1) - 2 * sizeof(zend_class_entry**)], sizeof(zend_class_entry*)); + +/* #ifndef ZEPHIR_RELEASE - assert(frame->permanent == persistent); + { + zend_class_entry *cls; + memcpy(&cls, &hash_key->arKey[len - sizeof(zend_class_entry**)], sizeof(zend_class_entry*)); + + fprintf(stderr, "func: %s, cls: %s, scope: %s [%u]\n", (*entry)->f->common.function_name, (cls ? cls->name : "N/A"), (scope ? scope->name : "N/A"), (uint)(*entry)->times); + } #endif +*/ + + if ((*entry)->type != ZEND_INTERNAL_FUNCTION || (scope && scope->type != ZEND_INTERNAL_CLASS)) { + return ZEND_HASH_APPLY_REMOVE; + } + + if (scope && scope->type == ZEND_INTERNAL_CLASS && scope->info.internal.module->type != MODULE_PERSISTENT) { + return ZEND_HASH_APPLY_REMOVE; + } + + return ZEND_HASH_APPLY_KEEP; } -ZEPHIR_ATTR_NONNULL static void zephir_reallocate_hmemory(const zend_zephir_globals_def *g) +ZEPHIR_ATTR_NONNULL static void zephir_reallocate_memory(const zend_zephir_globals_def *g) { zephir_memory_entry *frame = g->active_memory; int persistent = (frame >= g->start_memory && frame < g->end_memory); - void *buf = perealloc(frame->hash_addresses, sizeof(zval **) * (frame->hash_capacity + 4), persistent); + void *buf = perealloc(frame->addresses, sizeof(zval *) * (frame->capacity + 16), persistent); if (EXPECTED(buf != NULL)) { - frame->hash_capacity += 4; - frame->hash_addresses = buf; + frame->capacity += 16; + frame->addresses = buf; } else { zend_error(E_CORE_ERROR, "Memory allocation failed"); @@ -561,7 +531,7 @@ ZEPHIR_ATTR_NONNULL static void zephir_reallocate_hmemory(const zend_zephir_glob #endif } -ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe(zval **var, const zend_zephir_globals_def *g) +ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe(zval *var, const zend_zephir_globals_def *g) { zephir_memory_entry *frame = g->active_memory; #ifndef ZEPHIR_RELEASE @@ -593,219 +563,103 @@ ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe(zval **var, ++frame->pointer; } -ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe_alt(zval *var, const zend_zephir_globals_def *g) -{ - zephir_memory_entry *frame = g->active_memory; -#ifndef ZEPHIR_RELEASE - if (UNEXPECTED(frame == NULL)) { - fprintf(stderr, "ZEPHIR_MM_GROW() must be called before using any of MM functions or macros!"); - zephir_print_backtrace(); - abort(); - } -#endif - - if (UNEXPECTED(frame->alt_pointer == frame->alt_capacity)) { - zephir_reallocate_memory_alt(g); - } - - frame->alt_addresses[frame->alt_pointer] = var; - ++frame->alt_pointer; -} - /** * Observes a memory pointer to release its memory at the end of the request */ -void ZEND_FASTCALL zephir_memory_observe(zval **var TSRMLS_DC) +void ZEPHIR_FASTCALL zephir_memory_observe(zval *var) { zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; zephir_do_memory_observe(var, g); - *var = NULL; /* In case an exception or error happens BEFORE the observed variable gets initialized */ -} - -/** - * Observes a memory pointer to release its memory at the end of the request - * - * zval observed with this function will be destroyed with zval_dtor() but not freed - */ -void ZEND_FASTCALL zephir_memory_observe_alt(zval *var TSRMLS_DC) -{ - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - zephir_do_memory_observe_alt(var, g); } - /** * Observes a variable and allocates memory for it */ -void ZEND_FASTCALL zephir_memory_alloc(zval **var TSRMLS_DC) +void ZEPHIR_FASTCALL zephir_memory_alloc(zval *var) { zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; zephir_do_memory_observe(var, g); - ALLOC_INIT_ZVAL(*var); -} - -/** - * Releases memory for an allocated zval - */ -void ZEND_FASTCALL zephir_ptr_dtor(zval **var) -{ - if (!Z_ISREF_PP(var) || Z_TYPE_PP(var) == IS_OBJECT) { - zval_ptr_dtor(var); - } else { - if (Z_REFCOUNT_PP(var) == 0) { - efree(*var); - } else { - Z_DELREF_PP(var); - if (Z_REFCOUNT_PP(var) == 0) { - efree(*var); - } - } - } -} - -/** - * Observes a variable and allocates memory for it - * Marks hash key zvals to be nulled before freeing - */ -void ZEND_FASTCALL zephir_memory_alloc_pnull(zval **var TSRMLS_DC) -{ - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - zephir_memory_entry *active_memory = g->active_memory; - -#ifndef ZEPHIR_RELEASE - if (UNEXPECTED(active_memory == NULL)) { - fprintf(stderr, "ZEPHIR_MM_GROW() must be called before using any of MM functions or macros!"); - zephir_print_backtrace(); - abort(); - } -#endif - - zephir_do_memory_observe(var, g); - ALLOC_INIT_ZVAL(*var); - - if (active_memory->hash_pointer == active_memory->hash_capacity) { - zephir_reallocate_hmemory(g); - } - - active_memory->hash_addresses[active_memory->hash_pointer] = var; - ++active_memory->hash_pointer; -} - -/** - * Removes a memory pointer from the active memory pool - */ -void ZEND_FASTCALL zephir_memory_remove(zval **var TSRMLS_DC) { - zval_ptr_dtor(var); - *var = NULL; + ZVAL_NULL(var); } /** * Cleans the zephir memory stack recursively */ -int ZEND_FASTCALL zephir_clean_restore_stack(TSRMLS_D) { +int ZEPHIR_FASTCALL zephir_clean_restore_stack() { zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; while (zephir_globals_ptr->active_memory != NULL) { - zephir_memory_restore_stack_common(zephir_globals_ptr TSRMLS_CC); + zephir_memory_restore_stack_common(zephir_globals_ptr); } return SUCCESS; } -/** - * Copies a variable only if its refcount is greater than 1 - */ -void ZEND_FASTCALL zephir_copy_ctor(zval *destination, zval *origin) { - if (Z_REFCOUNT_P(origin) > 1) { - zval_copy_ctor(destination); - } else { - ZVAL_NULL(origin); - } -} - -/** - * Creates virtual symbol tables dynamically - */ -void zephir_create_symbol_table(TSRMLS_D) { - - zephir_symbol_table *entry; - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - HashTable *symbol_table; - +/* Debugging */ #ifndef ZEPHIR_RELEASE - if (!zephir_globals_ptr->active_memory) { - fprintf(stderr, "ERROR: Trying to create a virtual symbol table without a memory frame"); - zephir_print_backtrace(); - return; - } -#endif - - entry = (zephir_symbol_table *) emalloc(sizeof(zephir_symbol_table)); - entry->scope = zephir_globals_ptr->active_memory; - entry->symbol_table = EG(active_symbol_table); - entry->prev = zephir_globals_ptr->active_symbol_table; - zephir_globals_ptr->active_symbol_table = entry; - - ALLOC_HASHTABLE(symbol_table); - zend_hash_init(symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0); - EG(active_symbol_table) = symbol_table; -} /** - * Restores all the virtual symbol tables + * Dumps a memory frame for debug purposes */ -void zephir_clean_symbol_tables(TSRMLS_D) { - - /*unsigned int i; +void zephir_dump_memory_frame(zephir_memory_entry *active_memory) +{ + size_t i; - if (ZEPHIR_GLOBAL(symbol_tables)) { - for (i = ZEPHIR_GLOBAL(number_symbol_tables); i > 0; i--) { - EG(active_symbol_table) = ZEPHIR_GLOBAL(symbol_tables)[i - 1]; - } - efree(ZEPHIR_GLOBAL(symbol_tables)); - ZEPHIR_GLOBAL(symbol_tables) = NULL; - }*/ -} + assert(active_memory != NULL); -/** - * Exports symbols to the active symbol table - */ -int zephir_set_symbol(zval *key_name, zval *value TSRMLS_DC) { + fprintf(stderr, "Dump of the memory frame %p (%s)\n", active_memory, active_memory->func); - if (!EG(active_symbol_table)) { - zend_rebuild_symbol_table(TSRMLS_C); + if (active_memory->hash_pointer) { + for (i = 0; i < active_memory->hash_pointer; ++i) { + assert(active_memory->hash_addresses[i] != NULL); + fprintf(stderr, "Hash ptr %lu (%p), type=%u, refcnted=%d, refcnt=%u\n", (ulong)i, active_memory->hash_addresses[i], Z_TYPE_P(active_memory->hash_addresses[i]), + Z_REFCOUNTED_P(active_memory->hash_addresses[i]), + Z_REFCOUNTED_P(active_memory->hash_addresses[i]) ? Z_REFCOUNT_P(active_memory->hash_addresses[i]) : 0 + ); + } } - if (EG(active_symbol_table)) { - if (Z_TYPE_P(key_name) == IS_STRING) { - Z_ADDREF_P(value); - zend_hash_update(EG(active_symbol_table), Z_STRVAL_P(key_name), Z_STRLEN_P(key_name) + 1, &value, sizeof(zval *), NULL); - if (EG(exception)) { - return FAILURE; + for (i = 0; i < active_memory->pointer; ++i) { + if (EXPECTED(active_memory->addresses[i] != NULL)) { + zval *var = active_memory->addresses[i]; + fprintf(stderr, "Obs var %lu (%p), type=%u, refcnted=%d, refcnt=%u; ", (ulong)i, var, Z_TYPE_P(var), Z_REFCOUNTED_P(var), Z_REFCOUNTED_P(var) ? Z_REFCOUNT_P(var) : 0); + switch (Z_TYPE_P(var)) { + case IS_NULL: fprintf(stderr, "value=NULL\n"); break; +#ifdef ZEPHIR_ENABLE_64BITS + case IS_LONG: fprintf(stderr, "value=%lld\n", (long long int)Z_LVAL_P(var)); break; +#else + case IS_LONG: fprintf(stderr, "value=%ld\n", Z_LVAL_P(var)); break; +#endif + case IS_DOUBLE: fprintf(stderr, "value=%E\n", Z_DVAL_P(var)); break; + case IS_TRUE: fprintf(stderr, "value=(bool)true\n"); break; + case IS_FALSE: fprintf(stderr, "value=(bool)false\n"); break; + case IS_ARRAY: fprintf(stderr, "value=array(%p), %d elements\n", Z_ARRVAL_P(var), zend_hash_num_elements(Z_ARRVAL_P(var))); break; + case IS_OBJECT: fprintf(stderr, "value=object(%u), %s\n", Z_OBJ_HANDLE_P(var), ZSTR_VAL(Z_OBJCE_P(var)->name)); break; + case IS_STRING: fprintf(stderr, "value=%s (%zu)\n", Z_STRVAL_P(var), Z_STRLEN_P(var)); break; +#ifdef ZEPHIR_ENABLE_64BITS + case IS_RESOURCE: fprintf(stderr, "value=(resource)%lld\n", (long long int)Z_LVAL_P(var)); break; +#else + case IS_RESOURCE: fprintf(stderr, "value=(resource)%ld\n", Z_LVAL_P(var)); break; +#endif + default: fprintf(stderr, "\n"); break; } } } - return SUCCESS; + fprintf(stderr, "End of the dump of the memory frame %p\n", active_memory); } -/** - * Exports a string symbol to the active symbol table - */ -int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval *value TSRMLS_DC) { - - if (!EG(active_symbol_table)) { - zend_rebuild_symbol_table(TSRMLS_C); - } +void zephir_dump_current_frame() +{ + zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - if (&EG(symbol_table)) { - Z_ADDREF_P(value); - zend_hash_update(&EG(symbol_table), key_name, key_length, &value, sizeof(zval *), NULL); - if (EG(exception)) { - return FAILURE; - } + if (UNEXPECTED(zephir_globals_ptr->active_memory == NULL)) { + fprintf(stderr, "WARNING: calling %s() without an active memory frame!\n", __func__); + zephir_print_backtrace(); + return; } - return SUCCESS; + zephir_dump_memory_frame(zephir_globals_ptr->active_memory); } +#endif diff --git a/ext/kernel/memory.h b/ext/kernel/memory.h index 0b9f433f096..d50802ee629 100644 --- a/ext/kernel/memory.h +++ b/ext/kernel/memory.h @@ -26,257 +26,148 @@ #include "php_ext.h" #include "kernel/globals.h" +#if defined(__x86_64__) || defined(__LP64__) || defined(_LP64) || defined(_WIN64) + #define ZEPHIR_ENABLE_64BITS 1 +#endif + #define ZEPHIR_NUM_PREALLOCATED_FRAMES 25 -/* Variable Tracking */ -/** - * @todo Is it safe? - */ -void ZEND_FASTCALL zephir_ptr_dtor(zval **var); +void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr); +int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key *hash_key); +void zephir_deinitialize_memory(); /* Memory Frames */ #ifndef ZEPHIR_RELEASE -void ZEPHIR_FASTCALL zephir_memory_grow_stack(const char *func TSRMLS_DC); -int ZEPHIR_FASTCALL zephir_memory_restore_stack(const char *func TSRMLS_DC); +void ZEPHIR_FASTCALL zephir_memory_grow_stack(const char *func); +int ZEPHIR_FASTCALL zephir_memory_restore_stack(const char *func); -#define ZEPHIR_MM_GROW() zephir_memory_grow_stack(NULL TSRMLS_CC) -#define ZEPHIR_MM_RESTORE() zephir_memory_restore_stack(NULL TSRMLS_CC) +#define ZEPHIR_MM_GROW() zephir_memory_grow_stack(NULL) +#define ZEPHIR_MM_RESTORE() zephir_memory_restore_stack(NULL) #else -void ZEPHIR_FASTCALL zephir_memory_grow_stack(TSRMLS_D); -int ZEPHIR_FASTCALL zephir_memory_restore_stack(TSRMLS_D); +void ZEPHIR_FASTCALL zephir_memory_grow_stack(); +int ZEPHIR_FASTCALL zephir_memory_restore_stack(); -#define ZEPHIR_MM_GROW() zephir_memory_grow_stack(TSRMLS_C) -#define ZEPHIR_MM_RESTORE() zephir_memory_restore_stack(TSRMLS_C) +#define ZEPHIR_MM_GROW() zephir_memory_grow_stack() +#define ZEPHIR_MM_RESTORE() zephir_memory_restore_stack() #endif -void ZEPHIR_FASTCALL zephir_memory_observe(zval **var TSRMLS_DC); -void ZEPHIR_FASTCALL zephir_memory_observe_alt(zval *var TSRMLS_DC); -void ZEPHIR_FASTCALL zephir_memory_remove(zval **var TSRMLS_DC); -void ZEPHIR_FASTCALL zephir_memory_alloc(zval **var TSRMLS_DC); -void ZEPHIR_FASTCALL zephir_memory_alloc_pnull(zval **var TSRMLS_DC); +#define zephir_dtor(x) zval_dtor(x) +#define zephir_ptr_dtor(x) zval_ptr_dtor(x) -int ZEPHIR_FASTCALL zephir_clean_restore_stack(TSRMLS_D); +void ZEPHIR_FASTCALL zephir_memory_observe(zval *var); +void ZEPHIR_FASTCALL zephir_memory_alloc(zval *var); -/* Virtual symbol tables */ -void zephir_create_symbol_table(TSRMLS_D); -/*void zephir_restore_symbol_table(TSRMLS_D);*/ -void zephir_clean_symbol_tables(TSRMLS_D); +int ZEPHIR_FASTCALL zephir_clean_restore_stack(); -/** Export symbols to active symbol table */ -int zephir_set_symbol(zval *key_name, zval *value TSRMLS_DC); -int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval *value TSRMLS_DC); +#define zephir_safe_zval_ptr_dtor(pzval) -void ZEPHIR_FASTCALL zephir_copy_ctor(zval *destiny, zval *origin); +void zephir_create_symbol_table(); +int zephir_set_symbol(zval *key_name, zval *value); +int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval *value); -void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr TSRMLS_DC); -int zephir_cleanup_fcache(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key); -void zephir_deinitialize_memory(TSRMLS_D); +#define ZEPHIR_INIT_VAR(z) zephir_memory_alloc(z); -/* Memory macros */ -#define ZEPHIR_SINIT_VAR(z) \ - do { \ - INIT_PZVAL(&z); \ - ZVAL_NULL(&z); \ - } while (0) +#define ZEPHIR_SINIT_VAR(z) ZVAL_NULL(&z); -#define ZEPHIR_SINIT_NVAR(z) Z_SET_REFCOUNT_P(&z, 1) +#define ZEPHIR_SINIT_NVAR(z) /*Z_SET_REFCOUNT_P(&z, 1)*/ #define ZEPHIR_INIT_ZVAL_NREF(z) \ - do { \ - ALLOC_ZVAL(z); \ - Z_SET_REFCOUNT_P(z, 0); \ - Z_UNSET_ISREF_P(z); \ - } while (0) - -#define ZEPHIR_INIT_VAR(z) \ - zephir_memory_alloc(&z TSRMLS_CC) + ZVAL_UNDEF(&z); \ -#define ZEPHIR_INIT_NVAR(z)\ - if (z) { \ - if (!Z_ISREF_P(z)) { \ +#define ZEPHIR_INIT_NVAR(z) \ + do { \ + if (Z_TYPE_P(z) == IS_UNDEF) { \ + zephir_memory_observe(z); \ + } else if (Z_REFCOUNTED_P(z) && !Z_ISREF_P(z)) { \ if (Z_REFCOUNT_P(z) > 1) { \ Z_DELREF_P(z); \ - ALLOC_ZVAL(z); \ - Z_SET_REFCOUNT_P(z, 1); \ - Z_UNSET_ISREF_P(z); \ } else { \ - zval_dtor(z); \ - Z_SET_REFCOUNT_P(z, 1); \ - Z_UNSET_ISREF_P(z); \ - } \ - ZVAL_NULL(z); \ - } \ - } else { \ - zephir_memory_alloc(&z TSRMLS_CC); \ - } - -/** - * Second allocation, assumes the variable was allocated for the first time in the branch zero - */ -#define ZEPHIR_INIT_BNVAR(z) \ - if (Z_REFCOUNT_P(z) > 1) { \ - zephir_ptr_dtor(&z); \ - ALLOC_ZVAL(z); \ - Z_SET_REFCOUNT_P(z, 1); \ - Z_UNSET_ISREF_P(z); \ - ZVAL_NULL(z); \ - } else {\ - zephir_ptr_dtor(&z); \ - ZEPHIR_ALLOC_ZVAL(z); \ - } - -#define ZEPHIR_INIT_NVAR_PNULL(z)\ - if (z) { \ - if (Z_REFCOUNT_P(z) > 1) { \ - Z_DELREF_P(z); \ - if (Z_REFCOUNT_P(z) >= 1) { \ - zval_copy_ctor(z); \ + zephir_dtor(z); \ } \ - ALLOC_ZVAL(z); \ - Z_SET_REFCOUNT_P(z, 1); \ - Z_UNSET_ISREF_P(z); \ } \ ZVAL_NULL(z); \ - } else { \ - zephir_memory_alloc_pnull(&z TSRMLS_CC); \ - } + } while (0) /* only removes the value body of the zval */ -#define ZEPHIR_INIT_LNVAR(z)\ - if (z) { \ - if (Z_REFCOUNT_P(z) > 1) { \ - Z_DELREF_P(z); \ - ALLOC_ZVAL(z); \ - Z_SET_REFCOUNT_P(z, 1); \ - Z_UNSET_ISREF_P(z); \ - } else { \ - if (!Z_ISREF_P(z)) { \ - zval_dtor(z); \ - } \ - Z_SET_REFCOUNT_P(z, 1); \ - Z_UNSET_ISREF_P(z); \ - } \ - ZVAL_NULL(z); \ - } else { \ - zephir_memory_alloc(&z TSRMLS_CC); \ - } +#define ZEPHIR_INIT_LNVAR(z) ZEPHIR_INIT_NVAR(&z) #define ZEPHIR_CPY_WRT(d, v) \ - Z_ADDREF_P(v); \ - if (d) { \ - if (Z_REFCOUNT_P(d) > 0) { \ - zephir_ptr_dtor(&d); \ + Z_TRY_ADDREF_P(v); \ + if (Z_TYPE_P(d) > IS_UNDEF) { \ + if (Z_REFCOUNTED_P(d) && Z_REFCOUNT_P(d) > 0) { \ + zephir_ptr_dtor(d); \ } \ } else { \ - zephir_memory_observe(&d TSRMLS_CC); \ + zephir_memory_observe(d); \ } \ - d = v; + ZVAL_COPY_VALUE(d, v); #define ZEPHIR_CPY_WRT_CTOR(d, v) \ if (d) { \ - if (Z_REFCOUNT_P(d) > 0) { \ - zephir_ptr_dtor(&d); \ - } \ - } else { \ - zephir_memory_observe(&d TSRMLS_CC); \ - } \ - ALLOC_ZVAL(d); \ - *d = *v; \ - zval_copy_ctor(d); \ - Z_SET_REFCOUNT_P(d, 1); \ - Z_UNSET_ISREF_P(d); - -#define ZEPHIR_MAKE_REFERENCE(d, v) \ - if (d) { \ - if (Z_REFCOUNT_P(d) > 0) { \ - zephir_ptr_dtor(&d); \ + if (Z_REFCOUNTED_P(d) && Z_REFCOUNT_P(d) > 0) { \ + zephir_ptr_dtor(d); \ } \ } else { \ - zephir_memory_observe(&d TSRMLS_CC); \ + /*TODO: as above */ \ } \ - ALLOC_ZVAL(d); \ - Z_TYPE_P(d) = Z_TYPE_P(v); \ - d->value = v->value; \ - Z_SET_REFCOUNT_P(d, 1); \ - Z_SET_ISREF_P(d); + ZVAL_DUP(d, v); -/* */ #define ZEPHIR_OBS_VAR(z) \ - zephir_memory_observe(&z TSRMLS_CC) + zephir_memory_observe(z) -#define ZEPHIR_OBS_NVAR(z)\ - if (z) { \ - if (Z_REFCOUNT_P(z) > 1) { \ +#define ZEPHIR_OBS_VAR_ONCE(z) \ + if (Z_TYPE_P(z) == IS_UNDEF) { \ + zephir_memory_observe(z); \ + } + +#define ZEPHIR_OBS_COPY_OR_DUP(z, v) \ + ZEPHIR_OBS_VAR_ONCE(z); \ + ZVAL_COPY(z, v); + +#define ZEPHIR_OBS_NVAR(z) \ + if (Z_TYPE_P(z) != IS_UNDEF) { \ + if (Z_REFCOUNTED_P(z) && Z_REFCOUNT_P(z) > 1) { \ Z_DELREF_P(z); \ } else {\ - zephir_ptr_dtor(&z); \ - z = NULL; \ + zephir_ptr_dtor(z); \ + ZVAL_NULL(z); \ } \ } else { \ - zephir_memory_observe(&z TSRMLS_CC); \ + zephir_memory_observe(z); \ } +/* TODO: this might causes troubles, since we cannot observe here, since we aren't using double pointers + * figure out away to fix this (if it's an issue, which it isn't if observing isn't necessary) + */ #define ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(ppzv) \ do { \ - zval ** restrict tmp_ = (ppzv); \ + zval *tmp_ = (ppzv); \ if (tmp_ != NULL) { \ - if (*tmp_) { \ + if (Z_TYPE_P(tmp_) != IS_UNDEF) { \ zephir_ptr_dtor(tmp_); \ - *tmp_ = NULL; \ - } \ - else { \ - zephir_memory_observe((ppzv) TSRMLS_CC); \ + } else { \ + zephir_memory_observe(tmp_); \ } \ + ZVAL_NULL(tmp_); \ } \ } while (0) -#define ZEPHIR_OBSERVE_OR_NULLIFY_VAR(z) \ - do { \ - if (z) { \ - zephir_ptr_dtor(&z); \ - z = NULL; \ - } \ - else { \ - zephir_memory_observe(&z TSRMLS_CC); \ - } \ - } while (0) - -#define ZEPHIR_SEPARATE_ARRAY(a) \ - { \ - if (Z_REFCOUNT_P(a) > 1) { \ - zval *new_zv; \ - Z_DELREF_P(a); \ - ALLOC_ZVAL(new_zv); \ - INIT_PZVAL_COPY(new_zv, a); \ - a = new_zv; \ - zval_copy_ctor(new_zv); \ - } \ - } - -#define ZEPHIR_SEPARATE(z) SEPARATE_ZVAL(&z) +#define ZEPHIR_SEPARATE(z) SEPARATE_ZVAL(z) #define ZEPHIR_SEPARATE_PARAM(z) \ do { \ zval *orig_ptr = z;\ - zephir_memory_observe(&z TSRMLS_CC);\ - ALLOC_ZVAL(z);\ - *z = *orig_ptr;\ - zval_copy_ctor(z);\ - Z_SET_REFCOUNT_P(z, 1);\ - Z_UNSET_ISREF_P(z);\ + ZEPHIR_SEPARATE(orig_ptr); \ + /*zephir_memory_observe(orig_ptr);*/ \ } while (0) -#define ZEPHIR_SEPARATE_PARAM_NMO(z) { \ - zval *orig_ptr = z; \ - if (Z_REFCOUNT_P(orig_ptr) > 1) { \ - ALLOC_ZVAL(z); \ - *z = *orig_ptr; \ - zval_copy_ctor(z); \ - Z_SET_REFCOUNT_P(z, 1); \ - Z_UNSET_ISREF_P(z); \ - } \ - } +#endif +/* Backwards compatibility for GC API change in PHP 7.3 */ +#if PHP_VERSION_ID < 70300 +# define GC_ADDREF(p) ++GC_REFCOUNT(p) +# define GC_DELREF(p) --GC_REFCOUNT(p) +# define GC_SET_REFCOUNT(p, rc) GC_REFCOUNT(p) = rc #endif diff --git a/ext/kernel/object.c b/ext/kernel/object.c index f4300cf4064..7da30c6ff4d 100644 --- a/ext/kernel/object.c +++ b/ext/kernel/object.c @@ -26,6 +26,7 @@ #include "php_ext.h" #include +#include #include "kernel/main.h" #include "kernel/memory.h" @@ -35,80 +36,51 @@ #include "kernel/array.h" #include "kernel/operators.h" - -/** - * Reads class constant from string name and returns its value - */ -int zephir_get_class_constant(zval *return_value, zend_class_entry *ce, char *constant_name, unsigned int constant_length TSRMLS_DC) { - - zval **result_ptr; - - if (zend_hash_find(&ce->constants_table, constant_name, constant_length, (void **) &result_ptr) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Undefined class constant '%s::%s'", ce->name, constant_name); - return FAILURE; - } - - ZVAL_ZVAL(return_value, *result_ptr, 1, 0); - return SUCCESS; -} - -/** - * Check if class is instance of - */ -int zephir_instance_of(zval *result, const zval *object, const zend_class_entry *ce TSRMLS_DC) { - - if (Z_TYPE_P(object) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "instanceof expects an object instance"); - ZVAL_FALSE(result); - return FAILURE; - } - - ZVAL_BOOL(result, instanceof_function(Z_OBJCE_P(object), ce TSRMLS_CC)); - return SUCCESS; -} - -int zephir_instance_of_ev(const zval *object, const zend_class_entry *ce TSRMLS_DC) { - - if (Z_TYPE_P(object) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "instanceof expects an object instance"); +int zephir_instance_of_ev(zval *object, const zend_class_entry *ce) +{ + zval *z = Z_ISREF_P(object) ? Z_REFVAL_P(object) : object; + if (Z_TYPE_P(z) != IS_OBJECT) { + php_error_docref(NULL, E_WARNING, "instanceof expects an object instance"); return 0; } - return instanceof_function(Z_OBJCE_P(object), ce TSRMLS_CC); + return instanceof_function(Z_OBJCE_P(z), ce); } /** * Check if an object is instance of a class */ -int zephir_is_instance_of(zval *object, const char *class_name, unsigned int class_length TSRMLS_DC) { - +int zephir_is_instance_of(zval *object, const char *class_name, unsigned int class_length) +{ zend_class_entry *ce, *temp_ce; + zval *z = Z_ISREF_P(object) ? Z_REFVAL_P(object) : object; - if (Z_TYPE_P(object) == IS_OBJECT) { + if (Z_TYPE_P(z) == IS_OBJECT) { - ce = Z_OBJCE_P(object); - if (ce->name_length == class_length) { - if (!zend_binary_strcasecmp(ce->name, ce->name_length, class_name, class_length)) { - return 1; - } + ce = Z_OBJCE_P(z); + if (ZSTR_LEN(ce->name) == class_length) { + if (!zend_binary_strcasecmp(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), class_name, class_length)) { + return 1; + } } - temp_ce = zend_fetch_class(class_name, class_length, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC); + temp_ce = zephir_fetch_class_str_ex(class_name, class_length, ZEND_FETCH_CLASS_DEFAULT); if (temp_ce) { - return instanceof_function(ce, temp_ce TSRMLS_CC); + return instanceof_function(ce, temp_ce); } } return 0; } -int zephir_zval_is_traversable(zval *object TSRMLS_DC) { - +int zephir_zval_is_traversable(zval *object) +{ zend_class_entry *ce; zend_uint i; + zval *z = Z_ISREF_P(object) ? Z_REFVAL_P(object) : object; - if (Z_TYPE_P(object) == IS_OBJECT) { - ce = Z_OBJCE_P(object); + if (Z_TYPE_P(z) == IS_OBJECT) { + ce = Z_OBJCE_P(z); if (ce->get_iterator || (ce->parent && ce->parent->get_iterator)) { return 1; @@ -128,20 +100,70 @@ int zephir_zval_is_traversable(zval *object TSRMLS_DC) { } /** - * Returns a class name into a zval result + * Returns the called in class in the current scope + */ +void zephir_get_called_class(zval *return_value) +{ +#if PHP_VERSION_ID >= 70100 + zend_class_entry *called_scope = zend_get_called_scope(EG(current_execute_data)); + if (called_scope) { + ZVAL_STR(return_value, zend_string_dup(called_scope->name, 0)); + } + + if (!zend_get_executed_scope()) { + php_error_docref(NULL, E_WARNING, "zephir_get_called_class() called from outside a class"); + } +#else + if (EG(current_execute_data)->called_scope) { + zend_string *ret = EG(current_execute_data)->called_scope->name; + zend_string_addref(ret); + RETURN_STR(ret); + } + + if (!EG(scope)) { + php_error_docref(NULL, E_WARNING, "zephir_get_called_class() called from outside a class"); + } +#endif +} + +zend_class_entry *zephir_fetch_class_str_ex(const char *class_name, size_t length, int fetch_type) +{ + zend_class_entry *retval; + zend_string *str = zend_string_init(class_name, length, 0); + retval = zend_fetch_class(str, fetch_type); + zend_string_release(str); + return retval; +} + +/** + * Fetches a zend class entry from a zval value */ -void zephir_get_class(zval *result, zval *object, int lower TSRMLS_DC) { +zend_class_entry *zephir_fetch_class(zval *class_name) +{ + zval *z = Z_ISREF_P(class_name) ? Z_REFVAL_P(class_name) : class_name; + if (Z_TYPE_P(z) == IS_STRING) { + return zend_fetch_class(Z_STR_P(z), ZEND_FETCH_CLASS_DEFAULT); + } + + php_error_docref(NULL, E_WARNING, "class name must be a string"); + return zend_standard_class_def; +} +/** + * Returns a class name into a zval result + */ +void zephir_get_class(zval *result, zval *object, int lower) +{ zend_class_entry *ce; + zend_string *class_name; + zval *z = Z_ISREF_P(object) ? Z_REFVAL_P(object) : object; - if (Z_TYPE_P(object) == IS_OBJECT) { + if (Z_TYPE_P(z) == IS_OBJECT) { - ce = Z_OBJCE_P(object); - Z_STRLEN_P(result) = ce->name_length; - Z_STRVAL_P(result) = (char *) emalloc(ce->name_length + 1); - memcpy(Z_STRVAL_P(result), ce->name, ce->name_length); - Z_STRVAL_P(result)[Z_STRLEN_P(result)] = 0; - Z_TYPE_P(result) = IS_STRING; + ce = Z_OBJCE_P(z); + //zval_ptr_dtor(result); + class_name = zend_string_init(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), 0); + ZVAL_STR(result, class_name); if (lower) { zend_str_tolower(Z_STRVAL_P(result), Z_STRLEN_P(result)); @@ -149,35 +171,34 @@ void zephir_get_class(zval *result, zval *object, int lower TSRMLS_DC) { } else { ZVAL_NULL(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "zephir_get_class expects an object"); + php_error_docref(NULL, E_WARNING, "zephir_get_class expects an object"); } } /** * Returns a class name into a zval result */ -void zephir_get_class_ns(zval *result, zval *object, int lower TSRMLS_DC) { - +void zephir_get_class_ns(zval *result, zval *object, int lower) +{ int found = 0; - zend_class_entry *ce; unsigned int i, class_length; - const char *cursor, *class_name; + char *cursor, *class_name; + zval *z = Z_ISREF_P(object) ? Z_REFVAL_P(object) : object; - if (Z_TYPE_P(object) != IS_OBJECT) { - if (Z_TYPE_P(object) != IS_STRING) { + if (Z_TYPE_P(z) != IS_OBJECT) { + if (Z_TYPE_P(z) != IS_STRING) { ZVAL_NULL(result); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "zephir_get_class_ns expects an object"); + php_error_docref(NULL, E_WARNING, "zephir_get_class_ns expects an object"); return; } - } - if (Z_TYPE_P(object) == IS_OBJECT) { - ce = Z_OBJCE_P(object); - class_name = ce->name; - class_length = ce->name_length; - } else { - class_name = Z_STRVAL_P(object); - class_length = Z_STRLEN_P(object); + class_name = Z_STRVAL_P(z); + class_length = Z_STRLEN_P(z); + } + else { + zend_class_entry *ce = Z_OBJCE_P(z); + class_name = ZSTR_VAL(ce->name); + class_length = ZSTR_LEN(ce->name); } if (!class_length) { @@ -198,13 +219,14 @@ void zephir_get_class_ns(zval *result, zval *object, int lower TSRMLS_DC) { } if (found) { - Z_STRLEN_P(result) = class_length - i; - Z_STRVAL_P(result) = (char *) emalloc(class_length - i + 1); - memcpy(Z_STRVAL_P(result), class_name + i, class_length - i); - Z_STRVAL_P(result)[Z_STRLEN_P(result)] = 0; - Z_TYPE_P(result) = IS_STRING; + int cursor_length = class_length - i; + cursor = (char *) emalloc(cursor_length + 1); + memcpy(cursor, class_name + i, cursor_length); + cursor[cursor_length] = 0; + ZVAL_STRING(result, cursor); + efree(cursor); } else { - ZVAL_STRINGL(result, class_name, class_length, 1); + ZVAL_STRINGL(result, class_name, class_length); } if (lower) { @@ -216,32 +238,31 @@ void zephir_get_class_ns(zval *result, zval *object, int lower TSRMLS_DC) { /** * Returns a namespace from a class name */ -void zephir_get_ns_class(zval *result, zval *object, int lower TSRMLS_DC) { - - zend_class_entry *ce; +void zephir_get_ns_class(zval *result, zval *object, int lower) +{ int found = 0; unsigned int i, j, class_length; - const char *cursor, *class_name; + char *cursor, *class_name; + zval *z = Z_ISREF_P(object) ? Z_REFVAL_P(object) : object; - if (Z_TYPE_P(object) != IS_OBJECT) { - if (Z_TYPE_P(object) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "zephir_get_ns_class expects an object"); - ZVAL_NULL(result); + ZVAL_NULL(result); + + if (Z_TYPE_P(z) != IS_OBJECT) { + if (Z_TYPE_P(z) != IS_STRING) { + php_error_docref(NULL, E_WARNING, "zephir_get_ns_class expects an object"); return; } - } - if (Z_TYPE_P(object) == IS_OBJECT) { - ce = Z_OBJCE_P(object); - class_name = ce->name; - class_length = ce->name_length; - } else { - class_name = Z_STRVAL_P(object); - class_length = Z_STRLEN_P(object); + class_name = Z_STRVAL_P(z); + class_length = Z_STRLEN_P(z); + } + else { + zend_class_entry *ce = Z_OBJCE_P(z); + class_name = ZSTR_VAL(ce->name); + class_length = ZSTR_LEN(ce->name); } if (!class_length) { - ZVAL_NULL(result); return; } @@ -262,11 +283,12 @@ void zephir_get_ns_class(zval *result, zval *object, int lower TSRMLS_DC) { if (j > 0) { if (found) { - Z_STRLEN_P(result) = class_length - j - 1; - Z_STRVAL_P(result) = (char *) emalloc(class_length - j); - memcpy(Z_STRVAL_P(result), class_name, class_length - j - 1); - Z_STRVAL_P(result)[Z_STRLEN_P(result)] = 0; - Z_TYPE_P(result) = IS_STRING; + int cursor_length = class_length - j - 1; + cursor = (char *) emalloc(cursor_length + 1); + memcpy(cursor, class_name, cursor_length); + cursor[cursor_length] = 0; + ZVAL_STRING(result, cursor); + efree(cursor); } else { ZVAL_EMPTY_STRING(result); } @@ -274,117 +296,74 @@ void zephir_get_ns_class(zval *result, zval *object, int lower TSRMLS_DC) { if (lower) { zend_str_tolower(Z_STRVAL_P(result), Z_STRLEN_P(result)); } - } else { - ZVAL_NULL(result); - } - -} - -/** - * Returns the called in class in the current scope - */ -void zephir_get_called_class(zval *return_value TSRMLS_DC) { - - if (EG(called_scope)) { - RETURN_STRINGL(EG(called_scope)->name, EG(called_scope)->name_length, 1); - } - - if (!EG(scope)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "zephir_get_called_class() called from outside a class"); - } -} - -/** - * Fetches a zend class entry from a zval value - */ -zend_class_entry *zephir_fetch_class(const zval *class_name TSRMLS_DC) { - - if (Z_TYPE_P(class_name) == IS_STRING) { - return zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC); } - - php_error_docref(NULL TSRMLS_CC, E_WARNING, "class name must be a string"); - return zend_fetch_class("stdclass", strlen("stdclass"), ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC); -} - -zend_class_entry* zephir_fetch_self_class(TSRMLS_D) { - return zend_fetch_class(NULL, 0, ZEND_FETCH_CLASS_SELF TSRMLS_CC); -} - -zend_class_entry* zephir_fetch_parent_class(TSRMLS_D) { - return zend_fetch_class(NULL, 0, ZEND_FETCH_CLASS_PARENT TSRMLS_CC); -} - -zend_class_entry* zephir_fetch_static_class(TSRMLS_D) { - return zend_fetch_class(NULL, 0, ZEND_FETCH_CLASS_STATIC TSRMLS_CC); } /** * Checks if a class exist */ -int zephir_class_exists(const zval *class_name, int autoload TSRMLS_DC) { - - zend_class_entry **ce; +int zephir_class_exists(zval *class_name, int autoload) +{ + zend_class_entry *ce; + zval *z = Z_ISREF_P(class_name) ? Z_REFVAL_P(class_name) : class_name; - if (Z_TYPE_P(class_name) == IS_STRING) { - if (zend_lookup_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), &ce TSRMLS_CC) == SUCCESS) { - return ((*ce)->ce_flags & (ZEND_ACC_INTERFACE | (ZEND_ACC_TRAIT - ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) == 0; + if (Z_TYPE_P(z) == IS_STRING) { + if ((ce = zend_lookup_class_ex(Z_STR_P(z), NULL, autoload)) != NULL) { + return (ce->ce_flags & (ZEND_ACC_INTERFACE | (ZEND_ACC_INTERFACE | ZEND_ACC_TRAIT))) == 0; } return 0; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "class name must be a string"); + php_error_docref(NULL, E_WARNING, "class name must be a string"); return 0; } /** * Checks if a interface exist */ -int zephir_interface_exists(const zval *class_name, int autoload TSRMLS_DC) { - - zend_class_entry **ce; +int zephir_interface_exists(zval *class_name, int autoload) +{ + zend_class_entry *ce; + zval *z = Z_ISREF_P(class_name) ? Z_REFVAL_P(class_name) : class_name; - if (Z_TYPE_P(class_name) == IS_STRING) { - if (zend_lookup_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), &ce TSRMLS_CC) == SUCCESS) { - return (((*ce)->ce_flags & ZEND_ACC_INTERFACE) > 0); + if (Z_TYPE_P(z) == IS_STRING) { + if ((ce = zend_lookup_class(Z_STR_P(z))) != NULL) { + return ((ce->ce_flags & ZEND_ACC_INTERFACE) > 0); } return 0; } - php_error_docref(NULL TSRMLS_CC, E_WARNING, "interface name must be a string"); + php_error_docref(NULL, E_WARNING, "interface name must be a string"); return 0; } /** * Clones an object from obj to destination */ -int zephir_clone(zval *destination, zval *obj TSRMLS_DC) { - +int zephir_clone(zval *destination, zval *obj) +{ int status = SUCCESS; zend_class_entry *ce; zend_object_clone_obj_t clone_call; if (Z_TYPE_P(obj) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "__clone method called on non-object"); + php_error_docref(NULL, E_ERROR, "__clone method called on non-object"); status = FAILURE; } else { ce = Z_OBJCE_P(obj); clone_call = Z_OBJ_HT_P(obj)->clone_obj; if (!clone_call) { if (ce) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Trying to clone an uncloneable object of class %s", ce->name); + php_error_docref(NULL, E_ERROR, "Trying to clone an uncloneable object of class %s", ZSTR_VAL(ce->name)); } else { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Trying to clone an uncloneable object"); + php_error_docref(NULL, E_ERROR, "Trying to clone an uncloneable object"); } status = FAILURE; } else { if (!EG(exception)) { - Z_OBJVAL_P(destination) = clone_call(obj TSRMLS_CC); - Z_TYPE_P(destination) = IS_OBJECT; - Z_SET_REFCOUNT_P(destination, 1); - Z_UNSET_ISREF_P(destination); + ZVAL_OBJ(destination, clone_call(obj)); if (EG(exception)) { - zval_ptr_dtor(&destination); + zval_ptr_dtor(destination); } } } @@ -396,43 +375,30 @@ int zephir_clone(zval *destination, zval *obj TSRMLS_DC) { /** * Checks if property exists on object */ -int zephir_isset_property_quick(zval *object, const char *property_name, unsigned int property_length, unsigned long hash TSRMLS_DC) { - +int zephir_isset_property(zval *object, const char *property_name, unsigned int property_length) +{ if (Z_TYPE_P(object) == IS_OBJECT) { - if (EXPECTED(zend_hash_quick_exists(&Z_OBJCE_P(object)->properties_info, property_name, property_length, hash))) { + if (EXPECTED(zend_hash_str_exists(&Z_OBJCE_P(object)->properties_info, property_name, property_length))) { return 1; - } else { - return zend_hash_quick_exists(Z_OBJ_HT_P(object)->get_properties(object TSRMLS_CC), property_name, property_length, hash); } + return zend_hash_str_exists(Z_OBJ_HT_P(object)->get_properties(object), property_name, property_length); } return 0; } -/** - * Checks if property exists on object - */ -int zephir_isset_property(zval *object, const char *property_name, unsigned int property_length TSRMLS_DC) { - - return zephir_isset_property_quick(object, property_name, property_length, zend_inline_hash_func(property_name, property_length) TSRMLS_CC); -} - /** * Checks if string property exists on object */ -int zephir_isset_property_zval(zval *object, const zval *property TSRMLS_DC) { - - unsigned long hash; - +int zephir_isset_property_zval(zval *object, const zval *property) +{ if (Z_TYPE_P(object) == IS_OBJECT) { if (Z_TYPE_P(property) == IS_STRING) { - hash = zend_inline_hash_func(Z_STRVAL_P(property), Z_STRLEN_P(property) + 1); - - if (EXPECTED(zend_hash_quick_exists(&Z_OBJCE_P(object)->properties_info, Z_STRVAL_P(property), Z_STRLEN_P(property) + 1, hash))) { + if (EXPECTED(zend_hash_str_exists(&Z_OBJCE_P(object)->properties_info, Z_STRVAL_P(property), Z_STRLEN_P(property)))) { return 1; } else { - return zend_hash_quick_exists(Z_OBJ_HT_P(object)->get_properties(object TSRMLS_CC), Z_STRVAL_P(property), Z_STRLEN_P(property) + 1, hash); + return zend_hash_str_exists(Z_OBJ_HT_P(object)->get_properties(object), Z_STRVAL_P(property), Z_STRLEN_P(property)); } } } @@ -440,16 +406,13 @@ int zephir_isset_property_zval(zval *object, const zval *property TSRMLS_DC) { return 0; } -/* - * Lookup exact class where a property is defined (precomputed key) - * - */ -static inline zend_class_entry *zephir_lookup_class_ce_quick(zend_class_entry *ce, const char *property_name, zend_uint property_length, ulong hash TSRMLS_DC) { - +static inline zend_class_entry *zephir_lookup_class_ce(zend_class_entry *ce, const char *property_name, unsigned int property_length) +{ zend_class_entry *original_ce = ce; + zend_property_info *info; while (ce) { - if (zend_hash_quick_exists(&ce->properties_info, property_name, property_length + 1, hash)) { + if ((info = zend_hash_str_find_ptr(&ce->properties_info, property_name, property_length)) != NULL && (info->flags & ZEND_ACC_SHADOW) != ZEND_ACC_SHADOW) { return ce; } ce = ce->parent; @@ -457,543 +420,332 @@ static inline zend_class_entry *zephir_lookup_class_ce_quick(zend_class_entry *c return original_ce; } -/** - * Lookup exact class where a property is defined - * - */ -static inline zend_class_entry *zephir_lookup_class_ce(zend_class_entry *ce, const char *property_name, unsigned int property_length TSRMLS_DC) { - - return zephir_lookup_class_ce_quick(ce, property_name, property_length, zend_inline_hash_func(property_name, property_length + 1) TSRMLS_CC); -} /** * Reads a property from an object */ -int zephir_read_property(zval **result, zval *object, const char *property_name, zend_uint property_length, int silent TSRMLS_DC) { - - zval *property; +int zephir_read_property(zval *result, zval *object, const char *property_name, zend_uint property_length, int flags) +{ + zval property; zend_class_entry *ce, *old_scope; + zval tmp; + zval *res; + + ZVAL_UNDEF(&tmp); if (Z_TYPE_P(object) != IS_OBJECT) { - if (silent == PH_NOISY) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Trying to get property \"%s\" of non-object", property_name); + if ((flags & PH_NOISY) == PH_NOISY) { + php_error_docref(NULL, E_NOTICE, "Trying to get property \"%s\" of non-object", property_name); } - ALLOC_INIT_ZVAL(*result); - ZVAL_NULL(*result); + ZVAL_NULL(result); return FAILURE; } ce = Z_OBJCE_P(object); - if (ce->parent) { - ce = zephir_lookup_class_ce(ce, property_name, property_length TSRMLS_CC); - } +#if PHP_VERSION_ID >= 70100 + old_scope = EG(fake_scope); + EG(fake_scope) = ce; +#else old_scope = EG(scope); EG(scope) = ce; + if (ce->parent) { + ce = zephir_lookup_class_ce(ce, property_name, property_length); + } +#endif if (!Z_OBJ_HT_P(object)->read_property) { const char *class_name; - zend_uint class_name_len; - zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC); + class_name = Z_OBJ_P(object) ? ZSTR_VAL(Z_OBJCE_P(object)->name) : ""; zend_error(E_CORE_ERROR, "Property %s of class %s cannot be read", property_name, class_name); } - MAKE_STD_ZVAL(property); - ZVAL_STRINGL(property, property_name, property_length, 0); - - *result = Z_OBJ_HT_P(object)->read_property(object, property, silent ? BP_VAR_IS : BP_VAR_R, 0 TSRMLS_CC); - - Z_ADDREF_PP(result); + ZVAL_STRINGL(&property, property_name, property_length); - if (Z_REFCOUNT_P(property) > 1) { - ZVAL_STRINGL(property, property_name, property_length, 1); + res = Z_OBJ_HT_P(object)->read_property(object, &property, flags ? BP_VAR_IS : BP_VAR_R, NULL, &tmp); + if ((flags & PH_READONLY) == PH_READONLY) { + ZVAL_COPY_VALUE(result, res); } else { - ZVAL_NULL(property); + ZVAL_COPY(result, res); } zval_ptr_dtor(&property); +#if PHP_VERSION_ID >= 70100 + EG(fake_scope) = old_scope; +#else EG(scope) = old_scope; +#endif return SUCCESS; } -zval* zephir_fetch_property_this_quick(zval *object, const char *property_name, zend_uint property_length, ulong key, int silent TSRMLS_DC) { - - zval **zv = NULL; - zend_object *zobj; - zend_property_info *property_info; - zend_class_entry *ce, *old_scope; - - if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { - - ce = Z_OBJCE_P(object); - if (ce->parent) { - ce = zephir_lookup_class_ce_quick(ce, property_name, property_length, key TSRMLS_CC); - } - - old_scope = EG(scope); - EG(scope) = ce; - - zobj = zend_objects_get_address(object TSRMLS_CC); - - if (zend_hash_quick_find(&ce->properties_info, property_name, property_length + 1, key, (void **) &property_info) == SUCCESS) { - int flag; - if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && property_info->offset >= 0) { - if (zobj->properties) { - zv = (zval**) zobj->properties_table[property_info->offset]; - flag = (zv == NULL) ? 1 : 0; - } else { - zv = &zobj->properties_table[property_info->offset]; - flag = (*zv == NULL) ? 1 : 0; - } - } else if (UNEXPECTED(!zobj->properties)) { - flag = 1; - } else if (UNEXPECTED(zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &zv) == FAILURE)) { - flag = 2; - } else { - flag = 0; - } - - if (UNEXPECTED(flag) && zobj->properties) { - if ( - (flag == 2 || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &zv) == FAILURE) - && zv && *zv - ) { - flag = 0; - } - } - - if (EXPECTED(!flag)) { - EG(scope) = old_scope; - return *zv; - } - } - - EG(scope) = old_scope; - - } else { - if (silent == PH_NOISY) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Trying to get property \"%s\" of non-object", property_name); - } +/** + * Fetches a property using a const char + */ +int zephir_fetch_property(zval *result, zval *object, const char *property_name, zend_uint property_length, int silent) +{ + if (zephir_isset_property(object, property_name, property_length)) { + zephir_read_property(result, object, property_name, property_length, 0); + return 1; } - return NULL; + //zval_ptr_dtor(result); + ZVAL_NULL(result); + return 0; } /** - * Returns an object's member + * Fetches a property using a zval property */ -int zephir_return_property_quick(zval *return_value, zval **return_value_ptr, zval *object, char *property_name, unsigned int property_length, unsigned long key TSRMLS_DC) { - - zval **zv; - zend_object *zobj; - zend_property_info *property_info; - zend_class_entry *ce, *old_scope; - - if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { - - ce = Z_OBJCE_P(object); - if (ce->parent) { - ce = zephir_lookup_class_ce_quick(ce, property_name, property_length, key TSRMLS_CC); - } - - old_scope = EG(scope); - EG(scope) = ce; - - zobj = zend_objects_get_address(object TSRMLS_CC); - - if (zend_hash_quick_find(&ce->properties_info, property_name, property_length + 1, key, (void **) &property_info) == SUCCESS) { - int flag; - if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && property_info->offset >= 0) { - if (zobj->properties) { - zv = (zval**) zobj->properties_table[property_info->offset]; - flag = (zv == NULL) ? 1 : 0; - } else { - zv = &zobj->properties_table[property_info->offset]; - flag = (*zv == NULL) ? 1 : 0; - } - } else if (UNEXPECTED(!zobj->properties)) { - flag = 1; - } else if (UNEXPECTED(zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &zv) == FAILURE)) { - flag = 2; - } else { - flag = 0; - } - - if (UNEXPECTED(flag) && zobj->properties) { - if ( - (flag == 2 || zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &zv) == FAILURE) - && zv && *zv - ) { - flag = 0; - } - } - - if (EXPECTED(!flag)) { - EG(scope) = old_scope; - - if (return_value_ptr) { - zval_ptr_dtor(return_value_ptr); - Z_ADDREF_PP(zv); - *return_value_ptr = *zv; - } - else { - ZVAL_ZVAL(return_value, *zv, 1, 0); - } - - return SUCCESS; - } - } - - EG(scope) = old_scope; +int zephir_fetch_property_zval(zval *result, zval *object, zval *property, int silent) +{ + if (UNEXPECTED(Z_TYPE_P(property) != IS_STRING)) { + ZVAL_NULL(result); + return 0; + } - } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Trying to get property \"%s\" of non-object", property_name); + if (zephir_isset_property(object, Z_STRVAL_P(property), Z_STRLEN_P(property))) { + zephir_read_property(result, object, Z_STRVAL_P(property), Z_STRLEN_P(property), 0); + return 1; } - ZVAL_NULL(return_value); - return FAILURE; + ZVAL_NULL(result); + return 0; } -/** - * Returns an object's member - */ -int zephir_return_property(zval *return_value, zval **return_value_ptr, zval *object, char *property_name, unsigned int property_length TSRMLS_DC) { - - return zephir_return_property_quick(return_value, return_value_ptr, object, property_name, property_length, zend_inline_hash_func(property_name, property_length + 1) TSRMLS_CC); +int zephir_return_property(zval *return_value, zval *object, char *property_name, unsigned int property_length) +{ + ZVAL_NULL(return_value); + zephir_read_property(return_value, object, property_name, property_length, 0); + return SUCCESS; } /** * Reads a property from an object */ -int zephir_read_property_zval(zval **result, zval *object, zval *property, int flags TSRMLS_DC) { - +int zephir_read_property_zval(zval *result, zval *object, zval *property, int flags) +{ if (UNEXPECTED(Z_TYPE_P(property) != IS_STRING)) { - if ((flags & PH_NOISY) == PH_NOISY) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot access empty property %d", Z_TYPE_P(property)); + php_error_docref(NULL, E_NOTICE, "Cannot access empty property %d", Z_TYPE_P(property)); } - *result = ZEPHIR_GLOBAL(global_null); - Z_ADDREF_P(*result); + ZVAL_NULL(result); return FAILURE; } - return zephir_read_property(result, object, Z_STRVAL_P(property), Z_STRLEN_P(property), flags TSRMLS_CC); + return zephir_read_property(result, object, Z_STRVAL_P(property), Z_STRLEN_P(property), flags); } /** - * Checks whether obj is an object and updates property with long value + * Checks whether obj is an object and updates property with another zval */ -int zephir_update_property_long(zval *object, char *property_name, unsigned int property_length, long value TSRMLS_DC) { - - zval *v; +int zephir_update_property_zval(zval *object, const char *property_name, unsigned int property_length, zval *value) +{ + zend_class_entry *ce, *old_scope; + zval property; - ALLOC_ZVAL(v); - Z_UNSET_ISREF_P(v); - Z_SET_REFCOUNT_P(v, 0); - ZVAL_LONG(v, value); +#if PHP_VERSION_ID >= 70100 + old_scope = EG(fake_scope); +#else + old_scope = EG(scope); +#endif - return zephir_update_property_zval(object, property_name, property_length, v TSRMLS_CC); -} + if (Z_TYPE_P(object) != IS_OBJECT) { + php_error_docref(NULL, E_WARNING, "Attempt to assign property of non-object"); + return FAILURE; + } -/** - * Checks whether obj is an object and updates property with string value - */ -int zephir_update_property_string(zval *object, char *property_name, unsigned int property_length, char *str, unsigned int str_length TSRMLS_DC) { + ce = Z_OBJCE_P(object); + if (ce->parent) { + ce = zephir_lookup_class_ce(ce, property_name, property_length); + } - zval *value; - int res; +#if PHP_VERSION_ID >= 70100 + EG(fake_scope) = ce; +#else + EG(scope) = ce; +#endif - ALLOC_ZVAL(value); - Z_UNSET_ISREF_P(value); - Z_SET_REFCOUNT_P(value, 0); - ZVAL_STRINGL(value, str, str_length, 1); + if (!Z_OBJ_HT_P(object)->write_property) { + const char *class_name; - res = zephir_update_property_zval(object, property_name, property_length, value TSRMLS_CC); - if (res == SUCCESS) { - return SUCCESS; + class_name = Z_OBJ_P(object) ? ZSTR_VAL(Z_OBJCE_P(object)->name) : ""; + zend_error(E_CORE_ERROR, "Property %s of class %s cannot be updated", property_name, class_name); } - return FAILURE; + ZVAL_STRINGL(&property, property_name, property_length); + + /* write_property will add 1 to refcount, so no Z_TRY_ADDREF_P(value); is necessary */ + Z_OBJ_HT_P(object)->write_property(object, &property, value, 0); + zval_ptr_dtor(&property); + +#if PHP_VERSION_ID >= 70100 + EG(fake_scope) = old_scope; +#else + EG(scope) = old_scope; +#endif + return SUCCESS; } /** - * Checks whether obj is an object and updates property with bool value + * Checks whether obj is an object and updates zval property with another zval */ -int zephir_update_property_bool(zval *object, char *property_name, unsigned int property_length, int value TSRMLS_DC) { - return zephir_update_property_zval(object, property_name, property_length, value ? ZEPHIR_GLOBAL(global_true) : ZEPHIR_GLOBAL(global_false) TSRMLS_CC); -} - -/** - * Checks whether obj is an object and updates property with null value - */ -int zephir_update_property_null(zval *object, char *property_name, unsigned int property_length TSRMLS_DC) { - return zephir_update_property_zval(object, property_name, property_length, ZEPHIR_GLOBAL(global_null) TSRMLS_CC); -} - -/** - * Checks whether obj is an object and updates property with another zval - */ -int zephir_update_property_zval(zval *object, const char *property_name, unsigned int property_length, zval *value TSRMLS_DC){ - - zend_class_entry *ce, *old_scope; - zval *property; - - old_scope = EG(scope); - if (Z_TYPE_P(object) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to assign property of non-object"); - return FAILURE; - } - - ce = Z_OBJCE_P(object); - if (ce->parent) { - ce = zephir_lookup_class_ce(ce, property_name, property_length TSRMLS_CC); - } - - EG(scope) = ce; - - if (!Z_OBJ_HT_P(object)->write_property) { - const char *class_name; - zend_uint class_name_len; - - zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC); - zend_error(E_CORE_ERROR, "Property %s of class %s cannot be updated", property_name, class_name); - } - - MAKE_STD_ZVAL(property); - ZVAL_STRINGL(property, property_name, property_length, 0); - - Z_OBJ_HT_P(object)->write_property(object, property, value, 0 TSRMLS_CC); - - if (Z_REFCOUNT_P(property) > 1) { - ZVAL_STRINGL(property, property_name, property_length, 1); - } else { - ZVAL_NULL(property); - } - - zval_ptr_dtor(&property); - - EG(scope) = old_scope; - return SUCCESS; -} - -/** - * Updates properties on this_ptr (quick) - * If a variable is not defined in the class definition, this fallbacks to update_property_zval - * function ignores magic methods or dynamic properties - */ -int zephir_update_property_this_quick(zval *object, const char *property_name, zend_uint property_length, zval *value, ulong key TSRMLS_DC){ - - zend_class_entry *ce, *old_scope; - - if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to assign property of non-object"); - return FAILURE; - } - - ce = Z_OBJCE_P(object); - if (ce->parent) { - ce = zephir_lookup_class_ce_quick(ce, property_name, property_length, key TSRMLS_CC); - } - - old_scope = EG(scope); - EG(scope) = ce; - - { - zend_object *zobj; - zval **variable_ptr; - zend_property_info *property_info; - - zobj = zend_objects_get_address(object TSRMLS_CC); - - if (EXPECTED(zend_hash_quick_find(&ce->properties_info, property_name, property_length + 1, key, (void **) &property_info) == SUCCESS)) { - assert(property_info != NULL); - - /** This is as zend_std_write_property, but we're not interesed in validate properties visibility */ - if (property_info->offset >= 0 ? (zobj->properties ? ((variable_ptr = (zval**) zobj->properties_table[property_info->offset]) != NULL) : (*(variable_ptr = &zobj->properties_table[property_info->offset]) != NULL)) : (EXPECTED(zobj->properties != NULL) && EXPECTED(zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length + 1, property_info->h, (void **) &variable_ptr) == SUCCESS))) { - - if (EXPECTED(*variable_ptr != value)) { - - /* if we are assigning reference, we shouldn't move it, but instead assign variable to the same pointer */ - if (PZVAL_IS_REF(*variable_ptr)) { - - zval garbage = **variable_ptr; /* old value should be destroyed */ - - /* To check: can't *variable_ptr be some system variable like error_zval here? */ - Z_TYPE_PP(variable_ptr) = Z_TYPE_P(value); - (*variable_ptr)->value = value->value; - if (Z_REFCOUNT_P(value) > 0) { - zval_copy_ctor(*variable_ptr); - } else { - efree(value); - } - zval_dtor(&garbage); - - } else { - zval *garbage = *variable_ptr; - - /* if we assign referenced variable, we should separate it */ - Z_ADDREF_P(value); - if (PZVAL_IS_REF(value)) { - SEPARATE_ZVAL(&value); - } - *variable_ptr = value; - zval_ptr_dtor(&garbage); - } - } - - } - } else { - EG(scope) = old_scope; - return zephir_update_property_zval(object, property_name, property_length, value TSRMLS_CC); - } - } - - EG(scope) = old_scope; - - return SUCCESS; -} - -/** - * Updates properties on this_ptr - * Variables must be defined in the class definition. This function ignores magic methods or dynamic properties - */ -int zephir_update_property_this(zval *object, char *property_name, unsigned int property_length, zval *value TSRMLS_DC) { - - return zephir_update_property_this_quick(object, property_name, property_length, value, zend_inline_hash_func(property_name, property_length + 1) TSRMLS_CC); -} - -/** - * Checks whether obj is an object and updates zval property with another zval - */ -int zephir_update_property_zval_zval(zval *object, zval *property, zval *value TSRMLS_DC) { - +int zephir_update_property_zval_zval(zval *object, zval *property, zval *value) +{ if (Z_TYPE_P(property) != IS_STRING) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Property should be string"); + php_error_docref(NULL, E_WARNING, "Property should be string"); return FAILURE; } - return zephir_update_property_zval(object, Z_STRVAL_P(property), Z_STRLEN_P(property), value TSRMLS_CC); + return zephir_update_property_zval(object, Z_STRVAL_P(property), Z_STRLEN_P(property), value); } /** * Updates an array property */ -int zephir_update_property_array(zval *object, const char *property, zend_uint property_length, const zval *index, zval *value TSRMLS_DC) { - - zval *tmp; +int zephir_update_property_array(zval *object, const char *property, zend_uint property_length, const zval *index, zval *value) +{ + zval tmp; int separated = 0; if (Z_TYPE_P(object) == IS_OBJECT) { - - zephir_read_property(&tmp, object, property, property_length, PH_NOISY TSRMLS_CC); - - Z_DELREF_P(tmp); + zephir_read_property(&tmp, object, property, property_length, PH_NOISY | PH_READONLY); /** Separation only when refcount > 1 */ - if (Z_REFCOUNT_P(tmp) > 1) { - if (!Z_ISREF_P(tmp)) { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp); - tmp = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp, 0); - Z_UNSET_ISREF_P(tmp); - separated = 1; + if (Z_REFCOUNTED(tmp)) { + if (Z_REFCOUNT(tmp) > 1) { + if (!Z_ISREF(tmp)) { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp); + ZVAL_COPY_VALUE(&tmp, &new_zv); + Z_TRY_DELREF(new_zv); + Z_ADDREF(tmp); + separated = 1; + } } + } else { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp); + ZVAL_COPY_VALUE(&tmp, &new_zv); + Z_TRY_DELREF(new_zv); + separated = 1; } /** Convert the value to array if not is an array */ - if (Z_TYPE_P(tmp) != IS_ARRAY) { + if (Z_TYPE(tmp) != IS_ARRAY) { if (separated) { - convert_to_array(tmp); + convert_to_array(&tmp); } else { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp); - tmp = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp, 0); - Z_UNSET_ISREF_P(tmp); - array_init(tmp); + array_init(&tmp); separated = 1; } - } - Z_ADDREF_P(value); + if (Z_REFCOUNTED(tmp)) { + if (Z_REFCOUNT(tmp) > 1) { + if (!Z_ISREF(tmp)) { + Z_DELREF(tmp); + } + } + } + } + Z_TRY_ADDREF_P(value); if (Z_TYPE_P(index) == IS_STRING) { - zend_symtable_update(Z_ARRVAL_P(tmp), Z_STRVAL_P(index), Z_STRLEN_P(index) + 1, &value, sizeof(zval*), NULL); + zend_symtable_str_update(Z_ARRVAL(tmp), Z_STRVAL_P(index), Z_STRLEN_P(index), value); } else if (Z_TYPE_P(index) == IS_LONG) { - zend_hash_index_update(Z_ARRVAL_P(tmp), Z_LVAL_P(index), &value, sizeof(zval *), NULL); + zend_hash_index_update(Z_ARRVAL(tmp), Z_LVAL_P(index), value); } else if (Z_TYPE_P(index) == IS_NULL) { - zend_hash_next_index_insert(Z_ARRVAL_P(tmp), (void**)&value, sizeof(zval*), NULL); + zend_hash_next_index_insert(Z_ARRVAL(tmp), value); } if (separated) { - zephir_update_property_zval(object, property, property_length, tmp TSRMLS_CC); + zephir_update_property_zval(object, property, property_length, &tmp); + } + + if (Z_REFCOUNTED(tmp)) { + if (Z_REFCOUNT(tmp) > 1) { + if (!Z_ISREF(tmp)) { + Z_DELREF(tmp); + } + } } } return SUCCESS; } + /** - * Multiple array-offset update + * Appends a zval value to an array property */ -int zephir_update_property_array_multi(zval *object, const char *property, zend_uint property_length, zval **value TSRMLS_DC, const char *types, int types_length, int types_count, ...) { - va_list ap; - zval *tmp_arr; +int zephir_update_property_array_append(zval *object, char *property, unsigned int property_length, zval *value) +{ + zval tmp; int separated = 0; - if (Z_TYPE_P(object) == IS_OBJECT) { + ZVAL_UNDEF(&tmp); - zephir_read_property(&tmp_arr, object, property, property_length, PH_NOISY TSRMLS_CC); + if (Z_TYPE_P(object) != IS_OBJECT) { + return SUCCESS; + } - Z_DELREF_P(tmp_arr); + zephir_read_property(&tmp, object, property, property_length, PH_NOISY_CC); - /** Separation only when refcount > 1 */ - if (Z_REFCOUNT_P(tmp_arr) > 1) { - if (!Z_ISREF_P(tmp_arr)) { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp_arr); - tmp_arr = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp_arr, 0); - Z_UNSET_ISREF_P(tmp_arr); + Z_TRY_DELREF(tmp); + + /** Separation only when refcount > 1 */ + if (Z_REFCOUNTED(tmp)) { + if (Z_REFCOUNT(tmp) > 1) { + if (!Z_ISREF(tmp)) { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp); + ZVAL_COPY_VALUE(&tmp, &new_zv); + Z_TRY_DELREF(new_zv); separated = 1; } } + } else { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp); + ZVAL_COPY_VALUE(&tmp, &new_zv); + Z_TRY_DELREF(new_zv); + separated = 1; + } - /** Convert the value to array if not is an array */ - if (Z_TYPE_P(tmp_arr) != IS_ARRAY) { - if (separated) { - convert_to_array(tmp_arr); - } else { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp_arr); - tmp_arr = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp_arr, 0); - Z_UNSET_ISREF_P(tmp_arr); - array_init(tmp_arr); - separated = 1; + /** Convert the value to array if not is an array */ + if (Z_TYPE(tmp) != IS_ARRAY) { + if (separated) { + convert_to_array(&tmp); + } else { + array_init(&tmp); + separated = 1; + } + + if (Z_REFCOUNTED(tmp)) { + if (Z_REFCOUNT(tmp) > 1) { + if (!Z_ISREF(tmp)) { + Z_DELREF(tmp); + } } } + } - va_start(ap, types_count); - zephir_array_update_multi_ex(&tmp_arr, value, types, types_length, types_count, ap TSRMLS_CC); - va_end(ap); + Z_TRY_ADDREF_P(value); + add_next_index_zval(&tmp, value); - if (separated) { - zephir_update_property_zval(object, property, property_length, tmp_arr TSRMLS_CC); + if (separated) { + zephir_update_property_zval(object, property, property_length, &tmp); + } + + if (Z_REFCOUNTED(tmp)) { + if (Z_REFCOUNT(tmp) > 1) { + if (!Z_ISREF(tmp)) { + Z_DELREF(tmp); + } } } @@ -1001,150 +753,98 @@ int zephir_update_property_array_multi(zval *object, const char *property, zend_ } /** - * Updates an array property using a string index + * Multiple array-offset update */ -int zephir_update_property_array_string(zval *object, char *property, unsigned int property_length, char *index, unsigned int index_length, zval *value TSRMLS_DC) { - - zval *tmp; +int zephir_update_property_array_multi(zval *object, const char *property, zend_uint property_length, zval *value, const char *types, int types_length, int types_count, ...) +{ + va_list ap; + zval tmp_arr; int separated = 0; - if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { - - zephir_read_property(&tmp, object, property, property_length, PH_NOISY_CC); - - Z_DELREF_P(tmp); + if (Z_TYPE_P(object) == IS_OBJECT) { + zephir_read_property(&tmp_arr, object, property, property_length, PH_NOISY | PH_READONLY); /** Separation only when refcount > 1 */ - if (Z_REFCOUNT_P(tmp) > 1) { - if (!Z_ISREF_P(tmp)) { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp); - tmp = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp, 0); - Z_UNSET_ISREF_P(tmp); - separated = 1; + if (Z_REFCOUNTED(tmp_arr)) { + if (Z_REFCOUNT(tmp_arr) > 1) { + if (!Z_ISREF(tmp_arr)) { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp_arr); + ZVAL_COPY_VALUE(&tmp_arr, &new_zv); + Z_TRY_DELREF(new_zv); + Z_ADDREF(tmp_arr); + separated = 1; + } } + } else { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp_arr); + ZVAL_COPY_VALUE(&tmp_arr, &new_zv); + Z_TRY_DELREF(new_zv); + separated = 1; } /** Convert the value to array if not is an array */ - if (Z_TYPE_P(tmp) != IS_ARRAY) { + if (Z_TYPE(tmp_arr) != IS_ARRAY) { if (separated) { - convert_to_array(tmp); + convert_to_array(&tmp_arr); } else { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp); - tmp = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp, 0); - Z_UNSET_ISREF_P(tmp); - array_init(tmp); + array_init(&tmp_arr); separated = 1; } - } - Z_ADDREF_P(value); - - zend_hash_update(Z_ARRVAL_P(tmp), index, index_length, &value, sizeof(zval *), NULL); - - if (separated) { - zephir_update_property_zval(object, property, property_length, tmp TSRMLS_CC); + if (Z_REFCOUNTED(tmp_arr)) { + if (Z_REFCOUNT(tmp_arr) > 1) { + if (!Z_ISREF(tmp_arr)) { + Z_DELREF(tmp_arr); + } + } + } } - } - - return SUCCESS; -} - -/** - * Appends a zval value to an array property - */ -int zephir_update_property_array_append(zval *object, char *property, unsigned int property_length, zval *value TSRMLS_DC) { - - zval *tmp; - int separated = 0; - - if (Z_TYPE_P(object) != IS_OBJECT) { - return SUCCESS; - } - - zephir_read_property(&tmp, object, property, property_length, PH_NOISY_CC); - - Z_DELREF_P(tmp); - - /** Separation only when refcount > 1 */ - if (Z_REFCOUNT_P(tmp) > 1) { - if (!Z_ISREF_P(tmp)) { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp); - tmp = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp, 0); - Z_UNSET_ISREF_P(tmp); - separated = 1; - } - } + va_start(ap, types_count); + zephir_array_update_multi_ex(&tmp_arr, value, types, types_length, types_count, ap); + va_end(ap); - /** Convert the value to array if not is an array */ - if (Z_TYPE_P(tmp) != IS_ARRAY) { if (separated) { - convert_to_array(tmp); - } else { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp); - tmp = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp, 0); - Z_UNSET_ISREF_P(tmp); - array_init(tmp); - separated = 1; + zephir_update_property_zval(object, property, property_length, &tmp_arr); } - } - - Z_ADDREF_P(value); - add_next_index_zval(tmp, value); - if (separated) { - zephir_update_property_zval(object, property, property_length, tmp TSRMLS_CC); + if (Z_REFCOUNTED(tmp_arr)) { + if (Z_REFCOUNT(tmp_arr) > 1) { + if (!Z_ISREF(tmp_arr)) { + Z_DELREF(tmp_arr); + } + } + } } return SUCCESS; } -/** - * Intializes an object property with an empty array - */ -int zephir_update_property_empty_array(zend_class_entry *ce, zval *object, char *property_name, unsigned int property_length TSRMLS_DC) { - - zval *empty_array; - int res; - - ALLOC_INIT_ZVAL(empty_array); - array_init(empty_array); - - res = zephir_update_property_zval(object, property_name, property_length, empty_array TSRMLS_CC); - zval_ptr_dtor(&empty_array); - return res; -} - -int zephir_unset_property(zval* object, const char* name TSRMLS_DC) +int zephir_unset_property(zval* object, const char* name) { if (Z_TYPE_P(object) == IS_OBJECT) { zval member; zend_class_entry *old_scope; - INIT_PZVAL(&member); - ZVAL_STRING(&member, name, 0); + ZVAL_STRING(&member, name); + +#if PHP_VERSION_ID >= 70100 + old_scope = EG(fake_scope); + EG(fake_scope) = Z_OBJCE_P(object); +#else old_scope = EG(scope); EG(scope) = Z_OBJCE_P(object); +#endif - Z_OBJ_HT_P(object)->unset_property(object, &member, 0 TSRMLS_CC); + Z_OBJ_HT_P(object)->unset_property(object, &member, 0); +#if PHP_VERSION_ID >= 70100 + EG(fake_scope) = old_scope; +#else EG(scope) = old_scope; +#endif return SUCCESS; } @@ -1155,521 +855,326 @@ int zephir_unset_property(zval* object, const char* name TSRMLS_DC) /** * Unsets an index in an array property */ -int zephir_unset_property_array(zval *object, char *property, unsigned int property_length, zval *index TSRMLS_DC) { - - zval *tmp; +int zephir_unset_property_array(zval *object, char *property, unsigned int property_length, zval *index) +{ + zval tmp; int separated = 0; if (Z_TYPE_P(object) == IS_OBJECT) { zephir_read_property(&tmp, object, property, property_length, PH_NOISY_CC); - Z_DELREF_P(tmp); + Z_TRY_DELREF(tmp); /** Separation only when refcount > 1 */ - if (Z_REFCOUNT_P(tmp) > 1) { - if (!Z_ISREF_P(tmp)) { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp); - tmp = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp, 0); - Z_UNSET_ISREF_P(tmp); - separated = 1; + if (Z_REFCOUNTED(tmp)) { + if (Z_REFCOUNT(tmp) > 1) { + if (!Z_ISREF(tmp)) { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp); + ZVAL_COPY_VALUE(&tmp, &new_zv); + Z_TRY_DELREF(new_zv); + separated = 1; + } } + } else { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp); + ZVAL_COPY_VALUE(&tmp, &new_zv); + Z_TRY_DELREF(new_zv); + separated = 1; } zephir_array_unset(&tmp, index, PH_SEPARATE); if (separated) { - zephir_update_property_zval(object, property, property_length, tmp TSRMLS_CC); + zephir_update_property_zval(object, property, property_length, &tmp); } } return SUCCESS; } -/** - * Check if a method is implemented on certain object - */ -int zephir_method_exists(const zval *object, const zval *method_name TSRMLS_DC){ - - char *lcname = zend_str_tolower_dup(Z_STRVAL_P(method_name), Z_STRLEN_P(method_name)); - int res = zephir_method_exists_ex(object, lcname, Z_STRLEN_P(method_name) + 1 TSRMLS_CC); - efree(lcname); - return res; -} - -/** - * Check if method exists on certain object using explicit char param - * - * @param object - * @param method_name - * @param method_length strlen(method_name)+1 - */ -int zephir_method_exists_ex(const zval *object, const char *method_name, unsigned int method_len TSRMLS_DC){ - - return zephir_method_quick_exists_ex(object, method_name, method_len, zend_inline_hash_func(method_name, method_len) TSRMLS_CC); -} - -/** - * Check if method exists on certain object using explicit char param - */ -int zephir_method_quick_exists_ex(const zval *object, const char *method_name, unsigned int method_len, unsigned long hash TSRMLS_DC){ - +int zephir_method_exists_ex(zval *object, const char *method_name, unsigned int method_len) +{ zend_class_entry *ce; + union _zend_function *func = NULL; + zend_string *method; if (EXPECTED(Z_TYPE_P(object) == IS_OBJECT)) { ce = Z_OBJCE_P(object); + } else if (Z_TYPE_P(object) == IS_STRING) { + ce = zend_fetch_class(Z_STR_P(object), ZEND_FETCH_CLASS_DEFAULT); } else { - if (Z_TYPE_P(object) == IS_STRING) { - ce = zend_fetch_class(Z_STRVAL_P(object), Z_STRLEN_P(object), ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC); - } else { - return FAILURE; - } + return FAILURE; } - while (ce) { - if (zend_hash_quick_exists(&ce->function_table, method_name, method_len, hash)) { - return SUCCESS; - } - ce = ce->parent; + if (zend_hash_str_exists(&ce->function_table, method_name, method_len)) { + return SUCCESS; } - return FAILURE; -} - -zval* zephir_fetch_static_property_ce(zend_class_entry *ce, const char *property, int len TSRMLS_DC) { - assert(ce != NULL); - return zend_read_static_property(ce, property, len, (zend_bool) ZEND_FETCH_CLASS_SILENT TSRMLS_CC); -} + method = zend_string_init(method_name, method_len, 0); + if ( + Z_TYPE_P(object) == IS_OBJECT + && Z_OBJ_HT_P(object)->get_method + && (func = Z_OBJ_HT_P(object)->get_method(&Z_OBJ_P(object), method, NULL)) + ) { + if (func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) { + int status = (func->common.scope == zend_ce_closure && zend_string_equals_literal(method, ZEND_INVOKE_FUNC_NAME)); -int zephir_read_static_property_ce(zval **result, zend_class_entry *ce, const char *property, int len TSRMLS_DC) { - zval *tmp; - tmp = zephir_fetch_static_property_ce(ce, property, len TSRMLS_CC); - if (tmp) { - if (!Z_ISREF_P(tmp)) { - *result = tmp; - Z_ADDREF_PP(result); - } else { - ALLOC_INIT_ZVAL(*result); - ZVAL_ZVAL(*result, tmp, 1, 0); + zend_string_release(method); + zend_string_release(func->common.function_name); + zend_free_trampoline(func); + return status ? SUCCESS : FAILURE; } + + zend_string_release(method); return SUCCESS; } - ALLOC_INIT_ZVAL(*result); + + zend_string_release(method); return FAILURE; } -static zval **zephir_std_get_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, ulong hash_value, zend_bool silent, zend_property_info ** - property_info TSRMLS_DC) +int zephir_method_exists(zval *object, const zval *method_name) { - zend_property_info *temp_property_info; - - if (!hash_value) { - hash_value = zend_hash_func(property_name, property_name_len + 1); - } - - if (!property_info || !*property_info) { - - if (UNEXPECTED(zend_hash_quick_find(&ce->properties_info, property_name, property_name_len + 1, hash_value, (void **) &temp_property_info)==FAILURE)) { - if (!silent) { - zend_error(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name); - } - return NULL; - } - - #ifndef ZEPHIR_RELEASE - /*if (UNEXPECTED(!zend_verify_property_access(temp_property_info, ce TSRMLS_CC))) { - if (!silent) { - zend_error(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(temp_property_info->flags), ce->name, property_name); - } - return NULL; - } - - if (UNEXPECTED((temp_property_info->flags & ZEND_ACC_STATIC) == 0)) { - if (!silent) { - zend_error(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name); - } - return NULL; - }*/ - #endif - - zend_update_class_constants(ce TSRMLS_CC); - - if (property_info) { - *property_info = temp_property_info; - } - - } else { - temp_property_info = *property_info; - } - - if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL) || UNEXPECTED(CE_STATIC_MEMBERS(ce)[temp_property_info->offset] == NULL)) { - if (!silent) { - zend_error(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name); - } - return NULL; + if (Z_TYPE_P(method_name) != IS_STRING) { + zend_error(E_WARNING, "method_exists expected a string"); + return 0; } - - return &CE_STATIC_MEMBERS(ce)[temp_property_info->offset]; + char *lcname = zend_str_tolower_dup(Z_STRVAL_P(method_name), Z_STRLEN_P(method_name)); + int res = zephir_method_exists_ex(object, lcname, Z_STRLEN_P(method_name)); + efree(lcname); + return res; } -static int zephir_update_static_property_ex(zend_class_entry *scope, const char *name, int name_length, zval **value, zend_property_info **property_info TSRMLS_DC) +int zephir_read_static_property_ce(zval *result, zend_class_entry *ce, const char *property, int len, int flags) { - zval **property; zval *tmp, **safe_value; - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - zend_class_entry *old_scope = EG(scope); - - /** - * We have to protect super globals to avoid them make converted to references - */ - if (*value == zephir_globals_ptr->global_null) { - ALLOC_ZVAL(tmp); - Z_UNSET_ISREF_P(tmp); - Z_SET_REFCOUNT_P(tmp, 0); - ZVAL_NULL(tmp); - safe_value = &tmp; - } else { - if (*value == zephir_globals_ptr->global_true) { - ALLOC_ZVAL(tmp); - Z_UNSET_ISREF_P(tmp); - Z_SET_REFCOUNT_P(tmp, 0); - ZVAL_BOOL(tmp, 1); - safe_value = &tmp; - } else { - if (*value == zephir_globals_ptr->global_false) { - ALLOC_ZVAL(tmp); - Z_UNSET_ISREF_P(tmp); - Z_SET_REFCOUNT_P(tmp, 0); - ZVAL_BOOL(tmp, 0); - safe_value = &tmp; - } else { - safe_value = value; - } - } - } - - EG(scope) = scope; - property = zephir_std_get_static_property(scope, name, name_length, zend_inline_hash_func(name, name_length + 1), 0, property_info TSRMLS_CC); - EG(scope) = old_scope; + zval *tmp = zend_read_static_property(ce, property, len, (zend_bool) ZEND_FETCH_CLASS_SILENT); - if (!property) { - return FAILURE; - } else { - if (*property != *safe_value) { - if (PZVAL_IS_REF(*property)) { - zval_dtor(*property); - Z_TYPE_PP(property) = Z_TYPE_PP(safe_value); - (*property)->value = (*safe_value)->value; - if (Z_REFCOUNT_PP(safe_value) > 0) { - zval_copy_ctor(*property); - } else { - efree(*safe_value); - *safe_value = NULL; - } - } else { - zval *garbage = *property; - - Z_ADDREF_PP(safe_value); - if (Z_ISREF_PP(safe_value)) { - SEPARATE_ZVAL(safe_value); - } - *property = *safe_value; - zval_ptr_dtor(&garbage); - } + //zval_ptr_dtor(result); + ZVAL_NULL(result); + if (tmp) + { + if ((flags & PH_READONLY) == PH_READONLY) { + ZVAL_COPY_VALUE(result, tmp); + } else { + ZVAL_COPY(result, tmp); } return SUCCESS; } -} - -/** - * Query a static property value from a zend_class_entry - */ -int zephir_read_static_property(zval **result, const char *class_name, unsigned int class_length, char *property_name, - unsigned int property_length TSRMLS_DC) { - zend_class_entry **ce; - if (zend_lookup_class(class_name, class_length, &ce TSRMLS_CC) == SUCCESS) { - return zephir_read_static_property_ce(result, *ce, property_name, property_length TSRMLS_CC); - } return FAILURE; } -int zephir_update_static_property_ce(zend_class_entry *ce, const char *name, int len, zval **value TSRMLS_DC) { - assert(ce != NULL); - return zephir_update_static_property_ex(ce, name, len, value, NULL TSRMLS_CC); -} - -int zephir_update_static_property_ce_cache(zend_class_entry *ce, const char *name, int len, zval **value, zend_property_info **property_info TSRMLS_DC) { - assert(ce != NULL); - return zephir_update_static_property_ex(ce, name, len, value, property_info TSRMLS_CC); -} - /* * Multiple array-offset update */ -int zephir_update_static_property_array_multi_ce(zend_class_entry *ce, const char *property, zend_uint property_length, zval **value TSRMLS_DC, const char *types, int types_length, int types_count, ...) { - +int zephir_update_static_property_array_multi_ce(zend_class_entry *ce, const char *property, zend_uint property_length, zval *value, const char *types, int types_length, int types_count, ...) +{ va_list ap; - zval *tmp_arr; + zval tmp_arr; int separated = 0; - tmp_arr = zephir_fetch_static_property_ce(ce, property, property_length TSRMLS_CC); - if (!tmp_arr) { - ALLOC_INIT_ZVAL(tmp_arr); - array_init(tmp_arr); - separated = 1; - } + ZVAL_UNDEF(&tmp_arr); + + zephir_read_static_property_ce(&tmp_arr, ce, property, property_length, PH_NOISY | PH_READONLY); /** Separation only when refcount > 1 */ - if (Z_REFCOUNT_P(tmp_arr) > 1) { - if (!Z_ISREF_P(tmp_arr)) { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp_arr); - tmp_arr = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp_arr, 0); - Z_UNSET_ISREF_P(tmp_arr); - separated = 1; + if (Z_REFCOUNTED(tmp_arr)) { + if (Z_REFCOUNT(tmp_arr) > 1) { + if (!Z_ISREF(tmp_arr)) { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp_arr); + ZVAL_COPY_VALUE(&tmp_arr, &new_zv); + Z_TRY_DELREF(new_zv); + Z_ADDREF(tmp_arr); + separated = 1; + } } + } else { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp_arr); + ZVAL_COPY_VALUE(&tmp_arr, &new_zv); + Z_TRY_DELREF(new_zv); + separated = 1; } /** Convert the value to array if not is an array */ - if (Z_TYPE_P(tmp_arr) != IS_ARRAY) { + if (Z_TYPE(tmp_arr) != IS_ARRAY) { if (separated) { - convert_to_array(tmp_arr); + convert_to_array(&tmp_arr); } else { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp_arr); - tmp_arr = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp_arr, 0); - Z_UNSET_ISREF_P(tmp_arr); - array_init(tmp_arr); + array_init(&tmp_arr); separated = 1; } + if (Z_REFCOUNTED(tmp_arr)) { + if (Z_REFCOUNT(tmp_arr) > 1) { + if (!Z_ISREF(tmp_arr)) { + Z_DELREF(tmp_arr); + } + } + } } va_start(ap, types_count); - zephir_array_update_multi_ex(&tmp_arr, value, types, types_length, types_count, ap TSRMLS_CC); + SEPARATE_ZVAL_IF_NOT_REF(&tmp_arr); + zephir_array_update_multi_ex(&tmp_arr, value, types, types_length, types_count, ap); va_end(ap); if (separated) { - zephir_update_static_property_ce(ce, property, property_length, &tmp_arr TSRMLS_CC); - } - - return SUCCESS; -} - -/** - * Update a static property - */ -int zephir_update_static_property(const char *class_name, unsigned int class_length, char *name, unsigned int name_length, zval **value TSRMLS_DC){ - zend_class_entry **ce; - if (zend_lookup_class(class_name, class_length, &ce TSRMLS_CC) == SUCCESS) { - return zephir_update_static_property_ce(*ce, name, name_length, value TSRMLS_CC); - } - return FAILURE; -} - -int zephir_read_class_property(zval **result, int type, const char *property, int len TSRMLS_DC) { - zend_class_entry *ce; - - type |= (ZEND_FETCH_CLASS_SILENT | ZEND_FETCH_CLASS_NO_AUTOLOAD); - type &= ZEND_FETCH_CLASS_MASK; - ce = zend_fetch_class(NULL, 0, type TSRMLS_CC); - - if (EXPECTED(ce != NULL)) { - return zephir_read_static_property_ce(result, ce, property, len TSRMLS_CC); - } - - return FAILURE; -} - -/** - * Creates a new instance dynamically. Call constructor without parameters - */ -int zephir_create_instance(zval *return_value, const zval *class_name TSRMLS_DC){ - - zend_class_entry *ce; - - if (Z_TYPE_P(class_name) != IS_STRING) { - zephir_throw_exception_string(spl_ce_RuntimeException, SL("Invalid class name") TSRMLS_CC); - return FAILURE; + zend_update_static_property(ce, property, property_length, &tmp_arr); } - ce = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC); - if (!ce) { - ZVAL_NULL(return_value); - return FAILURE; - } - - object_init_ex(return_value, ce); - if (zephir_has_constructor_ce(ce)) { - return zephir_call_class_method_aparams(NULL, ce, zephir_fcall_method, return_value, SL("__construct"), NULL, 0, 0, NULL TSRMLS_CC); + if (Z_REFCOUNTED(tmp_arr)) { + if (Z_REFCOUNT(tmp_arr) > 1) { + if (!Z_ISREF(tmp_arr)) { + Z_DELREF(tmp_arr); + } + } } return SUCCESS; } /** - * Creates a new instance dynamically calling constructor with parameters + * Increments an object property */ -int zephir_create_instance_params(zval *return_value, const zval *class_name, zval *params TSRMLS_DC){ - - int outcome; +int zephir_property_incr_decr(zval *object, char *property_name, unsigned int property_length, unsigned int increment) +{ + zval tmp; zend_class_entry *ce; + int separated = 0; - if (Z_TYPE_P(class_name) != IS_STRING) { - zephir_throw_exception_string(spl_ce_RuntimeException, SL("Invalid class name") TSRMLS_CC); - return FAILURE; - } + ZVAL_UNDEF(&tmp); - if (Z_TYPE_P(params) != IS_ARRAY) { - zephir_throw_exception_string(spl_ce_RuntimeException, SL("Instantiation parameters must be an array") TSRMLS_CC); + if (Z_TYPE_P(object) != IS_OBJECT) { + php_error_docref(NULL, E_WARNING, "Attempt to assign property of non-object"); return FAILURE; } - ce = zend_fetch_class(Z_STRVAL_P(class_name), Z_STRLEN_P(class_name), ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC); - if (!ce) { - ZVAL_NULL(return_value); - return FAILURE; + ce = Z_OBJCE_P(object); + if (ce->parent) { + ce = zephir_lookup_class_ce(ce, property_name, property_length); } - object_init_ex(return_value, ce); - outcome = SUCCESS; - - if (zephir_has_constructor_ce(ce)) { - - int param_count = zend_hash_num_elements(Z_ARRVAL_P(params)); - zval *static_params[10]; - zval **params_ptr, **params_arr = NULL; - - if (param_count > 0) { - HashPosition pos; - zval **item; - int i = 0; + zephir_read_property(&tmp, object, property_name, property_length, 0); + if (Z_TYPE(tmp) > IS_UNDEF) { - if (EXPECTED(param_count <= 10)) { - params_ptr = static_params; - } else { - params_arr = emalloc(param_count * sizeof(zval*)); - params_ptr = params_arr; - } + Z_TRY_DELREF(tmp); - for ( - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(params), &pos); - zend_hash_get_current_data_ex(Z_ARRVAL_P(params), (void**) &item, &pos) == SUCCESS; - zend_hash_move_forward_ex(Z_ARRVAL_P(params), &pos), ++i - ) { - params_ptr[i] = *item; + /** Separation only when refcount > 1 */ + if (Z_REFCOUNTED(tmp)) { + if (Z_REFCOUNT(tmp) > 1) { + if (!Z_ISREF(tmp)) { + zval new_zv; + ZVAL_DUP(&new_zv, &tmp); + ZVAL_COPY_VALUE(&tmp, &new_zv); + Z_TRY_DELREF(new_zv); + separated = 1; + } } } else { - params_ptr = NULL; + zval new_zv; + ZVAL_DUP(&new_zv, &tmp); + ZVAL_COPY_VALUE(&tmp, &new_zv); + Z_TRY_DELREF(new_zv); + separated = 1; } - outcome = zephir_call_class_method_aparams(NULL, ce, zephir_fcall_method, return_value, SL("__construct"), NULL, 0, param_count, params_ptr TSRMLS_CC); + if (increment) { + zephir_increment(&tmp); + } else { + zephir_decrement(&tmp); + } - if (UNEXPECTED(params_arr != NULL)) { - efree(params_arr); + if (separated) { + zephir_update_property_zval(object, property_name, property_length, &tmp); } } - return outcome; + return SUCCESS; } +/* Imported since PHP is so nice to define this in a .c file... */ +typedef struct _zend_closure { + zend_object std; + zend_function func; + zval this_ptr; + zend_class_entry *called_scope; + void (*orig_internal_handler)(INTERNAL_FUNCTION_PARAMETERS); +} zend_closure; + /** - * Increments an object property + * Creates a closure */ -int zephir_property_incr(zval *object, char *property_name, unsigned int property_length TSRMLS_DC){ - - zval *tmp = NULL; - zend_class_entry *ce; - int separated = 0; +int zephir_create_closure_ex(zval *return_value, zval *this_ptr, zend_class_entry *ce, const char *method_name, zend_uint method_length) +{ + zend_function *function_ptr; + zend_closure *closure; - if (Z_TYPE_P(object) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to assign property of non-object"); + if ((function_ptr = zend_hash_str_find_ptr(&ce->function_table, method_name, method_length)) == NULL) { + ZVAL_NULL(return_value); return FAILURE; } - ce = Z_OBJCE_P(object); - if (ce->parent) { - ce = zephir_lookup_class_ce(ce, property_name, property_length TSRMLS_CC); - } - - zephir_read_property(&tmp, object, property_name, property_length, 0 TSRMLS_CC); - if (tmp) { - - Z_DELREF_P(tmp); - - /** Separation only when refcount > 1 */ - if (Z_REFCOUNT_P(tmp) > 1) { - if (!Z_ISREF_P(tmp)) { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp); - tmp = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp, 0); - Z_UNSET_ISREF_P(tmp); - separated = 1; - } - } - - zephir_increment(tmp); - - if (separated) { - zephir_update_property_zval(object, property_name, property_length, tmp TSRMLS_CC); - } - } - + zend_create_closure(return_value, function_ptr, ce, ce, this_ptr); + // Make sure we can use a closure multiple times + closure = (zend_closure*)Z_OBJ_P(return_value); + closure->func.internal_function.handler = closure->orig_internal_handler; return SUCCESS; } /** - * Decrements an object property + * Creates a new instance dynamically. Call constructor without parameters */ -int zephir_property_decr(zval *object, char *property_name, unsigned int property_length TSRMLS_DC){ - - zval *tmp = NULL; +int zephir_create_instance(zval *return_value, const zval *class_name) +{ zend_class_entry *ce; - int separated = 0; - if (Z_TYPE_P(object) != IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Attempt to assign property of non-object"); + if (Z_TYPE_P(class_name) != IS_STRING) { + zephir_throw_exception_string(spl_ce_RuntimeException, SL("Invalid class name")); return FAILURE; } - ce = Z_OBJCE_P(object); - if (ce->parent) { - ce = zephir_lookup_class_ce(ce, property_name, property_length TSRMLS_CC); + ce = zend_fetch_class(Z_STR_P(class_name), ZEND_FETCH_CLASS_DEFAULT); + if (!ce) { + ZVAL_NULL(return_value); + return FAILURE; } - zephir_read_property(&tmp, object, property_name, property_length, 0 TSRMLS_CC); - if (tmp) { + if(UNEXPECTED(object_init_ex(return_value, ce) != SUCCESS)) { + return FAILURE; + } - Z_DELREF_P(tmp); + if (EXPECTED(Z_OBJ_HT_P(return_value)->get_constructor)) { + zend_object* obj = Z_OBJ_P(return_value); + zend_function* ctor = Z_OBJ_HT_P(return_value)->get_constructor(obj); + if (ctor) { + zend_fcall_info fci; + zend_fcall_info_cache fcc; - /** Separation only when refcount > 1 */ - if (Z_REFCOUNT_P(tmp) > 1) { - if (!Z_ISREF_P(tmp)) { - zval *new_zv; - ALLOC_ZVAL(new_zv); - INIT_PZVAL_COPY(new_zv, tmp); - tmp = new_zv; - zval_copy_ctor(new_zv); - Z_SET_REFCOUNT_P(tmp, 0); - Z_UNSET_ISREF_P(tmp); - separated = 1; - } - } + zend_class_entry* ce = Z_OBJCE_P(return_value); - zephir_decrement(tmp); + fci.size = sizeof(fci); +#if PHP_VERSION_ID < 70100 + fci.function_table = &ce->function_table; + fci.symbol_table = NULL; +#endif + fci.object = obj; + fci.retval = 0; + fci.param_count = 0; + fci.params = 0; + fci.no_separation = 1; + ZVAL_NULL(&fci.function_name); + +#if PHP_VERSION_ID < 70300 + fcc.initialized = 1; +#endif + fcc.object = obj; + fcc.called_scope = ce; + fcc.calling_scope = ce; + fcc.function_handler = ctor; - if (separated) { - zephir_update_property_zval(object, property_name, property_length, tmp TSRMLS_CC); + return zend_fcall_info_call(&fci, &fcc, NULL, NULL); } } @@ -1677,59 +1182,68 @@ int zephir_property_decr(zval *object, char *property_name, unsigned int propert } /** - * Fetches a property using a const char + * Creates a new instance dynamically calling constructor with parameters */ -int zephir_fetch_property(zval **result, zval *object, const char *property_name, zend_uint property_length, int silent TSRMLS_DC) { +int zephir_create_instance_params(zval *return_value, const zval *class_name, zval *params) +{ + zend_class_entry *ce; - if (zephir_isset_property(object, property_name, property_length + 1 TSRMLS_CC)) { - zephir_read_property(result, object, property_name, property_length, 0 TSRMLS_CC); - return 1; + if (Z_TYPE_P(class_name) != IS_STRING) { + zephir_throw_exception_string(spl_ce_RuntimeException, SL("Invalid class name")); + return FAILURE; } - *result = ZEPHIR_GLOBAL(global_null); - Z_ADDREF_P(*result); - return 0; -} - -/** - * Fetches a property using a zval property - */ -int zephir_fetch_property_zval(zval **result, zval *object, zval *property, int silent TSRMLS_DC) { - - if (UNEXPECTED(Z_TYPE_P(property) != IS_STRING)) { - *result = ZEPHIR_GLOBAL(global_null); - Z_ADDREF_P(*result); - return 0; + if (Z_TYPE_P(params) != IS_ARRAY) { + zephir_throw_exception_string(spl_ce_RuntimeException, SL("Instantiation parameters must be an array")); + return FAILURE; } - if (zephir_isset_property(object, Z_STRVAL_P(property), Z_STRLEN_P(property) + 1 TSRMLS_CC)) { - zephir_read_property(result, object, Z_STRVAL_P(property), Z_STRLEN_P(property), 0 TSRMLS_CC); - return 1; + ce = zend_fetch_class(Z_STR_P(class_name), ZEND_FETCH_CLASS_AUTO); + if (!ce) { + ZVAL_NULL(return_value); + return FAILURE; } - *result = ZEPHIR_GLOBAL(global_null); - Z_ADDREF_P(*result); - return 0; -} + if(UNEXPECTED(object_init_ex(return_value, ce) != SUCCESS)) { + return FAILURE; + } -/** - * Creates a closure - */ -int zephir_create_closure_ex(zval *return_value, zval *this_ptr, zend_class_entry *ce, const char *method_name, zend_uint method_length TSRMLS_DC) { + if (EXPECTED(Z_OBJ_HT_P(return_value)->get_constructor)) { + zend_object* obj = Z_OBJ_P(return_value); + zend_function* ctor = Z_OBJ_HT_P(return_value)->get_constructor(obj); + if (ctor) { + int status; + zend_fcall_info fci; + zend_fcall_info_cache fcc; - zend_function *function_ptr; + zend_class_entry* ce = Z_OBJCE_P(return_value); - if (zend_hash_find(&ce->function_table, method_name, method_length, (void**) &function_ptr) == FAILURE) { - ZVAL_NULL(return_value); - return FAILURE; + fci.size = sizeof(fci); +#if PHP_VERSION_ID < 70100 + fci.function_table = &ce->function_table; + fci.symbol_table = NULL; +#endif + fci.object = obj; + fci.retval = 0; + fci.param_count = 0; + fci.params = 0; + fci.no_separation = 1; + ZVAL_NULL(&fci.function_name); + +#if PHP_VERSION_ID < 70300 + fcc.initialized = 1; +#endif + fcc.object = obj; + fcc.called_scope = ce; + fcc.calling_scope = ce; + fcc.function_handler = ctor; + + zend_fcall_info_args_ex(&fci, fcc.function_handler, params); + status = zend_fcall_info_call(&fci, &fcc, NULL, NULL); + zend_fcall_info_args_clear(&fci, 1); + return status; + } } - zend_create_closure(return_value, function_ptr, ce, this_ptr TSRMLS_CC); return SUCCESS; } - -void zephir_free_object_storage(void *object TSRMLS_DC) -{ - zend_object_std_dtor((zend_object*)object TSRMLS_CC); - efree(object); -} diff --git a/ext/kernel/object.h b/ext/kernel/object.h index b69ba702470..aa5ccb141df 100644 --- a/ext/kernel/object.h +++ b/ext/kernel/object.h @@ -28,172 +28,75 @@ #include "kernel/main.h" /** Class Retrieving/Checking */ -int zephir_class_exists(const zval *class_name, int autoload TSRMLS_DC); -int zephir_interface_exists(const zval *interface_name, int autoload TSRMLS_DC); -void zephir_get_class(zval *result, zval *object, int lower TSRMLS_DC); -void zephir_get_class_ns(zval *result, zval *object, int lower TSRMLS_DC); -void zephir_get_ns_class(zval *result, zval *object, int lower TSRMLS_DC); -void zephir_get_called_class(zval *return_value TSRMLS_DC); -zend_class_entry *zephir_fetch_class(const zval *class_name TSRMLS_DC); -zend_class_entry* zephir_fetch_self_class(TSRMLS_D); -zend_class_entry* zephir_fetch_parent_class(TSRMLS_D); -zend_class_entry* zephir_fetch_static_class(TSRMLS_D); - -#define ZEPHIR_GET_CLASS_CONSTANT(return_value, ce, const_name) \ - do { \ - if (FAILURE == zephir_get_class_constant(return_value, ce, const_name, strlen(const_name)+1 TSRMLS_CC)) { \ - ZEPHIR_MM_RESTORE(); \ - return; \ - } \ - } while (0) - -/** Class constants */ -int zephir_get_class_constant(zval *return_value, zend_class_entry *ce, char *constant_name, unsigned int constant_length TSRMLS_DC); - -/** Cloning/Instance of*/ -int zephir_clone(zval *destiny, zval *obj TSRMLS_DC); -int zephir_instance_of(zval *result, const zval *object, const zend_class_entry *ce TSRMLS_DC); -int zephir_is_instance_of(zval *object, const char *class_name, unsigned int class_length TSRMLS_DC); -int zephir_instance_of_ev(const zval *object, const zend_class_entry *ce TSRMLS_DC); -int zephir_zval_is_traversable(zval *object TSRMLS_DC); +int zephir_class_exists(zval *class_name, int autoload); +int zephir_interface_exists(zval *interface_name, int autoload); +void zephir_get_called_class(zval *return_value); +zend_class_entry *zephir_fetch_class(zval *class_name); +zend_class_entry *zephir_fetch_class_str_ex(const char *class_name, size_t length, int fetch_type); +void zephir_get_class(zval *result, zval *object, int lower); +void zephir_get_class_ns(zval *result, zval *object, int lower); +void zephir_get_ns_class(zval *result, zval *object, int lower); + +/** Cloning/Instance of */ +int zephir_clone(zval *destination, zval *obj); +int zephir_is_instance_of(zval *object, const char *class_name, unsigned int class_length); +int zephir_instance_of_ev(zval *object, const zend_class_entry *ce); +int zephir_zval_is_traversable(zval *object); /** Method exists */ -int zephir_method_exists(const zval *object, const zval *method_name TSRMLS_DC); -int zephir_method_exists_ex(const zval *object, const char *method_name, unsigned int method_len TSRMLS_DC); -int zephir_method_quick_exists_ex(const zval *object, const char *method_name, unsigned int method_len, unsigned long hash TSRMLS_DC); +int zephir_method_exists(zval *object, const zval *method_name); /** Isset properties */ -int zephir_isset_property(zval *object, const char *property_name, unsigned int property_length TSRMLS_DC); -int zephir_isset_property_quick(zval *object, const char *property_name, unsigned int property_length, unsigned long hash TSRMLS_DC); -int zephir_isset_property_zval(zval *object, const zval *property TSRMLS_DC); +int zephir_isset_property(zval *object, const char *property_name, unsigned int property_length); +int zephir_isset_property_zval(zval *object, const zval *property); /** Reading properties */ -zval* zephir_fetch_property_this_quick(zval *object, const char *property_name, zend_uint property_length, ulong key, int silent TSRMLS_DC); -int zephir_read_property(zval **result, zval *object, const char *property_name, zend_uint property_length, int silent TSRMLS_DC); -int zephir_read_property_zval(zval **result, zval *object, zval *property, int silent TSRMLS_DC); -int zephir_return_property(zval *return_value, zval **return_value_ptr, zval *object, char *property_name, unsigned int property_length TSRMLS_DC); -int zephir_return_property_quick(zval *return_value, zval **return_value_ptr, zval *object, char *property_name, unsigned int property_length, unsigned long key TSRMLS_DC); -int zephir_fetch_property(zval **result, zval *object, const char *property_name, zend_uint property_length, int silent TSRMLS_DC); -int zephir_fetch_property_zval(zval **result, zval *object, zval *property, int silent TSRMLS_DC); +int zephir_read_property(zval *result, zval *object, const char *property_name, zend_uint property_length, int silent); +int zephir_read_property_zval(zval *result, zval *object, zval *property, int silent); +int zephir_return_property(zval *return_value, zval *object, char *property_name, unsigned int property_length); +int zephir_fetch_property(zval *result, zval *object, const char *property_name, zend_uint property_length, int silent); +int zephir_fetch_property_zval(zval *result, zval *object, zval *property, int silent); /** Updating properties */ -int zephir_update_property_this(zval *object, char *property_name, unsigned int property_length, zval *value TSRMLS_DC); -int zephir_update_property_long(zval *obj, char *property_name, unsigned int property_length, long value TSRMLS_DC); -int zephir_update_property_string(zval *object, char *property_name, unsigned int property_length, char *str, unsigned int str_length TSRMLS_DC); -int zephir_update_property_bool(zval *obj, char *property_name, unsigned int property_length, int value TSRMLS_DC); -int zephir_update_property_null(zval *obj, char *property_name, unsigned int property_length TSRMLS_DC); -int zephir_update_property_zval(zval *obj, const char *property_name, unsigned int property_length, zval *value TSRMLS_DC); -int zephir_update_property_zval_zval(zval *obj, zval *property, zval *value TSRMLS_DC); -int zephir_update_property_empty_array(zend_class_entry *ce, zval *object, char *property, unsigned int property_length TSRMLS_DC); +int zephir_update_property_zval(zval *obj, const char *property_name, unsigned int property_length, zval *value); +int zephir_update_property_zval_zval(zval *obj, zval *property, zval *value); /** Updating array properties */ -int zephir_update_property_array(zval *object, const char *property, zend_uint property_length, const zval *index, zval *value TSRMLS_DC); -int zephir_update_property_array_string(zval *object, char *property, unsigned int property_length, char *index, unsigned int index_length, zval *value TSRMLS_DC); -int zephir_update_property_array_append(zval *object, char *property, unsigned int property_length, zval *value TSRMLS_DC); -int zephir_update_property_array_multi(zval *object, const char *property, zend_uint property_length, zval **value TSRMLS_DC, const char *types, int types_length, int types_count, ...); - -/** Increment/Decrement properties */ -int zephir_property_incr(zval *object, char *property_name, unsigned int property_length TSRMLS_DC); -int zephir_property_decr(zval *object, char *property_name, unsigned int property_length TSRMLS_DC); +int zephir_update_property_array(zval *object, const char *property, zend_uint property_length, const zval *index, zval *value); +int zephir_update_property_array_string(zval *object, char *property, unsigned int property_length, char *index, unsigned int index_length, zval *value); +int zephir_update_property_array_append(zval *object, char *property, unsigned int property_length, zval *value); +int zephir_update_property_array_multi(zval *object, const char *property, zend_uint property_length, zval *value, const char *types, int types_length, int types_count, ...); /** Unset properties */ -int zephir_unset_property(zval* object, const char* name TSRMLS_DC); -int zephir_unset_property_array(zval *object, char *property, unsigned int property_length, zval *index TSRMLS_DC); +int zephir_unset_property(zval* object, const char* name); +int zephir_unset_property_array(zval *object, char *property, unsigned int property_length, zval *index); /** Static properties */ -int zephir_read_static_property(zval **result, const char *class_name, unsigned int class_length, char *property_name, unsigned int property_length TSRMLS_DC); -int zephir_update_static_property_ce(zend_class_entry *ce, const char *name, int len, zval **value TSRMLS_DC); -int zephir_update_static_property_ce_cache(zend_class_entry *ce, const char *name, int len, zval **value, zend_property_info **property_info TSRMLS_DC); -int zephir_update_static_property(const char *class_name, unsigned int class_length, char *name, unsigned int name_length, zval **value TSRMLS_DC); -int zephir_read_static_property_ce(zval **result, zend_class_entry *ce, const char *property, int len TSRMLS_DC); -int zephir_read_class_property(zval **result, int type, const char *property, int len TSRMLS_DC); -zval* zephir_fetch_static_property_ce(zend_class_entry *ce, const char *property, int len TSRMLS_DC); -int zephir_update_static_property_array_multi_ce(zend_class_entry *ce, const char *property, zend_uint property_length, zval **value TSRMLS_DC, const char *types, int types_length, int types_count, ...); - -/** Create instances */ -int zephir_create_instance(zval *return_value, const zval *class_name TSRMLS_DC); -int zephir_create_instance_params(zval *return_value, const zval *class_name, zval *params TSRMLS_DC); +int zephir_read_static_property_ce(zval *result, zend_class_entry *ce, const char *property, int len, int flags); +int zephir_update_static_property_array_multi_ce(zend_class_entry *ce, const char *property, zend_uint property_length, zval *value, const char *types, int types_length, int types_count, ...); /** Create closures */ -int zephir_create_closure_ex(zval *return_value, zval *this_ptr, zend_class_entry *ce, const char *method_name, zend_uint method_length TSRMLS_DC); - -void zephir_free_object_storage(void *object TSRMLS_DC); - -/** - * Reads a property from this_ptr (with pre-calculated key) - * Variables must be defined in the class definition. This function ignores magic methods or dynamic properties - */ -ZEPHIR_ATTR_NONNULL static inline int zephir_read_property_this_quick(zval **result, zval *object, const char *property_name, zend_uint property_length, ulong key, int silent TSRMLS_DC) -{ - zval *tmp = zephir_fetch_property_this_quick(object, property_name, property_length, key, silent TSRMLS_CC); - if (EXPECTED(tmp != NULL)) { - *result = tmp; - Z_ADDREF_PP(result); - return SUCCESS; - } - - ALLOC_INIT_ZVAL(*result); - return FAILURE; -} - -/** - * Reads a property from this_ptr - * Variables must be defined in the class definition. This function ignores magic methods or dynamic properties - */ -ZEPHIR_ATTR_NONNULL static inline int zephir_read_property_this(zval **result, zval *object, const char *property_name, zend_uint property_length, int silent TSRMLS_DC) -{ -#ifdef __GNUC__ - if (__builtin_constant_p(property_name) && __builtin_constant_p(property_length)) { - return zephir_read_property_this_quick(result, object, property_name, property_length, zend_inline_hash_func(property_name, property_length + 1), silent TSRMLS_CC); - } -#endif - - return zephir_read_property_this_quick(result, object, property_name, property_length, zend_hash_func(property_name, property_length + 1), silent TSRMLS_CC); -} - -ZEPHIR_ATTR_NONNULL static inline zval* zephir_fetch_nproperty_this_quick(zval *object, const char *property_name, zend_uint property_length, ulong key, int silent TSRMLS_DC) -{ -#ifdef __GNUC__ - if (__builtin_constant_p(property_name) && __builtin_constant_p(property_length)) { - zval *result = zephir_fetch_property_this_quick(object, property_name, property_length, key, silent TSRMLS_CC); - return result ? result : EG(uninitialized_zval_ptr); - } -#endif - - zval *result = zephir_fetch_property_this_quick(object, property_name, property_length, key, silent TSRMLS_CC); - return result ? result : EG(uninitialized_zval_ptr); -} +int zephir_create_closure_ex(zval *return_value, zval *this_ptr, zend_class_entry *ce, const char *method_name, zend_uint method_length); -ZEPHIR_ATTR_NONNULL static inline zval* zephir_fetch_nproperty_this(zval *object, const char *property_name, zend_uint property_length, int silent TSRMLS_DC) -{ -#ifdef __GNUC__ - if (__builtin_constant_p(property_name) && __builtin_constant_p(property_length)) { - return zephir_fetch_nproperty_this_quick(object, property_name, property_length, zend_inline_hash_func(property_name, property_length + 1), silent TSRMLS_CC); - } -#endif - - return zephir_fetch_nproperty_this_quick(object, property_name, property_length, zend_hash_func(property_name, property_length + 1), silent TSRMLS_CC); -} - -ZEPHIR_ATTR_NONNULL static inline zval* zephir_fetch_property_this(zval *object, const char *property_name, zend_uint property_length, int silent TSRMLS_DC) -{ -#ifdef __GNUC__ - if (__builtin_constant_p(property_name) && __builtin_constant_p(property_length)) { - return zephir_fetch_property_this_quick(object, property_name, property_length, zend_inline_hash_func(property_name, property_length + 1), silent TSRMLS_CC); - } -#endif - - return zephir_fetch_property_this_quick(object, property_name, property_length, zend_hash_func(property_name, property_length + 1), silent TSRMLS_CC); -} +/** Create instances */ +int zephir_create_instance(zval *return_value, const zval *class_name); +int zephir_create_instance_params(zval *return_value, const zval *class_name, zval *params); -#endif +/** Increment/Decrement properties */ +#define zephir_property_incr(object, property) zephir_property_incr_decr(object, property, 1) +#define zephir_property_decr(object, property) zephir_property_incr_decr(object, property, 0) +int zephir_property_incr_decr(zval *object, char *property_name, unsigned int property_length, unsigned int increment); -#define zephir_fetch_safe_class(destination, var) \ - { \ +#define zephir_fetch_safe_class(destination, var) { \ if (Z_TYPE_P(var) == IS_STRING) { \ ZEPHIR_CPY_WRT(destination, var); \ } else { \ ZEPHIR_INIT_NVAR(destination); \ - ZVAL_STRING(destination, "", 1); \ + ZVAL_STRING(destination, ""); \ } \ } + +/** Methods */ +int zephir_method_exists_ex(zval *object, const char *method_name, unsigned int method_len); + +#endif diff --git a/ext/kernel/operators.c b/ext/kernel/operators.c index 8260a9e8080..289bf6351fc 100644 --- a/ext/kernel/operators.c +++ b/ext/kernel/operators.c @@ -34,46 +34,25 @@ #include "Zend/zend_operators.h" -void zephir_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy){ - zend_make_printable_zval(expr, expr_copy, use_copy); - if (use_copy) { - Z_SET_REFCOUNT_P(expr_copy, 1); - Z_UNSET_ISREF_P(expr_copy); - } -} - -/** - * Performs logical AND function operator - */ -int zephir_and_function(zval *result, zval *left, zval *right){ - int istrue = zend_is_true(left) && zend_is_true(right); - ZVAL_BOOL(result, istrue); - return SUCCESS; -} - /** * Appends the content of the right operator to the left operator */ -void zephir_concat_self(zval **left, zval *right TSRMLS_DC){ - +void zephir_concat_self(zval *left, zval *right) +{ zval left_copy, right_copy; - uint length; + uint length, left_length, right_length; int use_copy_left = 0, use_copy_right = 0; + zend_string *target; if (Z_TYPE_P(right) != IS_STRING) { - zephir_make_printable_zval(right, &right_copy, &use_copy_right); + use_copy_right = zephir_make_printable_zval(right, &right_copy); if (use_copy_right) { right = &right_copy; } } - if (Z_TYPE_PP(left) == IS_NULL) { - - Z_STRVAL_PP(left) = emalloc(Z_STRLEN_P(right) + 1); - memcpy(Z_STRVAL_PP(left), Z_STRVAL_P(right), Z_STRLEN_P(right)); - Z_STRVAL_PP(left)[Z_STRLEN_P(right)] = 0; - Z_STRLEN_PP(left) = Z_STRLEN_P(right); - Z_TYPE_PP(left) = IS_STRING; + if (Z_TYPE_P(left) == IS_NULL) { + ZVAL_STRINGL(left, Z_STRVAL_P(right), Z_STRLEN_P(right)); if (use_copy_right) { zval_dtor(&right_copy); @@ -82,22 +61,23 @@ void zephir_concat_self(zval **left, zval *right TSRMLS_DC){ return; } - if (Z_TYPE_PP(left) != IS_STRING) { - zephir_make_printable_zval(*left, &left_copy, &use_copy_left); + if (Z_TYPE_P(left) != IS_STRING) { + use_copy_left = zephir_make_printable_zval(left, &left_copy); if (use_copy_left) { - ZEPHIR_CPY_WRT_CTOR(*left, (&left_copy)); + ZEPHIR_CPY_WRT_CTOR(left, (&left_copy)); } } SEPARATE_ZVAL_IF_NOT_REF(left); - length = Z_STRLEN_PP(left) + Z_STRLEN_P(right); - Z_STRVAL_PP(left) = str_erealloc(Z_STRVAL_PP(left), length + 1); + left_length = Z_STRLEN_P(left); + right_length = Z_STRLEN_P(right); + length = left_length + right_length; + target = zend_string_extend(Z_STR_P(left), length, 0); + ZVAL_NEW_STR(left, target); + memcpy(ZSTR_VAL(target) + left_length, Z_STRVAL_P(right), right_length); - memcpy(Z_STRVAL_PP(left) + Z_STRLEN_PP(left), Z_STRVAL_P(right), Z_STRLEN_P(right)); - Z_STRVAL_PP(left)[length] = 0; - Z_STRLEN_PP(left) = length; - Z_TYPE_PP(left) = IS_STRING; + ZSTR_VAL(target)[length] = '\0'; if (use_copy_left) { zval_dtor(&left_copy); @@ -111,39 +91,34 @@ void zephir_concat_self(zval **left, zval *right TSRMLS_DC){ /** * Appends the content of the right operator to the left operator */ -void zephir_concat_self_str(zval **left, const char *right, int right_length TSRMLS_DC){ - +void zephir_concat_self_char(zval *left, unsigned char right) +{ zval left_copy; - uint length; - int use_copy = 0; - - if (Z_TYPE_PP(left) == IS_NULL) { - - Z_STRVAL_PP(left) = emalloc(right_length + 1); - memcpy(Z_STRVAL_PP(left), right, right_length); - Z_STRVAL_PP(left)[right_length] = 0; - Z_STRLEN_PP(left) = right_length; - Z_TYPE_PP(left) = IS_STRING; - + int use_copy = 0, length; + zend_string *target; + + if (Z_TYPE_P(left) == IS_NULL) { + target = zend_string_alloc(1, 0); + ZSTR_VAL(target)[0] = right; + ZSTR_VAL(target)[1] = 0; + ZVAL_STR(left, target);; return; } - if (Z_TYPE_PP(left) != IS_STRING) { - zephir_make_printable_zval(*left, &left_copy, &use_copy); + if (Z_TYPE_P(left) != IS_STRING) { + use_copy = zephir_make_printable_zval(left, &left_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*left, (&left_copy)); + ZEPHIR_CPY_WRT_CTOR(left, (&left_copy)); } } SEPARATE_ZVAL_IF_NOT_REF(left); - length = Z_STRLEN_PP(left) + right_length; - Z_STRVAL_PP(left) = str_erealloc(Z_STRVAL_PP(left), length + 1); - - memcpy(Z_STRVAL_PP(left) + Z_STRLEN_PP(left), right, right_length); - Z_STRVAL_PP(left)[length] = 0; - Z_STRLEN_PP(left) = length; - Z_TYPE_PP(left) = IS_STRING; + length = Z_STRLEN_P(left) + 1; + target = zend_string_extend(Z_STR_P(left), length, 0); + ZVAL_NEW_STR(left, target); + ZSTR_VAL(target)[length - 1] = right; + ZSTR_VAL(target)[length] = 0; if (use_copy) { zval_dtor(&left_copy); @@ -153,126 +128,43 @@ void zephir_concat_self_str(zval **left, const char *right, int right_length TSR /** * Appends the content of the right operator to the left operator */ -void zephir_concat_self_long(zval **left, const long right TSRMLS_DC) { - - zval left_copy; - uint length; - char *right_char; - int use_copy = 0, right_length = 0; - - right_length = zephir_spprintf(&right_char, 0, "%ld", right); - - if (Z_TYPE_PP(left) == IS_NULL) { - Z_STRVAL_PP(left) = emalloc(right_length + 1); - if (right_length > 0) { - memcpy(Z_STRVAL_PP(left), right_char, right_length); - } else { - memcpy(Z_STRVAL_PP(left), "", 0); - } - Z_STRVAL_PP(left)[right_length] = 0; - Z_STRLEN_PP(left) = right_length; - Z_TYPE_PP(left) = IS_STRING; - return; - } - - if (Z_TYPE_PP(left) != IS_STRING) { - zephir_make_printable_zval(*left, &left_copy, &use_copy); - if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*left, (&left_copy)); - } - } - - if (right_length > 0) { - - SEPARATE_ZVAL_IF_NOT_REF(left); - - length = Z_STRLEN_PP(left) + right_length; - Z_STRVAL_PP(left) = str_erealloc(Z_STRVAL_PP(left), length + 1); - memcpy(Z_STRVAL_PP(left) + Z_STRLEN_PP(left), right_char, right_length); - Z_STRVAL_PP(left)[length] = 0; - Z_STRLEN_PP(left) = length; - Z_TYPE_PP(left) = IS_STRING; - } - - if (use_copy) { - zval_dtor(&left_copy); - } -} - -/** - * Appends the content of the right operator to the left operator - */ -void zephir_concat_self_char(zval **left, unsigned char right TSRMLS_DC) { - +void zephir_concat_self_str(zval *left, const char *right, int right_length) +{ zval left_copy; + uint length, left_length; int use_copy = 0; + zend_string *target; - if (Z_TYPE_PP(left) == IS_NULL) { - Z_STRVAL_PP(left) = emalloc(2); - Z_STRVAL_PP(left)[0] = right; - Z_STRVAL_PP(left)[1] = 0; - Z_STRLEN_PP(left) = 1; - Z_TYPE_PP(left) = IS_STRING; + if (Z_TYPE_P(left) == IS_NULL) { + ZVAL_STRINGL(left, right, right_length); return; } - if (Z_TYPE_PP(left) != IS_STRING) { - zephir_make_printable_zval(*left, &left_copy, &use_copy); + if (Z_TYPE_P(left) != IS_STRING) { + use_copy = zephir_make_printable_zval(left, &left_copy); if (use_copy) { - ZEPHIR_CPY_WRT_CTOR(*left, (&left_copy)); + ZEPHIR_CPY_WRT_CTOR(left, (&left_copy)); } } SEPARATE_ZVAL_IF_NOT_REF(left); - - Z_STRLEN_PP(left)++; - Z_STRVAL_PP(left) = str_erealloc(Z_STRVAL_PP(left), Z_STRLEN_PP(left) + 1); - Z_STRVAL_PP(left)[Z_STRLEN_PP(left) - 1] = right; - Z_STRVAL_PP(left)[Z_STRLEN_PP(left)] = 0; - Z_TYPE_PP(left) = IS_STRING; + left_length = Z_STRLEN_P(left); + length = left_length + right_length; + target = zend_string_extend(Z_STR_P(left), length, 0); + ZVAL_NEW_STR(left, target); + memcpy(ZSTR_VAL(target) + left_length, right, right_length); + ZSTR_VAL(target)[length] = '\0'; if (use_copy) { zval_dtor(&left_copy); } } -/** - * Natural compare with string operandus on right - */ -int zephir_compare_strict_string(zval *op1, const char *op2, int op2_length) { - - switch (Z_TYPE_P(op1)) { - - case IS_STRING: - if (!Z_STRLEN_P(op1) && !op2_length) { - return 1; - } - if (Z_STRLEN_P(op1) != op2_length) { - return 0; - } - return !zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), op2, op2_length); - - case IS_NULL: - return !zend_binary_strcmp("", 0, op2, op2_length); - - case IS_BOOL: - if (!Z_BVAL_P(op1)) { - return !zend_binary_strcmp("0", strlen("0"), op2, op2_length); - } else { - return !zend_binary_strcmp("1", strlen("1"), op2, op2_length); - } - } - - return 0; -} - /** * Natural compare with long operandus on right */ -int zephir_compare_strict_long(zval *op1, long op2 TSRMLS_DC) { - - int bool_result; - +int zephir_compare_strict_long(zval *op1, long op2) +{ switch (Z_TYPE_P(op1)) { case IS_LONG: return Z_LVAL_P(op1) == op2; @@ -280,8 +172,9 @@ int zephir_compare_strict_long(zval *op1, long op2 TSRMLS_DC) { return Z_DVAL_P(op1) == (double) op2; case IS_NULL: return 0 == op2; - case IS_BOOL: - if (Z_BVAL_P(op1)) { + case IS_TRUE: + case IS_FALSE: + if (Z_TYPE_P(op1) == IS_TRUE) { return 1 == op2; } else { return 0 == op2; @@ -290,9 +183,8 @@ int zephir_compare_strict_long(zval *op1, long op2 TSRMLS_DC) { { zval result, op2_tmp; ZVAL_LONG(&op2_tmp, op2); - is_equal_function(&result, op1, &op2_tmp TSRMLS_CC); - bool_result = Z_BVAL(result); - return bool_result; + is_equal_function(&result, op1, &op2_tmp); + return Z_TYPE(result) == IS_TRUE ? 1 : 0; } } @@ -300,32 +192,27 @@ int zephir_compare_strict_long(zval *op1, long op2 TSRMLS_DC) { } /** - * Natural compare with double operandus on right + * Natural compare with bool operandus on right */ -int zephir_compare_strict_double(zval *op1, double op2 TSRMLS_DC) { - - int bool_result; - +int zephir_compare_strict_bool(zval *op1, zend_bool op2) +{ switch (Z_TYPE_P(op1)) { case IS_LONG: - return Z_LVAL_P(op1) == (long) op2; + return (Z_LVAL_P(op1) ? 1 : 0) == op2; case IS_DOUBLE: - return Z_DVAL_P(op1) == op2; + return (Z_DVAL_P(op1) ? 1 : 0) == op2; case IS_NULL: return 0 == op2; - case IS_BOOL: - if (Z_BVAL_P(op1)) { - return 1 == op2; - } else { - return 0 == op2; - } + case IS_TRUE: + return 1 == op2; + case IS_FALSE: + return 0 == op2; default: { zval result, op2_tmp; - ZVAL_DOUBLE(&op2_tmp, op2); - is_equal_function(&result, op1, &op2_tmp TSRMLS_CC); - bool_result = Z_BVAL(result); - return bool_result; + ZVAL_BOOL(&op2_tmp, op2); + is_equal_function(&result, op1, &op2_tmp); + return Z_TYPE(result) == IS_TRUE; } } @@ -333,118 +220,79 @@ int zephir_compare_strict_double(zval *op1, double op2 TSRMLS_DC) { } /** - * Natural compare with bool operandus on right + * Natural compare with string operandus on right */ -int zephir_compare_strict_bool(zval *op1, zend_bool op2 TSRMLS_DC) { - - int bool_result; - +int zephir_compare_strict_string(zval *op1, const char *op2, int op2_length) +{ switch (Z_TYPE_P(op1)) { - case IS_LONG: - return (Z_LVAL_P(op1) ? 1 : 0) == op2; - case IS_DOUBLE: - return (Z_DVAL_P(op1) ? 1 : 0) == op2; - case IS_NULL: - return 0 == op2; - case IS_BOOL: - if (Z_BVAL_P(op1)) { - return 1 == op2; - } else { - return 0 == op2; + + case IS_STRING: + if (!Z_STRLEN_P(op1) && !op2_length) { + return 1; } - default: - { - zval result, op2_tmp; - ZVAL_BOOL(&op2_tmp, op2); - is_equal_function(&result, op1, &op2_tmp TSRMLS_CC); - bool_result = Z_BVAL(result); - return bool_result; + if (Z_STRLEN_P(op1) != op2_length) { + return 0; } - } + return !zend_binary_strcmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), op2, op2_length); - return 0; -} + case IS_NULL: + return !zend_binary_strcmp("", 0, op2, op2_length); -/** - * Do add function keeping ref_count and is_ref - */ -int zephir_add_function_ex(zval *result, zval *op1, zval *op2 TSRMLS_DC) { - int status; - int ref_count = Z_REFCOUNT_P(result); - int is_ref = Z_ISREF_P(result); + case IS_TRUE: + return !zend_binary_strcmp("1", strlen("1"), op2, op2_length); - status = fast_add_function(result, op1, op2 TSRMLS_CC); - Z_SET_REFCOUNT_P(result, ref_count); - Z_SET_ISREF_TO_P(result, is_ref); - return status; + case IS_FALSE: + return !zend_binary_strcmp("0", strlen("0"), op2, op2_length); + } + + return 0; } -void zephir_negate(zval *z TSRMLS_DC) { +void zephir_negate(zval *z) +{ while (1) { switch (Z_TYPE_P(z)) { case IS_LONG: - case IS_BOOL: ZVAL_LONG(z, -Z_LVAL_P(z)); return; + case IS_TRUE: + ZVAL_LONG(z, -1); + return; + case IS_DOUBLE: ZVAL_DOUBLE(z, -Z_DVAL_P(z)); return; case IS_NULL: + case IS_FALSE: ZVAL_LONG(z, 0); return; default: - convert_scalar_to_number(z TSRMLS_CC); + convert_scalar_to_number(z); assert(Z_TYPE_P(z) == IS_LONG || Z_TYPE_P(z) == IS_DOUBLE); } } } -void zephir_convert_to_object(zval *op) { +void zephir_convert_to_object(zval *op) +{ convert_to_object(op); } -/** - * Cast variables converting they to other types - */ -void zephir_cast(zval *result, zval *var, zend_uint type){ - - ZVAL_ZVAL(result, var, 1, 0); - - switch (type) { - case IS_STRING: - convert_to_string(result); - break; - case IS_LONG: - convert_to_long(result); - break; - case IS_DOUBLE: - convert_to_double(result); - break; - /*case IS_BOOL: - convert_to_bool(result); - break;*/ - case IS_ARRAY: - if (Z_TYPE_P(result) != IS_ARRAY) { - convert_to_array(result); - } - break; - } - -} - /** * Returns the long value of a zval */ -long zephir_get_intval_ex(const zval *op) { - +long zephir_get_intval_ex(const zval *op) +{ switch (Z_TYPE_P(op)) { case IS_ARRAY: return zend_hash_num_elements(Z_ARRVAL_P(op)) ? 1 : 0; case IS_RESOURCE: + return (zend_long)Z_RES_HANDLE_P(op); + case IS_CALLABLE: case IS_OBJECT: return 1; @@ -452,16 +300,19 @@ long zephir_get_intval_ex(const zval *op) { case IS_LONG: return Z_LVAL_P(op); - case IS_BOOL: - return Z_BVAL_P(op); + case IS_TRUE: + return 1; + + case IS_FALSE: + return 0; case IS_DOUBLE: return (long) Z_DVAL_P(op); case IS_STRING: { - long long_value = 0; - double double_value = 0; zend_uchar type; + double double_value = 0; + zend_long long_value = 0; ASSUME(Z_STRVAL_P(op) != NULL); type = is_numeric_string(Z_STRVAL_P(op), Z_STRLEN_P(op), &long_value, &double_value, 0); @@ -478,8 +329,8 @@ long zephir_get_intval_ex(const zval *op) { return 0; } -long zephir_get_charval_ex(const zval *op) { - +long zephir_get_charval_ex(const zval *op) +{ switch (Z_TYPE_P(op)) { case IS_ARRAY: case IS_CALLABLE: @@ -490,8 +341,11 @@ long zephir_get_charval_ex(const zval *op) { case IS_LONG: return Z_LVAL_P(op); - case IS_BOOL: - return Z_BVAL_P(op); + case IS_TRUE: + return 1; + + case IS_FALSE: + return 0; case IS_DOUBLE: return (long) Z_DVAL_P(op); @@ -510,27 +364,34 @@ long zephir_get_charval_ex(const zval *op) { /** * Returns the long value of a zval */ -double zephir_get_doubleval_ex(const zval *op) { - +double zephir_get_doubleval_ex(const zval *op) +{ int type; - long long_value = 0; + zend_long long_value = 0; double double_value = 0; switch (Z_TYPE_P(op)) { + case IS_ARRAY: return zend_hash_num_elements(Z_ARRVAL_P(op)) ? (double) 1 : 0; - break; case IS_CALLABLE: case IS_RESOURCE: case IS_OBJECT: return (double) 1; + case IS_LONG: return (double) Z_LVAL_P(op); - case IS_BOOL: - return (double) Z_BVAL_P(op); + + case IS_TRUE: + return (double) 1; + + case IS_FALSE: + return (double) 0; + case IS_DOUBLE: return Z_DVAL_P(op); + case IS_STRING: if ((type = is_numeric_string(Z_STRVAL_P(op), Z_STRLEN_P(op), &long_value, &double_value, 0))) { if (type == IS_LONG) { @@ -551,24 +412,30 @@ double zephir_get_doubleval_ex(const zval *op) { /** * Returns the long value of a zval */ -zend_bool zephir_get_boolval_ex(zval *op) { +zend_bool zephir_get_boolval_ex(zval *op) +{ return (zend_bool) zend_is_true(op); } /** * Returns the long value of a zval */ -int zephir_is_numeric_ex(const zval *op) { - +int zephir_is_numeric_ex(const zval *op) +{ int type; switch (Z_TYPE_P(op)) { + case IS_LONG: return 1; - case IS_BOOL: + + case IS_TRUE: + case IS_FALSE: return 0; + case IS_DOUBLE: return 1; + case IS_STRING: if ((type = is_numeric_string(Z_STRVAL_P(op), Z_STRLEN_P(op), NULL, NULL, 0))) { if (type == IS_LONG || type == IS_DOUBLE) { @@ -583,186 +450,161 @@ int zephir_is_numeric_ex(const zval *op) { /** * Check if two zvals are equal */ -int zephir_is_equal(zval *op1, zval *op2 TSRMLS_DC) { +int zephir_is_equal(zval *op1, zval *op2) +{ zval result; - return fast_equal_function(&result, op1, op2 TSRMLS_CC); + + is_equal_function(&result, op1, op2); + return Z_TYPE(result) == IS_TRUE; } /** * Check if a zval is less than other */ -int zephir_less(zval *op1, zval *op2 TSRMLS_DC) { +int zephir_less(zval *op1, zval *op2) +{ zval result; - return fast_is_smaller_function(&result, op1, op2 TSRMLS_CC); + is_smaller_function(&result, op1, op2); + return Z_TYPE(result) == IS_TRUE; } /** - * Check if a zval is less/equal than other + * Check if a zval is greater than other */ -int zephir_less_equal(zval *op1, zval *op2 TSRMLS_DC) { +int zephir_greater(zval *op1, zval *op2) +{ zval result; - is_smaller_or_equal_function(&result, op1, op2 TSRMLS_CC); - return Z_BVAL(result); + is_smaller_or_equal_function(&result, op1, op2); + return Z_TYPE(result) == IS_FALSE; } /** - * Check if a zval is less than a long value + * Check if two zvals are identical */ -int zephir_less_long(zval *op1, long op2 TSRMLS_DC) { - zval result, op2_zval; - ZVAL_LONG(&op2_zval, op2); - - is_smaller_function(&result, op1, &op2_zval TSRMLS_CC); - return Z_BVAL(result); +int zephir_is_identical(zval *op1, zval *op2) +{ + zval result; + is_identical_function(&result, op1, op2); + return Z_TYPE(result) == IS_TRUE; } /** - * Check if a zval is less than a double value + * Do bitwise_and function */ -int zephir_less_double(zval *op1, double op2 TSRMLS_DC) { - zval result, op2_zval; - ZVAL_DOUBLE(&op2_zval, op2); - - is_smaller_function(&result, op1, &op2_zval TSRMLS_CC); - return Z_BVAL(result); +int zephir_bitwise_and_function(zval *result, zval *op1, zval *op2) +{ + int status; + status = bitwise_and_function(result, op1, op2); + return status; } -int zephir_less_equal_long(zval *op1, long op2 TSRMLS_DC) { - zval result, op2_zval; - ZVAL_LONG(&op2_zval, op2); +/** + * Do bitwise_or function + */ +int zephir_bitwise_or_function(zval *result, zval *op1, zval *op2) +{ + int status; + status = bitwise_or_function(result, op1, op2); + return status; +} - is_smaller_or_equal_function(&result, op1, &op2_zval TSRMLS_CC); - return Z_BVAL(result); +/** + * Do bitwise_xor function + */ +int zephir_bitwise_xor_function(zval *result, zval *op1, zval *op2) +{ + int status; + status = bitwise_xor_function(result, op1, op2); + return status; } /** - * Check if a zval is greater than other + * Check if a zval is less/equal than other */ -int zephir_greater(zval *op1, zval *op2 TSRMLS_DC) { +int zephir_less_equal(zval *op1, zval *op2) +{ zval result; - is_smaller_or_equal_function(&result, op1, op2 TSRMLS_CC); - return !Z_BVAL(result); + is_smaller_or_equal_function(&result, op1, op2); + return Z_TYPE(result) == IS_TRUE; } /** - * Check if a zval is greater than a long value + * Check if a zval is less than a long value */ -int zephir_greater_long(zval *op1, long op2 TSRMLS_DC) { +int zephir_less_long(zval *op1, long op2) +{ zval result, op2_zval; ZVAL_LONG(&op2_zval, op2); - is_smaller_or_equal_function(&result, op1, &op2_zval TSRMLS_CC); - return !Z_BVAL(result); + is_smaller_function(&result, op1, &op2_zval); + return Z_TYPE(result) == IS_TRUE; } -/** - * Check if a zval is greater than a double value - */ -int zephir_greater_double(zval *op1, double op2 TSRMLS_DC) { +int zephir_less_double(zval *op1, double op2) +{ zval result, op2_zval; ZVAL_DOUBLE(&op2_zval, op2); - is_smaller_or_equal_function(&result, op1, &op2_zval TSRMLS_CC); - return !Z_BVAL(result); + is_smaller_function(&result, op1, &op2_zval); + return Z_TYPE(result) == IS_TRUE; } -/** - * Check if a zval is greater/equal than other - */ -int zephir_greater_equal(zval *op1, zval *op2 TSRMLS_DC) { - zval result; - is_smaller_function(&result, op1, op2 TSRMLS_CC); - return !Z_BVAL(result); -} - -/** - * Check for greater/equal - */ -int zephir_greater_equal_long(zval *op1, long op2 TSRMLS_DC) { +int zephir_less_equal_long(zval *op1, long op2) +{ zval result, op2_zval; ZVAL_LONG(&op2_zval, op2); - is_smaller_function(&result, op1, &op2_zval TSRMLS_CC); - return !Z_BVAL(result); -} -/** - * Check if two zvals are identical - */ -int zephir_is_identical(zval *op1, zval *op2 TSRMLS_DC) { - zval result; - is_identical_function(&result, op1, op2 TSRMLS_CC); - return Z_BVAL(result); + is_smaller_or_equal_function(&result, op1, &op2_zval); + return Z_TYPE(result) == IS_TRUE; } /** - * Do bitwise_and function keeping ref_count and is_ref + * Check if a zval is greater than a long value */ -int zephir_bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC){ - int status; - int ref_count = Z_REFCOUNT_P(result); - int is_ref = Z_ISREF_P(result); - status = bitwise_and_function(result, op1, op2 TSRMLS_CC); - Z_SET_REFCOUNT_P(result, ref_count); - Z_SET_ISREF_TO_P(result, is_ref); - return status; -} +int zephir_greater_long(zval *op1, long op2) +{ + zval result, op2_zval; + ZVAL_LONG(&op2_zval, op2); -/** - * Do bitwise_or function keeping ref_count and is_ref - */ -int zephir_bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC){ - int status; - int ref_count = Z_REFCOUNT_P(result); - int is_ref = Z_ISREF_P(result); - status = bitwise_or_function(result, op1, op2 TSRMLS_CC); - Z_SET_REFCOUNT_P(result, ref_count); - Z_SET_ISREF_TO_P(result, is_ref); - return status; + is_smaller_or_equal_function(&result, op1, &op2_zval); + return Z_TYPE(result) == IS_FALSE; } -/** - * Do bitwise_xor function keeping ref_count and is_ref - */ -int zephir_bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC){ - int status; - int ref_count = Z_REFCOUNT_P(result); - int is_ref = Z_ISREF_P(result); - status = bitwise_xor_function(result, op1, op2 TSRMLS_CC); - Z_SET_REFCOUNT_P(result, ref_count); - Z_SET_ISREF_TO_P(result, is_ref); - return status; +int zephir_greater_double(zval *op1, double op2) +{ + zval result, op2_zval; + ZVAL_DOUBLE(&op2_zval, op2); + + is_smaller_or_equal_function(&result, op1, &op2_zval); + return Z_TYPE(result) == IS_FALSE; } /** - * Do shiftleft function keeping ref_count and is_ref + * Check if a zval is greater/equal than other */ -int zephir_shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC){ - int status; - int ref_count = Z_REFCOUNT_P(result); - int is_ref = Z_ISREF_P(result); - status = shift_left_function(result, op1, op2 TSRMLS_CC); - Z_SET_REFCOUNT_P(result, ref_count); - Z_SET_ISREF_TO_P(result, is_ref); - return status; +int zephir_greater_equal(zval *op1, zval *op2) +{ + zval result; + is_smaller_function(&result, op1, op2); + return Z_TYPE(result) == IS_FALSE; } /** - * Do shiftright function keeping ref_count and is_ref + * Check for greater/equal */ -int zephir_shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC){ - int status; - int ref_count = Z_REFCOUNT_P(result); - int is_ref = Z_ISREF_P(result); - status = shift_right_function(result, op1, op2 TSRMLS_CC); - Z_SET_REFCOUNT_P(result, ref_count); - Z_SET_ISREF_TO_P(result, is_ref); - return status; +int zephir_greater_equal_long(zval *op1, long op2) +{ + zval result, op2_zval; + ZVAL_LONG(&op2_zval, op2); + is_smaller_function(&result, op1, &op2_zval); + return Z_TYPE(result) == IS_FALSE; } /** * Do safe divisions between two longs */ -double zephir_safe_div_long_long(long op1, long op2 TSRMLS_DC) { +double zephir_safe_div_long_long(long op1, long op2) +{ if (!op2) { zend_error(E_WARNING, "Division by zero"); return 0; @@ -773,7 +615,8 @@ double zephir_safe_div_long_long(long op1, long op2 TSRMLS_DC) { /** * Do safe divisions between two long/double */ -double zephir_safe_div_long_double(long op1, double op2 TSRMLS_DC) { +double zephir_safe_div_long_double(long op1, double op2) +{ if (!op2) { zend_error(E_WARNING, "Division by zero"); return 0; @@ -782,49 +625,53 @@ double zephir_safe_div_long_double(long op1, double op2 TSRMLS_DC) { } /** - * Do safe divisions between two double/long + * Do safe divisions between two double/zval */ -double zephir_safe_div_double_long(double op1, long op2 TSRMLS_DC) { - if (!op2) { +double zephir_safe_div_double_zval(double op1, zval *op2) +{ + if (!zephir_get_numberval(op2)) { zend_error(E_WARNING, "Division by zero"); return 0; } - return op1 / (double) op2; + switch (Z_TYPE_P(op2)) { + case IS_ARRAY: + case IS_OBJECT: + case IS_RESOURCE: + zend_error(E_WARNING, "Unsupported operand types"); + break; + } + return op1 / ((double) zephir_get_numberval(op2)); } /** - * Do safe divisions between two doubles + * Do safe divisions between two double/long */ -double zephir_safe_div_double_double(double op1, double op2 TSRMLS_DC) { +double zephir_safe_div_double_long(double op1, long op2) +{ if (!op2) { zend_error(E_WARNING, "Division by zero"); return 0; } - return op1 / op2; + return op1 / (double) op2; } /** - * Do safe divisions between two zval/long + * Do safe divisions between two doubles */ -double zephir_safe_div_zval_long(zval *op1, long op2 TSRMLS_DC) { +double zephir_safe_div_double_double(double op1, double op2) +{ if (!op2) { zend_error(E_WARNING, "Division by zero"); return 0; } - switch (Z_TYPE_P(op1)) { - case IS_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - zend_error(E_WARNING, "Unsupported operand types"); - break; - } - return ((double) zephir_get_numberval(op1)) / (double) op2; + return op1 / op2; } /** - * Do safe divisions between two zval/double + * Do safe divisions between two zval/long */ -double zephir_safe_div_zval_double(zval *op1, double op2 TSRMLS_DC) { +double zephir_safe_div_zval_long(zval *op1, long op2) +{ if (!op2) { zend_error(E_WARNING, "Division by zero"); return 0; @@ -836,13 +683,14 @@ double zephir_safe_div_zval_double(zval *op1, double op2 TSRMLS_DC) { zend_error(E_WARNING, "Unsupported operand types"); break; } - return ((double) zephir_get_numberval(op1)) / op2; + return ((double) zephir_get_numberval(op1)) / (double) op2; } /** * Do safe divisions between two long/zval */ -double zephir_safe_div_long_zval(long op1, zval *op2 TSRMLS_DC) { +double zephir_safe_div_long_zval(long op1, zval *op2) +{ if (!zephir_get_numberval(op2)) { zend_error(E_WARNING, "Division by zero"); return 0; @@ -858,27 +706,29 @@ double zephir_safe_div_long_zval(long op1, zval *op2 TSRMLS_DC) { } /** - * Do safe divisions between two double/zval + * Do safe divisions between two zval/double */ -double zephir_safe_div_double_zval(double op1, zval *op2 TSRMLS_DC) { - if (!zephir_get_numberval(op2)) { +double zephir_safe_div_zval_double(zval *op1, double op2) +{ + if (!op2) { zend_error(E_WARNING, "Division by zero"); return 0; } - switch (Z_TYPE_P(op2)) { + switch (Z_TYPE_P(op1)) { case IS_ARRAY: case IS_OBJECT: case IS_RESOURCE: zend_error(E_WARNING, "Unsupported operand types"); break; } - return op1 / ((double) zephir_get_numberval(op2)); + return ((double) zephir_get_numberval(op1)) / op2; } /** * Do safe divisions between two longs */ -long zephir_safe_mod_long_long(long op1, long op2 TSRMLS_DC) { +long zephir_safe_mod_long_long(long op1, long op2) +{ if (!op2) { zend_error(E_WARNING, "Division by zero"); return 0; @@ -886,43 +736,11 @@ long zephir_safe_mod_long_long(long op1, long op2 TSRMLS_DC) { return op1 % op2; } -/** - * Do safe divisions between two long/double - */ -long zephir_safe_mod_long_double(long op1, double op2 TSRMLS_DC) { - if (!op2) { - zend_error(E_WARNING, "Division by zero"); - return 0; - } - return op1 % (long) op2; -} - -/** - * Do safe divisions between two double/long - */ -long zephir_safe_mod_double_long(double op1, long op2 TSRMLS_DC) { - if (!op2) { - zend_error(E_WARNING, "Division by zero"); - return 0; - } - return (long) op1 % op2; -} - -/** - * Do safe divisions between two doubles - */ -long zephir_safe_mod_double_double(double op1, double op2 TSRMLS_DC) { - if (!op2) { - zend_error(E_WARNING, "Division by zero"); - return 0; - } - return (long) op1 % (long) op2; -} - /** * Do safe divisions between two zval/long */ -long zephir_safe_mod_zval_long(zval *op1, long op2 TSRMLS_DC) { +long zephir_safe_mod_zval_long(zval *op1, long op2) +{ if (!op2) { zend_error(E_WARNING, "Division by zero"); return 0; @@ -936,57 +754,3 @@ long zephir_safe_mod_zval_long(zval *op1, long op2 TSRMLS_DC) { } return ((long) zephir_get_numberval(op1)) % (long) op2; } - -/** - * Do safe divisions between two zval/double - */ -long zephir_safe_mod_zval_double(zval *op1, double op2 TSRMLS_DC) { - if (!op2) { - zend_error(E_WARNING, "Division by zero"); - return 0; - } - switch (Z_TYPE_P(op1)) { - case IS_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - zend_error(E_WARNING, "Unsupported operand types"); - break; - } - return ((long) zephir_get_numberval(op1)) % (long) op2; -} - -/** - * Do safe divisions between two long/zval - */ -long zephir_safe_mod_long_zval(long op1, zval *op2 TSRMLS_DC) { - if (!zephir_get_numberval(op2)) { - zend_error(E_WARNING, "Division by zero"); - return 0; - } - switch (Z_TYPE_P(op2)) { - case IS_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - zend_error(E_WARNING, "Unsupported operand types"); - break; - } - return op1 % ((long) zephir_get_numberval(op2)); -} - -/** - * Do safe divisions between two double/zval - */ -long zephir_safe_mod_double_zval(double op1, zval *op2 TSRMLS_DC) { - if (!zephir_get_numberval(op2)) { - zend_error(E_WARNING, "Division by zero"); - return 0; - } - switch (Z_TYPE_P(op2)) { - case IS_ARRAY: - case IS_OBJECT: - case IS_RESOURCE: - zend_error(E_WARNING, "Unsupported operand types"); - break; - } - return (long) op1 % ((long) zephir_get_numberval(op2)); -} diff --git a/ext/kernel/operators.h b/ext/kernel/operators.h index 64a9d1e6cd9..3ec3ca14b7f 100644 --- a/ext/kernel/operators.h +++ b/ext/kernel/operators.h @@ -23,28 +23,30 @@ #include #include +#include "kernel/main.h" + +#define zephir_make_printable_zval(expr, expr_copy) zend_make_printable_zval(expr, expr_copy); /** Strict comparing */ -#define ZEPHIR_IS_LONG(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_LVAL_P(op1) == op2) || zephir_compare_strict_long(op1, op2 TSRMLS_CC)) -#define ZEPHIR_IS_DOUBLE(op1, op2) ((Z_TYPE_P(op1) == IS_DOUBLE && Z_DVAL_P(op1) == op2) || zephir_compare_strict_double(op1, op2 TSRMLS_CC)) +#define ZEPHIR_IS_LONG(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_LVAL_P(op1) == op2) || zephir_compare_strict_long(op1, op2)) +#define ZEPHIR_IS_DOUBLE(op1, op2) ((Z_TYPE_P(op1) == IS_DOUBLE && Z_DVAL_P(op1) == op2) || zephir_compare_strict_double(op1, op2)) #define ZEPHIR_IS_STRING(op1, op2) zephir_compare_strict_string(op1, op2, strlen(op2)) #define ZEPHIR_IS_LONG_IDENTICAL(op1, op2) (Z_TYPE_P(op1) == IS_LONG && Z_LVAL_P(op1) == op2) #define ZEPHIR_IS_DOUBLE_IDENTICAL(op1, op2) (Z_TYPE_P(op1) == IS_DOUBLE && Z_DVAL_P(op1) == op2) #define ZEPHIR_IS_STRING_IDENTICAL(op1, op2) (Z_TYPE_P(op1) == IS_STRING && zephir_compare_strict_string(op1, op2, strlen(op2))) -#define ZEPHIR_IS_BOOL_IDENTICAL(op1, op2) (Z_TYPE_P(op1) == IS_BOOL && zephir_compare_strict_bool(op1, op2 TSRMLS_CC)) +#define ZEPHIR_IS_BOOL_IDENTICAL(op1, op2) ((Z_TYPE_P(op1) == IS_FALSE || Z_TYPE_P(op1) == IS_TRUE) && zephir_compare_strict_bool(op1, op2)) /** strict boolean comparison */ -#define ZEPHIR_IS_FALSE(var) ((Z_TYPE_P(var) == IS_BOOL && !Z_BVAL_P(var)) || zephir_compare_strict_bool(var, 0 TSRMLS_CC)) -#define ZEPHIR_IS_TRUE(var) ((Z_TYPE_P(var) == IS_BOOL && Z_BVAL_P(var)) || zephir_compare_strict_bool(var, 1 TSRMLS_CC)) - -#define ZEPHIR_IS_FALSE_IDENTICAL(var) (Z_TYPE_P(var) == IS_BOOL && !Z_BVAL_P(var)) -#define ZEPHIR_IS_TRUE_IDENTICAL(var) (Z_TYPE_P(var) == IS_BOOL && Z_BVAL_P(var)) +#define ZEPHIR_IS_FALSE(var) ((Z_TYPE_P(var) == IS_FALSE) || zephir_compare_strict_bool(var, 0)) +#define ZEPHIR_IS_TRUE(var) ((Z_TYPE_P(var) == IS_TRUE) || zephir_compare_strict_bool(var, 1)) +#define ZEPHIR_IS_FALSE_IDENTICAL(var) (Z_TYPE_P(var) == IS_FALSE) +#define ZEPHIR_IS_TRUE_IDENTICAL(var) (Z_TYPE_P(var) == IS_TRUE) -#define ZEPHIR_IS_NOT_FALSE(var) (Z_TYPE_P(var) != IS_BOOL || (Z_TYPE_P(var) == IS_BOOL && Z_BVAL_P(var))) -#define ZEPHIR_IS_NOT_TRUE(var) (Z_TYPE_P(var) != IS_BOOL || (Z_TYPE_P(var) == IS_BOOL && !Z_BVAL_P(var))) -#define ZEPHIR_IS_BOOL(op1, op2) zephir_compare_strict_bool(op1, op2 TSRMLS_CC) -#define ZEPHIR_IS_BOOL_VALUE(op1, op2) zephir_compare_strict_bool(op1, op2 TSRMLS_CC) +#define ZEPHIR_IS_NOT_FALSE(var) ((Z_TYPE_P(var) != IS_TRUE && Z_TYPE_P(var) != IS_FALSE) || Z_TYPE_P(var) == IS_TRUE) +#define ZEPHIR_IS_NOT_TRUE(var) ((Z_TYPE_P(var) != IS_TRUE && Z_TYPE_P(var) != IS_FALSE) || Z_TYPE_P(var) == IS_FALSE) +#define ZEPHIR_IS_BOOL(op1, op2) zephir_compare_strict_bool(op1, op2) +#define ZEPHIR_IS_BOOL_VALUE(op1, op2) zephir_compare_strict_bool(op1, op2) /** SQL null empty **/ #define ZEPHIR_IS_EMPTY(var) (Z_TYPE_P(var) == IS_NULL || ZEPHIR_IS_FALSE(var) || (Z_TYPE_P(var) == IS_STRING && !Z_STRLEN_P(var)) || !zend_is_true(var)) @@ -55,61 +57,51 @@ #define ZEPHIR_IS_NOT_SCALAR(var) (Z_TYPE_P(var) == IS_NULL || Z_TYPE_P(var) == IS_ARRAY || Z_TYPE_P(var) == IS_OBJECT || Z_TYPE_P(var) == IS_RESOURCE) /** Equals/Identical */ -#define ZEPHIR_IS_EQUAL(op1, op2) zephir_is_equal(op1, op2 TSRMLS_CC) -#define ZEPHIR_IS_IDENTICAL(op1, op2) zephir_is_identical(op1, op2 TSRMLS_CC) +#define ZEPHIR_IS_EQUAL(op1, op2) zephir_is_equal(op1, op2) +#define ZEPHIR_IS_IDENTICAL(op1, op2) zephir_is_identical(op1, op2) /** Greater/Smaller equals */ -#define ZEPHIR_LE(op1, op2) zephir_less_equal(op1, op2 TSRMLS_CC) -#define ZEPHIR_LE_LONG(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_LVAL_P(op1) <= op2) || zephir_less_equal_long(op1, op2 TSRMLS_CC)) -#define ZEPHIR_LE_DOUBLE(op1, op2) ((Z_TYPE_P(op1) == IS_DOUBLE && Z_DVAL_P(op1) <= op2) || zephir_less_equal_double(op1, op2 TSRMLS_CC)) -#define ZEPHIR_GE(op1, op2) zephir_greater_equal(op1, op2 TSRMLS_CC) -#define ZEPHIR_GE_LONG(op1, op2) zephir_greater_equal_long(op1, op2 TSRMLS_CC) -#define ZEPHIR_LT(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_TYPE_P(op2) == IS_LONG) ? Z_LVAL_P(op1) < Z_LVAL_P(op2) : zephir_less(op1, op2 TSRMLS_CC)) -#define ZEPHIR_LT_LONG(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_LVAL_P(op1) < op2) || zephir_less_long(op1, op2 TSRMLS_CC)) -#define ZEPHIR_LT_DOUBLE(op1, op2) ((Z_TYPE_P(op1) == IS_DOUBLE && Z_DVAL_P(op1) < op2) || zephir_less_double(op1, op2 TSRMLS_CC)) -#define ZEPHIR_GT(op1, op2) zephir_greater(op1, op2 TSRMLS_CC) -#define ZEPHIR_GT_LONG(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_LVAL_P(op1) > op2) || zephir_greater_long(op1, op2 TSRMLS_CC)) -#define ZEPHIR_GT_DOUBLE(op1, op2) ((Z_TYPE_P(op1) == IS_DOUBLE && Z_DVAL_P(op1) > op2) || zephir_greater_double(op1, op2 TSRMLS_CC)) +#define ZEPHIR_LE(op1, op2) zephir_less_equal(op1, op2) +#define ZEPHIR_LE_LONG(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_LVAL_P(op1) <= op2) || zephir_less_equal_long(op1, op2)) +#define ZEPHIR_LE_DOUBLE(op1, op2) ((Z_TYPE_P(op1) == IS_DOUBLE && Z_DVAL_P(op1) <= op2) || zephir_less_equal_double(op1, op2)) +#define ZEPHIR_GE(op1, op2) zephir_greater_equal(op1, op2) +#define ZEPHIR_GE_LONG(op1, op2) zephir_greater_equal_long(op1, op2) +#define ZEPHIR_LT(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_TYPE_P(op2) == IS_LONG) ? Z_LVAL_P(op1) < Z_LVAL_P(op2) : zephir_less(op1, op2)) +#define ZEPHIR_LT_LONG(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_LVAL_P(op1) < op2) || zephir_less_long(op1, op2)) +#define ZEPHIR_LT_DOUBLE(op1, op2) ((Z_TYPE_P(op1) == IS_DOUBLE && Z_DVAL_P(op1) < op2) || zephir_less_double(op1, op2)) +#define ZEPHIR_GT(op1, op2) zephir_greater(op1, op2) +#define ZEPHIR_GT_LONG(op1, op2) ((Z_TYPE_P(op1) == IS_LONG && Z_LVAL_P(op1) > op2) || zephir_greater_long(op1, op2)) +#define ZEPHIR_GT_DOUBLE(op1, op2) ((Z_TYPE_P(op1) == IS_DOUBLE && Z_DVAL_P(op1) > op2) || zephir_greater_double(op1, op2)) #define ZEPHIR_STRING_OFFSET(op1, index) ((index >= 0 && index < Z_STRLEN_P(op1)) ? Z_STRVAL_P(op1)[index] : '\0') -#define zephir_increment(var) fast_increment_function(var) -#define zephir_decrement(var) fast_decrement_function(var) - -void zephir_make_printable_zval(zval *expr, zval *expr_copy, int *use_copy); +/* concatenation */ +void zephir_concat_self(zval *left, zval *right); +void zephir_concat_self_str(zval *left, const char *right, int right_length); +void zephir_concat_self_long(zval *left, const long right); +void zephir_concat_self_char(zval *left, unsigned char right); -#define zephir_add_function(result, left, right) zephir_add_function_ex(result, left, right TSRMLS_CC) -#define zephir_sub_function(result, left, right) fast_sub_function(result, left, right TSRMLS_CC) - -#if PHP_VERSION_ID < 50600 -void zephir_pow_function_ex(zval *return_value, zval *zbase, zval *zexp TSRMLS_DC); -#define zephir_pow_function(result, op1, op2) zephir_pow_function_ex(result, op1, op2 TSRMLS_CC) -#else -#define zephir_pow_function(result, op1, op2) pow_function(result, op1, op2 TSRMLS_CC) -#endif +/** Strict comparing */ +int zephir_compare_strict_string(zval *op1, const char *op2, int op2_length); +int zephir_compare_strict_long(zval *op1, long op2); /** Operator functions */ -int zephir_add_function_ex(zval *result, zval *op1, zval *op2 TSRMLS_DC); +int zephir_add_function_ex(zval *result, zval *op1, zval *op2); int zephir_and_function(zval *result, zval *left, zval *right); -void zephir_negate(zval *z TSRMLS_DC); +void zephir_negate(zval *z); /** Bitwise functions */ -int zephir_bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -int zephir_bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -int zephir_bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -int zephir_shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); -int zephir_shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC); - -void zephir_concat_self(zval **left, zval *right TSRMLS_DC); -void zephir_concat_self_str(zval **left, const char *right, int right_length TSRMLS_DC); -void zephir_concat_self_long(zval **left, const long right TSRMLS_DC); -void zephir_concat_self_char(zval **left, unsigned char right TSRMLS_DC); +int zephir_bitwise_and_function(zval *result, zval *op1, zval *op2); +int zephir_bitwise_or_function(zval *result, zval *op1, zval *op2); +int zephir_bitwise_xor_function(zval *result, zval *op1, zval *op2); +int zephir_shift_left_function(zval *result, zval *op1, zval *op2); +int zephir_shift_right_function(zval *result, zval *op1, zval *op2); /** Strict comparing */ int zephir_compare_strict_string(zval *op1, const char *op2, int op2_length); -int zephir_compare_strict_long(zval *op1, long op2 TSRMLS_DC); -int zephir_compare_strict_double(zval *op1, double op2 TSRMLS_DC); -int zephir_compare_strict_bool(zval *op1, zend_bool op2 TSRMLS_DC); +int zephir_compare_strict_long(zval *op1, long op2); +int zephir_compare_strict_double(zval *op1, double op2); +int zephir_compare_strict_bool(zval *op1, zend_bool op2); void zephir_cast(zval *result, zval *var, zend_uint type); void zephir_convert_to_object(zval *op); @@ -120,122 +112,58 @@ zend_bool zephir_get_boolval_ex(zval *op); int zephir_is_numeric_ex(const zval *op); -int zephir_is_equal(zval *op1, zval *op2 TSRMLS_DC); -int zephir_is_identical(zval *op1, zval *op2 TSRMLS_DC); - -int zephir_less(zval *op1, zval *op2 TSRMLS_DC); -int zephir_less_long(zval *op1, long op2 TSRMLS_DC); -int zephir_less_double(zval *op1, double op2 TSRMLS_DC); - -int zephir_greater(zval *op1, zval *op2 TSRMLS_DC); -int zephir_greater_long(zval *op1, long op2 TSRMLS_DC); -int zephir_greater_double(zval *op1, double op2 TSRMLS_DC); - -int zephir_less_equal(zval *op1, zval *op2 TSRMLS_DC); -int zephir_less_equal_long(zval *op1, long op2 TSRMLS_DC); - -int zephir_greater_equal(zval *op1, zval *op2 TSRMLS_DC); -int zephir_greater_equal_long(zval *op1, long op2 TSRMLS_DC); - -double zephir_safe_div_long_long(long op1, long op2 TSRMLS_DC); -double zephir_safe_div_long_double(long op1, double op2 TSRMLS_DC); -double zephir_safe_div_double_long(double op1, long op2 TSRMLS_DC); -double zephir_safe_div_double_double(double op1, double op2 TSRMLS_DC); -double zephir_safe_div_zval_long(zval *op1, long op2 TSRMLS_DC); -double zephir_safe_div_zval_double(zval *op1, double op2 TSRMLS_DC); -double zephir_safe_div_long_zval(long op1, zval *op2 TSRMLS_DC); -double zephir_safe_div_double_zval(double op1, zval *op2 TSRMLS_DC); - -long zephir_safe_mod_long_long(long op1, long op2 TSRMLS_DC); -long zephir_safe_mod_long_double(long op1, double op2 TSRMLS_DC); -long zephir_safe_mod_double_long(double op1, long op2 TSRMLS_DC); -long zephir_safe_mod_double_double(double op1, double op2 TSRMLS_DC); -long zephir_safe_mod_zval_long(zval *op1, long op2 TSRMLS_DC); -long zephir_safe_mod_zval_double(zval *op1, double op2 TSRMLS_DC); -long zephir_safe_mod_long_zval(long op1, zval *op2 TSRMLS_DC); -long zephir_safe_mod_double_zval(double op1, zval *op2 TSRMLS_DC); +int zephir_is_equal(zval *op1, zval *op2); +int zephir_is_identical(zval *op1, zval *op2); + +int zephir_less(zval *op1, zval *op2); +int zephir_less_long(zval *op1, long op2); +int zephir_less_double(zval *op1, double op2); + +int zephir_greater(zval *op1, zval *op2); +int zephir_greater_long(zval *op1, long op2); +int zephir_greater_double(zval *op1, double op2); + +int zephir_less_equal(zval *op1, zval *op2); +int zephir_less_equal_long(zval *op1, long op2); + +int zephir_greater_equal(zval *op1, zval *op2); +int zephir_greater_equal_long(zval *op1, long op2); + +double zephir_safe_div_long_long(long op1, long op2); +double zephir_safe_div_long_double(long op1, double op2); +double zephir_safe_div_double_long(double op1, long op2); +double zephir_safe_div_double_double(double op1, double op2); +double zephir_safe_div_zval_long(zval *op1, long op2); +double zephir_safe_div_zval_double(zval *op1, double op2); +double zephir_safe_div_long_zval(long op1, zval *op2); +double zephir_safe_div_double_zval(double op1, zval *op2); + +long zephir_safe_mod_long_long(long op1, long op2); +long zephir_safe_mod_long_double(long op1, double op2); +long zephir_safe_mod_double_long(double op1, long op2); +long zephir_safe_mod_double_double(double op1, double op2); +long zephir_safe_mod_zval_long(zval *op1, long op2); +long zephir_safe_mod_zval_double(zval *op1, double op2); +long zephir_safe_mod_long_zval(long op1, zval *op2); +long zephir_safe_mod_double_zval(double op1, zval *op2); #define zephir_get_numberval(z) (Z_TYPE_P(z) == IS_LONG ? Z_LVAL_P(z) : zephir_get_doubleval(z)) #define zephir_get_intval(z) (Z_TYPE_P(z) == IS_LONG ? Z_LVAL_P(z) : zephir_get_intval_ex(z)) #define zephir_get_doubleval(z) (Z_TYPE_P(z) == IS_DOUBLE ? Z_DVAL_P(z) : zephir_get_doubleval_ex(z)) -#define zephir_get_boolval(z) (Z_TYPE_P(z) == IS_BOOL ? Z_BVAL_P(z) : zephir_get_boolval_ex(z)) +#define zephir_get_boolval(z) (Z_TYPE_P(z) == IS_TRUE ? 1 : (Z_TYPE_P(z) == IS_FALSE ? 0 : zephir_get_boolval_ex(z))) #define zephir_get_charval(z) (Z_TYPE_P(z) == IS_LONG ? Z_LVAL_P(z) : zephir_get_charval_ex(z)) -#ifndef PHP_WIN32 - -#define ZEPHIR_ADD_ASSIGN(z, v) \ - { \ - zval tmp; \ - ZEPHIR_SEPARATE(z); \ - if (Z_TYPE_P(z) == IS_LONG && Z_TYPE_P(v) == IS_LONG) { \ - Z_LVAL_P(z) += Z_LVAL_P(v); \ - } else { \ - if (Z_TYPE_P(z) == IS_LONG && Z_TYPE_P(v) == IS_DOUBLE) { \ - Z_LVAL_P(z) += Z_DVAL_P(v); \ - } else { \ - add_function(&tmp, z, v TSRMLS_CC); \ - if (Z_TYPE(tmp) == IS_LONG) { \ - Z_LVAL_P(z) = Z_LVAL(tmp); \ - } else { \ - if (Z_TYPE(tmp) == IS_DOUBLE) { \ - Z_DVAL_P(z) = Z_DVAL(tmp); \ - } \ - } \ - } \ - } \ - } - -#define ZEPHIR_SUB_ASSIGN(z, v) \ - { \ - zval tmp; \ - ZEPHIR_SEPARATE(z); \ - if (Z_TYPE_P(z) == IS_LONG && Z_TYPE_P(v) == IS_LONG) { \ - Z_LVAL_P(z) -= Z_LVAL_P(v); \ - } else { \ - if (Z_TYPE_P(z) == IS_LONG && Z_TYPE_P(v) == IS_DOUBLE) { \ - Z_LVAL_P(z) -= Z_DVAL_P(v); \ - } else { \ - sub_function(&tmp, z, v TSRMLS_CC); \ - if (Z_TYPE(tmp) == IS_LONG) { \ - Z_LVAL_P(z) = Z_LVAL(tmp); \ - } else { \ - if (Z_TYPE(tmp) == IS_DOUBLE) { \ - Z_DVAL_P(z) = Z_DVAL(tmp); \ - } \ - } \ - } \ - } \ - } - -#define ZEPHIR_MUL_ASSIGN(z, v) \ - { \ - zval tmp; \ - ZEPHIR_SEPARATE(z); \ - if (Z_TYPE_P(z) == IS_LONG && Z_TYPE_P(v) == IS_LONG) { \ - Z_LVAL_P(z) *= Z_LVAL_P(v); \ - } else { \ - if (Z_TYPE_P(z) == IS_LONG && Z_TYPE_P(v) == IS_DOUBLE) { \ - Z_LVAL_P(z) *= Z_DVAL_P(v); \ - } else { \ - mul_function(&tmp, z, v TSRMLS_CC); \ - if (Z_TYPE(tmp) == IS_LONG) { \ - Z_LVAL_P(z) = Z_LVAL(tmp); \ - } else { \ - if (Z_TYPE(tmp) == IS_DOUBLE) { \ - Z_DVAL_P(z) = Z_DVAL(tmp); \ - } \ - } \ - } \ - } \ - } - -#else +#define zephir_add_function(result, left, right) fast_add_function(result, left, right) +#define zephir_sub_function(result, left, right) sub_function(result, left, right) +#define zephir_pow_function(result, op1, op2) pow_function(result, op1, op2) +#define zephir_increment(var) increment_function(var) +#define zephir_decrement(var) decrement_function(var) #define ZEPHIR_ADD_ASSIGN(z, v) \ { \ zval tmp; \ ZEPHIR_SEPARATE(z); \ - add_function(&tmp, z, v TSRMLS_CC); \ + add_function(&tmp, z, v); \ if (Z_TYPE(tmp) == IS_LONG) { \ Z_LVAL_P(z) = Z_LVAL(tmp); \ } else { \ @@ -249,7 +177,7 @@ long zephir_safe_mod_double_zval(double op1, zval *op2 TSRMLS_DC); { \ zval tmp; \ ZEPHIR_SEPARATE(z); \ - sub_function(&tmp, z, v TSRMLS_CC); \ + sub_function(&tmp, z, v); \ if (Z_TYPE(tmp) == IS_LONG) { \ Z_LVAL_P(z) = Z_LVAL(tmp); \ } else { \ @@ -263,7 +191,7 @@ long zephir_safe_mod_double_zval(double op1, zval *op2 TSRMLS_DC); { \ zval tmp; \ ZEPHIR_SEPARATE(z); \ - mul_function(&tmp, z, v TSRMLS_CC); \ + mul_function(&tmp, z, v); \ if (Z_TYPE(tmp) == IS_LONG) { \ Z_LVAL_P(z) = Z_LVAL(tmp); \ } else { \ @@ -273,7 +201,6 @@ long zephir_safe_mod_double_zval(double op1, zval *op2 TSRMLS_DC); } \ } -#endif #define zephir_get_strval(left, right) \ { \ @@ -282,11 +209,11 @@ long zephir_safe_mod_double_zval(double op1, zval *op2 TSRMLS_DC); if (Z_TYPE_P(right) == IS_STRING) { \ ZEPHIR_CPY_WRT(left, right); \ } else { \ - INIT_ZVAL(right_tmp); \ - zephir_make_printable_zval(right, &right_tmp, &use_copy_right); \ + use_copy_right = zephir_make_printable_zval(right, &right_tmp); \ if (use_copy_right) { \ ZEPHIR_INIT_NVAR(left); \ - ZVAL_STRINGL(left, Z_STRVAL_P(&right_tmp), Z_STRLEN_P(&right_tmp), 0); \ + ZVAL_STRINGL(left, Z_STRVAL(right_tmp), Z_STRLEN(right_tmp)); \ + zval_ptr_dtor(&right_tmp); \ } \ } \ } @@ -304,12 +231,15 @@ long zephir_safe_mod_double_zval(double op1, zval *op2 TSRMLS_DC); #define zephir_is_numeric(value) (Z_TYPE_P(value) == IS_LONG || Z_TYPE_P(value) == IS_DOUBLE || zephir_is_numeric_ex(value)) #define zephir_is_true(value) \ - (Z_TYPE_P(value) == IS_NULL ? 0 : \ - (Z_TYPE_P(value) == IS_BOOL ? Z_BVAL_P(value) : \ - (Z_TYPE_P(value) == IS_LONG ? (Z_LVAL_P(value) ? 1 : 0) : \ - zend_is_true(value) \ + (Z_TYPE_P(value) == IS_TRUE ? 1 : \ + (Z_TYPE_P(value) == IS_FALSE ? 0 : \ + (Z_TYPE_P(value) == IS_NULL ? 0 : \ + (Z_TYPE_P(value) == IS_LONG ? (Z_LVAL_P(value) ? 1 : 0) : \ + zend_is_true(value) \ + ) \ ) \ ) \ ) + #endif diff --git a/ext/kernel/output.c b/ext/kernel/output.c deleted file mode 100644 index 8facd517ea5..00000000000 --- a/ext/kernel/output.c +++ /dev/null @@ -1,86 +0,0 @@ - -/* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - | Vladimir Kolesnikov | - +------------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ext.h" -#include "kernel/memory.h" -#include "kernel/output.h" - -#include -#include
- -void zephir_ob_start(TSRMLS_D) -{ - php_output_start_default(TSRMLS_C); -} - -void zephir_ob_get_contents(zval *result TSRMLS_DC) -{ - php_output_get_contents(result TSRMLS_CC); -} - -int zephir_ob_end_flush(TSRMLS_D) -{ - if (zephir_ob_get_level(TSRMLS_C) < 1) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete and flush buffer. No buffer to flush"); - return FAILURE; - } - - return php_output_end(TSRMLS_C); -} - -int zephir_ob_end_clean(TSRMLS_D) -{ - if (zephir_ob_get_level(TSRMLS_C) < 1) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete"); - return FAILURE; - } - - return php_output_discard(TSRMLS_C); -} - -int zephir_ob_flush(TSRMLS_D) -{ - if (zephir_ob_get_level(TSRMLS_C) < 1) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to flush buffer. No buffer to flush"); - return FAILURE; - } - - return php_output_flush(TSRMLS_C); -} - -int zephir_ob_clean(TSRMLS_D) -{ - if (zephir_ob_get_level(TSRMLS_C) < 1) { - php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete"); - return FAILURE; - } - - return php_output_clean(TSRMLS_C); -} - -int zephir_ob_get_level(TSRMLS_D) -{ - return php_output_get_level(TSRMLS_C); -} diff --git a/ext/kernel/output.h b/ext/kernel/output.h deleted file mode 100644 index d6c05095f6d..00000000000 --- a/ext/kernel/output.h +++ /dev/null @@ -1,34 +0,0 @@ - -/* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - | Vladimir Kolesnikov | - +------------------------------------------------------------------------+ -*/ - -#ifndef ZEPHIR_KERNEL_OUTPUT_H -#define ZEPHIR_KERNEL_OUTPUT_H - -#include - -void zephir_ob_start(TSRMLS_D); -void zephir_ob_get_contents(zval *result TSRMLS_DC); -int zephir_ob_end_flush(TSRMLS_D); -int zephir_ob_end_clean(TSRMLS_D); -int zephir_ob_flush(TSRMLS_D); -int zephir_ob_clean(TSRMLS_D); -int zephir_ob_get_level(TSRMLS_D); - -#endif diff --git a/ext/kernel/require.c b/ext/kernel/require.c index 1880553168a..078cbdde43b 100644 --- a/ext/kernel/require.c +++ b/ext/kernel/require.c @@ -1,22 +1,13 @@ - /* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - | Vladimir Kolesnikov | - +------------------------------------------------------------------------+ -*/ + * This file is part of the Zephir. + * + * (c) Zephir Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. If you did not receive + * a copy of the license it is available through the world-wide-web at the + * following url: https://docs.zephir-lang.com/en/latest/license + */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -37,71 +28,68 @@ /** * Do an internal require to a plain php file taking care of the value returned by the file */ -int zephir_require_ret(zval **return_value_ptr, const char *require_path TSRMLS_DC) +int zephir_require_ret(zval *return_value_ptr, const char *require_path) { zend_file_handle file_handle; - int ret; zend_op_array *new_op_array; + zval dummy, local_retval; + int ret; + + ZVAL_UNDEF(&local_retval); #ifndef ZEPHIR_RELEASE - if (return_value_ptr && *return_value_ptr) { + if (return_value_ptr != NULL && Z_TYPE_P(return_value_ptr) > IS_NULL) { fprintf(stderr, "%s: *return_value_ptr is expected to be NULL", __func__); zephir_print_backtrace(); abort(); } #endif - if (!require_path) { - /* @TODO, throw an exception here */ - return FAILURE; - } - file_handle.filename = require_path; file_handle.free_filename = 0; file_handle.type = ZEND_HANDLE_FILENAME; file_handle.opened_path = NULL; file_handle.handle.fp = NULL; - new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC); + + new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE); if (new_op_array) { - if (file_handle.handle.stream.handle) { - int dummy = 1; + if (file_handle.handle.stream.handle) { + ZVAL_NULL(&dummy); if (!file_handle.opened_path) { - file_handle.opened_path = estrdup(require_path); + file_handle.opened_path = zend_string_init(require_path, strlen(require_path), 0); } - zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path) + 1, (void *)&dummy, sizeof(int), NULL); - zend_destroy_file_handle(&file_handle TSRMLS_CC); + zend_hash_add(&EG(included_files), file_handle.opened_path, &dummy); + zend_destroy_file_handle(&file_handle); } - { - zval **original_return_value = EG(return_value_ptr_ptr); - zend_op_array *original_active_op_array = EG(active_op_array); - zend_op **original_opline_ptr = EG(opline_ptr); - - EG(return_value_ptr_ptr) = return_value_ptr; - EG(active_op_array) = new_op_array; - - zend_execute(new_op_array TSRMLS_CC); - zend_exception_restore(TSRMLS_C); - destroy_op_array(new_op_array TSRMLS_CC); - efree(new_op_array); - - if (EG(exception)) { - assert(!return_value_ptr || !*return_value_ptr); - ret = FAILURE; - } - else { - ret = SUCCESS; - } - EG(return_value_ptr_ptr) = original_return_value; - EG(active_op_array) = original_active_op_array; - EG(opline_ptr) = original_opline_ptr; - return ret; +#if PHP_VERSION_ID >= 70100 + new_op_array->scope = EG(fake_scope) ? EG(fake_scope) : zend_get_executed_scope(); +#else + new_op_array->scope = EG(scope); +#endif + zend_execute(new_op_array, &local_retval); + + if (return_value_ptr) { + zval_ptr_dtor(return_value_ptr); + ZVAL_COPY_VALUE(return_value_ptr, &local_retval); + } else { + zval_ptr_dtor(&local_retval); } - } - else { - zend_destroy_file_handle(&file_handle TSRMLS_CC); + + destroy_op_array(new_op_array); + efree_size(new_op_array, sizeof(zend_op_array)); + + if (EG(exception)) { + ret = FAILURE; + } else { + ret = SUCCESS; + } + + return ret; + } else { + zend_destroy_file_handle(&file_handle); } return FAILURE; diff --git a/ext/kernel/require.h b/ext/kernel/require.h index c3bdb7b5a5c..e4fcaf52a92 100644 --- a/ext/kernel/require.h +++ b/ext/kernel/require.h @@ -1,43 +1,34 @@ - /* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - | Vladimir Kolesnikov | - +------------------------------------------------------------------------+ -*/ + * This file is part of the Zephir. + * + * (c) Zephir Team + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. If you did not receive + * a copy of the license it is available through the world-wide-web at the + * following url: https://docs.zephir-lang.com/en/latest/license + */ #ifndef ZEPHIR_KERNEL_REQUIRE_H #define ZEPHIR_KERNEL_REQUIRE_H #include "php_ext.h" -int zephir_require_ret(zval **return_value_ptr, const char *require_path TSRMLS_DC) ZEPHIR_ATTR_NONNULL1(2); +int zephir_require_ret(zval *return_value_ptr, const char *require_path) ZEPHIR_ATTR_NONNULL1(2); -ZEPHIR_ATTR_NONNULL static inline int zephir_require(const char *require_path TSRMLS_DC) +ZEPHIR_ATTR_NONNULL static inline int zephir_require(const char *require_path) { - return zephir_require_ret(NULL, require_path TSRMLS_CC); + return zephir_require_ret(NULL, require_path); } -ZEPHIR_ATTR_NONNULL static inline int zephir_require_zval(const zval *require_path TSRMLS_DC) +ZEPHIR_ATTR_NONNULL static inline int zephir_require_zval(const zval *require_path) { - return zephir_require_ret(NULL, Z_TYPE_P(require_path) == IS_STRING ? Z_STRVAL_P(require_path) : "" TSRMLS_CC); + return zephir_require_ret(NULL, Z_TYPE_P(require_path) == IS_STRING ? Z_STRVAL_P(require_path) : ""); } -ZEPHIR_ATTR_NONNULL static inline int zephir_require_zval_ret(zval **return_value_ptr, const zval *require_path TSRMLS_DC) +ZEPHIR_ATTR_NONNULL static inline int zephir_require_zval_ret(zval *return_value_ptr, const zval *require_path) { - return zephir_require_ret(return_value_ptr, Z_TYPE_P(require_path) == IS_STRING ? Z_STRVAL_P(require_path) : "" TSRMLS_CC); + return zephir_require_ret(return_value_ptr, Z_TYPE_P(require_path) == IS_STRING ? Z_STRVAL_P(require_path) : ""); } #endif /* ZEPHIR_KERNEL_REQUIRE_H */ diff --git a/ext/kernel/session.c b/ext/kernel/session.c deleted file mode 100644 index 714b84d5ad6..00000000000 --- a/ext/kernel/session.c +++ /dev/null @@ -1,88 +0,0 @@ - -/* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - | Vladimir Kolesnikov | - +------------------------------------------------------------------------+ -*/ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "php.h" -#include "php_ext.h" - -#include "kernel/main.h" -#include "kernel/fcall.h" -#include "kernel/session.h" - -#ifdef ZEPHIR_USE_PHP_SESSION -#include -#endif - -void zephir_session_start(TSRMLS_D) -{ -#ifdef ZEPHIR_USE_PHP_SESSION - php_session_start(TSRMLS_C); -#else - //zephir_call_func_params(NULL, NULL, SL("session_start") TSRMLS_CC, 0); -#endif -} - -void zephir_session_destroy(TSRMLS_D) -{ - //zephir_call_func_params(NULL, NULL, SL("session_destroy") TSRMLS_CC, 0); -} - -void zephir_get_session_id(zval *return_value, zval **return_value_ptr TSRMLS_DC) -{ -#ifdef ZEPHIR_USE_PHP_SESSION - if (PS(id)) { - RETURN_STRING(PS(id), 1); - } - - RETURN_EMPTY_STRING(); -#else - //zephir_call_func_params(return_value, return_value_ptr, SL("session_id") TSRMLS_CC, 0); -#endif -} - -void zephir_set_session_id(zval *sid TSRMLS_DC) -{ -#ifdef ZEPHIR_USE_PHP_SESSION - zval copy; - int use_copy = 0; - - if (UNEXPECTED(Z_TYPE_P(sid) != IS_STRING)) { - zend_make_printable_zval(sid, ©, &use_copy); - if (use_copy) { - sid = © - } - } - - if (PS(id)) { - efree(PS(id)); - } - - PS(id) = estrndup(Z_STRVAL_P(sid), Z_STRLEN_P(sid)); - - if (UNEXPECTED(use_copy)) { - zval_dtor(©); - } -#else - //zephir_call_func_params(NULL, NULL, SL("session_id") TSRMLS_CC, 1, sid); -#endif -} diff --git a/ext/kernel/session.h b/ext/kernel/session.h deleted file mode 100644 index 7239a00e35a..00000000000 --- a/ext/kernel/session.h +++ /dev/null @@ -1,32 +0,0 @@ - -/* - +------------------------------------------------------------------------+ - | Zephir Language | - +------------------------------------------------------------------------+ - | Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) | - +------------------------------------------------------------------------+ - | This source file is subject to the New BSD License that is bundled | - | with this package in the file docs/LICENSE.txt. | - | | - | If you did not receive a copy of the license and are unable to | - | obtain it through the world-wide-web, please send an email | - | to license@zephir-lang.com so we can send you a copy immediately. | - +------------------------------------------------------------------------+ - | Authors: Andres Gutierrez | - | Eduar Carvajal | - | Vladimir Kolesnikov | - +------------------------------------------------------------------------+ -*/ - -#ifndef ZEPHIR_KERNEL_SESSION_H -#define ZEPHIR_KERNEL_SESSION_H - -#include -#include - -void zephir_session_start(TSRMLS_D); -void zephir_session_destroy(TSRMLS_D); -void zephir_get_session_id(zval *return_value, zval **return_value_ptr TSRMLS_DC); -void zephir_set_session_id(zval *sid TSRMLS_DC); - -#endif /* ZEPHIR_KERNEL_SESSION_H */ diff --git a/ext/kernel/string.c b/ext/kernel/string.c index 1f4b8481794..f8e16db4ea9 100644 --- a/ext/kernel/string.c +++ b/ext/kernel/string.c @@ -27,17 +27,17 @@ #include "php_ext.h" #include "php_main.h" -#include +#include #include #include #include #include -#include "ext/standard/base64.h" -#include "ext/standard/md5.h" -#include "ext/standard/crc32.h" -#include "ext/standard/url.h" -#include "ext/standard/html.h" -#include "ext/date/php_date.h" +#include +#include +#include +#include +#include +#include #ifdef ZEPHIR_USE_PHP_PCRE #include @@ -60,37 +60,29 @@ #define PH_RANDOM_NOZERO 4 /** - * Fast call to php strlen + * This function is not external in the Zend API so we redeclare it here in the extension */ -void zephir_fast_strlen(zval *return_value, zval *str){ - - zval copy; - int use_copy = 0; - - if (Z_TYPE_P(str) != IS_STRING) { - zend_make_printable_zval(str, ©, &use_copy); - if (use_copy) { - str = © - } - } - - ZVAL_LONG(return_value, Z_STRLEN_P(str)); +int zephir_spprintf(char **message, int max_len, char *format, ...) +{ + va_list arg; + int len; - if (use_copy) { - zval_dtor(str); - } + va_start(arg, format); + len = vspprintf(message, max_len, format, arg); + va_end(arg); + return len; } /** * Fast call to php strlen */ -int zephir_fast_strlen_ev(zval *str){ - +int zephir_fast_strlen_ev(zval *str) +{ zval copy; int use_copy = 0, length; if (Z_TYPE_P(str) != IS_STRING) { - zend_make_printable_zval(str, ©, &use_copy); + use_copy = zend_make_printable_zval(str, ©); if (use_copy) { str = © } @@ -105,17 +97,17 @@ int zephir_fast_strlen_ev(zval *str){ } /** - * Fast call to php strlen + * Fast call to php strtolower */ -void zephir_fast_strtolower(zval *return_value, zval *str){ - +void zephir_fast_strtolower(zval *return_value, zval *str) +{ zval copy; int use_copy = 0; char *lower_str; unsigned int length; if (Z_TYPE_P(str) != IS_STRING) { - zend_make_printable_zval(str, ©, &use_copy); + use_copy = zend_make_printable_zval(str, ©); if (use_copy) { str = © } @@ -129,1136 +121,924 @@ void zephir_fast_strtolower(zval *return_value, zval *str){ zval_dtor(str); } - ZVAL_STRINGL(return_value, lower_str, length, 0); -} - -void zephir_strtolower_inplace(zval *s) { - if (EXPECTED(Z_TYPE_P(s) == IS_STRING)) { - php_strtolower(Z_STRVAL_P(s), Z_STRLEN_P(s)); - } + ZVAL_STRINGL(return_value, lower_str, length); + efree(lower_str); } /** - * Fast call to php join function + * Fast call to PHP strtoupper() function */ -void zephir_fast_join(zval *result, zval *glue, zval *pieces TSRMLS_DC) { +void zephir_fast_strtoupper(zval *return_value, zval *str) +{ + zval copy; + int use_copy = 0; + char *lower_str; + unsigned int length; - if (Z_TYPE_P(glue) != IS_STRING || Z_TYPE_P(pieces) != IS_ARRAY) { - ZVAL_NULL(result); - zend_error(E_WARNING, "Invalid arguments supplied for join()"); - return; + if (Z_TYPE_P(str) != IS_STRING) { + use_copy = zend_make_printable_zval(str, ©); + if (use_copy) { + str = © + } + } + + length = Z_STRLEN_P(str); + lower_str = estrndup(Z_STRVAL_P(str), length); + php_strtoupper(lower_str, length); + + if (use_copy) { + zval_dtor(str); } - php_implode(glue, pieces, result TSRMLS_CC); + ZVAL_STRINGL(return_value, lower_str, length); + efree(lower_str); } /** - * Appends to a smart_str a printable version of a zval + * Checks if a zval string starts with a zval string */ -void zephir_append_printable_zval(smart_str *implstr, zval **tmp TSRMLS_DC) { +int zephir_start_with(const zval *str, const zval *compared, zval *case_sensitive) +{ - zval tmp_val; - unsigned int str_len; + int i; + int sensitive = 0; + char *op1_cursor, *op2_cursor; - switch (Z_TYPE_PP(tmp)) { - case IS_STRING: - smart_str_appendl(implstr, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); - break; + if (Z_TYPE_P(str) != IS_STRING || Z_TYPE_P(compared) != IS_STRING) { + return 0; + } - case IS_LONG: - smart_str_append_long(implstr, Z_LVAL_PP(tmp)); - break; + if (!Z_STRLEN_P(compared) || !Z_STRLEN_P(str) || Z_STRLEN_P(compared) > Z_STRLEN_P(str)) { + return 0; + } - case IS_BOOL: - if (Z_LVAL_PP(tmp) == 1) { - smart_str_appendl(implstr, "1", sizeof("1") - 1); - } - break; + if (case_sensitive) { + sensitive = zend_is_true(case_sensitive); + } - case IS_NULL: - break; + if (!sensitive) { + return !memcmp(Z_STRVAL_P(str), Z_STRVAL_P(compared), Z_STRLEN_P(compared)); + } - case IS_DOUBLE: { - char *stmp; - str_len = spprintf(&stmp, 0, "%.*G", (int) EG(precision), Z_DVAL_PP(tmp)); - smart_str_appendl(implstr, stmp, str_len); - efree(stmp); - } - break; + op1_cursor = Z_STRVAL_P(str); + op2_cursor = Z_STRVAL_P(compared); + for (i = 0; i < Z_STRLEN_P(compared); i++) { - case IS_OBJECT: { - int copy; - zval expr; - zend_make_printable_zval(*tmp, &expr, ©); - smart_str_appendl(implstr, Z_STRVAL(expr), Z_STRLEN(expr)); - if (copy) { - zval_dtor(&expr); - } + if (tolower(*op1_cursor) != tolower(*op2_cursor)) { + return 0; } - break; - default: - tmp_val = **tmp; - zval_copy_ctor(&tmp_val); - convert_to_string(&tmp_val); - smart_str_appendl(implstr, Z_STRVAL(tmp_val), Z_STRLEN(tmp_val)); - zval_dtor(&tmp_val); - break; + op1_cursor++; + op2_cursor++; } + + return 1; } /** - * Fast join function - * This function is an adaption of the php_implode function - * + * Checks if a zval string starts with a string */ -void zephir_fast_join_str(zval *return_value, char *glue, unsigned int glue_length, zval *pieces TSRMLS_DC) { - - zval **tmp; - HashTable *arr; - HashPosition pos; - smart_str implstr = {0}; - unsigned int numelems, i = 0; - - if (Z_TYPE_P(pieces) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid arguments supplied for fast_join()"); - RETURN_EMPTY_STRING(); +int zephir_start_with_str(const zval *str, char *compared, unsigned int compared_length) +{ + if (Z_TYPE_P(str) != IS_STRING || compared_length > Z_STRLEN_P(str)) { + return 0; } - arr = Z_ARRVAL_P(pieces); - numelems = zend_hash_num_elements(arr); - - if (numelems == 0) { - RETURN_EMPTY_STRING(); - } + return !memcmp(Z_STRVAL_P(str), compared, compared_length); +} - zend_hash_internal_pointer_reset_ex(arr, &pos); +/** + * Checks if a string starts with other string + */ +int zephir_start_with_str_str(char *str, unsigned int str_length, char *compared, unsigned int compared_length) +{ - while (zend_hash_get_current_data_ex(arr, (void **) &tmp, &pos) == SUCCESS) { - zephir_append_printable_zval(&implstr, tmp TSRMLS_CC); - if (++i != numelems) { - smart_str_appendl(&implstr, glue, glue_length); - } - zend_hash_move_forward_ex(arr, &pos); + if (compared_length > str_length) { + return 0; } - smart_str_0(&implstr); - if (implstr.len) { - RETURN_STRINGL(implstr.c, implstr.len, 0); - } else { - smart_str_free(&implstr); - RETURN_EMPTY_STRING(); - } + return !memcmp(str, compared, compared_length); } /** - * Convert dash/underscored texts returning camelized - * (an optional delimiter can be specified as character-mask as for ltrim) + * Checks if a zval string ends with a zval string */ -void zephir_camelize(zval *return_value, const zval *str, const zval *delimiter) { +int zephir_end_with(const zval *str, const zval *compared, zval *case_sensitive) +{ - int i, len, delim_len, pre_del = 1; - smart_str camelize_str = {0}; - char *marker, ch, *delim; + int sensitive = 0; + int i; + char *op1_cursor, *op2_cursor; - if (UNEXPECTED(Z_TYPE_P(str) != IS_STRING)) { - zend_error(E_WARNING, "Invalid arguments supplied for camelize()"); - RETURN_EMPTY_STRING(); + if (Z_TYPE_P(str) != IS_STRING || Z_TYPE_P(compared) != IS_STRING) { + return 0; } - if (delimiter == NULL || Z_TYPE_P(delimiter) == IS_NULL) { - delim = "_-"; - delim_len = 2; - } else if (Z_TYPE_P(delimiter) == IS_STRING && Z_STRLEN_P(delimiter) > 0) { - delim = Z_STRVAL_P(delimiter); - delim_len = Z_STRLEN_P(delimiter); - } else { - zend_error(E_WARNING, "The second argument passed to the camelize() must be a string containing at least one character"); - RETURN_EMPTY_STRING(); + if (!Z_STRLEN_P(compared) || !Z_STRLEN_P(str) || Z_STRLEN_P(compared) > Z_STRLEN_P(str)) { + return 0; } - marker = Z_STRVAL_P(str); - len = Z_STRLEN_P(str); - - for (i = 0; i < len; i++) { - ch = marker[i]; + if (case_sensitive) { + sensitive = zend_is_true(case_sensitive); + } - if (memchr(delim, ch, delim_len)) { - pre_del = 1; - continue; - } - if (pre_del == 1) { - smart_str_appendc(&camelize_str, toupper(ch)); - pre_del = 0; - } else { - smart_str_appendc(&camelize_str, tolower(ch)); - } + if (!sensitive) { + return !memcmp(Z_STRVAL_P(str) + Z_STRLEN_P(str) - Z_STRLEN_P(compared), Z_STRVAL_P(compared), Z_STRLEN_P(compared)); } - smart_str_0(&camelize_str); + op1_cursor = Z_STRVAL_P(str) + Z_STRLEN_P(str) - Z_STRLEN_P(compared); + op2_cursor = Z_STRVAL_P(compared); + + for (i = 0; i < Z_STRLEN_P(compared); ++i) { + + if (tolower(*op1_cursor) != tolower(*op2_cursor)) { + return 0; + } - if (camelize_str.c) { - RETURN_STRINGL(camelize_str.c, camelize_str.len, 0); + ++op1_cursor; + ++op2_cursor; } - RETURN_EMPTY_STRING(); + return 1; } /** - * Convert a camelized to a dash/underscored texts (an optional delimiter can be specified) + * Checks if a zval string ends with a *char string */ -void zephir_uncamelize(zval *return_value, const zval *str, const zval *delimiter) { - - unsigned int i; - smart_str uncamelize_str = {0}; - char *marker, ch, delim; +int zephir_end_with_str(const zval *str, char *compared, unsigned int compared_length) +{ if (Z_TYPE_P(str) != IS_STRING) { - zend_error(E_WARNING, "Invalid arguments supplied for uncamelize()"); - RETURN_EMPTY_STRING(); + return 0; } - if (delimiter == NULL || Z_TYPE_P(delimiter) == IS_NULL) { - delim = '_'; - } else if (Z_TYPE_P(delimiter) == IS_STRING && Z_STRLEN_P(delimiter) == 1) { - delim = *(Z_STRVAL_P(delimiter)); - } else { - zend_error(E_WARNING, "Second argument passed to the uncamelize() must be a string of one character"); - RETURN_EMPTY_STRING(); + if (!compared_length || !Z_STRLEN_P(str) || compared_length > Z_STRLEN_P(str)) { + return 0; } - marker = Z_STRVAL_P(str); - for (i = 0; i < Z_STRLEN_P(str); i++) { + return !memcmp(Z_STRVAL_P(str) + Z_STRLEN_P(str) - compared_length, compared, compared_length); +} - ch = *marker; +/** + * Makes a substr like the PHP function. This function SUPPORT negative from and length + */ +void zephir_substr(zval *return_value, zval *str, long f, long l, int flags) +{ + zval copy; + int use_copy = 0; + int str_len; - if (ch == '\0') { - break; + if (Z_TYPE_P(str) != IS_STRING) { + + if (Z_TYPE_P(str) == IS_NULL || Z_TYPE_P(str) == IS_TRUE || Z_TYPE_P(str) == IS_FALSE) { + RETURN_FALSE; } - if (ch >= 'A' && ch <= 'Z') { - if (i > 0) { - smart_str_appendc(&uncamelize_str, delim); + if (Z_TYPE_P(str) != IS_STRING) { + use_copy = zend_make_printable_zval(str, ©); + if (use_copy) { + str = © } - smart_str_appendc(&uncamelize_str, (*marker) + 32); - } else { - smart_str_appendc(&uncamelize_str, (*marker)); } - - marker++; } - smart_str_0(&uncamelize_str); - if (uncamelize_str.c) { - RETURN_STRINGL(uncamelize_str.c, uncamelize_str.len, 0); - } else { - RETURN_EMPTY_STRING(); + str_len = Z_STRLEN_P(str); + if ((flags & ZEPHIR_SUBSTR_NO_LENGTH) == ZEPHIR_SUBSTR_NO_LENGTH) { + l = str_len; } -} - -/** - * Fast call to explode php function - */ -void zephir_fast_explode(zval *return_value, zval *delimiter, zval *str, long limit TSRMLS_DC) { - if (UNEXPECTED(Z_TYPE_P(str) != IS_STRING || Z_TYPE_P(delimiter) != IS_STRING)) { - zend_error(E_WARNING, "Invalid arguments supplied for explode()"); - RETURN_EMPTY_STRING(); + if ((l < 0 && -l > str_len)) { + if (use_copy) { + zval_dtor(str); + } + RETURN_FALSE; + } else { + if (l > str_len) { + l = str_len; + } } - array_init(return_value); - php_explode(delimiter, str, return_value, limit); -} - -/** - * Fast call to explode php function - */ -void zephir_fast_explode_str(zval *return_value, const char *delimiter, int delimiter_length, zval *str, long limit TSRMLS_DC) { - - zval delimiter_zval; - - if (UNEXPECTED(Z_TYPE_P(str) != IS_STRING)) { - zend_error(E_WARNING, "Invalid arguments supplied for explode()"); - RETURN_EMPTY_STRING(); - } - - ZVAL_STRINGL(&delimiter_zval, delimiter, delimiter_length, 0); - - array_init(return_value); - php_explode(&delimiter_zval, str, return_value, limit); -} - -/** - * Check if a string is contained into another - */ -int zephir_memnstr(const zval *haystack, const zval *needle ZEPHIR_DEBUG_PARAMS) { - - if (Z_TYPE_P(haystack) != IS_STRING || Z_TYPE_P(needle) != IS_STRING) { - #ifndef ZEPHIR_RELEASE - zend_error(E_WARNING, "Invalid arguments supplied for memnstr in %s on line %d", file, line); - #else - zend_error(E_WARNING, "Invalid arguments supplied for memnstr()"); - #endif - return 0; - } - - if (Z_STRLEN_P(haystack) >= Z_STRLEN_P(needle)) { - return php_memnstr(Z_STRVAL_P(haystack), Z_STRVAL_P(needle), Z_STRLEN_P(needle), Z_STRVAL_P(haystack) + Z_STRLEN_P(haystack)) ? 1 : 0; - } - - return 0; -} - -/** - * Check if a string is contained into another - */ -int zephir_memnstr_str(const zval *haystack, char *needle, unsigned int needle_length ZEPHIR_DEBUG_PARAMS) { - - if (Z_TYPE_P(haystack) != IS_STRING) { - #ifndef ZEPHIR_RELEASE - zend_error(E_WARNING, "Invalid arguments supplied for memnstr in %s on line %d", file, line); - #else - zend_error(E_WARNING, "Invalid arguments supplied for memnstr()"); - #endif - return 0; - } - - if (Z_STRLEN_P(haystack) >= needle_length) { - return php_memnstr(Z_STRVAL_P(haystack), needle, needle_length, Z_STRVAL_P(haystack) + Z_STRLEN_P(haystack)) ? 1 : 0; - } - - return 0; -} - -/** - * Inmediate function resolution for strpos function - */ -void zephir_fast_strpos(zval *return_value, const zval *haystack, const zval *needle, unsigned int offset) { - - const char *found = NULL; - - if (UNEXPECTED(Z_TYPE_P(haystack) != IS_STRING || Z_TYPE_P(needle) != IS_STRING)) { - ZVAL_NULL(return_value); - zend_error(E_WARNING, "Invalid arguments supplied for strpos()"); - return; - } - - if (offset > Z_STRLEN_P(haystack)) { - ZVAL_NULL(return_value); - zend_error(E_WARNING, "Offset not contained in string"); - return; - } - - if (!Z_STRLEN_P(needle)) { - ZVAL_NULL(return_value); - zend_error(E_WARNING, "Empty delimiter"); - return; - } - - found = php_memnstr(Z_STRVAL_P(haystack)+offset, Z_STRVAL_P(needle), Z_STRLEN_P(needle), Z_STRVAL_P(haystack) + Z_STRLEN_P(haystack)); - - if (found) { - ZVAL_LONG(return_value, found-Z_STRVAL_P(haystack)); - } else { - ZVAL_BOOL(return_value, 0); - } - -} - -/** - * Inmediate function resolution for strpos function - */ -void zephir_fast_strpos_str(zval *return_value, const zval *haystack, char *needle, unsigned int needle_length) { - - const char *found = NULL; - - if (UNEXPECTED(Z_TYPE_P(haystack) != IS_STRING)) { - ZVAL_NULL(return_value); - zend_error(E_WARNING, "Invalid arguments supplied for strpos()"); - return; - } - - found = php_memnstr(Z_STRVAL_P(haystack), needle, needle_length, Z_STRVAL_P(haystack) + Z_STRLEN_P(haystack)); - - if (found) { - ZVAL_LONG(return_value, found-Z_STRVAL_P(haystack)); - } else { - ZVAL_BOOL(return_value, 0); - } -} - -/** - * Inmediate function resolution for stripos function - */ -void zephir_fast_stripos_str(zval *return_value, zval *haystack, char *needle, unsigned int needle_length) { - - const char *found = NULL; - char *needle_dup, *haystack_dup; - - if (UNEXPECTED(Z_TYPE_P(haystack) != IS_STRING)) { - ZVAL_NULL(return_value); - zend_error(E_WARNING, "Invalid arguments supplied for stripos()"); - return; - } - - haystack_dup = estrndup(Z_STRVAL_P(haystack), Z_STRLEN_P(haystack)); - php_strtolower(haystack_dup, Z_STRLEN_P(haystack)); - - needle_dup = estrndup(needle, needle_length); - php_strtolower(needle_dup, needle_length); - - found = php_memnstr(haystack_dup, needle, needle_length, haystack_dup + Z_STRLEN_P(haystack)); - - efree(haystack_dup); - efree(needle_dup); - - if (found) { - ZVAL_LONG(return_value, found-Z_STRVAL_P(haystack)); + if (f > str_len) { + if (use_copy) { + zval_dtor(str); + } + RETURN_FALSE; } else { - ZVAL_BOOL(return_value, 0); + if (f < 0 && -f > str_len) { + f = 0; + } } -} -/** - * Immediate function resolution for str_replace function - */ -void zephir_fast_str_replace(zval **return_value_ptr, zval *search, zval *replace, zval *subject TSRMLS_DC) { - - zval replace_copy, search_copy; - zval *return_value = *return_value_ptr; - int copy_replace = 0, copy_search = 0; - - if (Z_TYPE_P(subject) != IS_STRING) { - ZVAL_NULL(return_value); - zend_error(E_WARNING, "Invalid arguments supplied for str_replace()"); - return; + if (l < 0 && (l + str_len - f) < 0) { + if (use_copy) { + zval_dtor(str); + } + RETURN_FALSE; } - /** - * Fallback to userland function if the first parameter is an array + /* if "from" position is negative, count start position from the end + * of the string */ - if (Z_TYPE_P(search) == IS_ARRAY) { - do { - zval *params[] = { search, replace, subject }; - zval_ptr_dtor(return_value_ptr); - *return_value_ptr = NULL; - zephir_call_func_aparams(return_value_ptr, "str_replace", sizeof("str_replace")-1, NULL, 0, 3, params TSRMLS_CC); - return; - } while(0); - } - - if (Z_TYPE_P(replace) != IS_STRING) { - zend_make_printable_zval(replace, &replace_copy, ©_replace); - if (copy_replace) { - replace = &replace_copy; + if (f < 0) { + f = str_len + f; + if (f < 0) { + f = 0; } } - if (Z_TYPE_P(search) != IS_STRING) { - zend_make_printable_zval(search, &search_copy, ©_search); - if (copy_search) { - search = &search_copy; + /* if "length" position is negative, set it to the length + * needed to stop that many chars from the end of the string + */ + if (l < 0) { + l = (str_len - f) + l; + if (l < 0) { + l = 0; } } - Z_TYPE_P(return_value) = IS_STRING; - if (Z_STRLEN_P(subject) == 0) { - ZVAL_STRINGL(return_value, "", 0, 1); - return; - } - - if (Z_STRLEN_P(search) == 1) { - php_char_to_str_ex(Z_STRVAL_P(subject), - Z_STRLEN_P(subject), - Z_STRVAL_P(search)[0], - Z_STRVAL_P(replace), - Z_STRLEN_P(replace), - return_value, - 1, - NULL); - } else { - if (Z_STRLEN_P(search) > 1) { - Z_STRVAL_P(return_value) = php_str_to_str_ex(Z_STRVAL_P(subject), Z_STRLEN_P(subject), - Z_STRVAL_P(search), Z_STRLEN_P(search), - Z_STRVAL_P(replace), Z_STRLEN_P(replace), &Z_STRLEN_P(return_value), 1, NULL); - } else { - MAKE_COPY_ZVAL(&subject, return_value); + if (f >= str_len) { + if (use_copy) { + zval_dtor(str); } + RETURN_FALSE; } - if (copy_replace) { - zval_dtor(replace); - } - - if (copy_search) { - zval_dtor(search); + if ((f + l) > str_len) { + l = str_len - f; } -} -/** - * Fast call to PHP trim() function - */ -void zephir_fast_trim(zval *return_value, zval *str, zval *charlist, int where TSRMLS_DC) { - - zval copy; - int use_copy = 0; - - if (Z_TYPE_P(str) != IS_STRING) { - zend_make_printable_zval(str, ©, &use_copy); + if (!l) { if (use_copy) { - str = © + zval_dtor(str); } + RETURN_EMPTY_STRING(); } - if (charlist && Z_TYPE_P(charlist) == IS_STRING) { - php_trim(Z_STRVAL_P(str), Z_STRLEN_P(str), Z_STRVAL_P(charlist), Z_STRLEN_P(charlist), return_value, where TSRMLS_CC); - } else { - php_trim(Z_STRVAL_P(str), Z_STRLEN_P(str), NULL, 0, return_value, where TSRMLS_CC); - } + ZVAL_STRINGL(return_value, Z_STRVAL_P(str) + f, l); if (use_copy) { - zval_dtor(©); + zval_dtor(str); } + + return; } /** - * Fast call to PHP strip_tags() function + * Appends to a smart_str a printable version of a zval */ -void zephir_fast_strip_tags(zval *return_value, zval *str) { +static void zephir_append_printable_zval(smart_str *implstr, zval *tmp) +{ + switch (Z_TYPE_P(tmp)) { - zval copy; - int use_copy = 0; - char *stripped; - size_t len; + case IS_STRING: + smart_str_appendl(implstr, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp)); + break; - if (Z_TYPE_P(str) != IS_STRING) { - zend_make_printable_zval(str, ©, &use_copy); - if (use_copy) { - str = © - } + default: + smart_str_append(implstr, _zval_get_string_func(tmp)); + break; } +} - stripped = estrndup(Z_STRVAL_P(str), Z_STRLEN_P(str)); - len = php_strip_tags(stripped, Z_STRLEN_P(str), NULL, NULL, 0); +void zephir_append_printable_array(smart_str *implstr, const zval *value) +{ - if (use_copy) { - zval_dtor(©); - } + zval *tmp; + zend_array *arr; + unsigned int numelems, i = 0; - ZVAL_STRINGL(return_value, stripped, len, 0); -} + arr = Z_ARRVAL_P(value); + numelems = zend_hash_num_elements(arr); -/** - * Fast call to PHP strtoupper() function - */ -void zephir_fast_strtoupper(zval *return_value, zval *str) { + smart_str_appendc(implstr, '['); - zval copy; - int use_copy = 0; - char *lower_str; - unsigned int length; + if (numelems > 0) { - if (Z_TYPE_P(str) != IS_STRING) { - zend_make_printable_zval(str, ©, &use_copy); - if (use_copy) { - str = © - } - } + ZEND_HASH_FOREACH_VAL(arr, tmp) { - length = Z_STRLEN_P(str); - lower_str = estrndup(Z_STRVAL_P(str), length); - php_strtoupper(lower_str, length); + if (Z_TYPE_P(tmp) == IS_OBJECT) { - if (use_copy) { - zval_dtor(str); + } else { + if (Z_TYPE_P(tmp) == IS_ARRAY) { + zephir_append_printable_array(implstr, tmp); + } else { + zephir_append_printable_zval(implstr, tmp); + } + } + + if (++i != numelems) { + smart_str_appendc(implstr, ','); + } + + } ZEND_HASH_FOREACH_END(); } - ZVAL_STRINGL(return_value, lower_str, length, 0); + smart_str_appendc(implstr, ']'); } /** - * Checks if a zval string starts with a zval string + * Creates a unique key to be used as index in a hash */ -int zephir_start_with(const zval *str, const zval *compared, zval *case_sensitive) +void zephir_unique_key(zval *return_value, const zval *prefix, zval *value) { - int i; - int sensitive = 0; - char *op1_cursor, *op2_cursor; - - if (Z_TYPE_P(str) != IS_STRING || Z_TYPE_P(compared) != IS_STRING) { - return 0; - } - - if (!Z_STRLEN_P(compared) || !Z_STRLEN_P(str) || Z_STRLEN_P(compared) > Z_STRLEN_P(str)) { - return 0; - } + smart_str implstr = {0}; - if (case_sensitive) { - sensitive = zend_is_true(case_sensitive); + if (Z_TYPE_P(prefix) == IS_STRING) { + smart_str_appendl(&implstr, Z_STRVAL_P(prefix), Z_STRLEN_P(prefix)); } - if (!sensitive) { - return !memcmp(Z_STRVAL_P(str), Z_STRVAL_P(compared), Z_STRLEN_P(compared)); + if (Z_TYPE_P(value) == IS_ARRAY) { + zephir_append_printable_array(&implstr, value); + } else { + zephir_append_printable_zval(&implstr, value); } - op1_cursor = Z_STRVAL_P(str); - op2_cursor = Z_STRVAL_P(compared); - for (i = 0; i < Z_STRLEN_P(compared); i++) { - - if (tolower(*op1_cursor) != tolower(*op2_cursor)) { - return 0; - } + smart_str_0(&implstr); - op1_cursor++; - op2_cursor++; + if (implstr.s) { + RETURN_STR(implstr.s); + } else { + smart_str_free(&implstr); + RETURN_NULL(); } - - return 1; } /** - * Checks if a zval string starts with a string + * Fast call to php join function */ -int zephir_start_with_str(const zval *str, char *compared, unsigned int compared_length) +void zephir_fast_join(zval *result, zval *glue, zval *pieces) { - - if (Z_TYPE_P(str) != IS_STRING || compared_length > Z_STRLEN_P(str)) { - return 0; + if (Z_TYPE_P(glue) != IS_STRING || Z_TYPE_P(pieces) != IS_ARRAY) { + ZVAL_NULL(result); + zend_error(E_WARNING, "Invalid arguments supplied for join()"); + return; } - return !memcmp(Z_STRVAL_P(str), compared, compared_length); + php_implode(Z_STR_P(glue), pieces, result); } /** - * Checks if a string starts with other string + * Fast join function + * This function is an adaption of the php_implode function + * */ -int zephir_start_with_str_str(char *str, unsigned int str_length, char *compared, unsigned int compared_length) +void zephir_fast_join_str(zval *return_value, char *glue, unsigned int glue_length, zval *pieces) { + zval *tmp; + int numelems; + zend_string *str; + char *cptr; + size_t len = 0; + zend_string **strings, **strptr; + zend_array *arr; - if (compared_length > str_length) { - return 0; - } - - return !memcmp(str, compared, compared_length); -} - -/** - * Checks if a zval string ends with a zval string - */ -int zephir_end_with(const zval *str, const zval *compared, zval *case_sensitive) { - - int sensitive = 0; - int i; - char *op1_cursor, *op2_cursor; - - if (Z_TYPE_P(str) != IS_STRING || Z_TYPE_P(compared) != IS_STRING) { - return 0; - } - - if (!Z_STRLEN_P(compared) || !Z_STRLEN_P(str) || Z_STRLEN_P(compared) > Z_STRLEN_P(str)) { - return 0; - } - - if (case_sensitive) { - sensitive = zend_is_true(case_sensitive); - } - - if (!sensitive) { - return !memcmp(Z_STRVAL_P(str) + Z_STRLEN_P(str) - Z_STRLEN_P(compared), Z_STRVAL_P(compared), Z_STRLEN_P(compared)); + if (Z_TYPE_P(pieces) != IS_ARRAY) { + php_error_docref(NULL, E_WARNING, "Invalid arguments supplied for fast_join()"); + RETURN_EMPTY_STRING(); } - op1_cursor = Z_STRVAL_P(str) + Z_STRLEN_P(str) - Z_STRLEN_P(compared); - op2_cursor = Z_STRVAL_P(compared); - - for (i = 0; i < Z_STRLEN_P(compared); ++i) { + arr = Z_ARRVAL_P(pieces); + numelems = zend_hash_num_elements(arr); - if (tolower(*op1_cursor) != tolower(*op2_cursor)) { - return 0; + if (numelems == 0) { + RETURN_EMPTY_STRING(); + } else if (numelems == 1) { + /* loop to search the first not undefined element... */ + ZEND_HASH_FOREACH_VAL(arr, tmp) { + RETURN_STR(zval_get_string(tmp)); + } ZEND_HASH_FOREACH_END(); + } + + strings = emalloc((sizeof(zend_long) + sizeof(zend_string *)) * numelems); + strptr = strings - 1; + + ZEND_HASH_FOREACH_VAL(arr, tmp) { + if (Z_TYPE_P(tmp) == IS_LONG) { + double val = Z_LVAL_P(tmp); + *++strptr = NULL; + ((zend_long *) (strings + numelems))[strptr - strings] = Z_LVAL_P(tmp); + if (val < 0) { + val = -10 * val; + } + if (val < 10) { + len++; + } else { + len += (int) log10(10 * (double) val); + } + } else { + *++strptr = zval_get_string(tmp); + len += ZSTR_LEN(*strptr); } + } ZEND_HASH_FOREACH_END(); - ++op1_cursor; - ++op2_cursor; - } + str = zend_string_alloc(len + (numelems - 1) * glue_length, 0); + cptr = ZSTR_VAL(str) + ZSTR_LEN(str); + *cptr = 0; - return 1; -} - -/** - * Checks if a zval string ends with a *char string - */ -int zephir_end_with_str(const zval *str, char *compared, unsigned int compared_length) { + do { + if (*strptr) { + cptr -= ZSTR_LEN(*strptr); + memcpy(cptr, ZSTR_VAL(*strptr), ZSTR_LEN(*strptr)); + zend_string_release(*strptr); + } else { + char *oldPtr = cptr; + char oldVal = *cptr; + zend_long val = ((zend_long *) (strings + numelems))[strptr - strings]; + cptr = zend_print_long_to_buf(cptr, val); + *oldPtr = oldVal; + } - if (Z_TYPE_P(str) != IS_STRING) { - return 0; - } + cptr -= glue_length; + memcpy(cptr, glue, glue_length); + } while (--strptr > strings); - if (!compared_length || !Z_STRLEN_P(str) || compared_length > Z_STRLEN_P(str)) { - return 0; + if (*strptr) { + memcpy(ZSTR_VAL(str), ZSTR_VAL(*strptr), ZSTR_LEN(*strptr)); + zend_string_release(*strptr); + } else { + char *oldPtr = cptr; + char oldVal = *cptr; + zend_print_long_to_buf(cptr, ((zend_long *) (strings + numelems))[strptr - strings]); + *oldPtr = oldVal; } - return !memcmp(Z_STRVAL_P(str) + Z_STRLEN_P(str) - compared_length, compared, compared_length); + efree(strings); + RETURN_NEW_STR(str); } /** - * + * Convert dash/underscored texts returning camelized + * (an optional delimiter can be specified as character-mask as for ltrim) */ -void zephir_random_string(zval *return_value, const zval *type, const zval *length TSRMLS_DC) { - - long i, rand_type, ch; - smart_str random_str = {0}; - - if (Z_TYPE_P(type) != IS_LONG) { - return; - } - - if (Z_LVAL_P(type) > PH_RANDOM_NOZERO) { - return; - } +void zephir_camelize(zval *return_value, const zval *str, const zval *delimiter) +{ - if (Z_TYPE_P(length) != IS_LONG) { - return; - } + int i, len, delim_len, pre_del = 1; + smart_str camelize_str = {0}; + char *marker, ch, *delim; - /** Generate seed */ - if (!BG(mt_rand_is_seeded)) { - php_mt_srand(GENERATE_SEED() TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(str) != IS_STRING)) { + zend_error(E_WARNING, "Invalid arguments supplied for camelize()"); + RETURN_EMPTY_STRING(); } - for (i = 0; i < Z_LVAL_P(length); i++) { - - switch (Z_LVAL_P(type)) { - - case PH_RANDOM_ALNUM: - rand_type = (long) (php_mt_rand(TSRMLS_C) >> 1); - RAND_RANGE(rand_type, 0, 3, PHP_MT_RAND_MAX); - break; - - case PH_RANDOM_ALPHA: - rand_type = (long) (php_mt_rand(TSRMLS_C) >> 1); - RAND_RANGE(rand_type, 1, 2, PHP_MT_RAND_MAX); - break; - - case PH_RANDOM_HEXDEC: - rand_type = (long) (php_mt_rand(TSRMLS_C) >> 1); - RAND_RANGE(rand_type, 0, 1, PHP_MT_RAND_MAX); - break; + if (delimiter == NULL || Z_TYPE_P(delimiter) == IS_NULL) { + delim = "_-"; + delim_len = 2; + } else if (Z_TYPE_P(delimiter) == IS_STRING && Z_STRLEN_P(delimiter) > 0) { + delim = Z_STRVAL_P(delimiter); + delim_len = Z_STRLEN_P(delimiter); + } else { + zend_error(E_WARNING, "The second argument passed to the camelize() must be a string containing at least one character"); + RETURN_EMPTY_STRING(); + } - case PH_RANDOM_NUMERIC: - rand_type = 0; - break; + marker = Z_STRVAL_P(str); + len = Z_STRLEN_P(str); - case PH_RANDOM_NOZERO: - rand_type = 5; - break; + for (i = 0; i < len; i++) { + ch = marker[i]; - default: - continue; + if (memchr(delim, ch, delim_len)) { + pre_del = 1; + continue; } - - switch (rand_type) { - - case 0: - ch = (long) (php_mt_rand(TSRMLS_C) >> 1); - RAND_RANGE(ch, '0', '9', PHP_MT_RAND_MAX); - break; - - case 1: - ch = (long) (php_mt_rand(TSRMLS_C) >> 1); - RAND_RANGE(ch, 'a', 'f', PHP_MT_RAND_MAX); - break; - - case 2: - ch = (long) (php_mt_rand(TSRMLS_C) >> 1); - RAND_RANGE(ch, 'a', 'z', PHP_MT_RAND_MAX); - break; - - case 3: - ch = (long) (php_mt_rand(TSRMLS_C) >> 1); - RAND_RANGE(ch, 'A', 'Z', PHP_MT_RAND_MAX); - break; - - case 5: - ch = (long) (php_mt_rand(TSRMLS_C) >> 1); - RAND_RANGE(ch, '1', '9', PHP_MT_RAND_MAX); - break; - - default: - continue; + if (pre_del == 1) { + smart_str_appendc(&camelize_str, toupper(ch)); + pre_del = 0; + } else { + smart_str_appendc(&camelize_str, tolower(ch)); } - - smart_str_appendc(&random_str, (unsigned int) ch); } - smart_str_0(&random_str); + smart_str_0(&camelize_str); - if (random_str.len) { - RETURN_STRINGL(random_str.c, random_str.len, 0); + if (camelize_str.s) { + RETURN_STR(camelize_str.s); } else { - smart_str_free(&random_str); RETURN_EMPTY_STRING(); } } /** - * Removes slashes at the end of a string + * Convert a camelized to a dash/underscored texts (a single-character optional delimiter can be specified) */ -void zephir_remove_extra_slashes(zval *return_value, const zval *str) { - - char *cursor, *removed_str; +void zephir_uncamelize(zval *return_value, const zval *str, const zval *delimiter) +{ unsigned int i; + smart_str uncamelize_str = {0}; + char *marker, ch, delim; if (Z_TYPE_P(str) != IS_STRING) { + zend_error(E_WARNING, "Invalid arguments supplied for uncamelize()"); RETURN_EMPTY_STRING(); } - if (Z_STRLEN_P(str) > 1) { - cursor = Z_STRVAL_P(str); - cursor += (Z_STRLEN_P(str) - 1); - for (i = Z_STRLEN_P(str); i > 0; i--) { - if ((*cursor) == '/') { - cursor--; - continue; - } - break; - } + if (delimiter == NULL || Z_TYPE_P(delimiter) == IS_NULL) { + delim = '_'; + } else if (Z_TYPE_P(delimiter) == IS_STRING && Z_STRLEN_P(delimiter) == 1) { + delim = *(Z_STRVAL_P(delimiter)); } else { - i = Z_STRLEN_P(str); + zend_error(E_WARNING, "Second argument passed to the uncamelize() must be a string of one character"); + RETURN_EMPTY_STRING(); } - removed_str = emalloc(i + 1); - memcpy(removed_str, Z_STRVAL_P(str), i); - removed_str[i] = '\0'; - - RETURN_STRINGL(removed_str, i, 0); -} - -/** - * This function is not external in the Zend API so we redeclare it here in the extension - */ -int zephir_spprintf(char **message, int max_len, char *format, ...) -{ - va_list arg; - int len; - - va_start(arg, format); - len = vspprintf(message, max_len, format, arg); - va_end(arg); - return len; -} - -/** - * Makes a substr like the PHP function. This function SUPPORT negative from and length - */ -void zephir_substr(zval *return_value, zval *str, long f, long l, int flags) { - - zval copy; - int use_copy = 0; - int str_len; - - if (Z_TYPE_P(str) != IS_STRING) { - - if (Z_TYPE_P(str) == IS_NULL || Z_TYPE_P(str) == IS_BOOL) { - RETURN_FALSE; + marker = Z_STRVAL_P(str); + for (i = 0; i < Z_STRLEN_P(str); i++) { + ch = *marker; + if (ch == '\0') { + break; } - - if (Z_TYPE_P(str) != IS_STRING) { - zend_make_printable_zval(str, ©, &use_copy); - if (use_copy) { - str = © + if (ch >= 'A' && ch <= 'Z') { + if (i > 0) { + smart_str_appendc(&uncamelize_str, delim); } + smart_str_appendc(&uncamelize_str, (*marker) + 32); + } else { + smart_str_appendc(&uncamelize_str, (*marker)); } + marker++; } + smart_str_0(&uncamelize_str); - str_len = Z_STRLEN_P(str); - if ((flags & ZEPHIR_SUBSTR_NO_LENGTH) == ZEPHIR_SUBSTR_NO_LENGTH) { - l = str_len; - } - - if ((l < 0 && -l > str_len)) { - if (use_copy) { - zval_dtor(str); - } - RETURN_FALSE; - } else { - if (l > str_len) { - l = str_len; - } - } - - if (f > str_len) { - if (use_copy) { - zval_dtor(str); - } - RETURN_FALSE; + if (uncamelize_str.s) { + RETURN_STR(uncamelize_str.s); } else { - if (f < 0 && -f > str_len) { - f = 0; - } + RETURN_EMPTY_STRING(); } +} - if (l < 0 && (l + str_len - f) < 0) { - if (use_copy) { - zval_dtor(str); - } - RETURN_FALSE; - } +/** + * Check if a string is contained into another + */ +int zephir_memnstr(const zval *haystack, const zval *needle ZEPHIR_DEBUG_PARAMS) +{ - /* if "from" position is negative, count start position from the end - * of the string - */ - if (f < 0) { - f = str_len + f; - if (f < 0) { - f = 0; - } + if (Z_TYPE_P(haystack) != IS_STRING || Z_TYPE_P(needle) != IS_STRING) { + #ifndef ZEPHIR_RELEASE + zend_error(E_WARNING, "Invalid arguments supplied for memnstr in %s on line %d", file, line); + #else + zend_error(E_WARNING, "Invalid arguments supplied for memnstr()"); + #endif + return 0; } - /* if "length" position is negative, set it to the length - * needed to stop that many chars from the end of the string - */ - if (l < 0) { - l = (str_len - f) + l; - if (l < 0) { - l = 0; - } + if (Z_STRLEN_P(haystack) >= Z_STRLEN_P(needle)) { + return php_memnstr(Z_STRVAL_P(haystack), Z_STRVAL_P(needle), Z_STRLEN_P(needle), Z_STRVAL_P(haystack) + Z_STRLEN_P(haystack)) ? 1 : 0; } - if (f >= str_len) { - if (use_copy) { - zval_dtor(str); - } - RETURN_FALSE; - } + return 0; +} - if ((f + l) > str_len) { - l = str_len - f; +/** + * Check if a string is contained into another + */ +int zephir_memnstr_str(const zval *haystack, char *needle, unsigned int needle_length ZEPHIR_DEBUG_PARAMS) +{ + if (Z_TYPE_P(haystack) != IS_STRING) { + #ifndef ZEPHIR_RELEASE + zend_error(E_WARNING, "Invalid arguments supplied for memnstr in %s on line %d", file, line); + #else + zend_error(E_WARNING, "Invalid arguments supplied for memnstr()"); + #endif + return 0; } - if (!l) { - if (use_copy) { - zval_dtor(str); - } - RETURN_EMPTY_STRING(); + if (Z_STRLEN_P(haystack) >= needle_length) { + return php_memnstr(Z_STRVAL_P(haystack), needle, needle_length, Z_STRVAL_P(haystack) + Z_STRLEN_P(haystack)) ? 1 : 0; } - ZVAL_STRINGL(return_value, Z_STRVAL_P(str) + f, l, 1); + return 0; +} - if (use_copy) { - zval_dtor(str); +/** + * Fast call to explode php function + */ +void zephir_fast_explode(zval *return_value, zval *delimiter, zval *str, long limit) +{ + if (UNEXPECTED(Z_TYPE_P(str) != IS_STRING || Z_TYPE_P(delimiter) != IS_STRING)) { + zend_error(E_WARNING, "Invalid arguments supplied for explode()"); + RETURN_EMPTY_STRING(); } - return; + array_init(return_value); + php_explode(Z_STR_P(delimiter), Z_STR_P(str), return_value, limit); } -void zephir_append_printable_array(smart_str *implstr, zval *value TSRMLS_DC) { - - zval **tmp; - HashTable *arr; - HashPosition pos; - unsigned int numelems, i = 0, str_len; - - arr = Z_ARRVAL_P(value); - numelems = zend_hash_num_elements(arr); - - smart_str_appendc(implstr, '['); - - if (numelems > 0) { - zend_hash_internal_pointer_reset_ex(arr, &pos); - while (zend_hash_get_current_data_ex(arr, (void **) &tmp, &pos) == SUCCESS) { - - /** - * We don't serialize objects - */ - if (Z_TYPE_PP(tmp) == IS_OBJECT) { - smart_str_appendc(implstr, 'O'); - { - char stmp[MAX_LENGTH_OF_LONG + 1]; - str_len = slprintf(stmp, sizeof(stmp), "%ld", Z_OBJVAL_PP(tmp).handle); - smart_str_appendl(implstr, stmp, str_len); - } - } else { - if (Z_TYPE_PP(tmp) == IS_ARRAY) { - zephir_append_printable_array(implstr, *tmp TSRMLS_CC); - } else { - zephir_append_printable_zval(implstr, tmp TSRMLS_CC); - } - } - - if (++i != numelems) { - smart_str_appendc(implstr, ','); - } +/** + * Fast call to explode php function + */ +void zephir_fast_explode_str(zval *return_value, const char *delim, int delim_length, zval *str, long limit) +{ + zend_string *delimiter; - zend_hash_move_forward_ex(arr, &pos); - } + if (UNEXPECTED(Z_TYPE_P(str) != IS_STRING)) { + zend_error(E_WARNING, "Invalid arguments supplied for explode()"); + RETURN_EMPTY_STRING(); } - smart_str_appendc(implstr, ']'); + delimiter = zend_string_init(delim, delim_length, 0); + array_init(return_value); + php_explode(delimiter, Z_STR_P(str), return_value, limit); + zend_string_free(delimiter); } /** - * Creates a unique key to be used as index in a hash + * Immediate function resolution for strpos function */ -void zephir_unique_key(zval *return_value, zval *prefix, zval *value TSRMLS_DC) +void zephir_fast_strpos(zval *return_value, const zval *haystack, const zval *needle, unsigned int offset) { + const char *found = NULL; - smart_str implstr = {0}; + if (UNEXPECTED(Z_TYPE_P(haystack) != IS_STRING || Z_TYPE_P(needle) != IS_STRING)) { + ZVAL_NULL(return_value); + zend_error(E_WARNING, "Invalid arguments supplied for strpos()"); + return; + } - if (Z_TYPE_P(prefix) == IS_STRING) { - smart_str_appendl(&implstr, Z_STRVAL_P(prefix), Z_STRLEN_P(prefix)); + if (offset > Z_STRLEN_P(haystack)) { + ZVAL_NULL(return_value); + zend_error(E_WARNING, "Offset not contained in string"); + return; } - if (Z_TYPE_P(value) == IS_ARRAY) { - zephir_append_printable_array(&implstr, value TSRMLS_CC); - } else { - zephir_append_printable_zval(&implstr, &value TSRMLS_CC); + if (!Z_STRLEN_P(needle)) { + ZVAL_NULL(return_value); + zend_error(E_WARNING, "Empty delimiter"); + return; } - smart_str_0(&implstr); + found = php_memnstr(Z_STRVAL_P(haystack)+offset, Z_STRVAL_P(needle), Z_STRLEN_P(needle), Z_STRVAL_P(haystack) + Z_STRLEN_P(haystack)); - if (implstr.len) { - RETURN_STRINGL(implstr.c, implstr.len, 0); + if (found) { + ZVAL_LONG(return_value, found - Z_STRVAL_P(haystack)); } else { - smart_str_free(&implstr); - RETURN_NULL(); + ZVAL_BOOL(return_value, 0); } } /** - * Returns the PHP_EOL (if the passed parameter is TRUE) + * Immediate function resolution for strpos function */ -zval *zephir_eol(int eol TSRMLS_DC) { +void zephir_fast_strpos_str(zval *return_value, const zval *haystack, char *needle, unsigned int needle_length) +{ + const char *found = NULL; - zval *local_eol; + if (UNEXPECTED(Z_TYPE_P(haystack) != IS_STRING)) { + ZVAL_NULL(return_value); + zend_error(E_WARNING, "Invalid arguments supplied for strpos()"); + return; + } - /** - * Initialize local var - */ - ZEPHIR_INIT_VAR(local_eol); + found = php_memnstr(Z_STRVAL_P(haystack), needle, needle_length, Z_STRVAL_P(haystack) + Z_STRLEN_P(haystack)); - /** - * Check if the eol is true and return PHP_EOL or empty string - */ - if (eol) { - ZVAL_STRING(local_eol, PHP_EOL, 1); + if (found) { + ZVAL_LONG(return_value, found - Z_STRVAL_P(haystack)); } else { - ZVAL_EMPTY_STRING(local_eol); + ZVAL_BOOL(return_value, 0); } - - return local_eol; } /** - * Base 64 encode + * Fast call to PHP trim() function */ -void zephir_base64_encode(zval *return_value, zval *data) { - +void zephir_fast_trim(zval *return_value, zval *str, zval *charlist, int where) +{ zval copy; - char *encoded; - int use_copy = 0, length; + int use_copy = 0; + zend_string *trimmed; - if (Z_TYPE_P(data) != IS_STRING) { - zend_make_printable_zval(data, ©, &use_copy); + if (Z_TYPE_P(str) != IS_STRING) { + use_copy = zend_make_printable_zval(str, ©); if (use_copy) { - data = © + str = © } } - encoded = (char *) php_base64_encode((unsigned char *)(Z_STRVAL_P(data)), Z_STRLEN_P(data), &length); - - if (use_copy) { - zval_dtor(data); + if (charlist && Z_TYPE_P(charlist) == IS_STRING) { + trimmed = php_trim(Z_STR_P(str), Z_STRVAL_P(charlist), Z_STRLEN_P(charlist), where); + } else { + trimmed = php_trim(Z_STR_P(str), NULL, 0, where); } + ZVAL_STR(return_value, trimmed); - if (encoded) { - RETURN_STRINGL(encoded, length, 0); - } else { - RETURN_NULL(); + if (use_copy) { + zval_dtor(©); } } -/** - * Base 64 decode +/* {{{ php_char_to_str_ex This function is subject to version 3.01 of the PHP license */ -void zephir_base64_decode(zval *return_value, zval *data) { - - zval copy; - char *decoded; - int use_copy = 0, length; - - if (Z_TYPE_P(data) != IS_STRING) { - zend_make_printable_zval(data, ©, &use_copy); - if (use_copy) { - data = © +static zend_string* php_char_to_str_ex(zend_string *str, char from, char *to, size_t to_len, int case_sensitivity, zend_long *replace_count) +{ + zend_string *result; + size_t char_count = 0; + char lc_from = 0; + char *source, *target, *source_end= ZSTR_VAL(str) + ZSTR_LEN(str); + + if (case_sensitivity) { + char *p = ZSTR_VAL(str), *e = p + ZSTR_LEN(str); + while ((p = memchr(p, from, (e - p)))) { + char_count++; + p++; + } + } else { + lc_from = tolower(from); + for (source = ZSTR_VAL(str); source < source_end; source++) { + if (tolower(*source) == lc_from) { + char_count++; + } } } - decoded = (char *) php_base64_decode((unsigned char *)(Z_STRVAL_P(data)), Z_STRLEN_P(data), &length); - - if (use_copy) { - zval_dtor(data); + if (char_count == 0) { + return zend_string_copy(str); } - if (decoded) { - RETURN_STRINGL(decoded, length, 0); + if (to_len > 0) { + result = zend_string_safe_alloc(char_count, to_len - 1, ZSTR_LEN(str), 0); } else { - RETURN_NULL(); + result = zend_string_alloc(ZSTR_LEN(str) - char_count, 0); + } + target = ZSTR_VAL(result); + + if (case_sensitivity) { + char *p = ZSTR_VAL(str), *e = p + ZSTR_LEN(str), *s = ZSTR_VAL(str); + while ((p = memchr(p, from, (e - p)))) { + memcpy(target, s, (p - s)); + target += p - s; + memcpy(target, to, to_len); + target += to_len; + p++; + s = p; + if (replace_count) { + *replace_count += 1; + } + } + if (s < e) { + memcpy(target, s, (e - s)); + target += e - s; + } + } else { + for (source = ZSTR_VAL(str); source < source_end; source++) { + if (tolower(*source) == lc_from) { + if (replace_count) { + *replace_count += 1; + } + memcpy(target, to, to_len); + target += to_len; + } else { + *target = *source; + target++; + } + } } + *target = 0; + return result; } +/* }}} */ -void zephir_md5(zval *return_value, zval *str) { +/* {{{ php_str_to_str_ex This function is subject to version 3.01 of the PHP license + */ +static zend_string *php_str_to_str_ex(zend_string *haystack, + char *needle, size_t needle_len, char *str, size_t str_len, zend_long *replace_count) +{ + zend_string *new_str; + + if (needle_len < ZSTR_LEN(haystack)) { + char *end; + char *e, *s, *p, *r; + + if (needle_len == str_len) { + new_str = NULL; + end = ZSTR_VAL(haystack) + ZSTR_LEN(haystack); + for (p = ZSTR_VAL(haystack); (r = (char*)php_memnstr(p, needle, needle_len, end)); p = r + needle_len) { + if (!new_str) { + new_str = zend_string_init(ZSTR_VAL(haystack), ZSTR_LEN(haystack), 0); + } + memcpy(ZSTR_VAL(new_str) + (r - ZSTR_VAL(haystack)), str, str_len); + (*replace_count)++; + } + if (!new_str) { + goto nothing_todo; + } + return new_str; + } else { + size_t count = 0; + char *o = ZSTR_VAL(haystack); + char *n = needle; + char *endp = o + ZSTR_LEN(haystack); + + while ((o = (char*)php_memnstr(o, n, needle_len, endp))) { + o += needle_len; + count++; + } + if (count == 0) { + /* Needle doesn't occur, shortcircuit the actual replacement. */ + goto nothing_todo; + } + new_str = zend_string_alloc(count * (str_len - needle_len) + ZSTR_LEN(haystack), 0); + + e = s = ZSTR_VAL(new_str); + end = ZSTR_VAL(haystack) + ZSTR_LEN(haystack); + for (p = ZSTR_VAL(haystack); (r = (char*)php_memnstr(p, needle, needle_len, end)); p = r + needle_len) { + memcpy(e, p, r - p); + e += r - p; + memcpy(e, str, str_len); + e += str_len; + (*replace_count)++; + } - PHP_MD5_CTX ctx; - unsigned char digest[16]; - char hexdigest[33]; - zval copy; - int use_copy = 0; + if (p < end) { + memcpy(e, p, end - p); + e += end - p; + } - if (Z_TYPE_P(str) != IS_STRING) { - zend_make_printable_zval(str, ©, &use_copy); - if (use_copy) { - str = © + *e = '\0'; + return new_str; } + } else if (needle_len > ZSTR_LEN(haystack) || memcmp(ZSTR_VAL(haystack), needle, ZSTR_LEN(haystack))) { +nothing_todo: + return zend_string_copy(haystack); + } else { + new_str = zend_string_init(str, str_len, 0); + (*replace_count)++; + return new_str; } +} +/* }}} */ - PHP_MD5Init(&ctx); - PHP_MD5Update(&ctx, Z_STRVAL_P(str), Z_STRLEN_P(str)); - PHP_MD5Final(digest, &ctx); - - make_digest(hexdigest, digest); +/** + * Immediate function resolution for str_replace function + */ +void zephir_fast_str_replace(zval *return_value_ptr, zval *search, zval *replace, zval *subject) +{ + zval replace_copy, search_copy; + int copy_replace = 0, copy_search = 0; + zend_long replace_count = 0; - ZVAL_STRINGL(return_value, hexdigest, 32, 1); -} + if (Z_TYPE_P(subject) != IS_STRING) { + ZVAL_NULL(return_value_ptr); + zend_error(E_WARNING, "Invalid arguments supplied for str_replace()"); + return; + } -void zephir_crc32(zval *return_value, zval *str TSRMLS_DC) { + /** + * Fallback to userland function if the first parameter is an array + */ + if (Z_TYPE_P(search) == IS_ARRAY) { + do { + zval *params[] = { search, replace, subject }; + ZVAL_NULL(return_value_ptr); + zephir_call_func_aparams(return_value_ptr, "str_replace", sizeof("str_replace")-1, NULL, 0, 3, params); + return; + } while(0); + } - zval copy; - int use_copy = 0; - size_t nr; - char *p; - php_uint32 crc; - php_uint32 crcinit = 0; + if (Z_TYPE_P(replace) != IS_STRING) { + copy_replace = zend_make_printable_zval(replace, &replace_copy); + if (copy_replace) { + replace = &replace_copy; + } + } - if (Z_TYPE_P(str) != IS_STRING) { - zend_make_printable_zval(str, ©, &use_copy); - if (use_copy) { - str = © + if (Z_TYPE_P(search) != IS_STRING) { + copy_search = zend_make_printable_zval(search, &search_copy); + if (copy_search) { + search = &search_copy; } } - p = Z_STRVAL_P(str); - nr = Z_STRLEN_P(str); + if (Z_STRLEN_P(subject) == 0) { + ZVAL_STRINGL(return_value_ptr, "", 0); + return; + } - crc = crcinit^0xFFFFFFFF; - for (; nr--; ++p) { - crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*p)) & 0xFF]; + if (Z_STRLEN_P(search) == 1) { + ZVAL_STR(return_value_ptr, php_char_to_str_ex(Z_STR_P(subject), + Z_STRVAL_P(search)[0], + Z_STRVAL_P(replace), + Z_STRLEN_P(replace), + 1, + &replace_count)); + } else { + if (Z_STRLEN_P(search) > 1) { + ZVAL_STR(return_value_ptr, php_str_to_str_ex(Z_STR_P(subject), + Z_STRVAL_P(search), Z_STRLEN_P(search), + Z_STRVAL_P(replace), Z_STRLEN_P(replace), &replace_count)); + } else { + ZVAL_STR_COPY(return_value_ptr, Z_STR_P(subject)); + } } - if (use_copy) { - zval_dtor(str); + if (copy_replace) { + zval_dtor(replace); } - RETVAL_LONG(crc ^ 0xFFFFFFFF); + if (copy_search) { + zval_dtor(search); + } } #ifdef ZEPHIR_USE_PHP_PCRE @@ -1266,10 +1046,10 @@ void zephir_crc32(zval *return_value, zval *str TSRMLS_DC) { /** * Execute preg-match without function lookup in the PHP userland */ -void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *matches, int global, long flags, long offset TSRMLS_DC) { - - zval copy; +void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *matches, int global, long flags, long offset) +{ int use_copy = 0; + zval copy, tmp_matches; pcre_cache_entry *pce; if (Z_TYPE_P(regex) != IS_STRING) { @@ -1278,14 +1058,14 @@ void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *mat } if (Z_TYPE_P(subject) != IS_STRING) { - zend_make_printable_zval(subject, ©, &use_copy); + use_copy = zend_make_printable_zval(subject, ©); if (use_copy) { subject = © } } - /* Compile regex or get it from cache. */ - if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(regex), Z_STRLEN_P(regex) TSRMLS_CC)) == NULL) { + /* Compile regex or get it from cache */ + if ((pce = pcre_get_compiled_regex_cache(Z_STR_P(regex))) == NULL) { if (use_copy) { zval_dtor(subject); @@ -1294,12 +1074,24 @@ void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *mat RETURN_FALSE; } + ZVAL_UNDEF(&tmp_matches); + if (flags != 0 || offset != 0) { - php_pcre_match_impl(pce, Z_STRVAL_P(subject), Z_STRLEN_P(subject), return_value, matches, global, 1, flags, offset TSRMLS_CC); + php_pcre_match_impl(pce, Z_STRVAL_P(subject), Z_STRLEN_P(subject), return_value, &tmp_matches, global, 1, flags, offset); } else { - php_pcre_match_impl(pce, Z_STRVAL_P(subject), Z_STRLEN_P(subject), return_value, matches, global, 0, 0, 0 TSRMLS_CC); + php_pcre_match_impl(pce, Z_STRVAL_P(subject), Z_STRLEN_P(subject), return_value, &tmp_matches, global, 0, 0, 0); + } + + if (matches) { + zval *php_matches = &tmp_matches; + + zval_dtor(matches); + ZVAL_DEREF(php_matches); + ZVAL_COPY(matches, php_matches); } + zval_ptr_dtor(&tmp_matches); + if (use_copy) { zval_dtor(©); } @@ -1307,36 +1099,44 @@ void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *mat #else -void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *matches, int global, long flags, long offset TSRMLS_DC) +void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *matches, int global, long flags, long offset) { zval tmp_flags; zval tmp_offset; - zval *rv = NULL; - zval **rvp = &rv; + zval rv, tmp_matches; + zval *rvp = return_value ? return_value : &rv; - if (matches) { - Z_SET_ISREF_P(matches); - } ZEPHIR_SINIT_VAR(tmp_flags); ZEPHIR_SINIT_VAR(tmp_offset); + ZVAL_LONG(&tmp_flags, flags); ZVAL_LONG(&tmp_offset, offset); + ZVAL_NULL(&tmp_matches); + ZVAL_MAKE_REF(&tmp_matches); + { - zval *tmp_params[5] = { regex, subject, matches, &tmp_flags, &tmp_offset }; + zval *tmp_params[5] = { regex, subject, &tmp_matches, &tmp_flags, &tmp_offset }; if (global) { - zephir_call_func_aparams(rvp, SL("preg_match_all"), NULL, 0, 5, tmp_params TSRMLS_CC); + zephir_call_func_aparams(rvp, SL("preg_match_all"), NULL, 0, 5, tmp_params); } else { - zephir_call_func_aparams(rvp, SL("preg_match"), NULL, 0, 5, tmp_params TSRMLS_CC); + zephir_call_func_aparams(rvp, SL("preg_match"), NULL, 0, 5, tmp_params); } } + if (matches) { - Z_UNSET_ISREF_P(matches); + if (Z_TYPE(tmp_matches) == IS_REFERENCE) { + ZVAL_COPY(matches, Z_REFVAL(tmp_matches)); + } else { + ZVAL_NULL(matches); + } } - if (return_value) { - COPY_PZVAL_TO_ZVAL(*return_value, rv); + zval_dtor(&tmp_matches); + + if (!return_value) { + zval_dtor(&rv); } } @@ -1344,30 +1144,30 @@ void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *mat #ifdef ZEPHIR_USE_PHP_JSON -int zephir_json_encode(zval *return_value, zval **return_value_ptr, zval *v, int opts TSRMLS_DC) { - - smart_str buf = { NULL, 0, 0 }; +int zephir_json_encode(zval *return_value, zval *v, int opts) +{ + smart_str buf = { 0 }; - php_json_encode(&buf, v, opts TSRMLS_CC); + php_json_encode(&buf, v, opts); smart_str_0(&buf); - ZVAL_STRINGL(return_value, buf.c, buf.len, 0); + ZVAL_STR(return_value, buf.s); return SUCCESS; } -int zephir_json_decode(zval *return_value, zval **return_value_ptr, zval *v, zend_bool assoc TSRMLS_DC) { - +int zephir_json_decode(zval *return_value, zval *v, zend_bool assoc) +{ zval copy; int use_copy = 0; if (UNEXPECTED(Z_TYPE_P(v) != IS_STRING)) { - zend_make_printable_zval(v, ©, &use_copy); + use_copy = zend_make_printable_zval(v, ©); if (use_copy) { v = © } } - php_json_decode(return_value, Z_STRVAL_P(v), Z_STRLEN_P(v), assoc, 512 /* JSON_PARSER_DEFAULT_DEPTH */ TSRMLS_CC); + php_json_decode(return_value, Z_STRVAL_P(v), Z_STRLEN_P(v), assoc, 512 /* JSON_PARSER_DEFAULT_DEPTH */); if (UNEXPECTED(use_copy)) { zval_dtor(©); @@ -1378,8 +1178,8 @@ int zephir_json_decode(zval *return_value, zval **return_value_ptr, zval *v, zen #else -int zephir_json_encode(zval *return_value, zval **return_value_ptr, zval *v, int opts TSRMLS_DC) { - +int zephir_json_encode(zval *return_value, zval *v, int opts) +{ zval zopts; zval *params[2]; @@ -1389,11 +1189,11 @@ int zephir_json_encode(zval *return_value, zval **return_value_ptr, zval *v, int params[0] = v; params[1] = &zopts; - return zephir_return_call_function(return_value, NULL, ZEND_STRL("json_encode"), NULL, 0, 2, params TSRMLS_CC); + return zephir_return_call_function(return_value, SL("json_encode"), NULL, 0, 2, params); } -int zephir_json_decode(zval *return_value, zval **return_value_ptr, zval *v, zend_bool assoc TSRMLS_DC) { - +int zephir_json_decode(zval *return_value, zval *v, zend_bool assoc) +{ zval zassoc; zval *params[2]; @@ -1403,236 +1203,150 @@ int zephir_json_decode(zval *return_value, zval **return_value_ptr, zval *v, zen params[0] = v; params[1] = &zassoc; - return zephir_return_call_function(return_value, NULL, ZEND_STRL("json_decode"), NULL, 0, 2, params TSRMLS_CC); + return zephir_return_call_function(return_value, SL("json_decode"), NULL, 0, 2, params); } #endif /* ZEPHIR_USE_PHP_JSON */ -void zephir_lcfirst(zval *return_value, zval *s) { - - zval copy; - char *c; - int use_copy = 0; - - if (UNEXPECTED(Z_TYPE_P(s) != IS_STRING)) { - zend_make_printable_zval(s, ©, &use_copy); - if (use_copy) { - s = © - } - } - - if (!Z_STRLEN_P(s)) { - ZVAL_EMPTY_STRING(return_value); - } - else { - ZVAL_STRINGL(return_value, Z_STRVAL_P(s), Z_STRLEN_P(s), 1); - c = Z_STRVAL_P(return_value); - *c = tolower((unsigned char)*c); - } - - if (UNEXPECTED(use_copy)) { - zval_dtor(©); - } -} - -void zephir_ucfirst(zval *return_value, zval *s) { - +void zephir_md5(zval *return_value, zval *str) +{ + PHP_MD5_CTX ctx; + unsigned char digest[16]; + char hexdigest[33]; zval copy; - char *c; int use_copy = 0; - if (UNEXPECTED(Z_TYPE_P(s) != IS_STRING)) { - zend_make_printable_zval(s, ©, &use_copy); - if (use_copy) { - s = © - } - } - - if (!Z_STRLEN_P(s)) { - ZVAL_EMPTY_STRING(return_value); - } - else { - ZVAL_STRINGL(return_value, Z_STRVAL_P(s), Z_STRLEN_P(s), 1); - c = Z_STRVAL_P(return_value); - *c = toupper((unsigned char)*c); - } - - if (UNEXPECTED(use_copy)) { - zval_dtor(©); - } -} - -int zephir_http_build_query(zval *return_value, zval *params, char *sep TSRMLS_DC) { - - if (Z_TYPE_P(params) == IS_ARRAY || Z_TYPE_P(params) == IS_OBJECT) { - smart_str formstr = { NULL, 0, 0 }; - int res; - - res = php_url_encode_hash_ex(HASH_OF(params), &formstr, NULL, 0, NULL, 0, NULL, 0, (Z_TYPE_P(params) == IS_OBJECT ? params : NULL), sep, PHP_QUERY_RFC1738 TSRMLS_CC); - - if (res == SUCCESS) { - if (!formstr.c) { - ZVAL_EMPTY_STRING(return_value); - } - else { - smart_str_0(&formstr); - ZVAL_STRINGL(return_value, formstr.c, formstr.len, 0); - } - - return SUCCESS; - } - - smart_str_free(&formstr); - ZVAL_FALSE(return_value); - } - else { - ZVAL_NULL(return_value); - } - - return FAILURE; -} - -void zephir_htmlspecialchars(zval *return_value, zval *string, zval *quoting, zval *charset TSRMLS_DC) { - zval copy; - char *escaped, *cs; - int qs, use_copy = 0; - size_t escaped_len; - - if (UNEXPECTED(Z_TYPE_P(string) != IS_STRING)) { - zend_make_printable_zval(string, ©, &use_copy); + if (Z_TYPE_P(str) != IS_STRING) { + use_copy = zend_make_printable_zval(str, ©); if (use_copy) { - string = © + str = © } } - cs = (charset && Z_TYPE_P(charset) == IS_STRING) ? Z_STRVAL_P(charset) : NULL; - qs = (quoting && Z_TYPE_P(quoting) == IS_LONG) ? Z_LVAL_P(quoting) : ENT_COMPAT; + PHP_MD5Init(&ctx); + PHP_MD5Update(&ctx, Z_STRVAL_P(str), Z_STRLEN_P(str)); + PHP_MD5Final(digest, &ctx); - escaped = php_escape_html_entities_ex((unsigned char *)(Z_STRVAL_P(string)), Z_STRLEN_P(string), &escaped_len, 0, qs, cs, 1 TSRMLS_CC); - ZVAL_STRINGL(return_value, escaped, escaped_len, 0); + make_digest(hexdigest, digest); - if (UNEXPECTED(use_copy)) { - zval_dtor(©); - } + ZVAL_STRINGL(return_value, hexdigest, 32); } -void zephir_htmlentities(zval *return_value, zval *string, zval *quoting, zval *charset TSRMLS_DC) +void zephir_crc32(zval *return_value, zval *str) { zval copy; - char *escaped, *cs; - int qs, use_copy = 0; - size_t escaped_len; + int use_copy = 0; + size_t nr; + char *p; + php_uint32 crc; + php_uint32 crcinit = 0; - if (UNEXPECTED(Z_TYPE_P(string) != IS_STRING)) { - zend_make_printable_zval(string, ©, &use_copy); + if (Z_TYPE_P(str) != IS_STRING) { + use_copy = zend_make_printable_zval(str, ©); if (use_copy) { - string = © + str = © } } - cs = (charset && Z_TYPE_P(charset) == IS_STRING) ? Z_STRVAL_P(charset) : NULL; - qs = (quoting && Z_TYPE_P(quoting) == IS_LONG) ? Z_LVAL_P(quoting) : ENT_COMPAT; - - escaped = php_escape_html_entities_ex((unsigned char *)(Z_STRVAL_P(string)), Z_STRLEN_P(string), &escaped_len, 1, qs, cs, 1 TSRMLS_CC); - ZVAL_STRINGL(return_value, escaped, escaped_len, 0); + p = Z_STRVAL_P(str); + nr = Z_STRLEN_P(str); - if (UNEXPECTED(use_copy)) { - zval_dtor(©); + crc = crcinit^0xFFFFFFFF; + for (; nr--; ++p) { + crc = ((crc >> 8) & 0x00FFFFFF) ^ crc32tab[(crc ^ (*p)) & 0xFF]; } -} - -void zephir_strval(zval *return_value, zval *v) -{ - zval copy; - int use_copy = 0; - zend_make_printable_zval(v, ©, &use_copy); if (use_copy) { - zval *tmp = © - ZVAL_ZVAL(return_value, tmp, 0, 0); - } else { - ZVAL_ZVAL(return_value, v, 1, 0); + zval_dtor(str); } + + RETVAL_LONG(crc ^ 0xFFFFFFFF); } -void zephir_date(zval *return_value, zval *format, zval *timestamp TSRMLS_DC) +void zephir_ucfirst(zval *return_value, zval *s) { - long int ts; zval copy; + char *c; int use_copy = 0; - char *formatted; - if (UNEXPECTED(Z_TYPE_P(format) != IS_STRING)) { - zend_make_printable_zval(format, ©, &use_copy); + if (UNEXPECTED(Z_TYPE_P(s) != IS_STRING)) { + use_copy = zend_make_printable_zval(s, ©); if (use_copy) { - format = © + s = © } } - ts = (timestamp) ? zephir_get_intval(timestamp) : time(NULL); - - formatted = php_format_date(Z_STRVAL_P(format), Z_STRLEN_P(format), ts, 1 TSRMLS_CC); - ZVAL_STRING(return_value, formatted, 0); + if (!Z_STRLEN_P(s)) { + ZVAL_EMPTY_STRING(return_value); + } + else { + ZVAL_STRINGL(return_value, Z_STRVAL_P(s), Z_STRLEN_P(s)); + c = Z_STRVAL_P(return_value); + *c = toupper((unsigned char)*c); + } if (UNEXPECTED(use_copy)) { zval_dtor(©); } } -void zephir_addslashes(zval *return_value, zval *str TSRMLS_DC) +void zephir_addslashes(zval *return_value, zval *str) { zval copy; int use_copy = 0; if (UNEXPECTED(Z_TYPE_P(str) != IS_STRING)) { - zend_make_printable_zval(str, ©, &use_copy); + use_copy = zend_make_printable_zval(str, ©); if (use_copy) { str = © } } - ZVAL_STRING(return_value, php_addslashes(Z_STRVAL_P(str), Z_STRLEN_P(str), &Z_STRLEN_P(return_value), 0 TSRMLS_CC), 0); +#if PHP_VERSION_ID < 70300 + ZVAL_STR(return_value, php_addslashes(Z_STR_P(str), 0)); +#else + ZVAL_STR(return_value, php_addslashes(Z_STR_P(str))); +#endif if (UNEXPECTED(use_copy)) { zval_dtor(©); } } -void zephir_stripslashes(zval *return_value, zval *str TSRMLS_DC) +void zephir_stripslashes(zval *return_value, zval *str) { zval copy; int use_copy = 0; if (UNEXPECTED(Z_TYPE_P(str) != IS_STRING)) { - zend_make_printable_zval(str, ©, &use_copy); + use_copy = zend_make_printable_zval(str, ©); if (use_copy) { str = © } } - ZVAL_STRINGL(return_value, Z_STRVAL_P(str), Z_STRLEN_P(str), 1); - php_stripslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value) TSRMLS_CC); + ZVAL_STRINGL(return_value, Z_STRVAL_P(str), Z_STRLEN_P(str)); + php_stripslashes(Z_STR_P(return_value)); if (UNEXPECTED(use_copy)) { zval_dtor(©); } } -void zephir_stripcslashes(zval *return_value, zval *str TSRMLS_DC) +void zephir_stripcslashes(zval *return_value, zval *str) { - zval copy; int use_copy = 0; if (UNEXPECTED(Z_TYPE_P(str) != IS_STRING)) { - zend_make_printable_zval(str, ©, &use_copy); + use_copy = zend_make_printable_zval(str, ©); if (use_copy) { str = © } } - ZVAL_STRINGL(return_value, Z_STRVAL_P(str), Z_STRLEN_P(str), 1); - php_stripcslashes(Z_STRVAL_P(return_value), &Z_STRLEN_P(return_value)); + ZVAL_STRINGL(return_value, Z_STRVAL_P(str), Z_STRLEN_P(str)); + php_stripcslashes(Z_STR_P(return_value)); if (UNEXPECTED(use_copy)) { zval_dtor(©); @@ -1673,23 +1387,25 @@ void zephir_string_to_hex(zval *return_value, zval *var) zval copy; size_t i; char *s; - char *res; + zend_string *res; if (Z_TYPE_P(var) != IS_STRING) { - zend_make_printable_zval(var, ©, &use_copy); + use_copy = zend_make_printable_zval(var, ©); if (use_copy) { var = © } } - res = emalloc(2*Z_STRLEN_P(var) + 1); + res = zend_string_alloc(2*Z_STRLEN_P(var) + 1, 0); s = Z_STRVAL_P(var); for (i=0; ival + 2*i, "%hhX", s[i]); } - res[2*Z_STRLEN_P(var)] = 0; - ZVAL_STRINGL(return_value, res, 2*Z_STRLEN_P(var), 0); + res->val[2*Z_STRLEN_P(var)] = 0; + res->len = 2*Z_STRLEN_P(var); + zend_string_forget_hash_val(res); + ZVAL_STR(return_value, res); if (use_copy) { zval_dtor(var); diff --git a/ext/kernel/string.h b/ext/kernel/string.h index 6da0fd30541..5998bb2470d 100644 --- a/ext/kernel/string.h +++ b/ext/kernel/string.h @@ -23,6 +23,7 @@ #include #include +#include #include "kernel/main.h" #define ZEPHIR_TRIM_LEFT 1 @@ -34,24 +35,18 @@ int zephir_memnstr(const zval *haystack, const zval *needle ZEPHIR_DEBUG_PARAMS); int zephir_memnstr_str(const zval *haystack, char *needle, unsigned int needle_length ZEPHIR_DEBUG_PARAMS); -/** Function replacement */ -void zephir_fast_strlen(zval *return_value, zval *str); int zephir_fast_strlen_ev(zval *str); void zephir_fast_strtolower(zval *return_value, zval *str); -void zephir_strtolower_inplace(zval *s); -void zephir_fast_join(zval *result, zval *glue, zval *pieces TSRMLS_DC); -void zephir_fast_join_str(zval *result, char *glue, unsigned int glue_length, zval *pieces TSRMLS_DC); -void zephir_fast_explode(zval *result, zval *delimiter, zval *str, long limit TSRMLS_DC); -void zephir_fast_explode_str(zval *result, const char *delimiter, int delimiter_length, zval *str, long limit TSRMLS_DC); +void zephir_fast_strtoupper(zval *return_value, zval *str); +void zephir_fast_join(zval *result, zval *glue, zval *pieces); +void zephir_fast_join_str(zval *result, char *glue, unsigned int glue_length, zval *pieces); +void zephir_fast_explode(zval *result, zval *delimiter, zval *str, long limit); +void zephir_fast_explode_str(zval *result, const char *delimiter, int delimiter_length, zval *str, long limit); void zephir_fast_strpos(zval *return_value, const zval *haystack, const zval *needle, unsigned int offset); void zephir_fast_strpos_str(zval *return_value, const zval *haystack, char *needle, unsigned int needle_length); -void zephir_fast_stripos_str(zval *return_value, zval *haystack, char *needle, unsigned int needle_length); -void zephir_fast_str_replace(zval **return_value, zval *search, zval *replace, zval *subject TSRMLS_DC); -void zephir_fast_trim(zval *return_value, zval *str, zval *charlist, int where TSRMLS_DC); -void zephir_fast_strip_tags(zval *return_value, zval *str); -void zephir_fast_strtoupper(zval *return_value, zval *str); +void zephir_fast_trim(zval *return_value, zval *str, zval *charlist, int where); +void zephir_fast_str_replace(zval *return_value, zval *search, zval *replace, zval *subject); -/** Camelize/Uncamelize */ void zephir_camelize(zval *return_value, const zval *str, const zval *delimiter); void zephir_uncamelize(zval *return_value, const zval *str, const zval *delimiter); @@ -59,63 +54,35 @@ void zephir_uncamelize(zval *return_value, const zval *str, const zval *delimite int zephir_start_with(const zval *str, const zval *compared, zval *case_sensitive); int zephir_start_with_str(const zval *str, char *compared, unsigned int compared_length); int zephir_start_with_str_str(char *str, unsigned int str_length, char *compared, unsigned int compared_length); + int zephir_end_with(const zval *str, const zval *compared, zval *case_sensitive); int zephir_end_with_str(const zval *str, char *compared, unsigned int compared_length); -/** Random string */ -void zephir_random_string(zval *return_value, const zval *type, const zval *length TSRMLS_DC); - -/* Strips extra slashes */ -void zephir_remove_extra_slashes(zval *return_value, const zval *str); - -/** Generates a unique key for an array/object */ -void zephir_unique_key(zval *return_value, zval *prefix, zval *value TSRMLS_DC); - /** spprintf */ int zephir_spprintf(char **message, int max_len, char *format, ...); +/** JSON */ +int zephir_json_encode(zval *return_value, zval *v, int opts); +int zephir_json_decode(zval *return_value, zval *v, zend_bool assoc); + /* Substr */ void zephir_substr(zval *return_value, zval *str, long from, long length, int flags); -/** EOL */ -zval *zephir_eol(int eol TSRMLS_DC); - /** Preg-Match */ -void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *matches, int global, long flags, long offset TSRMLS_DC); - -/** Base64 */ -void zephir_base64_encode(zval *return_value, zval *data); -void zephir_base64_decode(zval *return_value, zval *data); +void zephir_preg_match(zval *return_value, zval *regex, zval *subject, zval *matches, int global, long flags, long offset); /** Hash */ void zephir_md5(zval *return_value, zval *str); -void zephir_crc32(zval *return_value, zval *str TSRMLS_DC); +void zephir_crc32(zval *return_value, zval *str); -/** JSON */ -int zephir_json_encode(zval *return_value, zval **return_value_ptr, zval *v, int opts TSRMLS_DC); -int zephir_json_decode(zval *return_value, zval **return_value_ptr, zval *v, zend_bool assoc TSRMLS_DC); - -/***/ -void zephir_lcfirst(zval *return_value, zval *s); +/** */ void zephir_ucfirst(zval *return_value, zval *s); -int zephir_http_build_query(zval *return_value, zval *params, char *sep TSRMLS_DC); -void zephir_htmlspecialchars(zval *return_value, zval *string, zval *quoting, zval *charset TSRMLS_DC); -void zephir_htmlentities(zval *return_value, zval *string, zval *quoting, zval *charset TSRMLS_DC); -void zephir_strval(zval *return_value, zval *v); -void zephir_date(zval *return_value, zval *format, zval *timestamp TSRMLS_DC); -void zephir_addslashes(zval *return_value, zval *str TSRMLS_DC); -void zephir_stripslashes(zval *return_value, zval *str TSRMLS_DC); -void zephir_stripcslashes(zval *return_value, zval *str TSRMLS_DC); - -#define ZEPHIR_ZVAL_MAYBE_INTERNED_STRING(pz, string) \ - do { \ - if (IS_INTERNED(string)) { \ - ZVAL_STRINGL(pz, string, INTERNED_LEN(string)-1, 0); \ - } \ - else { \ - ZVAL_STRING(pz, string, 1); \ - } \ - } while (0) +void zephir_addslashes(zval *return_value, zval *str); +void zephir_stripslashes(zval *return_value, zval *str); +void zephir_stripcslashes(zval *return_value, zval *str); +void zephir_unique_key(zval *return_value, const zval *prefix, zval *value); + +void zephir_append_printable_array(smart_str *implstr, const zval *value); int zephir_hash_equals(const zval *known_zval, const zval *user_zval); diff --git a/ext/kernel/time.c b/ext/kernel/time.c index 1254634a0ad..a2da3ad68a8 100644 --- a/ext/kernel/time.c +++ b/ext/kernel/time.c @@ -34,8 +34,6 @@ #include "kernel/main.h" #include "kernel/time.h" -#include "kernel/memory.h" -#include "kernel/fcall.h" #include "kernel/operators.h" void zephir_time(zval *return_value) @@ -43,24 +41,8 @@ void zephir_time(zval *return_value) RETURN_LONG(time(NULL)); } -void zephir_microtime(zval *return_value, zval *get_as_float TSRMLS_DC) +void zephir_microtime(zval *return_value, zval *get_as_float) { -#ifdef PHP_WIN32 - zval z_as_float; - zval *params[1]; - -ZEPHIR_SINIT_VAR(z_as_float); -if (get_as_float && ZEPHIR_IS_TRUE(get_as_float)) { - ZVAL_BOOL(&z_as_float, 1); -} else { - ZVAL_BOOL(&z_as_float, 0); -} - - params[0] = &z_as_float; - - zephir_return_call_function(return_value, NULL, ZEND_STRL("microtime"), NULL, 0, 1, params TSRMLS_CC); - return; -#else struct timeval tp = {0}; char ret[100]; @@ -73,6 +55,5 @@ if (get_as_float && ZEPHIR_IS_TRUE(get_as_float)) { } snprintf(ret, 100, "%.8F %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec); - RETURN_STRING(ret, 1); -#endif + RETURN_STRING(ret); } diff --git a/ext/kernel/time.h b/ext/kernel/time.h index dbc04599f9e..0ed397aedec 100644 --- a/ext/kernel/time.h +++ b/ext/kernel/time.h @@ -24,7 +24,7 @@ void zephir_time(zval *return_value); #ifdef HAVE_GETTIMEOFDAY -void zephir_microtime(zval *return_value, zval *get_as_float TSRMLS_DC); +void zephir_microtime(zval *return_value, zval *get_as_float); #endif #endif /* ZEPHIR_KERNEL_TIME_H */ diff --git a/ext/kernel/variables.c b/ext/kernel/variables.c index e8572d22f18..04919b7757e 100644 --- a/ext/kernel/variables.c +++ b/ext/kernel/variables.c @@ -25,96 +25,50 @@ #include "php.h" #include "php_ext.h" -#include "ext/standard/php_smart_str.h" +#include "ext/standard/php_smart_string.h" #include "ext/standard/php_var.h" -/** - * Serializes php variables without using the PHP userland - */ -void zephir_serialize(zval *return_value, zval **var TSRMLS_DC) { - - php_serialize_data_t var_hash; - smart_str buf = {0}; - - PHP_VAR_SERIALIZE_INIT(var_hash); - php_var_serialize(&buf, var, &var_hash TSRMLS_CC); - PHP_VAR_SERIALIZE_DESTROY(var_hash); - - if (EG(exception)) { - smart_str_free(&buf); - RETURN_FALSE; - } - - if (buf.c) { - RETURN_STRINGL(buf.c, buf.len, 0); - } else { - RETURN_NULL(); +static zend_always_inline void zephir_smart_str_0(smart_str *str) +{ + if (str->s) { + ZSTR_VAL(str->s)[ZSTR_LEN(str->s)] = '\0'; } } /** - * Unserializes php variables without using the PHP userland + * var_dump outputs php variables without using the PHP userland */ -void zephir_unserialize(zval *return_value, zval *var TSRMLS_DC) { - - const unsigned char *p; - php_unserialize_data_t var_hash; - - if (Z_TYPE_P(var) != IS_STRING) { - RETURN_FALSE; - } - - if (Z_STRLEN_P(var) == 0) { - RETURN_FALSE; - } - - p = (const unsigned char*) Z_STRVAL_P(var); - PHP_VAR_UNSERIALIZE_INIT(var_hash); - if (!php_var_unserialize(&return_value, &p, p + Z_STRLEN_P(var), &var_hash TSRMLS_CC)) { - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - zval_dtor(return_value); - ZVAL_NULL(return_value); - if (!EG(exception)) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Error at offset %ld of %d bytes", (long)((char*)p - Z_STRVAL_P(var)), Z_STRLEN_P(var)); - } - RETURN_FALSE; - } - PHP_VAR_UNSERIALIZE_DESTROY(var_hash); - +void zephir_var_dump(zval *var) +{ + php_var_dump(var, 1); } /** * var_export outputs php variables without using the PHP userland */ -void zephir_var_export(zval **var TSRMLS_DC) { - php_var_export(var, 1 TSRMLS_CC); +void zephir_var_export(zval *var) +{ + php_var_export(var, 1); } /** * var_export returns php variables without using the PHP userland */ -void zephir_var_export_ex(zval *return_value, zval **var TSRMLS_DC) { - - smart_str buf = { NULL, 0, 0 }; - - php_var_export_ex(var, 1, &buf TSRMLS_CC); - smart_str_0(&buf); - ZVAL_STRINGL(return_value, buf.c, buf.len, 0); -} +void zephir_var_export_ex(zval *return_value, zval *var) +{ + smart_str buf = { 0 }; -/** - * var_dump outputs php variables without using the PHP userland - */ -void zephir_var_dump(zval **var TSRMLS_DC) { - php_var_dump(var, 1 TSRMLS_CC); + php_var_export_ex(var, 1, &buf); + zephir_smart_str_0(&buf); + ZVAL_STR(return_value, buf.s); } -void zephir_get_defined_vars(zval *return_value TSRMLS_DC) +void zephir_get_defined_vars(zval *return_value) { - if (!EG(active_symbol_table)) { - zend_rebuild_symbol_table(TSRMLS_C); + zend_array *symtable = zend_rebuild_symbol_table(); + if (EXPECTED(symtable != NULL)) { + RETURN_ARR(zend_array_dup(symtable)); } - array_init_size(return_value, zend_hash_num_elements(EG(active_symbol_table))); - zend_hash_copy(Z_ARRVAL_P(return_value), EG(active_symbol_table), (copy_ctor_func_t)zval_add_ref, NULL, sizeof(zval *)); + RETURN_NULL(); } diff --git a/ext/kernel/variables.h b/ext/kernel/variables.h index 298a6c0a2c6..821836a06ca 100644 --- a/ext/kernel/variables.h +++ b/ext/kernel/variables.h @@ -24,14 +24,11 @@ #include #include -void zephir_serialize(zval *return_value, zval **var TSRMLS_DC); -void zephir_unserialize(zval *return_value, zval *var TSRMLS_DC); +void zephir_var_dump(zval *var); -void zephir_var_export(zval **var TSRMLS_DC); -void zephir_var_export_ex(zval *return_value, zval **var TSRMLS_DC); +void zephir_var_export(zval *var); +void zephir_var_export_ex(zval *return_value, zval *var); -void zephir_var_dump(zval **var TSRMLS_DC); - -void zephir_get_defined_vars(zval *return_value TSRMLS_DC); +void zephir_get_defined_vars(zval *return_value); #endif diff --git a/ext/phalcon.c b/ext/phalcon.c index 313c593d011..64aa7230257 100644 --- a/ext/phalcon.c +++ b/ext/phalcon.c @@ -7,11 +7,6 @@ #include -// TODO: Deprecated. Will be removed in future -#if PHP_VERSION_ID < 50500 -#include -#endif - #include "php_ext.h" #include "phalcon.h" @@ -453,23 +448,8 @@ PHP_INI_END() static PHP_MINIT_FUNCTION(phalcon) { -// TODO: Deprecated. Will be removed in future -#if PHP_VERSION_ID < 50500 - char* old_lc_all = setlocale(LC_ALL, NULL); - if (old_lc_all) { - size_t len = strlen(old_lc_all); - char *tmp = calloc(len+1, 1); - if (UNEXPECTED(!tmp)) { - return FAILURE; - } - - memcpy(tmp, old_lc_all, len); - old_lc_all = tmp; - } - - setlocale(LC_ALL, "C"); -#endif REGISTER_INI_ENTRIES(); + zephir_module_init(); ZEPHIR_INIT(Phalcon_Di_InjectionAwareInterface); ZEPHIR_INIT(Phalcon_Events_EventsAwareInterface); ZEPHIR_INIT(Phalcon_Validation_ValidatorInterface); @@ -869,12 +849,6 @@ static PHP_MINIT_FUNCTION(phalcon) ZEPHIR_INIT(phalcon_1__closure); ZEPHIR_INIT(phalcon_2__closure); - -// TODO: Deprecated. Will be removed in future -#if PHP_VERSION_ID < 50500 - setlocale(LC_ALL, old_lc_all); - free(old_lc_all); -#endif return SUCCESS; } @@ -942,10 +916,13 @@ static void php_zephir_init_module_globals(zend_phalcon_globals *phalcon_globals static PHP_RINIT_FUNCTION(phalcon) { - zend_phalcon_globals *phalcon_globals_ptr = ZEPHIR_VGLOBAL; + zend_phalcon_globals *phalcon_globals_ptr; +#ifdef ZTS + tsrm_ls = ts_resource(0); +#endif + phalcon_globals_ptr = ZEPHIR_VGLOBAL; php_zephir_init_globals(phalcon_globals_ptr TSRMLS_CC); - //zephir_init_interned_strings(TSRMLS_C); zephir_initialize_memory(phalcon_globals_ptr TSRMLS_CC); diff --git a/ext/phalcon/0__closure.zep.c b/ext/phalcon/0__closure.zep.c index b9f6307f4cf..fb16dd7e0b6 100644 --- a/ext/phalcon/0__closure.zep.c +++ b/ext/phalcon/0__closure.zep.c @@ -25,7 +25,10 @@ ZEPHIR_INIT_CLASS(phalcon_0__closure) { PHP_METHOD(phalcon_0__closure, __invoke) { - zval *file; + zval *file, file_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&file_sub); zephir_fetch_params(0, 1, 0, &file); diff --git a/ext/phalcon/1__closure.zep.c b/ext/phalcon/1__closure.zep.c index d5624644644..0e16e85df7d 100644 --- a/ext/phalcon/1__closure.zep.c +++ b/ext/phalcon/1__closure.zep.c @@ -28,20 +28,25 @@ ZEPHIR_INIT_CLASS(phalcon_1__closure) { PHP_METHOD(phalcon_1__closure, __invoke) { zend_bool _1; - zval *element, *_0, *_2; + zval *element, element_sub, _0, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&element_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_OBS_VAR(_0); + ZEPHIR_OBS_VAR(&_0); zephir_array_fetch_long(&_0, element, 0, PH_NOISY, "phalcon/validation.zep", 62 TSRMLS_CC); - _1 = Z_TYPE_P(_0) != IS_ARRAY; + _1 = Z_TYPE_P(&_0) != IS_ARRAY; if (!(_1)) { - ZEPHIR_OBS_VAR(_2); + ZEPHIR_OBS_VAR(&_2); zephir_array_fetch_long(&_2, element, 1, PH_NOISY, "phalcon/validation.zep", 62 TSRMLS_CC); - _1 = !(zephir_is_instance_of(_2, SL("phalcon\\CombinedFieldsValidator") TSRMLS_CC)); + _1 = !(zephir_is_instance_of(&_2, SL("phalcon\\CombinedFieldsValidator") TSRMLS_CC)); } RETURN_MM_BOOL(_1); diff --git a/ext/phalcon/2__closure.zep.c b/ext/phalcon/2__closure.zep.c index c589eb2251b..829132e4e6b 100644 --- a/ext/phalcon/2__closure.zep.c +++ b/ext/phalcon/2__closure.zep.c @@ -28,20 +28,25 @@ ZEPHIR_INIT_CLASS(phalcon_2__closure) { PHP_METHOD(phalcon_2__closure, __invoke) { zend_bool _1; - zval *element, *_0, *_2; + zval *element, element_sub, _0, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&element_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &element); - ZEPHIR_OBS_VAR(_0); + ZEPHIR_OBS_VAR(&_0); zephir_array_fetch_long(&_0, element, 0, PH_NOISY, "phalcon/validation.zep", 65 TSRMLS_CC); - _1 = Z_TYPE_P(_0) == IS_ARRAY; + _1 = Z_TYPE_P(&_0) == IS_ARRAY; if (_1) { - ZEPHIR_OBS_VAR(_2); + ZEPHIR_OBS_VAR(&_2); zephir_array_fetch_long(&_2, element, 1, PH_NOISY, "phalcon/validation.zep", 65 TSRMLS_CC); - _1 = zephir_is_instance_of(_2, SL("phalcon\\CombinedFieldsValidator") TSRMLS_CC); + _1 = zephir_is_instance_of(&_2, SL("phalcon\\CombinedFieldsValidator") TSRMLS_CC); } RETURN_MM_BOOL(_1); diff --git a/ext/phalcon/acl.zep.c b/ext/phalcon/acl.zep.c index 604961c45fb..f2f3a555787 100644 --- a/ext/phalcon/acl.zep.c +++ b/ext/phalcon/acl.zep.c @@ -64,9 +64,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Acl) { ZEPHIR_REGISTER_CLASS(Phalcon, Acl, phalcon, acl, NULL, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - zend_declare_class_constant_long(phalcon_acl_ce, SL("ALLOW"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_acl_ce, SL("ALLOW"), 1); - zend_declare_class_constant_long(phalcon_acl_ce, SL("DENY"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_acl_ce, SL("DENY"), 0); return SUCCESS; diff --git a/ext/phalcon/acl/adapter.zep.c b/ext/phalcon/acl/adapter.zep.c index 1c7a980c705..79c279466d7 100644 --- a/ext/phalcon/acl/adapter.zep.c +++ b/ext/phalcon/acl/adapter.zep.c @@ -73,7 +73,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Acl_Adapter) { */ PHP_METHOD(Phalcon_Acl_Adapter, getActiveRole) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_activeRole"); @@ -84,7 +85,8 @@ PHP_METHOD(Phalcon_Acl_Adapter, getActiveRole) { */ PHP_METHOD(Phalcon_Acl_Adapter, getActiveResource) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_activeResource"); @@ -95,7 +97,8 @@ PHP_METHOD(Phalcon_Acl_Adapter, getActiveResource) { */ PHP_METHOD(Phalcon_Acl_Adapter, getActiveAccess) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_activeAccess"); @@ -106,13 +109,16 @@ PHP_METHOD(Phalcon_Acl_Adapter, getActiveAccess) { */ PHP_METHOD(Phalcon_Acl_Adapter, setEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); } @@ -121,7 +127,8 @@ PHP_METHOD(Phalcon_Acl_Adapter, setEventsManager) { */ PHP_METHOD(Phalcon_Acl_Adapter, getEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -132,8 +139,11 @@ PHP_METHOD(Phalcon_Acl_Adapter, getEventsManager) { */ PHP_METHOD(Phalcon_Acl_Adapter, setDefaultAction) { - zval *defaultAccess_param = NULL, *_0; + zval *defaultAccess_param = NULL, _0; zend_long defaultAccess; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &defaultAccess_param); @@ -141,8 +151,8 @@ PHP_METHOD(Phalcon_Acl_Adapter, setDefaultAction) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, defaultAccess); - zephir_update_property_this(getThis(), SL("_defaultAccess"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, defaultAccess); + zephir_update_property_zval(this_ptr, SL("_defaultAccess"), &_0); } @@ -151,7 +161,8 @@ PHP_METHOD(Phalcon_Acl_Adapter, setDefaultAction) { */ PHP_METHOD(Phalcon_Acl_Adapter, getDefaultAction) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_defaultAccess"); diff --git a/ext/phalcon/acl/adapter.zep.h b/ext/phalcon/acl/adapter.zep.h index 0b465f1b7b7..8b1a6aae5e6 100644 --- a/ext/phalcon/acl/adapter.zep.h +++ b/ext/phalcon/acl/adapter.zep.h @@ -11,21 +11,60 @@ PHP_METHOD(Phalcon_Acl_Adapter, getEventsManager); PHP_METHOD(Phalcon_Acl_Adapter, setDefaultAction); PHP_METHOD(Phalcon_Acl_Adapter, getDefaultAction); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_getactiverole, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_getactiverole, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_getactiveresource, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_getactiveresource, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_getactiveaccess, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_getactiveaccess, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_seteventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_acl_adapter_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_setdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultAccess, IS_LONG, 0) +#else ZEND_ARG_INFO(0, defaultAccess) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_getdefaultaction, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_getdefaultaction, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_acl_adapter_method_entry) { - PHP_ME(Phalcon_Acl_Adapter, getActiveRole, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Adapter, getActiveResource, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Adapter, getActiveAccess, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Adapter, getActiveRole, arginfo_phalcon_acl_adapter_getactiverole, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Adapter, getActiveResource, arginfo_phalcon_acl_adapter_getactiveresource, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Adapter, getActiveAccess, arginfo_phalcon_acl_adapter_getactiveaccess, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Acl_Adapter, setEventsManager, arginfo_phalcon_acl_adapter_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Adapter, getEventsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Adapter, getEventsManager, arginfo_phalcon_acl_adapter_geteventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Acl_Adapter, setDefaultAction, arginfo_phalcon_acl_adapter_setdefaultaction, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Adapter, getDefaultAction, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Adapter, getDefaultAction, arginfo_phalcon_acl_adapter_getdefaultaction, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/acl/adapter/memory.zep.c b/ext/phalcon/acl/adapter/memory.zep.c index 61dc41a293f..7d1194c0068 100644 --- a/ext/phalcon/acl/adapter/memory.zep.c +++ b/ext/phalcon/acl/adapter/memory.zep.c @@ -162,18 +162,24 @@ ZEPHIR_INIT_CLASS(Phalcon_Acl_Adapter_Memory) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, __construct) { - zval *_0, *_1; + zval _0, _1; + zval __$true; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_0, SL("*"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_resourcesNames"), _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_1, SL("*!*"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_accessList"), _1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_0, SL("*"), &__$true, PH_COPY | PH_SEPARATE); + zephir_update_property_zval(this_ptr, SL("_resourcesNames"), &_0); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_1, SL("*!*"), &__$true, PH_COPY | PH_SEPARATE); + zephir_update_property_zval(this_ptr, SL("_accessList"), &_1); ZEPHIR_MM_RESTORE(); } @@ -198,13 +204,23 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addRole) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *role, *accessInherits = NULL, *roleName = NULL, *roleObject = NULL, *_1; + zval *role, role_sub, *accessInherits = NULL, accessInherits_sub, __$true, __$null, roleName, roleObject, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&role_sub); + ZVAL_UNDEF(&accessInherits_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&roleName); + ZVAL_UNDEF(&roleObject); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &role, &accessInherits); if (!accessInherits) { - accessInherits = ZEPHIR_GLOBAL(global_null); + accessInherits = &accessInherits_sub; + accessInherits = &__$null; } @@ -215,25 +231,25 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addRole) { if (_0) { ZEPHIR_CALL_METHOD(&roleName, role, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(roleObject, role); + ZEPHIR_CPY_WRT(&roleObject, role); } else if (Z_TYPE_P(role) == IS_STRING) { - ZEPHIR_CPY_WRT(roleName, role); - ZEPHIR_INIT_NVAR(roleObject); - object_init_ex(roleObject, phalcon_acl_role_ce); - ZEPHIR_CALL_METHOD(NULL, roleObject, "__construct", NULL, 84, role); + ZEPHIR_CPY_WRT(&roleName, role); + ZEPHIR_INIT_NVAR(&roleObject); + object_init_ex(&roleObject, phalcon_acl_role_ce); + ZEPHIR_CALL_METHOD(NULL, &roleObject, "__construct", NULL, 75, role); zephir_check_call_status(); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Role must be either an string or implement RoleInterface", "phalcon/acl/adapter/memory.zep", 201); return; } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_rolesNames"), PH_NOISY_CC); - if (zephir_array_isset(_1, roleName)) { + zephir_read_property(&_1, this_ptr, SL("_rolesNames"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_1, &roleName)) { RETURN_MM_BOOL(0); } - zephir_update_property_array_append(this_ptr, SL("_roles"), roleObject TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_rolesNames"), roleName, ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_roles"), &roleObject TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_rolesNames"), &roleName, &__$true TSRMLS_CC); if (Z_TYPE_P(accessInherits) != IS_NULL) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addinherit", NULL, 0, roleName, accessInherits); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addinherit", NULL, 0, &roleName, accessInherits); zephir_check_call_status(); RETURN_MM(); } @@ -246,30 +262,44 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addRole) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) { - HashTable *_7$$6; - HashPosition _6$$6; zend_bool _2; - zephir_fcall_cache_entry *_9 = NULL; + zephir_fcall_cache_entry *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *roleName_param = NULL, *roleToInherit, *roleInheritName = NULL, *rolesNames = NULL, *deepInheritName = NULL, *_3, *_12, *_0$$3, *_4$$6, *_5$$6, **_8$$6, *_10$$8, *_11$$8; - zval *roleName = NULL, *_1$$3; + zval *roleName_param = NULL, *roleToInherit, roleToInherit_sub, __$true, roleInheritName, rolesNames, deepInheritName, _3, _10, _0$$3, _4$$6, _5$$6, *_6$$6, _8$$8, _9$$8; + zval roleName, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&roleName); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&roleToInherit_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&roleInheritName); + ZVAL_UNDEF(&rolesNames); + ZVAL_UNDEF(&deepInheritName); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &roleName_param, &roleToInherit); - zephir_get_strval(roleName, roleName_param); + zephir_get_strval(&roleName, roleName_param); - ZEPHIR_OBS_VAR(rolesNames); - zephir_read_property_this(&rolesNames, this_ptr, SL("_rolesNames"), PH_NOISY_CC); - if (!(zephir_array_isset(rolesNames, roleName))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_acl_exception_ce); - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_CONCAT_SVS(_1$$3, "Role '", roleName, "' does not exist in the role list"); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 9, _1$$3); + ZEPHIR_OBS_VAR(&rolesNames); + zephir_read_property(&rolesNames, this_ptr, SL("_rolesNames"), PH_NOISY_CC); + if (!(zephir_array_isset(&rolesNames, &roleName))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_acl_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_CONCAT_SVS(&_1$$3, "Role '", &roleName, "' does not exist in the role list"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 4, &_1$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/acl/adapter/memory.zep", 227 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/acl/adapter/memory.zep", 227 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -281,41 +311,41 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) { ZEPHIR_CALL_METHOD(&roleInheritName, roleToInherit, "getname", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(roleInheritName, roleToInherit); + ZEPHIR_CPY_WRT(&roleInheritName, roleToInherit); } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_roleInherits"), PH_NOISY_CC); - if (zephir_array_isset(_3, roleInheritName)) { - _4$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_roleInherits"), PH_NOISY_CC); - zephir_array_fetch(&_5$$6, _4$$6, roleInheritName, PH_NOISY | PH_READONLY, "phalcon/acl/adapter/memory.zep", 240 TSRMLS_CC); - zephir_is_iterable(_5$$6, &_7$$6, &_6$$6, 0, 0, "phalcon/acl/adapter/memory.zep", 243); - for ( - ; zend_hash_get_current_data_ex(_7$$6, (void**) &_8$$6, &_6$$6) == SUCCESS - ; zend_hash_move_forward_ex(_7$$6, &_6$$6) - ) { - ZEPHIR_GET_HVALUE(deepInheritName, _8$$6); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinherit", &_9, 85, roleName, deepInheritName); + zephir_read_property(&_3, this_ptr, SL("_roleInherits"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_3, &roleInheritName)) { + zephir_read_property(&_4$$6, this_ptr, SL("_roleInherits"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_5$$6, &_4$$6, &roleInheritName, PH_NOISY | PH_READONLY, "phalcon/acl/adapter/memory.zep", 240 TSRMLS_CC); + zephir_is_iterable(&_5$$6, 0, "phalcon/acl/adapter/memory.zep", 243); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_5$$6), _6$$6) + { + ZEPHIR_INIT_NVAR(&deepInheritName); + ZVAL_COPY(&deepInheritName, _6$$6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinherit", &_7, 76, &roleName, &deepInheritName); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&deepInheritName); } - if (!(zephir_array_isset(rolesNames, roleInheritName))) { - ZEPHIR_INIT_VAR(_10$$8); - object_init_ex(_10$$8, phalcon_acl_exception_ce); - ZEPHIR_INIT_VAR(_11$$8); - ZEPHIR_CONCAT_SVS(_11$$8, "Role '", roleInheritName, "' (to inherit) does not exist in the role list"); - ZEPHIR_CALL_METHOD(NULL, _10$$8, "__construct", NULL, 9, _11$$8); + if (!(zephir_array_isset(&rolesNames, &roleInheritName))) { + ZEPHIR_INIT_VAR(&_8$$8); + object_init_ex(&_8$$8, phalcon_acl_exception_ce); + ZEPHIR_INIT_VAR(&_9$$8); + ZEPHIR_CONCAT_SVS(&_9$$8, "Role '", &roleInheritName, "' (to inherit) does not exist in the role list"); + ZEPHIR_CALL_METHOD(NULL, &_8$$8, "__construct", NULL, 4, &_9$$8); zephir_check_call_status(); - zephir_throw_exception_debug(_10$$8, "phalcon/acl/adapter/memory.zep", 249 TSRMLS_CC); + zephir_throw_exception_debug(&_8$$8, "phalcon/acl/adapter/memory.zep", 249 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (ZEPHIR_IS_EQUAL(roleName, roleInheritName)) { + if (ZEPHIR_IS_EQUAL(&roleName, &roleInheritName)) { RETURN_MM_BOOL(0); } - _12 = zephir_fetch_nproperty_this(this_ptr, SL("_roleInherits"), PH_NOISY_CC); - if (!(zephir_array_isset(_12, roleName))) { - zephir_update_property_array(this_ptr, SL("_roleInherits"), roleName, ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_read_property(&_10, this_ptr, SL("_roleInherits"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_10, &roleName))) { + zephir_update_property_array(this_ptr, SL("_roleInherits"), &roleName, &__$true TSRMLS_CC); } - zephir_update_property_array_multi(this_ptr, SL("_roleInherits"), &roleInheritName TSRMLS_CC, SL("za"), 2, roleName); + zephir_update_property_array_multi(this_ptr, SL("_roleInherits"), &roleInheritName TSRMLS_CC, SL("za"), 2, &roleName); RETURN_MM_BOOL(1); } @@ -325,17 +355,21 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addInherit) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isRole) { - zval *roleName_param = NULL, *_0; - zval *roleName = NULL; + zval *roleName_param = NULL, _0; + zval roleName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&roleName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &roleName_param); - zephir_get_strval(roleName, roleName_param); + zephir_get_strval(&roleName, roleName_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_rolesNames"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, roleName)); + zephir_read_property(&_0, this_ptr, SL("_rolesNames"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &roleName)); } @@ -344,17 +378,21 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isRole) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isResource) { - zval *resourceName_param = NULL, *_0; - zval *resourceName = NULL; + zval *resourceName_param = NULL, _0; + zval resourceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resourceName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &resourceName_param); - zephir_get_strval(resourceName, resourceName_param); + zephir_get_strval(&resourceName, resourceName_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_resourcesNames"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, resourceName)); + zephir_read_property(&_0, this_ptr, SL("_resourcesNames"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &resourceName)); } @@ -399,7 +437,15 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addResource) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *resourceValue, *accessList, *resourceName = NULL, *resourceObject = NULL, *_1; + zval *resourceValue, resourceValue_sub, *accessList, accessList_sub, __$true, resourceName, resourceObject, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resourceValue_sub); + ZVAL_UNDEF(&accessList_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&resourceName); + ZVAL_UNDEF(&resourceObject); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &resourceValue, &accessList); @@ -413,20 +459,20 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addResource) { if (_0) { ZEPHIR_CALL_METHOD(&resourceName, resourceValue, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(resourceObject, resourceValue); + ZEPHIR_CPY_WRT(&resourceObject, resourceValue); } else { - ZEPHIR_CPY_WRT(resourceName, resourceValue); - ZEPHIR_INIT_NVAR(resourceObject); - object_init_ex(resourceObject, phalcon_acl_resource_ce); - ZEPHIR_CALL_METHOD(NULL, resourceObject, "__construct", NULL, 86, resourceName); + ZEPHIR_CPY_WRT(&resourceName, resourceValue); + ZEPHIR_INIT_NVAR(&resourceObject); + object_init_ex(&resourceObject, phalcon_acl_resource_ce); + ZEPHIR_CALL_METHOD(NULL, &resourceObject, "__construct", NULL, 77, &resourceName); zephir_check_call_status(); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_resourcesNames"), PH_NOISY_CC); - if (!(zephir_array_isset(_1, resourceName))) { - zephir_update_property_array_append(this_ptr, SL("_resources"), resourceObject TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_resourcesNames"), resourceName, ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_read_property(&_1, this_ptr, SL("_resourcesNames"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_1, &resourceName))) { + zephir_update_property_array_append(this_ptr, SL("_resources"), &resourceObject TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_resourcesNames"), &resourceName, &__$true TSRMLS_CC); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addresourceaccess", NULL, 0, resourceName, accessList); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addresourceaccess", NULL, 0, &resourceName, accessList); zephir_check_call_status(); RETURN_MM(); @@ -439,28 +485,39 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addResource) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addResourceAccess) { - HashTable *_5$$5; - HashPosition _4$$5; zend_bool exists = 0, _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *resourceName_param = NULL, *accessList, *accessName = NULL, *accessKey = NULL, *_0, *_1$$3, **_6$$5, *_7$$6, *_8$$7 = NULL, *_9$$8, *_10$$9; - zval *resourceName = NULL, *_2$$3; + zval *resourceName_param = NULL, *accessList, accessList_sub, accessName, accessKey, _0, _1$$3, *_4$$5, _5$$6, _6$$7, _7$$8, _8$$9; + zval resourceName, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resourceName); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&accessList_sub); + ZVAL_UNDEF(&accessName); + ZVAL_UNDEF(&accessKey); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_8$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &resourceName_param, &accessList); - zephir_get_strval(resourceName, resourceName_param); + zephir_get_strval(&resourceName, resourceName_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_resourcesNames"), PH_NOISY_CC); - if (!(zephir_array_isset(_0, resourceName))) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_acl_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SVS(_2$$3, "Resource '", resourceName, "' does not exist in ACL"); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _2$$3); + zephir_read_property(&_0, this_ptr, SL("_resourcesNames"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_0, &resourceName))) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_acl_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SVS(&_2$$3, "Resource '", &resourceName, "' does not exist in ACL"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/acl/adapter/memory.zep", 348 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/acl/adapter/memory.zep", 348 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -474,29 +531,29 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addResourceAccess) { } exists = 1; if (Z_TYPE_P(accessList) == IS_ARRAY) { - zephir_is_iterable(accessList, &_5$$5, &_4$$5, 0, 0, "phalcon/acl/adapter/memory.zep", 363); - for ( - ; zend_hash_get_current_data_ex(_5$$5, (void**) &_6$$5, &_4$$5) == SUCCESS - ; zend_hash_move_forward_ex(_5$$5, &_4$$5) - ) { - ZEPHIR_GET_HVALUE(accessName, _6$$5); - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSV(accessKey, resourceName, "!", accessName); - _7$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_accessList"), PH_NOISY_CC); - if (!(zephir_array_isset(_7$$6, accessKey))) { - ZEPHIR_INIT_NVAR(_8$$7); - ZVAL_BOOL(_8$$7, exists); - zephir_update_property_array(this_ptr, SL("_accessList"), accessKey, _8$$7 TSRMLS_CC); + zephir_is_iterable(accessList, 0, "phalcon/acl/adapter/memory.zep", 363); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(accessList), _4$$5) + { + ZEPHIR_INIT_NVAR(&accessName); + ZVAL_COPY(&accessName, _4$$5); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSV(&accessKey, &resourceName, "!", &accessName); + zephir_read_property(&_5$$6, this_ptr, SL("_accessList"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_5$$6, &accessKey))) { + ZEPHIR_INIT_NVAR(&_6$$7); + ZVAL_BOOL(&_6$$7, exists); + zephir_update_property_array(this_ptr, SL("_accessList"), &accessKey, &_6$$7 TSRMLS_CC); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&accessName); } else { - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSV(accessKey, resourceName, "!", accessList); - _9$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_accessList"), PH_NOISY_CC); - if (!(zephir_array_isset(_9$$8, accessKey))) { - ZEPHIR_INIT_VAR(_10$$9); - ZVAL_BOOL(_10$$9, exists); - zephir_update_property_array(this_ptr, SL("_accessList"), accessKey, _10$$9 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSV(&accessKey, &resourceName, "!", accessList); + zephir_read_property(&_7$$8, this_ptr, SL("_accessList"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_7$$8, &accessKey))) { + ZEPHIR_INIT_VAR(&_8$$9); + ZVAL_BOOL(&_8$$9, exists); + zephir_update_property_array(this_ptr, SL("_accessList"), &accessKey, &_8$$9 TSRMLS_CC); } } RETURN_MM_BOOL(1); @@ -510,40 +567,48 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, addResourceAccess) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, dropResourceAccess) { - HashTable *_1$$3; - HashPosition _0$$3; - zval *resourceName_param = NULL, *accessList, *accessName = NULL, *accessKey = NULL, **_2$$3, *_3$$4, *_4$$5, *_5$$7, *_6$$8; - zval *resourceName = NULL; + zval *resourceName_param = NULL, *accessList, accessList_sub, accessName, accessKey, *_0$$3, _1$$4, _2$$5, _3$$7, _4$$8; + zval resourceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resourceName); + ZVAL_UNDEF(&accessList_sub); + ZVAL_UNDEF(&accessName); + ZVAL_UNDEF(&accessKey); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &resourceName_param, &accessList); - zephir_get_strval(resourceName, resourceName_param); + zephir_get_strval(&resourceName, resourceName_param); if (Z_TYPE_P(accessList) == IS_ARRAY) { - zephir_is_iterable(accessList, &_1$$3, &_0$$3, 0, 0, "phalcon/acl/adapter/memory.zep", 389); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(accessName, _2$$3); - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSV(accessKey, resourceName, "!", accessName); - _3$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_accessList"), PH_NOISY_CC); - if (zephir_array_isset(_3$$4, accessKey)) { - _4$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_accessList"), PH_NOISY_CC); - zephir_array_unset(&_4$$5, accessKey, PH_SEPARATE); + zephir_is_iterable(accessList, 0, "phalcon/acl/adapter/memory.zep", 389); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(accessList), _0$$3) + { + ZEPHIR_INIT_NVAR(&accessName); + ZVAL_COPY(&accessName, _0$$3); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSV(&accessKey, &resourceName, "!", &accessName); + zephir_read_property(&_1$$4, this_ptr, SL("_accessList"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_1$$4, &accessKey)) { + zephir_read_property(&_2$$5, this_ptr, SL("_accessList"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_2$$5, &accessKey, PH_SEPARATE); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&accessName); } else { if (Z_TYPE_P(accessList) == IS_STRING) { - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSV(accessKey, resourceName, "!", accessName); - _5$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_accessList"), PH_NOISY_CC); - if (zephir_array_isset(_5$$7, accessKey)) { - _6$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_accessList"), PH_NOISY_CC); - zephir_array_unset(&_6$$8, accessKey, PH_SEPARATE); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSV(&accessKey, &resourceName, "!", &accessName); + zephir_read_property(&_3$$7, this_ptr, SL("_accessList"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_3$$7, &accessKey)) { + zephir_read_property(&_4$$8, this_ptr, SL("_accessList"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_4$$8, &accessKey, PH_SEPARATE); } } } @@ -556,103 +621,123 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, dropResourceAccess) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, _allowOrDeny) { - HashTable *_7$$5, *_12$$5; - HashPosition _6$$5, _11$$5; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *roleName_param = NULL, *resourceName_param = NULL, *access, *action, *func = NULL, *accessList = NULL, *accessName = NULL, *accessKey = NULL, *_0, *_3, *_1$$3, *_4$$4, **_8$$5, **_13$$5, *_9$$7 = NULL, *_10$$7 = NULL, *_14$$12, *_15$$12; - zval *roleName = NULL, *resourceName = NULL, *_2$$3, *_5$$4; + zval *roleName_param = NULL, *resourceName_param = NULL, *access, access_sub, *action, action_sub, *func = NULL, func_sub, __$null, accessList, accessName, accessKey, _0, _3, _1$$3, _4$$4, *_6$$5, *_9$$5, _7$$7, _8$$7, _10$$12, _11$$12; + zval roleName, resourceName, _2$$3, _5$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&roleName); + ZVAL_UNDEF(&resourceName); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&access_sub); + ZVAL_UNDEF(&action_sub); + ZVAL_UNDEF(&func_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&accessList); + ZVAL_UNDEF(&accessName); + ZVAL_UNDEF(&accessKey); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_10$$12); + ZVAL_UNDEF(&_11$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &roleName_param, &resourceName_param, &access, &action, &func); - zephir_get_strval(roleName, roleName_param); - zephir_get_strval(resourceName, resourceName_param); + zephir_get_strval(&roleName, roleName_param); + zephir_get_strval(&resourceName, resourceName_param); if (!func) { - func = ZEPHIR_GLOBAL(global_null); + func = &func_sub; + func = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_rolesNames"), PH_NOISY_CC); - if (!(zephir_array_isset(_0, roleName))) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_acl_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SVS(_2$$3, "Role '", roleName, "' does not exist in ACL"); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _2$$3); + zephir_read_property(&_0, this_ptr, SL("_rolesNames"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_0, &roleName))) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_acl_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SVS(&_2$$3, "Role '", &roleName, "' does not exist in ACL"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/acl/adapter/memory.zep", 407 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/acl/adapter/memory.zep", 407 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_resourcesNames"), PH_NOISY_CC); - if (!(zephir_array_isset(_3, resourceName))) { - ZEPHIR_INIT_VAR(_4$$4); - object_init_ex(_4$$4, phalcon_acl_exception_ce); - ZEPHIR_INIT_VAR(_5$$4); - ZEPHIR_CONCAT_SVS(_5$$4, "Resource '", resourceName, "' does not exist in ACL"); - ZEPHIR_CALL_METHOD(NULL, _4$$4, "__construct", NULL, 9, _5$$4); + zephir_read_property(&_3, this_ptr, SL("_resourcesNames"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_3, &resourceName))) { + ZEPHIR_INIT_VAR(&_4$$4); + object_init_ex(&_4$$4, phalcon_acl_exception_ce); + ZEPHIR_INIT_VAR(&_5$$4); + ZEPHIR_CONCAT_SVS(&_5$$4, "Resource '", &resourceName, "' does not exist in ACL"); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 4, &_5$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$4, "phalcon/acl/adapter/memory.zep", 411 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$4, "phalcon/acl/adapter/memory.zep", 411 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_VAR(accessList); - zephir_read_property_this(&accessList, this_ptr, SL("_accessList"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&accessList); + zephir_read_property(&accessList, this_ptr, SL("_accessList"), PH_NOISY_CC); if (Z_TYPE_P(access) == IS_ARRAY) { - zephir_is_iterable(access, &_7$$5, &_6$$5, 0, 0, "phalcon/acl/adapter/memory.zep", 425); - for ( - ; zend_hash_get_current_data_ex(_7$$5, (void**) &_8$$5, &_6$$5) == SUCCESS - ; zend_hash_move_forward_ex(_7$$5, &_6$$5) - ) { - ZEPHIR_GET_HVALUE(accessName, _8$$5); - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSV(accessKey, resourceName, "!", accessName); - if (!(zephir_array_isset(accessList, accessKey))) { - ZEPHIR_INIT_NVAR(_9$$7); - object_init_ex(_9$$7, phalcon_acl_exception_ce); - ZEPHIR_INIT_LNVAR(_10$$7); - ZEPHIR_CONCAT_SVSVS(_10$$7, "Access '", accessName, "' does not exist in resource '", resourceName, "'"); - ZEPHIR_CALL_METHOD(NULL, _9$$7, "__construct", NULL, 9, _10$$7); + zephir_is_iterable(access, 0, "phalcon/acl/adapter/memory.zep", 425); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(access), _6$$5) + { + ZEPHIR_INIT_NVAR(&accessName); + ZVAL_COPY(&accessName, _6$$5); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSV(&accessKey, &resourceName, "!", &accessName); + if (!(zephir_array_isset(&accessList, &accessKey))) { + ZEPHIR_INIT_NVAR(&_7$$7); + object_init_ex(&_7$$7, phalcon_acl_exception_ce); + ZEPHIR_INIT_LNVAR(_8$$7); + ZEPHIR_CONCAT_SVSVS(&_8$$7, "Access '", &accessName, "' does not exist in resource '", &resourceName, "'"); + ZEPHIR_CALL_METHOD(NULL, &_7$$7, "__construct", NULL, 4, &_8$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$7, "phalcon/acl/adapter/memory.zep", 421 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$7, "phalcon/acl/adapter/memory.zep", 421 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - } - zephir_is_iterable(access, &_12$$5, &_11$$5, 0, 0, "phalcon/acl/adapter/memory.zep", 434); - for ( - ; zend_hash_get_current_data_ex(_12$$5, (void**) &_13$$5, &_11$$5) == SUCCESS - ; zend_hash_move_forward_ex(_12$$5, &_11$$5) - ) { - ZEPHIR_GET_HVALUE(accessName, _13$$5); - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSVSV(accessKey, roleName, "!", resourceName, "!", accessName); - zephir_update_property_array(this_ptr, SL("_access"), accessKey, action TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&accessName); + zephir_is_iterable(access, 0, "phalcon/acl/adapter/memory.zep", 434); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(access), _9$$5) + { + ZEPHIR_INIT_NVAR(&accessName); + ZVAL_COPY(&accessName, _9$$5); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSVSV(&accessKey, &roleName, "!", &resourceName, "!", &accessName); + zephir_update_property_array(this_ptr, SL("_access"), &accessKey, action TSRMLS_CC); if (Z_TYPE_P(func) != IS_NULL) { - zephir_update_property_array(this_ptr, SL("_func"), accessKey, func TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_func"), &accessKey, func TSRMLS_CC); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&accessName); } else { if (!ZEPHIR_IS_STRING(access, "*")) { - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSV(accessKey, resourceName, "!", access); - if (!(zephir_array_isset(accessList, accessKey))) { - ZEPHIR_INIT_VAR(_14$$12); - object_init_ex(_14$$12, phalcon_acl_exception_ce); - ZEPHIR_INIT_VAR(_15$$12); - ZEPHIR_CONCAT_SVSVS(_15$$12, "Access '", access, "' does not exist in resource '", resourceName, "'"); - ZEPHIR_CALL_METHOD(NULL, _14$$12, "__construct", NULL, 9, _15$$12); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSV(&accessKey, &resourceName, "!", access); + if (!(zephir_array_isset(&accessList, &accessKey))) { + ZEPHIR_INIT_VAR(&_10$$12); + object_init_ex(&_10$$12, phalcon_acl_exception_ce); + ZEPHIR_INIT_VAR(&_11$$12); + ZEPHIR_CONCAT_SVSVS(&_11$$12, "Access '", access, "' does not exist in resource '", &resourceName, "'"); + ZEPHIR_CALL_METHOD(NULL, &_10$$12, "__construct", NULL, 4, &_11$$12); zephir_check_call_status(); - zephir_throw_exception_debug(_14$$12, "phalcon/acl/adapter/memory.zep", 439 TSRMLS_CC); + zephir_throw_exception_debug(&_10$$12, "phalcon/acl/adapter/memory.zep", 439 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSVSV(accessKey, roleName, "!", resourceName, "!", access); - zephir_update_property_array(this_ptr, SL("_access"), accessKey, action TSRMLS_CC); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSVSV(&accessKey, &roleName, "!", &resourceName, "!", access); + zephir_update_property_array(this_ptr, SL("_access"), &accessKey, action TSRMLS_CC); if (Z_TYPE_P(func) != IS_NULL) { - zephir_update_property_array(this_ptr, SL("_func"), accessKey, func TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_func"), &accessKey, func TSRMLS_CC); } } ZEPHIR_MM_RESTORE(); @@ -681,43 +766,60 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, _allowOrDeny) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, allow) { - HashTable *_4$$4; - HashPosition _3$$4; + zend_string *_5$$4; + zend_ulong _4$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *roleName_param = NULL, *resourceName_param = NULL, *access, *func = NULL, *innerRoleName = NULL, *_0$$3, *_1$$4, *_2$$4 = NULL, **_5$$4, *_6$$5 = NULL; - zval *roleName = NULL, *resourceName = NULL; + zval *roleName_param = NULL, *resourceName_param = NULL, *access, access_sub, *func = NULL, func_sub, __$null, innerRoleName, _0$$3, _1$$4, _2$$4, *_3$$4, _6$$5; + zval roleName, resourceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&roleName); + ZVAL_UNDEF(&resourceName); + ZVAL_UNDEF(&access_sub); + ZVAL_UNDEF(&func_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&innerRoleName); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_6$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &roleName_param, &resourceName_param, &access, &func); - zephir_get_strval(roleName, roleName_param); - zephir_get_strval(resourceName, resourceName_param); + zephir_get_strval(&roleName, roleName_param); + zephir_get_strval(&resourceName, resourceName_param); if (!func) { - func = ZEPHIR_GLOBAL(global_null); + func = &func_sub; + func = &__$null; } - if (!ZEPHIR_IS_STRING(roleName, "*")) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_LONG(_0$$3, 1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_allowordeny", NULL, 0, roleName, resourceName, access, _0$$3, func); + if (!ZEPHIR_IS_STRING(&roleName, "*")) { + ZVAL_LONG(&_0$$3, 1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_allowordeny", NULL, 0, &roleName, &resourceName, access, &_0$$3, func); zephir_check_call_status(); RETURN_MM(); } else { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_rolesNames"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2$$4); - zephir_is_iterable(_1$$4, &_4$$4, &_3$$4, 0, 0, "phalcon/acl/adapter/memory.zep", 486); - for ( - ; zend_hash_get_current_data_ex(_4$$4, (void**) &_5$$4, &_3$$4) == SUCCESS - ; zend_hash_move_forward_ex(_4$$4, &_3$$4) - ) { - ZEPHIR_GET_HMKEY(innerRoleName, _4$$4, _3$$4); - ZEPHIR_GET_HVALUE(_2$$4, _5$$4); - ZEPHIR_INIT_NVAR(_6$$5); - ZVAL_LONG(_6$$5, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_allowordeny", NULL, 0, innerRoleName, resourceName, access, _6$$5, func); + zephir_read_property(&_1$$4, this_ptr, SL("_rolesNames"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2$$4); + zephir_is_iterable(&_1$$4, 0, "phalcon/acl/adapter/memory.zep", 486); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_1$$4), _4$$4, _5$$4, _3$$4) + { + ZEPHIR_INIT_NVAR(&innerRoleName); + if (_5$$4 != NULL) { + ZVAL_STR_COPY(&innerRoleName, _5$$4); + } else { + ZVAL_LONG(&innerRoleName, _4$$4); + } + ZEPHIR_INIT_NVAR(&_2$$4); + ZVAL_COPY(&_2$$4, _3$$4); + ZVAL_LONG(&_6$$5, 1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_allowordeny", NULL, 0, &innerRoleName, &resourceName, access, &_6$$5, func); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_2$$4); + ZEPHIR_INIT_NVAR(&innerRoleName); } ZEPHIR_MM_RESTORE(); @@ -745,43 +847,60 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, allow) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, deny) { - HashTable *_4$$4; - HashPosition _3$$4; + zend_string *_5$$4; + zend_ulong _4$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *roleName_param = NULL, *resourceName_param = NULL, *access, *func = NULL, *innerRoleName = NULL, *_0$$3, *_1$$4, *_2$$4 = NULL, **_5$$4, *_6$$5 = NULL; - zval *roleName = NULL, *resourceName = NULL; + zval *roleName_param = NULL, *resourceName_param = NULL, *access, access_sub, *func = NULL, func_sub, __$null, innerRoleName, _0$$3, _1$$4, _2$$4, *_3$$4, _6$$5; + zval roleName, resourceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&roleName); + ZVAL_UNDEF(&resourceName); + ZVAL_UNDEF(&access_sub); + ZVAL_UNDEF(&func_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&innerRoleName); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_6$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &roleName_param, &resourceName_param, &access, &func); - zephir_get_strval(roleName, roleName_param); - zephir_get_strval(resourceName, resourceName_param); + zephir_get_strval(&roleName, roleName_param); + zephir_get_strval(&resourceName, resourceName_param); if (!func) { - func = ZEPHIR_GLOBAL(global_null); + func = &func_sub; + func = &__$null; } - if (!ZEPHIR_IS_STRING(roleName, "*")) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_LONG(_0$$3, 0); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_allowordeny", NULL, 0, roleName, resourceName, access, _0$$3, func); + if (!ZEPHIR_IS_STRING(&roleName, "*")) { + ZVAL_LONG(&_0$$3, 0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_allowordeny", NULL, 0, &roleName, &resourceName, access, &_0$$3, func); zephir_check_call_status(); RETURN_MM(); } else { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_rolesNames"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2$$4); - zephir_is_iterable(_1$$4, &_4$$4, &_3$$4, 0, 0, "phalcon/acl/adapter/memory.zep", 519); - for ( - ; zend_hash_get_current_data_ex(_4$$4, (void**) &_5$$4, &_3$$4) == SUCCESS - ; zend_hash_move_forward_ex(_4$$4, &_3$$4) - ) { - ZEPHIR_GET_HMKEY(innerRoleName, _4$$4, _3$$4); - ZEPHIR_GET_HVALUE(_2$$4, _5$$4); - ZEPHIR_INIT_NVAR(_6$$5); - ZVAL_LONG(_6$$5, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_allowordeny", NULL, 0, innerRoleName, resourceName, access, _6$$5, func); + zephir_read_property(&_1$$4, this_ptr, SL("_rolesNames"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2$$4); + zephir_is_iterable(&_1$$4, 0, "phalcon/acl/adapter/memory.zep", 519); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_1$$4), _4$$4, _5$$4, _3$$4) + { + ZEPHIR_INIT_NVAR(&innerRoleName); + if (_5$$4 != NULL) { + ZVAL_STR_COPY(&innerRoleName, _5$$4); + } else { + ZVAL_LONG(&innerRoleName, _4$$4); + } + ZEPHIR_INIT_NVAR(&_2$$4); + ZVAL_COPY(&_2$$4, _3$$4); + ZVAL_LONG(&_6$$5, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_allowordeny", NULL, 0, &innerRoleName, &resourceName, access, &_6$$5, func); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_2$$4); + ZEPHIR_INIT_NVAR(&innerRoleName); } ZEPHIR_MM_RESTORE(); @@ -803,48 +922,101 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, deny) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) { - HashTable *_7$$17, *_10$$23, *_13$$29, *_20$$34; - HashPosition _6$$17, _9$$23, _12$$29, _19$$34; - zend_bool hasRole, hasResource, _17$$35, _22$$37, _24$$37, _25$$37, _27$$37, _28$$37, _30$$37, _43$$44, _45$$43, _47$$45; - zephir_fcall_cache_entry *_38 = NULL; + zend_bool hasRole, hasResource, _11$$35, _14$$37, _16$$37, _17$$37, _19$$37, _20$$37, _22$$37, _35$$44, _37$$43, _39$$45; + zephir_fcall_cache_entry *_30 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters = NULL; - zval *access = NULL; - zval *roleName = NULL, *resourceName = NULL, *access_param = NULL, *parameters_param = NULL, *eventsManager = NULL, *accessList = NULL, *accessKey = NULL, *haveAccess = NULL, *roleInherits = NULL, *inheritedRole = NULL, *rolesNames = NULL, *inheritedRoles = NULL, *funcAccess = NULL, *resourceObject = NULL, *roleObject = NULL, *funcList = NULL, *reflectionFunction = NULL, *reflectionParameters = NULL, *parameterNumber = NULL, *parametersForFunction = NULL, *numberOfRequiredParameters = NULL, *userParametersSizeShouldBe = NULL, *reflectionClass = NULL, *parameterToCheck = NULL, *reflectionParameter = NULL, *_2, *_0$$5 = NULL, *_1$$9 = NULL, *_3$$11 = NULL, *_4$$11, *_5$$13, **_8$$17, **_11$$23, **_14$$29, *_15$$32, *_16$$33, *_18$$35, **_21$$34, *_49$$34, *_50$$34, *_23$$37 = NULL, *_26$$37 = NULL, *_29$$37 = NULL, *_31$$37 = NULL, *_32$$37, *_33$$40 = NULL, *_34$$40 = NULL, *_35$$40, *_36$$40 = NULL, *_37$$40 = NULL, *_39$$41, *_40$$42, _41$$42, *_42$$44, *_44$$44, *_46$$43, *_48$$45; + zval parameters; + zval access; + zval *roleName = NULL, roleName_sub, *resourceName = NULL, resourceName_sub, *access_param = NULL, *parameters_param = NULL, eventsManager, accessList, accessKey, haveAccess, roleInherits, inheritedRole, rolesNames, inheritedRoles, funcAccess, resourceObject, roleObject, funcList, reflectionFunction, reflectionParameters, parameterNumber, parametersForFunction, numberOfRequiredParameters, userParametersSizeShouldBe, reflectionClass, parameterToCheck, reflectionParameter, _2, _0$$5, _1$$9, _3$$11, _4$$11, _5$$13, *_6$$17, *_7$$23, *_8$$29, _9$$32, _10$$33, _12$$35, *_13$$34, _41$$34, _42$$34, _15$$37, _18$$37, _21$$37, _23$$37, _24$$37, _25$$40, _26$$40, _27$$40, _28$$40, _29$$40, _31$$41, _32$$42, _33$$42, _34$$44, _36$$44, _38$$43, _40$$45; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&roleName_sub); + ZVAL_UNDEF(&resourceName_sub); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&accessList); + ZVAL_UNDEF(&accessKey); + ZVAL_UNDEF(&haveAccess); + ZVAL_UNDEF(&roleInherits); + ZVAL_UNDEF(&inheritedRole); + ZVAL_UNDEF(&rolesNames); + ZVAL_UNDEF(&inheritedRoles); + ZVAL_UNDEF(&funcAccess); + ZVAL_UNDEF(&resourceObject); + ZVAL_UNDEF(&roleObject); + ZVAL_UNDEF(&funcList); + ZVAL_UNDEF(&reflectionFunction); + ZVAL_UNDEF(&reflectionParameters); + ZVAL_UNDEF(¶meterNumber); + ZVAL_UNDEF(¶metersForFunction); + ZVAL_UNDEF(&numberOfRequiredParameters); + ZVAL_UNDEF(&userParametersSizeShouldBe); + ZVAL_UNDEF(&reflectionClass); + ZVAL_UNDEF(¶meterToCheck); + ZVAL_UNDEF(&reflectionParameter); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$9); + ZVAL_UNDEF(&_3$$11); + ZVAL_UNDEF(&_4$$11); + ZVAL_UNDEF(&_5$$13); + ZVAL_UNDEF(&_9$$32); + ZVAL_UNDEF(&_10$$33); + ZVAL_UNDEF(&_12$$35); + ZVAL_UNDEF(&_41$$34); + ZVAL_UNDEF(&_42$$34); + ZVAL_UNDEF(&_15$$37); + ZVAL_UNDEF(&_18$$37); + ZVAL_UNDEF(&_21$$37); + ZVAL_UNDEF(&_23$$37); + ZVAL_UNDEF(&_24$$37); + ZVAL_UNDEF(&_25$$40); + ZVAL_UNDEF(&_26$$40); + ZVAL_UNDEF(&_27$$40); + ZVAL_UNDEF(&_28$$40); + ZVAL_UNDEF(&_29$$40); + ZVAL_UNDEF(&_31$$41); + ZVAL_UNDEF(&_32$$42); + ZVAL_UNDEF(&_33$$42); + ZVAL_UNDEF(&_34$$44); + ZVAL_UNDEF(&_36$$44); + ZVAL_UNDEF(&_38$$43); + ZVAL_UNDEF(&_40$$45); + ZVAL_UNDEF(&access); + ZVAL_UNDEF(¶meters); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &roleName, &resourceName, &access_param, ¶meters_param); ZEPHIR_SEPARATE_PARAM(roleName); ZEPHIR_SEPARATE_PARAM(resourceName); - zephir_get_strval(access, access_param); + zephir_get_strval(&access, access_param); if (!parameters_param) { - ZEPHIR_INIT_VAR(parameters); - array_init(parameters); + ZEPHIR_INIT_VAR(¶meters); + array_init(¶meters); } else { - zephir_get_arrval(parameters, parameters_param); + zephir_get_arrval(¶meters, parameters_param); } - ZEPHIR_INIT_VAR(haveAccess); - ZVAL_NULL(haveAccess); - ZEPHIR_INIT_VAR(funcAccess); - ZVAL_NULL(funcAccess); - ZEPHIR_INIT_VAR(resourceObject); - ZVAL_NULL(resourceObject); - ZEPHIR_INIT_VAR(roleObject); - ZVAL_NULL(roleObject); + ZEPHIR_INIT_VAR(&haveAccess); + ZVAL_NULL(&haveAccess); + ZEPHIR_INIT_VAR(&funcAccess); + ZVAL_NULL(&funcAccess); + ZEPHIR_INIT_VAR(&resourceObject); + ZVAL_NULL(&resourceObject); + ZEPHIR_INIT_VAR(&roleObject); + ZVAL_NULL(&roleObject); hasRole = 0; hasResource = 0; if (Z_TYPE_P(roleName) == IS_OBJECT) { if (zephir_instance_of_ev(roleName, phalcon_acl_roleaware_ce TSRMLS_CC)) { - ZEPHIR_CPY_WRT(roleObject, roleName); - ZEPHIR_CALL_METHOD(&roleName, roleObject, "getrolename", NULL, 0); + ZEPHIR_CPY_WRT(&roleObject, roleName); + ZEPHIR_CALL_METHOD(roleName, &roleObject, "getrolename", NULL, 0); zephir_check_call_status(); } else if (zephir_instance_of_ev(roleName, phalcon_acl_roleinterface_ce TSRMLS_CC)) { ZEPHIR_CALL_METHOD(&_0$$5, roleName, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(roleName, _0$$5); + ZEPHIR_CPY_WRT(roleName, &_0$$5); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Object passed as roleName must implement Phalcon\\Acl\\RoleAware or Phalcon\\Acl\\RoleInterface", "phalcon/acl/adapter/memory.zep", 552); return; @@ -852,300 +1024,297 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) { } if (Z_TYPE_P(resourceName) == IS_OBJECT) { if (zephir_instance_of_ev(resourceName, phalcon_acl_resourceaware_ce TSRMLS_CC)) { - ZEPHIR_CPY_WRT(resourceObject, resourceName); - ZEPHIR_CALL_METHOD(&resourceName, resourceObject, "getresourcename", NULL, 0); + ZEPHIR_CPY_WRT(&resourceObject, resourceName); + ZEPHIR_CALL_METHOD(resourceName, &resourceObject, "getresourcename", NULL, 0); zephir_check_call_status(); } else if (zephir_instance_of_ev(resourceName, phalcon_acl_resourceinterface_ce TSRMLS_CC)) { ZEPHIR_CALL_METHOD(&_1$$9, resourceName, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(resourceName, _1$$9); + ZEPHIR_CPY_WRT(resourceName, &_1$$9); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Object passed as resourceName must implement Phalcon\\Acl\\ResourceAware or Phalcon\\Acl\\ResourceInterface", "phalcon/acl/adapter/memory.zep", 563); return; } } - zephir_update_property_this(getThis(), SL("_activeRole"), roleName TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_activeResource"), resourceName TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_activeAccess"), access TSRMLS_CC); - ZEPHIR_OBS_VAR(accessList); - zephir_read_property_this(&accessList, this_ptr, SL("_access"), PH_NOISY_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _2); - ZEPHIR_OBS_VAR(funcList); - zephir_read_property_this(&funcList, this_ptr, SL("_func"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_4$$11); - ZVAL_STRING(_4$$11, "acl:beforeCheckAccess", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3$$11, eventsManager, "fire", NULL, 0, _4$$11, this_ptr); - zephir_check_temp_parameter(_4$$11); + zephir_update_property_zval(this_ptr, SL("_activeRole"), roleName); + zephir_update_property_zval(this_ptr, SL("_activeResource"), resourceName); + zephir_update_property_zval(this_ptr, SL("_activeAccess"), &access); + ZEPHIR_OBS_VAR(&accessList); + zephir_read_property(&accessList, this_ptr, SL("_access"), PH_NOISY_CC); + zephir_read_property(&_2, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_2); + ZEPHIR_OBS_VAR(&funcList); + zephir_read_property(&funcList, this_ptr, SL("_func"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_4$$11); + ZVAL_STRING(&_4$$11, "acl:beforeCheckAccess"); + ZEPHIR_CALL_METHOD(&_3$$11, &eventsManager, "fire", NULL, 0, &_4$$11, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_3$$11)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_3$$11)) { RETURN_MM_BOOL(0); } } - ZEPHIR_OBS_VAR(rolesNames); - zephir_read_property_this(&rolesNames, this_ptr, SL("_rolesNames"), PH_NOISY_CC); - if (!(zephir_array_isset(rolesNames, roleName))) { - _5$$13 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultAccess"), PH_NOISY_CC); - RETURN_MM_BOOL((ZEPHIR_IS_LONG(_5$$13, 1))); + ZEPHIR_OBS_VAR(&rolesNames); + zephir_read_property(&rolesNames, this_ptr, SL("_rolesNames"), PH_NOISY_CC); + if (!(zephir_array_isset(&rolesNames, roleName))) { + zephir_read_property(&_5$$13, this_ptr, SL("_defaultAccess"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL((ZEPHIR_IS_LONG(&_5$$13, 1))); } - ZEPHIR_INIT_VAR(accessKey); - ZEPHIR_CONCAT_VSVSV(accessKey, roleName, "!", resourceName, "!", access); - if (zephir_array_isset(accessList, accessKey)) { - ZEPHIR_OBS_NVAR(haveAccess); - zephir_array_fetch(&haveAccess, accessList, accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 595 TSRMLS_CC); + ZEPHIR_INIT_VAR(&accessKey); + ZEPHIR_CONCAT_VSVSV(&accessKey, roleName, "!", resourceName, "!", &access); + if (zephir_array_isset(&accessList, &accessKey)) { + ZEPHIR_OBS_NVAR(&haveAccess); + zephir_array_fetch(&haveAccess, &accessList, &accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 595 TSRMLS_CC); } - ZEPHIR_OBS_NVAR(funcAccess); - zephir_array_isset_fetch(&funcAccess, funcList, accessKey, 0 TSRMLS_CC); - if (Z_TYPE_P(haveAccess) == IS_NULL) { - ZEPHIR_OBS_VAR(roleInherits); - zephir_read_property_this(&roleInherits, this_ptr, SL("_roleInherits"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(inheritedRoles); - if (zephir_array_isset_fetch(&inheritedRoles, roleInherits, roleName, 0 TSRMLS_CC)) { - if (Z_TYPE_P(inheritedRoles) == IS_ARRAY) { - zephir_is_iterable(inheritedRoles, &_7$$17, &_6$$17, 0, 0, "phalcon/acl/adapter/memory.zep", 619); - for ( - ; zend_hash_get_current_data_ex(_7$$17, (void**) &_8$$17, &_6$$17) == SUCCESS - ; zend_hash_move_forward_ex(_7$$17, &_6$$17) - ) { - ZEPHIR_GET_HVALUE(inheritedRole, _8$$17); - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSVSV(accessKey, inheritedRole, "!", resourceName, "!", access); - if (zephir_array_isset(accessList, accessKey)) { - ZEPHIR_OBS_NVAR(haveAccess); - zephir_array_fetch(&haveAccess, accessList, accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 615 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&funcAccess); + zephir_array_isset_fetch(&funcAccess, &funcList, &accessKey, 0 TSRMLS_CC); + if (Z_TYPE_P(&haveAccess) == IS_NULL) { + ZEPHIR_OBS_VAR(&roleInherits); + zephir_read_property(&roleInherits, this_ptr, SL("_roleInherits"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&inheritedRoles); + if (zephir_array_isset_fetch(&inheritedRoles, &roleInherits, roleName, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&inheritedRoles) == IS_ARRAY) { + zephir_is_iterable(&inheritedRoles, 0, "phalcon/acl/adapter/memory.zep", 619); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&inheritedRoles), _6$$17) + { + ZEPHIR_INIT_NVAR(&inheritedRole); + ZVAL_COPY(&inheritedRole, _6$$17); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSVSV(&accessKey, &inheritedRole, "!", resourceName, "!", &access); + if (zephir_array_isset(&accessList, &accessKey)) { + ZEPHIR_OBS_NVAR(&haveAccess); + zephir_array_fetch(&haveAccess, &accessList, &accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 615 TSRMLS_CC); } - ZEPHIR_OBS_NVAR(funcAccess); - zephir_array_isset_fetch(&funcAccess, funcList, accessKey, 0 TSRMLS_CC); - } + ZEPHIR_OBS_NVAR(&funcAccess); + zephir_array_isset_fetch(&funcAccess, &funcList, &accessKey, 0 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&inheritedRole); } } } - if (Z_TYPE_P(haveAccess) == IS_NULL) { - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSVS(accessKey, roleName, "!", resourceName, "!*"); - if (zephir_array_isset(accessList, accessKey)) { - ZEPHIR_OBS_NVAR(haveAccess); - zephir_array_fetch(&haveAccess, accessList, accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 634 TSRMLS_CC); - ZEPHIR_OBS_NVAR(funcAccess); - zephir_array_isset_fetch(&funcAccess, funcList, accessKey, 0 TSRMLS_CC); + if (Z_TYPE_P(&haveAccess) == IS_NULL) { + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSVS(&accessKey, roleName, "!", resourceName, "!*"); + if (zephir_array_isset(&accessList, &accessKey)) { + ZEPHIR_OBS_NVAR(&haveAccess); + zephir_array_fetch(&haveAccess, &accessList, &accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 634 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&funcAccess); + zephir_array_isset_fetch(&funcAccess, &funcList, &accessKey, 0 TSRMLS_CC); } else { - if (Z_TYPE_P(inheritedRoles) == IS_ARRAY) { - zephir_is_iterable(inheritedRoles, &_10$$23, &_9$$23, 0, 0, "phalcon/acl/adapter/memory.zep", 650); - for ( - ; zend_hash_get_current_data_ex(_10$$23, (void**) &_11$$23, &_9$$23) == SUCCESS - ; zend_hash_move_forward_ex(_10$$23, &_9$$23) - ) { - ZEPHIR_GET_HVALUE(inheritedRole, _11$$23); - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VSVS(accessKey, inheritedRole, "!", resourceName, "!*"); - ZEPHIR_OBS_NVAR(funcAccess); - zephir_array_isset_fetch(&funcAccess, funcList, accessKey, 0 TSRMLS_CC); - if (zephir_array_isset(accessList, accessKey)) { - ZEPHIR_OBS_NVAR(haveAccess); - zephir_array_fetch(&haveAccess, accessList, accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 646 TSRMLS_CC); + if (Z_TYPE_P(&inheritedRoles) == IS_ARRAY) { + zephir_is_iterable(&inheritedRoles, 0, "phalcon/acl/adapter/memory.zep", 650); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&inheritedRoles), _7$$23) + { + ZEPHIR_INIT_NVAR(&inheritedRole); + ZVAL_COPY(&inheritedRole, _7$$23); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VSVS(&accessKey, &inheritedRole, "!", resourceName, "!*"); + ZEPHIR_OBS_NVAR(&funcAccess); + zephir_array_isset_fetch(&funcAccess, &funcList, &accessKey, 0 TSRMLS_CC); + if (zephir_array_isset(&accessList, &accessKey)) { + ZEPHIR_OBS_NVAR(&haveAccess); + zephir_array_fetch(&haveAccess, &accessList, &accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 646 TSRMLS_CC); break; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&inheritedRole); } } } - if (Z_TYPE_P(haveAccess) == IS_NULL) { - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VS(accessKey, roleName, "!*!*"); - if (zephir_array_isset(accessList, accessKey)) { - ZEPHIR_OBS_NVAR(haveAccess); - zephir_array_fetch(&haveAccess, accessList, accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 665 TSRMLS_CC); - ZEPHIR_OBS_NVAR(funcAccess); - zephir_array_isset_fetch(&funcAccess, funcList, accessKey, 0 TSRMLS_CC); + if (Z_TYPE_P(&haveAccess) == IS_NULL) { + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VS(&accessKey, roleName, "!*!*"); + if (zephir_array_isset(&accessList, &accessKey)) { + ZEPHIR_OBS_NVAR(&haveAccess); + zephir_array_fetch(&haveAccess, &accessList, &accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 665 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&funcAccess); + zephir_array_isset_fetch(&funcAccess, &funcList, &accessKey, 0 TSRMLS_CC); } else { - if (Z_TYPE_P(inheritedRoles) == IS_ARRAY) { - zephir_is_iterable(inheritedRoles, &_13$$29, &_12$$29, 0, 0, "phalcon/acl/adapter/memory.zep", 681); - for ( - ; zend_hash_get_current_data_ex(_13$$29, (void**) &_14$$29, &_12$$29) == SUCCESS - ; zend_hash_move_forward_ex(_13$$29, &_12$$29) - ) { - ZEPHIR_GET_HVALUE(inheritedRole, _14$$29); - ZEPHIR_INIT_NVAR(accessKey); - ZEPHIR_CONCAT_VS(accessKey, inheritedRole, "!*!*"); - ZEPHIR_OBS_NVAR(funcAccess); - zephir_array_isset_fetch(&funcAccess, funcList, accessKey, 0 TSRMLS_CC); - if (zephir_array_isset(accessList, accessKey)) { - ZEPHIR_OBS_NVAR(haveAccess); - zephir_array_fetch(&haveAccess, accessList, accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 677 TSRMLS_CC); + if (Z_TYPE_P(&inheritedRoles) == IS_ARRAY) { + zephir_is_iterable(&inheritedRoles, 0, "phalcon/acl/adapter/memory.zep", 681); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&inheritedRoles), _8$$29) + { + ZEPHIR_INIT_NVAR(&inheritedRole); + ZVAL_COPY(&inheritedRole, _8$$29); + ZEPHIR_INIT_NVAR(&accessKey); + ZEPHIR_CONCAT_VS(&accessKey, &inheritedRole, "!*!*"); + ZEPHIR_OBS_NVAR(&funcAccess); + zephir_array_isset_fetch(&funcAccess, &funcList, &accessKey, 0 TSRMLS_CC); + if (zephir_array_isset(&accessList, &accessKey)) { + ZEPHIR_OBS_NVAR(&haveAccess); + zephir_array_fetch(&haveAccess, &accessList, &accessKey, PH_NOISY, "phalcon/acl/adapter/memory.zep", 677 TSRMLS_CC); break; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&inheritedRole); } } } - zephir_update_property_this(getThis(), SL("_accessGranted"), haveAccess TSRMLS_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_15$$32); - ZVAL_STRING(_15$$32, "acl:afterCheckAccess", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _15$$32, this_ptr); - zephir_check_temp_parameter(_15$$32); + zephir_update_property_zval(this_ptr, SL("_accessGranted"), &haveAccess); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_9$$32); + ZVAL_STRING(&_9$$32, "acl:afterCheckAccess"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_9$$32, this_ptr); zephir_check_call_status(); } - if (Z_TYPE_P(haveAccess) == IS_NULL) { - _16$$33 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultAccess"), PH_NOISY_CC); - RETURN_MM_BOOL(ZEPHIR_IS_LONG(_16$$33, 1)); + if (Z_TYPE_P(&haveAccess) == IS_NULL) { + zephir_read_property(&_10$$33, this_ptr, SL("_defaultAccess"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(ZEPHIR_IS_LONG(&_10$$33, 1)); } - if (Z_TYPE_P(funcAccess) != IS_NULL) { - ZEPHIR_INIT_VAR(reflectionFunction); - object_init_ex(reflectionFunction, zephir_get_internal_ce(SS("reflectionfunction") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, reflectionFunction, "__construct", NULL, 87, funcAccess); + if (Z_TYPE_P(&funcAccess) != IS_NULL) { + ZEPHIR_INIT_VAR(&reflectionFunction); + object_init_ex(&reflectionFunction, zephir_get_internal_ce(SL("reflectionfunction"))); + ZEPHIR_CALL_METHOD(NULL, &reflectionFunction, "__construct", NULL, 78, &funcAccess); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&reflectionParameters, reflectionFunction, "getparameters", NULL, 88); + ZEPHIR_CALL_METHOD(&reflectionParameters, &reflectionFunction, "getparameters", NULL, 79); zephir_check_call_status(); - ZEPHIR_INIT_VAR(parameterNumber); - ZVAL_LONG(parameterNumber, zephir_fast_count_int(reflectionParameters TSRMLS_CC)); - if (ZEPHIR_IS_LONG_IDENTICAL(parameterNumber, 0)) { - _17$$35 = ZEPHIR_IS_LONG(haveAccess, 1); - if (_17$$35) { - ZEPHIR_INIT_VAR(_18$$35); - ZEPHIR_CALL_USER_FUNC(_18$$35, funcAccess); + ZEPHIR_INIT_VAR(¶meterNumber); + ZVAL_LONG(¶meterNumber, zephir_fast_count_int(&reflectionParameters TSRMLS_CC)); + if (ZEPHIR_IS_LONG_IDENTICAL(¶meterNumber, 0)) { + _11$$35 = ZEPHIR_IS_LONG(&haveAccess, 1); + if (_11$$35) { + ZEPHIR_INIT_VAR(&_12$$35); + ZEPHIR_CALL_USER_FUNC(&_12$$35, &funcAccess); zephir_check_call_status(); - _17$$35 = zephir_is_true(_18$$35); + _11$$35 = zephir_is_true(&_12$$35); } - RETURN_MM_BOOL(_17$$35); + RETURN_MM_BOOL(_11$$35); } - ZEPHIR_INIT_VAR(parametersForFunction); - array_init(parametersForFunction); - ZEPHIR_CALL_METHOD(&numberOfRequiredParameters, reflectionFunction, "getnumberofrequiredparameters", NULL, 89); + ZEPHIR_INIT_VAR(¶metersForFunction); + array_init(¶metersForFunction); + ZEPHIR_CALL_METHOD(&numberOfRequiredParameters, &reflectionFunction, "getnumberofrequiredparameters", NULL, 80); zephir_check_call_status(); - ZEPHIR_CPY_WRT(userParametersSizeShouldBe, parameterNumber); - zephir_is_iterable(reflectionParameters, &_20$$34, &_19$$34, 0, 0, "phalcon/acl/adapter/memory.zep", 748); - for ( - ; zend_hash_get_current_data_ex(_20$$34, (void**) &_21$$34, &_19$$34) == SUCCESS - ; zend_hash_move_forward_ex(_20$$34, &_19$$34) - ) { - ZEPHIR_GET_HVALUE(reflectionParameter, _21$$34); - ZEPHIR_CALL_METHOD(&reflectionClass, reflectionParameter, "getclass", NULL, 0); + ZEPHIR_CPY_WRT(&userParametersSizeShouldBe, ¶meterNumber); + zephir_is_iterable(&reflectionParameters, 0, "phalcon/acl/adapter/memory.zep", 748); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&reflectionParameters), _13$$34) + { + ZEPHIR_INIT_NVAR(&reflectionParameter); + ZVAL_COPY(&reflectionParameter, _13$$34); + ZEPHIR_CALL_METHOD(&reflectionClass, &reflectionParameter, "getclass", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(¶meterToCheck, reflectionParameter, "getname", NULL, 0); + ZEPHIR_CALL_METHOD(¶meterToCheck, &reflectionParameter, "getname", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(reflectionClass) != IS_NULL) { - _22$$37 = Z_TYPE_P(roleObject) != IS_NULL; - if (_22$$37) { - ZEPHIR_CALL_METHOD(&_23$$37, reflectionClass, "isinstance", NULL, 0, roleObject); + if (Z_TYPE_P(&reflectionClass) != IS_NULL) { + _14$$37 = Z_TYPE_P(&roleObject) != IS_NULL; + if (_14$$37) { + ZEPHIR_CALL_METHOD(&_15$$37, &reflectionClass, "isinstance", NULL, 0, &roleObject); zephir_check_call_status(); - _22$$37 = zephir_is_true(_23$$37); + _14$$37 = zephir_is_true(&_15$$37); } - _24$$37 = _22$$37; - if (_24$$37) { - _24$$37 = !hasRole; + _16$$37 = _14$$37; + if (_16$$37) { + _16$$37 = !hasRole; } - if (_24$$37) { + if (_16$$37) { hasRole = 1; - zephir_array_append(¶metersForFunction, roleObject, PH_SEPARATE, "phalcon/acl/adapter/memory.zep", 719); - ZEPHIR_SEPARATE(userParametersSizeShouldBe); - zephir_decrement(userParametersSizeShouldBe); + zephir_array_append(¶metersForFunction, &roleObject, PH_SEPARATE, "phalcon/acl/adapter/memory.zep", 719); + ZEPHIR_SEPARATE(&userParametersSizeShouldBe); + zephir_decrement(&userParametersSizeShouldBe); continue; } - _25$$37 = Z_TYPE_P(resourceObject) != IS_NULL; - if (_25$$37) { - ZEPHIR_CALL_METHOD(&_26$$37, reflectionClass, "isinstance", NULL, 0, resourceObject); + _17$$37 = Z_TYPE_P(&resourceObject) != IS_NULL; + if (_17$$37) { + ZEPHIR_CALL_METHOD(&_18$$37, &reflectionClass, "isinstance", NULL, 0, &resourceObject); zephir_check_call_status(); - _25$$37 = zephir_is_true(_26$$37); + _17$$37 = zephir_is_true(&_18$$37); } - _27$$37 = _25$$37; - if (_27$$37) { - _27$$37 = !hasResource; + _19$$37 = _17$$37; + if (_19$$37) { + _19$$37 = !hasResource; } - if (_27$$37) { + if (_19$$37) { hasResource = 1; - zephir_array_append(¶metersForFunction, resourceObject, PH_SEPARATE, "phalcon/acl/adapter/memory.zep", 728); - ZEPHIR_SEPARATE(userParametersSizeShouldBe); - zephir_decrement(userParametersSizeShouldBe); + zephir_array_append(¶metersForFunction, &resourceObject, PH_SEPARATE, "phalcon/acl/adapter/memory.zep", 728); + ZEPHIR_SEPARATE(&userParametersSizeShouldBe); + zephir_decrement(&userParametersSizeShouldBe); continue; } - _28$$37 = zephir_array_isset(parameters, parameterToCheck); - if (_28$$37) { - ZEPHIR_OBS_NVAR(_29$$37); - zephir_array_fetch(&_29$$37, parameters, parameterToCheck, PH_NOISY, "phalcon/acl/adapter/memory.zep", 735 TSRMLS_CC); - _28$$37 = Z_TYPE_P(_29$$37) == IS_OBJECT; + _20$$37 = zephir_array_isset(¶meters, ¶meterToCheck); + if (_20$$37) { + ZEPHIR_OBS_NVAR(&_21$$37); + zephir_array_fetch(&_21$$37, ¶meters, ¶meterToCheck, PH_NOISY, "phalcon/acl/adapter/memory.zep", 735 TSRMLS_CC); + _20$$37 = Z_TYPE_P(&_21$$37) == IS_OBJECT; } - _30$$37 = _28$$37; - if (_30$$37) { - zephir_array_fetch(&_32$$37, parameters, parameterToCheck, PH_NOISY | PH_READONLY, "phalcon/acl/adapter/memory.zep", 735 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_31$$37, reflectionClass, "isinstance", NULL, 0, _32$$37); + _22$$37 = _20$$37; + if (_22$$37) { + zephir_array_fetch(&_24$$37, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/acl/adapter/memory.zep", 735 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_23$$37, &reflectionClass, "isinstance", NULL, 0, &_24$$37); zephir_check_call_status(); - _30$$37 = !zephir_is_true(_31$$37); + _22$$37 = !zephir_is_true(&_23$$37); } - if (_30$$37) { - ZEPHIR_INIT_NVAR(_33$$40); - object_init_ex(_33$$40, phalcon_acl_exception_ce); - ZEPHIR_INIT_NVAR(_34$$40); - zephir_array_fetch(&_35$$40, parameters, parameterToCheck, PH_NOISY | PH_READONLY, "phalcon/acl/adapter/memory.zep", 737 TSRMLS_CC); - zephir_get_class(_34$$40, _35$$40, 0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_36$$40, reflectionClass, "getname", NULL, 0); + if (_22$$37) { + ZEPHIR_INIT_NVAR(&_25$$40); + object_init_ex(&_25$$40, phalcon_acl_exception_ce); + ZEPHIR_INIT_NVAR(&_26$$40); + zephir_array_fetch(&_27$$40, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/acl/adapter/memory.zep", 737 TSRMLS_CC); + zephir_get_class(&_26$$40, &_27$$40, 0 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_28$$40, &reflectionClass, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_37$$40); - ZEPHIR_CONCAT_SVSVSVSVSVS(_37$$40, "Your passed parameter doesn't have the same class as the parameter in defined function when check ", roleName, " can ", access, " ", resourceName, ". Class passed: ", _34$$40, " , Class in defined function: ", _36$$40, "."); - ZEPHIR_CALL_METHOD(NULL, _33$$40, "__construct", &_38, 9, _37$$40); + ZEPHIR_INIT_LNVAR(_29$$40); + ZEPHIR_CONCAT_SVSVSVSVSVS(&_29$$40, "Your passed parameter doesn't have the same class as the parameter in defined function when check ", roleName, " can ", &access, " ", resourceName, ". Class passed: ", &_26$$40, " , Class in defined function: ", &_28$$40, "."); + ZEPHIR_CALL_METHOD(NULL, &_25$$40, "__construct", &_30, 4, &_29$$40); zephir_check_call_status(); - zephir_throw_exception_debug(_33$$40, "phalcon/acl/adapter/memory.zep", 738 TSRMLS_CC); + zephir_throw_exception_debug(&_25$$40, "phalcon/acl/adapter/memory.zep", 738 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - if (zephir_array_isset(parameters, parameterToCheck)) { - zephir_array_fetch(&_39$$41, parameters, parameterToCheck, PH_NOISY | PH_READONLY, "phalcon/acl/adapter/memory.zep", 744 TSRMLS_CC); - zephir_array_append(¶metersForFunction, _39$$41, PH_SEPARATE, "phalcon/acl/adapter/memory.zep", 744); + if (zephir_array_isset(¶meters, ¶meterToCheck)) { + zephir_array_fetch(&_31$$41, ¶meters, ¶meterToCheck, PH_NOISY | PH_READONLY, "phalcon/acl/adapter/memory.zep", 744 TSRMLS_CC); + zephir_array_append(¶metersForFunction, &_31$$41, PH_SEPARATE, "phalcon/acl/adapter/memory.zep", 744); } - } - if (ZEPHIR_LT_LONG(userParametersSizeShouldBe, zephir_fast_count_int(parameters TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_40$$42); - ZEPHIR_CONCAT_SVSVSVS(_40$$42, "Number of parameters in array is higher than the number of parameters in defined function when check ", roleName, " can ", access, " ", resourceName, ". Remember that more parameters than defined in function will be ignored."); - ZEPHIR_SINIT_VAR(_41$$42); - ZVAL_LONG(&_41$$42, 512); - ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 2, _40$$42, &_41$$42); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&reflectionParameter); + if (ZEPHIR_LT_LONG(&userParametersSizeShouldBe, zephir_fast_count_int(¶meters TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_32$$42); + ZEPHIR_CONCAT_SVSVSVS(&_32$$42, "Number of parameters in array is higher than the number of parameters in defined function when check ", roleName, " can ", &access, " ", resourceName, ". Remember that more parameters than defined in function will be ignored."); + ZVAL_LONG(&_33$$42, 512); + ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 1, &_32$$42, &_33$$42); zephir_check_call_status(); } - if (zephir_fast_count_int(parametersForFunction TSRMLS_CC) == 0) { - if (ZEPHIR_GT_LONG(numberOfRequiredParameters, 0)) { - ZEPHIR_INIT_VAR(_42$$44); - ZEPHIR_CONCAT_SVSVSVS(_42$$44, "You didn't provide any parameters when check ", roleName, " can ", access, " ", resourceName, ". We will use default action when no arguments."); - ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 2, _42$$44); + if (zephir_fast_count_int(¶metersForFunction TSRMLS_CC) == 0) { + if (ZEPHIR_GT_LONG(&numberOfRequiredParameters, 0)) { + ZEPHIR_INIT_VAR(&_34$$44); + ZEPHIR_CONCAT_SVSVSVS(&_34$$44, "You didn't provide any parameters when check ", roleName, " can ", &access, " ", resourceName, ". We will use default action when no arguments."); + ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 1, &_34$$44); zephir_check_call_status(); - _43$$44 = ZEPHIR_IS_LONG(haveAccess, 1); - if (_43$$44) { - _44$$44 = zephir_fetch_nproperty_this(this_ptr, SL("_noArgumentsDefaultAction"), PH_NOISY_CC); - _43$$44 = ZEPHIR_IS_LONG(_44$$44, 1); + _35$$44 = ZEPHIR_IS_LONG(&haveAccess, 1); + if (_35$$44) { + zephir_read_property(&_36$$44, this_ptr, SL("_noArgumentsDefaultAction"), PH_NOISY_CC | PH_READONLY); + _35$$44 = ZEPHIR_IS_LONG(&_36$$44, 1); } - RETURN_MM_BOOL(_43$$44); + RETURN_MM_BOOL(_35$$44); } - _45$$43 = ZEPHIR_IS_LONG(haveAccess, 1); - if (_45$$43) { - ZEPHIR_INIT_VAR(_46$$43); - ZEPHIR_CALL_USER_FUNC(_46$$43, funcAccess); + _37$$43 = ZEPHIR_IS_LONG(&haveAccess, 1); + if (_37$$43) { + ZEPHIR_INIT_VAR(&_38$$43); + ZEPHIR_CALL_USER_FUNC(&_38$$43, &funcAccess); zephir_check_call_status(); - _45$$43 = zephir_is_true(_46$$43); + _37$$43 = zephir_is_true(&_38$$43); } - RETURN_MM_BOOL(_45$$43); + RETURN_MM_BOOL(_37$$43); } - if (ZEPHIR_LE_LONG(numberOfRequiredParameters, zephir_fast_count_int(parametersForFunction TSRMLS_CC))) { - _47$$45 = ZEPHIR_IS_LONG(haveAccess, 1); - if (_47$$45) { - ZEPHIR_INIT_VAR(_48$$45); - ZEPHIR_CALL_USER_FUNC_ARRAY(_48$$45, funcAccess, parametersForFunction); + if (ZEPHIR_LE_LONG(&numberOfRequiredParameters, zephir_fast_count_int(¶metersForFunction TSRMLS_CC))) { + _39$$45 = ZEPHIR_IS_LONG(&haveAccess, 1); + if (_39$$45) { + ZEPHIR_INIT_VAR(&_40$$45); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_40$$45, &funcAccess, ¶metersForFunction); zephir_check_call_status(); - _47$$45 = zephir_is_true(_48$$45); + _39$$45 = zephir_is_true(&_40$$45); } - RETURN_MM_BOOL(_47$$45); + RETURN_MM_BOOL(_39$$45); } - ZEPHIR_INIT_VAR(_49$$34); - object_init_ex(_49$$34, phalcon_acl_exception_ce); - ZEPHIR_INIT_VAR(_50$$34); - ZEPHIR_CONCAT_SVSVSV(_50$$34, "You didn't provide all necessary parameters for defined function when check ", roleName, " can ", access, " ", resourceName); - ZEPHIR_CALL_METHOD(NULL, _49$$34, "__construct", &_38, 9, _50$$34); + ZEPHIR_INIT_VAR(&_41$$34); + object_init_ex(&_41$$34, phalcon_acl_exception_ce); + ZEPHIR_INIT_VAR(&_42$$34); + ZEPHIR_CONCAT_SVSVSV(&_42$$34, "You didn't provide all necessary parameters for defined function when check ", roleName, " can ", &access, " ", resourceName); + ZEPHIR_CALL_METHOD(NULL, &_41$$34, "__construct", &_30, 4, &_42$$34); zephir_check_call_status(); - zephir_throw_exception_debug(_49$$34, "phalcon/acl/adapter/memory.zep", 777 TSRMLS_CC); + zephir_throw_exception_debug(&_41$$34, "phalcon/acl/adapter/memory.zep", 777 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - RETURN_MM_BOOL(ZEPHIR_IS_LONG(haveAccess, 1)); + RETURN_MM_BOOL(ZEPHIR_IS_LONG(&haveAccess, 1)); } @@ -1156,8 +1325,11 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, isAllowed) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, setNoArgumentsDefaultAction) { - zval *defaultAccess_param = NULL, *_0; + zval *defaultAccess_param = NULL, _0; zend_long defaultAccess; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &defaultAccess_param); @@ -1165,8 +1337,8 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, setNoArgumentsDefaultAction) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, defaultAccess); - zephir_update_property_this(getThis(), SL("_noArgumentsDefaultAction"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, defaultAccess); + zephir_update_property_zval(this_ptr, SL("_noArgumentsDefaultAction"), &_0); } @@ -1176,7 +1348,8 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, setNoArgumentsDefaultAction) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, getNoArgumentsDefaultAction) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_noArgumentsDefaultAction"); @@ -1187,7 +1360,8 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, getNoArgumentsDefaultAction) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, getRoles) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_roles"); @@ -1198,7 +1372,8 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, getRoles) { */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, getResources) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_resources"); diff --git a/ext/phalcon/acl/adapter/memory.zep.h b/ext/phalcon/acl/adapter/memory.zep.h index eb9945201b2..57b7bedf5b7 100644 --- a/ext/phalcon/acl/adapter/memory.zep.h +++ b/ext/phalcon/acl/adapter/memory.zep.h @@ -20,70 +20,171 @@ PHP_METHOD(Phalcon_Acl_Adapter_Memory, getNoArgumentsDefaultAction); PHP_METHOD(Phalcon_Acl_Adapter_Memory, getRoles); PHP_METHOD(Phalcon_Acl_Adapter_Memory, getResources); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_addrole, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_addrole, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_addrole, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, role) ZEND_ARG_INFO(0, accessInherits) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_addinherit, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_addinherit, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_addinherit, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, roleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, roleName) +#endif ZEND_ARG_INFO(0, roleToInherit) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_isrole, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_isrole, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_isrole, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, roleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, roleName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_isresource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_isresource, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_isresource, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_addresource, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_addresource, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_addresource, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, resourceValue) ZEND_ARG_INFO(0, accessList) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_addresourceaccess, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_addresourceaccess, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_addresourceaccess, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_ARG_INFO(0, accessList) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_dropresourceaccess, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_ARG_INFO(0, accessList) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory__allowordeny, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, roleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, roleName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_ARG_INFO(0, access) ZEND_ARG_INFO(0, action) ZEND_ARG_INFO(0, func) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_allow, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, roleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, roleName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_ARG_INFO(0, access) ZEND_ARG_INFO(0, func) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_deny, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, roleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, roleName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_ARG_INFO(0, access) ZEND_ARG_INFO(0, func) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_isallowed, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_isallowed, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_isallowed, 0, 3, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, roleName) ZEND_ARG_INFO(0, resourceName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, access, IS_STRING, 0) +#else ZEND_ARG_INFO(0, access) +#endif ZEND_ARG_ARRAY_INFO(0, parameters, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapter_memory_setnoargumentsdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultAccess, IS_LONG, 0) +#else ZEND_ARG_INFO(0, defaultAccess) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_getnoargumentsdefaultaction, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_getnoargumentsdefaultaction, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_acl_adapter_memory_getroles, 0, 0, Phalcon\\Acl\\RoleInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_getroles, 0, 0, IS_OBJECT, "Phalcon\\Acl\\RoleInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_acl_adapter_memory_getresources, 0, 0, Phalcon\\Acl\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapter_memory_getresources, 0, 0, IS_OBJECT, "Phalcon\\Acl\\ResourceInterface", 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_acl_adapter_memory_method_entry) { @@ -100,8 +201,8 @@ ZEPHIR_INIT_FUNCS(phalcon_acl_adapter_memory_method_entry) { PHP_ME(Phalcon_Acl_Adapter_Memory, deny, arginfo_phalcon_acl_adapter_memory_deny, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Acl_Adapter_Memory, isAllowed, arginfo_phalcon_acl_adapter_memory_isallowed, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Acl_Adapter_Memory, setNoArgumentsDefaultAction, arginfo_phalcon_acl_adapter_memory_setnoargumentsdefaultaction, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Adapter_Memory, getNoArgumentsDefaultAction, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Adapter_Memory, getRoles, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Adapter_Memory, getResources, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Adapter_Memory, getNoArgumentsDefaultAction, arginfo_phalcon_acl_adapter_memory_getnoargumentsdefaultaction, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Adapter_Memory, getRoles, arginfo_phalcon_acl_adapter_memory_getroles, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Adapter_Memory, getResources, arginfo_phalcon_acl_adapter_memory_getresources, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/acl/adapterinterface.zep.h b/ext/phalcon/acl/adapterinterface.zep.h index 9ad3ef95116..4cb23aaa432 100644 --- a/ext/phalcon/acl/adapterinterface.zep.h +++ b/ext/phalcon/acl/adapterinterface.zep.h @@ -4,72 +4,193 @@ extern zend_class_entry *phalcon_acl_adapterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Acl_AdapterInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_setdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultAccess, IS_LONG, 0) +#else ZEND_ARG_INFO(0, defaultAccess) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getdefaultaction, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getdefaultaction, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_setnoargumentsdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultAccess, IS_LONG, 0) +#else ZEND_ARG_INFO(0, defaultAccess) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getnoargumentsdefaultaction, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getnoargumentsdefaultaction, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_addrole, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_addrole, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_addrole, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, role) ZEND_ARG_INFO(0, accessInherits) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_addinherit, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_addinherit, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_addinherit, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, roleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, roleName) +#endif ZEND_ARG_INFO(0, roleToInherit) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_isrole, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_isrole, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_isrole, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, roleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, roleName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_isresource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_isresource, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_isresource, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_addresource, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_addresource, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_addresource, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, resourceObject) ZEND_ARG_INFO(0, accessList) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_addresourceaccess, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_ARG_INFO(0, accessList) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_dropresourceaccess, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_ARG_INFO(0, accessList) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_allow, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, roleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, roleName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_ARG_INFO(0, access) ZEND_ARG_INFO(0, func) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_deny, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, roleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, roleName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, resourceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, resourceName) +#endif ZEND_ARG_INFO(0, access) ZEND_ARG_INFO(0, func) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_adapterinterface_isallowed, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_isallowed, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_isallowed, 0, 3, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, roleName) ZEND_ARG_INFO(0, resourceName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, access, IS_STRING, 0) +#else ZEND_ARG_INFO(0, access) +#endif ZEND_ARG_ARRAY_INFO(0, parameters, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getactiverole, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getactiverole, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getactiveresource, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getactiveresource, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getactiveaccess, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getactiveaccess, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_acl_adapterinterface_getroles, 0, 0, Phalcon\\Acl\\RoleInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getroles, 0, 0, IS_OBJECT, "Phalcon\\Acl\\RoleInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_acl_adapterinterface_getresources, 0, 0, Phalcon\\Acl\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_adapterinterface_getresources, 0, 0, IS_OBJECT, "Phalcon\\Acl\\ResourceInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_acl_adapterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, setDefaultAction, arginfo_phalcon_acl_adapterinterface_setdefaultaction) - PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getDefaultAction, NULL) + PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getDefaultAction, arginfo_phalcon_acl_adapterinterface_getdefaultaction) PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, setNoArgumentsDefaultAction, arginfo_phalcon_acl_adapterinterface_setnoargumentsdefaultaction) - PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getNoArgumentsDefaultAction, NULL) + PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getNoArgumentsDefaultAction, arginfo_phalcon_acl_adapterinterface_getnoargumentsdefaultaction) PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, addRole, arginfo_phalcon_acl_adapterinterface_addrole) PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, addInherit, arginfo_phalcon_acl_adapterinterface_addinherit) PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, isRole, arginfo_phalcon_acl_adapterinterface_isrole) @@ -80,10 +201,10 @@ ZEPHIR_INIT_FUNCS(phalcon_acl_adapterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, allow, arginfo_phalcon_acl_adapterinterface_allow) PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, deny, arginfo_phalcon_acl_adapterinterface_deny) PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, isAllowed, arginfo_phalcon_acl_adapterinterface_isallowed) - PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getActiveRole, NULL) - PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getActiveResource, NULL) - PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getActiveAccess, NULL) - PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getRoles, NULL) - PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getResources, NULL) + PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getActiveRole, arginfo_phalcon_acl_adapterinterface_getactiverole) + PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getActiveResource, arginfo_phalcon_acl_adapterinterface_getactiveresource) + PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getActiveAccess, arginfo_phalcon_acl_adapterinterface_getactiveaccess) + PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getRoles, arginfo_phalcon_acl_adapterinterface_getroles) + PHP_ABSTRACT_ME(Phalcon_Acl_AdapterInterface, getResources, arginfo_phalcon_acl_adapterinterface_getresources) PHP_FE_END }; diff --git a/ext/phalcon/acl/resource.zep.c b/ext/phalcon/acl/resource.zep.c index 205c9a4be0b..1da890bdc20 100644 --- a/ext/phalcon/acl/resource.zep.c +++ b/ext/phalcon/acl/resource.zep.c @@ -50,7 +50,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Acl_Resource) { */ PHP_METHOD(Phalcon_Acl_Resource, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -61,7 +62,8 @@ PHP_METHOD(Phalcon_Acl_Resource, getName) { */ PHP_METHOD(Phalcon_Acl_Resource, __toString) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -72,7 +74,8 @@ PHP_METHOD(Phalcon_Acl_Resource, __toString) { */ PHP_METHOD(Phalcon_Acl_Resource, getDescription) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_description"); @@ -84,36 +87,40 @@ PHP_METHOD(Phalcon_Acl_Resource, getDescription) { PHP_METHOD(Phalcon_Acl_Resource, __construct) { zval *name_param = NULL, *description_param = NULL; - zval *name = NULL, *description = NULL; + zval name, description; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&description); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &description_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!description_param) { - ZEPHIR_INIT_VAR(description); - ZVAL_EMPTY_STRING(description); + ZEPHIR_INIT_VAR(&description); + ZVAL_STRING(&description, ""); } else { - zephir_get_strval(description, description_param); + zephir_get_strval(&description, description_param); } - if (ZEPHIR_IS_STRING(name, "*")) { + if (ZEPHIR_IS_STRING(&name, "*")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Resource name cannot be '*'", "phalcon/acl/resource.zep", 50); return; } - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); - if (!(!description) && Z_STRLEN_P(description)) { - zephir_update_property_this(getThis(), SL("_description"), description TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); + if (!(Z_TYPE_P(&description) == IS_UNDEF) && Z_STRLEN_P(&description)) { + zephir_update_property_zval(this_ptr, SL("_description"), &description); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/acl/resource.zep.h b/ext/phalcon/acl/resource.zep.h index 8b6e180263e..dae6a31f008 100644 --- a/ext/phalcon/acl/resource.zep.h +++ b/ext/phalcon/acl/resource.zep.h @@ -8,15 +8,44 @@ PHP_METHOD(Phalcon_Acl_Resource, __toString); PHP_METHOD(Phalcon_Acl_Resource, getDescription); PHP_METHOD(Phalcon_Acl_Resource, __construct); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resource_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resource_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resource___tostring, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resource___tostring, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resource_getdescription, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resource_getdescription, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_resource___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, description, IS_STRING, 1) +#else ZEND_ARG_INFO(0, description) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_acl_resource_method_entry) { - PHP_ME(Phalcon_Acl_Resource, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Resource, __toString, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Resource, getDescription, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Resource, getName, arginfo_phalcon_acl_resource_getname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Resource, __toString, arginfo_phalcon_acl_resource___tostring, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Resource, getDescription, arginfo_phalcon_acl_resource_getdescription, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Acl_Resource, __construct, arginfo_phalcon_acl_resource___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_FE_END }; diff --git a/ext/phalcon/acl/resourceaware.zep.h b/ext/phalcon/acl/resourceaware.zep.h index b0b6bea33de..eac80febab0 100644 --- a/ext/phalcon/acl/resourceaware.zep.h +++ b/ext/phalcon/acl/resourceaware.zep.h @@ -3,7 +3,14 @@ extern zend_class_entry *phalcon_acl_resourceaware_ce; ZEPHIR_INIT_CLASS(Phalcon_Acl_ResourceAware); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resourceaware_getresourcename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resourceaware_getresourcename, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_acl_resourceaware_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Acl_ResourceAware, getResourceName, NULL) + PHP_ABSTRACT_ME(Phalcon_Acl_ResourceAware, getResourceName, arginfo_phalcon_acl_resourceaware_getresourcename) PHP_FE_END }; diff --git a/ext/phalcon/acl/resourceinterface.zep.h b/ext/phalcon/acl/resourceinterface.zep.h index bff50ed90a2..2387291a1f3 100644 --- a/ext/phalcon/acl/resourceinterface.zep.h +++ b/ext/phalcon/acl/resourceinterface.zep.h @@ -3,9 +3,30 @@ extern zend_class_entry *phalcon_acl_resourceinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Acl_ResourceInterface); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resourceinterface_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resourceinterface_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resourceinterface_getdescription, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resourceinterface_getdescription, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resourceinterface___tostring, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_resourceinterface___tostring, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_acl_resourceinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Acl_ResourceInterface, getName, NULL) - PHP_ABSTRACT_ME(Phalcon_Acl_ResourceInterface, getDescription, NULL) - PHP_ABSTRACT_ME(Phalcon_Acl_ResourceInterface, __toString, NULL) + PHP_ABSTRACT_ME(Phalcon_Acl_ResourceInterface, getName, arginfo_phalcon_acl_resourceinterface_getname) + PHP_ABSTRACT_ME(Phalcon_Acl_ResourceInterface, getDescription, arginfo_phalcon_acl_resourceinterface_getdescription) + PHP_ABSTRACT_ME(Phalcon_Acl_ResourceInterface, __toString, arginfo_phalcon_acl_resourceinterface___tostring) PHP_FE_END }; diff --git a/ext/phalcon/acl/role.zep.c b/ext/phalcon/acl/role.zep.c index 9a9f9e92995..7f44f32c39f 100644 --- a/ext/phalcon/acl/role.zep.c +++ b/ext/phalcon/acl/role.zep.c @@ -50,7 +50,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Acl_Role) { */ PHP_METHOD(Phalcon_Acl_Role, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -61,7 +62,8 @@ PHP_METHOD(Phalcon_Acl_Role, getName) { */ PHP_METHOD(Phalcon_Acl_Role, __toString) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -72,7 +74,8 @@ PHP_METHOD(Phalcon_Acl_Role, __toString) { */ PHP_METHOD(Phalcon_Acl_Role, getDescription) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_description"); @@ -84,36 +87,40 @@ PHP_METHOD(Phalcon_Acl_Role, getDescription) { PHP_METHOD(Phalcon_Acl_Role, __construct) { zval *name_param = NULL, *description_param = NULL; - zval *name = NULL, *description = NULL; + zval name, description; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&description); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &description_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!description_param) { - ZEPHIR_INIT_VAR(description); - ZVAL_EMPTY_STRING(description); + ZEPHIR_INIT_VAR(&description); + ZVAL_STRING(&description, ""); } else { - zephir_get_strval(description, description_param); + zephir_get_strval(&description, description_param); } - if (ZEPHIR_IS_STRING(name, "*")) { + if (ZEPHIR_IS_STRING(&name, "*")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_acl_exception_ce, "Role name cannot be '*'", "phalcon/acl/role.zep", 49); return; } - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); - if (!(!description) && Z_STRLEN_P(description)) { - zephir_update_property_this(getThis(), SL("_description"), description TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); + if (!(Z_TYPE_P(&description) == IS_UNDEF) && Z_STRLEN_P(&description)) { + zephir_update_property_zval(this_ptr, SL("_description"), &description); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/acl/role.zep.h b/ext/phalcon/acl/role.zep.h index 78c0c011bcf..a083ede9920 100644 --- a/ext/phalcon/acl/role.zep.h +++ b/ext/phalcon/acl/role.zep.h @@ -8,15 +8,44 @@ PHP_METHOD(Phalcon_Acl_Role, __toString); PHP_METHOD(Phalcon_Acl_Role, getDescription); PHP_METHOD(Phalcon_Acl_Role, __construct); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_role_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_role_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_role___tostring, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_role___tostring, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_role_getdescription, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_role_getdescription, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_acl_role___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, description, IS_STRING, 1) +#else ZEND_ARG_INFO(0, description) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_acl_role_method_entry) { - PHP_ME(Phalcon_Acl_Role, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Role, __toString, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Acl_Role, getDescription, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Role, getName, arginfo_phalcon_acl_role_getname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Role, __toString, arginfo_phalcon_acl_role___tostring, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Acl_Role, getDescription, arginfo_phalcon_acl_role_getdescription, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Acl_Role, __construct, arginfo_phalcon_acl_role___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_FE_END }; diff --git a/ext/phalcon/acl/roleaware.zep.h b/ext/phalcon/acl/roleaware.zep.h index 60f2538249e..9a0d1a30bc0 100644 --- a/ext/phalcon/acl/roleaware.zep.h +++ b/ext/phalcon/acl/roleaware.zep.h @@ -3,7 +3,14 @@ extern zend_class_entry *phalcon_acl_roleaware_ce; ZEPHIR_INIT_CLASS(Phalcon_Acl_RoleAware); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_roleaware_getrolename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_roleaware_getrolename, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_acl_roleaware_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Acl_RoleAware, getRoleName, NULL) + PHP_ABSTRACT_ME(Phalcon_Acl_RoleAware, getRoleName, arginfo_phalcon_acl_roleaware_getrolename) PHP_FE_END }; diff --git a/ext/phalcon/acl/roleinterface.zep.h b/ext/phalcon/acl/roleinterface.zep.h index d756abb9b8e..c9bece57332 100644 --- a/ext/phalcon/acl/roleinterface.zep.h +++ b/ext/phalcon/acl/roleinterface.zep.h @@ -3,9 +3,30 @@ extern zend_class_entry *phalcon_acl_roleinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Acl_RoleInterface); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_roleinterface_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_roleinterface_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_roleinterface_getdescription, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_roleinterface_getdescription, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_roleinterface___tostring, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_acl_roleinterface___tostring, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_acl_roleinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Acl_RoleInterface, getName, NULL) - PHP_ABSTRACT_ME(Phalcon_Acl_RoleInterface, getDescription, NULL) - PHP_ABSTRACT_ME(Phalcon_Acl_RoleInterface, __toString, NULL) + PHP_ABSTRACT_ME(Phalcon_Acl_RoleInterface, getName, arginfo_phalcon_acl_roleinterface_getname) + PHP_ABSTRACT_ME(Phalcon_Acl_RoleInterface, getDescription, arginfo_phalcon_acl_roleinterface_getdescription) + PHP_ABSTRACT_ME(Phalcon_Acl_RoleInterface, __toString, arginfo_phalcon_acl_roleinterface___tostring) PHP_FE_END }; diff --git a/ext/phalcon/annotations/adapter.zep.c b/ext/phalcon/annotations/adapter.zep.c index dfe1b4576f1..831b6ffc9e7 100644 --- a/ext/phalcon/annotations/adapter.zep.c +++ b/ext/phalcon/annotations/adapter.zep.c @@ -42,13 +42,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter) { */ PHP_METHOD(Phalcon_Annotations_Adapter, setReader) { - zval *reader; + zval *reader, reader_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&reader_sub); zephir_fetch_params(0, 1, 0, &reader); - zephir_update_property_this(getThis(), SL("_reader"), reader TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_reader"), reader); } @@ -57,21 +60,25 @@ PHP_METHOD(Phalcon_Annotations_Adapter, setReader) { */ PHP_METHOD(Phalcon_Annotations_Adapter, getReader) { - zval *_0, *_1$$3; + zval _0, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_reader"), PH_NOISY_CC); - if (Z_TYPE_P(_0) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_annotations_reader_ce); - if (zephir_has_constructor(_1$$3 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_reader"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_annotations_reader_ce); + if (zephir_has_constructor(&_1$$3 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_reader"), _1$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_reader"), &_1$$3); } RETURN_MM_MEMBER(getThis(), "_reader"); @@ -86,7 +93,16 @@ PHP_METHOD(Phalcon_Annotations_Adapter, get) { zend_bool _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *className, *annotations = NULL, *classAnnotations = NULL, *parsedAnnotations = NULL, *realClassName = NULL, *reader = NULL, *_0$$6; + zval *className, className_sub, annotations, classAnnotations, parsedAnnotations, realClassName, reader, _0$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className_sub); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&classAnnotations); + ZVAL_UNDEF(&parsedAnnotations); + ZVAL_UNDEF(&realClassName); + ZVAL_UNDEF(&reader); + ZVAL_UNDEF(&_0$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &className); @@ -94,41 +110,41 @@ PHP_METHOD(Phalcon_Annotations_Adapter, get) { if (Z_TYPE_P(className) == IS_OBJECT) { - ZEPHIR_INIT_VAR(realClassName); - zephir_get_class(realClassName, className, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&realClassName); + zephir_get_class(&realClassName, className, 0 TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(realClassName, className); + ZEPHIR_CPY_WRT(&realClassName, className); } - ZEPHIR_OBS_VAR(annotations); - zephir_read_property_this(&annotations, this_ptr, SL("_annotations"), PH_NOISY_CC); - if (Z_TYPE_P(annotations) == IS_ARRAY) { - if (zephir_array_isset(annotations, realClassName)) { - zephir_array_fetch(&_0$$6, annotations, realClassName, PH_NOISY | PH_READONLY, "phalcon/annotations/adapter.zep", 81 TSRMLS_CC); - RETURN_CTOR(_0$$6); + ZEPHIR_OBS_VAR(&annotations); + zephir_read_property(&annotations, this_ptr, SL("_annotations"), PH_NOISY_CC); + if (Z_TYPE_P(&annotations) == IS_ARRAY) { + if (zephir_array_isset(&annotations, &realClassName)) { + zephir_array_fetch(&_0$$6, &annotations, &realClassName, PH_NOISY | PH_READONLY, "phalcon/annotations/adapter.zep", 81 TSRMLS_CC); + RETURN_CTOR(&_0$$6); } } - ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "read", NULL, 0, realClassName); + ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "read", NULL, 0, &realClassName); zephir_check_call_status(); - _1 = Z_TYPE_P(classAnnotations) == IS_NULL; + _1 = Z_TYPE_P(&classAnnotations) == IS_NULL; if (!(_1)) { - _1 = ZEPHIR_IS_FALSE_IDENTICAL(classAnnotations); + _1 = ZEPHIR_IS_FALSE_IDENTICAL(&classAnnotations); } if (_1) { ZEPHIR_CALL_METHOD(&reader, this_ptr, "getreader", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&parsedAnnotations, reader, "parse", NULL, 0, realClassName); + ZEPHIR_CALL_METHOD(&parsedAnnotations, &reader, "parse", NULL, 0, &realClassName); zephir_check_call_status(); - if (Z_TYPE_P(parsedAnnotations) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(classAnnotations); - object_init_ex(classAnnotations, phalcon_annotations_reflection_ce); - ZEPHIR_CALL_METHOD(NULL, classAnnotations, "__construct", NULL, 15, parsedAnnotations); + if (Z_TYPE_P(&parsedAnnotations) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&classAnnotations); + object_init_ex(&classAnnotations, phalcon_annotations_reflection_ce); + ZEPHIR_CALL_METHOD(NULL, &classAnnotations, "__construct", NULL, 10, &parsedAnnotations); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_annotations"), realClassName, classAnnotations TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, realClassName, classAnnotations); + zephir_update_property_array(this_ptr, SL("_annotations"), &realClassName, &classAnnotations TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &realClassName, &classAnnotations); zephir_check_call_status(); } } - RETURN_CCTOR(classAnnotations); + RETURN_CCTOR(&classAnnotations); } @@ -138,19 +154,23 @@ PHP_METHOD(Phalcon_Annotations_Adapter, get) { PHP_METHOD(Phalcon_Annotations_Adapter, getMethods) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *className_param = NULL, *classAnnotations = NULL; - zval *className = NULL; + zval *className_param = NULL, classAnnotations; + zval className; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&classAnnotations); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &className_param); - zephir_get_strval(className, className_param); + zephir_get_strval(&className, className_param); - ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, className); + ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); zephir_check_call_status(); - if (Z_TYPE_P(classAnnotations) == IS_OBJECT) { - ZEPHIR_RETURN_CALL_METHOD(classAnnotations, "getmethodsannotations", NULL, 0); + if (Z_TYPE_P(&classAnnotations) == IS_OBJECT) { + ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getmethodsannotations", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -164,43 +184,58 @@ PHP_METHOD(Phalcon_Annotations_Adapter, getMethods) { */ PHP_METHOD(Phalcon_Annotations_Adapter, getMethod) { - HashTable *_1$$4; - HashPosition _0$$4; + zend_string *_2$$4; + zend_ulong _1$$4; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *className_param = NULL, *methodName_param = NULL, *classAnnotations = NULL, *methods = NULL, *method = NULL, *methodKey = NULL, **_2$$4, *_3$$5 = NULL; - zval *className = NULL, *methodName = NULL; + zval *className_param = NULL, *methodName_param = NULL, classAnnotations, methods, method, methodKey, *_0$$4, _3$$5; + zval className, methodName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&methodName); + ZVAL_UNDEF(&classAnnotations); + ZVAL_UNDEF(&methods); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&methodKey); + ZVAL_UNDEF(&_3$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &className_param, &methodName_param); - zephir_get_strval(className, className_param); - zephir_get_strval(methodName, methodName_param); + zephir_get_strval(&className, className_param); + zephir_get_strval(&methodName, methodName_param); - ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, className); + ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); zephir_check_call_status(); - if (Z_TYPE_P(classAnnotations) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&methods, classAnnotations, "getmethodsannotations", NULL, 0); + if (Z_TYPE_P(&classAnnotations) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&methods, &classAnnotations, "getmethodsannotations", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(methods) == IS_ARRAY) { - zephir_is_iterable(methods, &_1$$4, &_0$$4, 0, 0, "phalcon/annotations/adapter.zep", 155); - for ( - ; zend_hash_get_current_data_ex(_1$$4, (void**) &_2$$4, &_0$$4) == SUCCESS - ; zend_hash_move_forward_ex(_1$$4, &_0$$4) - ) { - ZEPHIR_GET_HMKEY(methodKey, _1$$4, _0$$4); - ZEPHIR_GET_HVALUE(method, _2$$4); - ZEPHIR_CALL_FUNCTION(&_3$$5, "strcasecmp", &_4, 16, methodKey, methodName); + if (Z_TYPE_P(&methods) == IS_ARRAY) { + zephir_is_iterable(&methods, 0, "phalcon/annotations/adapter.zep", 155); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methods), _1$$4, _2$$4, _0$$4) + { + ZEPHIR_INIT_NVAR(&methodKey); + if (_2$$4 != NULL) { + ZVAL_STR_COPY(&methodKey, _2$$4); + } else { + ZVAL_LONG(&methodKey, _1$$4); + } + ZEPHIR_INIT_NVAR(&method); + ZVAL_COPY(&method, _0$$4); + ZEPHIR_CALL_FUNCTION(&_3$$5, "strcasecmp", &_4, 11, &methodKey, &methodName); zephir_check_call_status(); - if (!(zephir_is_true(_3$$5))) { - RETURN_CCTOR(method); + if (!(zephir_is_true(&_3$$5))) { + RETURN_CCTOR(&method); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&method); + ZEPHIR_INIT_NVAR(&methodKey); } } object_init_ex(return_value, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 17); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 12); zephir_check_call_status(); RETURN_MM(); @@ -212,19 +247,23 @@ PHP_METHOD(Phalcon_Annotations_Adapter, getMethod) { PHP_METHOD(Phalcon_Annotations_Adapter, getProperties) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *className_param = NULL, *classAnnotations = NULL; - zval *className = NULL; + zval *className_param = NULL, classAnnotations; + zval className; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&classAnnotations); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &className_param); - zephir_get_strval(className, className_param); + zephir_get_strval(&className, className_param); - ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, className); + ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); zephir_check_call_status(); - if (Z_TYPE_P(classAnnotations) == IS_OBJECT) { - ZEPHIR_RETURN_CALL_METHOD(classAnnotations, "getpropertiesannotations", NULL, 0); + if (Z_TYPE_P(&classAnnotations) == IS_OBJECT) { + ZEPHIR_RETURN_CALL_METHOD(&classAnnotations, "getpropertiesannotations", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -239,29 +278,36 @@ PHP_METHOD(Phalcon_Annotations_Adapter, getProperties) { PHP_METHOD(Phalcon_Annotations_Adapter, getProperty) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *className_param = NULL, *propertyName_param = NULL, *classAnnotations = NULL, *properties = NULL, *property = NULL; - zval *className = NULL, *propertyName = NULL; + zval *className_param = NULL, *propertyName_param = NULL, classAnnotations, properties, property; + zval className, propertyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&propertyName); + ZVAL_UNDEF(&classAnnotations); + ZVAL_UNDEF(&properties); + ZVAL_UNDEF(&property); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &className_param, &propertyName_param); - zephir_get_strval(className, className_param); - zephir_get_strval(propertyName, propertyName_param); + zephir_get_strval(&className, className_param); + zephir_get_strval(&propertyName, propertyName_param); - ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, className); + ZEPHIR_CALL_METHOD(&classAnnotations, this_ptr, "get", NULL, 0, &className); zephir_check_call_status(); - if (Z_TYPE_P(classAnnotations) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&properties, classAnnotations, "getpropertiesannotations", NULL, 0); + if (Z_TYPE_P(&classAnnotations) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&properties, &classAnnotations, "getpropertiesannotations", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(properties) == IS_ARRAY) { - if (zephir_array_isset_fetch(&property, properties, propertyName, 1 TSRMLS_CC)) { - RETURN_CTOR(property); + if (Z_TYPE_P(&properties) == IS_ARRAY) { + if (zephir_array_isset_fetch(&property, &properties, &propertyName, 1 TSRMLS_CC)) { + RETURN_CTOR(&property); } } } object_init_ex(return_value, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 17); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 12); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/annotations/adapter.zep.h b/ext/phalcon/annotations/adapter.zep.h index 9c16658fd51..43a1fde2017 100644 --- a/ext/phalcon/annotations/adapter.zep.h +++ b/ext/phalcon/annotations/adapter.zep.h @@ -15,31 +15,82 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_setreader, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, reader, Phalcon\\Annotations\\ReaderInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_getreader, 0, 0, Phalcon\\Annotations\\ReaderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_getreader, 0, 0, IS_OBJECT, "Phalcon\\Annotations\\ReaderInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_get, 0, 1, Phalcon\\Annotations\\Reflection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_get, 0, 1, IS_OBJECT, "Phalcon\\Annotations\\Reflection", 0) +#endif ZEND_ARG_INFO(0, className) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_getmethods, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_getmethods, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_getmethods, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_getmethod, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_getmethod, 0, 2, IS_OBJECT, "Phalcon\\Annotations\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, methodName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_getproperties, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_getproperties, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_getproperties, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_getproperty, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapter_getproperty, 0, 2, Phalcon\\Annotations\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapter_getproperty, 0, 2, IS_OBJECT, "Phalcon\\Annotations\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, propertyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, propertyName) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_adapter_method_entry) { PHP_ME(Phalcon_Annotations_Adapter, setReader, arginfo_phalcon_annotations_adapter_setreader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Annotations_Adapter, getReader, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Adapter, getReader, arginfo_phalcon_annotations_adapter_getreader, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter, get, arginfo_phalcon_annotations_adapter_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter, getMethods, arginfo_phalcon_annotations_adapter_getmethods, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Adapter, getMethod, arginfo_phalcon_annotations_adapter_getmethod, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/annotations/adapter/apc.zep.c b/ext/phalcon/annotations/adapter/apc.zep.c index 6d3d0af04c7..fe2ef7425e7 100644 --- a/ext/phalcon/annotations/adapter/apc.zep.c +++ b/ext/phalcon/annotations/adapter/apc.zep.c @@ -56,21 +56,28 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_Apc) { */ PHP_METHOD(Phalcon_Annotations_Adapter_Apc, __construct) { - zval *options = NULL, *prefix = NULL, *ttl = NULL; + zval *options = NULL, options_sub, __$null, prefix, ttl; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&ttl); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + if (zephir_array_isset_string_fetch(&prefix, options, SL("prefix"), 1)) { + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); } - if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_ttl"), ttl TSRMLS_CC); + if (zephir_array_isset_string_fetch(&ttl, options, SL("lifetime"), 1)) { + zephir_update_property_zval(this_ptr, SL("_ttl"), &ttl); } } @@ -82,30 +89,36 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Apc, __construct) { PHP_METHOD(Phalcon_Annotations_Adapter_Apc, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *_0, *_1, *_2; - zval *key = NULL; + zval *key_param = NULL, _0, _1, _2; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_INIT_VAR(_0); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVV(_2, "_PHAN", _1, key); - zephir_fast_strtolower(_0, _2); - ZEPHIR_RETURN_CALL_FUNCTION("apc_fetch", NULL, 90, _0); + ZEPHIR_INIT_VAR(&_0); + zephir_read_property(&_1, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key); + zephir_fast_strtolower(&_0, &_2); + ZEPHIR_RETURN_CALL_FUNCTION("apc_fetch", NULL, 81, &_0); zephir_check_call_status(); RETURN_MM(); @@ -117,31 +130,39 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Apc, read) { PHP_METHOD(Phalcon_Annotations_Adapter_Apc, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data, *_0, *_1, *_2, *_3; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, _0, _1, _2, _3; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_INIT_VAR(_0); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVV(_2, "_PHAN", _1, key); - zephir_fast_strtolower(_0, _2); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_ttl"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_FUNCTION("apc_store", NULL, 91, _0, data, _3); + ZEPHIR_INIT_VAR(&_0); + zephir_read_property(&_1, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key); + zephir_fast_strtolower(&_0, &_2); + zephir_read_property(&_3, this_ptr, SL("_ttl"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_FUNCTION("apc_store", NULL, 82, &_0, data, &_3); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/annotations/adapter/apc.zep.h b/ext/phalcon/annotations/adapter/apc.zep.h index 25aa96ec35f..2cedcf45e7b 100644 --- a/ext/phalcon/annotations/adapter/apc.zep.h +++ b/ext/phalcon/annotations/adapter/apc.zep.h @@ -12,11 +12,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_apc___construct, 0, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_apc_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_apc_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_OBJ_INFO(0, data, Phalcon\\Annotations\\Reflection, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/annotations/adapter/apcu.zep.c b/ext/phalcon/annotations/adapter/apcu.zep.c index 8f3c352cf4d..626792380cd 100644 --- a/ext/phalcon/annotations/adapter/apcu.zep.c +++ b/ext/phalcon/annotations/adapter/apcu.zep.c @@ -53,21 +53,28 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_Apcu) { */ PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, __construct) { - zval *options = NULL, *prefix = NULL, *ttl = NULL; + zval *options = NULL, options_sub, __$null, prefix, ttl; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&ttl); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + if (zephir_array_isset_string_fetch(&prefix, options, SL("prefix"), 1)) { + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); } - if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_ttl"), ttl TSRMLS_CC); + if (zephir_array_isset_string_fetch(&ttl, options, SL("lifetime"), 1)) { + zephir_update_property_zval(this_ptr, SL("_ttl"), &ttl); } } @@ -79,30 +86,36 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, __construct) { PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *_0, *_1, *_2; - zval *key = NULL; + zval *key_param = NULL, _0, _1, _2; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_INIT_VAR(_0); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVV(_2, "_PHAN", _1, key); - zephir_fast_strtolower(_0, _2); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_fetch", NULL, 92, _0); + ZEPHIR_INIT_VAR(&_0); + zephir_read_property(&_1, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key); + zephir_fast_strtolower(&_0, &_2); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_fetch", NULL, 0, &_0); zephir_check_call_status(); RETURN_MM(); @@ -114,31 +127,39 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, read) { PHP_METHOD(Phalcon_Annotations_Adapter_Apcu, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data, *_0, *_1, *_2, *_3; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, _0, _1, _2, _3; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_INIT_VAR(_0); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVV(_2, "_PHAN", _1, key); - zephir_fast_strtolower(_0, _2); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_ttl"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 93, _0, data, _3); + ZEPHIR_INIT_VAR(&_0); + zephir_read_property(&_1, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVV(&_2, "_PHAN", &_1, &key); + zephir_fast_strtolower(&_0, &_2); + zephir_read_property(&_3, this_ptr, SL("_ttl"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_store", NULL, 0, &_0, data, &_3); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/annotations/adapter/apcu.zep.h b/ext/phalcon/annotations/adapter/apcu.zep.h index 4bcb5ec32d1..7d086aab2c7 100644 --- a/ext/phalcon/annotations/adapter/apcu.zep.h +++ b/ext/phalcon/annotations/adapter/apcu.zep.h @@ -12,11 +12,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_apcu___construct, 0, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_apcu_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_apcu_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_OBJ_INFO(0, data, Phalcon\\Annotations\\Reflection, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/annotations/adapter/files.zep.c b/ext/phalcon/annotations/adapter/files.zep.c index 6cb9e104fe6..b3965c27824 100644 --- a/ext/phalcon/annotations/adapter/files.zep.c +++ b/ext/phalcon/annotations/adapter/files.zep.c @@ -56,18 +56,24 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_Files) { */ PHP_METHOD(Phalcon_Annotations_Adapter_Files, __construct) { - zval *options = NULL, *annotationsDir = NULL; + zval *options = NULL, options_sub, __$null, annotationsDir; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&annotationsDir); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&annotationsDir, options, SS("annotationsDir"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_annotationsDir"), annotationsDir TSRMLS_CC); + if (zephir_array_isset_string_fetch(&annotationsDir, options, SL("annotationsDir"), 1)) { + zephir_update_property_zval(this_ptr, SL("_annotationsDir"), &annotationsDir); } } @@ -81,28 +87,36 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Files, __construct) { */ PHP_METHOD(Phalcon_Annotations_Adapter_Files, read) { - zval *key_param = NULL, *path = NULL, *_0, *_1, _2, *_3$$3 = NULL; - zval *key = NULL; + zval *key_param = NULL, path, _0, _1, _2, _3$$3; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_annotationsDir"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_SINIT_VAR(_2); - ZVAL_STRING(&_2, "_", 0); - zephir_prepare_virtual_path(_1, key, &_2 TSRMLS_CC); - ZEPHIR_INIT_VAR(path); - ZEPHIR_CONCAT_VVS(path, _0, _1, ".php"); - if ((zephir_file_exists(path TSRMLS_CC) == SUCCESS)) { + zephir_read_property(&_0, this_ptr, SL("_annotationsDir"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "_"); + zephir_prepare_virtual_path(&_1, &key, &_2 TSRMLS_CC); + ZEPHIR_INIT_VAR(&path); + ZEPHIR_CONCAT_VVS(&path, &_0, &_1, ".php"); + if ((zephir_file_exists(&path TSRMLS_CC) == SUCCESS)) { ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(&_3$$3); - if (zephir_require_zval_ret(&_3$$3, path TSRMLS_CC) == FAILURE) { + if (zephir_require_zval_ret(&_3$$3, &path TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } - RETURN_CCTOR(_3$$3); + RETURN_CCTOR(&_3$$3); } RETURN_MM_BOOL(0); @@ -113,39 +127,50 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Files, read) { */ PHP_METHOD(Phalcon_Annotations_Adapter_Files, write) { - zval *key_param = NULL, *data, *path = NULL, *_0, *_1, _2, *_3, *_4 = NULL, *_5; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, path, _0, _1, _2, _3, _4, _5; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_annotationsDir"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_SINIT_VAR(_2); - ZVAL_STRING(&_2, "_", 0); - zephir_prepare_virtual_path(_1, key, &_2 TSRMLS_CC); - ZEPHIR_INIT_VAR(path); - ZEPHIR_CONCAT_VVS(path, _0, _1, ".php"); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_INIT_VAR(_4); - ZEPHIR_INIT_NVAR(_4); - zephir_var_export_ex(_4, &data TSRMLS_CC); - ZEPHIR_INIT_VAR(_5); - ZEPHIR_CONCAT_SVS(_5, "= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_files_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_OBJ_INFO(0, data, Phalcon\\Annotations\\Reflection, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/annotations/adapter/memory.zep.c b/ext/phalcon/annotations/adapter/memory.zep.c index bc700484a59..a3e0c0bedb9 100644 --- a/ext/phalcon/annotations/adapter/memory.zep.c +++ b/ext/phalcon/annotations/adapter/memory.zep.c @@ -45,29 +45,35 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_Memory) { */ PHP_METHOD(Phalcon_Annotations_Adapter_Memory, read) { - zval *key_param = NULL, *data = NULL, *_0, *_1; - zval *key = NULL; + zval *key_param = NULL, data, _0, _1; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_fast_strtolower(_1, key); - if (zephir_array_isset_fetch(&data, _0, _1, 1 TSRMLS_CC)) { - RETURN_CTOR(data); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_fast_strtolower(&_1, &key); + if (zephir_array_isset_fetch(&data, &_0, &_1, 1 TSRMLS_CC)) { + RETURN_CTOR(&data); } RETURN_MM_BOOL(0); @@ -78,27 +84,32 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Memory, read) { */ PHP_METHOD(Phalcon_Annotations_Adapter_Memory, write) { - zval *key_param = NULL, *data, *lowercasedKey = NULL; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, lowercasedKey; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&lowercasedKey); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_INIT_VAR(lowercasedKey); - zephir_fast_strtolower(lowercasedKey, key); - zephir_update_property_array(this_ptr, SL("_data"), lowercasedKey, data TSRMLS_CC); + ZEPHIR_INIT_VAR(&lowercasedKey); + zephir_fast_strtolower(&lowercasedKey, &key); + zephir_update_property_array(this_ptr, SL("_data"), &lowercasedKey, data TSRMLS_CC); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/annotations/adapter/memory.zep.h b/ext/phalcon/annotations/adapter/memory.zep.h index 976a202c523..e3e93e0ca03 100644 --- a/ext/phalcon/annotations/adapter/memory.zep.h +++ b/ext/phalcon/annotations/adapter/memory.zep.h @@ -7,11 +7,19 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Memory, read); PHP_METHOD(Phalcon_Annotations_Adapter_Memory, write); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_memory_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_memory_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_OBJ_INFO(0, data, Phalcon\\Annotations\\Reflection, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/annotations/adapter/xcache.zep.c b/ext/phalcon/annotations/adapter/xcache.zep.c index b070b8c7abb..7834275a13d 100644 --- a/ext/phalcon/annotations/adapter/xcache.zep.c +++ b/ext/phalcon/annotations/adapter/xcache.zep.c @@ -47,35 +47,42 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Adapter_Xcache) { PHP_METHOD(Phalcon_Annotations_Adapter_Xcache, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *serialized = NULL, *data = NULL, *_0; - zval *key = NULL, *_1; + zval *key_param = NULL, serialized, data, _0; + zval key, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&serialized); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_INIT_VAR(_0); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, "_PHAN", key); - zephir_fast_strtolower(_0, _1); - ZEPHIR_CALL_FUNCTION(&serialized, "xcache_get", NULL, 94, _0); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, "_PHAN", &key); + zephir_fast_strtolower(&_0, &_1); + ZEPHIR_CALL_FUNCTION(&serialized, "xcache_get", NULL, 83, &_0); zephir_check_call_status(); - if (Z_TYPE_P(serialized) == IS_STRING) { - ZEPHIR_CALL_FUNCTION(&data, "unserialize", NULL, 69, serialized); + if (Z_TYPE_P(&serialized) == IS_STRING) { + ZEPHIR_CALL_FUNCTION(&data, "unserialize", NULL, 62, &serialized); zephir_check_call_status(); - if (Z_TYPE_P(data) == IS_OBJECT) { - RETURN_CCTOR(data); + if (Z_TYPE_P(&data) == IS_OBJECT) { + RETURN_CCTOR(&data); } } RETURN_MM_BOOL(0); @@ -88,31 +95,38 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Xcache, read) { PHP_METHOD(Phalcon_Annotations_Adapter_Xcache, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data, *_0, *_2 = NULL; - zval *key = NULL, *_1; + zval *key_param = NULL, *data, data_sub, _0, _2; + zval key, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_INIT_VAR(_0); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, "_PHAN", key); - zephir_fast_strtolower(_0, _1); - ZEPHIR_CALL_FUNCTION(&_2, "serialize", NULL, 68, data); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, "_PHAN", &key); + zephir_fast_strtolower(&_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "serialize", NULL, 61, data); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 95, _0, _2); + ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 84, &_0, &_2); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/annotations/adapter/xcache.zep.h b/ext/phalcon/annotations/adapter/xcache.zep.h index 5dd9b399d08..113406fb99d 100644 --- a/ext/phalcon/annotations/adapter/xcache.zep.h +++ b/ext/phalcon/annotations/adapter/xcache.zep.h @@ -7,11 +7,19 @@ PHP_METHOD(Phalcon_Annotations_Adapter_Xcache, read); PHP_METHOD(Phalcon_Annotations_Adapter_Xcache, write); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_xcache_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapter_xcache_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_OBJ_INFO(0, data, Phalcon\\Annotations\\Reflection, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/annotations/adapterinterface.zep.h b/ext/phalcon/annotations/adapterinterface.zep.h index 50a34445d11..34ab6082ec7 100644 --- a/ext/phalcon/annotations/adapterinterface.zep.h +++ b/ext/phalcon/annotations/adapterinterface.zep.h @@ -7,31 +7,82 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapterinterface_setreader, 0 ZEND_ARG_OBJ_INFO(0, reader, Phalcon\\Annotations\\ReaderInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapterinterface_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getreader, 0, 0, Phalcon\\Annotations\\ReaderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getreader, 0, 0, IS_OBJECT, "Phalcon\\Annotations\\ReaderInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapterinterface_get, 0, 1, Phalcon\\Annotations\\Reflection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapterinterface_get, 0, 1, IS_OBJECT, "Phalcon\\Annotations\\Reflection", 0) +#endif ZEND_ARG_INFO(0, className) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getmethods, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getmethods, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getmethods, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getmethod, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getmethod, 0, 2, Phalcon\\Annotations\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getmethod, 0, 2, IS_OBJECT, "Phalcon\\Annotations\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, methodName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, methodName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getproperties, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getproperties, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getproperties, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getproperty, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getproperty, 0, 2, Phalcon\\Annotations\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_adapterinterface_getproperty, 0, 2, IS_OBJECT, "Phalcon\\Annotations\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, propertyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, propertyName) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_adapterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Annotations_AdapterInterface, setReader, arginfo_phalcon_annotations_adapterinterface_setreader) - PHP_ABSTRACT_ME(Phalcon_Annotations_AdapterInterface, getReader, NULL) + PHP_ABSTRACT_ME(Phalcon_Annotations_AdapterInterface, getReader, arginfo_phalcon_annotations_adapterinterface_getreader) PHP_ABSTRACT_ME(Phalcon_Annotations_AdapterInterface, get, arginfo_phalcon_annotations_adapterinterface_get) PHP_ABSTRACT_ME(Phalcon_Annotations_AdapterInterface, getMethods, arginfo_phalcon_annotations_adapterinterface_getmethods) PHP_ABSTRACT_ME(Phalcon_Annotations_AdapterInterface, getMethod, arginfo_phalcon_annotations_adapterinterface_getmethod) diff --git a/ext/phalcon/annotations/annotation.zep.c b/ext/phalcon/annotations/annotation.zep.c index 51e69c8ceaf..dddf53eb370 100644 --- a/ext/phalcon/annotations/annotation.zep.c +++ b/ext/phalcon/annotations/annotation.zep.c @@ -58,42 +58,50 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Annotation) { */ PHP_METHOD(Phalcon_Annotations_Annotation, __construct) { - HashTable *_2$$3; - HashPosition _1$$3; - zephir_fcall_cache_entry *_5 = NULL; + zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *reflectionData_param = NULL, *name = NULL, *exprArguments = NULL, *argument = NULL, *resolvedArgument = NULL, *arguments = NULL, *_0, **_3$$3, *_4$$4; - zval *reflectionData = NULL; + zval *reflectionData_param = NULL, name, exprArguments, argument, resolvedArgument, arguments, _0, *_1$$3, _2$$4; + zval reflectionData; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&reflectionData); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&exprArguments); + ZVAL_UNDEF(&argument); + ZVAL_UNDEF(&resolvedArgument); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &reflectionData_param); - reflectionData = reflectionData_param; - - - zephir_array_fetch_string(&_0, reflectionData, SL("name"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 58 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_name"), _0 TSRMLS_CC); - ZEPHIR_OBS_VAR(exprArguments); - if (zephir_array_isset_string_fetch(&exprArguments, reflectionData, SS("arguments"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(arguments); - array_init(arguments); - zephir_is_iterable(exprArguments, &_2$$3, &_1$$3, 0, 0, "phalcon/annotations/annotation.zep", 73); - for ( - ; zend_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS - ; zend_hash_move_forward_ex(_2$$3, &_1$$3) - ) { - ZEPHIR_GET_HVALUE(argument, _3$$3); - zephir_array_fetch_string(&_4$$4, argument, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 66 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&resolvedArgument, this_ptr, "getexpression", &_5, 0, _4$$4); + ZEPHIR_OBS_COPY_OR_DUP(&reflectionData, reflectionData_param); + + + zephir_array_fetch_string(&_0, &reflectionData, SL("name"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 58 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &_0); + ZEPHIR_OBS_VAR(&exprArguments); + if (zephir_array_isset_string_fetch(&exprArguments, &reflectionData, SL("arguments"), 0)) { + ZEPHIR_INIT_VAR(&arguments); + array_init(&arguments); + zephir_is_iterable(&exprArguments, 0, "phalcon/annotations/annotation.zep", 73); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&exprArguments), _1$$3) + { + ZEPHIR_INIT_NVAR(&argument); + ZVAL_COPY(&argument, _1$$3); + zephir_array_fetch_string(&_2$$4, &argument, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 66 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&resolvedArgument, this_ptr, "getexpression", &_3, 0, &_2$$4); zephir_check_call_status(); - if (zephir_array_isset_string_fetch(&name, argument, SS("name"), 1 TSRMLS_CC)) { - zephir_array_update_zval(&arguments, name, &resolvedArgument, PH_COPY | PH_SEPARATE); + if (zephir_array_isset_string_fetch(&name, &argument, SL("name"), 1)) { + zephir_array_update_zval(&arguments, &name, &resolvedArgument, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&arguments, resolvedArgument, PH_SEPARATE, "phalcon/annotations/annotation.zep", 70); + zephir_array_append(&arguments, &resolvedArgument, PH_SEPARATE, "phalcon/annotations/annotation.zep", 70); } - } - zephir_update_property_this(getThis(), SL("_arguments"), arguments TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_exprArguments"), exprArguments TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&argument); + zephir_update_property_zval(this_ptr, SL("_arguments"), &arguments); + zephir_update_property_zval(this_ptr, SL("_exprArguments"), &exprArguments); } ZEPHIR_MM_RESTORE(); @@ -104,7 +112,8 @@ PHP_METHOD(Phalcon_Annotations_Annotation, __construct) { */ PHP_METHOD(Phalcon_Annotations_Annotation, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -118,82 +127,93 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getName) { */ PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) { - HashTable *_2$$7; - HashPosition _1$$7; - zephir_fcall_cache_entry *_5 = NULL; + zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *value = NULL, *item = NULL, *resolvedItem = NULL, *arrayValue = NULL, *name = NULL, *type = NULL, *_0$$7, **_3$$7, *_4$$8, *_6$$12, *_7$$12; - zval *expr = NULL; + zval *expr_param = NULL, value, item, resolvedItem, arrayValue, name, type, _0$$7, *_1$$7, _2$$8, _4$$12, _5$$12; + zval expr; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&resolvedItem); + ZVAL_UNDEF(&arrayValue); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&_0$$7); + ZVAL_UNDEF(&_2$$8); + ZVAL_UNDEF(&_4$$12); + ZVAL_UNDEF(&_5$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &expr_param); - expr = expr_param; + ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param); - ZEPHIR_OBS_VAR(type); - zephir_array_fetch_string(&type, expr, SL("type"), PH_NOISY, "phalcon/annotations/annotation.zep", 96 TSRMLS_CC); + ZEPHIR_OBS_VAR(&type); + zephir_array_fetch_string(&type, &expr, SL("type"), PH_NOISY, "phalcon/annotations/annotation.zep", 96 TSRMLS_CC); do { - if (ZEPHIR_IS_LONG(type, 301) || ZEPHIR_IS_LONG(type, 302) || ZEPHIR_IS_LONG(type, 303) || ZEPHIR_IS_LONG(type, 307)) { - ZEPHIR_OBS_VAR(value); - zephir_array_fetch_string(&value, expr, SL("value"), PH_NOISY, "phalcon/annotations/annotation.zep", 103 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&type, 301) || ZEPHIR_IS_LONG(&type, 302) || ZEPHIR_IS_LONG(&type, 303) || ZEPHIR_IS_LONG(&type, 307)) { + ZEPHIR_OBS_VAR(&value); + zephir_array_fetch_string(&value, &expr, SL("value"), PH_NOISY, "phalcon/annotations/annotation.zep", 103 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 304)) { - ZEPHIR_INIT_NVAR(value); - ZVAL_NULL(value); + if (ZEPHIR_IS_LONG(&type, 304)) { + ZEPHIR_INIT_NVAR(&value); + ZVAL_NULL(&value); break; } - if (ZEPHIR_IS_LONG(type, 305)) { - ZEPHIR_INIT_NVAR(value); - ZVAL_BOOL(value, 0); + if (ZEPHIR_IS_LONG(&type, 305)) { + ZEPHIR_INIT_NVAR(&value); + ZVAL_BOOL(&value, 0); break; } - if (ZEPHIR_IS_LONG(type, 306)) { - ZEPHIR_INIT_NVAR(value); - ZVAL_BOOL(value, 1); + if (ZEPHIR_IS_LONG(&type, 306)) { + ZEPHIR_INIT_NVAR(&value); + ZVAL_BOOL(&value, 1); break; } - if (ZEPHIR_IS_LONG(type, 308)) { - ZEPHIR_INIT_VAR(arrayValue); - array_init(arrayValue); - zephir_array_fetch_string(&_0$$7, expr, SL("items"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 120 TSRMLS_CC); - zephir_is_iterable(_0$$7, &_2$$7, &_1$$7, 0, 0, "phalcon/annotations/annotation.zep", 128); - for ( - ; zend_hash_get_current_data_ex(_2$$7, (void**) &_3$$7, &_1$$7) == SUCCESS - ; zend_hash_move_forward_ex(_2$$7, &_1$$7) - ) { - ZEPHIR_GET_HVALUE(item, _3$$7); - zephir_array_fetch_string(&_4$$8, item, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 121 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_5, 96, _4$$8); + if (ZEPHIR_IS_LONG(&type, 308)) { + ZEPHIR_INIT_VAR(&arrayValue); + array_init(&arrayValue); + zephir_array_fetch_string(&_0$$7, &expr, SL("items"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 120 TSRMLS_CC); + zephir_is_iterable(&_0$$7, 0, "phalcon/annotations/annotation.zep", 128); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0$$7), _1$$7) + { + ZEPHIR_INIT_NVAR(&item); + ZVAL_COPY(&item, _1$$7); + zephir_array_fetch_string(&_2$$8, &item, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/annotations/annotation.zep", 121 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&resolvedItem, this_ptr, "getexpression", &_3, 85, &_2$$8); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(name); - if (zephir_array_isset_string_fetch(&name, item, SS("name"), 0 TSRMLS_CC)) { - zephir_array_update_zval(&arrayValue, name, &resolvedItem, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&name); + if (zephir_array_isset_string_fetch(&name, &item, SL("name"), 0)) { + zephir_array_update_zval(&arrayValue, &name, &resolvedItem, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&arrayValue, resolvedItem, PH_SEPARATE, "phalcon/annotations/annotation.zep", 125); + zephir_array_append(&arrayValue, &resolvedItem, PH_SEPARATE, "phalcon/annotations/annotation.zep", 125); } - } - RETURN_CCTOR(arrayValue); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&item); + RETURN_CCTOR(&arrayValue); } - if (ZEPHIR_IS_LONG(type, 300)) { + if (ZEPHIR_IS_LONG(&type, 300)) { object_init_ex(return_value, phalcon_annotations_annotation_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 97, expr); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 86, &expr); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(_6$$12); - object_init_ex(_6$$12, phalcon_annotations_exception_ce); - ZEPHIR_INIT_VAR(_7$$12); - ZEPHIR_CONCAT_SVS(_7$$12, "The expression ", type, " is unknown"); - ZEPHIR_CALL_METHOD(NULL, _6$$12, "__construct", NULL, 9, _7$$12); + ZEPHIR_INIT_VAR(&_4$$12); + object_init_ex(&_4$$12, phalcon_annotations_exception_ce); + ZEPHIR_INIT_VAR(&_5$$12); + ZEPHIR_CONCAT_SVS(&_5$$12, "The expression ", &type, " is unknown"); + ZEPHIR_CALL_METHOD(NULL, &_4$$12, "__construct", NULL, 4, &_5$$12); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$12, "phalcon/annotations/annotation.zep", 134 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$12, "phalcon/annotations/annotation.zep", 134 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); - RETURN_CCTOR(value); + RETURN_CCTOR(&value); } @@ -204,7 +224,8 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getExpression) { */ PHP_METHOD(Phalcon_Annotations_Annotation, getExprArguments) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_exprArguments"); @@ -217,7 +238,8 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getExprArguments) { */ PHP_METHOD(Phalcon_Annotations_Annotation, getArguments) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_arguments"); @@ -228,11 +250,14 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getArguments) { */ PHP_METHOD(Phalcon_Annotations_Annotation, numberArguments) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); - RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC)); + + zephir_read_property(&_0, this_ptr, SL("_arguments"), PH_NOISY_CC | PH_READONLY); + RETURN_LONG(zephir_fast_count_int(&_0 TSRMLS_CC)); } @@ -244,15 +269,20 @@ PHP_METHOD(Phalcon_Annotations_Annotation, numberArguments) { */ PHP_METHOD(Phalcon_Annotations_Annotation, getArgument) { - zval *position, *argument = NULL, *_0; + zval *position, position_sub, argument, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&position_sub); + ZVAL_UNDEF(&argument); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &position); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&argument, _0, position, 1 TSRMLS_CC)) { - RETURN_CTORW(argument); + zephir_read_property(&_0, this_ptr, SL("_arguments"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&argument, &_0, position, 1 TSRMLS_CC)) { + RETURN_CTORW(&argument); } } @@ -265,14 +295,18 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getArgument) { */ PHP_METHOD(Phalcon_Annotations_Annotation, hasArgument) { - zval *position, *_0; + zval *position, position_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&position_sub); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &position); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); - RETURN_BOOL(zephir_array_isset(_0, position)); + zephir_read_property(&_0, this_ptr, SL("_arguments"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_array_isset(&_0, position)); } @@ -283,27 +317,32 @@ PHP_METHOD(Phalcon_Annotations_Annotation, hasArgument) { */ PHP_METHOD(Phalcon_Annotations_Annotation, getNamedArgument) { - zval *name_param = NULL, *argument = NULL, *_0; - zval *name = NULL; + zval *name_param = NULL, argument, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&argument); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&argument, _0, name, 1 TSRMLS_CC)) { - RETURN_CTOR(argument); + zephir_read_property(&_0, this_ptr, SL("_arguments"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&argument, &_0, &name, 1 TSRMLS_CC)) { + RETURN_CTOR(&argument); } ZEPHIR_MM_RESTORE(); @@ -318,24 +357,27 @@ PHP_METHOD(Phalcon_Annotations_Annotation, getNamedParameter) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *name_param = NULL; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getnamedargument", NULL, 0, name); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getnamedargument", NULL, 0, &name); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/annotations/annotation.zep.h b/ext/phalcon/annotations/annotation.zep.h index 4eeac2c497e..ed31714611e 100644 --- a/ext/phalcon/annotations/annotation.zep.h +++ b/ext/phalcon/annotations/annotation.zep.h @@ -18,33 +18,59 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_annotation___construct, 0, 0, ZEND_ARG_ARRAY_INFO(0, reflectionData, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_annotation_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_annotation_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_annotation_getexpression, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, expr, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_annotation_numberarguments, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_annotation_numberarguments, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_annotation_getargument, 0, 0, 1) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_annotation_hasargument, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_annotation_hasargument, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_annotation_hasargument, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_annotation_getnamedargument, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_annotation_getnamedparameter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_annotation_method_entry) { PHP_ME(Phalcon_Annotations_Annotation, __construct, arginfo_phalcon_annotations_annotation___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Annotations_Annotation, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Annotation, getName, arginfo_phalcon_annotations_annotation_getname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Annotation, getExpression, arginfo_phalcon_annotations_annotation_getexpression, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Annotation, getExprArguments, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Annotation, getArguments, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Annotations_Annotation, numberArguments, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Annotation, numberArguments, arginfo_phalcon_annotations_annotation_numberarguments, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Annotation, getArgument, arginfo_phalcon_annotations_annotation_getargument, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Annotation, hasArgument, arginfo_phalcon_annotations_annotation_hasargument, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Annotation, getNamedArgument, arginfo_phalcon_annotations_annotation_getnamedargument, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/annotations/collection.zep.c b/ext/phalcon/annotations/collection.zep.c index 40123b7bef3..1216c45e1c9 100644 --- a/ext/phalcon/annotations/collection.zep.c +++ b/ext/phalcon/annotations/collection.zep.c @@ -61,18 +61,24 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Collection) { */ PHP_METHOD(Phalcon_Annotations_Collection, __construct) { - HashTable *_2$$4; - HashPosition _1$$4; zend_bool _0; - zephir_fcall_cache_entry *_5 = NULL; + zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *reflectionData = NULL, *annotations = NULL, *annotationData = NULL, **_3$$4, *_4$$5 = NULL; + zval *reflectionData = NULL, reflectionData_sub, __$null, annotations, annotationData, *_1$$4, _2$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&reflectionData_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&annotationData); + ZVAL_UNDEF(&_2$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &reflectionData); if (!reflectionData) { - reflectionData = ZEPHIR_GLOBAL(global_null); + reflectionData = &reflectionData_sub; + reflectionData = &__$null; } @@ -84,23 +90,23 @@ PHP_METHOD(Phalcon_Annotations_Collection, __construct) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_annotations_exception_ce, "Reflection data must be an array", "phalcon/annotations/collection.zep", 60); return; } - ZEPHIR_INIT_VAR(annotations); - array_init(annotations); + ZEPHIR_INIT_VAR(&annotations); + array_init(&annotations); if (Z_TYPE_P(reflectionData) == IS_ARRAY) { - zephir_is_iterable(reflectionData, &_2$$4, &_1$$4, 0, 0, "phalcon/annotations/collection.zep", 68); - for ( - ; zend_hash_get_current_data_ex(_2$$4, (void**) &_3$$4, &_1$$4) == SUCCESS - ; zend_hash_move_forward_ex(_2$$4, &_1$$4) - ) { - ZEPHIR_GET_HVALUE(annotationData, _3$$4); - ZEPHIR_INIT_NVAR(_4$$5); - object_init_ex(_4$$5, phalcon_annotations_annotation_ce); - ZEPHIR_CALL_METHOD(NULL, _4$$5, "__construct", &_5, 97, annotationData); + zephir_is_iterable(reflectionData, 0, "phalcon/annotations/collection.zep", 68); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(reflectionData), _1$$4) + { + ZEPHIR_INIT_NVAR(&annotationData); + ZVAL_COPY(&annotationData, _1$$4); + ZEPHIR_INIT_NVAR(&_2$$5); + object_init_ex(&_2$$5, phalcon_annotations_annotation_ce); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", &_3, 86, &annotationData); zephir_check_call_status(); - zephir_array_append(&annotations, _4$$5, PH_SEPARATE, "phalcon/annotations/collection.zep", 66); - } + zephir_array_append(&annotations, &_2$$5, PH_SEPARATE, "phalcon/annotations/collection.zep", 66); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&annotationData); } - zephir_update_property_this(getThis(), SL("_annotations"), annotations TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_annotations"), &annotations); ZEPHIR_MM_RESTORE(); } @@ -110,11 +116,14 @@ PHP_METHOD(Phalcon_Annotations_Collection, __construct) { */ PHP_METHOD(Phalcon_Annotations_Collection, count) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_annotations"), PH_NOISY_CC); - RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC)); + zephir_read_property(&_0, this_ptr, SL("_annotations"), PH_NOISY_CC | PH_READONLY); + RETURN_LONG(zephir_fast_count_int(&_0 TSRMLS_CC)); } @@ -123,12 +132,15 @@ PHP_METHOD(Phalcon_Annotations_Collection, count) { */ PHP_METHOD(Phalcon_Annotations_Collection, rewind) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_position"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_position"), &_0); } @@ -139,13 +151,18 @@ PHP_METHOD(Phalcon_Annotations_Collection, rewind) { */ PHP_METHOD(Phalcon_Annotations_Collection, current) { - zval *annotation = NULL, *_0, *_1; + zval annotation, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&annotation); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_annotations"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_position"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&annotation, _0, _1, 1 TSRMLS_CC)) { - RETURN_CTORW(annotation); + zephir_read_property(&_0, this_ptr, SL("_annotations"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_position"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&annotation, &_0, &_1, 1 TSRMLS_CC)) { + RETURN_CTORW(&annotation); } RETURN_BOOL(0); @@ -156,7 +173,8 @@ PHP_METHOD(Phalcon_Annotations_Collection, current) { */ PHP_METHOD(Phalcon_Annotations_Collection, key) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_position"); @@ -167,7 +185,8 @@ PHP_METHOD(Phalcon_Annotations_Collection, key) { */ PHP_METHOD(Phalcon_Annotations_Collection, next) { - + zval *this_ptr = getThis(); + RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_position") TSRMLS_CC)); @@ -178,12 +197,16 @@ PHP_METHOD(Phalcon_Annotations_Collection, next) { */ PHP_METHOD(Phalcon_Annotations_Collection, valid) { - zval *_0, *_1; + zval _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_annotations"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_position"), PH_NOISY_CC); - RETURN_BOOL(zephir_array_isset(_0, _1)); + zephir_read_property(&_0, this_ptr, SL("_annotations"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_position"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_array_isset(&_0, &_1)); } @@ -192,7 +215,8 @@ PHP_METHOD(Phalcon_Annotations_Collection, valid) { */ PHP_METHOD(Phalcon_Annotations_Collection, getAnnotations) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_annotations"); @@ -203,41 +227,47 @@ PHP_METHOD(Phalcon_Annotations_Collection, getAnnotations) { */ PHP_METHOD(Phalcon_Annotations_Collection, get) { - HashTable *_1$$3; - HashPosition _0$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *annotation = NULL, *annotations = NULL, *_4, **_2$$3, *_3$$4 = NULL; - zval *name = NULL, *_5; + zval *name_param = NULL, annotation, annotations, _2, *_0$$3, _1$$4; + zval name, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&annotation); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - ZEPHIR_OBS_VAR(annotations); - zephir_read_property_this(&annotations, this_ptr, SL("_annotations"), PH_NOISY_CC); - if (Z_TYPE_P(annotations) == IS_ARRAY) { - zephir_is_iterable(annotations, &_1$$3, &_0$$3, 0, 0, "phalcon/annotations/collection.zep", 147); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(annotation, _2$$3); - ZEPHIR_CALL_METHOD(&_3$$4, annotation, "getname", NULL, 0); + ZEPHIR_OBS_VAR(&annotations); + zephir_read_property(&annotations, this_ptr, SL("_annotations"), PH_NOISY_CC); + if (Z_TYPE_P(&annotations) == IS_ARRAY) { + zephir_is_iterable(&annotations, 0, "phalcon/annotations/collection.zep", 147); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _0$$3) + { + ZEPHIR_INIT_NVAR(&annotation); + ZVAL_COPY(&annotation, _0$$3); + ZEPHIR_CALL_METHOD(&_1$$4, &annotation, "getname", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EQUAL(name, _3$$4)) { - RETURN_CCTOR(annotation); + if (ZEPHIR_IS_EQUAL(&name, &_1$$4)) { + RETURN_CCTOR(&annotation); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&annotation); } - ZEPHIR_INIT_VAR(_4); - object_init_ex(_4, phalcon_annotations_exception_ce); - ZEPHIR_INIT_VAR(_5); - ZEPHIR_CONCAT_SVS(_5, "Collection doesn't have an annotation called '", name, "'"); - ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 9, _5); + ZEPHIR_INIT_VAR(&_2); + object_init_ex(&_2, phalcon_annotations_exception_ce); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SVS(&_3, "Collection doesn't have an annotation called '", &name, "'"); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 4, &_3); zephir_check_call_status(); - zephir_throw_exception_debug(_4, "phalcon/annotations/collection.zep", 149 TSRMLS_CC); + zephir_throw_exception_debug(&_2, "phalcon/annotations/collection.zep", 149 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -248,37 +278,42 @@ PHP_METHOD(Phalcon_Annotations_Collection, get) { */ PHP_METHOD(Phalcon_Annotations_Collection, getAll) { - HashTable *_1$$3; - HashPosition _0$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *annotations = NULL, *found = NULL, *annotation = NULL, **_2$$3, *_3$$4 = NULL; - zval *name = NULL; + zval *name_param = NULL, annotations, found, annotation, *_0$$3, _1$$4; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&found); + ZVAL_UNDEF(&annotation); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); - - - ZEPHIR_INIT_VAR(found); - array_init(found); - ZEPHIR_OBS_VAR(annotations); - zephir_read_property_this(&annotations, this_ptr, SL("_annotations"), PH_NOISY_CC); - if (Z_TYPE_P(annotations) == IS_ARRAY) { - zephir_is_iterable(annotations, &_1$$3, &_0$$3, 0, 0, "phalcon/annotations/collection.zep", 167); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(annotation, _2$$3); - ZEPHIR_CALL_METHOD(&_3$$4, annotation, "getname", NULL, 0); + zephir_get_strval(&name, name_param); + + + ZEPHIR_INIT_VAR(&found); + array_init(&found); + ZEPHIR_OBS_VAR(&annotations); + zephir_read_property(&annotations, this_ptr, SL("_annotations"), PH_NOISY_CC); + if (Z_TYPE_P(&annotations) == IS_ARRAY) { + zephir_is_iterable(&annotations, 0, "phalcon/annotations/collection.zep", 167); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _0$$3) + { + ZEPHIR_INIT_NVAR(&annotation); + ZVAL_COPY(&annotation, _0$$3); + ZEPHIR_CALL_METHOD(&_1$$4, &annotation, "getname", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EQUAL(name, _3$$4)) { - zephir_array_append(&found, annotation, PH_SEPARATE, "phalcon/annotations/collection.zep", 164); + if (ZEPHIR_IS_EQUAL(&name, &_1$$4)) { + zephir_array_append(&found, &annotation, PH_SEPARATE, "phalcon/annotations/collection.zep", 164); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&annotation); } - RETURN_CCTOR(found); + RETURN_CCTOR(&found); } @@ -287,33 +322,37 @@ PHP_METHOD(Phalcon_Annotations_Collection, getAll) { */ PHP_METHOD(Phalcon_Annotations_Collection, has) { - HashTable *_1$$3; - HashPosition _0$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *annotations = NULL, *annotation = NULL, **_2$$3, *_3$$4 = NULL; - zval *name = NULL; + zval *name_param = NULL, annotations, annotation, *_0$$3, _1$$4; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&annotation); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - ZEPHIR_OBS_VAR(annotations); - zephir_read_property_this(&annotations, this_ptr, SL("_annotations"), PH_NOISY_CC); - if (Z_TYPE_P(annotations) == IS_ARRAY) { - zephir_is_iterable(annotations, &_1$$3, &_0$$3, 0, 0, "phalcon/annotations/collection.zep", 186); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(annotation, _2$$3); - ZEPHIR_CALL_METHOD(&_3$$4, annotation, "getname", NULL, 0); + ZEPHIR_OBS_VAR(&annotations); + zephir_read_property(&annotations, this_ptr, SL("_annotations"), PH_NOISY_CC); + if (Z_TYPE_P(&annotations) == IS_ARRAY) { + zephir_is_iterable(&annotations, 0, "phalcon/annotations/collection.zep", 186); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _0$$3) + { + ZEPHIR_INIT_NVAR(&annotation); + ZVAL_COPY(&annotation, _0$$3); + ZEPHIR_CALL_METHOD(&_1$$4, &annotation, "getname", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EQUAL(name, _3$$4)) { + if (ZEPHIR_IS_EQUAL(&name, &_1$$4)) { RETURN_MM_BOOL(1); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&annotation); } RETURN_MM_BOOL(0); diff --git a/ext/phalcon/annotations/collection.zep.h b/ext/phalcon/annotations/collection.zep.h index 0ba14250024..ce2940a7bc0 100644 --- a/ext/phalcon/annotations/collection.zep.h +++ b/ext/phalcon/annotations/collection.zep.h @@ -19,27 +19,79 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_collection___construct, 0, 0, ZEND_ARG_INFO(0, reflectionData) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_collection_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_count, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_key, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_key, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_valid, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_valid, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_collection_getannotations, 0, 0, Phalcon\\Annotations\\Annotation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_getannotations, 0, 0, IS_OBJECT, "Phalcon\\Annotations\\Annotation", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_collection_get, 0, 1, Phalcon\\Annotations\\Annotation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_get, 0, 1, IS_OBJECT, "Phalcon\\Annotations\\Annotation", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_collection_getall, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_collection_getall, 0, 1, Phalcon\\Annotations\\Annotation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_getall, 0, 1, IS_OBJECT, "Phalcon\\Annotations\\Annotation", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_collection_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_collection_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_annotations_collection_method_entry) { PHP_ME(Phalcon_Annotations_Collection, __construct, arginfo_phalcon_annotations_collection___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Annotations_Collection, count, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Collection, count, arginfo_phalcon_annotations_collection_count, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, rewind, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, current, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Annotations_Collection, key, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Collection, key, arginfo_phalcon_annotations_collection_key, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, next, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Annotations_Collection, valid, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Annotations_Collection, getAnnotations, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Collection, valid, arginfo_phalcon_annotations_collection_valid, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Annotations_Collection, getAnnotations, arginfo_phalcon_annotations_collection_getannotations, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, get, arginfo_phalcon_annotations_collection_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, getAll, arginfo_phalcon_annotations_collection_getall, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Annotations_Collection, has, arginfo_phalcon_annotations_collection_has, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/annotations/factory.zep.c b/ext/phalcon/annotations/factory.zep.c index af446294dee..67265157fe5 100644 --- a/ext/phalcon/annotations/factory.zep.c +++ b/ext/phalcon/annotations/factory.zep.c @@ -44,17 +44,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Factory) { PHP_METHOD(Phalcon_Annotations_Factory, load) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *_0; + zval *config, config_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Phalcon\\Annotations\\Adapter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, _0, config); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Phalcon\\Annotations\\Adapter"); + ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, &_0, config); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/annotations/factory.zep.h b/ext/phalcon/annotations/factory.zep.h index 2ec59e5e0c9..0cf3e8a6aff 100644 --- a/ext/phalcon/annotations/factory.zep.h +++ b/ext/phalcon/annotations/factory.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Factory); PHP_METHOD(Phalcon_Annotations_Factory, load); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_factory_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_factory_load, 0, 1, Phalcon\\Annotations\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_factory_load, 0, 1, IS_OBJECT, "Phalcon\\Annotations\\AdapterInterface", 0) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/annotations/reader.zep.c b/ext/phalcon/annotations/reader.zep.c index 19d17d30027..a77ff9ba975 100644 --- a/ext/phalcon/annotations/reader.zep.c +++ b/ext/phalcon/annotations/reader.zep.c @@ -40,104 +40,124 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reader) { */ PHP_METHOD(Phalcon_Annotations_Reader, parse) { - HashTable *_3$$5, *_9$$10; - HashPosition _2$$5, _8$$10; zend_long ZEPHIR_LAST_CALL_STATUS, line = 0; - zval *className_param = NULL, *annotations = NULL, *reflection = NULL, *comment = NULL, *properties = NULL, *methods = NULL, *property = NULL, *method = NULL, *classAnnotations = NULL, *annotationsProperties = NULL, *propertyAnnotations = NULL, *annotationsMethods = NULL, *methodAnnotations = NULL, *_0$$3 = NULL, *_1$$3 = NULL, **_4$$5, *_5$$7 = NULL, *_6$$7 = NULL, *_7$$8 = NULL, **_10$$10, *_11$$12 = NULL, *_12$$12 = NULL, *_13$$13 = NULL; - zval *className = NULL; + zval *className_param = NULL, annotations, reflection, comment, properties, methods, property, method, classAnnotations, annotationsProperties, propertyAnnotations, annotationsMethods, methodAnnotations, _0$$3, _1$$3, *_2$$5, _3$$7, _4$$7, _5$$8, *_6$$10, _7$$12, _8$$12, _9$$13; + zval className; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&reflection); + ZVAL_UNDEF(&comment); + ZVAL_UNDEF(&properties); + ZVAL_UNDEF(&methods); + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&classAnnotations); + ZVAL_UNDEF(&annotationsProperties); + ZVAL_UNDEF(&propertyAnnotations); + ZVAL_UNDEF(&annotationsMethods); + ZVAL_UNDEF(&methodAnnotations); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_7$$12); + ZVAL_UNDEF(&_8$$12); + ZVAL_UNDEF(&_9$$13); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &className_param); - zephir_get_strval(className, className_param); + zephir_get_strval(&className, className_param); - ZEPHIR_INIT_VAR(annotations); - array_init(annotations); - ZEPHIR_INIT_VAR(reflection); - object_init_ex(reflection, zephir_get_internal_ce(SS("reflectionclass") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, reflection, "__construct", NULL, 98, className); + ZEPHIR_INIT_VAR(&annotations); + array_init(&annotations); + ZEPHIR_INIT_VAR(&reflection); + object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionclass"))); + ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 87, &className); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&comment, reflection, "getdoccomment", NULL, 99); + ZEPHIR_CALL_METHOD(&comment, &reflection, "getdoccomment", NULL, 88); zephir_check_call_status(); - if (Z_TYPE_P(comment) == IS_STRING) { - ZEPHIR_INIT_VAR(classAnnotations); - ZEPHIR_CALL_METHOD(&_0$$3, reflection, "getfilename", NULL, 100); + if (Z_TYPE_P(&comment) == IS_STRING) { + ZEPHIR_INIT_VAR(&classAnnotations); + ZEPHIR_CALL_METHOD(&_0$$3, &reflection, "getfilename", NULL, 89); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, reflection, "getstartline", NULL, 101); + ZEPHIR_CALL_METHOD(&_1$$3, &reflection, "getstartline", NULL, 90); zephir_check_call_status(); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(classAnnotations, comment, _0$$3, _1$$3 TSRMLS_CC); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&classAnnotations, &comment, &_0$$3, &_1$$3 TSRMLS_CC); zephir_check_call_status(); - if (Z_TYPE_P(classAnnotations) == IS_ARRAY) { + if (Z_TYPE_P(&classAnnotations) == IS_ARRAY) { zephir_array_update_string(&annotations, SL("class"), &classAnnotations, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_METHOD(&properties, reflection, "getproperties", NULL, 102); + ZEPHIR_CALL_METHOD(&properties, &reflection, "getproperties", NULL, 91); zephir_check_call_status(); - if (zephir_fast_count_int(properties TSRMLS_CC)) { + if (zephir_fast_count_int(&properties TSRMLS_CC)) { line = 1; - ZEPHIR_INIT_VAR(annotationsProperties); - array_init(annotationsProperties); - zephir_is_iterable(properties, &_3$$5, &_2$$5, 0, 0, "phalcon/annotations/reader.zep", 96); - for ( - ; zend_hash_get_current_data_ex(_3$$5, (void**) &_4$$5, &_2$$5) == SUCCESS - ; zend_hash_move_forward_ex(_3$$5, &_2$$5) - ) { - ZEPHIR_GET_HVALUE(property, _4$$5); - ZEPHIR_CALL_METHOD(&comment, property, "getdoccomment", NULL, 0); + ZEPHIR_INIT_VAR(&annotationsProperties); + array_init(&annotationsProperties); + zephir_is_iterable(&properties, 0, "phalcon/annotations/reader.zep", 96); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&properties), _2$$5) + { + ZEPHIR_INIT_NVAR(&property); + ZVAL_COPY(&property, _2$$5); + ZEPHIR_CALL_METHOD(&comment, &property, "getdoccomment", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(comment) == IS_STRING) { - ZEPHIR_INIT_NVAR(propertyAnnotations); - ZEPHIR_CALL_METHOD(&_5$$7, reflection, "getfilename", NULL, 100); + if (Z_TYPE_P(&comment) == IS_STRING) { + ZEPHIR_INIT_NVAR(&propertyAnnotations); + ZEPHIR_CALL_METHOD(&_3$$7, &reflection, "getfilename", NULL, 89); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_6$$7); - ZVAL_LONG(_6$$7, line); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(propertyAnnotations, comment, _5$$7, _6$$7 TSRMLS_CC); + ZVAL_LONG(&_4$$7, line); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&propertyAnnotations, &comment, &_3$$7, &_4$$7 TSRMLS_CC); zephir_check_call_status(); - if (Z_TYPE_P(propertyAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(_7$$8); - zephir_read_property(&_7$$8, property, SL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsProperties, _7$$8, &propertyAnnotations, PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&propertyAnnotations) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&_5$$8); + zephir_read_property(&_5$$8, &property, SL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsProperties, &_5$$8, &propertyAnnotations, PH_COPY | PH_SEPARATE); } } - } - if (zephir_fast_count_int(annotationsProperties TSRMLS_CC)) { + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&property); + if (zephir_fast_count_int(&annotationsProperties TSRMLS_CC)) { zephir_array_update_string(&annotations, SL("properties"), &annotationsProperties, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_METHOD(&methods, reflection, "getmethods", NULL, 103); + ZEPHIR_CALL_METHOD(&methods, &reflection, "getmethods", NULL, 92); zephir_check_call_status(); - if (zephir_fast_count_int(methods TSRMLS_CC)) { - ZEPHIR_INIT_VAR(annotationsMethods); - array_init(annotationsMethods); - zephir_is_iterable(methods, &_9$$10, &_8$$10, 0, 0, "phalcon/annotations/reader.zep", 126); - for ( - ; zend_hash_get_current_data_ex(_9$$10, (void**) &_10$$10, &_8$$10) == SUCCESS - ; zend_hash_move_forward_ex(_9$$10, &_8$$10) - ) { - ZEPHIR_GET_HVALUE(method, _10$$10); - ZEPHIR_CALL_METHOD(&comment, method, "getdoccomment", NULL, 0); + if (zephir_fast_count_int(&methods TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&annotationsMethods); + array_init(&annotationsMethods); + zephir_is_iterable(&methods, 0, "phalcon/annotations/reader.zep", 126); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&methods), _6$$10) + { + ZEPHIR_INIT_NVAR(&method); + ZVAL_COPY(&method, _6$$10); + ZEPHIR_CALL_METHOD(&comment, &method, "getdoccomment", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(comment) == IS_STRING) { - ZEPHIR_INIT_NVAR(methodAnnotations); - ZEPHIR_CALL_METHOD(&_11$$12, method, "getfilename", NULL, 0); + if (Z_TYPE_P(&comment) == IS_STRING) { + ZEPHIR_INIT_NVAR(&methodAnnotations); + ZEPHIR_CALL_METHOD(&_7$$12, &method, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_12$$12, method, "getstartline", NULL, 0); + ZEPHIR_CALL_METHOD(&_8$$12, &method, "getstartline", NULL, 0); zephir_check_call_status(); - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(methodAnnotations, comment, _11$$12, _12$$12 TSRMLS_CC); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(&methodAnnotations, &comment, &_7$$12, &_8$$12 TSRMLS_CC); zephir_check_call_status(); - if (Z_TYPE_P(methodAnnotations) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(_13$$13); - zephir_read_property(&_13$$13, method, SL("name"), PH_NOISY_CC); - zephir_array_update_zval(&annotationsMethods, _13$$13, &methodAnnotations, PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&_9$$13); + zephir_read_property(&_9$$13, &method, SL("name"), PH_NOISY_CC); + zephir_array_update_zval(&annotationsMethods, &_9$$13, &methodAnnotations, PH_COPY | PH_SEPARATE); } } - } - if (zephir_fast_count_int(annotationsMethods TSRMLS_CC)) { + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&method); + if (zephir_fast_count_int(&annotationsMethods TSRMLS_CC)) { zephir_array_update_string(&annotations, SL("methods"), &annotationsMethods, PH_COPY | PH_SEPARATE); } } - RETURN_CCTOR(annotations); + RETURN_CCTOR(&annotations); } @@ -147,28 +167,36 @@ PHP_METHOD(Phalcon_Annotations_Reader, parse) { PHP_METHOD(Phalcon_Annotations_Reader, parseDocBlock) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *docBlock_param = NULL, *file = NULL, *line = NULL; - zval *docBlock = NULL; + zval *docBlock_param = NULL, *file = NULL, file_sub, *line = NULL, line_sub, __$null; + zval docBlock; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&docBlock); + ZVAL_UNDEF(&file_sub); + ZVAL_UNDEF(&line_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &docBlock_param, &file, &line); - zephir_get_strval(docBlock, docBlock_param); + zephir_get_strval(&docBlock, docBlock_param); if (!file) { - ZEPHIR_CPY_WRT(file, ZEPHIR_GLOBAL(global_null)); + file = &file_sub; + ZEPHIR_CPY_WRT(file, &__$null); } else { ZEPHIR_SEPARATE_PARAM(file); } if (!line) { - line = ZEPHIR_GLOBAL(global_null); + line = &line_sub; + line = &__$null; } if (Z_TYPE_P(file) != IS_STRING) { ZEPHIR_INIT_NVAR(file); - ZVAL_STRING(file, "eval code", 1); + ZVAL_STRING(file, "eval code"); } - ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(return_value, docBlock, file, line TSRMLS_CC); + ZEPHIR_LAST_CALL_STATUS = phannot_parse_annotations(return_value, &docBlock, file, line TSRMLS_CC); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/annotations/reader.zep.h b/ext/phalcon/annotations/reader.zep.h index e221fdffbfe..7376e92bf16 100644 --- a/ext/phalcon/annotations/reader.zep.h +++ b/ext/phalcon/annotations/reader.zep.h @@ -6,12 +6,28 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reader); PHP_METHOD(Phalcon_Annotations_Reader, parse); PHP_METHOD(Phalcon_Annotations_Reader, parseDocBlock); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reader_parse, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_reader_parse, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_reader_parse, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reader_parsedocblock, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_reader_parsedocblock, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_reader_parsedocblock, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, docBlock, IS_STRING, 0) +#else ZEND_ARG_INFO(0, docBlock) +#endif ZEND_ARG_INFO(0, file) ZEND_ARG_INFO(0, line) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/annotations/readerinterface.zep.h b/ext/phalcon/annotations/readerinterface.zep.h index 06cba76718b..5b936860024 100644 --- a/ext/phalcon/annotations/readerinterface.zep.h +++ b/ext/phalcon/annotations/readerinterface.zep.h @@ -3,12 +3,28 @@ extern zend_class_entry *phalcon_annotations_readerinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Annotations_ReaderInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_readerinterface_parse, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_readerinterface_parse, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_readerinterface_parse, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_readerinterface_parsedocblock, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_readerinterface_parsedocblock, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_readerinterface_parsedocblock, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, docBlock, IS_STRING, 0) +#else ZEND_ARG_INFO(0, docBlock) +#endif ZEND_ARG_INFO(0, file) ZEND_ARG_INFO(0, line) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/annotations/reflection.zep.c b/ext/phalcon/annotations/reflection.zep.c index 10e994a8334..b19ca6dfd72 100644 --- a/ext/phalcon/annotations/reflection.zep.c +++ b/ext/phalcon/annotations/reflection.zep.c @@ -61,17 +61,22 @@ ZEPHIR_INIT_CLASS(Phalcon_Annotations_Reflection) { */ PHP_METHOD(Phalcon_Annotations_Reflection, __construct) { - zval *reflectionData = NULL; + zval *reflectionData = NULL, reflectionData_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&reflectionData_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &reflectionData); if (!reflectionData) { - reflectionData = ZEPHIR_GLOBAL(global_null); + reflectionData = &reflectionData_sub; + reflectionData = &__$null; } if (Z_TYPE_P(reflectionData) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_reflectionData"), reflectionData TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_reflectionData"), reflectionData); } } @@ -81,30 +86,38 @@ PHP_METHOD(Phalcon_Annotations_Reflection, __construct) { */ PHP_METHOD(Phalcon_Annotations_Reflection, getClassAnnotations) { - zval *annotations = NULL, *reflectionClass = NULL, *collection = NULL, *_0$$3; + zval __$true, __$false, annotations, reflectionClass, collection, _0$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&reflectionClass); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); - annotations = zephir_fetch_nproperty_this(this_ptr, SL("_classAnnotations"), PH_NOISY_CC); - if (Z_TYPE_P(annotations) != IS_OBJECT) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_reflectionData"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&reflectionClass, _0$$3, SS("class"), 1 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(collection); - object_init_ex(collection, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, collection, "__construct", NULL, 17, reflectionClass); + zephir_read_property(&annotations, this_ptr, SL("_classAnnotations"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&annotations) != IS_OBJECT) { + zephir_read_property(&_0$$3, this_ptr, SL("_reflectionData"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&reflectionClass, &_0$$3, SL("class"), 1)) { + ZEPHIR_INIT_VAR(&collection); + object_init_ex(&collection, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 12, &reflectionClass); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_classAnnotations"), collection TSRMLS_CC); - RETURN_CCTOR(collection); + zephir_update_property_zval(this_ptr, SL("_classAnnotations"), &collection); + RETURN_CCTOR(&collection); } if (0) { - zephir_update_property_this(getThis(), SL("_classAnnotations"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_classAnnotations"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_classAnnotations"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_classAnnotations"), &__$false); } RETURN_MM_BOOL(0); } - RETURN_CTOR(annotations); + RETURN_CTOR(&annotations); } @@ -113,48 +126,65 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getClassAnnotations) { */ PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) { - HashTable *_2$$5; - HashPosition _1$$5; - zval *annotations = NULL, *reflectionMethods = NULL, *collections = NULL, *methodName = NULL, *reflectionMethod = NULL, *_0$$3, **_3$$5, *_4$$6 = NULL; + zend_string *_3$$5; + zend_ulong _2$$5; + zval __$true, __$false, annotations, reflectionMethods, collections, methodName, reflectionMethod, _0$$3, *_1$$5, _4$$6; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&reflectionMethods); + ZVAL_UNDEF(&collections); + ZVAL_UNDEF(&methodName); + ZVAL_UNDEF(&reflectionMethod); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(annotations); - zephir_read_property_this(&annotations, this_ptr, SL("_methodAnnotations"), PH_NOISY_CC); - if (Z_TYPE_P(annotations) != IS_OBJECT) { - ZEPHIR_OBS_VAR(reflectionMethods); - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_reflectionData"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&reflectionMethods, _0$$3, SS("methods"), 0 TSRMLS_CC)) { - if (zephir_fast_count_int(reflectionMethods TSRMLS_CC)) { - ZEPHIR_INIT_VAR(collections); - array_init(collections); - zephir_is_iterable(reflectionMethods, &_2$$5, &_1$$5, 0, 0, "phalcon/annotations/reflection.zep", 104); - for ( - ; zend_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS - ; zend_hash_move_forward_ex(_2$$5, &_1$$5) - ) { - ZEPHIR_GET_HMKEY(methodName, _2$$5, _1$$5); - ZEPHIR_GET_HVALUE(reflectionMethod, _3$$5); - ZEPHIR_INIT_NVAR(_4$$6); - object_init_ex(_4$$6, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, _4$$6, "__construct", &_5, 17, reflectionMethod); + ZEPHIR_OBS_VAR(&annotations); + zephir_read_property(&annotations, this_ptr, SL("_methodAnnotations"), PH_NOISY_CC); + if (Z_TYPE_P(&annotations) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&reflectionMethods); + zephir_read_property(&_0$$3, this_ptr, SL("_reflectionData"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&reflectionMethods, &_0$$3, SL("methods"), 0)) { + if (zephir_fast_count_int(&reflectionMethods TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&collections); + array_init(&collections); + zephir_is_iterable(&reflectionMethods, 0, "phalcon/annotations/reflection.zep", 104); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionMethods), _2$$5, _3$$5, _1$$5) + { + ZEPHIR_INIT_NVAR(&methodName); + if (_3$$5 != NULL) { + ZVAL_STR_COPY(&methodName, _3$$5); + } else { + ZVAL_LONG(&methodName, _2$$5); + } + ZEPHIR_INIT_NVAR(&reflectionMethod); + ZVAL_COPY(&reflectionMethod, _1$$5); + ZEPHIR_INIT_NVAR(&_4$$6); + object_init_ex(&_4$$6, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_4$$6, "__construct", &_5, 12, &reflectionMethod); zephir_check_call_status(); - zephir_array_update_zval(&collections, methodName, &_4$$6, PH_COPY | PH_SEPARATE); - } - zephir_update_property_this(getThis(), SL("_methodAnnotations"), collections TSRMLS_CC); - RETURN_CCTOR(collections); + zephir_array_update_zval(&collections, &methodName, &_4$$6, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&reflectionMethod); + ZEPHIR_INIT_NVAR(&methodName); + zephir_update_property_zval(this_ptr, SL("_methodAnnotations"), &collections); + RETURN_CCTOR(&collections); } } if (0) { - zephir_update_property_this(getThis(), SL("_methodAnnotations"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_methodAnnotations"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_methodAnnotations"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_methodAnnotations"), &__$false); } RETURN_MM_BOOL(0); } - RETURN_CCTOR(annotations); + RETURN_CCTOR(&annotations); } @@ -163,48 +193,65 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getMethodsAnnotations) { */ PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations) { - HashTable *_2$$5; - HashPosition _1$$5; - zval *annotations = NULL, *reflectionProperties = NULL, *collections = NULL, *property = NULL, *reflectionProperty = NULL, *_0$$3, **_3$$5, *_4$$6 = NULL; + zend_string *_3$$5; + zend_ulong _2$$5; + zval __$true, __$false, annotations, reflectionProperties, collections, property, reflectionProperty, _0$$3, *_1$$5, _4$$6; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&reflectionProperties); + ZVAL_UNDEF(&collections); + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&reflectionProperty); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(annotations); - zephir_read_property_this(&annotations, this_ptr, SL("_propertyAnnotations"), PH_NOISY_CC); - if (Z_TYPE_P(annotations) != IS_OBJECT) { - ZEPHIR_OBS_VAR(reflectionProperties); - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_reflectionData"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&reflectionProperties, _0$$3, SS("properties"), 0 TSRMLS_CC)) { - if (zephir_fast_count_int(reflectionProperties TSRMLS_CC)) { - ZEPHIR_INIT_VAR(collections); - array_init(collections); - zephir_is_iterable(reflectionProperties, &_2$$5, &_1$$5, 0, 0, "phalcon/annotations/reflection.zep", 131); - for ( - ; zend_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS - ; zend_hash_move_forward_ex(_2$$5, &_1$$5) - ) { - ZEPHIR_GET_HMKEY(property, _2$$5, _1$$5); - ZEPHIR_GET_HVALUE(reflectionProperty, _3$$5); - ZEPHIR_INIT_NVAR(_4$$6); - object_init_ex(_4$$6, phalcon_annotations_collection_ce); - ZEPHIR_CALL_METHOD(NULL, _4$$6, "__construct", &_5, 17, reflectionProperty); + ZEPHIR_OBS_VAR(&annotations); + zephir_read_property(&annotations, this_ptr, SL("_propertyAnnotations"), PH_NOISY_CC); + if (Z_TYPE_P(&annotations) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&reflectionProperties); + zephir_read_property(&_0$$3, this_ptr, SL("_reflectionData"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&reflectionProperties, &_0$$3, SL("properties"), 0)) { + if (zephir_fast_count_int(&reflectionProperties TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&collections); + array_init(&collections); + zephir_is_iterable(&reflectionProperties, 0, "phalcon/annotations/reflection.zep", 131); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&reflectionProperties), _2$$5, _3$$5, _1$$5) + { + ZEPHIR_INIT_NVAR(&property); + if (_3$$5 != NULL) { + ZVAL_STR_COPY(&property, _3$$5); + } else { + ZVAL_LONG(&property, _2$$5); + } + ZEPHIR_INIT_NVAR(&reflectionProperty); + ZVAL_COPY(&reflectionProperty, _1$$5); + ZEPHIR_INIT_NVAR(&_4$$6); + object_init_ex(&_4$$6, phalcon_annotations_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &_4$$6, "__construct", &_5, 12, &reflectionProperty); zephir_check_call_status(); - zephir_array_update_zval(&collections, property, &_4$$6, PH_COPY | PH_SEPARATE); - } - zephir_update_property_this(getThis(), SL("_propertyAnnotations"), collections TSRMLS_CC); - RETURN_CCTOR(collections); + zephir_array_update_zval(&collections, &property, &_4$$6, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&reflectionProperty); + ZEPHIR_INIT_NVAR(&property); + zephir_update_property_zval(this_ptr, SL("_propertyAnnotations"), &collections); + RETURN_CCTOR(&collections); } } if (0) { - zephir_update_property_this(getThis(), SL("_propertyAnnotations"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_propertyAnnotations"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_propertyAnnotations"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_propertyAnnotations"), &__$false); } RETURN_MM_BOOL(0); } - RETURN_CCTOR(annotations); + RETURN_CCTOR(&annotations); } @@ -215,7 +262,8 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getPropertiesAnnotations) { */ PHP_METHOD(Phalcon_Annotations_Reflection, getReflectionData) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_reflectionData"); @@ -229,7 +277,11 @@ PHP_METHOD(Phalcon_Annotations_Reflection, getReflectionData) { PHP_METHOD(Phalcon_Annotations_Reflection, __set_state) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, *reflectionData = NULL; + zval *data, data_sub, reflectionData; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&reflectionData); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); @@ -237,15 +289,15 @@ PHP_METHOD(Phalcon_Annotations_Reflection, __set_state) { if (Z_TYPE_P(data) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&reflectionData, data, SS("_reflectionData"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&reflectionData, data, SL("_reflectionData"), 1)) { object_init_ex(return_value, phalcon_annotations_reflection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 15, reflectionData); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 10, &reflectionData); zephir_check_call_status(); RETURN_MM(); } } object_init_ex(return_value, phalcon_annotations_reflection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 15); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 10); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/annotations/reflection.zep.h b/ext/phalcon/annotations/reflection.zep.h index b8e8d18898f..289c7b9a409 100644 --- a/ext/phalcon/annotations/reflection.zep.h +++ b/ext/phalcon/annotations/reflection.zep.h @@ -14,7 +14,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection___construct, 0, 0, ZEND_ARG_INFO(0, reflectionData) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_annotations_reflection___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_annotations_reflection___set_state, 0, 1, Phalcon\\Annotations\\Reflection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_annotations_reflection___set_state, 0, 1, IS_OBJECT, "Phalcon\\Annotations\\Reflection", 0) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/application.zep.c b/ext/phalcon/application.zep.c index 4320bce5932..9c30d421480 100644 --- a/ext/phalcon/application.zep.c +++ b/ext/phalcon/application.zep.c @@ -57,17 +57,22 @@ ZEPHIR_INIT_CLASS(Phalcon_Application) { */ PHP_METHOD(Phalcon_Application, __construct) { - zval *dependencyInjector = NULL; + zval *dependencyInjector = NULL, dependencyInjector_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &dependencyInjector); if (!dependencyInjector) { - dependencyInjector = ZEPHIR_GLOBAL(global_null); + dependencyInjector = &dependencyInjector_sub; + dependencyInjector = &__$null; } if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } } @@ -77,13 +82,16 @@ PHP_METHOD(Phalcon_Application, __construct) { */ PHP_METHOD(Phalcon_Application, setEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); RETURN_THISW(); } @@ -93,7 +101,8 @@ PHP_METHOD(Phalcon_Application, setEventsManager) { */ PHP_METHOD(Phalcon_Application, getEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -120,13 +129,18 @@ PHP_METHOD(Phalcon_Application, getEventsManager) { PHP_METHOD(Phalcon_Application, registerModules) { zend_bool merge; - zval *modules_param = NULL, *merge_param = NULL, *_0$$3, *_1$$3; - zval *modules = NULL; + zval *modules_param = NULL, *merge_param = NULL, _0$$3, _1$$3; + zval modules; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modules); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &modules_param, &merge_param); - zephir_get_arrval(modules, modules_param); + zephir_get_arrval(&modules, modules_param); if (!merge_param) { merge = 0; } else { @@ -135,12 +149,12 @@ PHP_METHOD(Phalcon_Application, registerModules) { if (merge) { - ZEPHIR_INIT_VAR(_0$$3); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_modules"), PH_NOISY_CC); - zephir_fast_array_merge(_0$$3, &(_1$$3), &(modules) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_modules"), _0$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_read_property(&_1$$3, this_ptr, SL("_modules"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_0$$3, &_1$$3, &modules TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modules"), &_0$$3); } else { - zephir_update_property_this(getThis(), SL("_modules"), modules TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modules"), &modules); } RETURN_THIS(); @@ -151,7 +165,8 @@ PHP_METHOD(Phalcon_Application, registerModules) { */ PHP_METHOD(Phalcon_Application, getModules) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_modules"); @@ -163,38 +178,45 @@ PHP_METHOD(Phalcon_Application, getModules) { PHP_METHOD(Phalcon_Application, getModule) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *module = NULL, *_0, *_1$$3; - zval *name = NULL, *_2$$3; + zval *name_param = NULL, module, _0, _1$$3; + zval name, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&module); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(module); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modules"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&module, _0, name, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_application_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SVS(_2$$3, "Module '", name, "' isn't registered in the application container"); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _2$$3); + ZEPHIR_OBS_VAR(&module); + zephir_read_property(&_0, this_ptr, SL("_modules"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&module, &_0, &name, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_application_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SVS(&_2$$3, "Module '", &name, "' isn't registered in the application container"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/application.zep", 123 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/application.zep", 123 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - RETURN_CCTOR(module); + RETURN_CCTOR(&module); } @@ -204,24 +226,27 @@ PHP_METHOD(Phalcon_Application, getModule) { PHP_METHOD(Phalcon_Application, setDefaultModule) { zval *defaultModule_param = NULL; - zval *defaultModule = NULL; + zval defaultModule; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&defaultModule); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &defaultModule_param); if (UNEXPECTED(Z_TYPE_P(defaultModule_param) != IS_STRING && Z_TYPE_P(defaultModule_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'defaultModule' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'defaultModule' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(defaultModule_param) == IS_STRING)) { - zephir_get_strval(defaultModule, defaultModule_param); + zephir_get_strval(&defaultModule, defaultModule_param); } else { - ZEPHIR_INIT_VAR(defaultModule); - ZVAL_EMPTY_STRING(defaultModule); + ZEPHIR_INIT_VAR(&defaultModule); + ZVAL_EMPTY_STRING(&defaultModule); } - zephir_update_property_this(getThis(), SL("_defaultModule"), defaultModule TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultModule"), &defaultModule); RETURN_THIS(); } @@ -231,7 +256,8 @@ PHP_METHOD(Phalcon_Application, setDefaultModule) { */ PHP_METHOD(Phalcon_Application, getDefaultModule) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_defaultModule"); @@ -244,34 +270,25 @@ PHP_METHOD(Phalcon_Application, handle) { } -zend_object_value zephir_init_properties_Phalcon_Application(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Application(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modules"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_modules"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_modules"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_modules"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/application.zep.h b/ext/phalcon/application.zep.h index 37ca3681bfa..ec3db2ddd95 100644 --- a/ext/phalcon/application.zep.h +++ b/ext/phalcon/application.zep.h @@ -12,38 +12,83 @@ PHP_METHOD(Phalcon_Application, getModule); PHP_METHOD(Phalcon_Application, setDefaultModule); PHP_METHOD(Phalcon_Application, getDefaultModule); PHP_METHOD(Phalcon_Application, handle); -zend_object_value zephir_init_properties_Phalcon_Application(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Application(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_application___construct, 0, 0, 0) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_application_seteventsmanager, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_application_seteventsmanager, 0, 1, Phalcon\\Application, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_seteventsmanager, 0, 1, IS_OBJECT, "Phalcon\\Application", 0) +#endif ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_application_registermodules, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_application_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_application_registermodules, 0, 1, Phalcon\\Application, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_registermodules, 0, 1, IS_OBJECT, "Phalcon\\Application", 0) +#endif ZEND_ARG_ARRAY_INFO(0, modules, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_getmodules, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_getmodules, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_application_getmodule, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_application_setdefaultmodule, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_application_setdefaultmodule, 0, 1, Phalcon\\Application, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_setdefaultmodule, 0, 1, IS_OBJECT, "Phalcon\\Application", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultModule, IS_STRING, 0) +#else ZEND_ARG_INFO(0, defaultModule) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_getdefaultmodule, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_application_getdefaultmodule, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_application_method_entry) { PHP_ME(Phalcon_Application, __construct, arginfo_phalcon_application___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Application, setEventsManager, arginfo_phalcon_application_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, getEventsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Application, getEventsManager, arginfo_phalcon_application_geteventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Application, registerModules, arginfo_phalcon_application_registermodules, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, getModules, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Application, getModules, arginfo_phalcon_application_getmodules, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Application, getModule, arginfo_phalcon_application_getmodule, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Application, setDefaultModule, arginfo_phalcon_application_setdefaultmodule, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Application, getDefaultModule, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Application, getDefaultModule, arginfo_phalcon_application_getdefaultmodule, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Application, handle, NULL, ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/assets/collection.zep.c b/ext/phalcon/assets/collection.zep.c index 27a90514375..9227ebbcc70 100644 --- a/ext/phalcon/assets/collection.zep.c +++ b/ext/phalcon/assets/collection.zep.c @@ -69,7 +69,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Collection) { PHP_METHOD(Phalcon_Assets_Collection, getPrefix) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_prefix"); @@ -77,7 +78,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getPrefix) { PHP_METHOD(Phalcon_Assets_Collection, getLocal) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_local"); @@ -85,7 +87,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getLocal) { PHP_METHOD(Phalcon_Assets_Collection, getResources) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_resources"); @@ -93,7 +96,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getResources) { PHP_METHOD(Phalcon_Assets_Collection, getCodes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_codes"); @@ -101,7 +105,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getCodes) { PHP_METHOD(Phalcon_Assets_Collection, getPosition) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_position"); @@ -109,7 +114,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getPosition) { PHP_METHOD(Phalcon_Assets_Collection, getFilters) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_filters"); @@ -117,7 +123,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getFilters) { PHP_METHOD(Phalcon_Assets_Collection, getAttributes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_attributes"); @@ -125,7 +132,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getAttributes) { PHP_METHOD(Phalcon_Assets_Collection, getJoin) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_join"); @@ -133,7 +141,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getJoin) { PHP_METHOD(Phalcon_Assets_Collection, getTargetUri) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_targetUri"); @@ -141,7 +150,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getTargetUri) { PHP_METHOD(Phalcon_Assets_Collection, getTargetPath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_targetPath"); @@ -149,7 +159,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getTargetPath) { PHP_METHOD(Phalcon_Assets_Collection, getTargetLocal) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_targetLocal"); @@ -157,7 +168,8 @@ PHP_METHOD(Phalcon_Assets_Collection, getTargetLocal) { PHP_METHOD(Phalcon_Assets_Collection, getSourcePath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sourcePath"); @@ -168,13 +180,16 @@ PHP_METHOD(Phalcon_Assets_Collection, getSourcePath) { */ PHP_METHOD(Phalcon_Assets_Collection, __construct) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_includedResources"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_includedResources"), &_0); ZEPHIR_MM_RESTORE(); } @@ -185,14 +200,17 @@ PHP_METHOD(Phalcon_Assets_Collection, __construct) { PHP_METHOD(Phalcon_Assets_Collection, add) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *resource; + zval *resource, resource_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resource_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &resource); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresource", NULL, 104, resource); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresource", NULL, 93, resource); zephir_check_call_status(); RETURN_THIS(); @@ -204,14 +222,17 @@ PHP_METHOD(Phalcon_Assets_Collection, add) { PHP_METHOD(Phalcon_Assets_Collection, addInline) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *code; + zval *code, code_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&code_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &code); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresource", NULL, 104, code); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresource", NULL, 93, code); zephir_check_call_status(); RETURN_THIS(); @@ -233,7 +254,12 @@ PHP_METHOD(Phalcon_Assets_Collection, addInline) { PHP_METHOD(Phalcon_Assets_Collection, has) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *resource, *key = NULL, *resources = NULL; + zval *resource, resource_sub, key, resources; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resource_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&resources); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &resource); @@ -242,9 +268,9 @@ PHP_METHOD(Phalcon_Assets_Collection, has) { ZEPHIR_CALL_METHOD(&key, resource, "getresourcekey", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(resources); - zephir_read_property_this(&resources, this_ptr, SL("_includedResources"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_fast_in_array(key, resources TSRMLS_CC)); + ZEPHIR_OBS_VAR(&resources); + zephir_read_property(&resources, this_ptr, SL("_includedResources"), PH_NOISY_CC); + RETURN_MM_BOOL(zephir_fast_in_array(&key, &resources TSRMLS_CC)); } @@ -255,24 +281,35 @@ PHP_METHOD(Phalcon_Assets_Collection, addCss) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool filter; - zval *path_param = NULL, *local = NULL, *filter_param = NULL, *attributes = NULL, *collectionLocal = NULL, *collectionAttributes = NULL, *_0, *_1; - zval *path = NULL; + zval *path_param = NULL, *local = NULL, local_sub, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, collectionLocal, collectionAttributes, _0, _1; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&local_sub); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&collectionLocal); + ZVAL_UNDEF(&collectionAttributes); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &path_param, &local, &filter_param, &attributes); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } if (!local) { - local = ZEPHIR_GLOBAL(global_null); + local = &local_sub; + local = &__$null; } if (!filter_param) { filter = 1; @@ -280,33 +317,33 @@ PHP_METHOD(Phalcon_Assets_Collection, addCss) { filter = zephir_get_boolval(filter_param); } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - if (Z_TYPE_P(local) == IS_BOOL) { - ZEPHIR_CPY_WRT(collectionLocal, local); + if (((Z_TYPE_P(local) == IS_TRUE || Z_TYPE_P(local) == IS_FALSE) == 1)) { + ZEPHIR_CPY_WRT(&collectionLocal, local); } else { - ZEPHIR_OBS_NVAR(collectionLocal); - zephir_read_property_this(&collectionLocal, this_ptr, SL("_local"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&collectionLocal); + zephir_read_property(&collectionLocal, this_ptr, SL("_local"), PH_NOISY_CC); } if (Z_TYPE_P(attributes) == IS_ARRAY) { - ZEPHIR_CPY_WRT(collectionAttributes, attributes); + ZEPHIR_CPY_WRT(&collectionAttributes, attributes); } else { - ZEPHIR_OBS_NVAR(collectionAttributes); - zephir_read_property_this(&collectionAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&collectionAttributes); + zephir_read_property(&collectionAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_assets_resource_css_ce); - ZEPHIR_INIT_VAR(_1); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_assets_resource_css_ce); if (filter) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 105, path, collectionLocal, _1, collectionAttributes); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 94, &path, &collectionLocal, &_1, &collectionAttributes); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "add", NULL, 0, _0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "add", NULL, 0, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -319,40 +356,48 @@ PHP_METHOD(Phalcon_Assets_Collection, addInlineCss) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool filter; - zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, *collectionAttributes = NULL, *_0, *_1; - zval *content = NULL; + zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, collectionAttributes, _0, _1; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&collectionAttributes); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &content_param, &filter_param, &attributes); - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); if (!filter_param) { filter = 1; } else { filter = zephir_get_boolval(filter_param); } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } if (Z_TYPE_P(attributes) == IS_ARRAY) { - ZEPHIR_CPY_WRT(collectionAttributes, attributes); + ZEPHIR_CPY_WRT(&collectionAttributes, attributes); } else { - ZEPHIR_OBS_NVAR(collectionAttributes); - zephir_read_property_this(&collectionAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&collectionAttributes); + zephir_read_property(&collectionAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_assets_inline_css_ce); - ZEPHIR_INIT_VAR(_1); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_assets_inline_css_ce); if (filter) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 106, content, _1, collectionAttributes); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 95, &content, &_1, &collectionAttributes); zephir_check_call_status(); - zephir_update_property_array_append(this_ptr, SL("_codes"), _0 TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_codes"), &_0 TSRMLS_CC); RETURN_THIS(); } @@ -370,24 +415,35 @@ PHP_METHOD(Phalcon_Assets_Collection, addJs) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool filter; - zval *path_param = NULL, *local = NULL, *filter_param = NULL, *attributes = NULL, *collectionLocal = NULL, *collectionAttributes = NULL, *_0, *_1; - zval *path = NULL; + zval *path_param = NULL, *local = NULL, local_sub, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, collectionLocal, collectionAttributes, _0, _1; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&local_sub); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&collectionLocal); + ZVAL_UNDEF(&collectionAttributes); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &path_param, &local, &filter_param, &attributes); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } if (!local) { - local = ZEPHIR_GLOBAL(global_null); + local = &local_sub; + local = &__$null; } if (!filter_param) { filter = 1; @@ -395,33 +451,33 @@ PHP_METHOD(Phalcon_Assets_Collection, addJs) { filter = zephir_get_boolval(filter_param); } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - if (Z_TYPE_P(local) == IS_BOOL) { - ZEPHIR_CPY_WRT(collectionLocal, local); + if (((Z_TYPE_P(local) == IS_TRUE || Z_TYPE_P(local) == IS_FALSE) == 1)) { + ZEPHIR_CPY_WRT(&collectionLocal, local); } else { - ZEPHIR_OBS_NVAR(collectionLocal); - zephir_read_property_this(&collectionLocal, this_ptr, SL("_local"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&collectionLocal); + zephir_read_property(&collectionLocal, this_ptr, SL("_local"), PH_NOISY_CC); } if (Z_TYPE_P(attributes) == IS_ARRAY) { - ZEPHIR_CPY_WRT(collectionAttributes, attributes); + ZEPHIR_CPY_WRT(&collectionAttributes, attributes); } else { - ZEPHIR_OBS_NVAR(collectionAttributes); - zephir_read_property_this(&collectionAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&collectionAttributes); + zephir_read_property(&collectionAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_assets_resource_js_ce); - ZEPHIR_INIT_VAR(_1); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_assets_resource_js_ce); if (filter) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 107, path, collectionLocal, _1, collectionAttributes); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 96, &path, &collectionLocal, &_1, &collectionAttributes); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "add", NULL, 0, _0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "add", NULL, 0, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -434,40 +490,48 @@ PHP_METHOD(Phalcon_Assets_Collection, addInlineJs) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool filter; - zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, *collectionAttributes = NULL, *_0, *_1; - zval *content = NULL; + zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, collectionAttributes, _0, _1; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&collectionAttributes); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &content_param, &filter_param, &attributes); - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); if (!filter_param) { filter = 1; } else { filter = zephir_get_boolval(filter_param); } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } if (Z_TYPE_P(attributes) == IS_ARRAY) { - ZEPHIR_CPY_WRT(collectionAttributes, attributes); + ZEPHIR_CPY_WRT(&collectionAttributes, attributes); } else { - ZEPHIR_OBS_NVAR(collectionAttributes); - zephir_read_property_this(&collectionAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&collectionAttributes); + zephir_read_property(&collectionAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_assets_inline_js_ce); - ZEPHIR_INIT_VAR(_1); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_assets_inline_js_ce); if (filter) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 108, content, _1, collectionAttributes); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 97, &content, &_1, &collectionAttributes); zephir_check_call_status(); - zephir_update_property_array_append(this_ptr, SL("_codes"), _0 TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_codes"), &_0 TSRMLS_CC); RETURN_THIS(); } @@ -477,11 +541,14 @@ PHP_METHOD(Phalcon_Assets_Collection, addInlineJs) { */ PHP_METHOD(Phalcon_Assets_Collection, count) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_resources"), PH_NOISY_CC); - RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC)); + + zephir_read_property(&_0, this_ptr, SL("_resources"), PH_NOISY_CC | PH_READONLY); + RETURN_LONG(zephir_fast_count_int(&_0 TSRMLS_CC)); } @@ -490,12 +557,15 @@ PHP_METHOD(Phalcon_Assets_Collection, count) { */ PHP_METHOD(Phalcon_Assets_Collection, rewind) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_position"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_position"), &_0); } @@ -504,15 +574,20 @@ PHP_METHOD(Phalcon_Assets_Collection, rewind) { */ PHP_METHOD(Phalcon_Assets_Collection, current) { - zval *_0, *_1, *_2; + zval _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_resources"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(_2); - zephir_read_property_this(&_2, this_ptr, SL("_position"), PH_NOISY_CC); - zephir_array_fetch(&_1, _0, _2, PH_NOISY | PH_READONLY, "phalcon/assets/collection.zep", 225 TSRMLS_CC); - RETURN_CTOR(_1); + zephir_read_property(&_0, this_ptr, SL("_resources"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_OBS_VAR(&_2); + zephir_read_property(&_2, this_ptr, SL("_position"), PH_NOISY_CC); + zephir_array_fetch(&_1, &_0, &_2, PH_NOISY | PH_READONLY, "phalcon/assets/collection.zep", 225 TSRMLS_CC); + RETURN_CTOR(&_1); } @@ -523,7 +598,8 @@ PHP_METHOD(Phalcon_Assets_Collection, current) { */ PHP_METHOD(Phalcon_Assets_Collection, key) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_position"); @@ -534,7 +610,8 @@ PHP_METHOD(Phalcon_Assets_Collection, key) { */ PHP_METHOD(Phalcon_Assets_Collection, next) { - + zval *this_ptr = getThis(); + RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_position") TSRMLS_CC)); @@ -545,12 +622,16 @@ PHP_METHOD(Phalcon_Assets_Collection, next) { */ PHP_METHOD(Phalcon_Assets_Collection, valid) { - zval *_0, *_1; + zval _0, _1; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_resources"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_position"), PH_NOISY_CC); - RETURN_BOOL(zephir_array_isset(_0, _1)); + + zephir_read_property(&_0, this_ptr, SL("_resources"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_position"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_array_isset(&_0, &_1)); } @@ -560,24 +641,27 @@ PHP_METHOD(Phalcon_Assets_Collection, valid) { PHP_METHOD(Phalcon_Assets_Collection, setTargetPath) { zval *targetPath_param = NULL; - zval *targetPath = NULL; + zval targetPath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&targetPath); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &targetPath_param); if (UNEXPECTED(Z_TYPE_P(targetPath_param) != IS_STRING && Z_TYPE_P(targetPath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'targetPath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'targetPath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(targetPath_param) == IS_STRING)) { - zephir_get_strval(targetPath, targetPath_param); + zephir_get_strval(&targetPath, targetPath_param); } else { - ZEPHIR_INIT_VAR(targetPath); - ZVAL_EMPTY_STRING(targetPath); + ZEPHIR_INIT_VAR(&targetPath); + ZVAL_EMPTY_STRING(&targetPath); } - zephir_update_property_this(getThis(), SL("_targetPath"), targetPath TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_targetPath"), &targetPath); RETURN_THIS(); } @@ -588,24 +672,27 @@ PHP_METHOD(Phalcon_Assets_Collection, setTargetPath) { PHP_METHOD(Phalcon_Assets_Collection, setSourcePath) { zval *sourcePath_param = NULL; - zval *sourcePath = NULL; + zval sourcePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sourcePath); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sourcePath_param); if (UNEXPECTED(Z_TYPE_P(sourcePath_param) != IS_STRING && Z_TYPE_P(sourcePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sourcePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sourcePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sourcePath_param) == IS_STRING)) { - zephir_get_strval(sourcePath, sourcePath_param); + zephir_get_strval(&sourcePath, sourcePath_param); } else { - ZEPHIR_INIT_VAR(sourcePath); - ZVAL_EMPTY_STRING(sourcePath); + ZEPHIR_INIT_VAR(&sourcePath); + ZVAL_EMPTY_STRING(&sourcePath); } - zephir_update_property_this(getThis(), SL("_sourcePath"), sourcePath TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sourcePath"), &sourcePath); RETURN_THIS(); } @@ -616,24 +703,27 @@ PHP_METHOD(Phalcon_Assets_Collection, setSourcePath) { PHP_METHOD(Phalcon_Assets_Collection, setTargetUri) { zval *targetUri_param = NULL; - zval *targetUri = NULL; + zval targetUri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&targetUri); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &targetUri_param); if (UNEXPECTED(Z_TYPE_P(targetUri_param) != IS_STRING && Z_TYPE_P(targetUri_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'targetUri' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'targetUri' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(targetUri_param) == IS_STRING)) { - zephir_get_strval(targetUri, targetUri_param); + zephir_get_strval(&targetUri, targetUri_param); } else { - ZEPHIR_INIT_VAR(targetUri); - ZVAL_EMPTY_STRING(targetUri); + ZEPHIR_INIT_VAR(&targetUri); + ZVAL_EMPTY_STRING(&targetUri); } - zephir_update_property_this(getThis(), SL("_targetUri"), targetUri TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_targetUri"), &targetUri); RETURN_THIS(); } @@ -644,24 +734,27 @@ PHP_METHOD(Phalcon_Assets_Collection, setTargetUri) { PHP_METHOD(Phalcon_Assets_Collection, setPrefix) { zval *prefix_param = NULL; - zval *prefix = NULL; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &prefix_param); if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } else { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_EMPTY_STRING(&prefix); } - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); RETURN_THIS(); } @@ -671,22 +764,26 @@ PHP_METHOD(Phalcon_Assets_Collection, setPrefix) { */ PHP_METHOD(Phalcon_Assets_Collection, setLocal) { - zval *local_param = NULL; + zval *local_param = NULL, __$true, __$false; zend_bool local; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &local_param); - if (UNEXPECTED(Z_TYPE_P(local_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'local' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(local_param) != IS_TRUE && Z_TYPE_P(local_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'local' must be of the type bool") TSRMLS_CC); RETURN_NULL(); } - local = Z_BVAL_P(local_param); + local = (Z_TYPE_P(local_param) == IS_TRUE); if (local) { - zephir_update_property_this(getThis(), SL("_local"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_local"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_local"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_local"), &__$false); } RETURN_THISW(); @@ -698,15 +795,19 @@ PHP_METHOD(Phalcon_Assets_Collection, setLocal) { PHP_METHOD(Phalcon_Assets_Collection, setAttributes) { zval *attributes_param = NULL; - zval *attributes = NULL; + zval attributes; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &attributes_param); + ZVAL_UNDEF(&attributes); - attributes = attributes_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &attributes_param); + ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param); - zephir_update_property_this(getThis(), SL("_attributes"), attributes TSRMLS_CC); - RETURN_THISW(); + + zephir_update_property_zval(this_ptr, SL("_attributes"), &attributes); + RETURN_THIS(); } @@ -716,15 +817,19 @@ PHP_METHOD(Phalcon_Assets_Collection, setAttributes) { PHP_METHOD(Phalcon_Assets_Collection, setFilters) { zval *filters_param = NULL; - zval *filters = NULL; + zval filters; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &filters_param); + ZVAL_UNDEF(&filters); - filters = filters_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &filters_param); + ZEPHIR_OBS_COPY_OR_DUP(&filters, filters_param); - zephir_update_property_this(getThis(), SL("_filters"), filters TSRMLS_CC); - RETURN_THISW(); + + zephir_update_property_zval(this_ptr, SL("_filters"), &filters); + RETURN_THIS(); } @@ -733,22 +838,26 @@ PHP_METHOD(Phalcon_Assets_Collection, setFilters) { */ PHP_METHOD(Phalcon_Assets_Collection, setTargetLocal) { - zval *targetLocal_param = NULL; + zval *targetLocal_param = NULL, __$true, __$false; zend_bool targetLocal; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &targetLocal_param); - if (UNEXPECTED(Z_TYPE_P(targetLocal_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'targetLocal' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(targetLocal_param) != IS_TRUE && Z_TYPE_P(targetLocal_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'targetLocal' must be of the type bool") TSRMLS_CC); RETURN_NULL(); } - targetLocal = Z_BVAL_P(targetLocal_param); + targetLocal = (Z_TYPE_P(targetLocal_param) == IS_TRUE); if (targetLocal) { - zephir_update_property_this(getThis(), SL("_targetLocal"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_targetLocal"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_targetLocal"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_targetLocal"), &__$false); } RETURN_THISW(); @@ -759,8 +868,12 @@ PHP_METHOD(Phalcon_Assets_Collection, setTargetLocal) { */ PHP_METHOD(Phalcon_Assets_Collection, join) { - zval *join_param = NULL; + zval *join_param = NULL, __$true, __$false; zend_bool join; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &join_param); @@ -768,9 +881,9 @@ PHP_METHOD(Phalcon_Assets_Collection, join) { if (join) { - zephir_update_property_this(getThis(), SL("_join"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_join"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_join"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_join"), &__$false); } RETURN_THISW(); @@ -782,34 +895,39 @@ PHP_METHOD(Phalcon_Assets_Collection, join) { PHP_METHOD(Phalcon_Assets_Collection, getRealTargetPath) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *basePath_param = NULL, *targetPath = NULL, *completePath = NULL; - zval *basePath = NULL; + zval *basePath_param = NULL, targetPath, completePath; + zval basePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&basePath); + ZVAL_UNDEF(&targetPath); + ZVAL_UNDEF(&completePath); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &basePath_param); if (UNEXPECTED(Z_TYPE_P(basePath_param) != IS_STRING && Z_TYPE_P(basePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'basePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'basePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(basePath_param) == IS_STRING)) { - zephir_get_strval(basePath, basePath_param); + zephir_get_strval(&basePath, basePath_param); } else { - ZEPHIR_INIT_VAR(basePath); - ZVAL_EMPTY_STRING(basePath); + ZEPHIR_INIT_VAR(&basePath); + ZVAL_EMPTY_STRING(&basePath); } - ZEPHIR_OBS_VAR(targetPath); - zephir_read_property_this(&targetPath, this_ptr, SL("_targetPath"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(completePath); - ZEPHIR_CONCAT_VV(completePath, basePath, targetPath); - if ((zephir_file_exists(completePath TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 67, completePath); + ZEPHIR_OBS_VAR(&targetPath); + zephir_read_property(&targetPath, this_ptr, SL("_targetPath"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&completePath); + ZEPHIR_CONCAT_VV(&completePath, &basePath, &targetPath); + if ((zephir_file_exists(&completePath TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 60, &completePath); zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(completePath); + RETURN_CCTOR(&completePath); } @@ -818,7 +936,10 @@ PHP_METHOD(Phalcon_Assets_Collection, getRealTargetPath) { */ PHP_METHOD(Phalcon_Assets_Collection, addFilter) { - zval *filter; + zval *filter, filter_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filter_sub); zephir_fetch_params(0, 1, 0, &filter); @@ -835,7 +956,12 @@ PHP_METHOD(Phalcon_Assets_Collection, addFilter) { PHP_METHOD(Phalcon_Assets_Collection, addResource) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *resource, *_0 = NULL, *_1$$3 = NULL; + zval *resource, resource_sub, _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resource_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &resource); @@ -844,7 +970,7 @@ PHP_METHOD(Phalcon_Assets_Collection, addResource) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, resource); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { if (zephir_instance_of_ev(resource, phalcon_assets_resource_ce TSRMLS_CC)) { zephir_update_property_array_append(this_ptr, SL("_resources"), resource TSRMLS_CC); } else { @@ -852,59 +978,56 @@ PHP_METHOD(Phalcon_Assets_Collection, addResource) { } ZEPHIR_CALL_METHOD(&_1$$3, resource, "getresourcekey", NULL, 0); zephir_check_call_status(); - zephir_update_property_array_append(this_ptr, SL("_includedResources"), _1$$3 TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_includedResources"), &_1$$3 TSRMLS_CC); RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); } -zend_object_value zephir_init_properties_Phalcon_Assets_Collection(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Assets_Collection(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_2, *_4, *_6, *_1$$3, *_3$$4, *_5$$5, *_7$$6; + zval _0, _2, _4, _6, _1$$3, _3$$4, _5$$5, _7$$6; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$6); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_attributes"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_attributes"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_attributes"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_attributes"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_filters"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("_filters"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_filters"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("_filters"), &_3$$4); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_codes"), PH_NOISY_CC); - if (Z_TYPE_P(_4) == IS_NULL) { - ZEPHIR_INIT_VAR(_5$$5); - array_init(_5$$5); - zephir_update_property_this(getThis(), SL("_codes"), _5$$5 TSRMLS_CC); + zephir_read_property(&_4, this_ptr, SL("_codes"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_4) == IS_NULL) { + ZEPHIR_INIT_VAR(&_5$$5); + array_init(&_5$$5); + zephir_update_property_zval(this_ptr, SL("_codes"), &_5$$5); } - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_resources"), PH_NOISY_CC); - if (Z_TYPE_P(_6) == IS_NULL) { - ZEPHIR_INIT_VAR(_7$$6); - array_init(_7$$6); - zephir_update_property_this(getThis(), SL("_resources"), _7$$6 TSRMLS_CC); + zephir_read_property(&_6, this_ptr, SL("_resources"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_6) == IS_NULL) { + ZEPHIR_INIT_VAR(&_7$$6); + array_init(&_7$$6); + zephir_update_property_zval(this_ptr, SL("_resources"), &_7$$6); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/assets/collection.zep.h b/ext/phalcon/assets/collection.zep.h index e51b1bbc9f5..989a8dc8e79 100644 --- a/ext/phalcon/assets/collection.zep.h +++ b/ext/phalcon/assets/collection.zep.h @@ -41,91 +41,252 @@ PHP_METHOD(Phalcon_Assets_Collection, join); PHP_METHOD(Phalcon_Assets_Collection, getRealTargetPath); PHP_METHOD(Phalcon_Assets_Collection, addFilter); PHP_METHOD(Phalcon_Assets_Collection, addResource); -zend_object_value zephir_init_properties_Phalcon_Assets_Collection(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Assets_Collection(zend_class_entry *class_type TSRMLS_DC); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_add, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_add, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_add, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif ZEND_ARG_OBJ_INFO(0, resource, Phalcon\\Assets\\Resource, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_addinline, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_addinline, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_addinline, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif ZEND_ARG_OBJ_INFO(0, code, Phalcon\\Assets\\Inline, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_has, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, resource, Phalcon\\Assets\\ResourceInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_addcss, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_addcss, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_addcss, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, local) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_addinlinecss, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_addinlinecss, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_addinlinecss, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_addjs, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_addjs, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_addjs, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, local) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_addinlinejs, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_addinlinejs, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_addinlinejs, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_settargetpath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_count, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_current, 0, 0, Phalcon\\Assets\\Resource, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_current, 0, 0, IS_OBJECT, "Phalcon\\Assets\\Resource", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_valid, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_valid, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_settargetpath, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_settargetpath, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, targetPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, targetPath) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_setsourcepath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_setsourcepath, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_setsourcepath, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sourcePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sourcePath) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_settargeturi, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_settargeturi, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_settargeturi, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, targetUri, IS_STRING, 0) +#else ZEND_ARG_INFO(0, targetUri) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_setprefix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_setprefix, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_setprefix, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_setlocal, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_setlocal, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_setlocal, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, local, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, local) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_setattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_setattributes, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_setattributes, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_setfilters, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_setfilters, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_setfilters, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif ZEND_ARG_ARRAY_INFO(0, filters, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_settargetlocal, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_settargetlocal, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_settargetlocal, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, targetLocal, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, targetLocal) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_join, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_join, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_join, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, join, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, join) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_getrealtargetpath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_getrealtargetpath, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_getrealtargetpath, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, basePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, basePath) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_addfilter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_collection_addfilter, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_addfilter, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif ZEND_ARG_OBJ_INFO(0, filter, Phalcon\\Assets\\FilterInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_collection_addresource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_addresource, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_collection_addresource, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, resource, Phalcon\\Assets\\ResourceInterface, 0) ZEND_END_ARG_INFO() @@ -150,12 +311,12 @@ ZEPHIR_INIT_FUNCS(phalcon_assets_collection_method_entry) { PHP_ME(Phalcon_Assets_Collection, addInlineCss, arginfo_phalcon_assets_collection_addinlinecss, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, addJs, arginfo_phalcon_assets_collection_addjs, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, addInlineJs, arginfo_phalcon_assets_collection_addinlinejs, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Collection, count, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Collection, count, arginfo_phalcon_assets_collection_count, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, rewind, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Collection, current, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Collection, current, arginfo_phalcon_assets_collection_current, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, key, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, next, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Collection, valid, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Collection, valid, arginfo_phalcon_assets_collection_valid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, setTargetPath, arginfo_phalcon_assets_collection_settargetpath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, setSourcePath, arginfo_phalcon_assets_collection_setsourcepath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Collection, setTargetUri, arginfo_phalcon_assets_collection_settargeturi, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/assets/filterinterface.zep.h b/ext/phalcon/assets/filterinterface.zep.h index a2c25222fd5..4c55ecc9cd1 100644 --- a/ext/phalcon/assets/filterinterface.zep.h +++ b/ext/phalcon/assets/filterinterface.zep.h @@ -3,8 +3,16 @@ extern zend_class_entry *phalcon_assets_filterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Assets_FilterInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_filterinterface_filter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_filterinterface_filter, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_filterinterface_filter, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_assets_filterinterface_method_entry) { diff --git a/ext/phalcon/assets/filters/cssmin.zep.c b/ext/phalcon/assets/filters/cssmin.zep.c index ead465d4c23..2239b09c4a8 100644 --- a/ext/phalcon/assets/filters/cssmin.zep.c +++ b/ext/phalcon/assets/filters/cssmin.zep.c @@ -41,24 +41,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Filters_Cssmin) { PHP_METHOD(Phalcon_Assets_Filters_Cssmin, filter) { zval *content_param = NULL; - zval *content = NULL; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &content_param); if (UNEXPECTED(Z_TYPE_P(content_param) != IS_STRING && Z_TYPE_P(content_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(content_param) == IS_STRING)) { - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); } else { - ZEPHIR_INIT_VAR(content); - ZVAL_EMPTY_STRING(content); + ZEPHIR_INIT_VAR(&content); + ZVAL_EMPTY_STRING(&content); } - phalcon_cssmin(return_value, content TSRMLS_CC); + phalcon_cssmin(return_value, &content TSRMLS_CC); RETURN_MM(); } diff --git a/ext/phalcon/assets/filters/cssmin.zep.h b/ext/phalcon/assets/filters/cssmin.zep.h index 4afbe240b44..9d18c671080 100644 --- a/ext/phalcon/assets/filters/cssmin.zep.h +++ b/ext/phalcon/assets/filters/cssmin.zep.h @@ -5,8 +5,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Filters_Cssmin); PHP_METHOD(Phalcon_Assets_Filters_Cssmin, filter); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_filters_cssmin_filter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_filters_cssmin_filter, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_filters_cssmin_filter, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_assets_filters_cssmin_method_entry) { diff --git a/ext/phalcon/assets/filters/jsmin.zep.c b/ext/phalcon/assets/filters/jsmin.zep.c index 732f829253e..f30f0d31d25 100644 --- a/ext/phalcon/assets/filters/jsmin.zep.c +++ b/ext/phalcon/assets/filters/jsmin.zep.c @@ -41,24 +41,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Filters_Jsmin) { PHP_METHOD(Phalcon_Assets_Filters_Jsmin, filter) { zval *content_param = NULL; - zval *content = NULL; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &content_param); if (UNEXPECTED(Z_TYPE_P(content_param) != IS_STRING && Z_TYPE_P(content_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(content_param) == IS_STRING)) { - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); } else { - ZEPHIR_INIT_VAR(content); - ZVAL_EMPTY_STRING(content); + ZEPHIR_INIT_VAR(&content); + ZVAL_EMPTY_STRING(&content); } - phalcon_jsmin(return_value, content TSRMLS_CC); + phalcon_jsmin(return_value, &content TSRMLS_CC); RETURN_MM(); } diff --git a/ext/phalcon/assets/filters/jsmin.zep.h b/ext/phalcon/assets/filters/jsmin.zep.h index ff2feb4e872..f909d371538 100644 --- a/ext/phalcon/assets/filters/jsmin.zep.h +++ b/ext/phalcon/assets/filters/jsmin.zep.h @@ -5,8 +5,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Filters_Jsmin); PHP_METHOD(Phalcon_Assets_Filters_Jsmin, filter); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_filters_jsmin_filter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_filters_jsmin_filter, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_filters_jsmin_filter, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_assets_filters_jsmin_method_entry) { diff --git a/ext/phalcon/assets/filters/none.zep.c b/ext/phalcon/assets/filters/none.zep.c index bbce940d9e9..e68d6317c0a 100644 --- a/ext/phalcon/assets/filters/none.zep.c +++ b/ext/phalcon/assets/filters/none.zep.c @@ -38,24 +38,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Filters_None) { PHP_METHOD(Phalcon_Assets_Filters_None, filter) { zval *content_param = NULL; - zval *content = NULL; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &content_param); if (UNEXPECTED(Z_TYPE_P(content_param) != IS_STRING && Z_TYPE_P(content_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(content_param) == IS_STRING)) { - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); } else { - ZEPHIR_INIT_VAR(content); - ZVAL_EMPTY_STRING(content); + ZEPHIR_INIT_VAR(&content); + ZVAL_EMPTY_STRING(&content); } - RETURN_CTOR(content); + RETURN_CTOR(&content); } diff --git a/ext/phalcon/assets/filters/none.zep.h b/ext/phalcon/assets/filters/none.zep.h index 848574583fb..a6a64233e5a 100644 --- a/ext/phalcon/assets/filters/none.zep.h +++ b/ext/phalcon/assets/filters/none.zep.h @@ -5,8 +5,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Filters_None); PHP_METHOD(Phalcon_Assets_Filters_None, filter); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_filters_none_filter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_filters_none_filter, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_filters_none_filter, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_assets_filters_none_method_entry) { diff --git a/ext/phalcon/assets/inline.zep.c b/ext/phalcon/assets/inline.zep.c index 6e47a905910..19cd99476b8 100644 --- a/ext/phalcon/assets/inline.zep.c +++ b/ext/phalcon/assets/inline.zep.c @@ -56,7 +56,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Inline) { */ PHP_METHOD(Phalcon_Assets_Inline, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -64,7 +65,8 @@ PHP_METHOD(Phalcon_Assets_Inline, getType) { PHP_METHOD(Phalcon_Assets_Inline, getContent) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_content"); @@ -74,7 +76,8 @@ PHP_METHOD(Phalcon_Assets_Inline, getContent) { */ PHP_METHOD(Phalcon_Assets_Inline, getFilter) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_filter"); @@ -91,33 +94,42 @@ PHP_METHOD(Phalcon_Assets_Inline, getFilter) { PHP_METHOD(Phalcon_Assets_Inline, __construct) { zend_bool filter; - zval *type_param = NULL, *content_param = NULL, *filter_param = NULL, *attributes = NULL; - zval *type = NULL, *content = NULL; + zval *type_param = NULL, *content_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$true, __$false, __$null; + zval type, content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&attributes_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 2, &type_param, &content_param, &filter_param, &attributes); - zephir_get_strval(type, type_param); - zephir_get_strval(content, content_param); + zephir_get_strval(&type, type_param); + zephir_get_strval(&content, content_param); if (!filter_param) { filter = 1; } else { filter = zephir_get_boolval(filter_param); } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_content"), content TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), &type); + zephir_update_property_zval(this_ptr, SL("_content"), &content); if (filter) { - zephir_update_property_this(getThis(), SL("_filter"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filter"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_filter"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filter"), &__$false); } if (Z_TYPE_P(attributes) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_attributes"), attributes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_attributes"), attributes); } ZEPHIR_MM_RESTORE(); @@ -129,15 +141,18 @@ PHP_METHOD(Phalcon_Assets_Inline, __construct) { PHP_METHOD(Phalcon_Assets_Inline, setType) { zval *type_param = NULL; - zval *type = NULL; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &type_param); - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), &type); RETURN_THIS(); } @@ -147,8 +162,12 @@ PHP_METHOD(Phalcon_Assets_Inline, setType) { */ PHP_METHOD(Phalcon_Assets_Inline, setFilter) { - zval *filter_param = NULL; + zval *filter_param = NULL, __$true, __$false; zend_bool filter; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &filter_param); @@ -156,9 +175,9 @@ PHP_METHOD(Phalcon_Assets_Inline, setFilter) { if (filter) { - zephir_update_property_this(getThis(), SL("_filter"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filter"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_filter"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filter"), &__$false); } RETURN_THISW(); @@ -170,15 +189,18 @@ PHP_METHOD(Phalcon_Assets_Inline, setFilter) { PHP_METHOD(Phalcon_Assets_Inline, setAttributes) { zval *attributes_param = NULL; - zval *attributes = NULL; + zval attributes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attributes_param); - zephir_get_arrval(attributes, attributes_param); + zephir_get_arrval(&attributes, attributes_param); - zephir_update_property_this(getThis(), SL("_attributes"), attributes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_attributes"), &attributes); RETURN_THIS(); } @@ -188,7 +210,8 @@ PHP_METHOD(Phalcon_Assets_Inline, setAttributes) { */ PHP_METHOD(Phalcon_Assets_Inline, getAttributes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_attributes"); @@ -199,8 +222,13 @@ PHP_METHOD(Phalcon_Assets_Inline, getAttributes) { */ PHP_METHOD(Phalcon_Assets_Inline, getResourceKey) { - zval *key = NULL, *_0 = NULL, *_1 = NULL; + zval key, _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); @@ -208,9 +236,9 @@ PHP_METHOD(Phalcon_Assets_Inline, getResourceKey) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcontent", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(key); - ZEPHIR_CONCAT_VSV(key, _0, ":", _1); - zephir_md5(return_value, key); + ZEPHIR_INIT_VAR(&key); + ZEPHIR_CONCAT_VSV(&key, &_0, ":", &_1); + zephir_md5(return_value, &key); RETURN_MM(); } diff --git a/ext/phalcon/assets/inline.zep.h b/ext/phalcon/assets/inline.zep.h index 6ab50122709..98e2bbc2e8a 100644 --- a/ext/phalcon/assets/inline.zep.h +++ b/ext/phalcon/assets/inline.zep.h @@ -13,34 +13,94 @@ PHP_METHOD(Phalcon_Assets_Inline, setAttributes); PHP_METHOD(Phalcon_Assets_Inline, getAttributes); PHP_METHOD(Phalcon_Assets_Inline, getResourceKey); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_gettype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_gettype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_getfilter, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_getfilter, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_inline___construct, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_inline_settype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_inline_settype, 0, 1, Phalcon\\Assets\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_settype, 0, 1, IS_OBJECT, "Phalcon\\Assets\\ResourceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_inline_setfilter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_inline_setfilter, 0, 1, Phalcon\\Assets\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_setfilter, 0, 1, IS_OBJECT, "Phalcon\\Assets\\ResourceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_inline_setattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_inline_setattributes, 0, 1, Phalcon\\Assets\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_setattributes, 0, 1, IS_OBJECT, "Phalcon\\Assets\\ResourceInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_getattributes, 0, 0, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_getattributes, 0, 0, IS_ARRAY, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_getresourcekey, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_inline_getresourcekey, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_assets_inline_method_entry) { - PHP_ME(Phalcon_Assets_Inline, getType, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Inline, getType, arginfo_phalcon_assets_inline_gettype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Inline, getContent, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Inline, getFilter, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Inline, getFilter, arginfo_phalcon_assets_inline_getfilter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Inline, __construct, arginfo_phalcon_assets_inline___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Assets_Inline, setType, arginfo_phalcon_assets_inline_settype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Inline, setFilter, arginfo_phalcon_assets_inline_setfilter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Inline, setAttributes, arginfo_phalcon_assets_inline_setattributes, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Inline, getAttributes, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Inline, getResourceKey, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Inline, getAttributes, arginfo_phalcon_assets_inline_getattributes, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Inline, getResourceKey, arginfo_phalcon_assets_inline_getresourcekey, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/assets/inline/css.zep.c b/ext/phalcon/assets/inline/css.zep.c index 0a166e5a2bf..23afaa37fb7 100644 --- a/ext/phalcon/assets/inline/css.zep.c +++ b/ext/phalcon/assets/inline/css.zep.c @@ -43,20 +43,28 @@ PHP_METHOD(Phalcon_Assets_Inline_Css, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zend_bool filter; - zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, *_1, *_2; - zval *content = NULL; + zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, _1, _2; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &content_param, &filter_param, &attributes); - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); if (!filter_param) { filter = 1; } else { filter = zephir_get_boolval(filter_param); } if (!attributes) { - ZEPHIR_CPY_WRT(attributes, ZEPHIR_GLOBAL(global_null)); + attributes = &attributes_sub; + ZEPHIR_CPY_WRT(attributes, &__$null); } else { ZEPHIR_SEPARATE_PARAM(attributes); } @@ -65,18 +73,16 @@ PHP_METHOD(Phalcon_Assets_Inline_Css, __construct) { if (Z_TYPE_P(attributes) == IS_NULL) { ZEPHIR_INIT_NVAR(attributes); zephir_create_array(attributes, 1, 0 TSRMLS_CC); - add_assoc_stringl_ex(attributes, SS("type"), SL("text/css"), 1); + add_assoc_stringl_ex(attributes, SL("type"), SL("text/css")); } - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "css", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_2); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "css"); if (filter) { - ZVAL_BOOL(_2, 1); + ZVAL_BOOL(&_2, 1); } else { - ZVAL_BOOL(_2, 0); + ZVAL_BOOL(&_2, 0); } - ZEPHIR_CALL_PARENT(NULL, phalcon_assets_inline_css_ce, getThis(), "__construct", &_0, 109, _1, content, _2, attributes); - zephir_check_temp_parameter(_1); + ZEPHIR_CALL_PARENT(NULL, phalcon_assets_inline_css_ce, getThis(), "__construct", &_0, 0, &_1, &content, &_2, attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/assets/inline/css.zep.h b/ext/phalcon/assets/inline/css.zep.h index 1ce708665de..57286745d02 100644 --- a/ext/phalcon/assets/inline/css.zep.h +++ b/ext/phalcon/assets/inline/css.zep.h @@ -6,8 +6,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Inline_Css); PHP_METHOD(Phalcon_Assets_Inline_Css, __construct); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_inline_css___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/assets/inline/js.zep.c b/ext/phalcon/assets/inline/js.zep.c index 78153afb330..c8ec8192391 100644 --- a/ext/phalcon/assets/inline/js.zep.c +++ b/ext/phalcon/assets/inline/js.zep.c @@ -43,20 +43,28 @@ PHP_METHOD(Phalcon_Assets_Inline_Js, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zend_bool filter; - zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, *_1, *_2; - zval *content = NULL; + zval *content_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, _1, _2; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &content_param, &filter_param, &attributes); - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); if (!filter_param) { filter = 1; } else { filter = zephir_get_boolval(filter_param); } if (!attributes) { - ZEPHIR_CPY_WRT(attributes, ZEPHIR_GLOBAL(global_null)); + attributes = &attributes_sub; + ZEPHIR_CPY_WRT(attributes, &__$null); } else { ZEPHIR_SEPARATE_PARAM(attributes); } @@ -65,18 +73,16 @@ PHP_METHOD(Phalcon_Assets_Inline_Js, __construct) { if (Z_TYPE_P(attributes) == IS_NULL) { ZEPHIR_INIT_NVAR(attributes); zephir_create_array(attributes, 1, 0 TSRMLS_CC); - add_assoc_stringl_ex(attributes, SS("type"), SL("text/javascript"), 1); + add_assoc_stringl_ex(attributes, SL("type"), SL("text/javascript")); } - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "js", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_2); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "js"); if (filter) { - ZVAL_BOOL(_2, 1); + ZVAL_BOOL(&_2, 1); } else { - ZVAL_BOOL(_2, 0); + ZVAL_BOOL(&_2, 0); } - ZEPHIR_CALL_PARENT(NULL, phalcon_assets_inline_js_ce, getThis(), "__construct", &_0, 109, _1, content, _2, attributes); - zephir_check_temp_parameter(_1); + ZEPHIR_CALL_PARENT(NULL, phalcon_assets_inline_js_ce, getThis(), "__construct", &_0, 0, &_1, &content, &_2, attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/assets/inline/js.zep.h b/ext/phalcon/assets/inline/js.zep.h index 437f4b47b86..c3afd484dd7 100644 --- a/ext/phalcon/assets/inline/js.zep.h +++ b/ext/phalcon/assets/inline/js.zep.h @@ -6,8 +6,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Inline_Js); PHP_METHOD(Phalcon_Assets_Inline_Js, __construct); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_inline_js___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/assets/manager.zep.c b/ext/phalcon/assets/manager.zep.c index acb06ed1733..d0da205e1bf 100644 --- a/ext/phalcon/assets/manager.zep.c +++ b/ext/phalcon/assets/manager.zep.c @@ -53,17 +53,22 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Manager) { */ PHP_METHOD(Phalcon_Assets_Manager, __construct) { - zval *options = NULL; + zval *options = NULL, options_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(options) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), options); } } @@ -74,15 +79,19 @@ PHP_METHOD(Phalcon_Assets_Manager, __construct) { PHP_METHOD(Phalcon_Assets_Manager, setOptions) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &options_param); + ZVAL_UNDEF(&options); - options = options_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &options_param); + ZEPHIR_OBS_COPY_OR_DUP(&options, options_param); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); - RETURN_THISW(); + + zephir_update_property_zval(this_ptr, SL("_options"), &options); + RETURN_THIS(); } @@ -91,7 +100,8 @@ PHP_METHOD(Phalcon_Assets_Manager, setOptions) { */ PHP_METHOD(Phalcon_Assets_Manager, getOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -102,8 +112,12 @@ PHP_METHOD(Phalcon_Assets_Manager, getOptions) { */ PHP_METHOD(Phalcon_Assets_Manager, useImplicitOutput) { - zval *implicitOutput_param = NULL; + zval *implicitOutput_param = NULL, __$true, __$false; zend_bool implicitOutput; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &implicitOutput_param); @@ -111,9 +125,9 @@ PHP_METHOD(Phalcon_Assets_Manager, useImplicitOutput) { if (implicitOutput) { - zephir_update_property_this(getThis(), SL("_implicitOutput"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_implicitOutput"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_implicitOutput"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_implicitOutput"), &__$false); } RETURN_THISW(); @@ -130,41 +144,53 @@ PHP_METHOD(Phalcon_Assets_Manager, useImplicitOutput) { PHP_METHOD(Phalcon_Assets_Manager, addCss) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, *local = NULL, *filter = NULL, *attributes = NULL, *_0, *_1; - zval *path = NULL; + zval *path_param = NULL, *local = NULL, local_sub, *filter = NULL, filter_sub, *attributes = NULL, attributes_sub, __$true, __$null, _0, _1; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&local_sub); + ZVAL_UNDEF(&filter_sub); + ZVAL_UNDEF(&attributes_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &path_param, &local, &filter, &attributes); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } if (!local) { - local = ZEPHIR_GLOBAL(global_true); + local = &local_sub; + local = &__$true; } if (!filter) { - filter = ZEPHIR_GLOBAL(global_true); + filter = &filter_sub; + filter = &__$true; } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_assets_resource_css_ce); - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 105, path, local, filter, attributes); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_assets_resource_css_ce); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 94, &path, local, filter, attributes); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "css", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresourcebytype", NULL, 0, _1, _0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "css"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresourcebytype", NULL, 0, &_1, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -176,29 +202,39 @@ PHP_METHOD(Phalcon_Assets_Manager, addCss) { PHP_METHOD(Phalcon_Assets_Manager, addInlineCss) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *content_param = NULL, *filter = NULL, *attributes = NULL, *_0, *_1; - zval *content = NULL; + zval *content_param = NULL, *filter = NULL, filter_sub, *attributes = NULL, attributes_sub, __$true, __$null, _0, _1; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&filter_sub); + ZVAL_UNDEF(&attributes_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &content_param, &filter, &attributes); - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); if (!filter) { - filter = ZEPHIR_GLOBAL(global_true); + filter = &filter_sub; + filter = &__$true; } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_assets_inline_css_ce); - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 106, content, filter, attributes); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_assets_inline_css_ce); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 95, &content, filter, attributes); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "css", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinlinecodebytype", NULL, 0, _1, _0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "css"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinlinecodebytype", NULL, 0, &_1, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -215,41 +251,53 @@ PHP_METHOD(Phalcon_Assets_Manager, addInlineCss) { PHP_METHOD(Phalcon_Assets_Manager, addJs) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, *local = NULL, *filter = NULL, *attributes = NULL, *_0, *_1; - zval *path = NULL; + zval *path_param = NULL, *local = NULL, local_sub, *filter = NULL, filter_sub, *attributes = NULL, attributes_sub, __$true, __$null, _0, _1; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&local_sub); + ZVAL_UNDEF(&filter_sub); + ZVAL_UNDEF(&attributes_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &path_param, &local, &filter, &attributes); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } if (!local) { - local = ZEPHIR_GLOBAL(global_true); + local = &local_sub; + local = &__$true; } if (!filter) { - filter = ZEPHIR_GLOBAL(global_true); + filter = &filter_sub; + filter = &__$true; } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_assets_resource_js_ce); - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 107, path, local, filter, attributes); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_assets_resource_js_ce); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 96, &path, local, filter, attributes); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "js", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresourcebytype", NULL, 0, _1, _0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "js"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresourcebytype", NULL, 0, &_1, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -261,29 +309,39 @@ PHP_METHOD(Phalcon_Assets_Manager, addJs) { PHP_METHOD(Phalcon_Assets_Manager, addInlineJs) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *content_param = NULL, *filter = NULL, *attributes = NULL, *_0, *_1; - zval *content = NULL; + zval *content_param = NULL, *filter = NULL, filter_sub, *attributes = NULL, attributes_sub, __$true, __$null, _0, _1; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&filter_sub); + ZVAL_UNDEF(&attributes_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &content_param, &filter, &attributes); - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); if (!filter) { - filter = ZEPHIR_GLOBAL(global_true); + filter = &filter_sub; + filter = &__$true; } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_assets_inline_js_ce); - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 108, content, filter, attributes); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_assets_inline_js_ce); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 97, &content, filter, attributes); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "js", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinlinecodebytype", NULL, 0, _1, _0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "js"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinlinecodebytype", NULL, 0, &_1, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -301,34 +359,40 @@ PHP_METHOD(Phalcon_Assets_Manager, addInlineJs) { PHP_METHOD(Phalcon_Assets_Manager, addResourceByType) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *resource, *collection = NULL, *_0; - zval *type = NULL; + zval *type_param = NULL, *resource, resource_sub, collection, _0; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&resource_sub); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &resource); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - ZEPHIR_OBS_VAR(collection); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_collections"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&collection, _0, type, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(collection); - object_init_ex(collection, phalcon_assets_collection_ce); - ZEPHIR_CALL_METHOD(NULL, collection, "__construct", NULL, 110); + ZEPHIR_OBS_VAR(&collection); + zephir_read_property(&_0, this_ptr, SL("_collections"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&collection, &_0, &type, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&collection); + object_init_ex(&collection, phalcon_assets_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 98); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_collections"), type, collection TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_collections"), &type, &collection TSRMLS_CC); } - ZEPHIR_CALL_METHOD(NULL, collection, "add", NULL, 111, resource); + ZEPHIR_CALL_METHOD(NULL, &collection, "add", NULL, 99, resource); zephir_check_call_status(); RETURN_THIS(); @@ -340,34 +404,40 @@ PHP_METHOD(Phalcon_Assets_Manager, addResourceByType) { PHP_METHOD(Phalcon_Assets_Manager, addInlineCodeByType) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *code, *collection = NULL, *_0; - zval *type = NULL; + zval *type_param = NULL, *code, code_sub, collection, _0; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&code_sub); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &code); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - ZEPHIR_OBS_VAR(collection); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_collections"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&collection, _0, type, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(collection); - object_init_ex(collection, phalcon_assets_collection_ce); - ZEPHIR_CALL_METHOD(NULL, collection, "__construct", NULL, 110); + ZEPHIR_OBS_VAR(&collection); + zephir_read_property(&_0, this_ptr, SL("_collections"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&collection, &_0, &type, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&collection); + object_init_ex(&collection, phalcon_assets_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 98); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_collections"), type, collection TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_collections"), &type, &collection TSRMLS_CC); } - ZEPHIR_CALL_METHOD(NULL, collection, "addinline", NULL, 112, code); + ZEPHIR_CALL_METHOD(NULL, &collection, "addinline", NULL, 100, code); zephir_check_call_status(); RETURN_THIS(); @@ -385,7 +455,11 @@ PHP_METHOD(Phalcon_Assets_Manager, addInlineCodeByType) { PHP_METHOD(Phalcon_Assets_Manager, addResource) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *resource, *_0 = NULL; + zval *resource, resource_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resource_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &resource); @@ -394,7 +468,7 @@ PHP_METHOD(Phalcon_Assets_Manager, addResource) { ZEPHIR_CALL_METHOD(&_0, resource, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresourcebytype", NULL, 0, _0, resource); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addresourcebytype", NULL, 0, &_0, resource); zephir_check_call_status(); RETURN_THIS(); @@ -406,7 +480,11 @@ PHP_METHOD(Phalcon_Assets_Manager, addResource) { PHP_METHOD(Phalcon_Assets_Manager, addInlineCode) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *code, *_0 = NULL; + zval *code, code_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&code_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &code); @@ -415,7 +493,7 @@ PHP_METHOD(Phalcon_Assets_Manager, addInlineCode) { ZEPHIR_CALL_METHOD(&_0, code, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinlinecodebytype", NULL, 0, _0, code); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "addinlinecodebytype", NULL, 0, &_0, code); zephir_check_call_status(); RETURN_THIS(); @@ -430,25 +508,29 @@ PHP_METHOD(Phalcon_Assets_Manager, addInlineCode) { */ PHP_METHOD(Phalcon_Assets_Manager, set) { - zval *id_param = NULL, *collection; - zval *id = NULL; + zval *id_param = NULL, *collection, collection_sub; + zval id; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&collection_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &id_param, &collection); if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(id_param) == IS_STRING)) { - zephir_get_strval(id, id_param); + zephir_get_strval(&id, id_param); } else { - ZEPHIR_INIT_VAR(id); - ZVAL_EMPTY_STRING(id); + ZEPHIR_INIT_VAR(&id); + ZVAL_EMPTY_STRING(&id); } - zephir_update_property_array(this_ptr, SL("_collections"), id, collection TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_collections"), &id, collection TSRMLS_CC); RETURN_THIS(); } @@ -462,31 +544,36 @@ PHP_METHOD(Phalcon_Assets_Manager, set) { */ PHP_METHOD(Phalcon_Assets_Manager, get) { - zval *id_param = NULL, *collection = NULL, *_0; - zval *id = NULL; + zval *id_param = NULL, collection, _0; + zval id; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &id_param); if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(id_param) == IS_STRING)) { - zephir_get_strval(id, id_param); + zephir_get_strval(&id, id_param); } else { - ZEPHIR_INIT_VAR(id); - ZVAL_EMPTY_STRING(id); + ZEPHIR_INIT_VAR(&id); + ZVAL_EMPTY_STRING(&id); } - ZEPHIR_OBS_VAR(collection); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_collections"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&collection, _0, id, 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&collection); + zephir_read_property(&_0, this_ptr, SL("_collections"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&collection, &_0, &id, 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "The collection does not exist in the manager", "phalcon/assets/manager.zep", 235); return; } - RETURN_CCTOR(collection); + RETURN_CCTOR(&collection); } @@ -495,19 +582,23 @@ PHP_METHOD(Phalcon_Assets_Manager, get) { */ PHP_METHOD(Phalcon_Assets_Manager, getCss) { - zval *collection = NULL, *_0; + zval collection, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_collections"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&collection, _0, SS("css"), 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_collections"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&collection, &_0, SL("css"), 1))) { object_init_ex(return_value, phalcon_assets_collection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 110); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 98); zephir_check_call_status(); RETURN_MM(); } - RETURN_CTOR(collection); + RETURN_CTOR(&collection); } @@ -516,19 +607,23 @@ PHP_METHOD(Phalcon_Assets_Manager, getCss) { */ PHP_METHOD(Phalcon_Assets_Manager, getJs) { - zval *collection = NULL, *_0; + zval collection, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_collections"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&collection, _0, SS("js"), 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_collections"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&collection, &_0, SL("js"), 1))) { object_init_ex(return_value, phalcon_assets_collection_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 110); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 98); zephir_check_call_status(); RETURN_MM(); } - RETURN_CTOR(collection); + RETURN_CTOR(&collection); } @@ -538,59 +633,69 @@ PHP_METHOD(Phalcon_Assets_Manager, getJs) { PHP_METHOD(Phalcon_Assets_Manager, collection) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *collection = NULL, *_0; - zval *name = NULL; + zval *name_param = NULL, collection, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - ZEPHIR_OBS_VAR(collection); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_collections"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&collection, _0, name, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(collection); - object_init_ex(collection, phalcon_assets_collection_ce); - ZEPHIR_CALL_METHOD(NULL, collection, "__construct", NULL, 110); + ZEPHIR_OBS_VAR(&collection); + zephir_read_property(&_0, this_ptr, SL("_collections"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&collection, &_0, &name, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&collection); + object_init_ex(&collection, phalcon_assets_collection_ce); + ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 98); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_collections"), name, collection TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_collections"), &name, &collection TSRMLS_CC); } - RETURN_CCTOR(collection); + RETURN_CCTOR(&collection); } PHP_METHOD(Phalcon_Assets_Manager, collectionResourcesByType) { - HashTable *_1; - HashPosition _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type = NULL; - zval *resources_param = NULL, *type_param = NULL, *filtered = NULL, *resource = NULL, **_2, *_3$$3 = NULL; - zval *resources = NULL; + zval type; + zval *resources_param = NULL, *type_param = NULL, filtered, resource, *_0, _1$$3; + zval resources; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resources); + ZVAL_UNDEF(&filtered); + ZVAL_UNDEF(&resource); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&type); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &resources_param, &type_param); - zephir_get_arrval(resources, resources_param); - zephir_get_strval(type, type_param); + zephir_get_arrval(&resources, resources_param); + zephir_get_strval(&type, type_param); - ZEPHIR_INIT_VAR(filtered); - array_init(filtered); - zephir_is_iterable(resources, &_1, &_0, 0, 0, "phalcon/assets/manager.zep", 299); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(resource, _2); - ZEPHIR_CALL_METHOD(&_3$$3, resource, "gettype", NULL, 0); + ZEPHIR_INIT_VAR(&filtered); + array_init(&filtered); + zephir_is_iterable(&resources, 0, "phalcon/assets/manager.zep", 299); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&resources), _0) + { + ZEPHIR_INIT_NVAR(&resource); + ZVAL_COPY(&resource, _0); + ZEPHIR_CALL_METHOD(&_1$$3, &resource, "gettype", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EQUAL(_3$$3, type)) { - zephir_array_append(&filtered, resource, PH_SEPARATE, "phalcon/assets/manager.zep", 295); + if (ZEPHIR_IS_EQUAL(&_1$$3, &type)) { + zephir_array_append(&filtered, &resource, PH_SEPARATE, "phalcon/assets/manager.zep", 295); } - } - RETURN_CCTOR(filtered); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&resource); + RETURN_CCTOR(&filtered); } @@ -603,11 +708,57 @@ PHP_METHOD(Phalcon_Assets_Manager, collectionResourcesByType) { */ PHP_METHOD(Phalcon_Assets_Manager, output) { - HashTable *_7, *_17$$31; - HashPosition _6, _16$$31; zend_bool filterNeeded = 0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collection, *callback, *type = NULL, *output = NULL, *resources = NULL, *filters = NULL, *prefix = NULL, *sourceBasePath = NULL, *targetBasePath = NULL, *options = NULL, *collectionSourcePath = NULL, *completeSourcePath = NULL, *collectionTargetPath = NULL, *completeTargetPath = NULL, *filteredJoinedContent = NULL, *join = NULL, *resource = NULL, *local = NULL, *sourcePath = NULL, *targetPath = NULL, *path = NULL, *prefixedPath = NULL, *attributes = NULL, *parameters = NULL, *html = NULL, *useImplicitOutput = NULL, *content = NULL, *mustFilter = NULL, *filter = NULL, *filteredContent = NULL, *typeCss = NULL, *targetUri = NULL, *_0 = NULL, **_8, *_1$$10, *_2$$10, *_3$$9 = NULL, *_4$$11, *_5$$11, *_9$$15 = NULL, *_10$$15 = NULL, *_11$$17 = NULL, *_12$$17 = NULL, *_13$$19 = NULL, *_14$$19 = NULL, *_15$$20 = NULL, **_18$$31, *_19$$36 = NULL; + zval *collection, collection_sub, *callback, callback_sub, *type = NULL, type_sub, output, resources, filters, prefix, sourceBasePath, targetBasePath, options, collectionSourcePath, completeSourcePath, collectionTargetPath, completeTargetPath, filteredJoinedContent, join, resource, local, sourcePath, targetPath, path, prefixedPath, attributes, parameters, html, useImplicitOutput, content, mustFilter, filter, filteredContent, typeCss, targetUri, _0, *_6, _1$$10, _2$$10, _3$$9, _4$$11, _5$$11, _7$$15, _8$$15, _9$$17, _10$$17, _11$$19, _12$$19, _13$$20, *_14$$31, _15$$36; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection_sub); + ZVAL_UNDEF(&callback_sub); + ZVAL_UNDEF(&type_sub); + ZVAL_UNDEF(&output); + ZVAL_UNDEF(&resources); + ZVAL_UNDEF(&filters); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&sourceBasePath); + ZVAL_UNDEF(&targetBasePath); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&collectionSourcePath); + ZVAL_UNDEF(&completeSourcePath); + ZVAL_UNDEF(&collectionTargetPath); + ZVAL_UNDEF(&completeTargetPath); + ZVAL_UNDEF(&filteredJoinedContent); + ZVAL_UNDEF(&join); + ZVAL_UNDEF(&resource); + ZVAL_UNDEF(&local); + ZVAL_UNDEF(&sourcePath); + ZVAL_UNDEF(&targetPath); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&prefixedPath); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(¶meters); + ZVAL_UNDEF(&html); + ZVAL_UNDEF(&useImplicitOutput); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&mustFilter); + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&filteredContent); + ZVAL_UNDEF(&typeCss); + ZVAL_UNDEF(&targetUri); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$10); + ZVAL_UNDEF(&_2$$10); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$11); + ZVAL_UNDEF(&_5$$11); + ZVAL_UNDEF(&_7$$15); + ZVAL_UNDEF(&_8$$15); + ZVAL_UNDEF(&_9$$17); + ZVAL_UNDEF(&_10$$17); + ZVAL_UNDEF(&_11$$19); + ZVAL_UNDEF(&_12$$19); + ZVAL_UNDEF(&_13$$20); + ZVAL_UNDEF(&_15$$36); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &collection, &callback, &type); @@ -615,141 +766,140 @@ PHP_METHOD(Phalcon_Assets_Manager, output) { ZEPHIR_SEPARATE_PARAM(type); - ZEPHIR_INIT_VAR(sourceBasePath); - ZVAL_NULL(sourceBasePath); - ZEPHIR_INIT_VAR(targetBasePath); - ZVAL_NULL(targetBasePath); - ZEPHIR_OBS_VAR(useImplicitOutput); - zephir_read_property_this(&useImplicitOutput, this_ptr, SL("_implicitOutput"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(output); - ZVAL_STRING(output, "", 1); + ZEPHIR_INIT_VAR(&sourceBasePath); + ZVAL_NULL(&sourceBasePath); + ZEPHIR_INIT_VAR(&targetBasePath); + ZVAL_NULL(&targetBasePath); + ZEPHIR_OBS_VAR(&useImplicitOutput); + zephir_read_property(&useImplicitOutput, this_ptr, SL("_implicitOutput"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&output); + ZVAL_STRING(&output, ""); ZEPHIR_CALL_METHOD(&_0, collection, "getresources", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&resources, this_ptr, "collectionresourcesbytype", NULL, 0, _0, type); + ZEPHIR_CALL_METHOD(&resources, this_ptr, "collectionresourcesbytype", NULL, 0, &_0, type); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&filters, collection, "getfilters", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&prefix, collection, "getprefix", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(typeCss); - ZVAL_STRING(typeCss, "css", 1); - if (zephir_fast_count_int(filters TSRMLS_CC)) { - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(sourceBasePath); - zephir_array_isset_string_fetch(&sourceBasePath, options, SS("sourceBasePath"), 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(targetBasePath); - zephir_array_isset_string_fetch(&targetBasePath, options, SS("targetBasePath"), 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&typeCss); + ZVAL_STRING(&typeCss, "css"); + if (zephir_fast_count_int(&filters TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + if (Z_TYPE_P(&options) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&sourceBasePath); + zephir_array_isset_string_fetch(&sourceBasePath, &options, SL("sourceBasePath"), 0); + ZEPHIR_OBS_NVAR(&targetBasePath); + zephir_array_isset_string_fetch(&targetBasePath, &options, SL("targetBasePath"), 0); } ZEPHIR_CALL_METHOD(&collectionSourcePath, collection, "getsourcepath", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(collectionSourcePath)) { - ZEPHIR_INIT_VAR(completeSourcePath); - ZEPHIR_CONCAT_VV(completeSourcePath, sourceBasePath, collectionSourcePath); + if (zephir_is_true(&collectionSourcePath)) { + ZEPHIR_INIT_VAR(&completeSourcePath); + ZEPHIR_CONCAT_VV(&completeSourcePath, &sourceBasePath, &collectionSourcePath); } else { - ZEPHIR_CPY_WRT(completeSourcePath, sourceBasePath); + ZEPHIR_CPY_WRT(&completeSourcePath, &sourceBasePath); } ZEPHIR_CALL_METHOD(&collectionTargetPath, collection, "gettargetpath", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(collectionTargetPath)) { - ZEPHIR_INIT_VAR(completeTargetPath); - ZEPHIR_CONCAT_VV(completeTargetPath, targetBasePath, collectionTargetPath); + if (zephir_is_true(&collectionTargetPath)) { + ZEPHIR_INIT_VAR(&completeTargetPath); + ZEPHIR_CONCAT_VV(&completeTargetPath, &targetBasePath, &collectionTargetPath); } else { - ZEPHIR_CPY_WRT(completeTargetPath, targetBasePath); + ZEPHIR_CPY_WRT(&completeTargetPath, &targetBasePath); } - ZEPHIR_INIT_VAR(filteredJoinedContent); - ZVAL_STRING(filteredJoinedContent, "", 1); + ZEPHIR_INIT_VAR(&filteredJoinedContent); + ZVAL_STRING(&filteredJoinedContent, ""); ZEPHIR_CALL_METHOD(&join, collection, "getjoin", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(join)) { - if (!(zephir_is_true(completeTargetPath))) { - ZEPHIR_INIT_VAR(_1$$10); - object_init_ex(_1$$10, phalcon_assets_exception_ce); - ZEPHIR_INIT_VAR(_2$$10); - ZEPHIR_CONCAT_SVS(_2$$10, "Path '", completeTargetPath, "' is not a valid target path (1)"); - ZEPHIR_CALL_METHOD(NULL, _1$$10, "__construct", NULL, 9, _2$$10); + if (zephir_is_true(&join)) { + if (!(zephir_is_true(&completeTargetPath))) { + ZEPHIR_INIT_VAR(&_1$$10); + object_init_ex(&_1$$10, phalcon_assets_exception_ce); + ZEPHIR_INIT_VAR(&_2$$10); + ZEPHIR_CONCAT_SVS(&_2$$10, "Path '", &completeTargetPath, "' is not a valid target path (1)"); + ZEPHIR_CALL_METHOD(NULL, &_1$$10, "__construct", NULL, 4, &_2$$10); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$10, "phalcon/assets/manager.zep", 408 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$10, "phalcon/assets/manager.zep", 408 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_FUNCTION(&_3$$9, "is_dir", NULL, 113, completeTargetPath); + ZEPHIR_CALL_FUNCTION(&_3$$9, "is_dir", NULL, 101, &completeTargetPath); zephir_check_call_status(); - if (zephir_is_true(_3$$9)) { - ZEPHIR_INIT_VAR(_4$$11); - object_init_ex(_4$$11, phalcon_assets_exception_ce); - ZEPHIR_INIT_VAR(_5$$11); - ZEPHIR_CONCAT_SVS(_5$$11, "Path '", completeTargetPath, "' is not a valid target path (2), is dir."); - ZEPHIR_CALL_METHOD(NULL, _4$$11, "__construct", NULL, 9, _5$$11); + if (zephir_is_true(&_3$$9)) { + ZEPHIR_INIT_VAR(&_4$$11); + object_init_ex(&_4$$11, phalcon_assets_exception_ce); + ZEPHIR_INIT_VAR(&_5$$11); + ZEPHIR_CONCAT_SVS(&_5$$11, "Path '", &completeTargetPath, "' is not a valid target path (2), is dir."); + ZEPHIR_CALL_METHOD(NULL, &_4$$11, "__construct", NULL, 4, &_5$$11); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$11, "phalcon/assets/manager.zep", 412 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$11, "phalcon/assets/manager.zep", 412 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } - zephir_is_iterable(resources, &_7, &_6, 0, 0, "phalcon/assets/manager.zep", 650); - for ( - ; zend_hash_get_current_data_ex(_7, (void**) &_8, &_6) == SUCCESS - ; zend_hash_move_forward_ex(_7, &_6) - ) { - ZEPHIR_GET_HVALUE(resource, _8); + zephir_is_iterable(&resources, 0, "phalcon/assets/manager.zep", 650); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&resources), _6) + { + ZEPHIR_INIT_NVAR(&resource); + ZVAL_COPY(&resource, _6); filterNeeded = 0; - ZEPHIR_CALL_METHOD(&type, resource, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(type, &resource, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&local, resource, "getlocal", NULL, 0); + ZEPHIR_CALL_METHOD(&local, &resource, "getlocal", NULL, 0); zephir_check_call_status(); - if (zephir_fast_count_int(filters TSRMLS_CC)) { - if (zephir_is_true(local)) { - ZEPHIR_CALL_METHOD(&sourcePath, resource, "getrealsourcepath", NULL, 0, completeSourcePath); + if (zephir_fast_count_int(&filters TSRMLS_CC)) { + if (zephir_is_true(&local)) { + ZEPHIR_CALL_METHOD(&sourcePath, &resource, "getrealsourcepath", NULL, 0, &completeSourcePath); zephir_check_call_status(); - if (!(zephir_is_true(sourcePath))) { - ZEPHIR_CALL_METHOD(&sourcePath, resource, "getpath", NULL, 0); + if (!(zephir_is_true(&sourcePath))) { + ZEPHIR_CALL_METHOD(&sourcePath, &resource, "getpath", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_9$$15); - object_init_ex(_9$$15, phalcon_assets_exception_ce); - ZEPHIR_INIT_LNVAR(_10$$15); - ZEPHIR_CONCAT_SVS(_10$$15, "Resource '", sourcePath, "' does not have a valid source path"); - ZEPHIR_CALL_METHOD(NULL, _9$$15, "__construct", NULL, 9, _10$$15); + ZEPHIR_INIT_NVAR(&_7$$15); + object_init_ex(&_7$$15, phalcon_assets_exception_ce); + ZEPHIR_INIT_LNVAR(_8$$15); + ZEPHIR_CONCAT_SVS(&_8$$15, "Resource '", &sourcePath, "' does not have a valid source path"); + ZEPHIR_CALL_METHOD(NULL, &_7$$15, "__construct", NULL, 4, &_8$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$15, "phalcon/assets/manager.zep", 446 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$15, "phalcon/assets/manager.zep", 446 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CALL_METHOD(&sourcePath, resource, "getpath", NULL, 0); + ZEPHIR_CALL_METHOD(&sourcePath, &resource, "getpath", NULL, 0); zephir_check_call_status(); filterNeeded = 1; } - ZEPHIR_CALL_METHOD(&targetPath, resource, "getrealtargetpath", NULL, 0, completeTargetPath); + ZEPHIR_CALL_METHOD(&targetPath, &resource, "getrealtargetpath", NULL, 0, &completeTargetPath); zephir_check_call_status(); - if (!(zephir_is_true(targetPath))) { - ZEPHIR_INIT_NVAR(_11$$17); - object_init_ex(_11$$17, phalcon_assets_exception_ce); - ZEPHIR_INIT_LNVAR(_12$$17); - ZEPHIR_CONCAT_SVS(_12$$17, "Resource '", sourcePath, "' does not have a valid target path"); - ZEPHIR_CALL_METHOD(NULL, _11$$17, "__construct", NULL, 9, _12$$17); + if (!(zephir_is_true(&targetPath))) { + ZEPHIR_INIT_NVAR(&_9$$17); + object_init_ex(&_9$$17, phalcon_assets_exception_ce); + ZEPHIR_INIT_LNVAR(_10$$17); + ZEPHIR_CONCAT_SVS(&_10$$17, "Resource '", &sourcePath, "' does not have a valid target path"); + ZEPHIR_CALL_METHOD(NULL, &_9$$17, "__construct", NULL, 4, &_10$$17); zephir_check_call_status(); - zephir_throw_exception_debug(_11$$17, "phalcon/assets/manager.zep", 470 TSRMLS_CC); + zephir_throw_exception_debug(&_9$$17, "phalcon/assets/manager.zep", 470 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_is_true(local)) { - if (ZEPHIR_IS_EQUAL(targetPath, sourcePath)) { - ZEPHIR_INIT_NVAR(_13$$19); - object_init_ex(_13$$19, phalcon_assets_exception_ce); - ZEPHIR_INIT_LNVAR(_14$$19); - ZEPHIR_CONCAT_SVS(_14$$19, "Resource '", targetPath, "' have the same source and target paths"); - ZEPHIR_CALL_METHOD(NULL, _13$$19, "__construct", NULL, 9, _14$$19); + if (zephir_is_true(&local)) { + if (ZEPHIR_IS_EQUAL(&targetPath, &sourcePath)) { + ZEPHIR_INIT_NVAR(&_11$$19); + object_init_ex(&_11$$19, phalcon_assets_exception_ce); + ZEPHIR_INIT_LNVAR(_12$$19); + ZEPHIR_CONCAT_SVS(&_12$$19, "Resource '", &targetPath, "' have the same source and target paths"); + ZEPHIR_CALL_METHOD(NULL, &_11$$19, "__construct", NULL, 4, &_12$$19); zephir_check_call_status(); - zephir_throw_exception_debug(_13$$19, "phalcon/assets/manager.zep", 479 TSRMLS_CC); + zephir_throw_exception_debug(&_11$$19, "phalcon/assets/manager.zep", 479 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if ((zephir_file_exists(targetPath TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_NVAR(_15$$20); - if (zephir_compare_mtime(targetPath, sourcePath TSRMLS_CC)) { + if ((zephir_file_exists(&targetPath TSRMLS_CC) == SUCCESS)) { + ZEPHIR_INIT_NVAR(&_13$$20); + if (zephir_compare_mtime(&targetPath, &sourcePath TSRMLS_CC)) { filterNeeded = 1; } } else { @@ -757,142 +907,143 @@ PHP_METHOD(Phalcon_Assets_Manager, output) { } } } else { - ZEPHIR_CALL_METHOD(&path, resource, "getrealtargeturi", NULL, 0); + ZEPHIR_CALL_METHOD(&path, &resource, "getrealtargeturi", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(prefix)) { - ZEPHIR_INIT_NVAR(prefixedPath); - ZEPHIR_CONCAT_VV(prefixedPath, prefix, path); + if (zephir_is_true(&prefix)) { + ZEPHIR_INIT_NVAR(&prefixedPath); + ZEPHIR_CONCAT_VV(&prefixedPath, &prefix, &path); } else { - ZEPHIR_CPY_WRT(prefixedPath, path); + ZEPHIR_CPY_WRT(&prefixedPath, &path); } - ZEPHIR_CALL_METHOD(&attributes, resource, "getattributes", NULL, 0); + ZEPHIR_CALL_METHOD(&attributes, &resource, "getattributes", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(parameters); - array_init(parameters); - if (Z_TYPE_P(attributes) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(¶meters); + array_init(¶meters); + if (Z_TYPE_P(&attributes) == IS_ARRAY) { zephir_array_update_long(&attributes, 0, &prefixedPath, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_append(¶meters, attributes, PH_SEPARATE, "phalcon/assets/manager.zep", 514); + zephir_array_append(¶meters, &attributes, PH_SEPARATE, "phalcon/assets/manager.zep", 514); } else { - zephir_array_append(¶meters, prefixedPath, PH_SEPARATE, "phalcon/assets/manager.zep", 516); + zephir_array_append(¶meters, &prefixedPath, PH_SEPARATE, "phalcon/assets/manager.zep", 516); } - zephir_array_append(¶meters, local, PH_SEPARATE, "phalcon/assets/manager.zep", 518); - ZEPHIR_INIT_NVAR(html); - ZEPHIR_CALL_USER_FUNC_ARRAY(html, callback, parameters); + zephir_array_append(¶meters, &local, PH_SEPARATE, "phalcon/assets/manager.zep", 518); + ZEPHIR_INIT_NVAR(&html); + ZEPHIR_CALL_USER_FUNC_ARRAY(&html, callback, ¶meters); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE(useImplicitOutput)) { - zend_print_zval(html, 0); + if (ZEPHIR_IS_TRUE(&useImplicitOutput)) { + zend_print_zval(&html, 0); } else { - zephir_concat_self(&output, html TSRMLS_CC); + zephir_concat_self(&output, &html TSRMLS_CC); } continue; } if (filterNeeded == 1) { - ZEPHIR_CALL_METHOD(&content, resource, "getcontent", NULL, 0, completeSourcePath); + ZEPHIR_CALL_METHOD(&content, &resource, "getcontent", NULL, 0, &completeSourcePath); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&mustFilter, resource, "getfilter", NULL, 0); + ZEPHIR_CALL_METHOD(&mustFilter, &resource, "getfilter", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE(mustFilter)) { - zephir_is_iterable(filters, &_17$$31, &_16$$31, 0, 0, "phalcon/assets/manager.zep", 571); - for ( - ; zend_hash_get_current_data_ex(_17$$31, (void**) &_18$$31, &_16$$31) == SUCCESS - ; zend_hash_move_forward_ex(_17$$31, &_16$$31) - ) { - ZEPHIR_GET_HVALUE(filter, _18$$31); - if (Z_TYPE_P(filter) != IS_OBJECT) { + if (ZEPHIR_IS_TRUE(&mustFilter)) { + zephir_is_iterable(&filters, 0, "phalcon/assets/manager.zep", 571); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _14$$31) + { + ZEPHIR_INIT_NVAR(&filter); + ZVAL_COPY(&filter, _14$$31); + if (Z_TYPE_P(&filter) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/assets/manager.zep", 559); return; } - ZEPHIR_CALL_METHOD(&filteredContent, filter, "filter", NULL, 0, content); + ZEPHIR_CALL_METHOD(&filteredContent, &filter, "filter", NULL, 0, &content); zephir_check_call_status(); - ZEPHIR_CPY_WRT(content, filteredContent); - } - if (ZEPHIR_IS_TRUE(join)) { - if (ZEPHIR_IS_EQUAL(type, typeCss)) { - zephir_concat_self(&filteredJoinedContent, filteredContent TSRMLS_CC); + ZEPHIR_CPY_WRT(&content, &filteredContent); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&filter); + if (ZEPHIR_IS_TRUE(&join)) { + if (ZEPHIR_IS_EQUAL(type, &typeCss)) { + zephir_concat_self(&filteredJoinedContent, &filteredContent TSRMLS_CC); } else { - ZEPHIR_INIT_LNVAR(_19$$36); - ZEPHIR_CONCAT_VS(_19$$36, filteredContent, ";"); - zephir_concat_self(&filteredJoinedContent, _19$$36 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_15$$36); + ZEPHIR_CONCAT_VS(&_15$$36, &filteredContent, ";"); + zephir_concat_self(&filteredJoinedContent, &_15$$36 TSRMLS_CC); } } } else { - if (ZEPHIR_IS_TRUE(join)) { - zephir_concat_self(&filteredJoinedContent, content TSRMLS_CC); + if (ZEPHIR_IS_TRUE(&join)) { + zephir_concat_self(&filteredJoinedContent, &content TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(filteredContent, content); + ZEPHIR_CPY_WRT(&filteredContent, &content); } } - if (!(zephir_is_true(join))) { - zephir_file_put_contents(NULL, targetPath, filteredContent TSRMLS_CC); + if (!(zephir_is_true(&join))) { + zephir_file_put_contents(NULL, &targetPath, &filteredContent TSRMLS_CC); } } - if (!(zephir_is_true(join))) { - ZEPHIR_CALL_METHOD(&path, resource, "getrealtargeturi", NULL, 0); + if (!(zephir_is_true(&join))) { + ZEPHIR_CALL_METHOD(&path, &resource, "getrealtargeturi", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(prefix)) { - ZEPHIR_INIT_NVAR(prefixedPath); - ZEPHIR_CONCAT_VV(prefixedPath, prefix, path); + if (zephir_is_true(&prefix)) { + ZEPHIR_INIT_NVAR(&prefixedPath); + ZEPHIR_CONCAT_VV(&prefixedPath, &prefix, &path); } else { - ZEPHIR_CPY_WRT(prefixedPath, path); + ZEPHIR_CPY_WRT(&prefixedPath, &path); } - ZEPHIR_CALL_METHOD(&attributes, resource, "getattributes", NULL, 0); + ZEPHIR_CALL_METHOD(&attributes, &resource, "getattributes", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(local); - ZVAL_BOOL(local, 1); - ZEPHIR_INIT_NVAR(parameters); - array_init(parameters); - if (Z_TYPE_P(attributes) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&local); + ZVAL_BOOL(&local, 1); + ZEPHIR_INIT_NVAR(¶meters); + array_init(¶meters); + if (Z_TYPE_P(&attributes) == IS_ARRAY) { zephir_array_update_long(&attributes, 0, &prefixedPath, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_append(¶meters, attributes, PH_SEPARATE, "phalcon/assets/manager.zep", 628); + zephir_array_append(¶meters, &attributes, PH_SEPARATE, "phalcon/assets/manager.zep", 628); } else { - zephir_array_append(¶meters, prefixedPath, PH_SEPARATE, "phalcon/assets/manager.zep", 630); + zephir_array_append(¶meters, &prefixedPath, PH_SEPARATE, "phalcon/assets/manager.zep", 630); } - zephir_array_append(¶meters, local, PH_SEPARATE, "phalcon/assets/manager.zep", 632); - ZEPHIR_INIT_NVAR(html); - ZEPHIR_CALL_USER_FUNC_ARRAY(html, callback, parameters); + zephir_array_append(¶meters, &local, PH_SEPARATE, "phalcon/assets/manager.zep", 632); + ZEPHIR_INIT_NVAR(&html); + ZEPHIR_CALL_USER_FUNC_ARRAY(&html, callback, ¶meters); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE(useImplicitOutput)) { - zend_print_zval(html, 0); + if (ZEPHIR_IS_TRUE(&useImplicitOutput)) { + zend_print_zval(&html, 0); } else { - zephir_concat_self(&output, html TSRMLS_CC); + zephir_concat_self(&output, &html TSRMLS_CC); } } - } - if (zephir_fast_count_int(filters TSRMLS_CC)) { - if (ZEPHIR_IS_TRUE(join)) { - zephir_file_put_contents(NULL, completeTargetPath, filteredJoinedContent TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&resource); + if (zephir_fast_count_int(&filters TSRMLS_CC)) { + if (ZEPHIR_IS_TRUE(&join)) { + zephir_file_put_contents(NULL, &completeTargetPath, &filteredJoinedContent TSRMLS_CC); ZEPHIR_CALL_METHOD(&targetUri, collection, "gettargeturi", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(prefix)) { - ZEPHIR_INIT_NVAR(prefixedPath); - ZEPHIR_CONCAT_VV(prefixedPath, prefix, targetUri); + if (zephir_is_true(&prefix)) { + ZEPHIR_INIT_NVAR(&prefixedPath); + ZEPHIR_CONCAT_VV(&prefixedPath, &prefix, &targetUri); } else { - ZEPHIR_CPY_WRT(prefixedPath, targetUri); + ZEPHIR_CPY_WRT(&prefixedPath, &targetUri); } ZEPHIR_CALL_METHOD(&attributes, collection, "getattributes", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&local, collection, "gettargetlocal", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(parameters); - array_init(parameters); - if (Z_TYPE_P(attributes) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(¶meters); + array_init(¶meters); + if (Z_TYPE_P(&attributes) == IS_ARRAY) { zephir_array_update_long(&attributes, 0, &prefixedPath, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_append(¶meters, attributes, PH_SEPARATE, "phalcon/assets/manager.zep", 687); + zephir_array_append(¶meters, &attributes, PH_SEPARATE, "phalcon/assets/manager.zep", 687); } else { - zephir_array_append(¶meters, prefixedPath, PH_SEPARATE, "phalcon/assets/manager.zep", 689); + zephir_array_append(¶meters, &prefixedPath, PH_SEPARATE, "phalcon/assets/manager.zep", 689); } - zephir_array_append(¶meters, local, PH_SEPARATE, "phalcon/assets/manager.zep", 691); - ZEPHIR_INIT_NVAR(html); - ZEPHIR_CALL_USER_FUNC_ARRAY(html, callback, parameters); + zephir_array_append(¶meters, &local, PH_SEPARATE, "phalcon/assets/manager.zep", 691); + ZEPHIR_INIT_NVAR(&html); + ZEPHIR_CALL_USER_FUNC_ARRAY(&html, callback, ¶meters); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE(useImplicitOutput)) { - zend_print_zval(html, 0); + if (ZEPHIR_IS_TRUE(&useImplicitOutput)) { + zend_print_zval(&html, 0); } else { - zephir_concat_self(&output, html TSRMLS_CC); + zephir_concat_self(&output, &html TSRMLS_CC); } } } - RETURN_CCTOR(output); + RETURN_CCTOR(&output); } @@ -904,95 +1055,113 @@ PHP_METHOD(Phalcon_Assets_Manager, output) { */ PHP_METHOD(Phalcon_Assets_Manager, outputInline) { - HashTable *_1$$3, *_4$$4; - HashPosition _0$$3, _3$$4; - zephir_fcall_cache_entry *_8 = NULL, *_12 = NULL; + zephir_fcall_cache_entry *_4 = NULL, *_8 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collection, *type, *output = NULL, *html = NULL, *codes = NULL, *filters = NULL, *filter = NULL, *code = NULL, *attributes = NULL, *content = NULL, *join = NULL, *joinedContent = NULL, **_2$$3, *_19$$3, **_5$$4, *_6$$5 = NULL, *_7$$8 = NULL, *_9$$8 = NULL, *_10$$8 = NULL, *_11$$8 = NULL, *_13$$8 = NULL, *_14$$9 = NULL, *_15$$9 = NULL, *_16$$9, *_17$$9 = NULL, *_18$$9; + zval *collection, collection_sub, *type, type_sub, output, html, codes, filters, filter, code, attributes, content, join, joinedContent, *_0$$3, _15$$3, *_1$$4, _2$$5, _3$$8, _5$$8, _6$$8, _7$$8, _9$$8, _10$$9, _11$$9, _12$$9, _13$$9, _14$$9; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection_sub); + ZVAL_UNDEF(&type_sub); + ZVAL_UNDEF(&output); + ZVAL_UNDEF(&html); + ZVAL_UNDEF(&codes); + ZVAL_UNDEF(&filters); + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&join); + ZVAL_UNDEF(&joinedContent); + ZVAL_UNDEF(&_15$$3); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_9$$8); + ZVAL_UNDEF(&_10$$9); + ZVAL_UNDEF(&_11$$9); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_14$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &collection, &type); - ZEPHIR_INIT_VAR(output); - ZVAL_STRING(output, "", 1); - ZEPHIR_INIT_VAR(html); - ZVAL_STRING(html, "", 1); - ZEPHIR_INIT_VAR(joinedContent); - ZVAL_STRING(joinedContent, "", 1); + ZEPHIR_INIT_VAR(&output); + ZVAL_STRING(&output, ""); + ZEPHIR_INIT_VAR(&html); + ZVAL_STRING(&html, ""); + ZEPHIR_INIT_VAR(&joinedContent); + ZVAL_STRING(&joinedContent, ""); ZEPHIR_CALL_METHOD(&codes, collection, "getcodes", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&filters, collection, "getfilters", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&join, collection, "getjoin", NULL, 0); zephir_check_call_status(); - if (zephir_fast_count_int(codes TSRMLS_CC)) { - zephir_is_iterable(codes, &_1$$3, &_0$$3, 0, 0, "phalcon/assets/manager.zep", 756); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(code, _2$$3); - ZEPHIR_CALL_METHOD(&attributes, code, "getattributes", NULL, 0); + if (zephir_fast_count_int(&codes TSRMLS_CC)) { + zephir_is_iterable(&codes, 0, "phalcon/assets/manager.zep", 756); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&codes), _0$$3) + { + ZEPHIR_INIT_NVAR(&code); + ZVAL_COPY(&code, _0$$3); + ZEPHIR_CALL_METHOD(&attributes, &code, "getattributes", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&content, code, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&content, &code, "getcontent", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(filters, &_4$$4, &_3$$4, 0, 0, "phalcon/assets/manager.zep", 749); - for ( - ; zend_hash_get_current_data_ex(_4$$4, (void**) &_5$$4, &_3$$4) == SUCCESS - ; zend_hash_move_forward_ex(_4$$4, &_3$$4) - ) { - ZEPHIR_GET_HVALUE(filter, _5$$4); - if (Z_TYPE_P(filter) != IS_OBJECT) { + zephir_is_iterable(&filters, 0, "phalcon/assets/manager.zep", 749); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&filters), _1$$4) + { + ZEPHIR_INIT_NVAR(&filter); + ZVAL_COPY(&filter, _1$$4); + if (Z_TYPE_P(&filter) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_assets_exception_ce, "Filter is invalid", "phalcon/assets/manager.zep", 740); return; } - ZEPHIR_CALL_METHOD(&_6$$5, filter, "filter", NULL, 0, content); + ZEPHIR_CALL_METHOD(&_2$$5, &filter, "filter", NULL, 0, &content); zephir_check_call_status(); - ZEPHIR_CPY_WRT(content, _6$$5); - } - if (zephir_is_true(join)) { - zephir_concat_self(&joinedContent, content TSRMLS_CC); + ZEPHIR_CPY_WRT(&content, &_2$$5); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&filter); + if (zephir_is_true(&join)) { + zephir_concat_self(&joinedContent, &content TSRMLS_CC); } else { - ZEPHIR_INIT_NVAR(_9$$8); - ZVAL_BOOL(_9$$8, 0); - ZEPHIR_INIT_NVAR(_10$$8); - ZVAL_BOOL(_10$$8, 1); - ZEPHIR_CALL_CE_STATIC(&_7$$8, phalcon_tag_ce, "taghtml", &_8, 0, type, attributes, _9$$8, _10$$8); + ZVAL_BOOL(&_5$$8, 0); + ZVAL_BOOL(&_6$$8, 1); + ZEPHIR_CALL_CE_STATIC(&_3$$8, phalcon_tag_ce, "taghtml", &_4, 0, type, &attributes, &_5$$8, &_6$$8); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_9$$8); - ZVAL_BOOL(_9$$8, 1); - ZEPHIR_CALL_CE_STATIC(&_11$$8, phalcon_tag_ce, "taghtmlclose", &_12, 0, type, _9$$8); + ZVAL_BOOL(&_5$$8, 1); + ZEPHIR_CALL_CE_STATIC(&_7$$8, phalcon_tag_ce, "taghtmlclose", &_8, 0, type, &_5$$8); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_13$$8); - ZEPHIR_CONCAT_VVV(_13$$8, _7$$8, content, _11$$8); - zephir_concat_self(&html, _13$$8 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_9$$8); + ZEPHIR_CONCAT_VVV(&_9$$8, &_3$$8, &content, &_7$$8); + zephir_concat_self(&html, &_9$$8 TSRMLS_CC); } - } - if (zephir_is_true(join)) { - ZEPHIR_INIT_VAR(_15$$9); - ZVAL_BOOL(_15$$9, 0); - ZEPHIR_INIT_VAR(_16$$9); - ZVAL_BOOL(_16$$9, 1); - ZEPHIR_CALL_CE_STATIC(&_14$$9, phalcon_tag_ce, "taghtml", &_8, 0, type, attributes, _15$$9, _16$$9); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&code); + if (zephir_is_true(&join)) { + ZVAL_BOOL(&_11$$9, 0); + ZVAL_BOOL(&_12$$9, 1); + ZEPHIR_CALL_CE_STATIC(&_10$$9, phalcon_tag_ce, "taghtml", &_4, 0, type, &attributes, &_11$$9, &_12$$9); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_15$$9); - ZVAL_BOOL(_15$$9, 1); - ZEPHIR_CALL_CE_STATIC(&_17$$9, phalcon_tag_ce, "taghtmlclose", &_12, 0, type, _15$$9); + ZVAL_BOOL(&_11$$9, 1); + ZEPHIR_CALL_CE_STATIC(&_13$$9, phalcon_tag_ce, "taghtmlclose", &_8, 0, type, &_11$$9); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_18$$9); - ZEPHIR_CONCAT_VVV(_18$$9, _14$$9, joinedContent, _17$$9); - zephir_concat_self(&html, _18$$9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_14$$9); + ZEPHIR_CONCAT_VVV(&_14$$9, &_10$$9, &joinedContent, &_13$$9); + zephir_concat_self(&html, &_14$$9 TSRMLS_CC); } - _19$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_implicitOutput"), PH_NOISY_CC); - if (ZEPHIR_IS_TRUE(_19$$3)) { - zend_print_zval(html, 0); + zephir_read_property(&_15$$3, this_ptr, SL("_implicitOutput"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_TRUE(&_15$$3)) { + zend_print_zval(&html, 0); } else { - zephir_concat_self(&output, html TSRMLS_CC); + zephir_concat_self(&output, &html TSRMLS_CC); } } - RETURN_CCTOR(output); + RETURN_CCTOR(&output); } @@ -1003,15 +1172,23 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInline) { */ PHP_METHOD(Phalcon_Assets_Manager, outputCss) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collectionName = NULL, *collection = NULL, *_1 = NULL; + zval *collectionName = NULL, collectionName_sub, __$null, collection, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collectionName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &collectionName); if (!collectionName) { - collectionName = ZEPHIR_GLOBAL(global_null); + collectionName = &collectionName_sub; + collectionName = &__$null; } @@ -1022,18 +1199,17 @@ PHP_METHOD(Phalcon_Assets_Manager, outputCss) { ZEPHIR_CALL_METHOD(&collection, this_ptr, "get", NULL, 0, collectionName); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "Phalcon\\Tag", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "stylesheetLink", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "css", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "output", NULL, 0, collection, _0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "Phalcon\\Tag"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "stylesheetLink"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "css"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "output", NULL, 0, &collection, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1047,13 +1223,20 @@ PHP_METHOD(Phalcon_Assets_Manager, outputCss) { PHP_METHOD(Phalcon_Assets_Manager, outputInlineCss) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collectionName = NULL, *collection = NULL, *_0; + zval *collectionName = NULL, collectionName_sub, __$null, collection, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collectionName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &collectionName); if (!collectionName) { - collectionName = ZEPHIR_GLOBAL(global_null); + collectionName = &collectionName_sub; + collectionName = &__$null; } @@ -1064,10 +1247,9 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInlineCss) { ZEPHIR_CALL_METHOD(&collection, this_ptr, "get", NULL, 0, collectionName); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "style", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputinline", NULL, 0, collection, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "style"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputinline", NULL, 0, &collection, &_0); zephir_check_call_status(); RETURN_MM(); @@ -1080,15 +1262,23 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInlineCss) { */ PHP_METHOD(Phalcon_Assets_Manager, outputJs) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collectionName = NULL, *collection = NULL, *_1 = NULL; + zval *collectionName = NULL, collectionName_sub, __$null, collection, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collectionName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &collectionName); if (!collectionName) { - collectionName = ZEPHIR_GLOBAL(global_null); + collectionName = &collectionName_sub; + collectionName = &__$null; } @@ -1099,18 +1289,17 @@ PHP_METHOD(Phalcon_Assets_Manager, outputJs) { ZEPHIR_CALL_METHOD(&collection, this_ptr, "get", NULL, 0, collectionName); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "Phalcon\\Tag", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "javascriptInclude", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "js", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "output", NULL, 0, collection, _0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "Phalcon\\Tag"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "javascriptInclude"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "js"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "output", NULL, 0, &collection, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1124,13 +1313,20 @@ PHP_METHOD(Phalcon_Assets_Manager, outputJs) { PHP_METHOD(Phalcon_Assets_Manager, outputInlineJs) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collectionName = NULL, *collection = NULL, *_0; + zval *collectionName = NULL, collectionName_sub, __$null, collection, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collectionName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &collectionName); if (!collectionName) { - collectionName = ZEPHIR_GLOBAL(global_null); + collectionName = &collectionName_sub; + collectionName = &__$null; } @@ -1141,10 +1337,9 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInlineJs) { ZEPHIR_CALL_METHOD(&collection, this_ptr, "get", NULL, 0, collectionName); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "script", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputinline", NULL, 0, collection, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "script"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputinline", NULL, 0, &collection, &_0); zephir_check_call_status(); RETURN_MM(); @@ -1155,7 +1350,8 @@ PHP_METHOD(Phalcon_Assets_Manager, outputInlineJs) { */ PHP_METHOD(Phalcon_Assets_Manager, getCollections) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_collections"); @@ -1173,26 +1369,30 @@ PHP_METHOD(Phalcon_Assets_Manager, getCollections) { */ PHP_METHOD(Phalcon_Assets_Manager, exists) { - zval *id_param = NULL, *_0; - zval *id = NULL; + zval *id_param = NULL, _0; + zval id; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &id_param); if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(id_param) == IS_STRING)) { - zephir_get_strval(id, id_param); + zephir_get_strval(&id, id_param); } else { - ZEPHIR_INIT_VAR(id); - ZVAL_EMPTY_STRING(id); + ZEPHIR_INIT_VAR(&id); + ZVAL_EMPTY_STRING(&id); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_collections"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, id)); + zephir_read_property(&_0, this_ptr, SL("_collections"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &id)); } diff --git a/ext/phalcon/assets/manager.zep.h b/ext/phalcon/assets/manager.zep.h index b2cd061461f..451fbc6f055 100644 --- a/ext/phalcon/assets/manager.zep.h +++ b/ext/phalcon/assets/manager.zep.h @@ -34,111 +34,271 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_setoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_setoptions, 0, 1, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_setoptions, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_useimplicitoutput, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_getoptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_getoptions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_useimplicitoutput, 0, 1, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_useimplicitoutput, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, implicitOutput, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, implicitOutput) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_addcss, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_addcss, 0, 1, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_addcss, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, local) ZEND_ARG_INFO(0, filter) ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_addinlinecss, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_addinlinecss, 0, 1, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_addinlinecss, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif ZEND_ARG_INFO(0, filter) ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_addjs, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_addjs, 0, 1, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_addjs, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, local) ZEND_ARG_INFO(0, filter) ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_addinlinejs, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_addinlinejs, 0, 1, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_addinlinejs, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif ZEND_ARG_INFO(0, filter) ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_addresourcebytype, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_addresourcebytype, 0, 2, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_addresourcebytype, 0, 2, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, resource, Phalcon\\Assets\\Resource, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_addinlinecodebytype, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_addinlinecodebytype, 0, 2, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_addinlinecodebytype, 0, 2, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, code, Phalcon\\Assets\\Inline, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_addresource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_addresource, 0, 1, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_addresource, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif ZEND_ARG_OBJ_INFO(0, resource, Phalcon\\Assets\\Resource, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_addinlinecode, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_addinlinecode, 0, 1, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_addinlinecode, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif ZEND_ARG_OBJ_INFO(0, code, Phalcon\\Assets\\Inline, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_set, 0, 2, Phalcon\\Assets\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_set, 0, 2, IS_OBJECT, "Phalcon\\Assets\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) +#else ZEND_ARG_INFO(0, id) +#endif ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Assets\\Collection, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_get, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_get, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) +#else ZEND_ARG_INFO(0, id) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_getcss, 0, 0, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_getcss, 0, 0, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_collection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_getjs, 0, 0, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_getjs, 0, 0, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_collection, 0, 1, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_collection, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_collectionresourcesbytype, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_collectionresourcesbytype, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_collectionresourcesbytype, 0, 2, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, resources, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_output, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_output, 0, 3, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_output, 0, 3, IS_STRING, NULL, 1) +#endif ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Assets\\Collection, 0) ZEND_ARG_INFO(0, callback) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_outputinline, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputinline, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputinline, 0, 2, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Assets\\Collection, 0) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_outputcss, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputcss, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputcss, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, collectionName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_outputinlinecss, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputinlinecss, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputinlinecss, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, collectionName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_outputjs, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputjs, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputjs, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, collectionName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_outputinlinejs, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputinlinejs, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_outputinlinejs, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, collectionName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_manager_exists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_manager_getcollections, 0, 0, Phalcon\\Assets\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_getcollections, 0, 0, IS_OBJECT, "Phalcon\\Assets\\Collection", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_exists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_manager_exists, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) +#else ZEND_ARG_INFO(0, id) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_assets_manager_method_entry) { PHP_ME(Phalcon_Assets_Manager, __construct, arginfo_phalcon_assets_manager___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Assets_Manager, setOptions, arginfo_phalcon_assets_manager_setoptions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Manager, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Manager, getOptions, arginfo_phalcon_assets_manager_getoptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, useImplicitOutput, arginfo_phalcon_assets_manager_useimplicitoutput, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, addCss, arginfo_phalcon_assets_manager_addcss, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, addInlineCss, arginfo_phalcon_assets_manager_addinlinecss, ZEND_ACC_PUBLIC) @@ -150,8 +310,8 @@ ZEPHIR_INIT_FUNCS(phalcon_assets_manager_method_entry) { PHP_ME(Phalcon_Assets_Manager, addInlineCode, arginfo_phalcon_assets_manager_addinlinecode, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, set, arginfo_phalcon_assets_manager_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, get, arginfo_phalcon_assets_manager_get, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Manager, getCss, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Manager, getJs, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Manager, getCss, arginfo_phalcon_assets_manager_getcss, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Manager, getJs, arginfo_phalcon_assets_manager_getjs, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, collection, arginfo_phalcon_assets_manager_collection, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, collectionResourcesByType, arginfo_phalcon_assets_manager_collectionresourcesbytype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, output, arginfo_phalcon_assets_manager_output, ZEND_ACC_PUBLIC) @@ -160,7 +320,7 @@ ZEPHIR_INIT_FUNCS(phalcon_assets_manager_method_entry) { PHP_ME(Phalcon_Assets_Manager, outputInlineCss, arginfo_phalcon_assets_manager_outputinlinecss, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, outputJs, arginfo_phalcon_assets_manager_outputjs, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, outputInlineJs, arginfo_phalcon_assets_manager_outputinlinejs, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Manager, getCollections, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Manager, getCollections, arginfo_phalcon_assets_manager_getcollections, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Manager, exists, arginfo_phalcon_assets_manager_exists, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/assets/resource.zep.c b/ext/phalcon/assets/resource.zep.c index b97baed2d73..159eb7b29af 100644 --- a/ext/phalcon/assets/resource.zep.c +++ b/ext/phalcon/assets/resource.zep.c @@ -75,7 +75,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Resource) { */ PHP_METHOD(Phalcon_Assets_Resource, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -85,7 +86,8 @@ PHP_METHOD(Phalcon_Assets_Resource, getType) { */ PHP_METHOD(Phalcon_Assets_Resource, getPath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_path"); @@ -95,7 +97,8 @@ PHP_METHOD(Phalcon_Assets_Resource, getPath) { */ PHP_METHOD(Phalcon_Assets_Resource, getLocal) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_local"); @@ -105,7 +108,8 @@ PHP_METHOD(Phalcon_Assets_Resource, getLocal) { */ PHP_METHOD(Phalcon_Assets_Resource, getFilter) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_filter"); @@ -115,7 +119,8 @@ PHP_METHOD(Phalcon_Assets_Resource, getFilter) { */ PHP_METHOD(Phalcon_Assets_Resource, getAttributes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_attributes"); @@ -123,7 +128,8 @@ PHP_METHOD(Phalcon_Assets_Resource, getAttributes) { PHP_METHOD(Phalcon_Assets_Resource, getSourcePath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sourcePath"); @@ -131,7 +137,8 @@ PHP_METHOD(Phalcon_Assets_Resource, getSourcePath) { PHP_METHOD(Phalcon_Assets_Resource, getTargetPath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_targetPath"); @@ -139,7 +146,8 @@ PHP_METHOD(Phalcon_Assets_Resource, getTargetPath) { PHP_METHOD(Phalcon_Assets_Resource, getTargetUri) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_targetUri"); @@ -157,14 +165,22 @@ PHP_METHOD(Phalcon_Assets_Resource, getTargetUri) { PHP_METHOD(Phalcon_Assets_Resource, __construct) { zend_bool local, filter; - zval *type_param = NULL, *path_param = NULL, *local_param = NULL, *filter_param = NULL, *attributes = NULL; - zval *type = NULL, *path = NULL; + zval *type_param = NULL, *path_param = NULL, *local_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$true, __$false, __$null; + zval type, path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&attributes_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 3, &type_param, &path_param, &local_param, &filter_param, &attributes); - zephir_get_strval(type, type_param); - zephir_get_strval(path, path_param); + zephir_get_strval(&type, type_param); + zephir_get_strval(&path, path_param); if (!local_param) { local = 1; } else { @@ -176,24 +192,25 @@ PHP_METHOD(Phalcon_Assets_Resource, __construct) { filter = zephir_get_boolval(filter_param); } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_path"), path TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), &type); + zephir_update_property_zval(this_ptr, SL("_path"), &path); if (local) { - zephir_update_property_this(getThis(), SL("_local"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_local"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_local"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_local"), &__$false); } if (filter) { - zephir_update_property_this(getThis(), SL("_filter"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filter"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_filter"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filter"), &__$false); } if (Z_TYPE_P(attributes) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_attributes"), attributes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_attributes"), attributes); } ZEPHIR_MM_RESTORE(); @@ -205,15 +222,18 @@ PHP_METHOD(Phalcon_Assets_Resource, __construct) { PHP_METHOD(Phalcon_Assets_Resource, setType) { zval *type_param = NULL; - zval *type = NULL; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &type_param); - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), &type); RETURN_THIS(); } @@ -224,15 +244,18 @@ PHP_METHOD(Phalcon_Assets_Resource, setType) { PHP_METHOD(Phalcon_Assets_Resource, setPath) { zval *path_param = NULL; - zval *path = NULL; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &path_param); - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); - zephir_update_property_this(getThis(), SL("_path"), path TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_path"), &path); RETURN_THIS(); } @@ -242,8 +265,12 @@ PHP_METHOD(Phalcon_Assets_Resource, setPath) { */ PHP_METHOD(Phalcon_Assets_Resource, setLocal) { - zval *local_param = NULL; + zval *local_param = NULL, __$true, __$false; zend_bool local; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &local_param); @@ -251,9 +278,9 @@ PHP_METHOD(Phalcon_Assets_Resource, setLocal) { if (local) { - zephir_update_property_this(getThis(), SL("_local"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_local"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_local"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_local"), &__$false); } RETURN_THISW(); @@ -264,8 +291,12 @@ PHP_METHOD(Phalcon_Assets_Resource, setLocal) { */ PHP_METHOD(Phalcon_Assets_Resource, setFilter) { - zval *filter_param = NULL; + zval *filter_param = NULL, __$true, __$false; zend_bool filter; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &filter_param); @@ -273,9 +304,9 @@ PHP_METHOD(Phalcon_Assets_Resource, setFilter) { if (filter) { - zephir_update_property_this(getThis(), SL("_filter"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filter"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_filter"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filter"), &__$false); } RETURN_THISW(); @@ -287,15 +318,18 @@ PHP_METHOD(Phalcon_Assets_Resource, setFilter) { PHP_METHOD(Phalcon_Assets_Resource, setAttributes) { zval *attributes_param = NULL; - zval *attributes = NULL; + zval attributes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attributes_param); - zephir_get_arrval(attributes, attributes_param); + zephir_get_arrval(&attributes, attributes_param); - zephir_update_property_this(getThis(), SL("_attributes"), attributes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_attributes"), &attributes); RETURN_THIS(); } @@ -306,15 +340,18 @@ PHP_METHOD(Phalcon_Assets_Resource, setAttributes) { PHP_METHOD(Phalcon_Assets_Resource, setTargetUri) { zval *targetUri_param = NULL; - zval *targetUri = NULL; + zval targetUri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&targetUri); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &targetUri_param); - zephir_get_strval(targetUri, targetUri_param); + zephir_get_strval(&targetUri, targetUri_param); - zephir_update_property_this(getThis(), SL("_targetUri"), targetUri TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_targetUri"), &targetUri); RETURN_THIS(); } @@ -325,15 +362,18 @@ PHP_METHOD(Phalcon_Assets_Resource, setTargetUri) { PHP_METHOD(Phalcon_Assets_Resource, setSourcePath) { zval *sourcePath_param = NULL; - zval *sourcePath = NULL; + zval sourcePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sourcePath); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sourcePath_param); - zephir_get_strval(sourcePath, sourcePath_param); + zephir_get_strval(&sourcePath, sourcePath_param); - zephir_update_property_this(getThis(), SL("_sourcePath"), sourcePath TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sourcePath"), &sourcePath); RETURN_THIS(); } @@ -344,15 +384,18 @@ PHP_METHOD(Phalcon_Assets_Resource, setSourcePath) { PHP_METHOD(Phalcon_Assets_Resource, setTargetPath) { zval *targetPath_param = NULL; - zval *targetPath = NULL; + zval targetPath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&targetPath); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &targetPath_param); - zephir_get_strval(targetPath, targetPath_param); + zephir_get_strval(&targetPath, targetPath_param); - zephir_update_property_this(getThis(), SL("_targetPath"), targetPath TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_targetPath"), &targetPath); RETURN_THIS(); } @@ -364,56 +407,67 @@ PHP_METHOD(Phalcon_Assets_Resource, setTargetPath) { PHP_METHOD(Phalcon_Assets_Resource, getContent) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *basePath_param = NULL, *sourcePath = NULL, *completePath = NULL, *content = NULL, *_0, *_1$$5, *_2$$5, *_3$$6, *_4$$6; - zval *basePath = NULL; + zval *basePath_param = NULL, sourcePath, completePath, content, _0, _1$$5, _2$$5, _3$$6, _4$$6; + zval basePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&basePath); + ZVAL_UNDEF(&sourcePath); + ZVAL_UNDEF(&completePath); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &basePath_param); if (!basePath_param) { - ZEPHIR_INIT_VAR(basePath); - ZVAL_EMPTY_STRING(basePath); + ZEPHIR_INIT_VAR(&basePath); + ZVAL_STRING(&basePath, ""); } else { - zephir_get_strval(basePath, basePath_param); + zephir_get_strval(&basePath, basePath_param); } - ZEPHIR_OBS_VAR(sourcePath); - zephir_read_property_this(&sourcePath, this_ptr, SL("_sourcePath"), PH_NOISY_CC); - if (ZEPHIR_IS_EMPTY(sourcePath)) { - ZEPHIR_OBS_NVAR(sourcePath); - zephir_read_property_this(&sourcePath, this_ptr, SL("_path"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&sourcePath); + zephir_read_property(&sourcePath, this_ptr, SL("_sourcePath"), PH_NOISY_CC); + if (ZEPHIR_IS_EMPTY(&sourcePath)) { + ZEPHIR_OBS_NVAR(&sourcePath); + zephir_read_property(&sourcePath, this_ptr, SL("_path"), PH_NOISY_CC); } - ZEPHIR_INIT_VAR(completePath); - ZEPHIR_CONCAT_VV(completePath, basePath, sourcePath); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_local"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - if (!((zephir_file_exists(completePath TSRMLS_CC) == SUCCESS))) { - ZEPHIR_INIT_VAR(_1$$5); - object_init_ex(_1$$5, phalcon_assets_exception_ce); - ZEPHIR_INIT_VAR(_2$$5); - ZEPHIR_CONCAT_SVS(_2$$5, "Resource's content for '", completePath, "' cannot be read"); - ZEPHIR_CALL_METHOD(NULL, _1$$5, "__construct", NULL, 9, _2$$5); + ZEPHIR_INIT_VAR(&completePath); + ZEPHIR_CONCAT_VV(&completePath, &basePath, &sourcePath); + zephir_read_property(&_0, this_ptr, SL("_local"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + if (!((zephir_file_exists(&completePath TSRMLS_CC) == SUCCESS))) { + ZEPHIR_INIT_VAR(&_1$$5); + object_init_ex(&_1$$5, phalcon_assets_exception_ce); + ZEPHIR_INIT_VAR(&_2$$5); + ZEPHIR_CONCAT_SVS(&_2$$5, "Resource's content for '", &completePath, "' cannot be read"); + ZEPHIR_CALL_METHOD(NULL, &_1$$5, "__construct", NULL, 4, &_2$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$5, "phalcon/assets/resource.zep", 183 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$5, "phalcon/assets/resource.zep", 183 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - ZEPHIR_INIT_VAR(content); - zephir_file_get_contents(content, completePath TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(content)) { - ZEPHIR_INIT_VAR(_3$$6); - object_init_ex(_3$$6, phalcon_assets_exception_ce); - ZEPHIR_INIT_VAR(_4$$6); - ZEPHIR_CONCAT_SVS(_4$$6, "Resource's content for '", completePath, "' cannot be read"); - ZEPHIR_CALL_METHOD(NULL, _3$$6, "__construct", NULL, 9, _4$$6); + ZEPHIR_INIT_VAR(&content); + zephir_file_get_contents(&content, &completePath TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&content)) { + ZEPHIR_INIT_VAR(&_3$$6); + object_init_ex(&_3$$6, phalcon_assets_exception_ce); + ZEPHIR_INIT_VAR(&_4$$6); + ZEPHIR_CONCAT_SVS(&_4$$6, "Resource's content for '", &completePath, "' cannot be read"); + ZEPHIR_CALL_METHOD(NULL, &_3$$6, "__construct", NULL, 4, &_4$$6); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$6, "phalcon/assets/resource.zep", 192 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$6, "phalcon/assets/resource.zep", 192 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - RETURN_CCTOR(content); + RETURN_CCTOR(&content); } @@ -422,17 +476,20 @@ PHP_METHOD(Phalcon_Assets_Resource, getContent) { */ PHP_METHOD(Phalcon_Assets_Resource, getRealTargetUri) { - zval *targetUri = NULL; + zval targetUri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&targetUri); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(targetUri); - zephir_read_property_this(&targetUri, this_ptr, SL("_targetUri"), PH_NOISY_CC); - if (ZEPHIR_IS_EMPTY(targetUri)) { - ZEPHIR_OBS_NVAR(targetUri); - zephir_read_property_this(&targetUri, this_ptr, SL("_path"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&targetUri); + zephir_read_property(&targetUri, this_ptr, SL("_targetUri"), PH_NOISY_CC); + if (ZEPHIR_IS_EMPTY(&targetUri)) { + ZEPHIR_OBS_NVAR(&targetUri); + zephir_read_property(&targetUri, this_ptr, SL("_path"), PH_NOISY_CC); } - RETURN_CCTOR(targetUri); + RETURN_CCTOR(&targetUri); } @@ -442,35 +499,41 @@ PHP_METHOD(Phalcon_Assets_Resource, getRealTargetUri) { PHP_METHOD(Phalcon_Assets_Resource, getRealSourcePath) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *basePath_param = NULL, *sourcePath = NULL, *_0, *_1$$4; - zval *basePath = NULL; + zval *basePath_param = NULL, sourcePath, _0, _1$$4; + zval basePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&basePath); + ZVAL_UNDEF(&sourcePath); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &basePath_param); if (!basePath_param) { - ZEPHIR_INIT_VAR(basePath); - ZVAL_EMPTY_STRING(basePath); + ZEPHIR_INIT_VAR(&basePath); + ZVAL_STRING(&basePath, ""); } else { - zephir_get_strval(basePath, basePath_param); + zephir_get_strval(&basePath, basePath_param); } - ZEPHIR_OBS_VAR(sourcePath); - zephir_read_property_this(&sourcePath, this_ptr, SL("_sourcePath"), PH_NOISY_CC); - if (ZEPHIR_IS_EMPTY(sourcePath)) { - ZEPHIR_OBS_NVAR(sourcePath); - zephir_read_property_this(&sourcePath, this_ptr, SL("_path"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&sourcePath); + zephir_read_property(&sourcePath, this_ptr, SL("_sourcePath"), PH_NOISY_CC); + if (ZEPHIR_IS_EMPTY(&sourcePath)) { + ZEPHIR_OBS_NVAR(&sourcePath); + zephir_read_property(&sourcePath, this_ptr, SL("_path"), PH_NOISY_CC); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_local"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_VV(_1$$4, basePath, sourcePath); - ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 67, _1$$4); + zephir_read_property(&_0, this_ptr, SL("_local"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_VV(&_1$$4, &basePath, &sourcePath); + ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 60, &_1$$4); zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(sourcePath); + RETURN_CCTOR(&sourcePath); } @@ -480,38 +543,44 @@ PHP_METHOD(Phalcon_Assets_Resource, getRealSourcePath) { PHP_METHOD(Phalcon_Assets_Resource, getRealTargetPath) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *basePath_param = NULL, *targetPath = NULL, *completePath = NULL, *_0; - zval *basePath = NULL; + zval *basePath_param = NULL, targetPath, completePath, _0; + zval basePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&basePath); + ZVAL_UNDEF(&targetPath); + ZVAL_UNDEF(&completePath); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &basePath_param); if (!basePath_param) { - ZEPHIR_INIT_VAR(basePath); - ZVAL_EMPTY_STRING(basePath); + ZEPHIR_INIT_VAR(&basePath); + ZVAL_STRING(&basePath, ""); } else { - zephir_get_strval(basePath, basePath_param); + zephir_get_strval(&basePath, basePath_param); } - ZEPHIR_OBS_VAR(targetPath); - zephir_read_property_this(&targetPath, this_ptr, SL("_targetPath"), PH_NOISY_CC); - if (ZEPHIR_IS_EMPTY(targetPath)) { - ZEPHIR_OBS_NVAR(targetPath); - zephir_read_property_this(&targetPath, this_ptr, SL("_path"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&targetPath); + zephir_read_property(&targetPath, this_ptr, SL("_targetPath"), PH_NOISY_CC); + if (ZEPHIR_IS_EMPTY(&targetPath)) { + ZEPHIR_OBS_NVAR(&targetPath); + zephir_read_property(&targetPath, this_ptr, SL("_path"), PH_NOISY_CC); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_local"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - ZEPHIR_INIT_VAR(completePath); - ZEPHIR_CONCAT_VV(completePath, basePath, targetPath); - if ((zephir_file_exists(completePath TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 67, completePath); + zephir_read_property(&_0, this_ptr, SL("_local"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + ZEPHIR_INIT_VAR(&completePath); + ZEPHIR_CONCAT_VV(&completePath, &basePath, &targetPath); + if ((zephir_file_exists(&completePath TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_FUNCTION("realpath", NULL, 60, &completePath); zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(completePath); + RETURN_CCTOR(&completePath); } - RETURN_CCTOR(targetPath); + RETURN_CCTOR(&targetPath); } @@ -520,8 +589,13 @@ PHP_METHOD(Phalcon_Assets_Resource, getRealTargetPath) { */ PHP_METHOD(Phalcon_Assets_Resource, getResourceKey) { - zval *key = NULL, *_0 = NULL, *_1 = NULL; + zval key, _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); @@ -529,9 +603,9 @@ PHP_METHOD(Phalcon_Assets_Resource, getResourceKey) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getpath", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(key); - ZEPHIR_CONCAT_VSV(key, _0, ":", _1); - zephir_md5(return_value, key); + ZEPHIR_INIT_VAR(&key); + ZEPHIR_CONCAT_VSV(&key, &_0, ":", &_1); + zephir_md5(return_value, &key); RETURN_MM(); } diff --git a/ext/phalcon/assets/resource.zep.h b/ext/phalcon/assets/resource.zep.h index 8f94eb06635..45bcde1d1fe 100644 --- a/ext/phalcon/assets/resource.zep.h +++ b/ext/phalcon/assets/resource.zep.h @@ -26,64 +26,206 @@ PHP_METHOD(Phalcon_Assets_Resource, getRealSourcePath); PHP_METHOD(Phalcon_Assets_Resource, getRealTargetPath); PHP_METHOD(Phalcon_Assets_Resource, getResourceKey); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_gettype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_gettype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getpath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getpath, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getfilter, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getfilter, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getattributes, 0, 0, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getattributes, 0, 0, IS_ARRAY, NULL, 1) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource___construct, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, local, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, local) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_settype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resource_settype, 0, 1, Phalcon\\Assets\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_settype, 0, 1, IS_OBJECT, "Phalcon\\Assets\\ResourceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_setpath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resource_setpath, 0, 1, Phalcon\\Assets\\Resource, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_setpath, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Resource", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_setlocal, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resource_setlocal, 0, 1, Phalcon\\Assets\\Resource, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_setlocal, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Resource", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, local, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, local) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_setfilter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resource_setfilter, 0, 1, Phalcon\\Assets\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_setfilter, 0, 1, IS_OBJECT, "Phalcon\\Assets\\ResourceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_setattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resource_setattributes, 0, 1, Phalcon\\Assets\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_setattributes, 0, 1, IS_OBJECT, "Phalcon\\Assets\\ResourceInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_settargeturi, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resource_settargeturi, 0, 1, Phalcon\\Assets\\Resource, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_settargeturi, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Resource", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, targetUri, IS_STRING, 0) +#else ZEND_ARG_INFO(0, targetUri) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_setsourcepath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resource_setsourcepath, 0, 1, Phalcon\\Assets\\Resource, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_setsourcepath, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Resource", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sourcePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sourcePath) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_settargetpath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resource_settargetpath, 0, 1, Phalcon\\Assets\\Resource, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_settargetpath, 0, 1, IS_OBJECT, "Phalcon\\Assets\\Resource", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, targetPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, targetPath) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_getcontent, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getcontent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getcontent, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, basePath, IS_STRING, 1) +#else ZEND_ARG_INFO(0, basePath) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getrealtargeturi, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getrealtargeturi, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_getrealsourcepath, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getrealsourcepath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getrealsourcepath, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, basePath, IS_STRING, 1) +#else ZEND_ARG_INFO(0, basePath) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_getrealtargetpath, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getrealtargetpath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getrealtargetpath, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, basePath, IS_STRING, 1) +#else ZEND_ARG_INFO(0, basePath) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getresourcekey, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resource_getresourcekey, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_assets_resource_method_entry) { - PHP_ME(Phalcon_Assets_Resource, getType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Resource, getPath, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Resource, getType, arginfo_phalcon_assets_resource_gettype, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Resource, getPath, arginfo_phalcon_assets_resource_getpath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getLocal, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Resource, getFilter, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Resource, getAttributes, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Resource, getFilter, arginfo_phalcon_assets_resource_getfilter, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Resource, getAttributes, arginfo_phalcon_assets_resource_getattributes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getSourcePath, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getTargetPath, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getTargetUri, NULL, ZEND_ACC_PUBLIC) @@ -97,9 +239,9 @@ ZEPHIR_INIT_FUNCS(phalcon_assets_resource_method_entry) { PHP_ME(Phalcon_Assets_Resource, setSourcePath, arginfo_phalcon_assets_resource_setsourcepath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, setTargetPath, arginfo_phalcon_assets_resource_settargetpath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getContent, arginfo_phalcon_assets_resource_getcontent, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Resource, getRealTargetUri, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Resource, getRealTargetUri, arginfo_phalcon_assets_resource_getrealtargeturi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getRealSourcePath, arginfo_phalcon_assets_resource_getrealsourcepath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Assets_Resource, getRealTargetPath, arginfo_phalcon_assets_resource_getrealtargetpath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Assets_Resource, getResourceKey, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Assets_Resource, getResourceKey, arginfo_phalcon_assets_resource_getresourcekey, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/assets/resource/css.zep.c b/ext/phalcon/assets/resource/css.zep.c index b598335e4e2..84f388ed9d2 100644 --- a/ext/phalcon/assets/resource/css.zep.c +++ b/ext/phalcon/assets/resource/css.zep.c @@ -45,21 +45,29 @@ PHP_METHOD(Phalcon_Assets_Resource_Css, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zend_bool local, filter; - zval *path_param = NULL, *local_param = NULL, *filter_param = NULL, *attributes = NULL, *_1, *_2, *_3; - zval *path = NULL; + zval *path_param = NULL, *local_param = NULL, *filter_param = NULL, *attributes = NULL, attributes_sub, __$null, _1, _2, _3; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &path_param, &local_param, &filter_param, &attributes); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } if (!local_param) { local = 1; @@ -72,26 +80,24 @@ PHP_METHOD(Phalcon_Assets_Resource_Css, __construct) { filter = zephir_get_boolval(filter_param); } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "css", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_2); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "css"); if (local) { - ZVAL_BOOL(_2, 1); + ZVAL_BOOL(&_2, 1); } else { - ZVAL_BOOL(_2, 0); + ZVAL_BOOL(&_2, 0); } - ZEPHIR_INIT_VAR(_3); if (filter) { - ZVAL_BOOL(_3, 1); + ZVAL_BOOL(&_3, 1); } else { - ZVAL_BOOL(_3, 0); + ZVAL_BOOL(&_3, 0); } - ZEPHIR_CALL_PARENT(NULL, phalcon_assets_resource_css_ce, getThis(), "__construct", &_0, 114, _1, path, _2, _3, attributes); - zephir_check_temp_parameter(_1); + ZEPHIR_CALL_PARENT(NULL, phalcon_assets_resource_css_ce, getThis(), "__construct", &_0, 0, &_1, &path, &_2, &_3, attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/assets/resource/css.zep.h b/ext/phalcon/assets/resource/css.zep.h index 7e8f01e2cac..c2870b94639 100644 --- a/ext/phalcon/assets/resource/css.zep.h +++ b/ext/phalcon/assets/resource/css.zep.h @@ -6,9 +6,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Assets_Resource_Css); PHP_METHOD(Phalcon_Assets_Resource_Css, __construct); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resource_css___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, local, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, local) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/assets/resource/js.zep.c b/ext/phalcon/assets/resource/js.zep.c index ab537e692d4..c358b02c1ff 100644 --- a/ext/phalcon/assets/resource/js.zep.c +++ b/ext/phalcon/assets/resource/js.zep.c @@ -41,26 +41,37 @@ PHP_METHOD(Phalcon_Assets_Resource_Js, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *path, *local = NULL, *filter = NULL, *attributes = NULL, *_1; + zval *path, path_sub, *local = NULL, local_sub, *filter = NULL, filter_sub, *attributes = NULL, attributes_sub, __$true, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path_sub); + ZVAL_UNDEF(&local_sub); + ZVAL_UNDEF(&filter_sub); + ZVAL_UNDEF(&attributes_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &path, &local, &filter, &attributes); if (!local) { - local = ZEPHIR_GLOBAL(global_true); + local = &local_sub; + local = &__$true; } if (!filter) { - filter = ZEPHIR_GLOBAL(global_true); + filter = &filter_sub; + filter = &__$true; } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "js", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_PARENT(NULL, phalcon_assets_resource_js_ce, getThis(), "__construct", &_0, 114, _1, path, local, filter, attributes); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "js"); + ZEPHIR_CALL_PARENT(NULL, phalcon_assets_resource_js_ce, getThis(), "__construct", &_0, 0, &_1, path, local, filter, attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/assets/resourceinterface.zep.h b/ext/phalcon/assets/resourceinterface.zep.h index 36f7bf8d6b3..0837fefa105 100644 --- a/ext/phalcon/assets/resourceinterface.zep.h +++ b/ext/phalcon/assets/resourceinterface.zep.h @@ -3,25 +3,73 @@ extern zend_class_entry *phalcon_assets_resourceinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Assets_ResourceInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resourceinterface_settype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resourceinterface_settype, 0, 1, Phalcon\\Assets\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_settype, 0, 1, IS_OBJECT, "Phalcon\\Assets\\ResourceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resourceinterface_setfilter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_gettype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_gettype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resourceinterface_setfilter, 0, 1, Phalcon\\Assets\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_setfilter, 0, 1, IS_OBJECT, "Phalcon\\Assets\\ResourceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, filter) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_getfilter, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_getfilter, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_assets_resourceinterface_setattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_assets_resourceinterface_setattributes, 0, 1, Phalcon\\Assets\\ResourceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_setattributes, 0, 1, IS_OBJECT, "Phalcon\\Assets\\ResourceInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_getattributes, 0, 0, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_getattributes, 0, 0, IS_ARRAY, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_getresourcekey, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_assets_resourceinterface_getresourcekey, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_assets_resourceinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, setType, arginfo_phalcon_assets_resourceinterface_settype) - PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, getType, NULL) + PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, getType, arginfo_phalcon_assets_resourceinterface_gettype) PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, setFilter, arginfo_phalcon_assets_resourceinterface_setfilter) - PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, getFilter, NULL) + PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, getFilter, arginfo_phalcon_assets_resourceinterface_getfilter) PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, setAttributes, arginfo_phalcon_assets_resourceinterface_setattributes) - PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, getAttributes, NULL) - PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, getResourceKey, NULL) + PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, getAttributes, arginfo_phalcon_assets_resourceinterface_getattributes) + PHP_ABSTRACT_ME(Phalcon_Assets_ResourceInterface, getResourceKey, arginfo_phalcon_assets_resourceinterface_getresourcekey) PHP_FE_END }; diff --git a/ext/phalcon/cache/backend.zep.c b/ext/phalcon/cache/backend.zep.c index e8b4a6d78bf..0d230aefc10 100644 --- a/ext/phalcon/cache/backend.zep.c +++ b/ext/phalcon/cache/backend.zep.c @@ -49,7 +49,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Backend) { PHP_METHOD(Phalcon_Cache_Backend, getFrontend) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_frontend"); @@ -57,20 +58,24 @@ PHP_METHOD(Phalcon_Cache_Backend, getFrontend) { PHP_METHOD(Phalcon_Cache_Backend, setFrontend) { - zval *frontend; + zval *frontend, frontend_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontend_sub); zephir_fetch_params(0, 1, 0, &frontend); - zephir_update_property_this(getThis(), SL("_frontend"), frontend TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_frontend"), frontend); RETURN_THISW(); } PHP_METHOD(Phalcon_Cache_Backend, getOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -78,20 +83,24 @@ PHP_METHOD(Phalcon_Cache_Backend, getOptions) { PHP_METHOD(Phalcon_Cache_Backend, setOptions) { - zval *options; + zval *options, options_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); zephir_fetch_params(0, 1, 0, &options); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), options); RETURN_THISW(); } PHP_METHOD(Phalcon_Cache_Backend, getLastKey) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lastKey"); @@ -99,13 +108,16 @@ PHP_METHOD(Phalcon_Cache_Backend, getLastKey) { PHP_METHOD(Phalcon_Cache_Backend, setLastKey) { - zval *lastKey; + zval *lastKey, lastKey_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&lastKey_sub); zephir_fetch_params(0, 1, 0, &lastKey); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_lastKey"), lastKey); RETURN_THISW(); } @@ -118,20 +130,27 @@ PHP_METHOD(Phalcon_Cache_Backend, setLastKey) { */ PHP_METHOD(Phalcon_Cache_Backend, __construct) { - zval *frontend, *options = NULL, *prefix = NULL; + zval *frontend, frontend_sub, *options = NULL, options_sub, __$null, prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontend_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefix); zephir_fetch_params(0, 1, 1, &frontend, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + if (zephir_array_isset_string_fetch(&prefix, options, SL("prefix"), 1)) { + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); } - zephir_update_property_this(getThis(), SL("_frontend"), frontend TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_frontend"), frontend); + zephir_update_property_zval(this_ptr, SL("_options"), options); } @@ -146,40 +165,50 @@ PHP_METHOD(Phalcon_Cache_Backend, start) { zend_bool fresh = 0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *lifetime = NULL, *existingCache = NULL, *_0$$3; + zval *keyName, keyName_sub, *lifetime = NULL, lifetime_sub, __$true, __$false, __$null, existingCache, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&existingCache); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &lifetime); if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } ZEPHIR_CALL_METHOD(&existingCache, this_ptr, "get", NULL, 0, keyName, lifetime); zephir_check_call_status(); - if (Z_TYPE_P(existingCache) == IS_NULL) { + if (Z_TYPE_P(&existingCache) == IS_NULL) { fresh = 1; - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "start", NULL, 0); + zephir_read_property(&_0$$3, this_ptr, SL("_frontend"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "start", NULL, 0); zephir_check_call_status(); } else { fresh = 0; } if (fresh) { - zephir_update_property_this(getThis(), SL("_fresh"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_fresh"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_fresh"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_fresh"), &__$false); } if (1) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } if (Z_TYPE_P(lifetime) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_lastLifetime"), lifetime TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_lastLifetime"), lifetime); } - RETURN_CCTOR(existingCache); + RETURN_CCTOR(&existingCache); } @@ -189,8 +218,13 @@ PHP_METHOD(Phalcon_Cache_Backend, start) { PHP_METHOD(Phalcon_Cache_Backend, stop) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *stopBuffer_param = NULL, *_0$$3; + zval *stopBuffer_param = NULL, __$true, __$false, _0$$3; zend_bool stopBuffer; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &stopBuffer_param); @@ -203,14 +237,14 @@ PHP_METHOD(Phalcon_Cache_Backend, stop) { if (stopBuffer == 1) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "stop", NULL, 0); + zephir_read_property(&_0$$3, this_ptr, SL("_frontend"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "stop", NULL, 0); zephir_check_call_status(); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } ZEPHIR_MM_RESTORE(); @@ -221,7 +255,8 @@ PHP_METHOD(Phalcon_Cache_Backend, stop) { */ PHP_METHOD(Phalcon_Cache_Backend, isFresh) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_fresh"); @@ -232,7 +267,8 @@ PHP_METHOD(Phalcon_Cache_Backend, isFresh) { */ PHP_METHOD(Phalcon_Cache_Backend, isStarted) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_started"); @@ -245,7 +281,8 @@ PHP_METHOD(Phalcon_Cache_Backend, isStarted) { */ PHP_METHOD(Phalcon_Cache_Backend, getLifetime) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lastLifetime"); diff --git a/ext/phalcon/cache/backend.zep.h b/ext/phalcon/cache/backend.zep.h index 540e5be1d3d..b38f809a8c1 100644 --- a/ext/phalcon/cache/backend.zep.h +++ b/ext/phalcon/cache/backend.zep.h @@ -39,7 +39,32 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_start, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_stop, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_isfresh, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_isfresh, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_isstarted, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_isstarted, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_getlifetime, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_getlifetime, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backend_method_entry) { @@ -52,8 +77,8 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_method_entry) { PHP_ME(Phalcon_Cache_Backend, __construct, arginfo_phalcon_cache_backend___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Cache_Backend, start, arginfo_phalcon_cache_backend_start, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend, stop, arginfo_phalcon_cache_backend_stop, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend, isFresh, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend, isStarted, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend, getLifetime, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend, isFresh, arginfo_phalcon_cache_backend_isfresh, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend, isStarted, arginfo_phalcon_cache_backend_isstarted, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend, getLifetime, arginfo_phalcon_cache_backend_getlifetime, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cache/backend/apc.zep.c b/ext/phalcon/cache/backend/apc.zep.c index 0b92dea4d7e..661904a241d 100644 --- a/ext/phalcon/cache/backend/apc.zep.c +++ b/ext/phalcon/cache/backend/apc.zep.c @@ -71,13 +71,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Backend_Apc) { PHP_METHOD(Phalcon_Cache_Backend_Apc, get) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *lifetime_param = NULL, *prefixedKey = NULL, *cachedContent = NULL, *_0, *_1; - zval *keyName = NULL; + zval *keyName_param = NULL, *lifetime_param = NULL, prefixedKey, cachedContent, _0, _1; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName_param, &lifetime_param); - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); if (!lifetime_param) { lifetime = 0; } else { @@ -85,17 +92,17 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, get) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_SVV(prefixedKey, "_PHCA", _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&cachedContent, "apc_fetch", NULL, 90, prefixedKey); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_SVV(&prefixedKey, "_PHCA", &_0, &keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + ZEPHIR_CALL_FUNCTION(&cachedContent, "apc_fetch", NULL, 81, &prefixedKey); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(cachedContent)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&cachedContent)) { RETURN_MM_NULL(); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_1, "afterretrieve", NULL, 0, cachedContent); + zephir_read_property(&_1, this_ptr, SL("_frontend"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_1, "afterretrieve", NULL, 0, &cachedContent); zephir_check_call_status(); RETURN_MM(); @@ -113,19 +120,38 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, save) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend = NULL, *cachedContent = NULL, *preparedContent = NULL, *ttl = NULL, *isBuffering = NULL, *success = NULL, *_0$$4; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer_param = NULL, __$true, __$false, __$null, lastKey, frontend, cachedContent, preparedContent, ttl, isBuffering, success, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&preparedContent); + ZVAL_UNDEF(&ttl); + ZVAL_UNDEF(&isBuffering); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - ZEPHIR_CPY_WRT(lifetime, ZEPHIR_GLOBAL(global_null)); + lifetime = &lifetime_sub; + ZEPHIR_CPY_WRT(lifetime, &__$null); } else { ZEPHIR_SEPARATE_PARAM(lifetime); } @@ -137,65 +163,65 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, save) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCA", _0$$4, keyName); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCA", &_0$$4, keyName); } - if (!(zephir_is_true(lastKey))) { + if (!(zephir_is_true(&lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/apc.zep", 98); return; } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); if (Z_TYPE_P(content) == IS_NULL) { - ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&cachedContent, &frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(cachedContent, content); + ZEPHIR_CPY_WRT(&cachedContent, content); } - if (!(zephir_is_numeric(cachedContent))) { - ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); + if (!(zephir_is_numeric(&cachedContent))) { + ZEPHIR_CALL_METHOD(&preparedContent, &frontend, "beforestore", NULL, 0, &cachedContent); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedContent, cachedContent); + ZEPHIR_CPY_WRT(&preparedContent, &cachedContent); } if (Z_TYPE_P(lifetime) == IS_NULL) { ZEPHIR_OBS_NVAR(lifetime); - zephir_read_property_this(&lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + zephir_read_property(lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); if (Z_TYPE_P(lifetime) == IS_NULL) { - ZEPHIR_CALL_METHOD(&ttl, frontend, "getlifetime", NULL, 0); + ZEPHIR_CALL_METHOD(&ttl, &frontend, "getlifetime", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(ttl, lifetime); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + ZEPHIR_CPY_WRT(&ttl, lifetime); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } } else { - ZEPHIR_CPY_WRT(ttl, lifetime); + ZEPHIR_CPY_WRT(&ttl, lifetime); } - ZEPHIR_CALL_FUNCTION(&success, "apc_store", NULL, 91, lastKey, preparedContent, ttl); + ZEPHIR_CALL_FUNCTION(&success, "apc_store", NULL, 82, &lastKey, &preparedContent, &ttl); zephir_check_call_status(); - if (!(zephir_is_true(success))) { + if (!(zephir_is_true(&success))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing data in apc", "phalcon/cache/backend/apc.zep", 135); return; } - ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0); + ZEPHIR_CALL_METHOD(&isBuffering, &frontend, "isbuffering", NULL, 0); zephir_check_call_status(); if (stopBuffer == 1) { - ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &frontend, "stop", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) { - zend_print_zval(cachedContent, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&isBuffering)) { + zend_print_zval(&cachedContent, 0); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -207,13 +233,23 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, save) { PHP_METHOD(Phalcon_Cache_Backend_Apc, increment) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *prefixedKey = NULL, *cachedContent = NULL, *result = NULL, *_0, *_1$$3; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, prefixedKey, cachedContent, result, _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -222,25 +258,24 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, increment) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_SVV(prefixedKey, "_PHCA", _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - if ((zephir_function_exists_ex(SS("apc_inc") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_LONG(_1$$3, value); - ZEPHIR_CALL_FUNCTION(&result, "apc_inc", NULL, 115, prefixedKey, _1$$3); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_SVV(&prefixedKey, "_PHCA", &_0, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + if ((zephir_function_exists_ex(SL("apc_inc") TSRMLS_CC) == SUCCESS)) { + ZVAL_LONG(&_1$$3, value); + ZEPHIR_CALL_FUNCTION(&result, "apc_inc", NULL, 102, &prefixedKey, &_1$$3); zephir_check_call_status(); - RETURN_CCTOR(result); + RETURN_CCTOR(&result); } else { - ZEPHIR_CALL_FUNCTION(&cachedContent, "apc_fetch", NULL, 90, prefixedKey); + ZEPHIR_CALL_FUNCTION(&cachedContent, "apc_fetch", NULL, 81, &prefixedKey); zephir_check_call_status(); - if (zephir_is_numeric(cachedContent)) { - ZEPHIR_INIT_NVAR(result); - ZVAL_LONG(result, (zephir_get_numberval(cachedContent) + value)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "save", NULL, 0, keyName, result); + if (zephir_is_numeric(&cachedContent)) { + ZEPHIR_INIT_NVAR(&result); + ZVAL_LONG(&result, (zephir_get_numberval(&cachedContent) + value)); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "save", NULL, 0, keyName, &result); zephir_check_call_status(); - RETURN_CCTOR(result); + RETURN_CCTOR(&result); } } RETURN_MM_BOOL(0); @@ -255,13 +290,23 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, increment) { PHP_METHOD(Phalcon_Cache_Backend_Apc, decrement) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *lastKey = NULL, *cachedContent = NULL, *result = NULL, *_0, *_1$$3; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, lastKey, cachedContent, result, _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -270,25 +315,24 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, decrement) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCA", _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - if ((zephir_function_exists_ex(SS("apc_dec") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_LONG(_1$$3, value); - ZEPHIR_RETURN_CALL_FUNCTION("apc_dec", NULL, 116, lastKey, _1$$3); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&lastKey); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCA", &_0, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + if ((zephir_function_exists_ex(SL("apc_dec") TSRMLS_CC) == SUCCESS)) { + ZVAL_LONG(&_1$$3, value); + ZEPHIR_RETURN_CALL_FUNCTION("apc_dec", NULL, 103, &lastKey, &_1$$3); zephir_check_call_status(); RETURN_MM(); } else { - ZEPHIR_CALL_FUNCTION(&cachedContent, "apc_fetch", NULL, 90, lastKey); + ZEPHIR_CALL_FUNCTION(&cachedContent, "apc_fetch", NULL, 81, &lastKey); zephir_check_call_status(); - if (zephir_is_numeric(cachedContent)) { - ZEPHIR_INIT_VAR(result); - ZVAL_LONG(result, (zephir_get_numberval(cachedContent) - value)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "save", NULL, 0, keyName, result); + if (zephir_is_numeric(&cachedContent)) { + ZEPHIR_INIT_VAR(&result); + ZVAL_LONG(&result, (zephir_get_numberval(&cachedContent) - value)); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "save", NULL, 0, keyName, &result); zephir_check_call_status(); - RETURN_CCTOR(result); + RETURN_CCTOR(&result); } } RETURN_MM_BOOL(0); @@ -301,28 +345,33 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, decrement) { PHP_METHOD(Phalcon_Cache_Backend_Apc, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *_0, *_1; - zval *keyName = NULL; + zval *keyName_param = NULL, _0, _1; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName_param); if (UNEXPECTED(Z_TYPE_P(keyName_param) != IS_STRING && Z_TYPE_P(keyName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'keyName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'keyName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(keyName_param) == IS_STRING)) { - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); } else { - ZEPHIR_INIT_VAR(keyName); - ZVAL_EMPTY_STRING(keyName); + ZEPHIR_INIT_VAR(&keyName); + ZVAL_EMPTY_STRING(&keyName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVV(_1, "_PHCA", _0, keyName); - ZEPHIR_RETURN_CALL_FUNCTION("apc_delete", NULL, 117, _1); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVV(&_1, "_PHCA", &_0, &keyName); + ZEPHIR_RETURN_CALL_FUNCTION("apc_delete", NULL, 104, &_1); zephir_check_call_status(); RETURN_MM(); @@ -342,55 +391,62 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, queryKeys) { zend_object_iterator *_2; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, *prefixPattern = NULL, *apc = NULL, *keys = NULL, *key = NULL, *_1 = NULL, _3$$5 = zval_used_for_init, *_4$$5 = NULL; - zval *prefix = NULL, *_0$$4; + zval *prefix_param = NULL, prefixPattern, apc, keys, key, _1, _3$$5, _4$$5; + zval prefix, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&prefixPattern); + ZVAL_UNDEF(&apc); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix_param); if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } - ZEPHIR_INIT_VAR(prefixPattern); - if (ZEPHIR_IS_EMPTY(prefix)) { - ZVAL_STRING(prefixPattern, "/^_PHCA/", 1); + ZEPHIR_INIT_VAR(&prefixPattern); + if (ZEPHIR_IS_EMPTY(&prefix)) { + ZVAL_STRING(&prefixPattern, "/^_PHCA/"); } else { - ZEPHIR_INIT_VAR(_0$$4); - ZEPHIR_CONCAT_SVS(_0$$4, "/^_PHCA", prefix, "/"); - ZEPHIR_CPY_WRT(prefixPattern, _0$$4); + ZEPHIR_INIT_VAR(&_0$$4); + ZEPHIR_CONCAT_SVS(&_0$$4, "/^_PHCA", &prefix, "/"); + ZEPHIR_CPY_WRT(&prefixPattern, &_0$$4); } - ZEPHIR_INIT_VAR(keys); - array_init(keys); - ZEPHIR_INIT_VAR(apc); - object_init_ex(apc, zephir_get_internal_ce(SS("apciterator") TSRMLS_CC)); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "user", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, apc, "__construct", NULL, 0, _1, prefixPattern); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&keys); + array_init(&keys); + ZEPHIR_INIT_VAR(&apc); + object_init_ex(&apc, zephir_get_internal_ce(SL("apciterator"))); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "user"); + ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &_1, &prefixPattern); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_1); - _2 = zephir_get_iterator(apc TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_1); + _2 = zephir_get_iterator(&apc TSRMLS_CC); _2->funcs->rewind(_2 TSRMLS_CC); for (;_2->funcs->valid(_2 TSRMLS_CC) == SUCCESS && !EG(exception); _2->funcs->move_forward(_2 TSRMLS_CC)) { ZEPHIR_GET_IMKEY(key, _2); { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _2->funcs->get_current_data(_2, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(_1, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&_1, _2); } - ZEPHIR_SINIT_NVAR(_3$$5); ZVAL_LONG(&_3$$5, 5); - ZEPHIR_INIT_NVAR(_4$$5); - zephir_substr(_4$$5, key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_array_append(&keys, _4$$5, PH_SEPARATE, "phalcon/cache/backend/apc.zep", 240); + ZEPHIR_INIT_NVAR(&_4$$5); + zephir_substr(&_4$$5, &key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_array_append(&keys, &_4$$5, PH_SEPARATE, "phalcon/cache/backend/apc.zep", 240); } - _2->funcs->dtor(_2 TSRMLS_CC); - RETURN_CCTOR(keys); + zend_iterator_dtor(_2); + RETURN_CCTOR(&keys); } @@ -403,13 +459,21 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, queryKeys) { PHP_METHOD(Phalcon_Cache_Backend_Apc, exists) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *lifetime_param = NULL, *lastKey = NULL, *_0$$4, *_1$$5 = NULL; + zval *keyName = NULL, keyName_sub, *lifetime_param = NULL, __$null, lastKey, _0$$4, _1$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime_param) { lifetime = 0; @@ -419,17 +483,17 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, exists) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCA", _0$$4, keyName); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCA", &_0$$4, keyName); } - if (zephir_is_true(lastKey)) { - ZEPHIR_CALL_FUNCTION(&_1$$5, "apc_exists", NULL, 118, lastKey); + if (zephir_is_true(&lastKey)) { + ZEPHIR_CALL_FUNCTION(&_1$$5, "apc_exists", NULL, 105, &lastKey); zephir_check_call_status(); - if (!ZEPHIR_IS_FALSE_IDENTICAL(_1$$5)) { + if (!ZEPHIR_IS_FALSE_IDENTICAL(&_1$$5)) { RETURN_MM_BOOL(1); } } @@ -454,35 +518,40 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, exists) { PHP_METHOD(Phalcon_Cache_Backend_Apc, flush) { zend_object_iterator *_1; - zval *item = NULL, *prefixPattern = NULL, *_0, *_2, *_3, *_4$$3; + zval item, prefixPattern, _0, _2, _3, _4$$3; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&prefixPattern); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixPattern); - ZEPHIR_CONCAT_SVS(prefixPattern, "/^_PHCA", _0, "/"); - ZEPHIR_INIT_VAR(_2); - object_init_ex(_2, zephir_get_internal_ce(SS("apciterator") TSRMLS_CC)); - ZEPHIR_INIT_VAR(_3); - ZVAL_STRING(_3, "user", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 0, _3, prefixPattern); - zephir_check_temp_parameter(_3); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixPattern); + ZEPHIR_CONCAT_SVS(&prefixPattern, "/^_PHCA", &_0, "/"); + ZEPHIR_INIT_VAR(&_2); + object_init_ex(&_2, zephir_get_internal_ce(SL("apciterator"))); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "user"); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 0, &_3, &prefixPattern); zephir_check_call_status(); - _1 = zephir_get_iterator(_2 TSRMLS_CC); + _1 = zephir_get_iterator(&_2 TSRMLS_CC); _1->funcs->rewind(_1 TSRMLS_CC); for (;_1->funcs->valid(_1 TSRMLS_CC) == SUCCESS && !EG(exception); _1->funcs->move_forward(_1 TSRMLS_CC)) { { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _1->funcs->get_current_data(_1, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(item, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&item, _1); } - zephir_array_fetch_string(&_4$$3, item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/apc.zep", 292 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(NULL, "apc_delete", &_5, 117, _4$$3); + zephir_array_fetch_string(&_4$$3, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/apc.zep", 292 TSRMLS_CC); + ZEPHIR_CALL_FUNCTION(NULL, "apc_delete", &_5, 104, &_4$$3); zephir_check_call_status(); } - _1->funcs->dtor(_1 TSRMLS_CC); + zend_iterator_dtor(_1); RETURN_MM_BOOL(1); } diff --git a/ext/phalcon/cache/backend/apc.zep.h b/ext/phalcon/cache/backend/apc.zep.h index d9af0bd4322..060bee3aa6b 100644 --- a/ext/phalcon/cache/backend/apc.zep.h +++ b/ext/phalcon/cache/backend/apc.zep.h @@ -13,38 +13,93 @@ PHP_METHOD(Phalcon_Cache_Backend_Apc, exists); PHP_METHOD(Phalcon_Cache_Backend_Apc, flush); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apc_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apc_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apc_increment, 0, 0, 0) ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apc_decrement, 0, 0, 0) ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apc_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apc_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apc_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apc_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backend_apc_method_entry) { @@ -55,6 +110,6 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_apc_method_entry) { PHP_ME(Phalcon_Cache_Backend_Apc, delete, arginfo_phalcon_cache_backend_apc_delete, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Apc, queryKeys, arginfo_phalcon_cache_backend_apc_querykeys, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Apc, exists, arginfo_phalcon_cache_backend_apc_exists, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_Apc, flush, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_Apc, flush, arginfo_phalcon_cache_backend_apc_flush, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cache/backend/apcu.zep.c b/ext/phalcon/cache/backend/apcu.zep.c index cf516ce2458..e50853fd48e 100644 --- a/ext/phalcon/cache/backend/apcu.zep.c +++ b/ext/phalcon/cache/backend/apcu.zep.c @@ -68,13 +68,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Backend_Apcu) { PHP_METHOD(Phalcon_Cache_Backend_Apcu, get) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *lifetime_param = NULL, *prefixedKey = NULL, *cachedContent = NULL, *_0, *_1; - zval *keyName = NULL; + zval *keyName_param = NULL, *lifetime_param = NULL, prefixedKey, cachedContent, _0, _1; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName_param, &lifetime_param); - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); if (!lifetime_param) { lifetime = 0; } else { @@ -82,17 +89,17 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, get) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_SVV(prefixedKey, "_PHCA", _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&cachedContent, "apcu_fetch", NULL, 92, prefixedKey); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_SVV(&prefixedKey, "_PHCA", &_0, &keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + ZEPHIR_CALL_FUNCTION(&cachedContent, "apcu_fetch", NULL, 0, &prefixedKey); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(cachedContent)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&cachedContent)) { RETURN_MM_NULL(); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_1, "afterretrieve", NULL, 0, cachedContent); + zephir_read_property(&_1, this_ptr, SL("_frontend"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_1, "afterretrieve", NULL, 0, &cachedContent); zephir_check_call_status(); RETURN_MM(); @@ -110,19 +117,38 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, save) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend = NULL, *cachedContent = NULL, *preparedContent = NULL, *ttl = NULL, *isBuffering = NULL, *success = NULL, *_0$$4; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer_param = NULL, __$true, __$false, __$null, lastKey, frontend, cachedContent, preparedContent, ttl, isBuffering, success, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&preparedContent); + ZVAL_UNDEF(&ttl); + ZVAL_UNDEF(&isBuffering); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - ZEPHIR_CPY_WRT(lifetime, ZEPHIR_GLOBAL(global_null)); + lifetime = &lifetime_sub; + ZEPHIR_CPY_WRT(lifetime, &__$null); } else { ZEPHIR_SEPARATE_PARAM(lifetime); } @@ -134,65 +160,65 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, save) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCA", _0$$4, keyName); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCA", &_0$$4, keyName); } - if (!(zephir_is_true(lastKey))) { + if (!(zephir_is_true(&lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/apcu.zep", 95); return; } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); if (Z_TYPE_P(content) == IS_NULL) { - ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&cachedContent, &frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(cachedContent, content); + ZEPHIR_CPY_WRT(&cachedContent, content); } - if (!(zephir_is_numeric(cachedContent))) { - ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); + if (!(zephir_is_numeric(&cachedContent))) { + ZEPHIR_CALL_METHOD(&preparedContent, &frontend, "beforestore", NULL, 0, &cachedContent); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedContent, cachedContent); + ZEPHIR_CPY_WRT(&preparedContent, &cachedContent); } if (Z_TYPE_P(lifetime) == IS_NULL) { ZEPHIR_OBS_NVAR(lifetime); - zephir_read_property_this(&lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + zephir_read_property(lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); if (Z_TYPE_P(lifetime) == IS_NULL) { - ZEPHIR_CALL_METHOD(&ttl, frontend, "getlifetime", NULL, 0); + ZEPHIR_CALL_METHOD(&ttl, &frontend, "getlifetime", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(ttl, lifetime); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + ZEPHIR_CPY_WRT(&ttl, lifetime); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } } else { - ZEPHIR_CPY_WRT(ttl, lifetime); + ZEPHIR_CPY_WRT(&ttl, lifetime); } - ZEPHIR_CALL_FUNCTION(&success, "apcu_store", NULL, 93, lastKey, preparedContent, ttl); + ZEPHIR_CALL_FUNCTION(&success, "apcu_store", NULL, 0, &lastKey, &preparedContent, &ttl); zephir_check_call_status(); - if (!(zephir_is_true(success))) { + if (!(zephir_is_true(&success))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing data in APCu", "phalcon/cache/backend/apcu.zep", 132); return; } - ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0); + ZEPHIR_CALL_METHOD(&isBuffering, &frontend, "isbuffering", NULL, 0); zephir_check_call_status(); if (stopBuffer == 1) { - ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &frontend, "stop", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) { - zend_print_zval(cachedContent, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&isBuffering)) { + zend_print_zval(&cachedContent, 0); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -204,13 +230,21 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, save) { PHP_METHOD(Phalcon_Cache_Backend_Apcu, increment) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *prefixedKey = NULL, *_0, *_1; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, prefixedKey, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -219,13 +253,12 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, increment) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_SVV(prefixedKey, "_PHCA", _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_inc", NULL, 119, prefixedKey, _1); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_SVV(&prefixedKey, "_PHCA", &_0, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + ZVAL_LONG(&_1, value); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_inc", NULL, 0, &prefixedKey, &_1); zephir_check_call_status(); RETURN_MM(); @@ -239,13 +272,21 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, increment) { PHP_METHOD(Phalcon_Cache_Backend_Apcu, decrement) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *lastKey = NULL, *_0, *_1; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, lastKey, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -254,13 +295,12 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, decrement) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCA", _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, value); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_dec", NULL, 120, lastKey, _1); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&lastKey); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCA", &_0, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + ZVAL_LONG(&_1, value); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_dec", NULL, 0, &lastKey, &_1); zephir_check_call_status(); RETURN_MM(); @@ -272,28 +312,33 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, decrement) { PHP_METHOD(Phalcon_Cache_Backend_Apcu, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *_0, *_1; - zval *keyName = NULL; + zval *keyName_param = NULL, _0, _1; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName_param); if (UNEXPECTED(Z_TYPE_P(keyName_param) != IS_STRING && Z_TYPE_P(keyName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'keyName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'keyName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(keyName_param) == IS_STRING)) { - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); } else { - ZEPHIR_INIT_VAR(keyName); - ZVAL_EMPTY_STRING(keyName); + ZEPHIR_INIT_VAR(&keyName); + ZVAL_EMPTY_STRING(&keyName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVV(_1, "_PHCA", _0, keyName); - ZEPHIR_RETURN_CALL_FUNCTION("apcu_delete", NULL, 121, _1); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVV(&_1, "_PHCA", &_0, &keyName); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_delete", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -314,75 +359,85 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, queryKeys) { zend_class_entry *_3$$5 = NULL; zend_object_iterator *_5; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, *prefixPattern = NULL, *apc = NULL, *keys = NULL, *key = NULL, _1, _2, *_6 = NULL, *_4$$6, _7$$8 = zval_used_for_init, *_8$$8 = NULL; - zval *prefix = NULL, *_0$$4; + zval *prefix_param = NULL, prefixPattern, apc, keys, key, _1, _2, _6, _4$$6, _7$$8, _8$$8; + zval prefix, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&prefixPattern); + ZVAL_UNDEF(&apc); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_8$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix_param); if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } - ZEPHIR_INIT_VAR(prefixPattern); - if (ZEPHIR_IS_EMPTY(prefix)) { - ZVAL_STRING(prefixPattern, "/^_PHCA/", 1); + ZEPHIR_INIT_VAR(&prefixPattern); + if (ZEPHIR_IS_EMPTY(&prefix)) { + ZVAL_STRING(&prefixPattern, "/^_PHCA/"); } else { - ZEPHIR_INIT_VAR(_0$$4); - ZEPHIR_CONCAT_SVS(_0$$4, "/^_PHCA", prefix, "/"); - ZEPHIR_CPY_WRT(prefixPattern, _0$$4); - } - ZEPHIR_INIT_VAR(keys); - array_init(keys); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "APCUIterator", 0); - ZEPHIR_SINIT_VAR(_2); - ZVAL_STRING(&_2, "APCIterator", 0); + ZEPHIR_INIT_VAR(&_0$$4); + ZEPHIR_CONCAT_SVS(&_0$$4, "/^_PHCA", &prefix, "/"); + ZEPHIR_CPY_WRT(&prefixPattern, &_0$$4); + } + ZEPHIR_INIT_VAR(&keys); + array_init(&keys); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "APCUIterator"); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "APCIterator"); if (zephir_class_exists(&_1, 1 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(apc); + ZEPHIR_INIT_VAR(&apc); if (!_3$$5) { - _3$$5 = zend_fetch_class(SL("APCUIterator"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + _3$$5 = zephir_fetch_class_str_ex(SL("APCUIterator"), ZEND_FETCH_CLASS_AUTO); } - object_init_ex(apc, _3$$5); - if (zephir_has_constructor(apc TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, apc, "__construct", NULL, 0, prefixPattern); + object_init_ex(&apc, _3$$5); + if (zephir_has_constructor(&apc TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &prefixPattern); zephir_check_call_status(); } } else if (zephir_class_exists(&_2, 1 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(apc); - object_init_ex(apc, zephir_get_internal_ce(SS("apciterator") TSRMLS_CC)); - ZEPHIR_INIT_VAR(_4$$6); - ZVAL_STRING(_4$$6, "user", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, apc, "__construct", NULL, 0, _4$$6, prefixPattern); - zephir_check_temp_parameter(_4$$6); + ZEPHIR_INIT_NVAR(&apc); + object_init_ex(&apc, zephir_get_internal_ce(SL("apciterator"))); + ZEPHIR_INIT_VAR(&_4$$6); + ZVAL_STRING(&_4$$6, "user"); + ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &_4$$6, &prefixPattern); zephir_check_call_status(); } - if (Z_TYPE_P(apc) != IS_OBJECT) { + if (Z_TYPE_P(&apc) != IS_OBJECT) { array_init(return_value); RETURN_MM(); } - ZEPHIR_INIT_VAR(_6); - _5 = zephir_get_iterator(apc TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6); + _5 = zephir_get_iterator(&apc TSRMLS_CC); _5->funcs->rewind(_5 TSRMLS_CC); for (;_5->funcs->valid(_5 TSRMLS_CC) == SUCCESS && !EG(exception); _5->funcs->move_forward(_5 TSRMLS_CC)) { ZEPHIR_GET_IMKEY(key, _5); { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _5->funcs->get_current_data(_5, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(_6, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&_6, _5); } - ZEPHIR_SINIT_NVAR(_7$$8); ZVAL_LONG(&_7$$8, 5); - ZEPHIR_INIT_NVAR(_8$$8); - zephir_substr(_8$$8, key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_array_append(&keys, _8$$8, PH_SEPARATE, "phalcon/cache/backend/apcu.zep", 222); + ZEPHIR_INIT_NVAR(&_8$$8); + zephir_substr(&_8$$8, &key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_array_append(&keys, &_8$$8, PH_SEPARATE, "phalcon/cache/backend/apcu.zep", 222); } - _5->funcs->dtor(_5 TSRMLS_CC); - RETURN_CCTOR(keys); + zend_iterator_dtor(_5); + RETURN_CCTOR(&keys); } @@ -394,15 +449,24 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, queryKeys) { */ PHP_METHOD(Phalcon_Cache_Backend_Apcu, exists) { - zval *_1$$3 = NULL; + zval _1$$3; zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *lifetime_param = NULL, *lastKey = NULL, *_0$$3, *_2$$4; + zval *keyName = NULL, keyName_sub, *lifetime_param = NULL, __$null, lastKey, _0$$3, _2$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime_param) { lifetime = 0; @@ -411,20 +475,20 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, exists) { } - ZEPHIR_INIT_VAR(lastKey); + ZEPHIR_INIT_VAR(&lastKey); if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(_0$$3); - zephir_read_property_this(&_0$$3, this_ptr, SL("_lastKey"), PH_NOISY_CC); - zephir_get_strval(_1$$3, _0$$3); - ZEPHIR_CPY_WRT(lastKey, _1$$3); + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property(&_0$$3, this_ptr, SL("_lastKey"), PH_NOISY_CC); + zephir_get_strval(&_1$$3, &_0$$3); + ZEPHIR_CPY_WRT(&lastKey, &_1$$3); } else { - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCA", _2$$4, keyName); + zephir_read_property(&_2$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCA", &_2$$4, keyName); } - if (ZEPHIR_IS_EMPTY(lastKey)) { + if (ZEPHIR_IS_EMPTY(&lastKey)) { RETURN_MM_BOOL(0); } - ZEPHIR_RETURN_CALL_FUNCTION("apcu_exists", NULL, 122, lastKey); + ZEPHIR_RETURN_CALL_FUNCTION("apcu_exists", NULL, 0, &lastKey); zephir_check_call_status(); RETURN_MM(); @@ -448,56 +512,62 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, flush) { zend_class_entry *_3$$3 = NULL; zend_object_iterator *_5; - zval *item = NULL, *prefixPattern = NULL, *apc = NULL, *_0, _1, _2, *_4$$4, *_6$$6; - zephir_fcall_cache_entry *_7 = NULL; + zval item, prefixPattern, apc, _0, _1, _2, _4$$4, _6$$6; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&prefixPattern); + ZVAL_UNDEF(&apc); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_6$$6); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(apc); - ZVAL_NULL(apc); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixPattern); - ZEPHIR_CONCAT_SVS(prefixPattern, "/^_PHCA", _0, "/"); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "APCUIterator", 0); - ZEPHIR_SINIT_VAR(_2); - ZVAL_STRING(&_2, "APCIterator", 0); + ZEPHIR_INIT_VAR(&apc); + ZVAL_NULL(&apc); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixPattern); + ZEPHIR_CONCAT_SVS(&prefixPattern, "/^_PHCA", &_0, "/"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "APCUIterator"); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "APCIterator"); if (zephir_class_exists(&_1, 1 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(apc); + ZEPHIR_INIT_NVAR(&apc); if (!_3$$3) { - _3$$3 = zend_fetch_class(SL("APCUIterator"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + _3$$3 = zephir_fetch_class_str_ex(SL("APCUIterator"), ZEND_FETCH_CLASS_AUTO); } - object_init_ex(apc, _3$$3); - if (zephir_has_constructor(apc TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, apc, "__construct", NULL, 0, prefixPattern); + object_init_ex(&apc, _3$$3); + if (zephir_has_constructor(&apc TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &prefixPattern); zephir_check_call_status(); } } else if (zephir_class_exists(&_2, 1 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(apc); - object_init_ex(apc, zephir_get_internal_ce(SS("apciterator") TSRMLS_CC)); - ZEPHIR_INIT_VAR(_4$$4); - ZVAL_STRING(_4$$4, "user", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, apc, "__construct", NULL, 0, _4$$4, prefixPattern); - zephir_check_temp_parameter(_4$$4); + ZEPHIR_INIT_NVAR(&apc); + object_init_ex(&apc, zephir_get_internal_ce(SL("apciterator"))); + ZEPHIR_INIT_VAR(&_4$$4); + ZVAL_STRING(&_4$$4, "user"); + ZEPHIR_CALL_METHOD(NULL, &apc, "__construct", NULL, 0, &_4$$4, &prefixPattern); zephir_check_call_status(); } - if (Z_TYPE_P(apc) != IS_OBJECT) { + if (Z_TYPE_P(&apc) != IS_OBJECT) { RETURN_MM_BOOL(0); } - _5 = zephir_get_iterator(apc TSRMLS_CC); + _5 = zephir_get_iterator(&apc TSRMLS_CC); _5->funcs->rewind(_5 TSRMLS_CC); for (;_5->funcs->valid(_5 TSRMLS_CC) == SUCCESS && !EG(exception); _5->funcs->move_forward(_5 TSRMLS_CC)) { { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _5->funcs->get_current_data(_5, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(item, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&item, _5); } - zephir_array_fetch_string(&_6$$6, item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/apcu.zep", 283 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(NULL, "apcu_delete", &_7, 121, _6$$6); + zephir_array_fetch_string(&_6$$6, &item, SL("key"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/apcu.zep", 283 TSRMLS_CC); + ZEPHIR_CALL_FUNCTION(NULL, "apcu_delete", NULL, 0, &_6$$6); zephir_check_call_status(); } - _5->funcs->dtor(_5 TSRMLS_CC); + zend_iterator_dtor(_5); RETURN_MM_BOOL(1); } diff --git a/ext/phalcon/cache/backend/apcu.zep.h b/ext/phalcon/cache/backend/apcu.zep.h index 4270eb1d2cd..3c0dba78d56 100644 --- a/ext/phalcon/cache/backend/apcu.zep.h +++ b/ext/phalcon/cache/backend/apcu.zep.h @@ -13,38 +13,93 @@ PHP_METHOD(Phalcon_Cache_Backend_Apcu, exists); PHP_METHOD(Phalcon_Cache_Backend_Apcu, flush); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apcu_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apcu_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apcu_increment, 0, 0, 0) ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apcu_decrement, 0, 0, 0) ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apcu_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apcu_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_apcu_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_apcu_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backend_apcu_method_entry) { @@ -55,6 +110,6 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_apcu_method_entry) { PHP_ME(Phalcon_Cache_Backend_Apcu, delete, arginfo_phalcon_cache_backend_apcu_delete, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Apcu, queryKeys, arginfo_phalcon_cache_backend_apcu_querykeys, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Apcu, exists, arginfo_phalcon_cache_backend_apcu_exists, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_Apcu, flush, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_Apcu, flush, arginfo_phalcon_cache_backend_apcu_flush, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cache/backend/factory.zep.c b/ext/phalcon/cache/backend/factory.zep.c index 643fc62b8d5..ef547890503 100644 --- a/ext/phalcon/cache/backend/factory.zep.c +++ b/ext/phalcon/cache/backend/factory.zep.c @@ -51,17 +51,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Backend_Factory) { PHP_METHOD(Phalcon_Cache_Backend_Factory, load) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *_0; + zval *config, config_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Phalcon\\Cache\\Backend", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, _0, config); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Phalcon\\Cache\\Backend"); + ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, &_0, config); zephir_check_call_status(); RETURN_MM(); @@ -73,13 +76,24 @@ PHP_METHOD(Phalcon_Cache_Backend_Factory, loadClass) { zend_bool _0, _2$$6; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *namespace_param = NULL, *config = NULL, *adapter = NULL, *className = NULL, *frontend = NULL, *_1$$3 = NULL, *_5$$6, *_6$$6 = NULL, *_3$$7 = NULL; - zval *namespace = NULL; + zval *namespace_param = NULL, *config = NULL, config_sub, adapter, className, frontend, _1$$3, _5$$6, _6$$6, _3$$7; + zval namespace; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespace); + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_3$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &namespace_param, &config); - zephir_get_strval(namespace, namespace_param); + zephir_get_strval(&namespace, namespace_param); ZEPHIR_SEPARATE_PARAM(config); @@ -90,39 +104,39 @@ PHP_METHOD(Phalcon_Cache_Backend_Factory, loadClass) { if (_0) { ZEPHIR_CALL_METHOD(&_1$$3, config, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(config, _1$$3); + ZEPHIR_CPY_WRT(config, &_1$$3); } if (Z_TYPE_P(config) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "Config must be array or Phalcon\\Config object", "phalcon/cache/backend/factory.zep", 62); return; } - ZEPHIR_OBS_VAR(frontend); - if (!(zephir_array_isset_string_fetch(&frontend, config, SS("frontend"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&frontend); + if (!(zephir_array_isset_string_fetch(&frontend, config, SL("frontend"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "You must provide 'frontend' option in factory config parameter.", "phalcon/cache/backend/factory.zep", 66); return; } - ZEPHIR_OBS_VAR(adapter); - if (zephir_array_isset_string_fetch(&adapter, config, SS("adapter"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&config, SS("adapter"), PH_SEPARATE); - zephir_array_unset_string(&config, SS("frontend"), PH_SEPARATE); - _2$$6 = Z_TYPE_P(frontend) == IS_ARRAY; + ZEPHIR_OBS_VAR(&adapter); + if (zephir_array_isset_string_fetch(&adapter, config, SL("adapter"), 0)) { + zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE); + zephir_array_unset_string(config, SL("frontend"), PH_SEPARATE); + _2$$6 = Z_TYPE_P(&frontend) == IS_ARRAY; if (!(_2$$6)) { - _2$$6 = zephir_instance_of_ev(frontend, phalcon_config_ce TSRMLS_CC); + _2$$6 = zephir_instance_of_ev(&frontend, phalcon_config_ce TSRMLS_CC); } if (_2$$6) { - ZEPHIR_CALL_CE_STATIC(&_3$$7, phalcon_cache_frontend_factory_ce, "load", &_4, 123, frontend); + ZEPHIR_CALL_CE_STATIC(&_3$$7, phalcon_cache_frontend_factory_ce, "load", &_4, 0, &frontend); zephir_check_call_status(); - ZEPHIR_CPY_WRT(frontend, _3$$7); + ZEPHIR_CPY_WRT(&frontend, &_3$$7); } - ZEPHIR_INIT_VAR(_5$$6); - zephir_camelize(_5$$6, adapter, NULL ); - ZEPHIR_INIT_VAR(className); - ZEPHIR_CONCAT_VSV(className, namespace, "\\", _5$$6); - zephir_fetch_safe_class(_6$$6, className); - _7$$6 = zend_fetch_class(Z_STRVAL_P(_6$$6), Z_STRLEN_P(_6$$6), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$6); + zephir_camelize(&_5$$6, &adapter, NULL ); + ZEPHIR_INIT_VAR(&className); + ZEPHIR_CONCAT_VSV(&className, &namespace, "\\", &_5$$6); + zephir_fetch_safe_class(&_6$$6, &className); + _7$$6 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_6$$6), Z_STRLEN_P(&_6$$6), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _7$$6); if (zephir_has_constructor(return_value TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, frontend, config); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &frontend, config); zephir_check_call_status(); } RETURN_MM(); diff --git a/ext/phalcon/cache/backend/factory.zep.h b/ext/phalcon/cache/backend/factory.zep.h index 7ead357cddd..250c8884602 100644 --- a/ext/phalcon/cache/backend/factory.zep.h +++ b/ext/phalcon/cache/backend/factory.zep.h @@ -6,12 +6,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Backend_Factory); PHP_METHOD(Phalcon_Cache_Backend_Factory, load); PHP_METHOD(Phalcon_Cache_Backend_Factory, loadClass); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_factory_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_backend_factory_load, 0, 1, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_factory_load, 0, 1, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_factory_loadclass, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespace) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/cache/backend/file.zep.c b/ext/phalcon/cache/backend/file.zep.c index 94ee7ce5fc0..ed4d13921a2 100644 --- a/ext/phalcon/cache/backend/file.zep.c +++ b/ext/phalcon/cache/backend/file.zep.c @@ -84,46 +84,59 @@ PHP_METHOD(Phalcon_Cache_Backend_File, __construct) { zend_bool _1$$6; zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_5 = NULL; - zval *options = NULL; - zval *frontend, *options_param = NULL, *prefix = NULL, *safekey = NULL, *_0$$6, *_2$$6, *_3$$6, _4$$6; + zephir_fcall_cache_entry *_6 = NULL; + zval options; + zval *frontend, frontend_sub, *options_param = NULL, prefix, safekey, _0$$6, _2$$6, _3$$6, _4$$6, _5$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontend_sub); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&safekey); + ZVAL_UNDEF(&_0$$6); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&options); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &frontend, &options_param); - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); - if (!(zephir_array_isset_string(options, SS("cacheDir")))) { + if (!(zephir_array_isset_string(&options, SL("cacheDir")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache directory must be specified with the option cacheDir", "phalcon/cache/backend/file.zep", 79); return; } - ZEPHIR_OBS_VAR(safekey); - if (zephir_array_isset_string_fetch(&safekey, options, SS("safekey"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(safekey) != IS_BOOL) { + ZEPHIR_OBS_VAR(&safekey); + if (zephir_array_isset_string_fetch(&safekey, &options, SL("safekey"), 0)) { + if (((Z_TYPE_P(&safekey) == IS_TRUE || Z_TYPE_P(&safekey) == IS_FALSE) != 1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "safekey option should be a boolean.", "phalcon/cache/backend/file.zep", 84); return; } - zephir_update_property_this(getThis(), SL("_useSafeKey"), safekey TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_useSafeKey"), &safekey); } - ZEPHIR_OBS_VAR(prefix); - if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 0 TSRMLS_CC)) { - _0$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_useSafeKey"), PH_NOISY_CC); - _1$$6 = zephir_is_true(_0$$6); + ZEPHIR_OBS_VAR(&prefix); + if (zephir_array_isset_string_fetch(&prefix, &options, SL("prefix"), 0)) { + zephir_read_property(&_0$$6, this_ptr, SL("_useSafeKey"), PH_NOISY_CC | PH_READONLY); + _1$$6 = zephir_is_true(&_0$$6); if (_1$$6) { - ZEPHIR_INIT_VAR(_2$$6); - ZEPHIR_INIT_VAR(_3$$6); - ZEPHIR_SINIT_VAR(_4$$6); - ZVAL_STRING(&_4$$6, "/[^a-zA-Z0-9_.-]+/", 0); - zephir_preg_match(_3$$6, &_4$$6, prefix, _2$$6, 0, 0 , 0 TSRMLS_CC); - _1$$6 = zephir_is_true(_3$$6); + ZEPHIR_INIT_VAR(&_2$$6); + ZEPHIR_INIT_VAR(&_3$$6); + ZVAL_STRING(&_3$$6, "/[^a-zA-Z0-9_.-]+/"); + ZEPHIR_INIT_VAR(&_4$$6); + ZEPHIR_INIT_VAR(&_5$$6); + ZVAL_STRING(&_5$$6, "/[^a-zA-Z0-9_.-]+/"); + zephir_preg_match(&_4$$6, &_5$$6, &prefix, &_2$$6, 0, 0 , 0 TSRMLS_CC); + _1$$6 = zephir_is_true(&_4$$6); } if (_1$$6) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "FileCache prefix should only use alphanumeric characters.", "phalcon/cache/backend/file.zep", 93); return; } } - ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_file_ce, getThis(), "__construct", &_5, 124, frontend, options); + ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_file_ce, getThis(), "__construct", &_6, 0, frontend, &options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -135,13 +148,32 @@ PHP_METHOD(Phalcon_Cache_Backend_File, __construct) { PHP_METHOD(Phalcon_Cache_Backend_File, get) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS, ttl = 0, modifiedTime = 0; - zval *keyName_param = NULL, *lifetime_param = NULL, *prefixedKey = NULL, *cacheDir = NULL, *cacheFile = NULL, *frontend = NULL, *lastLifetime = NULL, *cachedContent = NULL, *ret = NULL, *_0, *_1 = NULL, *_2, *_3$$6 = NULL, *_4$$4, *_5$$4, *_6$$10, *_7$$10; - zval *keyName = NULL; + zval *keyName_param = NULL, *lifetime_param = NULL, __$true, prefixedKey, cacheDir, cacheFile, frontend, lastLifetime, cachedContent, ret, _0, _1, _2, _3$$6, _4$$4, _5$$4, _6$$10, _7$$10; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&cacheDir); + ZVAL_UNDEF(&cacheFile); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&lastLifetime); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&_7$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName_param, &lifetime_param); - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); if (!lifetime_param) { lifetime = 0; } else { @@ -149,63 +181,63 @@ PHP_METHOD(Phalcon_Cache_Backend_File, get) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getkey", NULL, 0, keyName); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getkey", NULL, 0, &keyName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, _1); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - ZEPHIR_OBS_VAR(cacheDir); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&cacheDir, _2, SS("cacheDir"), 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, &_1); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + ZEPHIR_OBS_VAR(&cacheDir); + zephir_read_property(&_2, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&cacheDir, &_2, SL("cacheDir"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/file.zep", 111); return; } - ZEPHIR_INIT_VAR(cacheFile); - ZEPHIR_CONCAT_VV(cacheFile, cacheDir, prefixedKey); - if ((zephir_file_exists(cacheFile TSRMLS_CC) == SUCCESS) == 1) { - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&cacheFile); + ZEPHIR_CONCAT_VV(&cacheFile, &cacheDir, &prefixedKey); + if ((zephir_file_exists(&cacheFile TSRMLS_CC) == SUCCESS) == 1) { + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); if (!(lifetime)) { - ZEPHIR_OBS_VAR(lastLifetime); - zephir_read_property_this(&lastLifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - if (!(zephir_is_true(lastLifetime))) { - ZEPHIR_CALL_METHOD(&_3$$6, frontend, "getlifetime", NULL, 0); + ZEPHIR_OBS_VAR(&lastLifetime); + zephir_read_property(&lastLifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + if (!(zephir_is_true(&lastLifetime))) { + ZEPHIR_CALL_METHOD(&_3$$6, &frontend, "getlifetime", NULL, 0); zephir_check_call_status(); - ttl = zephir_get_intval(_3$$6); + ttl = zephir_get_intval(&_3$$6); } else { - ttl = zephir_get_intval(lastLifetime); + ttl = zephir_get_intval(&lastLifetime); } } else { ttl = lifetime; } - ZEPHIR_CALL_FUNCTION(NULL, "clearstatcache", NULL, 125, ZEPHIR_GLOBAL(global_true), cacheFile); + ZEPHIR_CALL_FUNCTION(NULL, "clearstatcache", NULL, 106, &__$true, &cacheFile); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4$$4); - zephir_filemtime(_4$$4, cacheFile TSRMLS_CC); - modifiedTime = zephir_get_intval(_4$$4); - ZEPHIR_INIT_VAR(_5$$4); - zephir_time(_5$$4); - if (ZEPHIR_LT_LONG(_5$$4, (modifiedTime + ttl))) { - ZEPHIR_INIT_VAR(cachedContent); - zephir_file_get_contents(cachedContent, cacheFile TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(cachedContent)) { - ZEPHIR_INIT_VAR(_6$$10); - object_init_ex(_6$$10, phalcon_cache_exception_ce); - ZEPHIR_INIT_VAR(_7$$10); - ZEPHIR_CONCAT_SVS(_7$$10, "Cache file ", cacheFile, " could not be opened"); - ZEPHIR_CALL_METHOD(NULL, _6$$10, "__construct", NULL, 9, _7$$10); + ZEPHIR_INIT_VAR(&_4$$4); + zephir_filemtime(&_4$$4, &cacheFile TSRMLS_CC); + modifiedTime = zephir_get_intval(&_4$$4); + ZEPHIR_INIT_VAR(&_5$$4); + zephir_time(&_5$$4); + if (ZEPHIR_LT_LONG(&_5$$4, (modifiedTime + ttl))) { + ZEPHIR_INIT_VAR(&cachedContent); + zephir_file_get_contents(&cachedContent, &cacheFile TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&cachedContent)) { + ZEPHIR_INIT_VAR(&_6$$10); + object_init_ex(&_6$$10, phalcon_cache_exception_ce); + ZEPHIR_INIT_VAR(&_7$$10); + ZEPHIR_CONCAT_SVS(&_7$$10, "Cache file ", &cacheFile, " could not be opened"); + ZEPHIR_CALL_METHOD(NULL, &_6$$10, "__construct", NULL, 4, &_7$$10); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$10, "phalcon/cache/backend/file.zep", 148 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$10, "phalcon/cache/backend/file.zep", 148 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_is_numeric(cachedContent)) { - RETURN_CCTOR(cachedContent); + if (zephir_is_numeric(&cachedContent)) { + RETURN_CCTOR(&cachedContent); } else { - ZEPHIR_CALL_METHOD(&ret, frontend, "afterretrieve", NULL, 0, cachedContent); + ZEPHIR_CALL_METHOD(&ret, &frontend, "afterretrieve", NULL, 0, &cachedContent); zephir_check_call_status(); - RETURN_CCTOR(ret); + RETURN_CCTOR(&ret); } } } @@ -225,19 +257,43 @@ PHP_METHOD(Phalcon_Cache_Backend_File, save) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend = NULL, *cacheDir = NULL, *isBuffering = NULL, *cacheFile = NULL, *cachedContent = NULL, *preparedContent = NULL, *status = NULL, *_2, *_0$$4, *_1$$4 = NULL, *_3$$11, *_4$$11; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer_param = NULL, __$true, __$false, __$null, lastKey, frontend, cacheDir, isBuffering, cacheFile, cachedContent, preparedContent, status, _2, _0$$4, _1$$4, _3$$11, _4$$11; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&cacheDir); + ZVAL_UNDEF(&isBuffering); + ZVAL_UNDEF(&cacheFile); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&preparedContent); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_3$$11); + ZVAL_UNDEF(&_4$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } if (!stopBuffer_param) { stopBuffer = 1; @@ -247,70 +303,70 @@ PHP_METHOD(Phalcon_Cache_Backend_File, save) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getkey", NULL, 0, keyName); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, _0$$4, _1$$4); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &_0$$4, &_1$$4); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } - if (!(zephir_is_true(lastKey))) { + if (!(zephir_is_true(&lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/file.zep", 186); return; } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(cacheDir); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&cacheDir, _2, SS("cacheDir"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&cacheDir); + zephir_read_property(&_2, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&cacheDir, &_2, SL("cacheDir"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/file.zep", 192); return; } - ZEPHIR_INIT_VAR(cacheFile); - ZEPHIR_CONCAT_VV(cacheFile, cacheDir, lastKey); + ZEPHIR_INIT_VAR(&cacheFile); + ZEPHIR_CONCAT_VV(&cacheFile, &cacheDir, &lastKey); if (Z_TYPE_P(content) == IS_NULL) { - ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&cachedContent, &frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(cachedContent, content); + ZEPHIR_CPY_WRT(&cachedContent, content); } - if (!(zephir_is_numeric(cachedContent))) { - ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); + if (!(zephir_is_numeric(&cachedContent))) { + ZEPHIR_CALL_METHOD(&preparedContent, &frontend, "beforestore", NULL, 0, &cachedContent); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedContent, cachedContent); - } - ZEPHIR_INIT_VAR(status); - zephir_file_put_contents(status, cacheFile, preparedContent TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(status)) { - ZEPHIR_INIT_VAR(_3$$11); - object_init_ex(_3$$11, phalcon_cache_exception_ce); - ZEPHIR_INIT_VAR(_4$$11); - ZEPHIR_CONCAT_SVS(_4$$11, "Cache file ", cacheFile, " could not be written"); - ZEPHIR_CALL_METHOD(NULL, _3$$11, "__construct", NULL, 9, _4$$11); + ZEPHIR_CPY_WRT(&preparedContent, &cachedContent); + } + ZEPHIR_INIT_VAR(&status); + zephir_file_put_contents(&status, &cacheFile, &preparedContent TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&status)) { + ZEPHIR_INIT_VAR(&_3$$11); + object_init_ex(&_3$$11, phalcon_cache_exception_ce); + ZEPHIR_INIT_VAR(&_4$$11); + ZEPHIR_CONCAT_SVS(&_4$$11, "Cache file ", &cacheFile, " could not be written"); + ZEPHIR_CALL_METHOD(NULL, &_3$$11, "__construct", NULL, 4, &_4$$11); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$11, "phalcon/cache/backend/file.zep", 215 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$11, "phalcon/cache/backend/file.zep", 215 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0); + ZEPHIR_CALL_METHOD(&isBuffering, &frontend, "isbuffering", NULL, 0); zephir_check_call_status(); if (stopBuffer == 1) { - ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &frontend, "stop", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) { - zend_print_zval(cachedContent, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&isBuffering)) { + zend_print_zval(&cachedContent, 0); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(status)); + RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&status)); } @@ -322,26 +378,34 @@ PHP_METHOD(Phalcon_Cache_Backend_File, save) { PHP_METHOD(Phalcon_Cache_Backend_File, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *cacheFile = NULL, *cacheDir = NULL, *_0, *_1, *_2 = NULL; + zval *keyName, keyName_sub, cacheFile, cacheDir, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&cacheFile); + ZVAL_UNDEF(&cacheDir); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName); - ZEPHIR_OBS_VAR(cacheDir); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&cacheDir, _0, SS("cacheDir"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&cacheDir); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&cacheDir, &_0, SL("cacheDir"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/file.zep", 243); return; } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); + zephir_read_property(&_1, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_2, this_ptr, "getkey", NULL, 0, keyName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(cacheFile); - ZEPHIR_CONCAT_VVV(cacheFile, cacheDir, _1, _2); - if ((zephir_file_exists(cacheFile TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 126, cacheFile); + ZEPHIR_INIT_VAR(&cacheFile); + ZEPHIR_CONCAT_VVV(&cacheFile, &cacheDir, &_1, &_2); + if ((zephir_file_exists(&cacheFile TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_FUNCTION("unlink", NULL, 107, &cacheFile); zephir_check_call_status(); RETURN_MM(); } @@ -362,65 +426,76 @@ PHP_METHOD(Phalcon_Cache_Backend_File, delete) { PHP_METHOD(Phalcon_Cache_Backend_File, queryKeys) { zend_object_iterator *_3; - zval *keys; + zval keys; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, *item = NULL, *key = NULL, *cacheDir = NULL, *prefixedKey = NULL, *_0, *_4, *_1$$4, *_2$$4 = NULL, *_5$$5 = NULL; - zval *prefix = NULL; + zval *prefix_param = NULL, item, key, cacheDir, prefixedKey, _0, _4, _1$$4, _2$$4, _5$$5; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&cacheDir); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&keys); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix_param); if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } - ZEPHIR_INIT_VAR(keys); - array_init(keys); - ZEPHIR_OBS_VAR(cacheDir); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&cacheDir, _0, SS("cacheDir"), 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&keys); + array_init(&keys); + ZEPHIR_OBS_VAR(&cacheDir); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&cacheDir, &_0, SL("cacheDir"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/file.zep", 270); return; } - if (!(ZEPHIR_IS_EMPTY(prefix))) { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getkey", NULL, 0, prefix); + if (!(ZEPHIR_IS_EMPTY(&prefix))) { + zephir_read_property(&_1$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getkey", NULL, 0, &prefix); zephir_check_call_status(); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _1$$4, _2$$4); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_1$$4, &_2$$4); } - ZEPHIR_INIT_VAR(_4); - object_init_ex(_4, spl_ce_DirectoryIterator); - ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 127, cacheDir); + ZEPHIR_INIT_VAR(&_4); + object_init_ex(&_4, spl_ce_DirectoryIterator); + ZEPHIR_CALL_METHOD(NULL, &_4, "__construct", NULL, 108, &cacheDir); zephir_check_call_status(); - _3 = zephir_get_iterator(_4 TSRMLS_CC); + _3 = zephir_get_iterator(&_4 TSRMLS_CC); _3->funcs->rewind(_3 TSRMLS_CC); for (;_3->funcs->valid(_3 TSRMLS_CC) == SUCCESS && !EG(exception); _3->funcs->move_forward(_3 TSRMLS_CC)) { { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _3->funcs->get_current_data(_3, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(item, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&item, _3); } - ZEPHIR_CALL_METHOD(&_5$$5, item, "isdir", NULL, 0); + ZEPHIR_CALL_METHOD(&_5$$5, &item, "isdir", NULL, 0); zephir_check_call_status(); - if (EXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(_5$$5))) { - ZEPHIR_CALL_METHOD(&key, item, "getfilename", NULL, 0); + if (EXPECTED(ZEPHIR_IS_FALSE_IDENTICAL(&_5$$5))) { + ZEPHIR_CALL_METHOD(&key, &item, "getfilename", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(prefix))) { - if (zephir_start_with(key, prefixedKey, NULL)) { - zephir_array_append(&keys, key, PH_SEPARATE, "phalcon/cache/backend/file.zep", 285); + if (!(ZEPHIR_IS_EMPTY(&prefix))) { + if (zephir_start_with(&key, &prefixedKey, NULL)) { + zephir_array_append(&keys, &key, PH_SEPARATE, "phalcon/cache/backend/file.zep", 285); } } else { - zephir_array_append(&keys, key, PH_SEPARATE, "phalcon/cache/backend/file.zep", 288); + zephir_array_append(&keys, &key, PH_SEPARATE, "phalcon/cache/backend/file.zep", 288); } } } - _3->funcs->dtor(_3 TSRMLS_CC); - RETURN_CTOR(keys); + zend_iterator_dtor(_3); + RETURN_CTOR(&keys); } @@ -433,13 +508,29 @@ PHP_METHOD(Phalcon_Cache_Backend_File, queryKeys) { PHP_METHOD(Phalcon_Cache_Backend_File, exists) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS, ttl = 0, modifiedTime = 0; - zval *keyName = NULL, *lifetime_param = NULL, *lastKey = NULL, *prefix = NULL, *cacheFile = NULL, *_0$$4 = NULL, *_1$$5, *_2$$5, *_3$$7, *_4$$7 = NULL, *_5$$6, *_6$$6; + zval *keyName = NULL, keyName_sub, *lifetime_param = NULL, __$true, __$null, lastKey, prefix, cacheFile, _0$$4, _1$$5, _2$$5, _3$$7, _4$$7, _5$$6, _6$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&cacheFile); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime_param) { lifetime = 0; @@ -449,38 +540,38 @@ PHP_METHOD(Phalcon_Cache_Backend_File, exists) { if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); ZEPHIR_CALL_METHOD(&_0$$4, this_ptr, "getkey", NULL, 0, keyName); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, prefix, _0$$4); - } - if (zephir_is_true(lastKey)) { - _1$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - zephir_array_fetch_string(&_2$$5, _1$$5, SL("cacheDir"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/file.zep", 315 TSRMLS_CC); - ZEPHIR_INIT_VAR(cacheFile); - ZEPHIR_CONCAT_VV(cacheFile, _2$$5, lastKey); - if ((zephir_file_exists(cacheFile TSRMLS_CC) == SUCCESS)) { + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, &_0$$4); + } + if (zephir_is_true(&lastKey)) { + zephir_read_property(&_1$$5, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch_string(&_2$$5, &_1$$5, SL("cacheDir"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/file.zep", 315 TSRMLS_CC); + ZEPHIR_INIT_VAR(&cacheFile); + ZEPHIR_CONCAT_VV(&cacheFile, &_2$$5, &lastKey); + if ((zephir_file_exists(&cacheFile TSRMLS_CC) == SUCCESS)) { if (!(lifetime)) { - _3$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_4$$7, _3$$7, "getlifetime", NULL, 0); + zephir_read_property(&_3$$7, this_ptr, SL("_frontend"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_4$$7, &_3$$7, "getlifetime", NULL, 0); zephir_check_call_status(); - ttl = zephir_get_intval(_4$$7); + ttl = zephir_get_intval(&_4$$7); } else { ttl = lifetime; } - ZEPHIR_CALL_FUNCTION(NULL, "clearstatcache", NULL, 125, ZEPHIR_GLOBAL(global_true), cacheFile); + ZEPHIR_CALL_FUNCTION(NULL, "clearstatcache", NULL, 106, &__$true, &cacheFile); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_5$$6); - zephir_filemtime(_5$$6, cacheFile TSRMLS_CC); - modifiedTime = zephir_get_intval(_5$$6); - ZEPHIR_INIT_VAR(_6$$6); - zephir_time(_6$$6); - if (ZEPHIR_LT_LONG(_6$$6, (modifiedTime + ttl))) { + ZEPHIR_INIT_VAR(&_5$$6); + zephir_filemtime(&_5$$6, &cacheFile TSRMLS_CC); + modifiedTime = zephir_get_intval(&_5$$6); + ZEPHIR_INIT_VAR(&_6$$6); + zephir_time(&_6$$6); + if (ZEPHIR_LT_LONG(&_6$$6, (modifiedTime + ttl))) { RETURN_MM_BOOL(1); } } @@ -497,13 +588,35 @@ PHP_METHOD(Phalcon_Cache_Backend_File, exists) { PHP_METHOD(Phalcon_Cache_Backend_File, increment) { zend_long value, ZEPHIR_LAST_CALL_STATUS, modifiedTime = 0; - zval *keyName = NULL, *value_param = NULL, *prefixedKey = NULL, *cacheFile = NULL, *frontend = NULL, *lifetime = NULL, *ttl = NULL, *cachedContent = NULL, *result = NULL, *_0, *_1 = NULL, *_2, *_3, *_4$$3, *_5$$3, *_6$$7, *_7$$7, *_8$$8; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$true, __$null, prefixedKey, cacheFile, frontend, lifetime, ttl, cachedContent, result, _0, _1, _2, _3, _4$$3, _5$$3, _6$$7, _7$$7, _8$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&cacheFile); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&lifetime); + ZVAL_UNDEF(&ttl); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -512,58 +625,58 @@ PHP_METHOD(Phalcon_Cache_Backend_File, increment) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getkey", NULL, 0, keyName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, _1); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - zephir_array_fetch_string(&_3, _2, SL("cacheDir"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/file.zep", 352 TSRMLS_CC); - ZEPHIR_INIT_VAR(cacheFile); - ZEPHIR_CONCAT_VV(cacheFile, _3, prefixedKey); - if ((zephir_file_exists(cacheFile TSRMLS_CC) == SUCCESS)) { - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(lifetime); - zephir_read_property_this(&lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - if (!(zephir_is_true(lifetime))) { - ZEPHIR_CALL_METHOD(&ttl, frontend, "getlifetime", NULL, 0); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, &_1); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + zephir_read_property(&_2, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch_string(&_3, &_2, SL("cacheDir"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/file.zep", 352 TSRMLS_CC); + ZEPHIR_INIT_VAR(&cacheFile); + ZEPHIR_CONCAT_VV(&cacheFile, &_3, &prefixedKey); + if ((zephir_file_exists(&cacheFile TSRMLS_CC) == SUCCESS)) { + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lifetime); + zephir_read_property(&lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + if (!(zephir_is_true(&lifetime))) { + ZEPHIR_CALL_METHOD(&ttl, &frontend, "getlifetime", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(ttl, lifetime); + ZEPHIR_CPY_WRT(&ttl, &lifetime); } - ZEPHIR_CALL_FUNCTION(NULL, "clearstatcache", NULL, 125, ZEPHIR_GLOBAL(global_true), cacheFile); + ZEPHIR_CALL_FUNCTION(NULL, "clearstatcache", NULL, 106, &__$true, &cacheFile); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4$$3); - zephir_filemtime(_4$$3, cacheFile TSRMLS_CC); - modifiedTime = zephir_get_intval(_4$$3); - ZEPHIR_INIT_VAR(_5$$3); - zephir_time(_5$$3); - if (ZEPHIR_LT_LONG(_5$$3, (modifiedTime + zephir_get_numberval(ttl)))) { - ZEPHIR_INIT_VAR(cachedContent); - zephir_file_get_contents(cachedContent, cacheFile TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(cachedContent)) { - ZEPHIR_INIT_VAR(_6$$7); - object_init_ex(_6$$7, phalcon_cache_exception_ce); - ZEPHIR_INIT_VAR(_7$$7); - ZEPHIR_CONCAT_SVS(_7$$7, "Cache file ", cacheFile, " could not be opened"); - ZEPHIR_CALL_METHOD(NULL, _6$$7, "__construct", NULL, 9, _7$$7); + ZEPHIR_INIT_VAR(&_4$$3); + zephir_filemtime(&_4$$3, &cacheFile TSRMLS_CC); + modifiedTime = zephir_get_intval(&_4$$3); + ZEPHIR_INIT_VAR(&_5$$3); + zephir_time(&_5$$3); + if (ZEPHIR_LT_LONG(&_5$$3, (modifiedTime + zephir_get_numberval(&ttl)))) { + ZEPHIR_INIT_VAR(&cachedContent); + zephir_file_get_contents(&cachedContent, &cacheFile TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&cachedContent)) { + ZEPHIR_INIT_VAR(&_6$$7); + object_init_ex(&_6$$7, phalcon_cache_exception_ce); + ZEPHIR_INIT_VAR(&_7$$7); + ZEPHIR_CONCAT_SVS(&_7$$7, "Cache file ", &cacheFile, " could not be opened"); + ZEPHIR_CALL_METHOD(NULL, &_6$$7, "__construct", NULL, 4, &_7$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$7, "phalcon/cache/backend/file.zep", 383 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$7, "phalcon/cache/backend/file.zep", 383 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_is_numeric(cachedContent)) { - ZEPHIR_INIT_VAR(result); - ZVAL_LONG(result, (zephir_get_numberval(cachedContent) + value)); - ZEPHIR_INIT_VAR(_8$$8); - zephir_file_put_contents(_8$$8, cacheFile, result TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_8$$8)) { + if (zephir_is_numeric(&cachedContent)) { + ZEPHIR_INIT_VAR(&result); + ZVAL_LONG(&result, (zephir_get_numberval(&cachedContent) + value)); + ZEPHIR_INIT_VAR(&_8$$8); + zephir_file_put_contents(&_8$$8, &cacheFile, &result TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_8$$8)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache directory could not be written", "phalcon/cache/backend/file.zep", 390); return; } - RETURN_CCTOR(result); + RETURN_CCTOR(&result); } } } @@ -579,13 +692,35 @@ PHP_METHOD(Phalcon_Cache_Backend_File, increment) { PHP_METHOD(Phalcon_Cache_Backend_File, decrement) { zend_long value, ZEPHIR_LAST_CALL_STATUS, modifiedTime = 0; - zval *keyName = NULL, *value_param = NULL, *prefixedKey = NULL, *cacheFile = NULL, *lifetime = NULL, *ttl = NULL, *cachedContent = NULL, *result = NULL, *_0, *_1 = NULL, *_2, *_3, *_4$$4, *_5$$3, *_6$$3, *_7$$7, *_8$$7, *_9$$8; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$true, __$null, prefixedKey, cacheFile, lifetime, ttl, cachedContent, result, _0, _1, _2, _3, _4$$4, _5$$3, _6$$3, _7$$7, _8$$7, _9$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&cacheFile); + ZVAL_UNDEF(&lifetime); + ZVAL_UNDEF(&ttl); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_9$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -594,57 +729,57 @@ PHP_METHOD(Phalcon_Cache_Backend_File, decrement) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getkey", NULL, 0, keyName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, _1); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - zephir_array_fetch_string(&_3, _2, SL("cacheDir"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/file.zep", 412 TSRMLS_CC); - ZEPHIR_INIT_VAR(cacheFile); - ZEPHIR_CONCAT_VV(cacheFile, _3, prefixedKey); - if ((zephir_file_exists(cacheFile TSRMLS_CC) == SUCCESS)) { - ZEPHIR_OBS_VAR(lifetime); - zephir_read_property_this(&lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - if (!(zephir_is_true(lifetime))) { - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&ttl, _4$$4, "getlifetime", NULL, 0); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, &_1); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + zephir_read_property(&_2, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch_string(&_3, &_2, SL("cacheDir"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/file.zep", 412 TSRMLS_CC); + ZEPHIR_INIT_VAR(&cacheFile); + ZEPHIR_CONCAT_VV(&cacheFile, &_3, &prefixedKey); + if ((zephir_file_exists(&cacheFile TSRMLS_CC) == SUCCESS)) { + ZEPHIR_OBS_VAR(&lifetime); + zephir_read_property(&lifetime, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + if (!(zephir_is_true(&lifetime))) { + zephir_read_property(&_4$$4, this_ptr, SL("_frontend"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&ttl, &_4$$4, "getlifetime", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(ttl, lifetime); + ZEPHIR_CPY_WRT(&ttl, &lifetime); } - ZEPHIR_CALL_FUNCTION(NULL, "clearstatcache", NULL, 125, ZEPHIR_GLOBAL(global_true), cacheFile); + ZEPHIR_CALL_FUNCTION(NULL, "clearstatcache", NULL, 106, &__$true, &cacheFile); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_5$$3); - zephir_filemtime(_5$$3, cacheFile TSRMLS_CC); - modifiedTime = zephir_get_intval(_5$$3); - ZEPHIR_INIT_VAR(_6$$3); - zephir_time(_6$$3); - if (ZEPHIR_LT_LONG(_6$$3, (modifiedTime + zephir_get_numberval(ttl)))) { - ZEPHIR_INIT_VAR(cachedContent); - zephir_file_get_contents(cachedContent, cacheFile TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(cachedContent)) { - ZEPHIR_INIT_VAR(_7$$7); - object_init_ex(_7$$7, phalcon_cache_exception_ce); - ZEPHIR_INIT_VAR(_8$$7); - ZEPHIR_CONCAT_SVS(_8$$7, "Cache file ", cacheFile, " could not be opened"); - ZEPHIR_CALL_METHOD(NULL, _7$$7, "__construct", NULL, 9, _8$$7); + ZEPHIR_INIT_VAR(&_5$$3); + zephir_filemtime(&_5$$3, &cacheFile TSRMLS_CC); + modifiedTime = zephir_get_intval(&_5$$3); + ZEPHIR_INIT_VAR(&_6$$3); + zephir_time(&_6$$3); + if (ZEPHIR_LT_LONG(&_6$$3, (modifiedTime + zephir_get_numberval(&ttl)))) { + ZEPHIR_INIT_VAR(&cachedContent); + zephir_file_get_contents(&cachedContent, &cacheFile TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&cachedContent)) { + ZEPHIR_INIT_VAR(&_7$$7); + object_init_ex(&_7$$7, phalcon_cache_exception_ce); + ZEPHIR_INIT_VAR(&_8$$7); + ZEPHIR_CONCAT_SVS(&_8$$7, "Cache file ", &cacheFile, " could not be opened"); + ZEPHIR_CALL_METHOD(NULL, &_7$$7, "__construct", NULL, 4, &_8$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$7, "phalcon/cache/backend/file.zep", 441 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$7, "phalcon/cache/backend/file.zep", 441 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_is_numeric(cachedContent)) { - ZEPHIR_INIT_VAR(result); - ZVAL_LONG(result, (zephir_get_numberval(cachedContent) - value)); - ZEPHIR_INIT_VAR(_9$$8); - zephir_file_put_contents(_9$$8, cacheFile, result TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_9$$8)) { + if (zephir_is_numeric(&cachedContent)) { + ZEPHIR_INIT_VAR(&result); + ZVAL_LONG(&result, (zephir_get_numberval(&cachedContent) - value)); + ZEPHIR_INIT_VAR(&_9$$8); + zephir_file_put_contents(&_9$$8, &cacheFile, &result TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_9$$8)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache directory can't be written", "phalcon/cache/backend/file.zep", 448); return; } - RETURN_CCTOR(result); + RETURN_CCTOR(&result); } } } @@ -659,53 +794,62 @@ PHP_METHOD(Phalcon_Cache_Backend_File, flush) { zend_bool _4$$5; zend_object_iterator *_1; - zval *prefix = NULL, *cacheDir = NULL, *item = NULL, *key = NULL, *cacheFile = NULL, *_0, *_2, *_3$$4 = NULL, *_5$$6 = NULL; + zval prefix, cacheDir, item, key, cacheFile, _0, _2, _3$$4, _5$$6; zephir_fcall_cache_entry *_6 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&cacheDir); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&cacheFile); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$6); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(cacheDir); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&cacheDir, _0, SS("cacheDir"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&cacheDir); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&cacheDir, &_0, SL("cacheDir"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/file.zep", 469); return; } - ZEPHIR_INIT_VAR(_2); - object_init_ex(_2, spl_ce_DirectoryIterator); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 127, cacheDir); + ZEPHIR_INIT_VAR(&_2); + object_init_ex(&_2, spl_ce_DirectoryIterator); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 108, &cacheDir); zephir_check_call_status(); - _1 = zephir_get_iterator(_2 TSRMLS_CC); + _1 = zephir_get_iterator(&_2 TSRMLS_CC); _1->funcs->rewind(_1 TSRMLS_CC); for (;_1->funcs->valid(_1 TSRMLS_CC) == SUCCESS && !EG(exception); _1->funcs->move_forward(_1 TSRMLS_CC)) { { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _1->funcs->get_current_data(_1, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(item, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&item, _1); } - ZEPHIR_CALL_METHOD(&_3$$4, item, "isfile", NULL, 0); + ZEPHIR_CALL_METHOD(&_3$$4, &item, "isfile", NULL, 0); zephir_check_call_status(); - if (EXPECTED(ZEPHIR_IS_TRUE(_3$$4))) { - ZEPHIR_CALL_METHOD(&key, item, "getfilename", NULL, 0); + if (EXPECTED(ZEPHIR_IS_TRUE(&_3$$4))) { + ZEPHIR_CALL_METHOD(&key, &item, "getfilename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&cacheFile, item, "getpathname", NULL, 0); + ZEPHIR_CALL_METHOD(&cacheFile, &item, "getpathname", NULL, 0); zephir_check_call_status(); - _4$$5 = ZEPHIR_IS_EMPTY(prefix); + _4$$5 = ZEPHIR_IS_EMPTY(&prefix); if (!(_4$$5)) { - _4$$5 = zephir_start_with(key, prefix, NULL); + _4$$5 = zephir_start_with(&key, &prefix, NULL); } if (_4$$5) { - ZEPHIR_CALL_FUNCTION(&_5$$6, "unlink", &_6, 126, cacheFile); + ZEPHIR_CALL_FUNCTION(&_5$$6, "unlink", &_6, 107, &cacheFile); zephir_check_call_status(); - if (!(zephir_is_true(_5$$6))) { + if (!(zephir_is_true(&_5$$6))) { RETURN_MM_BOOL(0); } } } } - _1->funcs->dtor(_1 TSRMLS_CC); + zend_iterator_dtor(_1); RETURN_MM_BOOL(1); } @@ -715,14 +859,18 @@ PHP_METHOD(Phalcon_Cache_Backend_File, flush) { */ PHP_METHOD(Phalcon_Cache_Backend_File, getKey) { - zval *key, *_0; + zval *key, key_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &key); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_useSafeKey"), PH_NOISY_CC); - if (ZEPHIR_IS_TRUE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_useSafeKey"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { zephir_md5(return_value, key); return; } @@ -736,8 +884,12 @@ PHP_METHOD(Phalcon_Cache_Backend_File, getKey) { */ PHP_METHOD(Phalcon_Cache_Backend_File, useSafeKey) { - zval *useSafeKey_param = NULL; + zval *useSafeKey_param = NULL, __$true, __$false; zend_bool useSafeKey; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &useSafeKey_param); @@ -745,9 +897,9 @@ PHP_METHOD(Phalcon_Cache_Backend_File, useSafeKey) { if (useSafeKey) { - zephir_update_property_this(getThis(), SL("_useSafeKey"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_useSafeKey"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_useSafeKey"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_useSafeKey"), &__$false); } RETURN_THISW(); diff --git a/ext/phalcon/cache/backend/file.zep.h b/ext/phalcon/cache/backend/file.zep.h index 648d63fc504..7d8dadc2e15 100644 --- a/ext/phalcon/cache/backend/file.zep.h +++ b/ext/phalcon/cache/backend/file.zep.h @@ -21,46 +21,117 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file___construct, 0, 0, 2) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file_increment, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_increment, 0, 0, IS_LONG, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_increment, 0, 0, IS_LONG, NULL, 1) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file_decrement, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_decrement, 0, 0, IS_LONG, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_decrement, 0, 0, IS_LONG, NULL, 1) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file_getkey, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_getkey, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_getkey, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_file_usesafekey, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_backend_file_usesafekey, 0, 1, Phalcon\\Cache\\Backend\\File, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_file_usesafekey, 0, 1, IS_OBJECT, "Phalcon\\Cache\\Backend\\File", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useSafeKey, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useSafeKey) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backend_file_method_entry) { @@ -72,7 +143,7 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_file_method_entry) { PHP_ME(Phalcon_Cache_Backend_File, exists, arginfo_phalcon_cache_backend_file_exists, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_File, increment, arginfo_phalcon_cache_backend_file_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_File, decrement, arginfo_phalcon_cache_backend_file_decrement, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_File, flush, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_File, flush, arginfo_phalcon_cache_backend_file_flush, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_File, getKey, arginfo_phalcon_cache_backend_file_getkey, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_File, useSafeKey, arginfo_phalcon_cache_backend_file_usesafekey, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/cache/backend/libmemcached.zep.c b/ext/phalcon/cache/backend/libmemcached.zep.c index 6075bd7d358..c3e1dfc8ae2 100644 --- a/ext/phalcon/cache/backend/libmemcached.zep.c +++ b/ext/phalcon/cache/backend/libmemcached.zep.c @@ -82,16 +82,25 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Backend_Libmemcached) { */ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, __construct) { - zval *_0$$4; + zval _0$$4; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_2 = NULL; - zval *frontend, *options = NULL, *servers = NULL, *_1$$5; + zval *frontend, frontend_sub, *options = NULL, options_sub, __$null, servers, _1$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontend_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&servers); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { - ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); + options = &options_sub; + ZEPHIR_CPY_WRT(options, &__$null); } else { ZEPHIR_SEPARATE_PARAM(options); } @@ -101,23 +110,23 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, __construct) { ZEPHIR_INIT_NVAR(options); array_init(options); } - if (!(zephir_array_isset_string(options, SS("servers")))) { - ZEPHIR_INIT_VAR(servers); - zephir_create_array(servers, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_0$$4); - zephir_create_array(_0$$4, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(_0$$4, SS("host"), SL("127.0.0.1"), 1); - add_assoc_long_ex(_0$$4, SS("port"), 11211); - add_assoc_long_ex(_0$$4, SS("weight"), 1); + if (!(zephir_array_isset_string(options, SL("servers")))) { + ZEPHIR_INIT_VAR(&servers); + zephir_create_array(&servers, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$4); + zephir_create_array(&_0$$4, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_0$$4, SL("host"), SL("127.0.0.1")); + add_assoc_long_ex(&_0$$4, SL("port"), 11211); + add_assoc_long_ex(&_0$$4, SL("weight"), 1); zephir_array_update_long(&servers, 0, &_0$$4, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_string(&options, SL("servers"), &servers, PH_COPY | PH_SEPARATE); + zephir_array_update_string(options, SL("servers"), &servers, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("statsKey")))) { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_STRING(_1$$5, "", 1); - zephir_array_update_string(&options, SL("statsKey"), &_1$$5, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("statsKey")))) { + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_STRING(&_1$$5, ""); + zephir_array_update_string(options, SL("statsKey"), &_1$$5, PH_COPY | PH_SEPARATE); } - ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_libmemcached_ce, getThis(), "__construct", &_2, 124, frontend, options); + ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_libmemcached_ce, getThis(), "__construct", &_2, 0, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -128,57 +137,67 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, __construct) { */ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, _connect) { - zval *options = NULL, *memcache = NULL, *client = NULL, *servers = NULL, *persistentId = NULL, *_0 = NULL, *_1$$4 = NULL, *_2$$4 = NULL; + zval options, memcache, client, servers, persistentId, _0, _1$$4, _2$$4; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&client); + ZVAL_UNDEF(&servers); + ZVAL_UNDEF(&persistentId); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(persistentId); - if (!(zephir_array_isset_string_fetch(&persistentId, options, SS("persistent_id"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(persistentId); - ZVAL_STRING(persistentId, "phalcon_cache", 1); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&persistentId); + if (!(zephir_array_isset_string_fetch(&persistentId, &options, SL("persistent_id"), 0))) { + ZEPHIR_INIT_NVAR(&persistentId); + ZVAL_STRING(&persistentId, "phalcon_cache"); } - ZEPHIR_INIT_VAR(memcache); - object_init_ex(memcache, zephir_get_internal_ce(SS("memcached") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, memcache, "__construct", NULL, 0, persistentId); + ZEPHIR_INIT_VAR(&memcache); + object_init_ex(&memcache, zephir_get_internal_ce(SL("memcached"))); + ZEPHIR_CALL_METHOD(NULL, &memcache, "__construct", NULL, 0, &persistentId); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, memcache, "getserverlist", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &memcache, "getserverlist", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(_0)) { - ZEPHIR_OBS_VAR(servers); - if (!(zephir_array_isset_string_fetch(&servers, options, SS("servers"), 0 TSRMLS_CC))) { + if (ZEPHIR_IS_EMPTY(&_0)) { + ZEPHIR_OBS_VAR(&servers); + if (!(zephir_array_isset_string_fetch(&servers, &options, SL("servers"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Servers must be an array", "phalcon/cache/backend/libmemcached.zep", 120); return; } - if (Z_TYPE_P(servers) != IS_ARRAY) { + if (Z_TYPE_P(&servers) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Servers must be an array", "phalcon/cache/backend/libmemcached.zep", 124); return; } - ZEPHIR_OBS_VAR(client); - if (!(zephir_array_isset_string_fetch(&client, options, SS("client"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(client); - array_init(client); + ZEPHIR_OBS_VAR(&client); + if (!(zephir_array_isset_string_fetch(&client, &options, SL("client"), 0))) { + ZEPHIR_INIT_NVAR(&client); + array_init(&client); } - if (Z_TYPE_P(client) != IS_ARRAY) { + if (Z_TYPE_P(&client) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Client options must be instance of array", "phalcon/cache/backend/libmemcached.zep", 132); return; } - ZEPHIR_CALL_METHOD(&_1$$4, memcache, "setoptions", NULL, 0, client); + ZEPHIR_CALL_METHOD(&_1$$4, &memcache, "setoptions", NULL, 0, &client); zephir_check_call_status(); - if (!(zephir_is_true(_1$$4))) { + if (!(zephir_is_true(&_1$$4))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cannot set to Memcached options", "phalcon/cache/backend/libmemcached.zep", 136); return; } - ZEPHIR_CALL_METHOD(&_2$$4, memcache, "addservers", NULL, 0, servers); + ZEPHIR_CALL_METHOD(&_2$$4, &memcache, "addservers", NULL, 0, &servers); zephir_check_call_status(); - if (!(zephir_is_true(_2$$4))) { + if (!(zephir_is_true(&_2$$4))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cannot connect to Memcached server", "phalcon/cache/backend/libmemcached.zep", 140); return; } } - zephir_update_property_this(getThis(), SL("_memcache"), memcache TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_memcache"), &memcache); ZEPHIR_MM_RESTORE(); } @@ -189,13 +208,21 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, _connect) { PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, get) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *lifetime_param = NULL, *memcache = NULL, *prefixedKey = NULL, *cachedContent = NULL, *_0, *_1$$6; - zval *keyName = NULL; + zval *keyName_param = NULL, *lifetime_param = NULL, memcache, prefixedKey, cachedContent, _0, _1$$6; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName_param, &lifetime_param); - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); if (!lifetime_param) { lifetime = 0; } else { @@ -203,28 +230,28 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, get) { } - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - ZEPHIR_CALL_METHOD(&cachedContent, memcache, "get", NULL, 0, prefixedKey); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + } + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, &keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + ZEPHIR_CALL_METHOD(&cachedContent, &memcache, "get", NULL, 0, &prefixedKey); zephir_check_call_status(); - if (!(zephir_is_true(cachedContent))) { + if (!(zephir_is_true(&cachedContent))) { RETURN_MM_NULL(); } - if (zephir_is_numeric(cachedContent)) { - RETURN_CCTOR(cachedContent); + if (zephir_is_numeric(&cachedContent)) { + RETURN_CCTOR(&cachedContent); } else { - _1$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_1$$6, "afterretrieve", NULL, 0, cachedContent); + zephir_read_property(&_1$$6, this_ptr, SL("_frontend"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_1$$6, "afterretrieve", NULL, 0, &cachedContent); zephir_check_call_status(); RETURN_MM(); } @@ -243,19 +270,46 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, save) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend = NULL, *memcache = NULL, *cachedContent = NULL, *preparedContent = NULL, *tmp = NULL, *tt1 = NULL, *success = NULL, *options = NULL, *specialKey = NULL, *keys = NULL, *isBuffering = NULL, *_0$$4, *_1$$15, *_2$$15 = NULL, *_3$$15; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer_param = NULL, __$true, __$false, __$null, lastKey, frontend, memcache, cachedContent, preparedContent, tmp, tt1, success, options, specialKey, keys, isBuffering, _0$$4, _1$$15, _2$$15, _3$$15; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&preparedContent); + ZVAL_UNDEF(&tmp); + ZVAL_UNDEF(&tt1); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&isBuffering); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$15); + ZVAL_UNDEF(&_2$$15); + ZVAL_UNDEF(&_3$$15); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } if (!stopBuffer_param) { stopBuffer = 1; @@ -265,102 +319,102 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, save) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, _0$$4, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &_0$$4, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } - if (!(zephir_is_true(lastKey))) { + if (!(zephir_is_true(&lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/libmemcached.zep", 196); return; } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } if (Z_TYPE_P(content) == IS_NULL) { - ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&cachedContent, &frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(cachedContent, content); + ZEPHIR_CPY_WRT(&cachedContent, content); } - if (!(zephir_is_numeric(cachedContent))) { - ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); + if (!(zephir_is_numeric(&cachedContent))) { + ZEPHIR_CALL_METHOD(&preparedContent, &frontend, "beforestore", NULL, 0, &cachedContent); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedContent, cachedContent); + ZEPHIR_CPY_WRT(&preparedContent, &cachedContent); } if (Z_TYPE_P(lifetime) == IS_NULL) { - ZEPHIR_OBS_VAR(tmp); - zephir_read_property_this(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - if (!(zephir_is_true(tmp))) { - ZEPHIR_CALL_METHOD(&tt1, frontend, "getlifetime", NULL, 0); + ZEPHIR_OBS_VAR(&tmp); + zephir_read_property(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + if (!(zephir_is_true(&tmp))) { + ZEPHIR_CALL_METHOD(&tt1, &frontend, "getlifetime", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(tt1, tmp); + ZEPHIR_CPY_WRT(&tt1, &tmp); } } else { - ZEPHIR_CPY_WRT(tt1, lifetime); + ZEPHIR_CPY_WRT(&tt1, lifetime); } - ZEPHIR_CALL_METHOD(&success, memcache, "set", NULL, 0, lastKey, preparedContent, tt1); + ZEPHIR_CALL_METHOD(&success, &memcache, "set", NULL, 0, &lastKey, &preparedContent, &tt1); zephir_check_call_status(); - if (!(zephir_is_true(success))) { - ZEPHIR_INIT_VAR(_1$$15); - object_init_ex(_1$$15, phalcon_cache_exception_ce); - ZEPHIR_CALL_METHOD(&_2$$15, memcache, "getresultcode", NULL, 0); + if (!(zephir_is_true(&success))) { + ZEPHIR_INIT_VAR(&_1$$15); + object_init_ex(&_1$$15, phalcon_cache_exception_ce); + ZEPHIR_CALL_METHOD(&_2$$15, &memcache, "getresultcode", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3$$15); - ZEPHIR_CONCAT_SV(_3$$15, "Failed storing data in memcached, error code: ", _2$$15); - ZEPHIR_CALL_METHOD(NULL, _1$$15, "__construct", NULL, 9, _3$$15); + ZEPHIR_INIT_VAR(&_3$$15); + ZEPHIR_CONCAT_SV(&_3$$15, "Failed storing data in memcached, error code: ", &_2$$15); + ZEPHIR_CALL_METHOD(NULL, &_1$$15, "__construct", NULL, 4, &_3$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$15, "phalcon/cache/backend/libmemcached.zep", 240 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$15, "phalcon/cache/backend/libmemcached.zep", 240 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/libmemcached.zep", 246); return; } - if (!ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); + if (!ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_CALL_METHOD(&keys, &memcache, "get", NULL, 0, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(keys); - array_init(keys); + if (Z_TYPE_P(&keys) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&keys); + array_init(&keys); } - if (!(zephir_array_isset(keys, lastKey))) { - zephir_array_update_zval(&keys, lastKey, &tt1, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, memcache, "set", NULL, 0, specialKey, keys); + if (!(zephir_array_isset(&keys, &lastKey))) { + zephir_array_update_zval(&keys, &lastKey, &tt1, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, &memcache, "set", NULL, 0, &specialKey, &keys); zephir_check_call_status(); } } - ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0); + ZEPHIR_CALL_METHOD(&isBuffering, &frontend, "isbuffering", NULL, 0); zephir_check_call_status(); if (stopBuffer == 1) { - ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &frontend, "stop", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) { - zend_print_zval(cachedContent, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&isBuffering)) { + zend_print_zval(&cachedContent, 0); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -373,43 +427,53 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, save) { PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *memcache = NULL, *prefixedKey = NULL, *options = NULL, *keys = NULL, *specialKey = NULL, *ret = NULL, *_0; + zval *keyName, keyName_sub, memcache, prefixedKey, options, keys, specialKey, ret, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName); - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, keyName); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + } + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, keyName); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/libmemcached.zep", 299); return; } - if (!ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); + if (!ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_CALL_METHOD(&keys, &memcache, "get", NULL, 0, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) == IS_ARRAY) { - zephir_array_unset(&keys, prefixedKey, PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, memcache, "set", NULL, 0, specialKey, keys); + if (Z_TYPE_P(&keys) == IS_ARRAY) { + zephir_array_unset(&keys, &prefixedKey, PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, &memcache, "set", NULL, 0, &specialKey, &keys); zephir_check_call_status(); } } - ZEPHIR_CALL_METHOD(&ret, memcache, "delete", NULL, 0, prefixedKey); + ZEPHIR_CALL_METHOD(&ret, &memcache, "delete", NULL, 0, &prefixedKey); zephir_check_call_status(); - RETURN_CCTOR(ret); + RETURN_CCTOR(&ret); } @@ -426,69 +490,83 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, delete) { PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, queryKeys) { zend_bool _4$$7; - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, *memcache = NULL, *options = NULL, *keys = NULL, *specialKey = NULL, *key = NULL, *idx = NULL, *_0, **_3; - zval *prefix = NULL; + zval *prefix_param = NULL, memcache, options, keys, specialKey, key, idx, _0, *_1; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&idx); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix_param); if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/libmemcached.zep", 341); return; } - if (ZEPHIR_IS_STRING(specialKey, "")) { + if (ZEPHIR_IS_STRING(&specialKey, "")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCM')!", "phalcon/cache/backend/libmemcached.zep", 345); return; } - ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); + ZEPHIR_CALL_METHOD(&keys, &memcache, "get", NULL, 0, &specialKey); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(keys) != IS_ARRAY)) { + if (UNEXPECTED(Z_TYPE_P(&keys) != IS_ARRAY)) { array_init(return_value); RETURN_MM(); } - ZEPHIR_INIT_VAR(_0); - zephir_array_keys(_0, keys TSRMLS_CC); - ZEPHIR_CPY_WRT(keys, _0); - zephir_is_iterable(keys, &_2, &_1, 1, 0, "phalcon/cache/backend/libmemcached.zep", 363); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(idx, _2, _1); - ZEPHIR_GET_HVALUE(key, _3); - _4$$7 = !(ZEPHIR_IS_EMPTY(prefix)); + ZEPHIR_INIT_VAR(&_0); + zephir_array_keys(&_0, &keys TSRMLS_CC); + ZEPHIR_CPY_WRT(&keys, &_0); + zephir_is_iterable(&keys, 1, "phalcon/cache/backend/libmemcached.zep", 363); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&keys), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&idx); + if (_3 != NULL) { + ZVAL_STR_COPY(&idx, _3); + } else { + ZVAL_LONG(&idx, _2); + } + ZEPHIR_INIT_NVAR(&key); + ZVAL_COPY(&key, _1); + _4$$7 = !(ZEPHIR_IS_EMPTY(&prefix)); if (_4$$7) { - _4$$7 = !(zephir_start_with(key, prefix, NULL)); + _4$$7 = !(zephir_start_with(&key, &prefix, NULL)); } if (_4$$7) { - zephir_array_unset(&keys, idx, PH_SEPARATE); + zephir_array_unset(&keys, &idx, PH_SEPARATE); } - } - zend_hash_destroy(_2); - FREE_HASHTABLE(_2); - RETURN_CCTOR(keys); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_INIT_NVAR(&idx); + RETURN_CCTOR(&keys); } @@ -501,13 +579,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, queryKeys) { PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, exists) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *lifetime_param = NULL, *lastKey = NULL, *memcache = NULL, *value = NULL, *_0$$4; + zval *keyName = NULL, keyName_sub, *lifetime_param = NULL, __$null, lastKey, memcache, value, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime_param) { lifetime = 0; @@ -517,25 +604,25 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, exists) { if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, _0$$4, keyName); - } - if (zephir_is_true(lastKey)) { - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &_0$$4, keyName); + } + if (zephir_is_true(&lastKey)) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } - ZEPHIR_CALL_METHOD(&value, memcache, "get", NULL, 0, lastKey); + ZEPHIR_CALL_METHOD(&value, &memcache, "get", NULL, 0, &lastKey); zephir_check_call_status(); - if (!(zephir_is_true(value))) { + if (!(zephir_is_true(&value))) { RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1); @@ -552,13 +639,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, exists) { PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, increment) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *memcache = NULL, *prefix = NULL, *lastKey = NULL, *_0; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, memcache, prefix, lastKey, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -567,30 +663,29 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, increment) { } - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, prefix, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } if (!(value)) { value = 1; } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, value); - ZEPHIR_RETURN_CALL_METHOD(memcache, "increment", NULL, 0, lastKey, _0); + ZVAL_LONG(&_0, value); + ZEPHIR_RETURN_CALL_METHOD(&memcache, "increment", NULL, 0, &lastKey, &_0); zephir_check_call_status(); RETURN_MM(); @@ -604,13 +699,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, increment) { PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, decrement) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *memcache = NULL, *prefix = NULL, *lastKey = NULL, *_0; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, memcache, prefix, lastKey, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -619,27 +723,26 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, decrement) { } - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, prefix, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, value); - ZEPHIR_RETURN_CALL_METHOD(memcache, "decrement", NULL, 0, lastKey, _0); + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + } + ZVAL_LONG(&_0, value); + ZEPHIR_RETURN_CALL_METHOD(&memcache, "decrement", NULL, 0, &lastKey, &_0); zephir_check_call_status(); RETURN_MM(); @@ -667,50 +770,64 @@ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, decrement) { */ PHP_METHOD(Phalcon_Cache_Backend_Libmemcached, flush) { - HashTable *_2; - HashPosition _1; - zval *memcache = NULL, *options = NULL, *keys = NULL, *specialKey = NULL, *key = NULL, *_0 = NULL, **_3; + zend_string *_3; + zend_ulong _2; + zval memcache, options, keys, specialKey, key, _0, *_1; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/libmemcached.zep", 490); return; } - if (ZEPHIR_IS_STRING(specialKey, "")) { + if (ZEPHIR_IS_STRING(&specialKey, "")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCM')!", "phalcon/cache/backend/libmemcached.zep", 494); return; } - ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); + ZEPHIR_CALL_METHOD(&keys, &memcache, "get", NULL, 0, &specialKey); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(keys) != IS_ARRAY)) { + if (UNEXPECTED(Z_TYPE_P(&keys) != IS_ARRAY)) { RETURN_MM_BOOL(1); } - ZEPHIR_INIT_VAR(_0); - zephir_is_iterable(keys, &_2, &_1, 0, 0, "phalcon/cache/backend/libmemcached.zep", 509); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(key, _2, _1); - ZEPHIR_GET_HVALUE(_0, _3); - ZEPHIR_CALL_METHOD(NULL, memcache, "delete", &_4, 0, key); + ZEPHIR_INIT_VAR(&_0); + zephir_is_iterable(&keys, 0, "phalcon/cache/backend/libmemcached.zep", 509); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&keys), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&_0); + ZVAL_COPY(&_0, _1); + ZEPHIR_CALL_METHOD(NULL, &memcache, "delete", &_4, 0, &key); zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(NULL, memcache, "delete", NULL, 0, specialKey); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_0); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_CALL_METHOD(NULL, &memcache, "delete", NULL, 0, &specialKey); zephir_check_call_status(); RETURN_MM_BOOL(1); diff --git a/ext/phalcon/cache/backend/libmemcached.zep.h b/ext/phalcon/cache/backend/libmemcached.zep.h index bf885d4563c..f66575316c1 100644 --- a/ext/phalcon/cache/backend/libmemcached.zep.h +++ b/ext/phalcon/cache/backend/libmemcached.zep.h @@ -20,38 +20,85 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_libmemcached___construct, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_delete, 0, 0, 1) ZEND_ARG_INFO(0, keyName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_increment, 0, 0, 0) ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_decrement, 0, 0, 0) ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_libmemcached_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backend_libmemcached_method_entry) { @@ -64,6 +111,6 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_libmemcached_method_entry) { PHP_ME(Phalcon_Cache_Backend_Libmemcached, exists, arginfo_phalcon_cache_backend_libmemcached_exists, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Libmemcached, increment, arginfo_phalcon_cache_backend_libmemcached_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Libmemcached, decrement, arginfo_phalcon_cache_backend_libmemcached_decrement, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_Libmemcached, flush, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_Libmemcached, flush, arginfo_phalcon_cache_backend_libmemcached_flush, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cache/backend/memcache.zep.c b/ext/phalcon/cache/backend/memcache.zep.c index a0c8fe13d1a..5042f4d6eae 100644 --- a/ext/phalcon/cache/backend/memcache.zep.c +++ b/ext/phalcon/cache/backend/memcache.zep.c @@ -78,13 +78,23 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_3 = NULL; - zval *frontend, *options = NULL, *_0$$4, *_1$$5, *_2$$7; + zval *frontend, frontend_sub, *options = NULL, options_sub, __$false, __$null, _0$$4, _1$$5, _2$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontend_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { - ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); + options = &options_sub; + ZEPHIR_CPY_WRT(options, &__$null); } else { ZEPHIR_SEPARATE_PARAM(options); } @@ -94,25 +104,25 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, __construct) { ZEPHIR_INIT_NVAR(options); array_init(options); } - if (!(zephir_array_isset_string(options, SS("host")))) { - ZEPHIR_INIT_VAR(_0$$4); - ZVAL_STRING(_0$$4, "127.0.0.1", 1); - zephir_array_update_string(&options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("host")))) { + ZEPHIR_INIT_VAR(&_0$$4); + ZVAL_STRING(&_0$$4, "127.0.0.1"); + zephir_array_update_string(options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("port")))) { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_LONG(_1$$5, 11211); - zephir_array_update_string(&options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("port")))) { + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_LONG(&_1$$5, 11211); + zephir_array_update_string(options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("persistent")))) { - zephir_array_update_string(&options, SL("persistent"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("persistent")))) { + zephir_array_update_string(options, SL("persistent"), &__$false, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("statsKey")))) { - ZEPHIR_INIT_VAR(_2$$7); - ZVAL_STRING(_2$$7, "", 1); - zephir_array_update_string(&options, SL("statsKey"), &_2$$7, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("statsKey")))) { + ZEPHIR_INIT_VAR(&_2$$7); + ZVAL_STRING(&_2$$7, ""); + zephir_array_update_string(options, SL("statsKey"), &_2$$7, PH_COPY | PH_SEPARATE); } - ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_memcache_ce, getThis(), "__construct", &_3, 124, frontend, options); + ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_memcache_ce, getThis(), "__construct", &_3, 0, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -124,46 +134,54 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, __construct) { PHP_METHOD(Phalcon_Cache_Backend_Memcache, _connect) { zend_bool _0, _1; - zval *options = NULL, *memcache = NULL, *persistent = NULL, *success = NULL, *host = NULL, *port = NULL; + zval options, memcache, persistent, success, host, port; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&persistent); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&host); + ZVAL_UNDEF(&port); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(memcache); - object_init_ex(memcache, zephir_get_internal_ce(SS("memcache") TSRMLS_CC)); - if (zephir_has_constructor(memcache TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, memcache, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&memcache); + object_init_ex(&memcache, zephir_get_internal_ce(SL("memcache"))); + if (zephir_has_constructor(&memcache TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &memcache, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(host); - _0 = !(zephir_array_isset_string_fetch(&host, options, SS("host"), 0 TSRMLS_CC)); + ZEPHIR_OBS_VAR(&host); + _0 = !(zephir_array_isset_string_fetch(&host, &options, SL("host"), 0)); if (!(_0)) { - ZEPHIR_OBS_VAR(port); - _0 = !(zephir_array_isset_string_fetch(&port, options, SS("port"), 0 TSRMLS_CC)); + ZEPHIR_OBS_VAR(&port); + _0 = !(zephir_array_isset_string_fetch(&port, &options, SL("port"), 0)); } _1 = _0; if (!(_1)) { - ZEPHIR_OBS_VAR(persistent); - _1 = !(zephir_array_isset_string_fetch(&persistent, options, SS("persistent"), 0 TSRMLS_CC)); + ZEPHIR_OBS_VAR(&persistent); + _1 = !(zephir_array_isset_string_fetch(&persistent, &options, SL("persistent"), 0)); } if (_1) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/memcache.zep", 109); return; } - if (zephir_is_true(persistent)) { - ZEPHIR_CALL_METHOD(&success, memcache, "pconnect", NULL, 0, host, port); + if (zephir_is_true(&persistent)) { + ZEPHIR_CALL_METHOD(&success, &memcache, "pconnect", NULL, 0, &host, &port); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&success, memcache, "connect", NULL, 0, host, port); + ZEPHIR_CALL_METHOD(&success, &memcache, "connect", NULL, 0, &host, &port); zephir_check_call_status(); } - if (!(zephir_is_true(success))) { + if (!(zephir_is_true(&success))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cannot connect to Memcached server", "phalcon/cache/backend/memcache.zep", 119); return; } - zephir_update_property_this(getThis(), SL("_memcache"), memcache TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_memcache"), &memcache); ZEPHIR_MM_RESTORE(); } @@ -175,21 +193,28 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, addServers) { zend_bool persistent; zend_long port, ZEPHIR_LAST_CALL_STATUS; - zval *host_param = NULL, *port_param = NULL, *persistent_param = NULL, *memcache = NULL, *success = NULL, *_0, *_1; - zval *host = NULL; + zval *host_param = NULL, *port_param = NULL, *persistent_param = NULL, memcache, success, _0, _1; + zval host; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&host); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &host_param, &port_param, &persistent_param); if (UNEXPECTED(Z_TYPE_P(host_param) != IS_STRING && Z_TYPE_P(host_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'host' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'host' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(host_param) == IS_STRING)) { - zephir_get_strval(host, host_param); + zephir_get_strval(&host, host_param); } else { - ZEPHIR_INIT_VAR(host); - ZVAL_EMPTY_STRING(host); + ZEPHIR_INIT_VAR(&host); + ZVAL_EMPTY_STRING(&host); } port = zephir_get_intval(port_param); if (!persistent_param) { @@ -199,26 +224,24 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, addServers) { } - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, port); - ZEPHIR_INIT_VAR(_1); + ZVAL_LONG(&_0, port); if (persistent) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(&success, memcache, "addserver", NULL, 0, host, _0, _1); + ZEPHIR_CALL_METHOD(&success, &memcache, "addserver", NULL, 0, &host, &_0, &_1); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_memcache"), memcache TSRMLS_CC); - RETURN_CCTOR(success); + zephir_update_property_zval(this_ptr, SL("_memcache"), &memcache); + RETURN_CCTOR(&success); } @@ -228,13 +251,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, addServers) { PHP_METHOD(Phalcon_Cache_Backend_Memcache, get) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *lifetime_param = NULL, *memcache = NULL, *prefixedKey = NULL, *cachedContent = NULL, *retrieve = NULL, *_0, *_1; - zval *keyName = NULL; + zval *keyName_param = NULL, *lifetime_param = NULL, memcache, prefixedKey, cachedContent, retrieve, _0, _1; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&retrieve); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName_param, &lifetime_param); - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); if (!lifetime_param) { lifetime = 0; } else { @@ -242,30 +274,30 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, get) { } - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - ZEPHIR_CALL_METHOD(&cachedContent, memcache, "get", NULL, 0, prefixedKey); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + } + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, &keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + ZEPHIR_CALL_METHOD(&cachedContent, &memcache, "get", NULL, 0, &prefixedKey); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(cachedContent)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&cachedContent)) { RETURN_MM_NULL(); } - if (zephir_is_numeric(cachedContent)) { - RETURN_CCTOR(cachedContent); + if (zephir_is_numeric(&cachedContent)) { + RETURN_CCTOR(&cachedContent); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&retrieve, _1, "afterretrieve", NULL, 0, cachedContent); + zephir_read_property(&_1, this_ptr, SL("_frontend"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&retrieve, &_1, "afterretrieve", NULL, 0, &cachedContent); zephir_check_call_status(); - RETURN_CCTOR(retrieve); + RETURN_CCTOR(&retrieve); } @@ -281,19 +313,44 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, save) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend = NULL, *memcache = NULL, *cachedContent = NULL, *preparedContent = NULL, *tmp = NULL, *ttl = NULL, *success = NULL, *options = NULL, *specialKey = NULL, *keys = NULL, *isBuffering = NULL, *_1, *_0$$4; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer_param = NULL, __$true, __$false, __$null, lastKey, frontend, memcache, cachedContent, preparedContent, tmp, ttl, success, options, specialKey, keys, isBuffering, _1, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&preparedContent); + ZVAL_UNDEF(&tmp); + ZVAL_UNDEF(&ttl); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&isBuffering); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } if (!stopBuffer_param) { stopBuffer = 1; @@ -303,95 +360,94 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, save) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, _0$$4, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &_0$$4, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } - if (!(zephir_is_true(lastKey))) { + if (!(zephir_is_true(&lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/memcache.zep", 194); return; } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } if (Z_TYPE_P(content) == IS_NULL) { - ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&cachedContent, &frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(cachedContent, content); + ZEPHIR_CPY_WRT(&cachedContent, content); } - if (!(zephir_is_numeric(cachedContent))) { - ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); + if (!(zephir_is_numeric(&cachedContent))) { + ZEPHIR_CALL_METHOD(&preparedContent, &frontend, "beforestore", NULL, 0, &cachedContent); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedContent, cachedContent); + ZEPHIR_CPY_WRT(&preparedContent, &cachedContent); } if (Z_TYPE_P(lifetime) == IS_NULL) { - ZEPHIR_OBS_VAR(tmp); - zephir_read_property_this(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - if (!(zephir_is_true(tmp))) { - ZEPHIR_CALL_METHOD(&ttl, frontend, "getlifetime", NULL, 0); + ZEPHIR_OBS_VAR(&tmp); + zephir_read_property(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + if (!(zephir_is_true(&tmp))) { + ZEPHIR_CALL_METHOD(&ttl, &frontend, "getlifetime", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(ttl, tmp); + ZEPHIR_CPY_WRT(&ttl, &tmp); } } else { - ZEPHIR_CPY_WRT(ttl, lifetime); + ZEPHIR_CPY_WRT(&ttl, lifetime); } - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_CALL_METHOD(&success, memcache, "set", NULL, 0, lastKey, preparedContent, _1, ttl); + ZVAL_LONG(&_1, 0); + ZEPHIR_CALL_METHOD(&success, &memcache, "set", NULL, 0, &lastKey, &preparedContent, &_1, &ttl); zephir_check_call_status(); - if (!(zephir_is_true(success))) { + if (!(zephir_is_true(&success))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing data in memcached", "phalcon/cache/backend/memcache.zep", 241); return; } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/memcache.zep", 247); return; } - if (!ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); + if (!ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_CALL_METHOD(&keys, &memcache, "get", NULL, 0, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(keys); - array_init(keys); + if (Z_TYPE_P(&keys) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&keys); + array_init(&keys); } - if (!(zephir_array_isset(keys, lastKey))) { - zephir_array_update_zval(&keys, lastKey, &ttl, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, memcache, "set", NULL, 0, specialKey, keys); + if (!(zephir_array_isset(&keys, &lastKey))) { + zephir_array_update_zval(&keys, &lastKey, &ttl, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, &memcache, "set", NULL, 0, &specialKey, &keys); zephir_check_call_status(); } } - ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0); + ZEPHIR_CALL_METHOD(&isBuffering, &frontend, "isbuffering", NULL, 0); zephir_check_call_status(); if (stopBuffer == 1) { - ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &frontend, "stop", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) { - zend_print_zval(cachedContent, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&isBuffering)) { + zend_print_zval(&cachedContent, 0); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -404,43 +460,53 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, save) { PHP_METHOD(Phalcon_Cache_Backend_Memcache, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *memcache = NULL, *prefixedKey = NULL, *options = NULL, *keys = NULL, *specialKey = NULL, *ret = NULL, *_0; + zval *keyName, keyName_sub, memcache, prefixedKey, options, keys, specialKey, ret, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName); - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, keyName); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + } + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, keyName); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/memcache.zep", 300); return; } - if (!ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); + if (!ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_CALL_METHOD(&keys, &memcache, "get", NULL, 0, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) == IS_ARRAY) { - zephir_array_unset(&keys, prefixedKey, PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, memcache, "set", NULL, 0, specialKey, keys); + if (Z_TYPE_P(&keys) == IS_ARRAY) { + zephir_array_unset(&keys, &prefixedKey, PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, &memcache, "set", NULL, 0, &specialKey, &keys); zephir_check_call_status(); } } - ZEPHIR_CALL_METHOD(&ret, memcache, "delete", NULL, 0, prefixedKey); + ZEPHIR_CALL_METHOD(&ret, &memcache, "delete", NULL, 0, &prefixedKey); zephir_check_call_status(); - RETURN_CCTOR(ret); + RETURN_CCTOR(&ret); } @@ -457,69 +523,83 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, delete) { PHP_METHOD(Phalcon_Cache_Backend_Memcache, queryKeys) { zend_bool _4$$7; - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, *memcache = NULL, *options = NULL, *keys = NULL, *specialKey = NULL, *key = NULL, *idx = NULL, *_0, **_3; - zval *prefix = NULL; + zval *prefix_param = NULL, memcache, options, keys, specialKey, key, idx, _0, *_1; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&idx); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix_param); if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/memcache.zep", 343); return; } - if (ZEPHIR_IS_STRING(specialKey, "")) { + if (ZEPHIR_IS_STRING(&specialKey, "")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCM')!", "phalcon/cache/backend/memcache.zep", 347); return; } - ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); + ZEPHIR_CALL_METHOD(&keys, &memcache, "get", NULL, 0, &specialKey); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(keys) != IS_ARRAY)) { + if (UNEXPECTED(Z_TYPE_P(&keys) != IS_ARRAY)) { array_init(return_value); RETURN_MM(); } - ZEPHIR_INIT_VAR(_0); - zephir_array_keys(_0, keys TSRMLS_CC); - ZEPHIR_CPY_WRT(keys, _0); - zephir_is_iterable(keys, &_2, &_1, 1, 0, "phalcon/cache/backend/memcache.zep", 365); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(idx, _2, _1); - ZEPHIR_GET_HVALUE(key, _3); - _4$$7 = !(ZEPHIR_IS_EMPTY(prefix)); + ZEPHIR_INIT_VAR(&_0); + zephir_array_keys(&_0, &keys TSRMLS_CC); + ZEPHIR_CPY_WRT(&keys, &_0); + zephir_is_iterable(&keys, 1, "phalcon/cache/backend/memcache.zep", 365); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&keys), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&idx); + if (_3 != NULL) { + ZVAL_STR_COPY(&idx, _3); + } else { + ZVAL_LONG(&idx, _2); + } + ZEPHIR_INIT_NVAR(&key); + ZVAL_COPY(&key, _1); + _4$$7 = !(ZEPHIR_IS_EMPTY(&prefix)); if (_4$$7) { - _4$$7 = !(zephir_start_with(key, prefix, NULL)); + _4$$7 = !(zephir_start_with(&key, &prefix, NULL)); } if (_4$$7) { - zephir_array_unset(&keys, idx, PH_SEPARATE); + zephir_array_unset(&keys, &idx, PH_SEPARATE); } - } - zend_hash_destroy(_2); - FREE_HASHTABLE(_2); - RETURN_CCTOR(keys); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_INIT_NVAR(&idx); + RETURN_CCTOR(&keys); } @@ -532,13 +612,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, queryKeys) { PHP_METHOD(Phalcon_Cache_Backend_Memcache, exists) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *lifetime_param = NULL, *lastKey = NULL, *memcache = NULL, *prefix = NULL, *_0$$5 = NULL; + zval *keyName = NULL, keyName_sub, *lifetime_param = NULL, __$null, lastKey, memcache, prefix, _0$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_0$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime_param) { lifetime = 0; @@ -548,26 +637,26 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, exists) { if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, prefix, keyName); - } - if (zephir_is_true(lastKey)) { - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + } + if (zephir_is_true(&lastKey)) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } - ZEPHIR_CALL_METHOD(&_0$$5, memcache, "get", NULL, 0, lastKey); + ZEPHIR_CALL_METHOD(&_0$$5, &memcache, "get", NULL, 0, &lastKey); zephir_check_call_status(); - if (!(zephir_is_true(_0$$5))) { + if (!(zephir_is_true(&_0$$5))) { RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1); @@ -584,13 +673,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, exists) { PHP_METHOD(Phalcon_Cache_Backend_Memcache, increment) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *memcache = NULL, *prefix = NULL, *lastKey = NULL, *_0; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, memcache, prefix, lastKey, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -599,27 +697,26 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, increment) { } - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, prefix, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, value); - ZEPHIR_RETURN_CALL_METHOD(memcache, "increment", NULL, 0, lastKey, _0); + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + } + ZVAL_LONG(&_0, value); + ZEPHIR_RETURN_CALL_METHOD(&memcache, "increment", NULL, 0, &lastKey, &_0); zephir_check_call_status(); RETURN_MM(); @@ -633,13 +730,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, increment) { PHP_METHOD(Phalcon_Cache_Backend_Memcache, decrement) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *memcache = NULL, *prefix = NULL, *lastKey = NULL, *_0; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, memcache, prefix, lastKey, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -648,27 +754,26 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, decrement) { } - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, prefix, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, value); - ZEPHIR_RETURN_CALL_METHOD(memcache, "decrement", NULL, 0, lastKey, _0); + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + } + ZVAL_LONG(&_0, value); + ZEPHIR_RETURN_CALL_METHOD(&memcache, "decrement", NULL, 0, &lastKey, &_0); zephir_check_call_status(); RETURN_MM(); @@ -679,50 +784,64 @@ PHP_METHOD(Phalcon_Cache_Backend_Memcache, decrement) { */ PHP_METHOD(Phalcon_Cache_Backend_Memcache, flush) { - HashTable *_2; - HashPosition _1; - zval *memcache = NULL, *options = NULL, *keys = NULL, *specialKey = NULL, *key = NULL, *_0 = NULL, **_3; + zend_string *_3; + zend_ulong _2; + zval memcache, options, keys, specialKey, key, _0, *_1; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&memcache); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); - if (Z_TYPE_P(memcache) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + if (Z_TYPE_P(&memcache) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(memcache); - zephir_read_property_this(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&memcache); + zephir_read_property(&memcache, this_ptr, SL("_memcache"), PH_NOISY_CC); } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/memcache.zep", 473); return; } - if (ZEPHIR_IS_STRING(specialKey, "")) { + if (ZEPHIR_IS_STRING(&specialKey, "")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCM')!", "phalcon/cache/backend/memcache.zep", 477); return; } - ZEPHIR_CALL_METHOD(&keys, memcache, "get", NULL, 0, specialKey); + ZEPHIR_CALL_METHOD(&keys, &memcache, "get", NULL, 0, &specialKey); zephir_check_call_status(); - if (UNEXPECTED(Z_TYPE_P(keys) != IS_ARRAY)) { + if (UNEXPECTED(Z_TYPE_P(&keys) != IS_ARRAY)) { RETURN_MM_BOOL(1); } - ZEPHIR_INIT_VAR(_0); - zephir_is_iterable(keys, &_2, &_1, 0, 0, "phalcon/cache/backend/memcache.zep", 492); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(key, _2, _1); - ZEPHIR_GET_HVALUE(_0, _3); - ZEPHIR_CALL_METHOD(NULL, memcache, "delete", &_4, 0, key); + ZEPHIR_INIT_VAR(&_0); + zephir_is_iterable(&keys, 0, "phalcon/cache/backend/memcache.zep", 492); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&keys), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&_0); + ZVAL_COPY(&_0, _1); + ZEPHIR_CALL_METHOD(NULL, &memcache, "delete", &_4, 0, &key); zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(NULL, memcache, "delete", NULL, 0, specialKey); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_0); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_CALL_METHOD(NULL, &memcache, "delete", NULL, 0, &specialKey); zephir_check_call_status(); RETURN_MM_BOOL(1); diff --git a/ext/phalcon/cache/backend/memcache.zep.h b/ext/phalcon/cache/backend/memcache.zep.h index 2e32e6eed1e..fb256c501b2 100644 --- a/ext/phalcon/cache/backend/memcache.zep.h +++ b/ext/phalcon/cache/backend/memcache.zep.h @@ -20,45 +20,108 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memcache___construct, 0, 0, ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memcache_addservers, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_addservers, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_addservers, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, host, IS_STRING, 0) +#else ZEND_ARG_INFO(0, host) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, port, IS_LONG, 0) +#else ZEND_ARG_INFO(0, port) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, persistent, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, persistent) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memcache_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memcache_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memcache_delete, 0, 0, 1) ZEND_ARG_INFO(0, keyName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memcache_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memcache_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memcache_increment, 0, 0, 0) ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memcache_decrement, 0, 0, 0) ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memcache_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backend_memcache_method_entry) { @@ -72,6 +135,6 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_memcache_method_entry) { PHP_ME(Phalcon_Cache_Backend_Memcache, exists, arginfo_phalcon_cache_backend_memcache_exists, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Memcache, increment, arginfo_phalcon_cache_backend_memcache_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Memcache, decrement, arginfo_phalcon_cache_backend_memcache_decrement, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_Memcache, flush, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_Memcache, flush, arginfo_phalcon_cache_backend_memcache_flush, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cache/backend/memory.zep.c b/ext/phalcon/cache/backend/memory.zep.c index ccda5604cee..75ed55226de 100644 --- a/ext/phalcon/cache/backend/memory.zep.c +++ b/ext/phalcon/cache/backend/memory.zep.c @@ -60,13 +60,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Backend_Memory) { PHP_METHOD(Phalcon_Cache_Backend_Memory, get) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *lifetime_param = NULL, *lastKey = NULL, *cachedContent = NULL, *_1, *_2, *_0$$4; - zval *keyName = NULL; + zval *keyName_param = NULL, *lifetime_param = NULL, lastKey, cachedContent, _1, _2, _0$$4; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName_param, &lifetime_param); - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); if (!lifetime_param) { lifetime = 0; } else { @@ -74,25 +82,25 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, get) { } - if (ZEPHIR_IS_STRING_IDENTICAL(keyName, "")) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + if (ZEPHIR_IS_STRING_IDENTICAL(&keyName, "")) { + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, _0$$4, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - } - ZEPHIR_OBS_VAR(cachedContent); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&cachedContent, _1, lastKey, 0 TSRMLS_CC))) { + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &_0$$4, &keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + } + ZEPHIR_OBS_VAR(&cachedContent); + zephir_read_property(&_1, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&cachedContent, &_1, &lastKey, 0 TSRMLS_CC))) { RETURN_MM_NULL(); } - if (Z_TYPE_P(cachedContent) == IS_NULL) { + if (Z_TYPE_P(&cachedContent) == IS_NULL) { RETURN_MM_NULL(); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_2, "afterretrieve", NULL, 0, cachedContent); + zephir_read_property(&_2, this_ptr, SL("_frontend"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_2, "afterretrieve", NULL, 0, &cachedContent); zephir_check_call_status(); RETURN_MM(); @@ -110,19 +118,36 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, save) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend = NULL, *cachedContent = NULL, *preparedContent = NULL, *isBuffering = NULL, *_0$$4; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer_param = NULL, __$true, __$false, __$null, lastKey, frontend, cachedContent, preparedContent, isBuffering, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&preparedContent); + ZVAL_UNDEF(&isBuffering); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } if (!stopBuffer_param) { stopBuffer = 1; @@ -132,46 +157,46 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, save) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, _0$$4, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &_0$$4, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } - if (!(zephir_is_true(lastKey))) { + if (!(zephir_is_true(&lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/memory.zep", 95); return; } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); if (Z_TYPE_P(content) == IS_NULL) { - ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&cachedContent, &frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(cachedContent, content); + ZEPHIR_CPY_WRT(&cachedContent, content); } - if (!(zephir_is_numeric(cachedContent))) { - ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); + if (!(zephir_is_numeric(&cachedContent))) { + ZEPHIR_CALL_METHOD(&preparedContent, &frontend, "beforestore", NULL, 0, &cachedContent); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedContent, cachedContent); + ZEPHIR_CPY_WRT(&preparedContent, &cachedContent); } - zephir_update_property_array(this_ptr, SL("_data"), lastKey, preparedContent TSRMLS_CC); - ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0); + zephir_update_property_array(this_ptr, SL("_data"), &lastKey, &preparedContent TSRMLS_CC); + ZEPHIR_CALL_METHOD(&isBuffering, &frontend, "isbuffering", NULL, 0); zephir_check_call_status(); if (stopBuffer == 1) { - ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &frontend, "stop", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) { - zend_print_zval(cachedContent, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&isBuffering)) { + zend_print_zval(&cachedContent, 0); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } RETURN_MM_BOOL(1); @@ -185,21 +210,27 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, save) { */ PHP_METHOD(Phalcon_Cache_Backend_Memory, delete) { - zval *keyName, *key = NULL, *data = NULL, *_0; + zval *keyName, keyName_sub, key, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(key); - ZEPHIR_CONCAT_VV(key, _0, keyName); - ZEPHIR_OBS_VAR(data); - zephir_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC); - if (zephir_array_isset(data, key)) { - zephir_array_unset(&data, key, PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_data"), data TSRMLS_CC); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&key); + ZEPHIR_CONCAT_VV(&key, &_0, keyName); + ZEPHIR_OBS_VAR(&data); + zephir_read_property(&data, this_ptr, SL("_data"), PH_NOISY_CC); + if (zephir_array_isset(&data, &key)) { + zephir_array_unset(&data, &key, PH_SEPARATE); + zephir_update_property_zval(this_ptr, SL("_data"), &data); RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); @@ -219,48 +250,59 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, delete) { PHP_METHOD(Phalcon_Cache_Backend_Memory, queryKeys) { zend_bool _3$$4; - HashTable *_1; - HashPosition _0; - zval *prefix_param = NULL, *data = NULL, *keys = NULL, *key = NULL, *idx = NULL, **_2; - zval *prefix = NULL; + zend_string *_2; + zend_ulong _1; + zval *prefix_param = NULL, data, keys, key, idx, *_0; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&idx); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix_param); if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } - ZEPHIR_OBS_VAR(data); - zephir_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC); - if (Z_TYPE_P(data) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&data); + zephir_read_property(&data, this_ptr, SL("_data"), PH_NOISY_CC); + if (Z_TYPE_P(&data) != IS_ARRAY) { array_init(return_value); RETURN_MM(); } - ZEPHIR_INIT_VAR(keys); - zephir_array_keys(keys, data TSRMLS_CC); - zephir_is_iterable(keys, &_1, &_0, 1, 0, "phalcon/cache/backend/memory.zep", 177); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(idx, _1, _0); - ZEPHIR_GET_HVALUE(key, _2); - _3$$4 = !(ZEPHIR_IS_EMPTY(prefix)); + ZEPHIR_INIT_VAR(&keys); + zephir_array_keys(&keys, &data TSRMLS_CC); + zephir_is_iterable(&keys, 1, "phalcon/cache/backend/memory.zep", 177); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&keys), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&idx); + if (_2 != NULL) { + ZVAL_STR_COPY(&idx, _2); + } else { + ZVAL_LONG(&idx, _1); + } + ZEPHIR_INIT_NVAR(&key); + ZVAL_COPY(&key, _0); + _3$$4 = !(ZEPHIR_IS_EMPTY(&prefix)); if (_3$$4) { - _3$$4 = !(zephir_start_with(key, prefix, NULL)); + _3$$4 = !(zephir_start_with(&key, &prefix, NULL)); } if (_3$$4) { - zephir_array_unset(&keys, idx, PH_SEPARATE); + zephir_array_unset(&keys, &idx, PH_SEPARATE); } - } - zend_hash_destroy(_1); - FREE_HASHTABLE(_1); - RETURN_CCTOR(keys); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_INIT_NVAR(&idx); + RETURN_CCTOR(&keys); } @@ -273,13 +315,21 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, queryKeys) { PHP_METHOD(Phalcon_Cache_Backend_Memory, exists) { zend_long lifetime; - zval *keyName = NULL, *lifetime_param = NULL, *lastKey = NULL, *_0$$4, *_1$$5; + zval *keyName = NULL, keyName_sub, *lifetime_param = NULL, __$null, lastKey, _0$$4, _1$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime_param) { lifetime = 0; @@ -289,16 +339,16 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, exists) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, _0$$4, keyName); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &_0$$4, keyName); } - if (zephir_is_true(lastKey)) { - _1$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - if (zephir_array_isset(_1$$5, lastKey)) { + if (zephir_is_true(&lastKey)) { + zephir_read_property(&_1$$5, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_1$$5, &lastKey)) { RETURN_MM_BOOL(1); } } @@ -314,13 +364,23 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, exists) { PHP_METHOD(Phalcon_Cache_Backend_Memory, increment) { zend_long value; - zval *keyName = NULL, *value_param = NULL, *lastKey = NULL, *prefix = NULL, *cachedContent = NULL, *result = NULL, *_0; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, lastKey, prefix, cachedContent, result, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -330,25 +390,25 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, increment) { if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - prefix = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, prefix, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&cachedContent, _0, lastKey, 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&cachedContent, &_0, &lastKey, 1 TSRMLS_CC))) { RETURN_MM_NULL(); } - if (!(zephir_is_true(cachedContent))) { + if (!(zephir_is_true(&cachedContent))) { RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(result); - ZVAL_LONG(result, (zephir_get_numberval(cachedContent) + value)); - zephir_update_property_array(this_ptr, SL("_data"), lastKey, result TSRMLS_CC); - RETURN_CCTOR(result); + ZEPHIR_INIT_VAR(&result); + ZVAL_LONG(&result, (zephir_get_numberval(&cachedContent) + value)); + zephir_update_property_array(this_ptr, SL("_data"), &lastKey, &result TSRMLS_CC); + RETURN_CCTOR(&result); } @@ -360,13 +420,23 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, increment) { PHP_METHOD(Phalcon_Cache_Backend_Memory, decrement) { zend_long value; - zval *keyName = NULL, *value_param = NULL, *lastKey = NULL, *prefix = NULL, *cachedContent = NULL, *result = NULL, *_0; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, lastKey, prefix, cachedContent, result, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -376,25 +446,25 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, decrement) { if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - prefix = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, prefix, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&cachedContent, _0, lastKey, 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&cachedContent, &_0, &lastKey, 1 TSRMLS_CC))) { RETURN_MM_NULL(); } - if (!(zephir_is_true(cachedContent))) { + if (!(zephir_is_true(&cachedContent))) { RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(result); - ZVAL_LONG(result, (zephir_get_numberval(cachedContent) - value)); - zephir_update_property_array(this_ptr, SL("_data"), lastKey, result TSRMLS_CC); - RETURN_CCTOR(result); + ZEPHIR_INIT_VAR(&result); + ZVAL_LONG(&result, (zephir_get_numberval(&cachedContent) - value)); + zephir_update_property_array(this_ptr, SL("_data"), &lastKey, &result TSRMLS_CC); + RETURN_CCTOR(&result); } @@ -403,9 +473,13 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, decrement) { */ PHP_METHOD(Phalcon_Cache_Backend_Memory, flush) { - + zval __$null; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + - zephir_update_property_this(getThis(), SL("_data"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_data"), &__$null); RETURN_BOOL(1); } @@ -415,18 +489,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, flush) { */ PHP_METHOD(Phalcon_Cache_Backend_Memory, serialize) { - zval *_1; - zval *_0; + zval _1; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_frontend"), PH_NOISY_CC); zephir_array_update_string(&_0, SL("frontend"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 68, _0); + ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 61, &_0); zephir_check_call_status(); RETURN_MM(); @@ -438,21 +516,26 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, serialize) { PHP_METHOD(Phalcon_Cache_Backend_Memory, unserialize) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, *unserialized = NULL, *_0; + zval *data, data_sub, unserialized, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&unserialized); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_FUNCTION(&unserialized, "unserialize", NULL, 69, data); + ZEPHIR_CALL_FUNCTION(&unserialized, "unserialize", NULL, 62, data); zephir_check_call_status(); - if (Z_TYPE_P(unserialized) != IS_ARRAY) { + if (Z_TYPE_P(&unserialized) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(zend_exception_get_default(TSRMLS_C), "Unserialized data must be an array", "phalcon/cache/backend/memory.zep", 295); return; } - zephir_array_fetch_string(&_0, unserialized, SL("frontend"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/memory.zep", 298 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_frontend"), _0 TSRMLS_CC); + zephir_array_fetch_string(&_0, &unserialized, SL("frontend"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/memory.zep", 298 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_frontend"), &_0); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/cache/backend/memory.zep.h b/ext/phalcon/cache/backend/memory.zep.h index 14dc510c515..8f8bcc96b8d 100644 --- a/ext/phalcon/cache/backend/memory.zep.h +++ b/ext/phalcon/cache/backend/memory.zep.h @@ -15,38 +15,104 @@ PHP_METHOD(Phalcon_Cache_Backend_Memory, serialize); PHP_METHOD(Phalcon_Cache_Backend_Memory, unserialize); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memory_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memory_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memory_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memory_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memory_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memory_increment, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_increment, 0, 0, IS_LONG, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_increment, 0, 0, IS_LONG, NULL, 1) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memory_decrement, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_decrement, 0, 0, IS_LONG, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_decrement, 0, 0, IS_LONG, NULL, 1) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_serialize, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_memory_serialize, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_memory_unserialize, 0, 0, 1) @@ -61,8 +127,8 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_memory_method_entry) { PHP_ME(Phalcon_Cache_Backend_Memory, exists, arginfo_phalcon_cache_backend_memory_exists, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Memory, increment, arginfo_phalcon_cache_backend_memory_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Memory, decrement, arginfo_phalcon_cache_backend_memory_decrement, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_Memory, flush, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_Memory, serialize, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_Memory, flush, arginfo_phalcon_cache_backend_memory_flush, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_Memory, serialize, arginfo_phalcon_cache_backend_memory_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Memory, unserialize, arginfo_phalcon_cache_backend_memory_unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cache/backend/mongo.zep.c b/ext/phalcon/cache/backend/mongo.zep.c index 42b80a354c6..da62e48d3e3 100644 --- a/ext/phalcon/cache/backend/mongo.zep.c +++ b/ext/phalcon/cache/backend/mongo.zep.c @@ -79,31 +79,37 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *frontend, *options = NULL; + zval *frontend, frontend_sub, *options = NULL, options_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontend_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - if (!(zephir_array_isset_string(options, SS("mongo")))) { - if (!(zephir_array_isset_string(options, SS("server")))) { + if (!(zephir_array_isset_string(options, SL("mongo")))) { + if (!(zephir_array_isset_string(options, SL("server")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The parameter 'server' is required", "phalcon/cache/backend/mongo.zep", 77); return; } } - if (!(zephir_array_isset_string(options, SS("db")))) { + if (!(zephir_array_isset_string(options, SL("db")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The parameter 'db' is required", "phalcon/cache/backend/mongo.zep", 82); return; } - if (!(zephir_array_isset_string(options, SS("collection")))) { + if (!(zephir_array_isset_string(options, SL("collection")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The parameter 'collection' is required", "phalcon/cache/backend/mongo.zep", 86); return; } - ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_mongo_ce, getThis(), "__construct", &_0, 124, frontend, options); + ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_mongo_ce, getThis(), "__construct", &_0, 0, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -117,67 +123,76 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, __construct) { PHP_METHOD(Phalcon_Cache_Backend_Mongo, _getCollection) { zend_bool _0$$6, _1$$3, _2$$3; - zval *options = NULL, *mongo = NULL, *server = NULL, *database = NULL, *collection = NULL, *mongoCollection = NULL, *_3$$3 = NULL; + zval options, mongo, server, database, collection, mongoCollection, _3$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&mongo); + ZVAL_UNDEF(&server); + ZVAL_UNDEF(&database); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&mongoCollection); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(mongoCollection); - zephir_read_property_this(&mongoCollection, this_ptr, SL("_collection"), PH_NOISY_CC); - if (Z_TYPE_P(mongoCollection) != IS_OBJECT) { - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(mongo); - if (zephir_array_isset_string_fetch(&mongo, options, SS("mongo"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(mongo) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&mongoCollection); + zephir_read_property(&mongoCollection, this_ptr, SL("_collection"), PH_NOISY_CC); + if (Z_TYPE_P(&mongoCollection) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&mongo); + if (zephir_array_isset_string_fetch(&mongo, &options, SL("mongo"), 0)) { + if (Z_TYPE_P(&mongo) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The 'mongo' parameter must be a valid Mongo instance", "phalcon/cache/backend/mongo.zep", 111); return; } } else { - ZEPHIR_OBS_VAR(server); - zephir_array_fetch_string(&server, options, SL("server"), PH_NOISY, "phalcon/cache/backend/mongo.zep", 119 TSRMLS_CC); - _0$$6 = !zephir_is_true(server); + ZEPHIR_OBS_VAR(&server); + zephir_array_fetch_string(&server, &options, SL("server"), PH_NOISY, "phalcon/cache/backend/mongo.zep", 119 TSRMLS_CC); + _0$$6 = !zephir_is_true(&server); if (!(_0$$6)) { - _0$$6 = Z_TYPE_P(server) != IS_STRING; + _0$$6 = Z_TYPE_P(&server) != IS_STRING; } if (_0$$6) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The backend requires a valid MongoDB connection string", "phalcon/cache/backend/mongo.zep", 121); return; } - ZEPHIR_INIT_NVAR(mongo); - object_init_ex(mongo, zephir_get_internal_ce(SS("mongoclient") TSRMLS_CC)); - if (zephir_has_constructor(mongo TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, mongo, "__construct", NULL, 0, server); + ZEPHIR_INIT_NVAR(&mongo); + object_init_ex(&mongo, zephir_get_internal_ce(SL("mongoclient"))); + if (zephir_has_constructor(&mongo TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &mongo, "__construct", NULL, 0, &server); zephir_check_call_status(); } } - ZEPHIR_OBS_VAR(database); - zephir_array_fetch_string(&database, options, SL("db"), PH_NOISY, "phalcon/cache/backend/mongo.zep", 130 TSRMLS_CC); - _1$$3 = !zephir_is_true(database); + ZEPHIR_OBS_VAR(&database); + zephir_array_fetch_string(&database, &options, SL("db"), PH_NOISY, "phalcon/cache/backend/mongo.zep", 130 TSRMLS_CC); + _1$$3 = !zephir_is_true(&database); if (!(_1$$3)) { - _1$$3 = Z_TYPE_P(database) != IS_STRING; + _1$$3 = Z_TYPE_P(&database) != IS_STRING; } if (_1$$3) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The backend requires a valid MongoDB db", "phalcon/cache/backend/mongo.zep", 132); return; } - ZEPHIR_OBS_VAR(collection); - zephir_array_fetch_string(&collection, options, SL("collection"), PH_NOISY, "phalcon/cache/backend/mongo.zep", 138 TSRMLS_CC); - _2$$3 = !zephir_is_true(collection); + ZEPHIR_OBS_VAR(&collection); + zephir_array_fetch_string(&collection, &options, SL("collection"), PH_NOISY, "phalcon/cache/backend/mongo.zep", 138 TSRMLS_CC); + _2$$3 = !zephir_is_true(&collection); if (!(_2$$3)) { - _2$$3 = Z_TYPE_P(collection) != IS_STRING; + _2$$3 = Z_TYPE_P(&collection) != IS_STRING; } if (_2$$3) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The backend requires a valid MongoDB collection", "phalcon/cache/backend/mongo.zep", 140); return; } - ZEPHIR_CALL_METHOD(&_3$$3, mongo, "selectdb", NULL, 0, database); + ZEPHIR_CALL_METHOD(&_3$$3, &mongo, "selectdb", NULL, 0, &database); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&mongoCollection, _3$$3, "selectcollection", NULL, 0, collection); + ZEPHIR_CALL_METHOD(&mongoCollection, &_3$$3, "selectcollection", NULL, 0, &collection); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_collection"), mongoCollection TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_collection"), &mongoCollection); } - RETURN_CCTOR(mongoCollection); + RETURN_CCTOR(&mongoCollection); } @@ -186,15 +201,27 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, _getCollection) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, get) { - zval *_1; + zval _1; zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *lifetime_param = NULL, *frontend = NULL, *prefixedKey = NULL, *conditions = NULL, *document = NULL, *cachedContent = NULL, *_0, *_2, *_3 = NULL; - zval *keyName = NULL; + zval *keyName_param = NULL, *lifetime_param = NULL, frontend, prefixedKey, conditions, document, cachedContent, _0, _2, _3; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&document); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName_param, &lifetime_param); - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); if (!lifetime_param) { lifetime = 0; } else { @@ -202,32 +229,32 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, get) { } - ZEPHIR_INIT_VAR(conditions); - array_init(conditions); - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); + ZEPHIR_INIT_VAR(&conditions); + array_init(&conditions); + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, &keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); zephir_array_update_string(&conditions, SL("key"), &prefixedKey, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - zephir_time(_2); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + zephir_time(&_2); zephir_array_update_string(&_1, SL("$gt"), &_2, PH_COPY | PH_SEPARATE); zephir_array_update_string(&conditions, SL("time"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "_getcollection", NULL, 128); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "_getcollection", NULL, 109); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&document, _3, "findone", NULL, 0, conditions); + ZEPHIR_CALL_METHOD(&document, &_3, "findone", NULL, 0, &conditions); zephir_check_call_status(); - if (Z_TYPE_P(document) == IS_ARRAY) { - ZEPHIR_OBS_VAR(cachedContent); - if (zephir_array_isset_string_fetch(&cachedContent, document, SS("data"), 0 TSRMLS_CC)) { - if (zephir_is_numeric(cachedContent)) { - RETURN_CCTOR(cachedContent); + if (Z_TYPE_P(&document) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&cachedContent); + if (zephir_array_isset_string_fetch(&cachedContent, &document, SL("data"), 0)) { + if (zephir_is_numeric(&cachedContent)) { + RETURN_CCTOR(&cachedContent); } - ZEPHIR_RETURN_CALL_METHOD(frontend, "afterretrieve", NULL, 0, cachedContent); + ZEPHIR_RETURN_CALL_METHOD(&frontend, "afterretrieve", NULL, 0, &cachedContent); zephir_check_call_status(); RETURN_MM(); } else { @@ -249,22 +276,50 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, get) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, save) { - zval *_2$$14; + zval _2$$14; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastkey = NULL, *frontend = NULL, *cachedContent = NULL, *tmp = NULL, *ttl = NULL, *collection = NULL, *timestamp = NULL, *conditions = NULL, *document = NULL, *preparedContent = NULL, *isBuffering = NULL, *data = NULL, *success = NULL, *_1, *_0$$4, *_3$$14; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer_param = NULL, __$true, __$false, __$null, lastkey, frontend, cachedContent, tmp, ttl, collection, timestamp, conditions, document, preparedContent, isBuffering, data, success, _1, _0$$4, _3$$14; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastkey); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&tmp); + ZVAL_UNDEF(&ttl); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(×tamp); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&document); + ZVAL_UNDEF(&preparedContent); + ZVAL_UNDEF(&isBuffering); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_3$$14); + ZVAL_UNDEF(&_2$$14); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } if (!stopBuffer_param) { stopBuffer = 1; @@ -273,94 +328,94 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, save) { } - ZEPHIR_INIT_VAR(conditions); - array_init(conditions); - ZEPHIR_INIT_VAR(data); - array_init(data); + ZEPHIR_INIT_VAR(&conditions); + array_init(&conditions); + ZEPHIR_INIT_VAR(&data); + array_init(&data); if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastkey); - zephir_read_property_this(&lastkey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastkey); + zephir_read_property(&lastkey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastkey); - ZEPHIR_CONCAT_VV(lastkey, _0$$4, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastkey TSRMLS_CC); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastkey); + ZEPHIR_CONCAT_VV(&lastkey, &_0$$4, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastkey); } - if (!(zephir_is_true(lastkey))) { + if (!(zephir_is_true(&lastkey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/mongo.zep", 208); return; } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); if (Z_TYPE_P(content) == IS_NULL) { - ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&cachedContent, &frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(cachedContent, content); + ZEPHIR_CPY_WRT(&cachedContent, content); } - if (!(zephir_is_numeric(cachedContent))) { - ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); + if (!(zephir_is_numeric(&cachedContent))) { + ZEPHIR_CALL_METHOD(&preparedContent, &frontend, "beforestore", NULL, 0, &cachedContent); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedContent, cachedContent); + ZEPHIR_CPY_WRT(&preparedContent, &cachedContent); } if (Z_TYPE_P(lifetime) == IS_NULL) { - ZEPHIR_OBS_VAR(tmp); - zephir_read_property_this(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - if (!(zephir_is_true(tmp))) { - ZEPHIR_CALL_METHOD(&ttl, frontend, "getlifetime", NULL, 0); + ZEPHIR_OBS_VAR(&tmp); + zephir_read_property(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + if (!(zephir_is_true(&tmp))) { + ZEPHIR_CALL_METHOD(&ttl, &frontend, "getlifetime", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(ttl, tmp); + ZEPHIR_CPY_WRT(&ttl, &tmp); } } else { - ZEPHIR_CPY_WRT(ttl, lifetime); + ZEPHIR_CPY_WRT(&ttl, lifetime); } - ZEPHIR_CALL_METHOD(&collection, this_ptr, "_getcollection", NULL, 128); + ZEPHIR_CALL_METHOD(&collection, this_ptr, "_getcollection", NULL, 109); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - zephir_time(_1); - ZEPHIR_INIT_VAR(timestamp); - ZVAL_LONG(timestamp, (zephir_get_numberval(_1) + zephir_get_intval(ttl))); + ZEPHIR_INIT_VAR(&_1); + zephir_time(&_1); + ZEPHIR_INIT_VAR(×tamp); + ZVAL_LONG(×tamp, (zephir_get_numberval(&_1) + zephir_get_intval(&ttl))); zephir_array_update_string(&conditions, SL("key"), &lastkey, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&document, collection, "findone", NULL, 0, conditions); + ZEPHIR_CALL_METHOD(&document, &collection, "findone", NULL, 0, &conditions); zephir_check_call_status(); - if (Z_TYPE_P(document) == IS_ARRAY) { + if (Z_TYPE_P(&document) == IS_ARRAY) { zephir_array_update_string(&document, SL("time"), ×tamp, PH_COPY | PH_SEPARATE); zephir_array_update_string(&document, SL("data"), &preparedContent, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_2$$14); - zephir_create_array(_2$$14, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_3$$14); - zephir_array_fetch_string(&_3$$14, document, SL("_id"), PH_NOISY, "phalcon/cache/backend/mongo.zep", 243 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$14); + zephir_create_array(&_2$$14, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_3$$14); + zephir_array_fetch_string(&_3$$14, &document, SL("_id"), PH_NOISY, "phalcon/cache/backend/mongo.zep", 243 TSRMLS_CC); zephir_array_update_string(&_2$$14, SL("_id"), &_3$$14, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&success, collection, "update", NULL, 0, _2$$14, document); + ZEPHIR_CALL_METHOD(&success, &collection, "update", NULL, 0, &_2$$14, &document); zephir_check_call_status(); } else { zephir_array_update_string(&data, SL("key"), &lastkey, PH_COPY | PH_SEPARATE); zephir_array_update_string(&data, SL("time"), ×tamp, PH_COPY | PH_SEPARATE); zephir_array_update_string(&data, SL("data"), &preparedContent, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&success, collection, "insert", NULL, 0, data); + ZEPHIR_CALL_METHOD(&success, &collection, "insert", NULL, 0, &data); zephir_check_call_status(); } - if (!(zephir_is_true(success))) { + if (!(zephir_is_true(&success))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing data in mongodb", "phalcon/cache/backend/mongo.zep", 252); return; } - ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0); + ZEPHIR_CALL_METHOD(&isBuffering, &frontend, "isbuffering", NULL, 0); zephir_check_call_status(); if (stopBuffer == 1) { - ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &frontend, "stop", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) { - zend_print_zval(cachedContent, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&isBuffering)) { + zend_print_zval(&cachedContent, 0); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -372,28 +427,36 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, save) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, delete) { - zval *_1; + zval _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *_0 = NULL, *_2, *_3, *_4 = NULL; + zval *keyName, keyName_sub, _0, _2, _3, _4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "_getcollection", NULL, 128); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "_getcollection", NULL, 109); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 1, 0 TSRMLS_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_VV(_3, _2, keyName); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 1, 0 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_VV(&_3, &_2, keyName); zephir_array_update_string(&_1, SL("key"), &_3, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _0, "remove", NULL, 0, _1); + ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_4, "rand", NULL, 129); + ZEPHIR_CALL_FUNCTION(&_4, "rand", NULL, 110); zephir_check_call_status(); - if (zephir_safe_mod_long_long(zephir_get_intval(_4), 100 TSRMLS_CC) == 0) { + if (zephir_safe_mod_long_long(zephir_get_intval(&_4), 100 TSRMLS_CC) == 0) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "gc", NULL, 0); zephir_check_call_status(); } @@ -413,75 +476,94 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, delete) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, queryKeys) { - HashTable *_7$$4; - HashPosition _6$$4; + zend_string *_8$$4; + zend_ulong _7$$4; zend_object_iterator *_5; - zval *keys, *conditions, *_2, *_4; + zval keys, conditions, _2, _4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, *collection = NULL, *key = NULL, *item = NULL, *items = NULL, *value = NULL, *_3, *_0$$3, **_8$$4; - zval *prefix = NULL, *_1$$3; + zval *prefix_param = NULL, collection, key, item, items, value, _3, _0$$3, *_6$$4; + zval prefix, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&items); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix_param); if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } - ZEPHIR_INIT_VAR(keys); - array_init(keys); - ZEPHIR_INIT_VAR(conditions); - array_init(conditions); - if (!(ZEPHIR_IS_EMPTY(prefix))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, zephir_get_internal_ce(SS("mongoregex") TSRMLS_CC)); - if (zephir_has_constructor(_0$$3 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_CONCAT_SVS(_1$$3, "/^", prefix, "/"); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 0, _1$$3); + ZEPHIR_INIT_VAR(&keys); + array_init(&keys); + ZEPHIR_INIT_VAR(&conditions); + array_init(&conditions); + if (!(ZEPHIR_IS_EMPTY(&prefix))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, zephir_get_internal_ce(SL("mongoregex"))); + if (zephir_has_constructor(&_0$$3 TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_CONCAT_SVS(&_1$$3, "/^", &prefix, "/"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 0, &_1$$3); zephir_check_call_status(); } zephir_array_update_string(&conditions, SL("key"), &_0$$3, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(_2); - zephir_create_array(_2, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3); - zephir_time(_3); + ZEPHIR_INIT_VAR(&_2); + zephir_create_array(&_2, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3); + zephir_time(&_3); zephir_array_update_string(&_2, SL("$gt"), &_3, PH_COPY | PH_SEPARATE); zephir_array_update_string(&conditions, SL("time"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&collection, this_ptr, "_getcollection", NULL, 128); + ZEPHIR_CALL_METHOD(&collection, this_ptr, "_getcollection", NULL, 109); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4); - zephir_create_array(_4, 1, 0 TSRMLS_CC); - add_assoc_long_ex(_4, SS("key"), 1); - ZEPHIR_CALL_METHOD(&items, collection, "find", NULL, 0, conditions, _4); + ZEPHIR_INIT_VAR(&_4); + zephir_create_array(&_4, 1, 0 TSRMLS_CC); + add_assoc_long_ex(&_4, SL("key"), 1); + ZEPHIR_CALL_METHOD(&items, &collection, "find", NULL, 0, &conditions, &_4); zephir_check_call_status(); - _5 = zephir_get_iterator(items TSRMLS_CC); + _5 = zephir_get_iterator(&items TSRMLS_CC); _5->funcs->rewind(_5 TSRMLS_CC); for (;_5->funcs->valid(_5 TSRMLS_CC) == SUCCESS && !EG(exception); _5->funcs->move_forward(_5 TSRMLS_CC)) { { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _5->funcs->get_current_data(_5, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(item, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&item, _5); } - zephir_is_iterable(item, &_7$$4, &_6$$4, 0, 0, "phalcon/cache/backend/mongo.zep", 317); - for ( - ; zend_hash_get_current_data_ex(_7$$4, (void**) &_8$$4, &_6$$4) == SUCCESS - ; zend_hash_move_forward_ex(_7$$4, &_6$$4) - ) { - ZEPHIR_GET_HMKEY(key, _7$$4, _6$$4); - ZEPHIR_GET_HVALUE(value, _8$$4); - if (ZEPHIR_IS_STRING(key, "key")) { - zephir_array_append(&keys, value, PH_SEPARATE, "phalcon/cache/backend/mongo.zep", 314); + zephir_is_iterable(&item, 0, "phalcon/cache/backend/mongo.zep", 317); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&item), _7$$4, _8$$4, _6$$4) + { + ZEPHIR_INIT_NVAR(&key); + if (_8$$4 != NULL) { + ZVAL_STR_COPY(&key, _8$$4); + } else { + ZVAL_LONG(&key, _7$$4); } - } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _6$$4); + if (ZEPHIR_IS_STRING(&key, "key")) { + zephir_array_append(&keys, &value, PH_SEPARATE, "phalcon/cache/backend/mongo.zep", 314); + } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } - _5->funcs->dtor(_5 TSRMLS_CC); - RETURN_CTOR(keys); + zend_iterator_dtor(_5); + RETURN_CTOR(&keys); } @@ -493,15 +575,27 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, queryKeys) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, exists) { - zval *_3$$5, *_4$$5; + zval _3$$5, _4$$5; zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *lifetime_param = NULL, *lastKey = NULL, *_0$$4, *_1$$5 = NULL, *_2$$5 = NULL, *_5$$5; + zval *keyName = NULL, keyName_sub, *lifetime_param = NULL, __$null, lastKey, _0$$4, _1$$5, _2$$5, _5$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime_param) { lifetime = 0; @@ -511,28 +605,28 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, exists) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_VV(lastKey, _0$$4, keyName); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &_0$$4, keyName); } - if (zephir_is_true(lastKey)) { - ZEPHIR_CALL_METHOD(&_1$$5, this_ptr, "_getcollection", NULL, 128); + if (zephir_is_true(&lastKey)) { + ZEPHIR_CALL_METHOD(&_1$$5, this_ptr, "_getcollection", NULL, 109); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3$$5); - zephir_create_array(_3$$5, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$5); + zephir_create_array(&_3$$5, 2, 0 TSRMLS_CC); zephir_array_update_string(&_3$$5, SL("key"), &lastKey, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_4$$5); - zephir_create_array(_4$$5, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_5$$5); - zephir_time(_5$$5); + ZEPHIR_INIT_VAR(&_4$$5); + zephir_create_array(&_4$$5, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$5); + zephir_time(&_5$$5); zephir_array_update_string(&_4$$5, SL("$gt"), &_5$$5, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_3$$5, SL("time"), &_4$$5, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_2$$5, _1$$5, "count", NULL, 0, _3$$5); + ZEPHIR_CALL_METHOD(&_2$$5, &_1$$5, "count", NULL, 0, &_3$$5); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_GT_LONG(_2$$5, 0)); + RETURN_MM_BOOL(ZEPHIR_GT_LONG(&_2$$5, 0)); } RETURN_MM_BOOL(0); @@ -544,23 +638,29 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, exists) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, gc) { - zval *_1, *_2; - zval *_0 = NULL, *_3; + zval _1, _2; + zval _0, _3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "_getcollection", NULL, 128); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "_getcollection", NULL, 109); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - zephir_create_array(_2, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3); - zephir_time(_3); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + zephir_create_array(&_2, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3); + zephir_time(&_3); zephir_array_update_string(&_2, SL("$lt"), &_3, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_1, SL("time"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_RETURN_CALL_METHOD(_0, "remove", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(&_0, "remove", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -573,9 +673,21 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, gc) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment) { - zval *_2; + zval _2; zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *value_param = NULL, *prefixedKey = NULL, *document = NULL, *modifiedTime = NULL, *cachedContent = NULL, *incremented = NULL, *_0, *_1 = NULL, *_3; + zval *keyName, keyName_sub, *value_param = NULL, prefixedKey, document, modifiedTime, cachedContent, incremented, _0, _1, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&document); + ZVAL_UNDEF(&modifiedTime); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&incremented); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &value_param); @@ -587,36 +699,36 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "_getcollection", NULL, 128); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "_getcollection", NULL, 109); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - zephir_create_array(_2, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + zephir_create_array(&_2, 1, 0 TSRMLS_CC); zephir_array_update_string(&_2, SL("key"), &prefixedKey, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&document, _1, "findone", NULL, 0, _2); + ZEPHIR_CALL_METHOD(&document, &_1, "findone", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_OBS_VAR(modifiedTime); - if (!(zephir_array_isset_string_fetch(&modifiedTime, document, SS("time"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&modifiedTime); + if (!(zephir_array_isset_string_fetch(&modifiedTime, &document, SL("time"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The cache is corrupted", "phalcon/cache/backend/mongo.zep", 370); return; } - ZEPHIR_INIT_VAR(_3); - zephir_time(_3); - if (ZEPHIR_LT(_3, modifiedTime)) { - ZEPHIR_OBS_VAR(cachedContent); - if (!(zephir_array_isset_string_fetch(&cachedContent, document, SS("data"), 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_3); + zephir_time(&_3); + if (ZEPHIR_LT(&_3, &modifiedTime)) { + ZEPHIR_OBS_VAR(&cachedContent); + if (!(zephir_array_isset_string_fetch(&cachedContent, &document, SL("data"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The cache is corrupted", "phalcon/cache/backend/mongo.zep", 379); return; } - if (zephir_is_numeric(cachedContent)) { - ZEPHIR_INIT_VAR(incremented); - ZVAL_LONG(incremented, (zephir_get_numberval(cachedContent) + value)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "save", NULL, 0, prefixedKey, incremented); + if (zephir_is_numeric(&cachedContent)) { + ZEPHIR_INIT_VAR(&incremented); + ZVAL_LONG(&incremented, (zephir_get_numberval(&cachedContent) + value)); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "save", NULL, 0, &prefixedKey, &incremented); zephir_check_call_status(); - RETURN_CCTOR(incremented); + RETURN_CCTOR(&incremented); } } RETURN_MM_NULL(); @@ -630,9 +742,21 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, increment) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, decrement) { - zval *_2; + zval _2; zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *value_param = NULL, *prefixedKey = NULL, *document = NULL, *modifiedTime = NULL, *cachedContent = NULL, *decremented = NULL, *_0, *_1 = NULL, *_3; + zval *keyName, keyName_sub, *value_param = NULL, prefixedKey, document, modifiedTime, cachedContent, decremented, _0, _1, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&document); + ZVAL_UNDEF(&modifiedTime); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&decremented); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &value_param); @@ -644,36 +768,36 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, decrement) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "_getcollection", NULL, 128); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "_getcollection", NULL, 109); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - zephir_create_array(_2, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + zephir_create_array(&_2, 1, 0 TSRMLS_CC); zephir_array_update_string(&_2, SL("key"), &prefixedKey, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&document, _1, "findone", NULL, 0, _2); + ZEPHIR_CALL_METHOD(&document, &_1, "findone", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_OBS_VAR(modifiedTime); - if (!(zephir_array_isset_string_fetch(&modifiedTime, document, SS("time"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&modifiedTime); + if (!(zephir_array_isset_string_fetch(&modifiedTime, &document, SL("time"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The cache is corrupted", "phalcon/cache/backend/mongo.zep", 407); return; } - ZEPHIR_INIT_VAR(_3); - zephir_time(_3); - if (ZEPHIR_LT(_3, modifiedTime)) { - ZEPHIR_OBS_VAR(cachedContent); - if (!(zephir_array_isset_string_fetch(&cachedContent, document, SS("data"), 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_3); + zephir_time(&_3); + if (ZEPHIR_LT(&_3, &modifiedTime)) { + ZEPHIR_OBS_VAR(&cachedContent); + if (!(zephir_array_isset_string_fetch(&cachedContent, &document, SL("data"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The cache is corrupted", "phalcon/cache/backend/mongo.zep", 416); return; } - if (zephir_is_numeric(cachedContent)) { - ZEPHIR_INIT_VAR(decremented); - ZVAL_LONG(decremented, (zephir_get_numberval(cachedContent) - value)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "save", NULL, 0, prefixedKey, decremented); + if (zephir_is_numeric(&cachedContent)) { + ZEPHIR_INIT_VAR(&decremented); + ZVAL_LONG(&decremented, (zephir_get_numberval(&cachedContent) - value)); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "save", NULL, 0, &prefixedKey, &decremented); zephir_check_call_status(); - RETURN_CCTOR(decremented); + RETURN_CCTOR(&decremented); } } RETURN_MM_NULL(); @@ -685,14 +809,17 @@ PHP_METHOD(Phalcon_Cache_Backend_Mongo, decrement) { */ PHP_METHOD(Phalcon_Cache_Backend_Mongo, flush) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "_getcollection", NULL, 128); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "_getcollection", NULL, 109); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _0, "remove", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &_0, "remove", NULL, 0); zephir_check_call_status(); RETURN_MM_BOOL(1); diff --git a/ext/phalcon/cache/backend/mongo.zep.h b/ext/phalcon/cache/backend/mongo.zep.h index c571bd53d86..800d598b3f1 100644 --- a/ext/phalcon/cache/backend/mongo.zep.h +++ b/ext/phalcon/cache/backend/mongo.zep.h @@ -21,38 +21,97 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo___construct, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo_increment, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_increment, 0, 1, IS_LONG, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_increment, 0, 1, IS_LONG, NULL, 1) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_mongo_decrement, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_decrement, 0, 1, IS_LONG, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_decrement, 0, 1, IS_LONG, NULL, 1) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_mongo_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backend_mongo_method_entry) { @@ -66,6 +125,6 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_mongo_method_entry) { PHP_ME(Phalcon_Cache_Backend_Mongo, gc, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Mongo, increment, arginfo_phalcon_cache_backend_mongo_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Mongo, decrement, arginfo_phalcon_cache_backend_mongo_decrement, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_Mongo, flush, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_Mongo, flush, arginfo_phalcon_cache_backend_mongo_flush, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cache/backend/redis.zep.c b/ext/phalcon/cache/backend/redis.zep.c index 8b2eeed386c..ef7592acba8 100644 --- a/ext/phalcon/cache/backend/redis.zep.c +++ b/ext/phalcon/cache/backend/redis.zep.c @@ -14,10 +14,10 @@ #include "kernel/main.h" #include "kernel/memory.h" #include "kernel/array.h" -#include "kernel/fcall.h" +#include "kernel/operators.h" #include "kernel/object.h" +#include "kernel/fcall.h" #include "kernel/exception.h" -#include "kernel/operators.h" #include "kernel/concat.h" #include "kernel/string.h" @@ -27,8 +27,6 @@ * * Allows to cache output fragments, PHP data or raw data to a redis backend * - * This adapter uses the special redis key "_PHCR" to store all the keys internally used by the adapter - * * * use Phalcon\Cache\Backend\Redis; * use Phalcon\Cache\Frontend\Data as FrontData; @@ -77,15 +75,32 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Backend_Redis) { */ PHP_METHOD(Phalcon_Cache_Backend_Redis, __construct) { + zend_bool _0, _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_6 = NULL; - zval *frontend, *options = NULL, *_0$$4, *_1$$5, *_2$$6, *_3$$8, *_4$$9, *_5$$10; + zephir_fcall_cache_entry *_11 = NULL; + zval *frontend, frontend_sub, *options = NULL, options_sub, __$false, __$null, _1, _3, _4$$4, _5$$5, _6$$6, _7$$7, _8$$9, _9$$10, _10$$11; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontend_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_10$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { - ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); + options = &options_sub; + ZEPHIR_CPY_WRT(options, &__$null); } else { ZEPHIR_SEPARATE_PARAM(options); } @@ -95,40 +110,55 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, __construct) { ZEPHIR_INIT_NVAR(options); array_init(options); } - if (!(zephir_array_isset_string(options, SS("host")))) { - ZEPHIR_INIT_VAR(_0$$4); - ZVAL_STRING(_0$$4, "127.0.0.1", 1); - zephir_array_update_string(&options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE); - } - if (!(zephir_array_isset_string(options, SS("port")))) { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_LONG(_1$$5, 6379); - zephir_array_update_string(&options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE); + _0 = zephir_array_isset_string(options, SL("redis")); + if (_0) { + zephir_array_fetch_string(&_1, options, SL("redis"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/redis.zep", 77 TSRMLS_CC); + _0 = !(ZEPHIR_IS_EMPTY(&_1)); } - if (!(zephir_array_isset_string(options, SS("index")))) { - ZEPHIR_INIT_VAR(_2$$6); - ZVAL_LONG(_2$$6, 0); - zephir_array_update_string(&options, SL("index"), &_2$$6, PH_COPY | PH_SEPARATE); - } - if (!(zephir_array_isset_string(options, SS("persistent")))) { - zephir_array_update_string(&options, SL("persistent"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); - } - if (!(zephir_array_isset_string(options, SS("statsKey")))) { - ZEPHIR_INIT_VAR(_3$$8); - ZVAL_STRING(_3$$8, "", 1); - zephir_array_update_string(&options, SL("statsKey"), &_3$$8, PH_COPY | PH_SEPARATE); - } - if (!(zephir_array_isset_string(options, SS("auth")))) { - ZEPHIR_INIT_VAR(_4$$9); - ZVAL_STRING(_4$$9, "", 1); - zephir_array_update_string(&options, SL("auth"), &_4$$9, PH_COPY | PH_SEPARATE); - } - if (!(zephir_array_isset_string(options, SS("timeout")))) { - ZEPHIR_INIT_VAR(_5$$10); - ZVAL_LONG(_5$$10, 0); - zephir_array_update_string(&options, SL("timeout"), &_5$$10, PH_COPY | PH_SEPARATE); + _2 = _0; + if (_2) { + ZEPHIR_OBS_VAR(&_3); + zephir_array_fetch_string(&_3, options, SL("redis"), PH_NOISY, "phalcon/cache/backend/redis.zep", 77 TSRMLS_CC); + _2 = Z_TYPE_P(&_3) == IS_OBJECT; } - ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_redis_ce, getThis(), "__construct", &_6, 124, frontend, options); + if (_2) { + zephir_array_fetch_string(&_4$$4, options, SL("redis"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/redis.zep", 78 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_redis"), &_4$$4); + } + if (!(zephir_array_isset_string(options, SL("host")))) { + ZEPHIR_INIT_VAR(&_5$$5); + ZVAL_STRING(&_5$$5, "127.0.0.1"); + zephir_array_update_string(options, SL("host"), &_5$$5, PH_COPY | PH_SEPARATE); + } + if (!(zephir_array_isset_string(options, SL("port")))) { + ZEPHIR_INIT_VAR(&_6$$6); + ZVAL_LONG(&_6$$6, 6379); + zephir_array_update_string(options, SL("port"), &_6$$6, PH_COPY | PH_SEPARATE); + } + if (!(zephir_array_isset_string(options, SL("index")))) { + ZEPHIR_INIT_VAR(&_7$$7); + ZVAL_LONG(&_7$$7, 0); + zephir_array_update_string(options, SL("index"), &_7$$7, PH_COPY | PH_SEPARATE); + } + if (!(zephir_array_isset_string(options, SL("persistent")))) { + zephir_array_update_string(options, SL("persistent"), &__$false, PH_COPY | PH_SEPARATE); + } + if (!(zephir_array_isset_string(options, SL("statsKey")))) { + ZEPHIR_INIT_VAR(&_8$$9); + ZVAL_STRING(&_8$$9, ""); + zephir_array_update_string(options, SL("statsKey"), &_8$$9, PH_COPY | PH_SEPARATE); + } + if (!(zephir_array_isset_string(options, SL("auth")))) { + ZEPHIR_INIT_VAR(&_9$$10); + ZVAL_STRING(&_9$$10, ""); + zephir_array_update_string(options, SL("auth"), &_9$$10, PH_COPY | PH_SEPARATE); + } + if (!(zephir_array_isset_string(options, SL("timeout")))) { + ZEPHIR_INIT_VAR(&_10$$11); + ZVAL_LONG(&_10$$11, 0); + zephir_array_update_string(options, SL("timeout"), &_10$$11, PH_COPY | PH_SEPARATE); + } + ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_redis_ce, getThis(), "__construct", &_11, 0, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -140,85 +170,99 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, __construct) { PHP_METHOD(Phalcon_Cache_Backend_Redis, _connect) { zend_bool _0, _1, _2, _5, _7; - zval *options = NULL, *redis = NULL, *persistent = NULL, *success = NULL, *host = NULL, *port = NULL, *auth = NULL, *index = NULL, *timeout = NULL, *_6, *_3$$6, *_4$$6; + zval options, redis, persistent, success, host, port, auth, index, timeout, _6, _3$$6, _4$$6; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&redis); + ZVAL_UNDEF(&persistent); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&host); + ZVAL_UNDEF(&port); + ZVAL_UNDEF(&auth); + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&timeout); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(redis); - object_init_ex(redis, zephir_get_internal_ce(SS("redis") TSRMLS_CC)); - if (zephir_has_constructor(redis TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, redis, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&redis); + object_init_ex(&redis, zephir_get_internal_ce(SL("redis"))); + if (zephir_has_constructor(&redis TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &redis, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(host); - _0 = !(zephir_array_isset_string_fetch(&host, options, SS("host"), 0 TSRMLS_CC)); + ZEPHIR_OBS_VAR(&host); + _0 = !(zephir_array_isset_string_fetch(&host, &options, SL("host"), 0)); if (!(_0)) { - ZEPHIR_OBS_VAR(port); - _0 = !(zephir_array_isset_string_fetch(&port, options, SS("port"), 0 TSRMLS_CC)); + ZEPHIR_OBS_VAR(&port); + _0 = !(zephir_array_isset_string_fetch(&port, &options, SL("port"), 0)); } _1 = _0; if (!(_1)) { - ZEPHIR_OBS_VAR(persistent); - _1 = !(zephir_array_isset_string_fetch(&persistent, options, SS("persistent"), 0 TSRMLS_CC)); + ZEPHIR_OBS_VAR(&persistent); + _1 = !(zephir_array_isset_string_fetch(&persistent, &options, SL("persistent"), 0)); } _2 = _1; if (!(_2)) { - ZEPHIR_OBS_VAR(timeout); - _2 = !(zephir_array_isset_string_fetch(&timeout, options, SS("timeout"), 0 TSRMLS_CC)); + ZEPHIR_OBS_VAR(&timeout); + _2 = !(zephir_array_isset_string_fetch(&timeout, &options, SL("timeout"), 0)); } if (_2) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 120); + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 122); return; } - if (zephir_is_true(persistent)) { - ZEPHIR_CALL_METHOD(&success, redis, "pconnect", NULL, 0, host, port, timeout); + if (zephir_is_true(&persistent)) { + ZEPHIR_CALL_METHOD(&success, &redis, "pconnect", NULL, 0, &host, &port, &timeout); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&success, redis, "connect", NULL, 0, host, port, timeout); + ZEPHIR_CALL_METHOD(&success, &redis, "connect", NULL, 0, &host, &port, &timeout); zephir_check_call_status(); } - if (!(zephir_is_true(success))) { - ZEPHIR_INIT_VAR(_3$$6); - object_init_ex(_3$$6, phalcon_cache_exception_ce); - ZEPHIR_INIT_VAR(_4$$6); - ZEPHIR_CONCAT_SVSV(_4$$6, "Could not connect to the Redisd server ", host, ":", port); - ZEPHIR_CALL_METHOD(NULL, _3$$6, "__construct", NULL, 9, _4$$6); + if (!(zephir_is_true(&success))) { + ZEPHIR_INIT_VAR(&_3$$6); + object_init_ex(&_3$$6, phalcon_cache_exception_ce); + ZEPHIR_INIT_VAR(&_4$$6); + ZEPHIR_CONCAT_SVSV(&_4$$6, "Could not connect to the Redisd server ", &host, ":", &port); + ZEPHIR_CALL_METHOD(NULL, &_3$$6, "__construct", NULL, 4, &_4$$6); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$6, "phalcon/cache/backend/redis.zep", 130 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$6, "phalcon/cache/backend/redis.zep", 132 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_VAR(auth); - _5 = zephir_array_isset_string_fetch(&auth, options, SS("auth"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&auth); + _5 = zephir_array_isset_string_fetch(&auth, &options, SL("auth"), 0); if (_5) { - zephir_array_fetch_string(&_6, options, SL("auth"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/redis.zep", 133 TSRMLS_CC); - _5 = !(ZEPHIR_IS_EMPTY(_6)); + zephir_array_fetch_string(&_6, &options, SL("auth"), PH_NOISY | PH_READONLY, "phalcon/cache/backend/redis.zep", 135 TSRMLS_CC); + _5 = !(ZEPHIR_IS_EMPTY(&_6)); } if (_5) { - ZEPHIR_CALL_METHOD(&success, redis, "auth", NULL, 0, auth); + ZEPHIR_CALL_METHOD(&success, &redis, "auth", NULL, 0, &auth); zephir_check_call_status(); - if (!(zephir_is_true(success))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed to authenticate with the Redisd server", "phalcon/cache/backend/redis.zep", 137); + if (!(zephir_is_true(&success))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed to authenticate with the Redisd server", "phalcon/cache/backend/redis.zep", 139); return; } } - ZEPHIR_OBS_VAR(index); - _7 = zephir_array_isset_string_fetch(&index, options, SS("index"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&index); + _7 = zephir_array_isset_string_fetch(&index, &options, SL("index"), 0); if (_7) { - _7 = ZEPHIR_GT_LONG(index, 0); + _7 = ZEPHIR_GT_LONG(&index, 0); } if (_7) { - ZEPHIR_CALL_METHOD(&success, redis, "select", NULL, 0, index); + ZEPHIR_CALL_METHOD(&success, &redis, "select", NULL, 0, &index); zephir_check_call_status(); - if (!(zephir_is_true(success))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Redis server selected database failed", "phalcon/cache/backend/redis.zep", 145); + if (!(zephir_is_true(&success))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Redis server selected database failed", "phalcon/cache/backend/redis.zep", 147); return; } } - zephir_update_property_this(getThis(), SL("_redis"), redis TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_redis"), &redis); ZEPHIR_MM_RESTORE(); } @@ -229,13 +273,21 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, _connect) { PHP_METHOD(Phalcon_Cache_Backend_Redis, get) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *lifetime_param = NULL, *redis = NULL, *frontend = NULL, *prefix = NULL, *lastKey = NULL, *cachedContent = NULL; - zval *keyName = NULL; + zval *keyName_param = NULL, *lifetime_param = NULL, redis, frontend, prefix, lastKey, cachedContent; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&redis); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&cachedContent); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName_param, &lifetime_param); - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); if (!lifetime_param) { lifetime = 0; } else { @@ -243,30 +295,30 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, get) { } - ZEPHIR_OBS_VAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - if (Z_TYPE_P(redis) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + if (Z_TYPE_P(&redis) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCR", prefix, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - ZEPHIR_CALL_METHOD(&cachedContent, redis, "get", NULL, 0, lastKey); + ZEPHIR_OBS_NVAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + } + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, &keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + ZEPHIR_CALL_METHOD(&cachedContent, &redis, "get", NULL, 0, &lastKey); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(cachedContent)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&cachedContent)) { RETURN_MM_NULL(); } - if (zephir_is_numeric(cachedContent)) { - RETURN_CCTOR(cachedContent); + if (zephir_is_numeric(&cachedContent)) { + RETURN_CCTOR(&cachedContent); } - ZEPHIR_RETURN_CALL_METHOD(frontend, "afterretrieve", NULL, 0, cachedContent); + ZEPHIR_RETURN_CALL_METHOD(&frontend, "afterretrieve", NULL, 0, &cachedContent); zephir_check_call_status(); RETURN_MM(); @@ -291,19 +343,43 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, save) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *prefixedKey = NULL, *lastKey = NULL, *frontend = NULL, *redis = NULL, *cachedContent = NULL, *preparedContent = NULL, *tmp = NULL, *tt1 = NULL, *success = NULL, *options = NULL, *specialKey = NULL, *isBuffering = NULL, _0$$3, *_1$$4; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer_param = NULL, __$true, __$false, __$null, prefixedKey, lastKey, frontend, redis, cachedContent, preparedContent, tmp, tt1, success, options, specialKey, isBuffering, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&redis); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&preparedContent); + ZVAL_UNDEF(&tmp); + ZVAL_UNDEF(&tt1); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&isBuffering); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } if (!stopBuffer_param) { stopBuffer = 1; @@ -313,94 +389,90 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, save) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_0$$3); - ZVAL_LONG(&_0$$3, 5); - ZEPHIR_INIT_VAR(prefixedKey); - zephir_substr(prefixedKey, lastKey, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_CPY_WRT(&prefixedKey, &lastKey); } else { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, _1$$4, keyName); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SV(lastKey, "_PHCR", prefixedKey); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - } - if (!(zephir_is_true(lastKey))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The cache must be started first", "phalcon/cache/backend/redis.zep", 212); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &_0$$4, keyName); + ZEPHIR_CPY_WRT(&lastKey, &prefixedKey); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + } + if (!(zephir_is_true(&lastKey))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "The cache must be started first", "phalcon/cache/backend/redis.zep", 214); return; } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - if (Z_TYPE_P(redis) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + if (Z_TYPE_P(&redis) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); } if (Z_TYPE_P(content) == IS_NULL) { - ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&cachedContent, &frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(cachedContent, content); + ZEPHIR_CPY_WRT(&cachedContent, content); } - if (!(zephir_is_numeric(cachedContent))) { - ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); + if (!(zephir_is_numeric(&cachedContent))) { + ZEPHIR_CALL_METHOD(&preparedContent, &frontend, "beforestore", NULL, 0, &cachedContent); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedContent, cachedContent); + ZEPHIR_CPY_WRT(&preparedContent, &cachedContent); } if (Z_TYPE_P(lifetime) == IS_NULL) { - ZEPHIR_OBS_VAR(tmp); - zephir_read_property_this(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - if (!(zephir_is_true(tmp))) { - ZEPHIR_CALL_METHOD(&tt1, frontend, "getlifetime", NULL, 0); + ZEPHIR_OBS_VAR(&tmp); + zephir_read_property(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + if (!(zephir_is_true(&tmp))) { + ZEPHIR_CALL_METHOD(&tt1, &frontend, "getlifetime", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(tt1, tmp); + ZEPHIR_CPY_WRT(&tt1, &tmp); } } else { - ZEPHIR_CPY_WRT(tt1, lifetime); + ZEPHIR_CPY_WRT(&tt1, lifetime); } - ZEPHIR_CALL_METHOD(&success, redis, "set", NULL, 0, lastKey, preparedContent); + ZEPHIR_CALL_METHOD(&success, &redis, "set", NULL, 0, &lastKey, &preparedContent); zephir_check_call_status(); - if (!(zephir_is_true(success))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing the data in redis", "phalcon/cache/backend/redis.zep", 256); + if (!(zephir_is_true(&success))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing the data in redis", "phalcon/cache/backend/redis.zep", 258); return; } - if (ZEPHIR_GE_LONG(tt1, 1)) { - ZEPHIR_CALL_METHOD(NULL, redis, "settimeout", NULL, 0, lastKey, tt1); + if (ZEPHIR_GE_LONG(&tt1, 1)) { + ZEPHIR_CALL_METHOD(NULL, &redis, "settimeout", NULL, 0, &lastKey, &tt1); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 267); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 269); return; } - if (!ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_CALL_METHOD(NULL, redis, "sadd", NULL, 0, specialKey, prefixedKey); + if (!ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_CALL_METHOD(NULL, &redis, "sadd", NULL, 0, &specialKey, &prefixedKey); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0); + ZEPHIR_CALL_METHOD(&isBuffering, &frontend, "isbuffering", NULL, 0); zephir_check_call_status(); if (stopBuffer == 1) { - ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &frontend, "stop", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) { - zend_print_zval(cachedContent, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&isBuffering)) { + zend_print_zval(&cachedContent, 0); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -412,41 +484,50 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, save) { PHP_METHOD(Phalcon_Cache_Backend_Redis, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *redis = NULL, *prefix = NULL, *prefixedKey = NULL, *lastKey = NULL, *options = NULL, *specialKey = NULL, *_0 = NULL; + zval *keyName, keyName_sub, redis, prefix, prefixedKey, lastKey, options, specialKey, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&redis); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName); - ZEPHIR_OBS_VAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - if (Z_TYPE_P(redis) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + if (Z_TYPE_P(&redis) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - } - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_VV(prefixedKey, prefix, keyName); - ZEPHIR_INIT_VAR(lastKey); - ZEPHIR_CONCAT_SV(lastKey, "_PHCR", prefixedKey); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 310); + ZEPHIR_OBS_NVAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + } + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_VV(&prefixedKey, &prefix, keyName); + ZEPHIR_CPY_WRT(&lastKey, &prefixedKey); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 312); return; } - if (!ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_CALL_METHOD(NULL, redis, "srem", NULL, 0, specialKey, prefixedKey); + if (!ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_CALL_METHOD(NULL, &redis, "srem", NULL, 0, &specialKey, &prefixedKey); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&_0, redis, "delete", NULL, 0, lastKey); + ZEPHIR_CALL_METHOD(&_0, &redis, "delete", NULL, 0, &lastKey); zephir_check_call_status(); - RETURN_MM_BOOL(zephir_get_boolval(_0)); + RETURN_MM_BOOL(zephir_get_boolval(&_0)); } @@ -463,66 +544,79 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, delete) { PHP_METHOD(Phalcon_Cache_Backend_Redis, queryKeys) { zend_bool _3$$7; - HashTable *_1; - HashPosition _0; + zend_string *_2; + zend_ulong _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, *redis = NULL, *options = NULL, *keys = NULL, *specialKey = NULL, *key = NULL, *idx = NULL, **_2; - zval *prefix = NULL; + zval *prefix_param = NULL, redis, options, keys, specialKey, key, idx, *_0; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&redis); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&idx); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix_param); if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } - ZEPHIR_OBS_VAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - if (Z_TYPE_P(redis) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + if (Z_TYPE_P(&redis) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 347); + ZEPHIR_OBS_NVAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + } + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 349); return; } - if (ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCR')!", "phalcon/cache/backend/redis.zep", 351); + if (ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCR')!", "phalcon/cache/backend/redis.zep", 353); return; } - ZEPHIR_CALL_METHOD(&keys, redis, "smembers", NULL, 0, specialKey); + ZEPHIR_CALL_METHOD(&keys, &redis, "smembers", NULL, 0, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) != IS_ARRAY) { + if (Z_TYPE_P(&keys) != IS_ARRAY) { array_init(return_value); RETURN_MM(); } - zephir_is_iterable(keys, &_1, &_0, 1, 0, "phalcon/cache/backend/redis.zep", 368); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(idx, _1, _0); - ZEPHIR_GET_HVALUE(key, _2); - _3$$7 = !(ZEPHIR_IS_EMPTY(prefix)); + zephir_is_iterable(&keys, 1, "phalcon/cache/backend/redis.zep", 370); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&keys), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&idx); + if (_2 != NULL) { + ZVAL_STR_COPY(&idx, _2); + } else { + ZVAL_LONG(&idx, _1); + } + ZEPHIR_INIT_NVAR(&key); + ZVAL_COPY(&key, _0); + _3$$7 = !(ZEPHIR_IS_EMPTY(&prefix)); if (_3$$7) { - _3$$7 = !(zephir_start_with(key, prefix, NULL)); + _3$$7 = !(zephir_start_with(&key, &prefix, NULL)); } if (_3$$7) { - zephir_array_unset(&keys, idx, PH_SEPARATE); + zephir_array_unset(&keys, &idx, PH_SEPARATE); } - } - zend_hash_destroy(_1); - FREE_HASHTABLE(_1); - RETURN_CCTOR(keys); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_INIT_NVAR(&idx); + RETURN_CCTOR(&keys); } @@ -535,13 +629,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, queryKeys) { PHP_METHOD(Phalcon_Cache_Backend_Redis, exists) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *lifetime_param = NULL, *lastKey = NULL, *redis = NULL, *prefix = NULL, *_0$$5 = NULL; + zval *keyName = NULL, keyName_sub, *lifetime_param = NULL, __$null, lastKey, redis, prefix, _0$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&redis); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_0$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime_param) { lifetime = 0; @@ -551,26 +654,26 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, exists) { if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCR", prefix, keyName); - } - if (zephir_is_true(lastKey)) { - ZEPHIR_OBS_VAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - if (Z_TYPE_P(redis) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + } + if (zephir_is_true(&lastKey)) { + ZEPHIR_OBS_VAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + if (Z_TYPE_P(&redis) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); } - ZEPHIR_CALL_METHOD(&_0$$5, redis, "exists", NULL, 0, lastKey); + ZEPHIR_CALL_METHOD(&_0$$5, &redis, "exists", NULL, 0, &lastKey); zephir_check_call_status(); - RETURN_MM_BOOL(zephir_get_boolval(_0$$5)); + RETURN_MM_BOOL(zephir_get_boolval(&_0$$5)); } RETURN_MM_BOOL(0); @@ -584,13 +687,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, exists) { PHP_METHOD(Phalcon_Cache_Backend_Redis, increment) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *redis = NULL, *prefix = NULL, *lastKey = NULL, *_0; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, redis, prefix, lastKey, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&redis); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -599,27 +711,26 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, increment) { } - ZEPHIR_OBS_VAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - if (Z_TYPE_P(redis) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + if (Z_TYPE_P(&redis) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); } if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCR", prefix, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, value); - ZEPHIR_RETURN_CALL_METHOD(redis, "incrby", NULL, 0, lastKey, _0); + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + } + ZVAL_LONG(&_0, value); + ZEPHIR_RETURN_CALL_METHOD(&redis, "incrby", NULL, 0, &lastKey, &_0); zephir_check_call_status(); RETURN_MM(); @@ -633,13 +744,22 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, increment) { PHP_METHOD(Phalcon_Cache_Backend_Redis, decrement) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *value_param = NULL, *redis = NULL, *prefix = NULL, *lastKey = NULL, *_0; + zval *keyName = NULL, keyName_sub, *value_param = NULL, __$null, redis, prefix, lastKey, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&redis); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &value_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!value_param) { value = 1; @@ -648,27 +768,26 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, decrement) { } - ZEPHIR_OBS_VAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - if (Z_TYPE_P(redis) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + if (Z_TYPE_P(&redis) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); } if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - ZEPHIR_OBS_VAR(prefix); - zephir_read_property_this(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCR", prefix, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); - } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, value); - ZEPHIR_RETURN_CALL_METHOD(redis, "decrby", NULL, 0, lastKey, _0); + ZEPHIR_OBS_VAR(&prefix); + zephir_read_property(&prefix, this_ptr, SL("_prefix"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_VV(&lastKey, &prefix, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); + } + ZVAL_LONG(&_0, value); + ZEPHIR_RETURN_CALL_METHOD(&redis, "decrby", NULL, 0, &lastKey, &_0); zephir_check_call_status(); RETURN_MM(); @@ -679,49 +798,54 @@ PHP_METHOD(Phalcon_Cache_Backend_Redis, decrement) { */ PHP_METHOD(Phalcon_Cache_Backend_Redis, flush) { - HashTable *_1$$6; - HashPosition _0$$6; - zval *options = NULL, *specialKey = NULL, *redis = NULL, *keys = NULL, *key = NULL, *lastKey = NULL, **_2$$6; - zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL; + zval options, specialKey, redis, keys, key, lastKey, *_0$$6; + zephir_fcall_cache_entry *_1 = NULL, *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&redis); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&lastKey); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - if (!(zephir_array_isset_string_fetch(&specialKey, options, SS("statsKey"), 0 TSRMLS_CC))) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 465); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + if (!(zephir_array_isset_string_fetch(&specialKey, &options, SL("statsKey"), 0))) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/redis.zep", 467); return; } - ZEPHIR_OBS_VAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); - if (Z_TYPE_P(redis) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + if (Z_TYPE_P(&redis) != IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_connect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(redis); - zephir_read_property_this(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&redis); + zephir_read_property(&redis, this_ptr, SL("_redis"), PH_NOISY_CC); } - if (ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCR')!", "phalcon/cache/backend/redis.zep", 476); + if (ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCR')!", "phalcon/cache/backend/redis.zep", 478); return; } - ZEPHIR_CALL_METHOD(&keys, redis, "smembers", NULL, 0, specialKey); + ZEPHIR_CALL_METHOD(&keys, &redis, "smembers", NULL, 0, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) == IS_ARRAY) { - zephir_is_iterable(keys, &_1$$6, &_0$$6, 0, 0, "phalcon/cache/backend/redis.zep", 486); - for ( - ; zend_hash_get_current_data_ex(_1$$6, (void**) &_2$$6, &_0$$6) == SUCCESS - ; zend_hash_move_forward_ex(_1$$6, &_0$$6) - ) { - ZEPHIR_GET_HVALUE(key, _2$$6); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SV(lastKey, "_PHCR", key); - ZEPHIR_CALL_METHOD(NULL, redis, "srem", &_3, 0, specialKey, key); + if (Z_TYPE_P(&keys) == IS_ARRAY) { + zephir_is_iterable(&keys, 0, "phalcon/cache/backend/redis.zep", 488); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&keys), _0$$6) + { + ZEPHIR_INIT_NVAR(&key); + ZVAL_COPY(&key, _0$$6); + ZEPHIR_CPY_WRT(&lastKey, &key); + ZEPHIR_CALL_METHOD(NULL, &redis, "srem", &_1, 0, &specialKey, &key); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, redis, "delete", &_4, 0, lastKey); + ZEPHIR_CALL_METHOD(NULL, &redis, "delete", &_2, 0, &lastKey); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&key); } RETURN_MM_BOOL(1); diff --git a/ext/phalcon/cache/backend/redis.zep.h b/ext/phalcon/cache/backend/redis.zep.h index 0dae9b385e8..3101567f5b6 100644 --- a/ext/phalcon/cache/backend/redis.zep.h +++ b/ext/phalcon/cache/backend/redis.zep.h @@ -20,38 +20,97 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_redis___construct, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_redis_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_redis_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_redis_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_redis_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_redis_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_redis_increment, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_increment, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_increment, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_redis_decrement, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_decrement, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_decrement, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_redis_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backend_redis_method_entry) { @@ -64,6 +123,6 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_redis_method_entry) { PHP_ME(Phalcon_Cache_Backend_Redis, exists, arginfo_phalcon_cache_backend_redis_exists, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Redis, increment, arginfo_phalcon_cache_backend_redis_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Redis, decrement, arginfo_phalcon_cache_backend_redis_decrement, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_Redis, flush, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_Redis, flush, arginfo_phalcon_cache_backend_redis_flush, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cache/backend/xcache.zep.c b/ext/phalcon/cache/backend/xcache.zep.c index 6eb084b9ce6..517ddd5357c 100644 --- a/ext/phalcon/cache/backend/xcache.zep.c +++ b/ext/phalcon/cache/backend/xcache.zep.c @@ -70,13 +70,20 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL; - zval *frontend, *options = NULL, *_0$$4; + zval *frontend, frontend_sub, *options = NULL, options_sub, __$null, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontend_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &frontend, &options); if (!options) { - ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); + options = &options_sub; + ZEPHIR_CPY_WRT(options, &__$null); } else { ZEPHIR_SEPARATE_PARAM(options); } @@ -86,12 +93,12 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, __construct) { ZEPHIR_INIT_NVAR(options); array_init(options); } - if (!(zephir_array_isset_string(options, SS("statsKey")))) { - ZEPHIR_INIT_VAR(_0$$4); - ZVAL_STRING(_0$$4, "", 1); - zephir_array_update_string(&options, SL("statsKey"), &_0$$4, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("statsKey")))) { + ZEPHIR_INIT_VAR(&_0$$4); + ZVAL_STRING(&_0$$4, ""); + zephir_array_update_string(options, SL("statsKey"), &_0$$4, PH_COPY | PH_SEPARATE); } - ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_xcache_ce, getThis(), "__construct", &_1, 124, frontend, options); + ZEPHIR_CALL_PARENT(NULL, phalcon_cache_backend_xcache_ce, getThis(), "__construct", &_1, 0, frontend, options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -103,13 +110,20 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, __construct) { PHP_METHOD(Phalcon_Cache_Backend_Xcache, get) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName_param = NULL, *lifetime_param = NULL, *frontend = NULL, *prefixedKey = NULL, *cachedContent = NULL, *_0; - zval *keyName = NULL; + zval *keyName_param = NULL, *lifetime_param = NULL, frontend, prefixedKey, cachedContent, _0; + zval keyName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName_param, &lifetime_param); - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); if (!lifetime_param) { lifetime = 0; } else { @@ -117,21 +131,21 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, get) { } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_SVV(prefixedKey, "_PHCX", _0, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), prefixedKey TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&cachedContent, "xcache_get", NULL, 94, prefixedKey); + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_SVV(&prefixedKey, "_PHCX", &_0, &keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &prefixedKey); + ZEPHIR_CALL_FUNCTION(&cachedContent, "xcache_get", NULL, 83, &prefixedKey); zephir_check_call_status(); - if (!(zephir_is_true(cachedContent))) { + if (!(zephir_is_true(&cachedContent))) { RETURN_MM_NULL(); } - if (zephir_is_numeric(cachedContent)) { - RETURN_CCTOR(cachedContent); + if (zephir_is_numeric(&cachedContent)) { + RETURN_CCTOR(&cachedContent); } else { - ZEPHIR_RETURN_CALL_METHOD(frontend, "afterretrieve", NULL, 0, cachedContent); + ZEPHIR_RETURN_CALL_METHOD(&frontend, "afterretrieve", NULL, 0, &cachedContent); zephir_check_call_status(); RETURN_MM(); } @@ -150,19 +164,43 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, save) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool stopBuffer; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer_param = NULL, *lastKey = NULL, *frontend = NULL, *cachedContent = NULL, *preparedContent = NULL, *tmp = NULL, *tt1 = NULL, *success = NULL, *isBuffering = NULL, *options = NULL, *keys = NULL, *specialKey = NULL, *_0$$4, *_1$$17; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer_param = NULL, __$true, __$false, __$null, lastKey, frontend, cachedContent, preparedContent, tmp, tt1, success, isBuffering, options, keys, specialKey, _0$$4, _1$$17; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&frontend); + ZVAL_UNDEF(&cachedContent); + ZVAL_UNDEF(&preparedContent); + ZVAL_UNDEF(&tmp); + ZVAL_UNDEF(&tt1); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&isBuffering); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$17); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } if (!stopBuffer_param) { stopBuffer = 1; @@ -172,86 +210,86 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, save) { if (Z_TYPE_P(keyName) == IS_NULL) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCX", _0$$4, keyName); - zephir_update_property_this(getThis(), SL("_lastKey"), lastKey TSRMLS_CC); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCX", &_0$$4, keyName); + zephir_update_property_zval(this_ptr, SL("_lastKey"), &lastKey); } - if (!(zephir_is_true(lastKey))) { + if (!(zephir_is_true(&lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/xcache.zep", 123); return; } - ZEPHIR_OBS_VAR(frontend); - zephir_read_property_this(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&frontend); + zephir_read_property(&frontend, this_ptr, SL("_frontend"), PH_NOISY_CC); if (Z_TYPE_P(content) == IS_NULL) { - ZEPHIR_CALL_METHOD(&cachedContent, frontend, "getcontent", NULL, 0); + ZEPHIR_CALL_METHOD(&cachedContent, &frontend, "getcontent", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(cachedContent, content); + ZEPHIR_CPY_WRT(&cachedContent, content); } - if (!(zephir_is_numeric(cachedContent))) { - ZEPHIR_CALL_METHOD(&preparedContent, frontend, "beforestore", NULL, 0, cachedContent); + if (!(zephir_is_numeric(&cachedContent))) { + ZEPHIR_CALL_METHOD(&preparedContent, &frontend, "beforestore", NULL, 0, &cachedContent); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedContent, cachedContent); + ZEPHIR_CPY_WRT(&preparedContent, &cachedContent); } if (Z_TYPE_P(lifetime) == IS_NULL) { - ZEPHIR_OBS_VAR(tmp); - zephir_read_property_this(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); - if (!(zephir_is_true(tmp))) { - ZEPHIR_CALL_METHOD(&tt1, frontend, "getlifetime", NULL, 0); + ZEPHIR_OBS_VAR(&tmp); + zephir_read_property(&tmp, this_ptr, SL("_lastLifetime"), PH_NOISY_CC); + if (!(zephir_is_true(&tmp))) { + ZEPHIR_CALL_METHOD(&tt1, &frontend, "getlifetime", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(tt1, tmp); + ZEPHIR_CPY_WRT(&tt1, &tmp); } } else { - ZEPHIR_CPY_WRT(tt1, lifetime); + ZEPHIR_CPY_WRT(&tt1, lifetime); } - ZEPHIR_CALL_FUNCTION(&success, "xcache_set", NULL, 95, lastKey, preparedContent, tt1); + ZEPHIR_CALL_FUNCTION(&success, "xcache_set", NULL, 84, &lastKey, &preparedContent, &tt1); zephir_check_call_status(); - if (!(zephir_is_true(success))) { + if (!(zephir_is_true(&success))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Failed storing the data in xcache", "phalcon/cache/backend/xcache.zep", 156); return; } - ZEPHIR_CALL_METHOD(&isBuffering, frontend, "isbuffering", NULL, 0); + ZEPHIR_CALL_METHOD(&isBuffering, &frontend, "isbuffering", NULL, 0); zephir_check_call_status(); if (stopBuffer == 1) { - ZEPHIR_CALL_METHOD(NULL, frontend, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &frontend, "stop", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_TRUE_IDENTICAL(isBuffering)) { - zend_print_zval(cachedContent, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&isBuffering)) { + zend_print_zval(&cachedContent, 0); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); - } - if (zephir_is_true(success)) { - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - _1$$17 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&specialKey, _1$$17, SS("statsKey"), 0 TSRMLS_CC))) { + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); + } + if (zephir_is_true(&success)) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + zephir_read_property(&_1$$17, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&specialKey, &_1$$17, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/xcache.zep", 175); return; } - if (!ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_CALL_FUNCTION(&keys, "xcache_get", NULL, 94, specialKey); + if (!ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_CALL_FUNCTION(&keys, "xcache_get", NULL, 83, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(keys); - array_init(keys); + if (Z_TYPE_P(&keys) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&keys); + array_init(&keys); } - zephir_array_update_zval(&keys, lastKey, &tt1, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 95, specialKey, keys); + zephir_array_update_zval(&keys, &lastKey, &tt1, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 84, &specialKey, &keys); zephir_check_call_status(); } } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -264,31 +302,39 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, save) { PHP_METHOD(Phalcon_Cache_Backend_Xcache, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *prefixedKey = NULL, *specialKey = NULL, *keys = NULL, *_0, *_1; + zval *keyName, keyName_sub, prefixedKey, specialKey, keys, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&prefixedKey); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixedKey); - ZEPHIR_CONCAT_SVV(prefixedKey, "_PHCX", _0, keyName); - ZEPHIR_OBS_VAR(specialKey); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&specialKey, _1, SS("statsKey"), 0 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&prefixedKey); + ZEPHIR_CONCAT_SVV(&prefixedKey, "_PHCX", &_0, keyName); + ZEPHIR_OBS_VAR(&specialKey); + zephir_read_property(&_1, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&specialKey, &_1, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/xcache.zep", 209); return; } - if (!ZEPHIR_IS_STRING(specialKey, "")) { - ZEPHIR_CALL_FUNCTION(&keys, "xcache_get", NULL, 94, specialKey); + if (!ZEPHIR_IS_STRING(&specialKey, "")) { + ZEPHIR_CALL_FUNCTION(&keys, "xcache_get", NULL, 83, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(keys); - array_init(keys); + if (Z_TYPE_P(&keys) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&keys); + array_init(&keys); } - zephir_array_unset(&keys, prefixedKey, PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 95, specialKey, keys); + zephir_array_unset(&keys, &prefixedKey, PH_SEPARATE); + ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 84, &specialKey, &keys); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -307,68 +353,87 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, delete) { */ PHP_METHOD(Phalcon_Cache_Backend_Xcache, queryKeys) { - HashTable *_4; - HashPosition _3; + zend_string *_5; + zend_ulong _4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix_param = NULL, *options = NULL, *prefixed = NULL, *specialKey = NULL, *keys = NULL, *retval = NULL, *key = NULL, *realKey = NULL, *_1, *_2 = NULL, **_5, _6$$9 = zval_used_for_init; - zval *prefix = NULL, *_0$$4; + zval *prefix_param = NULL, options, prefixed, specialKey, keys, retval, key, realKey, _1, _2, *_3, _6$$9; + zval prefix, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&prefixed); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&retval); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&realKey); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_6$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prefix_param); if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } - ZEPHIR_INIT_VAR(prefixed); - if (!(!(!prefix) && Z_STRLEN_P(prefix))) { - ZVAL_STRING(prefixed, "_PHCX", 1); + ZEPHIR_INIT_VAR(&prefixed); + if (!(!(Z_TYPE_P(&prefix) == IS_UNDEF) && Z_STRLEN_P(&prefix))) { + ZVAL_STRING(&prefixed, "_PHCX"); } else { - ZEPHIR_INIT_VAR(_0$$4); - ZEPHIR_CONCAT_SV(_0$$4, "_PHCX", prefix); - ZEPHIR_CPY_WRT(prefixed, _0$$4); - } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&specialKey, _1, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_0$$4); + ZEPHIR_CONCAT_SV(&_0$$4, "_PHCX", &prefix); + ZEPHIR_CPY_WRT(&prefixed, &_0$$4); + } + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + zephir_read_property(&_1, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&specialKey, &_1, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/xcache.zep", 247); return; } - if (ZEPHIR_IS_STRING(specialKey, "")) { + if (ZEPHIR_IS_STRING(&specialKey, "")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCX')!", "phalcon/cache/backend/xcache.zep", 251); return; } - ZEPHIR_CALL_FUNCTION(&keys, "xcache_get", NULL, 94, specialKey); + ZEPHIR_CALL_FUNCTION(&keys, "xcache_get", NULL, 83, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) != IS_ARRAY) { + if (Z_TYPE_P(&keys) != IS_ARRAY) { array_init(return_value); RETURN_MM(); } - ZEPHIR_INIT_VAR(retval); - array_init(retval); - ZEPHIR_INIT_VAR(_2); - zephir_is_iterable(keys, &_4, &_3, 0, 0, "phalcon/cache/backend/xcache.zep", 272); - for ( - ; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS - ; zend_hash_move_forward_ex(_4, &_3) - ) { - ZEPHIR_GET_HMKEY(key, _4, _3); - ZEPHIR_GET_HVALUE(_2, _5); - if (zephir_start_with(key, prefixed, NULL)) { - ZEPHIR_SINIT_NVAR(_6$$9); + ZEPHIR_INIT_VAR(&retval); + array_init(&retval); + ZEPHIR_INIT_VAR(&_2); + zephir_is_iterable(&keys, 0, "phalcon/cache/backend/xcache.zep", 272); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&keys), _4, _5, _3) + { + ZEPHIR_INIT_NVAR(&key); + if (_5 != NULL) { + ZVAL_STR_COPY(&key, _5); + } else { + ZVAL_LONG(&key, _4); + } + ZEPHIR_INIT_NVAR(&_2); + ZVAL_COPY(&_2, _3); + if (zephir_start_with(&key, &prefixed, NULL)) { ZVAL_LONG(&_6$$9, 5); - ZEPHIR_INIT_NVAR(realKey); - zephir_substr(realKey, key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_array_append(&retval, realKey, PH_SEPARATE, "phalcon/cache/backend/xcache.zep", 268); + ZEPHIR_INIT_NVAR(&realKey); + zephir_substr(&realKey, &key, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_array_append(&retval, &realKey, PH_SEPARATE, "phalcon/cache/backend/xcache.zep", 268); } - } - RETURN_CCTOR(retval); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_2); + ZEPHIR_INIT_NVAR(&key); + RETURN_CCTOR(&retval); } @@ -381,13 +446,20 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, queryKeys) { PHP_METHOD(Phalcon_Cache_Backend_Xcache, exists) { zend_long lifetime, ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *lifetime_param = NULL, *lastKey = NULL, *_0$$4; + zval *keyName = NULL, keyName_sub, *lifetime_param = NULL, __$null, lastKey, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime_param); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime_param) { lifetime = 0; @@ -397,15 +469,15 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, exists) { if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCX", _0$$4, keyName); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCX", &_0$$4, keyName); } - if (zephir_is_true(lastKey)) { - ZEPHIR_RETURN_CALL_FUNCTION("xcache_isset", NULL, 130, lastKey); + if (zephir_is_true(&lastKey)) { + ZEPHIR_RETURN_CALL_FUNCTION("xcache_isset", NULL, 111, &lastKey); zephir_check_call_status(); RETURN_MM(); } @@ -421,7 +493,15 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, exists) { PHP_METHOD(Phalcon_Cache_Backend_Xcache, increment) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *value_param = NULL, *lastKey = NULL, *newVal = NULL, *origVal = NULL, *_0$$4, _1$$6; + zval *keyName, keyName_sub, *value_param = NULL, lastKey, newVal, origVal, _0$$4, _1$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&newVal); + ZVAL_UNDEF(&origVal); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &value_param); @@ -434,31 +514,30 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, increment) { if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCX", _0$$4, keyName); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCX", &_0$$4, keyName); } - if (!(zephir_is_true(lastKey))) { + if (!(zephir_is_true(&lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/xcache.zep", 313); return; } - if ((zephir_function_exists_ex(SS("xcache_inc") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_SINIT_VAR(_1$$6); + if ((zephir_function_exists_ex(SL("xcache_inc") TSRMLS_CC) == SUCCESS)) { ZVAL_LONG(&_1$$6, value); - ZEPHIR_CALL_FUNCTION(&newVal, "xcache_inc", NULL, 131, lastKey, &_1$$6); + ZEPHIR_CALL_FUNCTION(&newVal, "xcache_inc", NULL, 112, &lastKey, &_1$$6); zephir_check_call_status(); } else { - ZEPHIR_CALL_FUNCTION(&origVal, "xcache_get", NULL, 94, lastKey); + ZEPHIR_CALL_FUNCTION(&origVal, "xcache_get", NULL, 83, &lastKey); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(newVal); - ZVAL_LONG(newVal, (zephir_get_numberval(origVal) - value)); - ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 95, lastKey, newVal); + ZEPHIR_INIT_NVAR(&newVal); + ZVAL_LONG(&newVal, (zephir_get_numberval(&origVal) - value)); + ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 84, &lastKey, &newVal); zephir_check_call_status(); } - RETURN_CCTOR(newVal); + RETURN_CCTOR(&newVal); } @@ -470,7 +549,16 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, increment) { PHP_METHOD(Phalcon_Cache_Backend_Xcache, decrement) { zend_long value, ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *value_param = NULL, *lastKey = NULL, *newVal = NULL, *origVal = NULL, *success = NULL, *_0$$4, _1$$6; + zval *keyName, keyName_sub, *value_param = NULL, lastKey, newVal, origVal, success, _0$$4, _1$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&lastKey); + ZVAL_UNDEF(&newVal); + ZVAL_UNDEF(&origVal); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &value_param); @@ -483,31 +571,30 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, decrement) { if (!(zephir_is_true(keyName))) { - ZEPHIR_OBS_VAR(lastKey); - zephir_read_property_this(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&lastKey); + zephir_read_property(&lastKey, this_ptr, SL("_lastKey"), PH_NOISY_CC); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(lastKey); - ZEPHIR_CONCAT_SVV(lastKey, "_PHCX", _0$$4, keyName); + zephir_read_property(&_0$$4, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&lastKey); + ZEPHIR_CONCAT_SVV(&lastKey, "_PHCX", &_0$$4, keyName); } - if (!(zephir_is_true(lastKey))) { + if (!(zephir_is_true(&lastKey))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cache must be started first", "phalcon/cache/backend/xcache.zep", 343); return; } - if ((zephir_function_exists_ex(SS("xcache_dec") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_SINIT_VAR(_1$$6); + if ((zephir_function_exists_ex(SL("xcache_dec") TSRMLS_CC) == SUCCESS)) { ZVAL_LONG(&_1$$6, value); - ZEPHIR_CALL_FUNCTION(&newVal, "xcache_dec", NULL, 132, lastKey, &_1$$6); + ZEPHIR_CALL_FUNCTION(&newVal, "xcache_dec", NULL, 113, &lastKey, &_1$$6); zephir_check_call_status(); } else { - ZEPHIR_CALL_FUNCTION(&origVal, "xcache_get", NULL, 94, lastKey); + ZEPHIR_CALL_FUNCTION(&origVal, "xcache_get", NULL, 83, &lastKey); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(newVal); - ZVAL_LONG(newVal, (zephir_get_numberval(origVal) - value)); - ZEPHIR_CALL_FUNCTION(&success, "xcache_set", NULL, 95, lastKey, newVal); + ZEPHIR_INIT_NVAR(&newVal); + ZVAL_LONG(&newVal, (zephir_get_numberval(&origVal) - value)); + ZEPHIR_CALL_FUNCTION(&success, "xcache_set", NULL, 84, &lastKey, &newVal); zephir_check_call_status(); } - RETURN_CCTOR(newVal); + RETURN_CCTOR(&newVal); } @@ -516,44 +603,56 @@ PHP_METHOD(Phalcon_Cache_Backend_Xcache, decrement) { */ PHP_METHOD(Phalcon_Cache_Backend_Xcache, flush) { - HashTable *_3$$5; - HashPosition _2$$5; - zval *options = NULL, *specialKey = NULL, *keys = NULL, *key = NULL, *_0, *_1$$5 = NULL, **_4$$5; + zend_string *_4$$5; + zend_ulong _3$$5; + zval options, specialKey, keys, key, _0, _1$$5, *_2$$5; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&specialKey); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(specialKey); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&specialKey, _0, SS("statsKey"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&specialKey); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&specialKey, &_0, SL("statsKey"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Unexpected inconsistency in options", "phalcon/cache/backend/xcache.zep", 367); return; } - if (ZEPHIR_IS_STRING(specialKey, "")) { + if (ZEPHIR_IS_STRING(&specialKey, "")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Cached keys need to be enabled to use this function (options['statsKey'] == '_PHCM')!", "phalcon/cache/backend/xcache.zep", 371); return; } - ZEPHIR_CALL_FUNCTION(&keys, "xcache_get", NULL, 94, specialKey); + ZEPHIR_CALL_FUNCTION(&keys, "xcache_get", NULL, 83, &specialKey); zephir_check_call_status(); - if (Z_TYPE_P(keys) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_1$$5); - zephir_is_iterable(keys, &_3$$5, &_2$$5, 1, 0, "phalcon/cache/backend/xcache.zep", 381); - for ( - ; zend_hash_get_current_data_ex(_3$$5, (void**) &_4$$5, &_2$$5) == SUCCESS - ; zend_hash_move_forward_ex(_3$$5, &_2$$5) - ) { - ZEPHIR_GET_HMKEY(key, _3$$5, _2$$5); - ZEPHIR_GET_HVALUE(_1$$5, _4$$5); - zephir_array_unset(&keys, key, PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(NULL, "xcache_unset", &_5, 133, key); + if (Z_TYPE_P(&keys) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_1$$5); + zephir_is_iterable(&keys, 1, "phalcon/cache/backend/xcache.zep", 381); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&keys), _3$$5, _4$$5, _2$$5) + { + ZEPHIR_INIT_NVAR(&key); + if (_4$$5 != NULL) { + ZVAL_STR_COPY(&key, _4$$5); + } else { + ZVAL_LONG(&key, _3$$5); + } + ZEPHIR_INIT_NVAR(&_1$$5); + ZVAL_COPY(&_1$$5, _2$$5); + zephir_array_unset(&keys, &key, PH_SEPARATE); + ZEPHIR_CALL_FUNCTION(NULL, "xcache_unset", &_5, 114, &key); zephir_check_call_status(); - } - zend_hash_destroy(_3$$5); - FREE_HASHTABLE(_3$$5); - ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 95, specialKey, keys); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_1$$5); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 84, &specialKey, &keys); zephir_check_call_status(); } RETURN_MM_BOOL(1); diff --git a/ext/phalcon/cache/backend/xcache.zep.h b/ext/phalcon/cache/backend/xcache.zep.h index 166153c84f0..ac29bf21e9d 100644 --- a/ext/phalcon/cache/backend/xcache.zep.h +++ b/ext/phalcon/cache/backend/xcache.zep.h @@ -19,38 +19,93 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_xcache___construct, 0, 0, 1 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_xcache_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_xcache_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_xcache_delete, 0, 0, 1) ZEND_ARG_INFO(0, keyName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_xcache_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_xcache_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_xcache_increment, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_increment, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_increment, 0, 1, IS_LONG, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backend_xcache_decrement, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_decrement, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_decrement, 0, 1, IS_LONG, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) +#else ZEND_ARG_INFO(0, value) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backend_xcache_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backend_xcache_method_entry) { @@ -62,6 +117,6 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backend_xcache_method_entry) { PHP_ME(Phalcon_Cache_Backend_Xcache, exists, arginfo_phalcon_cache_backend_xcache_exists, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Xcache, increment, arginfo_phalcon_cache_backend_xcache_increment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Backend_Xcache, decrement, arginfo_phalcon_cache_backend_xcache_decrement, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Backend_Xcache, flush, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Backend_Xcache, flush, arginfo_phalcon_cache_backend_xcache_flush, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cache/backendinterface.zep.h b/ext/phalcon/cache/backendinterface.zep.h index 15a85ea3439..86f07a5a226 100644 --- a/ext/phalcon/cache/backendinterface.zep.h +++ b/ext/phalcon/cache/backendinterface.zep.h @@ -9,7 +9,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backendinterface_start, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backendinterface_stop, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_isfresh, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_isfresh, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_isstarted, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_isstarted, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backendinterface_setlastkey, 0, 0, 1) @@ -17,28 +35,64 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backendinterface_setlastkey, 0, 0, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backendinterface_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backendinterface_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, content) ZEND_ARG_INFO(0, lifetime) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, stopBuffer, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, stopBuffer) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backendinterface_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, keyName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backendinterface_querykeys, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_querykeys, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_querykeys, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_backendinterface_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_backendinterface_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lifetime, IS_LONG, 1) +#else ZEND_ARG_INFO(0, lifetime) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_backendinterface_method_entry) { @@ -46,8 +100,8 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_backendinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, stop, arginfo_phalcon_cache_backendinterface_stop) PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, getFrontend, NULL) PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, getOptions, NULL) - PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, isFresh, NULL) - PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, isStarted, NULL) + PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, isFresh, arginfo_phalcon_cache_backendinterface_isfresh) + PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, isStarted, arginfo_phalcon_cache_backendinterface_isstarted) PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, setLastKey, arginfo_phalcon_cache_backendinterface_setlastkey) PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, getLastKey, NULL) PHP_ABSTRACT_ME(Phalcon_Cache_BackendInterface, get, arginfo_phalcon_cache_backendinterface_get) diff --git a/ext/phalcon/cache/frontend/base64.zep.c b/ext/phalcon/cache/frontend/base64.zep.c index 4d9d3c3ee84..70ececf54f1 100644 --- a/ext/phalcon/cache/frontend/base64.zep.c +++ b/ext/phalcon/cache/frontend/base64.zep.c @@ -81,16 +81,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Frontend_Base64) { */ PHP_METHOD(Phalcon_Cache_Frontend_Base64, __construct) { - zval *frontendOptions = NULL; + zval *frontendOptions = NULL, frontendOptions_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontendOptions_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &frontendOptions); if (!frontendOptions) { - frontendOptions = ZEPHIR_GLOBAL(global_null); + frontendOptions = &frontendOptions_sub; + frontendOptions = &__$null; } - zephir_update_property_this(getThis(), SL("_frontendOptions"), frontendOptions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_frontendOptions"), frontendOptions); } @@ -99,13 +104,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Base64, __construct) { */ PHP_METHOD(Phalcon_Cache_Frontend_Base64, getLifetime) { - zval *options = NULL, *lifetime = NULL; + zval options, lifetime; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&lifetime); - options = zephir_fetch_nproperty_this(this_ptr, SL("_frontendOptions"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 1 TSRMLS_CC)) { - RETURN_CTORW(lifetime); + zephir_read_property(&options, this_ptr, SL("_frontendOptions"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&lifetime, &options, SL("lifetime"), 1)) { + RETURN_CTORW(&lifetime); } } RETURN_LONG(1); @@ -117,7 +126,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Base64, getLifetime) { */ PHP_METHOD(Phalcon_Cache_Frontend_Base64, isBuffering) { - + zval *this_ptr = getThis(); + RETURN_BOOL(0); @@ -128,7 +138,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Base64, isBuffering) { */ PHP_METHOD(Phalcon_Cache_Frontend_Base64, start) { - + zval *this_ptr = getThis(); + } @@ -140,7 +151,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Base64, start) { */ PHP_METHOD(Phalcon_Cache_Frontend_Base64, getContent) { - + zval *this_ptr = getThis(); + RETURN_NULL(); @@ -151,7 +163,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Base64, getContent) { */ PHP_METHOD(Phalcon_Cache_Frontend_Base64, stop) { - + zval *this_ptr = getThis(); + } @@ -162,14 +175,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Base64, stop) { PHP_METHOD(Phalcon_Cache_Frontend_Base64, beforeStore) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 134, data); + ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 115, data); zephir_check_call_status(); RETURN_MM(); @@ -181,14 +197,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Base64, beforeStore) { PHP_METHOD(Phalcon_Cache_Frontend_Base64, afterRetrieve) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_RETURN_CALL_FUNCTION("base64_decode", NULL, 135, data); + ZEPHIR_RETURN_CALL_FUNCTION("base64_decode", NULL, 116, data); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/cache/frontend/base64.zep.h b/ext/phalcon/cache/frontend/base64.zep.h index a43d2300c34..8b58adba2f6 100644 --- a/ext/phalcon/cache/frontend/base64.zep.h +++ b/ext/phalcon/cache/frontend/base64.zep.h @@ -16,7 +16,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_base64___construct, 0, 0, ZEND_ARG_INFO(0, frontendOptions) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_base64_beforestore, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_base64_getlifetime, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_base64_getlifetime, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_base64_isbuffering, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_base64_isbuffering, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_base64_beforestore, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_base64_beforestore, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -26,8 +44,8 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_frontend_base64_method_entry) { PHP_ME(Phalcon_Cache_Frontend_Base64, __construct, arginfo_phalcon_cache_frontend_base64___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Cache_Frontend_Base64, getLifetime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Frontend_Base64, isBuffering, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Base64, getLifetime, arginfo_phalcon_cache_frontend_base64_getlifetime, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Base64, isBuffering, arginfo_phalcon_cache_frontend_base64_isbuffering, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Base64, start, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Base64, getContent, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Base64, stop, NULL, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/cache/frontend/data.zep.c b/ext/phalcon/cache/frontend/data.zep.c index c5f299305f6..b66dafc4171 100644 --- a/ext/phalcon/cache/frontend/data.zep.c +++ b/ext/phalcon/cache/frontend/data.zep.c @@ -87,16 +87,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Frontend_Data) { */ PHP_METHOD(Phalcon_Cache_Frontend_Data, __construct) { - zval *frontendOptions = NULL; + zval *frontendOptions = NULL, frontendOptions_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontendOptions_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &frontendOptions); if (!frontendOptions) { - frontendOptions = ZEPHIR_GLOBAL(global_null); + frontendOptions = &frontendOptions_sub; + frontendOptions = &__$null; } - zephir_update_property_this(getThis(), SL("_frontendOptions"), frontendOptions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_frontendOptions"), frontendOptions); } @@ -105,13 +110,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Data, __construct) { */ PHP_METHOD(Phalcon_Cache_Frontend_Data, getLifetime) { - zval *options = NULL, *lifetime = NULL; + zval options, lifetime; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&lifetime); - options = zephir_fetch_nproperty_this(this_ptr, SL("_frontendOptions"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 1 TSRMLS_CC)) { - RETURN_CTORW(lifetime); + zephir_read_property(&options, this_ptr, SL("_frontendOptions"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&lifetime, &options, SL("lifetime"), 1)) { + RETURN_CTORW(&lifetime); } } RETURN_LONG(1); @@ -123,7 +132,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Data, getLifetime) { */ PHP_METHOD(Phalcon_Cache_Frontend_Data, isBuffering) { - + zval *this_ptr = getThis(); + RETURN_BOOL(0); @@ -134,7 +144,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Data, isBuffering) { */ PHP_METHOD(Phalcon_Cache_Frontend_Data, start) { - + zval *this_ptr = getThis(); + } @@ -146,7 +157,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Data, start) { */ PHP_METHOD(Phalcon_Cache_Frontend_Data, getContent) { - + zval *this_ptr = getThis(); + RETURN_NULL(); @@ -157,7 +169,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Data, getContent) { */ PHP_METHOD(Phalcon_Cache_Frontend_Data, stop) { - + zval *this_ptr = getThis(); + } @@ -168,14 +181,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Data, stop) { PHP_METHOD(Phalcon_Cache_Frontend_Data, beforeStore) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 68, data); + ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 61, data); zephir_check_call_status(); RETURN_MM(); @@ -187,7 +203,10 @@ PHP_METHOD(Phalcon_Cache_Frontend_Data, beforeStore) { PHP_METHOD(Phalcon_Cache_Frontend_Data, afterRetrieve) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); @@ -202,7 +221,7 @@ PHP_METHOD(Phalcon_Cache_Frontend_Data, afterRetrieve) { RETVAL_ZVAL(data, 1, 0); RETURN_MM(); } - ZEPHIR_RETURN_CALL_FUNCTION("unserialize", NULL, 69, data); + ZEPHIR_RETURN_CALL_FUNCTION("unserialize", NULL, 62, data); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/cache/frontend/data.zep.h b/ext/phalcon/cache/frontend/data.zep.h index a04ae2e3a49..bbb7e5caeb4 100644 --- a/ext/phalcon/cache/frontend/data.zep.h +++ b/ext/phalcon/cache/frontend/data.zep.h @@ -16,6 +16,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_data___construct, 0, 0, 0) ZEND_ARG_INFO(0, frontendOptions) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_data_getlifetime, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_data_getlifetime, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_data_isbuffering, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_data_isbuffering, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_data_beforestore, 0, 0, 1) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -26,8 +40,8 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_frontend_data_method_entry) { PHP_ME(Phalcon_Cache_Frontend_Data, __construct, arginfo_phalcon_cache_frontend_data___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Cache_Frontend_Data, getLifetime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Frontend_Data, isBuffering, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Data, getLifetime, arginfo_phalcon_cache_frontend_data_getlifetime, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Data, isBuffering, arginfo_phalcon_cache_frontend_data_isbuffering, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Data, start, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Data, getContent, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Data, stop, NULL, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/cache/frontend/factory.zep.c b/ext/phalcon/cache/frontend/factory.zep.c index e172902fd91..8e9a4a9402c 100644 --- a/ext/phalcon/cache/frontend/factory.zep.c +++ b/ext/phalcon/cache/frontend/factory.zep.c @@ -49,17 +49,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Frontend_Factory) { PHP_METHOD(Phalcon_Cache_Frontend_Factory, load) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *_0; + zval *config, config_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Phalcon\\Cache\\Frontend", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, _0, config); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Phalcon\\Cache\\Frontend"); + ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, &_0, config); zephir_check_call_status(); RETURN_MM(); @@ -70,13 +73,23 @@ PHP_METHOD(Phalcon_Cache_Frontend_Factory, loadClass) { zend_class_entry *_4$$6, *_6$$7; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *namespace_param = NULL, *config = NULL, *adapter = NULL, *className = NULL, *_1$$3 = NULL, *_2$$5, *_3$$6 = NULL, *_5$$7 = NULL; - zval *namespace = NULL; + zval *namespace_param = NULL, *config = NULL, config_sub, adapter, className, _1$$3, _2$$5, _3$$6, _5$$7; + zval namespace; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespace); + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_5$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &namespace_param, &config); - zephir_get_strval(namespace, namespace_param); + zephir_get_strval(&namespace, namespace_param); ZEPHIR_SEPARATE_PARAM(config); @@ -87,22 +100,22 @@ PHP_METHOD(Phalcon_Cache_Frontend_Factory, loadClass) { if (_0) { ZEPHIR_CALL_METHOD(&_1$$3, config, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(config, _1$$3); + ZEPHIR_CPY_WRT(config, &_1$$3); } if (Z_TYPE_P(config) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "Config must be array or Phalcon\\Config object", "phalcon/cache/frontend/factory.zep", 59); return; } - ZEPHIR_OBS_VAR(adapter); - if (zephir_array_isset_string_fetch(&adapter, config, SS("adapter"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&config, SS("adapter"), PH_SEPARATE); - ZEPHIR_INIT_VAR(_2$$5); - zephir_camelize(_2$$5, adapter, NULL ); - ZEPHIR_INIT_VAR(className); - ZEPHIR_CONCAT_VSV(className, namespace, "\\", _2$$5); - if (ZEPHIR_IS_STRING(className, "Phalcon\\Cache\\Frontend\\None")) { - zephir_fetch_safe_class(_3$$6, className); - _4$$6 = zend_fetch_class(Z_STRVAL_P(_3$$6), Z_STRLEN_P(_3$$6), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + ZEPHIR_OBS_VAR(&adapter); + if (zephir_array_isset_string_fetch(&adapter, config, SL("adapter"), 0)) { + zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE); + ZEPHIR_INIT_VAR(&_2$$5); + zephir_camelize(&_2$$5, &adapter, NULL ); + ZEPHIR_INIT_VAR(&className); + ZEPHIR_CONCAT_VSV(&className, &namespace, "\\", &_2$$5); + if (ZEPHIR_IS_STRING(&className, "Phalcon\\Cache\\Frontend\\None")) { + zephir_fetch_safe_class(&_3$$6, &className); + _4$$6 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_3$$6), Z_STRLEN_P(&_3$$6), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _4$$6); if (zephir_has_constructor(return_value TSRMLS_CC)) { ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0); @@ -110,8 +123,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Factory, loadClass) { } RETURN_MM(); } else { - zephir_fetch_safe_class(_5$$7, className); - _6$$7 = zend_fetch_class(Z_STRVAL_P(_5$$7), Z_STRLEN_P(_5$$7), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + zephir_fetch_safe_class(&_5$$7, &className); + _6$$7 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_5$$7), Z_STRLEN_P(&_5$$7), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _6$$7); if (zephir_has_constructor(return_value TSRMLS_CC)) { ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, config); diff --git a/ext/phalcon/cache/frontend/factory.zep.h b/ext/phalcon/cache/frontend/factory.zep.h index 8802613b8c5..b5a6debb8aa 100644 --- a/ext/phalcon/cache/frontend/factory.zep.h +++ b/ext/phalcon/cache/frontend/factory.zep.h @@ -6,12 +6,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Frontend_Factory); PHP_METHOD(Phalcon_Cache_Frontend_Factory, load); PHP_METHOD(Phalcon_Cache_Frontend_Factory, loadClass); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_factory_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_frontend_factory_load, 0, 1, Phalcon\\Cache\\FrontendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_factory_load, 0, 1, IS_OBJECT, "Phalcon\\Cache\\FrontendInterface", 0) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_factory_loadclass, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespace) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/cache/frontend/igbinary.zep.c b/ext/phalcon/cache/frontend/igbinary.zep.c index 2a898870e4c..7aadb6c6137 100644 --- a/ext/phalcon/cache/frontend/igbinary.zep.c +++ b/ext/phalcon/cache/frontend/igbinary.zep.c @@ -82,16 +82,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Frontend_Igbinary) { */ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, __construct) { - zval *frontendOptions = NULL; + zval *frontendOptions = NULL, frontendOptions_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontendOptions_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &frontendOptions); if (!frontendOptions) { - frontendOptions = ZEPHIR_GLOBAL(global_null); + frontendOptions = &frontendOptions_sub; + frontendOptions = &__$null; } - zephir_update_property_this(getThis(), SL("_frontendOptions"), frontendOptions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_frontendOptions"), frontendOptions); } @@ -100,13 +105,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, __construct) { */ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, getLifetime) { - zval *options = NULL, *lifetime = NULL; + zval options, lifetime; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&lifetime); - options = zephir_fetch_nproperty_this(this_ptr, SL("_frontendOptions"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 1 TSRMLS_CC)) { - RETURN_CTORW(lifetime); + zephir_read_property(&options, this_ptr, SL("_frontendOptions"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&lifetime, &options, SL("lifetime"), 1)) { + RETURN_CTORW(&lifetime); } } RETURN_LONG(1); @@ -118,7 +127,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, getLifetime) { */ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, isBuffering) { - + zval *this_ptr = getThis(); + RETURN_BOOL(0); @@ -129,7 +139,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, isBuffering) { */ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, start) { - + zval *this_ptr = getThis(); + } @@ -141,7 +152,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, start) { */ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, getContent) { - + zval *this_ptr = getThis(); + RETURN_NULL(); @@ -152,7 +164,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, getContent) { */ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, stop) { - + zval *this_ptr = getThis(); + } @@ -163,14 +176,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, stop) { PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, beforeStore) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_RETURN_CALL_FUNCTION("igbinary_serialize", NULL, 136, data); + ZEPHIR_RETURN_CALL_FUNCTION("igbinary_serialize", NULL, 117, data); zephir_check_call_status(); RETURN_MM(); @@ -182,7 +198,10 @@ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, beforeStore) { PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, afterRetrieve) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); @@ -193,7 +212,7 @@ PHP_METHOD(Phalcon_Cache_Frontend_Igbinary, afterRetrieve) { RETVAL_ZVAL(data, 1, 0); RETURN_MM(); } - ZEPHIR_RETURN_CALL_FUNCTION("igbinary_unserialize", NULL, 137, data); + ZEPHIR_RETURN_CALL_FUNCTION("igbinary_unserialize", NULL, 118, data); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/cache/frontend/igbinary.zep.h b/ext/phalcon/cache/frontend/igbinary.zep.h index 4921131e49a..c5f2cea74e1 100644 --- a/ext/phalcon/cache/frontend/igbinary.zep.h +++ b/ext/phalcon/cache/frontend/igbinary.zep.h @@ -16,7 +16,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_igbinary___construct, 0, 0 ZEND_ARG_INFO(0, frontendOptions) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_igbinary_beforestore, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_igbinary_getlifetime, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_igbinary_getlifetime, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_igbinary_isbuffering, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_igbinary_isbuffering, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_igbinary_beforestore, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_igbinary_beforestore, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -26,8 +44,8 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_frontend_igbinary_method_entry) { PHP_ME(Phalcon_Cache_Frontend_Igbinary, __construct, arginfo_phalcon_cache_frontend_igbinary___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Cache_Frontend_Igbinary, getLifetime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Frontend_Igbinary, isBuffering, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Igbinary, getLifetime, arginfo_phalcon_cache_frontend_igbinary_getlifetime, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Igbinary, isBuffering, arginfo_phalcon_cache_frontend_igbinary_isbuffering, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Igbinary, start, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Igbinary, getContent, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Igbinary, stop, NULL, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/cache/frontend/json.zep.c b/ext/phalcon/cache/frontend/json.zep.c index 3067e39aead..a06cbc1a190 100644 --- a/ext/phalcon/cache/frontend/json.zep.c +++ b/ext/phalcon/cache/frontend/json.zep.c @@ -73,16 +73,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Frontend_Json) { */ PHP_METHOD(Phalcon_Cache_Frontend_Json, __construct) { - zval *frontendOptions = NULL; + zval *frontendOptions = NULL, frontendOptions_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontendOptions_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &frontendOptions); if (!frontendOptions) { - frontendOptions = ZEPHIR_GLOBAL(global_null); + frontendOptions = &frontendOptions_sub; + frontendOptions = &__$null; } - zephir_update_property_this(getThis(), SL("_frontendOptions"), frontendOptions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_frontendOptions"), frontendOptions); } @@ -91,13 +96,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Json, __construct) { */ PHP_METHOD(Phalcon_Cache_Frontend_Json, getLifetime) { - zval *options = NULL, *lifetime = NULL; + zval options, lifetime; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&lifetime); - options = zephir_fetch_nproperty_this(this_ptr, SL("_frontendOptions"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 1 TSRMLS_CC)) { - RETURN_CTORW(lifetime); + zephir_read_property(&options, this_ptr, SL("_frontendOptions"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&lifetime, &options, SL("lifetime"), 1)) { + RETURN_CTORW(&lifetime); } } RETURN_LONG(1); @@ -109,7 +118,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Json, getLifetime) { */ PHP_METHOD(Phalcon_Cache_Frontend_Json, isBuffering) { - + zval *this_ptr = getThis(); + RETURN_BOOL(0); @@ -120,7 +130,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Json, isBuffering) { */ PHP_METHOD(Phalcon_Cache_Frontend_Json, start) { - + zval *this_ptr = getThis(); + } @@ -132,7 +143,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Json, start) { */ PHP_METHOD(Phalcon_Cache_Frontend_Json, getContent) { - + zval *this_ptr = getThis(); + RETURN_NULL(); @@ -143,7 +155,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Json, getContent) { */ PHP_METHOD(Phalcon_Cache_Frontend_Json, stop) { - + zval *this_ptr = getThis(); + } @@ -153,13 +166,16 @@ PHP_METHOD(Phalcon_Cache_Frontend_Json, stop) { */ PHP_METHOD(Phalcon_Cache_Frontend_Json, beforeStore) { - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); zephir_fetch_params(0, 1, 0, &data); - zephir_json_encode(return_value, &(return_value), data, 0 TSRMLS_CC); + zephir_json_encode(return_value, data, 0 ); return; } @@ -169,13 +185,16 @@ PHP_METHOD(Phalcon_Cache_Frontend_Json, beforeStore) { */ PHP_METHOD(Phalcon_Cache_Frontend_Json, afterRetrieve) { - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); zephir_fetch_params(0, 1, 0, &data); - zephir_json_decode(return_value, &(return_value), data, 0 TSRMLS_CC); + zephir_json_decode(return_value, data, 0 ); return; } diff --git a/ext/phalcon/cache/frontend/json.zep.h b/ext/phalcon/cache/frontend/json.zep.h index 8b8763f3807..2d79fdb93ce 100644 --- a/ext/phalcon/cache/frontend/json.zep.h +++ b/ext/phalcon/cache/frontend/json.zep.h @@ -16,7 +16,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_json___construct, 0, 0, 0) ZEND_ARG_INFO(0, frontendOptions) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_json_beforestore, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_json_getlifetime, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_json_getlifetime, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_json_isbuffering, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_json_isbuffering, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_json_beforestore, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_json_beforestore, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -26,8 +44,8 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_frontend_json_method_entry) { PHP_ME(Phalcon_Cache_Frontend_Json, __construct, arginfo_phalcon_cache_frontend_json___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Cache_Frontend_Json, getLifetime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Frontend_Json, isBuffering, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Json, getLifetime, arginfo_phalcon_cache_frontend_json_getlifetime, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Json, isBuffering, arginfo_phalcon_cache_frontend_json_isbuffering, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Json, start, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Json, getContent, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Json, stop, NULL, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/cache/frontend/msgpack.zep.c b/ext/phalcon/cache/frontend/msgpack.zep.c index 990c247bbe7..c264b4ae2a6 100644 --- a/ext/phalcon/cache/frontend/msgpack.zep.c +++ b/ext/phalcon/cache/frontend/msgpack.zep.c @@ -89,24 +89,30 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Frontend_Msgpack) { */ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, __construct) { - zval *frontendOptions = NULL, *lifetime = NULL; + zval *frontendOptions = NULL, frontendOptions_sub, __$null, lifetime; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontendOptions_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&lifetime); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &frontendOptions); if (!frontendOptions) { - frontendOptions = ZEPHIR_GLOBAL(global_null); + frontendOptions = &frontendOptions_sub; + frontendOptions = &__$null; } - ZEPHIR_OBS_VAR(lifetime); - if (zephir_array_isset_string_fetch(&lifetime, frontendOptions, SS("lifetime"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(lifetime) != IS_LONG) { + ZEPHIR_OBS_VAR(&lifetime); + if (zephir_array_isset_string_fetch(&lifetime, frontendOptions, SL("lifetime"), 0)) { + if (Z_TYPE_P(&lifetime) != IS_LONG) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cache_exception_ce, "Option 'lifetime' must be an integer", "phalcon/cache/frontend/msgpack.zep", 91); return; } } - zephir_update_property_this(getThis(), SL("_frontendOptions"), frontendOptions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_frontendOptions"), frontendOptions); ZEPHIR_MM_RESTORE(); } @@ -116,13 +122,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, __construct) { */ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, getLifetime) { - zval *options = NULL, *lifetime = NULL; + zval options, lifetime; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&lifetime); - options = zephir_fetch_nproperty_this(this_ptr, SL("_frontendOptions"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 1 TSRMLS_CC)) { - RETURN_CTORW(lifetime); + zephir_read_property(&options, this_ptr, SL("_frontendOptions"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&lifetime, &options, SL("lifetime"), 1)) { + RETURN_CTORW(&lifetime); } } RETURN_LONG(1); @@ -134,7 +144,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, getLifetime) { */ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, isBuffering) { - + zval *this_ptr = getThis(); + RETURN_BOOL(0); @@ -145,7 +156,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, isBuffering) { */ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, start) { - + zval *this_ptr = getThis(); + } @@ -155,7 +167,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, start) { */ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, getContent) { - + zval *this_ptr = getThis(); + RETURN_NULL(); @@ -166,7 +179,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, getContent) { */ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, stop) { - + zval *this_ptr = getThis(); + } @@ -177,14 +191,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, stop) { PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, beforeStore) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_RETURN_CALL_FUNCTION("msgpack_pack", NULL, 138, data); + ZEPHIR_RETURN_CALL_FUNCTION("msgpack_pack", NULL, 119, data); zephir_check_call_status(); RETURN_MM(); @@ -196,7 +213,10 @@ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, beforeStore) { PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, afterRetrieve) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); @@ -207,7 +227,7 @@ PHP_METHOD(Phalcon_Cache_Frontend_Msgpack, afterRetrieve) { RETVAL_ZVAL(data, 1, 0); RETURN_MM(); } - ZEPHIR_RETURN_CALL_FUNCTION("msgpack_unpack", NULL, 139, data); + ZEPHIR_RETURN_CALL_FUNCTION("msgpack_unpack", NULL, 120, data); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/cache/frontend/msgpack.zep.h b/ext/phalcon/cache/frontend/msgpack.zep.h index a14cf4afcc3..be6da37a9d3 100644 --- a/ext/phalcon/cache/frontend/msgpack.zep.h +++ b/ext/phalcon/cache/frontend/msgpack.zep.h @@ -16,7 +16,32 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_msgpack___construct, 0, 0, ZEND_ARG_INFO(0, frontendOptions) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_msgpack_beforestore, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_msgpack_getlifetime, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_msgpack_getlifetime, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_msgpack_isbuffering, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_msgpack_isbuffering, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_msgpack_getcontent, 0, 0, IS_NULL, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_msgpack_getcontent, 0, 0, IS_NULL, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_msgpack_beforestore, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_msgpack_beforestore, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -26,10 +51,10 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_frontend_msgpack_method_entry) { PHP_ME(Phalcon_Cache_Frontend_Msgpack, __construct, arginfo_phalcon_cache_frontend_msgpack___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Cache_Frontend_Msgpack, getLifetime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Frontend_Msgpack, isBuffering, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Msgpack, getLifetime, arginfo_phalcon_cache_frontend_msgpack_getlifetime, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Msgpack, isBuffering, arginfo_phalcon_cache_frontend_msgpack_isbuffering, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Msgpack, start, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Frontend_Msgpack, getContent, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Msgpack, getContent, arginfo_phalcon_cache_frontend_msgpack_getcontent, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Msgpack, stop, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Msgpack, beforeStore, arginfo_phalcon_cache_frontend_msgpack_beforestore, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Msgpack, afterRetrieve, arginfo_phalcon_cache_frontend_msgpack_afterretrieve, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/cache/frontend/none.zep.c b/ext/phalcon/cache/frontend/none.zep.c index 42db0e352b6..897e121d4d7 100644 --- a/ext/phalcon/cache/frontend/none.zep.c +++ b/ext/phalcon/cache/frontend/none.zep.c @@ -73,7 +73,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Frontend_None) { */ PHP_METHOD(Phalcon_Cache_Frontend_None, getLifetime) { - + zval *this_ptr = getThis(); + RETURN_LONG(1); @@ -84,7 +85,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, getLifetime) { */ PHP_METHOD(Phalcon_Cache_Frontend_None, isBuffering) { - + zval *this_ptr = getThis(); + RETURN_BOOL(0); @@ -95,7 +97,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, isBuffering) { */ PHP_METHOD(Phalcon_Cache_Frontend_None, start) { - + zval *this_ptr = getThis(); + } @@ -107,7 +110,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, start) { */ PHP_METHOD(Phalcon_Cache_Frontend_None, getContent) { - + zval *this_ptr = getThis(); + } @@ -117,7 +121,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, getContent) { */ PHP_METHOD(Phalcon_Cache_Frontend_None, stop) { - + zval *this_ptr = getThis(); + } @@ -127,7 +132,10 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, stop) { */ PHP_METHOD(Phalcon_Cache_Frontend_None, beforeStore) { - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); zephir_fetch_params(0, 1, 0, &data); @@ -143,7 +151,10 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, beforeStore) { */ PHP_METHOD(Phalcon_Cache_Frontend_None, afterRetrieve) { - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); zephir_fetch_params(0, 1, 0, &data); diff --git a/ext/phalcon/cache/frontend/none.zep.h b/ext/phalcon/cache/frontend/none.zep.h index 3c57de1ec7b..ddea03e4aff 100644 --- a/ext/phalcon/cache/frontend/none.zep.h +++ b/ext/phalcon/cache/frontend/none.zep.h @@ -11,6 +11,20 @@ PHP_METHOD(Phalcon_Cache_Frontend_None, stop); PHP_METHOD(Phalcon_Cache_Frontend_None, beforeStore); PHP_METHOD(Phalcon_Cache_Frontend_None, afterRetrieve); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_none_getlifetime, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_none_getlifetime, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_none_isbuffering, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_none_isbuffering, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_none_beforestore, 0, 0, 1) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -20,8 +34,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_none_afterretrieve, 0, 0, ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_frontend_none_method_entry) { - PHP_ME(Phalcon_Cache_Frontend_None, getLifetime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Frontend_None, isBuffering, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_None, getLifetime, arginfo_phalcon_cache_frontend_none_getlifetime, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_None, isBuffering, arginfo_phalcon_cache_frontend_none_isbuffering, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_None, start, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_None, getContent, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_None, stop, NULL, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/cache/frontend/output.zep.c b/ext/phalcon/cache/frontend/output.zep.c index d7c967057b8..0d99c0156c1 100644 --- a/ext/phalcon/cache/frontend/output.zep.c +++ b/ext/phalcon/cache/frontend/output.zep.c @@ -91,16 +91,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Frontend_Output) { */ PHP_METHOD(Phalcon_Cache_Frontend_Output, __construct) { - zval *frontendOptions = NULL; + zval *frontendOptions = NULL, frontendOptions_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&frontendOptions_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &frontendOptions); if (!frontendOptions) { - frontendOptions = ZEPHIR_GLOBAL(global_null); + frontendOptions = &frontendOptions_sub; + frontendOptions = &__$null; } - zephir_update_property_this(getThis(), SL("_frontendOptions"), frontendOptions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_frontendOptions"), frontendOptions); } @@ -109,13 +114,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, __construct) { */ PHP_METHOD(Phalcon_Cache_Frontend_Output, getLifetime) { - zval *options = NULL, *lifetime = NULL; + zval options, lifetime; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&lifetime); - options = zephir_fetch_nproperty_this(this_ptr, SL("_frontendOptions"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 1 TSRMLS_CC)) { - RETURN_CTORW(lifetime); + zephir_read_property(&options, this_ptr, SL("_frontendOptions"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&lifetime, &options, SL("lifetime"), 1)) { + RETURN_CTORW(&lifetime); } } RETURN_LONG(1); @@ -127,7 +136,8 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, getLifetime) { */ PHP_METHOD(Phalcon_Cache_Frontend_Output, isBuffering) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_buffering"); @@ -139,15 +149,20 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, isBuffering) { PHP_METHOD(Phalcon_Cache_Frontend_Output, start) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval __$true, __$false; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); ZEPHIR_MM_GROW(); if (1) { - zephir_update_property_this(getThis(), SL("_buffering"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_buffering"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_buffering"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_buffering"), &__$false); } - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 140); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 121); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -160,14 +175,17 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, start) { */ PHP_METHOD(Phalcon_Cache_Frontend_Output, getContent) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_buffering"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - ZEPHIR_RETURN_CALL_FUNCTION("ob_get_contents", NULL, 141); + zephir_read_property(&_0, this_ptr, SL("_buffering"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + ZEPHIR_RETURN_CALL_FUNCTION("ob_get_contents", NULL, 122); zephir_check_call_status(); RETURN_MM(); } @@ -180,20 +198,25 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, getContent) { */ PHP_METHOD(Phalcon_Cache_Frontend_Output, stop) { - zval *_0; + zval __$true, __$false, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_buffering"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 142); + zephir_read_property(&_0, this_ptr, SL("_buffering"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 123); zephir_check_call_status(); } if (0) { - zephir_update_property_this(getThis(), SL("_buffering"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_buffering"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_buffering"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_buffering"), &__$false); } ZEPHIR_MM_RESTORE(); @@ -204,7 +227,10 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, stop) { */ PHP_METHOD(Phalcon_Cache_Frontend_Output, beforeStore) { - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); zephir_fetch_params(0, 1, 0, &data); @@ -220,7 +246,10 @@ PHP_METHOD(Phalcon_Cache_Frontend_Output, beforeStore) { */ PHP_METHOD(Phalcon_Cache_Frontend_Output, afterRetrieve) { - zval *data; + zval *data, data_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); zephir_fetch_params(0, 1, 0, &data); diff --git a/ext/phalcon/cache/frontend/output.zep.h b/ext/phalcon/cache/frontend/output.zep.h index 8ad537145eb..aa6bf50982c 100644 --- a/ext/phalcon/cache/frontend/output.zep.h +++ b/ext/phalcon/cache/frontend/output.zep.h @@ -16,7 +16,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_output___construct, 0, 0, ZEND_ARG_INFO(0, frontendOptions) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontend_output_beforestore, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_output_getlifetime, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_output_getlifetime, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_output_isbuffering, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_output_isbuffering, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_output_beforestore, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontend_output_beforestore, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -26,8 +44,8 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_frontend_output_method_entry) { PHP_ME(Phalcon_Cache_Frontend_Output, __construct, arginfo_phalcon_cache_frontend_output___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Cache_Frontend_Output, getLifetime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Frontend_Output, isBuffering, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Output, getLifetime, arginfo_phalcon_cache_frontend_output_getlifetime, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Frontend_Output, isBuffering, arginfo_phalcon_cache_frontend_output_isbuffering, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Output, start, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Output, getContent, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Frontend_Output, stop, NULL, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/cache/frontendinterface.zep.h b/ext/phalcon/cache/frontendinterface.zep.h index 73e8f29a36e..135e3b5951c 100644 --- a/ext/phalcon/cache/frontendinterface.zep.h +++ b/ext/phalcon/cache/frontendinterface.zep.h @@ -3,6 +3,20 @@ extern zend_class_entry *phalcon_cache_frontendinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Cache_FrontendInterface); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontendinterface_getlifetime, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontendinterface_getlifetime, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontendinterface_isbuffering, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_frontendinterface_isbuffering, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontendinterface_beforestore, 0, 0, 1) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -12,8 +26,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_frontendinterface_afterretrieve, 0, ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cache_frontendinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Cache_FrontendInterface, getLifetime, NULL) - PHP_ABSTRACT_ME(Phalcon_Cache_FrontendInterface, isBuffering, NULL) + PHP_ABSTRACT_ME(Phalcon_Cache_FrontendInterface, getLifetime, arginfo_phalcon_cache_frontendinterface_getlifetime) + PHP_ABSTRACT_ME(Phalcon_Cache_FrontendInterface, isBuffering, arginfo_phalcon_cache_frontendinterface_isbuffering) PHP_ABSTRACT_ME(Phalcon_Cache_FrontendInterface, start, NULL) PHP_ABSTRACT_ME(Phalcon_Cache_FrontendInterface, getContent, NULL) PHP_ABSTRACT_ME(Phalcon_Cache_FrontendInterface, stop, NULL) diff --git a/ext/phalcon/cache/multiple.zep.c b/ext/phalcon/cache/multiple.zep.c index 093508d2704..161d5230eef 100644 --- a/ext/phalcon/cache/multiple.zep.c +++ b/ext/phalcon/cache/multiple.zep.c @@ -97,12 +97,17 @@ ZEPHIR_INIT_CLASS(Phalcon_Cache_Multiple) { */ PHP_METHOD(Phalcon_Cache_Multiple, __construct) { - zval *backends = NULL; + zval *backends = NULL, backends_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&backends_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &backends); if (!backends) { - backends = ZEPHIR_GLOBAL(global_null); + backends = &backends_sub; + backends = &__$null; } @@ -111,7 +116,7 @@ PHP_METHOD(Phalcon_Cache_Multiple, __construct) { ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_cache_exception_ce, "The backends must be an array", "phalcon/cache/multiple.zep", 100); return; } - zephir_update_property_this(getThis(), SL("_backends"), backends TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_backends"), backends); } } @@ -121,7 +126,10 @@ PHP_METHOD(Phalcon_Cache_Multiple, __construct) { */ PHP_METHOD(Phalcon_Cache_Multiple, push) { - zval *backend; + zval *backend, backend_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&backend_sub); zephir_fetch_params(0, 1, 0, &backend); @@ -141,32 +149,39 @@ PHP_METHOD(Phalcon_Cache_Multiple, push) { */ PHP_METHOD(Phalcon_Cache_Multiple, get) { - HashTable *_2; - HashPosition _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *lifetime = NULL, *backend = NULL, *content = NULL, *_0, **_3; + zval *keyName, keyName_sub, *lifetime = NULL, lifetime_sub, __$null, backend, content, _0, *_1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&backend); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &lifetime); if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_backends"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/cache/multiple.zep", 133); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(backend, _3); - ZEPHIR_CALL_METHOD(&content, backend, "get", NULL, 0, keyName, lifetime); + zephir_read_property(&_0, this_ptr, SL("_backends"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/cache/multiple.zep", 133); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&backend); + ZVAL_COPY(&backend, _1); + ZEPHIR_CALL_METHOD(&content, &backend, "get", NULL, 0, keyName, lifetime); zephir_check_call_status(); - if (Z_TYPE_P(content) != IS_NULL) { - RETURN_CCTOR(content); + if (Z_TYPE_P(&content) != IS_NULL) { + RETURN_CCTOR(&content); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&backend); RETURN_MM_NULL(); } @@ -179,29 +194,35 @@ PHP_METHOD(Phalcon_Cache_Multiple, get) { */ PHP_METHOD(Phalcon_Cache_Multiple, start) { - HashTable *_2; - HashPosition _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *lifetime = NULL, *backend = NULL, *_0, **_3; + zval *keyName, keyName_sub, *lifetime = NULL, lifetime_sub, __$null, backend, _0, *_1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&backend); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &keyName, &lifetime); if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_backends"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/cache/multiple.zep", 149); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(backend, _3); - ZEPHIR_CALL_METHOD(NULL, backend, "start", NULL, 0, keyName, lifetime); + zephir_read_property(&_0, this_ptr, SL("_backends"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/cache/multiple.zep", 149); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&backend); + ZVAL_COPY(&backend, _1); + ZEPHIR_CALL_METHOD(NULL, &backend, "start", NULL, 0, keyName, lifetime); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&backend); ZEPHIR_MM_RESTORE(); } @@ -216,38 +237,49 @@ PHP_METHOD(Phalcon_Cache_Multiple, start) { */ PHP_METHOD(Phalcon_Cache_Multiple, save) { - HashTable *_2; - HashPosition _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *content = NULL, *lifetime = NULL, *stopBuffer = NULL, *backend = NULL, *_0, **_3; + zval *keyName = NULL, keyName_sub, *content = NULL, content_sub, *lifetime = NULL, lifetime_sub, *stopBuffer = NULL, stopBuffer_sub, __$null, backend, _0, *_1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_UNDEF(&stopBuffer_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&backend); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &keyName, &content, &lifetime, &stopBuffer); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } if (!stopBuffer) { - stopBuffer = ZEPHIR_GLOBAL(global_null); + stopBuffer = &stopBuffer_sub; + stopBuffer = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_backends"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/cache/multiple.zep", 166); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(backend, _3); - ZEPHIR_CALL_METHOD(NULL, backend, "save", NULL, 0, keyName, content, lifetime, stopBuffer); + zephir_read_property(&_0, this_ptr, SL("_backends"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/cache/multiple.zep", 166); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&backend); + ZVAL_COPY(&backend, _1); + ZEPHIR_CALL_METHOD(NULL, &backend, "save", NULL, 0, keyName, content, lifetime, stopBuffer); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&backend); ZEPHIR_MM_RESTORE(); } @@ -260,26 +292,29 @@ PHP_METHOD(Phalcon_Cache_Multiple, save) { */ PHP_METHOD(Phalcon_Cache_Multiple, delete) { - HashTable *_2; - HashPosition _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName, *backend = NULL, *_0, **_3; + zval *keyName, keyName_sub, backend, _0, *_1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&backend); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keyName); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_backends"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/cache/multiple.zep", 182); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(backend, _3); - ZEPHIR_CALL_METHOD(NULL, backend, "delete", NULL, 0, keyName); + zephir_read_property(&_0, this_ptr, SL("_backends"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/cache/multiple.zep", 182); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&backend); + ZVAL_COPY(&backend, _1); + ZEPHIR_CALL_METHOD(NULL, &backend, "delete", NULL, 0, keyName); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&backend); RETURN_MM_BOOL(1); } @@ -292,35 +327,43 @@ PHP_METHOD(Phalcon_Cache_Multiple, delete) { */ PHP_METHOD(Phalcon_Cache_Multiple, exists) { - HashTable *_2; - HashPosition _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keyName = NULL, *lifetime = NULL, *backend = NULL, *_0, **_3, *_4$$3 = NULL; + zval *keyName = NULL, keyName_sub, *lifetime = NULL, lifetime_sub, __$null, backend, _0, *_1, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyName_sub); + ZVAL_UNDEF(&lifetime_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&backend); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &keyName, &lifetime); if (!keyName) { - keyName = ZEPHIR_GLOBAL(global_null); + keyName = &keyName_sub; + keyName = &__$null; } if (!lifetime) { - lifetime = ZEPHIR_GLOBAL(global_null); + lifetime = &lifetime_sub; + lifetime = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_backends"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/cache/multiple.zep", 201); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(backend, _3); - ZEPHIR_CALL_METHOD(&_4$$3, backend, "exists", NULL, 0, keyName, lifetime); + zephir_read_property(&_0, this_ptr, SL("_backends"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/cache/multiple.zep", 201); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&backend); + ZVAL_COPY(&backend, _1); + ZEPHIR_CALL_METHOD(&_2$$3, &backend, "exists", NULL, 0, keyName, lifetime); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE(_4$$3)) { + if (ZEPHIR_IS_TRUE(&_2$$3)) { RETURN_MM_BOOL(1); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&backend); RETURN_MM_BOOL(0); } @@ -330,23 +373,25 @@ PHP_METHOD(Phalcon_Cache_Multiple, exists) { */ PHP_METHOD(Phalcon_Cache_Multiple, flush) { - HashTable *_2; - HashPosition _1; - zval *backend = NULL, *_0, **_3; + zval backend, _0, *_1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&backend); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_backends"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/cache/multiple.zep", 215); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(backend, _3); - ZEPHIR_CALL_METHOD(NULL, backend, "flush", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_backends"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/cache/multiple.zep", 215); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&backend); + ZVAL_COPY(&backend, _1); + ZEPHIR_CALL_METHOD(NULL, &backend, "flush", NULL, 0); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&backend); RETURN_MM_BOOL(1); } diff --git a/ext/phalcon/cache/multiple.zep.h b/ext/phalcon/cache/multiple.zep.h index 9bc901ba9be..d8354bfd6e1 100644 --- a/ext/phalcon/cache/multiple.zep.h +++ b/ext/phalcon/cache/multiple.zep.h @@ -16,7 +16,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_multiple___construct, 0, 0, 0) ZEND_ARG_INFO(0, backends) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_multiple_push, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cache_multiple_push, 0, 1, Phalcon\\Cache\\Multiple, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_multiple_push, 0, 1, IS_OBJECT, "Phalcon\\Cache\\Multiple", 0) +#endif ZEND_ARG_OBJ_INFO(0, backend, Phalcon\\Cache\\BackendInterface, 0) ZEND_END_ARG_INFO() @@ -37,15 +41,30 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_multiple_save, 0, 0, 0) ZEND_ARG_INFO(0, stopBuffer) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_multiple_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_multiple_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_multiple_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cache_multiple_exists, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_multiple_exists, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_multiple_exists, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, keyName) ZEND_ARG_INFO(0, lifetime) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_multiple_flush, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cache_multiple_flush, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_cache_multiple_method_entry) { PHP_ME(Phalcon_Cache_Multiple, __construct, arginfo_phalcon_cache_multiple___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Cache_Multiple, push, arginfo_phalcon_cache_multiple_push, ZEND_ACC_PUBLIC) @@ -54,6 +73,6 @@ ZEPHIR_INIT_FUNCS(phalcon_cache_multiple_method_entry) { PHP_ME(Phalcon_Cache_Multiple, save, arginfo_phalcon_cache_multiple_save, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Multiple, delete, arginfo_phalcon_cache_multiple_delete, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cache_Multiple, exists, arginfo_phalcon_cache_multiple_exists, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cache_Multiple, flush, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cache_Multiple, flush, arginfo_phalcon_cache_multiple_flush, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cli/console.zep.c b/ext/phalcon/cli/console.zep.c index ba0bcaaa739..c7e1d348195 100644 --- a/ext/phalcon/cli/console.zep.c +++ b/ext/phalcon/cli/console.zep.c @@ -13,9 +13,9 @@ #include "kernel/main.h" #include "kernel/fcall.h" -#include "kernel/memory.h" #include "ext/spl/spl_exceptions.h" #include "kernel/exception.h" +#include "kernel/memory.h" #include "kernel/object.h" #include "kernel/operators.h" #include "kernel/array.h" @@ -60,18 +60,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Console) { PHP_METHOD(Phalcon_Cli_Console, addModules) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *modules_param = NULL, *_0; - zval *modules = NULL; + zval *modules_param = NULL, _0; + zval modules; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modules); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &modules_param); - modules = modules_param; + ZEPHIR_OBS_COPY_OR_DUP(&modules, modules_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_BOOL(_0, 1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "registermodules", NULL, 0, modules, _0); + ZVAL_BOOL(&_0, 1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "registermodules", NULL, 0, &modules, &_0); zephir_check_call_status(); RETURN_MM(); @@ -84,173 +87,200 @@ PHP_METHOD(Phalcon_Cli_Console, handle) { zend_bool _5; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *arguments_param = NULL, *dependencyInjector = NULL, *router = NULL, *eventsManager = NULL, *moduleName = NULL, *modules = NULL, *module = NULL, *path = NULL, *className = NULL, *moduleObject = NULL, *dispatcher = NULL, *task = NULL, *_0, *_3 = NULL, *_4 = NULL, *_15 = NULL, *_16 = NULL, *_17, *_1$$4 = NULL, *_2$$4, *_6$$6, *_7$$10 = NULL, *_8$$10, *_9$$12, *_10$$12, *_11$$15, *_12$$15, *_13$$17 = NULL, *_14$$17, *_18$$19 = NULL, *_19$$19, *_20$$21; - zval *arguments = NULL; + zval *arguments_param = NULL, dependencyInjector, router, eventsManager, moduleName, modules, module, path, className, moduleObject, dispatcher, task, _0, _3, _4, _15, _16, _17, _1$$4, _2$$4, _6$$6, _7$$10, _8$$10, _9$$12, _10$$12, _11$$15, _12$$15, _13$$17, _14$$17, _18$$19, _19$$19, _20$$21; + zval arguments; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&moduleName); + ZVAL_UNDEF(&modules); + ZVAL_UNDEF(&module); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&moduleObject); + ZVAL_UNDEF(&dispatcher); + ZVAL_UNDEF(&task); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_15); + ZVAL_UNDEF(&_16); + ZVAL_UNDEF(&_17); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$10); + ZVAL_UNDEF(&_8$$10); + ZVAL_UNDEF(&_9$$12); + ZVAL_UNDEF(&_10$$12); + ZVAL_UNDEF(&_11$$15); + ZVAL_UNDEF(&_12$$15); + ZVAL_UNDEF(&_13$$17); + ZVAL_UNDEF(&_14$$17); + ZVAL_UNDEF(&_18$$19); + ZVAL_UNDEF(&_19$$19); + ZVAL_UNDEF(&_20$$21); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &arguments_param); if (!arguments_param) { - ZEPHIR_INIT_VAR(arguments); - array_init(arguments); + ZEPHIR_INIT_VAR(&arguments); + array_init(&arguments); } else { - zephir_get_arrval(arguments, arguments_param); + zephir_get_arrval(&arguments, arguments_param); } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cli_console_exception_ce, "A dependency injection object is required to access internal services", "phalcon/cli/console.zep", 71); return; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_STRING(_2$$4, "console:boot", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$4, eventsManager, "fire", NULL, 0, _2$$4, this_ptr); - zephir_check_temp_parameter(_2$$4); + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, "console:boot"); + ZEPHIR_CALL_METHOD(&_1$$4, &eventsManager, "fire", NULL, 0, &_2$$4, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1$$4)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$4)) { RETURN_MM_BOOL(0); } } - ZEPHIR_INIT_VAR(_4); - ZVAL_STRING(_4, "router", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3, dependencyInjector, "getshared", NULL, 0, _4); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "router"); + ZEPHIR_CALL_METHOD(&_3, &dependencyInjector, "getshared", NULL, 0, &_4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(router, _3); - _5 = !(zephir_fast_count_int(arguments TSRMLS_CC)); + ZEPHIR_CPY_WRT(&router, &_3); + _5 = !(zephir_fast_count_int(&arguments TSRMLS_CC)); if (_5) { - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); - _5 = zephir_is_true(_0); + zephir_read_property(&_0, this_ptr, SL("_arguments"), PH_NOISY_CC | PH_READONLY); + _5 = zephir_is_true(&_0); } if (_5) { - _6$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, router, "handle", NULL, 0, _6$$6); + zephir_read_property(&_6$$6, this_ptr, SL("_arguments"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &router, "handle", NULL, 0, &_6$$6); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(NULL, router, "handle", NULL, 0, arguments); + ZEPHIR_CALL_METHOD(NULL, &router, "handle", NULL, 0, &arguments); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&moduleName, router, "getmodulename", NULL, 0); + ZEPHIR_CALL_METHOD(&moduleName, &router, "getmodulename", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(moduleName))) { - ZEPHIR_OBS_NVAR(moduleName); - zephir_read_property_this(&moduleName, this_ptr, SL("_defaultModule"), PH_NOISY_CC); + if (!(zephir_is_true(&moduleName))) { + ZEPHIR_OBS_NVAR(&moduleName); + zephir_read_property(&moduleName, this_ptr, SL("_defaultModule"), PH_NOISY_CC); } - if (zephir_is_true(moduleName)) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_8$$10); - ZVAL_STRING(_8$$10, "console:beforeStartModule", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_7$$10, eventsManager, "fire", NULL, 0, _8$$10, this_ptr, moduleName); - zephir_check_temp_parameter(_8$$10); + if (zephir_is_true(&moduleName)) { + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_8$$10); + ZVAL_STRING(&_8$$10, "console:beforeStartModule"); + ZEPHIR_CALL_METHOD(&_7$$10, &eventsManager, "fire", NULL, 0, &_8$$10, this_ptr, &moduleName); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_7$$10)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_7$$10)) { RETURN_MM_BOOL(0); } } - ZEPHIR_OBS_VAR(modules); - zephir_read_property_this(&modules, this_ptr, SL("_modules"), PH_NOISY_CC); - if (!(zephir_array_isset(modules, moduleName))) { - ZEPHIR_INIT_VAR(_9$$12); - object_init_ex(_9$$12, phalcon_cli_console_exception_ce); - ZEPHIR_INIT_VAR(_10$$12); - ZEPHIR_CONCAT_SVS(_10$$12, "Module '", moduleName, "' isn't registered in the console container"); - ZEPHIR_CALL_METHOD(NULL, _9$$12, "__construct", NULL, 9, _10$$12); + ZEPHIR_OBS_VAR(&modules); + zephir_read_property(&modules, this_ptr, SL("_modules"), PH_NOISY_CC); + if (!(zephir_array_isset(&modules, &moduleName))) { + ZEPHIR_INIT_VAR(&_9$$12); + object_init_ex(&_9$$12, phalcon_cli_console_exception_ce); + ZEPHIR_INIT_VAR(&_10$$12); + ZEPHIR_CONCAT_SVS(&_10$$12, "Module '", &moduleName, "' isn't registered in the console container"); + ZEPHIR_CALL_METHOD(NULL, &_9$$12, "__construct", NULL, 4, &_10$$12); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$12, "phalcon/cli/console.zep", 111 TSRMLS_CC); + zephir_throw_exception_debug(&_9$$12, "phalcon/cli/console.zep", 111 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_VAR(module); - zephir_array_fetch(&module, modules, moduleName, PH_NOISY, "phalcon/cli/console.zep", 114 TSRMLS_CC); - if (Z_TYPE_P(module) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&module); + zephir_array_fetch(&module, &modules, &moduleName, PH_NOISY, "phalcon/cli/console.zep", 114 TSRMLS_CC); + if (Z_TYPE_P(&module) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cli_console_exception_ce, "Invalid module definition path", "phalcon/cli/console.zep", 116); return; } - ZEPHIR_OBS_VAR(path); - if (zephir_array_isset_string_fetch(&path, module, SS("path"), 0 TSRMLS_CC)) { - if (!((zephir_file_exists(path TSRMLS_CC) == SUCCESS))) { - ZEPHIR_INIT_VAR(_11$$15); - object_init_ex(_11$$15, phalcon_cli_console_exception_ce); - ZEPHIR_INIT_VAR(_12$$15); - ZEPHIR_CONCAT_SVS(_12$$15, "Module definition path '", path, "' doesn't exist"); - ZEPHIR_CALL_METHOD(NULL, _11$$15, "__construct", NULL, 9, _12$$15); + ZEPHIR_OBS_VAR(&path); + if (zephir_array_isset_string_fetch(&path, &module, SL("path"), 0)) { + if (!((zephir_file_exists(&path TSRMLS_CC) == SUCCESS))) { + ZEPHIR_INIT_VAR(&_11$$15); + object_init_ex(&_11$$15, phalcon_cli_console_exception_ce); + ZEPHIR_INIT_VAR(&_12$$15); + ZEPHIR_CONCAT_SVS(&_12$$15, "Module definition path '", &path, "' doesn't exist"); + ZEPHIR_CALL_METHOD(NULL, &_11$$15, "__construct", NULL, 4, &_12$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_11$$15, "phalcon/cli/console.zep", 121 TSRMLS_CC); + zephir_throw_exception_debug(&_11$$15, "phalcon/cli/console.zep", 121 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_require_zval(path TSRMLS_CC) == FAILURE) { + if (zephir_require_zval(&path TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } } - ZEPHIR_OBS_VAR(className); - if (!(zephir_array_isset_string_fetch(&className, module, SS("className"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(className); - ZVAL_STRING(className, "Module", 1); + ZEPHIR_OBS_VAR(&className); + if (!(zephir_array_isset_string_fetch(&className, &module, SL("className"), 0))) { + ZEPHIR_INIT_NVAR(&className); + ZVAL_STRING(&className, "Module"); } - ZEPHIR_CALL_METHOD(&moduleObject, dependencyInjector, "get", NULL, 0, className); + ZEPHIR_CALL_METHOD(&moduleObject, &dependencyInjector, "get", NULL, 0, &className); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, moduleObject, "registerautoloaders", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &moduleObject, "registerautoloaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, moduleObject, "registerservices", NULL, 0, dependencyInjector); + ZEPHIR_CALL_METHOD(NULL, &moduleObject, "registerservices", NULL, 0, &dependencyInjector); zephir_check_call_status(); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_14$$17); - ZVAL_STRING(_14$$17, "console:afterStartModule", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_13$$17, eventsManager, "fire", NULL, 0, _14$$17, this_ptr, moduleObject); - zephir_check_temp_parameter(_14$$17); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_14$$17); + ZVAL_STRING(&_14$$17, "console:afterStartModule"); + ZEPHIR_CALL_METHOD(&_13$$17, &eventsManager, "fire", NULL, 0, &_14$$17, this_ptr, &moduleObject); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_13$$17)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_13$$17)) { RETURN_MM_BOOL(0); } } } - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "dispatcher", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3, dependencyInjector, "getshared", NULL, 0, _4); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "dispatcher"); + ZEPHIR_CALL_METHOD(&_3, &dependencyInjector, "getshared", NULL, 0, &_4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(dispatcher, _3); - ZEPHIR_CALL_METHOD(&_3, router, "gettaskname", NULL, 0); + ZEPHIR_CPY_WRT(&dispatcher, &_3); + ZEPHIR_CALL_METHOD(&_3, &router, "gettaskname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, dispatcher, "settaskname", NULL, 0, _3); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "settaskname", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_15, router, "getactionname", NULL, 0); + ZEPHIR_CALL_METHOD(&_15, &router, "getactionname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, dispatcher, "setactionname", NULL, 0, _15); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setactionname", NULL, 0, &_15); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_16, router, "getparams", NULL, 0); + ZEPHIR_CALL_METHOD(&_16, &router, "getparams", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, dispatcher, "setparams", NULL, 0, _16); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setparams", NULL, 0, &_16); zephir_check_call_status(); - _17 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, dispatcher, "setoptions", NULL, 0, _17); + zephir_read_property(&_17, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setoptions", NULL, 0, &_17); zephir_check_call_status(); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_19$$19); - ZVAL_STRING(_19$$19, "console:beforeHandleTask", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_18$$19, eventsManager, "fire", NULL, 0, _19$$19, this_ptr, dispatcher); - zephir_check_temp_parameter(_19$$19); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_19$$19); + ZVAL_STRING(&_19$$19, "console:beforeHandleTask"); + ZEPHIR_CALL_METHOD(&_18$$19, &eventsManager, "fire", NULL, 0, &_19$$19, this_ptr, &dispatcher); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_18$$19)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_18$$19)) { RETURN_MM_BOOL(0); } } - ZEPHIR_CALL_METHOD(&task, dispatcher, "dispatch", NULL, 0); + ZEPHIR_CALL_METHOD(&task, &dispatcher, "dispatch", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_20$$21); - ZVAL_STRING(_20$$21, "console:afterHandleTask", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _20$$21, this_ptr, task); - zephir_check_temp_parameter(_20$$21); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_20$$21); + ZVAL_STRING(&_20$$21, "console:afterHandleTask"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_20$$21, this_ptr, &task); zephir_check_call_status(); } - RETURN_CCTOR(task); + RETURN_CCTOR(&task); } @@ -259,196 +289,215 @@ PHP_METHOD(Phalcon_Cli_Console, handle) { */ PHP_METHOD(Phalcon_Cli_Console, setArgument) { - HashTable *_2; - HashPosition _1; - zephir_fcall_cache_entry *_7 = NULL, *_26 = NULL; + zephir_fcall_cache_entry *_5 = NULL, *_24 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool str, shift, _0; - zval *arguments_param = NULL, *str_param = NULL, *shift_param = NULL, *arg = NULL, *pos = NULL, *args = NULL, *opts = NULL, *handleArgs = NULL, **_3, _4$$5 = zval_used_for_init, _5$$5 = zval_used_for_init, *_6$$5 = NULL, _8$$6 = zval_used_for_init, *_9$$7 = NULL, _10$$7 = zval_used_for_init, *_11$$7 = NULL, *_12$$7 = NULL, _13$$7 = zval_used_for_init, _14$$7 = zval_used_for_init, *_15$$7 = NULL, *_16$$8 = NULL, _17$$8 = zval_used_for_init, *_18$$8 = NULL, _19$$9 = zval_used_for_init, _20$$9 = zval_used_for_init, *_21$$9 = NULL, _22$$10 = zval_used_for_init, *_23$$10 = NULL, *_24$$13, *_25$$13 = NULL, *_27$$15 = NULL, *_28$$16 = NULL, *_29$$17; - zval *arguments = NULL; + zval *arguments_param = NULL, *str_param = NULL, *shift_param = NULL, __$true, arg, pos, args, opts, handleArgs, *_1, _2$$5, _3$$5, _4$$5, _6$$6, _7$$7, _8$$7, _9$$7, _10$$7, _11$$7, _12$$7, _13$$7, _14$$8, _15$$8, _16$$8, _17$$9, _18$$9, _19$$9, _20$$10, _21$$10, _22$$13, _23$$13, _25$$15, _26$$16, _27$$17; + zval arguments; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&arguments); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&arg); + ZVAL_UNDEF(&pos); + ZVAL_UNDEF(&args); + ZVAL_UNDEF(&opts); + ZVAL_UNDEF(&handleArgs); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_11$$7); + ZVAL_UNDEF(&_12$$7); + ZVAL_UNDEF(&_13$$7); + ZVAL_UNDEF(&_14$$8); + ZVAL_UNDEF(&_15$$8); + ZVAL_UNDEF(&_16$$8); + ZVAL_UNDEF(&_17$$9); + ZVAL_UNDEF(&_18$$9); + ZVAL_UNDEF(&_19$$9); + ZVAL_UNDEF(&_20$$10); + ZVAL_UNDEF(&_21$$10); + ZVAL_UNDEF(&_22$$13); + ZVAL_UNDEF(&_23$$13); + ZVAL_UNDEF(&_25$$15); + ZVAL_UNDEF(&_26$$16); + ZVAL_UNDEF(&_27$$17); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &arguments_param, &str_param, &shift_param); if (!arguments_param) { - ZEPHIR_INIT_VAR(arguments); - array_init(arguments); + ZEPHIR_INIT_VAR(&arguments); + array_init(&arguments); } else { - arguments = arguments_param; + ZEPHIR_OBS_COPY_OR_DUP(&arguments, arguments_param); } if (!str_param) { str = 1; } else { - if (UNEXPECTED(Z_TYPE_P(str_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(str_param) != IS_TRUE && Z_TYPE_P(str_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - str = Z_BVAL_P(str_param); + str = (Z_TYPE_P(str_param) == IS_TRUE); } if (!shift_param) { shift = 1; } else { - if (UNEXPECTED(Z_TYPE_P(shift_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'shift' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(shift_param) != IS_TRUE && Z_TYPE_P(shift_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'shift' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - shift = Z_BVAL_P(shift_param); + shift = (Z_TYPE_P(shift_param) == IS_TRUE); } - ZEPHIR_INIT_VAR(args); - array_init(args); - ZEPHIR_INIT_VAR(opts); - array_init(opts); - ZEPHIR_INIT_VAR(handleArgs); - array_init(handleArgs); + ZEPHIR_INIT_VAR(&args); + array_init(&args); + ZEPHIR_INIT_VAR(&opts); + array_init(&opts); + ZEPHIR_INIT_VAR(&handleArgs); + array_init(&handleArgs); _0 = shift; if (_0) { - _0 = ((zephir_fast_count_int(arguments TSRMLS_CC)) ? 1 : 0); + _0 = ((zephir_fast_count_int(&arguments TSRMLS_CC)) ? 1 : 0); } if (_0) { - ZEPHIR_MAKE_REF(arguments); - ZEPHIR_CALL_FUNCTION(NULL, "array_shift", NULL, 19, arguments); - ZEPHIR_UNREF(arguments); + ZEPHIR_MAKE_REF(&arguments); + ZEPHIR_CALL_FUNCTION(NULL, "array_shift", NULL, 14, &arguments); + ZEPHIR_UNREF(&arguments); zephir_check_call_status(); } - zephir_is_iterable(arguments, &_2, &_1, 0, 0, "phalcon/cli/console.zep", 201); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(arg, _3); - if (Z_TYPE_P(arg) == IS_STRING) { - ZEPHIR_SINIT_NVAR(_4$$5); - ZVAL_STRING(&_4$$5, "--", 0); - ZEPHIR_SINIT_NVAR(_5$$5); - ZVAL_LONG(&_5$$5, 2); - ZEPHIR_CALL_FUNCTION(&_6$$5, "strncmp", &_7, 143, arg, &_4$$5, &_5$$5); + zephir_is_iterable(&arguments, 0, "phalcon/cli/console.zep", 201); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arguments), _1) + { + ZEPHIR_INIT_NVAR(&arg); + ZVAL_COPY(&arg, _1); + if (Z_TYPE_P(&arg) == IS_STRING) { + ZEPHIR_INIT_NVAR(&_2$$5); + ZVAL_STRING(&_2$$5, "--"); + ZVAL_LONG(&_3$$5, 2); + ZEPHIR_CALL_FUNCTION(&_4$$5, "strncmp", &_5, 124, &arg, &_2$$5, &_3$$5); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_6$$5, 0)) { - ZEPHIR_SINIT_NVAR(_8$$6); - ZVAL_STRING(&_8$$6, "=", 0); - ZEPHIR_INIT_NVAR(pos); - zephir_fast_strpos(pos, arg, &_8$$6, 0 ); - if (zephir_is_true(pos)) { - ZEPHIR_INIT_NVAR(_9$$7); - ZEPHIR_SINIT_NVAR(_10$$7); - ZVAL_LONG(&_10$$7, (zephir_get_numberval(pos) + 1)); - ZEPHIR_INIT_NVAR(_11$$7); - zephir_substr(_11$$7, arg, zephir_get_intval(&_10$$7), 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_trim(_9$$7, _11$$7, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); - ZEPHIR_INIT_NVAR(_12$$7); - ZEPHIR_SINIT_NVAR(_13$$7); - ZVAL_LONG(&_13$$7, 2); - ZEPHIR_SINIT_NVAR(_14$$7); - ZVAL_LONG(&_14$$7, (zephir_get_numberval(pos) - 2)); - ZEPHIR_INIT_NVAR(_15$$7); - zephir_substr(_15$$7, arg, 2 , zephir_get_intval(&_14$$7), 0); - zephir_fast_trim(_12$$7, _15$$7, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); - zephir_array_update_zval(&opts, _12$$7, &_9$$7, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_LONG(&_4$$5, 0)) { + ZEPHIR_INIT_NVAR(&_6$$6); + ZVAL_STRING(&_6$$6, "="); + ZEPHIR_INIT_NVAR(&pos); + zephir_fast_strpos(&pos, &arg, &_6$$6, 0 ); + if (zephir_is_true(&pos)) { + ZEPHIR_INIT_NVAR(&_7$$7); + ZVAL_LONG(&_8$$7, (zephir_get_numberval(&pos) + 1)); + ZEPHIR_INIT_NVAR(&_9$$7); + zephir_substr(&_9$$7, &arg, zephir_get_intval(&_8$$7), 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_fast_trim(&_7$$7, &_9$$7, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_10$$7); + ZVAL_LONG(&_11$$7, 2); + ZVAL_LONG(&_12$$7, (zephir_get_numberval(&pos) - 2)); + ZEPHIR_INIT_NVAR(&_13$$7); + zephir_substr(&_13$$7, &arg, 2 , zephir_get_intval(&_12$$7), 0); + zephir_fast_trim(&_10$$7, &_13$$7, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); + zephir_array_update_zval(&opts, &_10$$7, &_7$$7, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(_16$$8); - ZEPHIR_SINIT_NVAR(_17$$8); - ZVAL_LONG(&_17$$8, 2); - ZEPHIR_INIT_NVAR(_18$$8); - zephir_substr(_18$$8, arg, 2 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_fast_trim(_16$$8, _18$$8, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); - zephir_array_update_zval(&opts, _16$$8, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_14$$8); + ZVAL_LONG(&_15$$8, 2); + ZEPHIR_INIT_NVAR(&_16$$8); + zephir_substr(&_16$$8, &arg, 2 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_fast_trim(&_14$$8, &_16$$8, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); + zephir_array_update_zval(&opts, &_14$$8, &__$true, PH_COPY | PH_SEPARATE); } } else { - ZEPHIR_SINIT_NVAR(_19$$9); - ZVAL_STRING(&_19$$9, "-", 0); - ZEPHIR_SINIT_NVAR(_20$$9); - ZVAL_LONG(&_20$$9, 1); - ZEPHIR_CALL_FUNCTION(&_21$$9, "strncmp", &_7, 143, arg, &_19$$9, &_20$$9); + ZEPHIR_INIT_NVAR(&_17$$9); + ZVAL_STRING(&_17$$9, "-"); + ZVAL_LONG(&_18$$9, 1); + ZEPHIR_CALL_FUNCTION(&_19$$9, "strncmp", &_5, 124, &arg, &_17$$9, &_18$$9); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_21$$9, 0)) { - ZEPHIR_SINIT_NVAR(_22$$10); - ZVAL_LONG(&_22$$10, 1); - ZEPHIR_INIT_NVAR(_23$$10); - zephir_substr(_23$$10, arg, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_array_update_zval(&opts, _23$$10, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_LONG(&_19$$9, 0)) { + ZVAL_LONG(&_20$$10, 1); + ZEPHIR_INIT_NVAR(&_21$$10); + zephir_substr(&_21$$10, &arg, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_array_update_zval(&opts, &_21$$10, &__$true, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&args, arg, PH_SEPARATE, "phalcon/cli/console.zep", 193); + zephir_array_append(&args, &arg, PH_SEPARATE, "phalcon/cli/console.zep", 193); } } } else { - zephir_array_append(&args, arg, PH_SEPARATE, "phalcon/cli/console.zep", 197); + zephir_array_append(&args, &arg, PH_SEPARATE, "phalcon/cli/console.zep", 197); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&arg); if (str) { - ZEPHIR_INIT_VAR(_24$$13); - ZEPHIR_CALL_CE_STATIC(&_25$$13, phalcon_cli_router_route_ce, "getdelimiter", &_26, 144); + ZEPHIR_INIT_VAR(&_22$$13); + ZEPHIR_CALL_CE_STATIC(&_23$$13, phalcon_cli_router_route_ce, "getdelimiter", &_24, 0); zephir_check_call_status(); - zephir_fast_join(_24$$13, _25$$13, args TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_arguments"), _24$$13 TSRMLS_CC); + zephir_fast_join(&_22$$13, &_23$$13, &args TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_arguments"), &_22$$13); } else { - if (zephir_fast_count_int(args TSRMLS_CC)) { - ZEPHIR_MAKE_REF(args); - ZEPHIR_CALL_FUNCTION(&_27$$15, "array_shift", NULL, 19, args); - ZEPHIR_UNREF(args); + if (zephir_fast_count_int(&args TSRMLS_CC)) { + ZEPHIR_MAKE_REF(&args); + ZEPHIR_CALL_FUNCTION(&_25$$15, "array_shift", NULL, 14, &args); + ZEPHIR_UNREF(&args); zephir_check_call_status(); - zephir_array_update_string(&handleArgs, SL("task"), &_27$$15, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&handleArgs, SL("task"), &_25$$15, PH_COPY | PH_SEPARATE); } - if (zephir_fast_count_int(args TSRMLS_CC)) { - ZEPHIR_MAKE_REF(args); - ZEPHIR_CALL_FUNCTION(&_28$$16, "array_shift", NULL, 19, args); - ZEPHIR_UNREF(args); + if (zephir_fast_count_int(&args TSRMLS_CC)) { + ZEPHIR_MAKE_REF(&args); + ZEPHIR_CALL_FUNCTION(&_26$$16, "array_shift", NULL, 14, &args); + ZEPHIR_UNREF(&args); zephir_check_call_status(); - zephir_array_update_string(&handleArgs, SL("action"), &_28$$16, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&handleArgs, SL("action"), &_26$$16, PH_COPY | PH_SEPARATE); } - if (zephir_fast_count_int(args TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_29$$17); - zephir_fast_array_merge(_29$$17, &(handleArgs), &(args) TSRMLS_CC); - ZEPHIR_CPY_WRT(handleArgs, _29$$17); + if (zephir_fast_count_int(&args TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_27$$17); + zephir_fast_array_merge(&_27$$17, &handleArgs, &args TSRMLS_CC); + ZEPHIR_CPY_WRT(&handleArgs, &_27$$17); } - zephir_update_property_this(getThis(), SL("_arguments"), handleArgs TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_arguments"), &handleArgs); } - zephir_update_property_this(getThis(), SL("_options"), opts TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &opts); RETURN_THIS(); } -zend_object_value zephir_init_properties_Phalcon_Cli_Console(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Cli_Console(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_2, *_4, *_1$$3, *_3$$4, *_5$$5; + zval _0, _2, _4, _1$$3, _3$$4, _5$$5; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$5); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_options"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_options"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_modules"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("_modules"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_modules"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("_modules"), &_3$$4); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_arguments"), PH_NOISY_CC); - if (Z_TYPE_P(_4) == IS_NULL) { - ZEPHIR_INIT_VAR(_5$$5); - array_init(_5$$5); - zephir_update_property_this(getThis(), SL("_arguments"), _5$$5 TSRMLS_CC); + zephir_read_property(&_4, this_ptr, SL("_arguments"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_4) == IS_NULL) { + ZEPHIR_INIT_VAR(&_5$$5); + array_init(&_5$$5); + zephir_update_property_zval(this_ptr, SL("_arguments"), &_5$$5); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/cli/console.zep.h b/ext/phalcon/cli/console.zep.h index 83242385bd8..c8e67d5687c 100644 --- a/ext/phalcon/cli/console.zep.h +++ b/ext/phalcon/cli/console.zep.h @@ -6,7 +6,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Console); PHP_METHOD(Phalcon_Cli_Console, addModules); PHP_METHOD(Phalcon_Cli_Console, handle); PHP_METHOD(Phalcon_Cli_Console, setArgument); -zend_object_value zephir_init_properties_Phalcon_Cli_Console(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Cli_Console(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_console_addmodules, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, modules, 0) @@ -16,10 +16,22 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_console_handle, 0, 0, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_console_setargument, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_console_setargument, 0, 0, Phalcon\\Cli\\Console, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_console_setargument, 0, 0, IS_OBJECT, "Phalcon\\Cli\\Console", 0) +#endif ZEND_ARG_ARRAY_INFO(0, arguments, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, str, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, str) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, shift, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, shift) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cli_console_method_entry) { diff --git a/ext/phalcon/cli/dispatcher.zep.c b/ext/phalcon/cli/dispatcher.zep.c index add1adc60eb..c7f8e607456 100644 --- a/ext/phalcon/cli/dispatcher.zep.c +++ b/ext/phalcon/cli/dispatcher.zep.c @@ -68,15 +68,18 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Dispatcher) { PHP_METHOD(Phalcon_Cli_Dispatcher, setTaskSuffix) { zval *taskSuffix_param = NULL; - zval *taskSuffix = NULL; + zval taskSuffix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&taskSuffix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &taskSuffix_param); - zephir_get_strval(taskSuffix, taskSuffix_param); + zephir_get_strval(&taskSuffix, taskSuffix_param); - zephir_update_property_this(getThis(), SL("_handlerSuffix"), taskSuffix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_handlerSuffix"), &taskSuffix); ZEPHIR_MM_RESTORE(); } @@ -87,15 +90,18 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, setTaskSuffix) { PHP_METHOD(Phalcon_Cli_Dispatcher, setDefaultTask) { zval *taskName_param = NULL; - zval *taskName = NULL; + zval taskName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&taskName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &taskName_param); - zephir_get_strval(taskName, taskName_param); + zephir_get_strval(&taskName, taskName_param); - zephir_update_property_this(getThis(), SL("_defaultHandler"), taskName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultHandler"), &taskName); ZEPHIR_MM_RESTORE(); } @@ -106,15 +112,18 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, setDefaultTask) { PHP_METHOD(Phalcon_Cli_Dispatcher, setTaskName) { zval *taskName_param = NULL; - zval *taskName = NULL; + zval taskName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&taskName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &taskName_param); - zephir_get_strval(taskName, taskName_param); + zephir_get_strval(&taskName, taskName_param); - zephir_update_property_this(getThis(), SL("_handlerName"), taskName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_handlerName"), &taskName); ZEPHIR_MM_RESTORE(); } @@ -124,7 +133,8 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, setTaskName) { */ PHP_METHOD(Phalcon_Cli_Dispatcher, getTaskName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_handlerName"); @@ -136,13 +146,19 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, getTaskName) { PHP_METHOD(Phalcon_Cli_Dispatcher, _throwDispatchException) { zend_long exceptionCode, ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *exceptionCode_param = NULL, *exception = NULL, *_0, *_1 = NULL; - zval *message = NULL; + zval *message_param = NULL, *exceptionCode_param = NULL, exception, _0, _1; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&exception); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &exceptionCode_param); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); if (!exceptionCode_param) { exceptionCode = 0; } else { @@ -150,18 +166,17 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, _throwDispatchException) { } - ZEPHIR_INIT_VAR(exception); - object_init_ex(exception, phalcon_cli_dispatcher_exception_ce); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, exceptionCode); - ZEPHIR_CALL_METHOD(NULL, exception, "__construct", NULL, 9, message, _0); + ZEPHIR_INIT_VAR(&exception); + object_init_ex(&exception, phalcon_cli_dispatcher_exception_ce); + ZVAL_LONG(&_0, exceptionCode); + ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 4, &message, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "_handleexception", NULL, 0, exception); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "_handleexception", NULL, 0, &exception); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1)) { RETURN_MM_BOOL(0); } - zephir_throw_exception_debug(exception, "phalcon/cli/dispatcher.zep", 106 TSRMLS_CC); + zephir_throw_exception_debug(&exception, "phalcon/cli/dispatcher.zep", 106 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -173,22 +188,28 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, _throwDispatchException) { PHP_METHOD(Phalcon_Cli_Dispatcher, _handleException) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *exception, *eventsManager = NULL, *_0, *_1$$3 = NULL, *_2$$3; + zval *exception, exception_sub, eventsManager, _0, _1$$3, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&exception_sub); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &exception); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "dispatch:beforeException", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$3, eventsManager, "fire", NULL, 0, _2$$3, this_ptr, exception); - zephir_check_temp_parameter(_2$$3); + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "dispatch:beforeException"); + ZEPHIR_CALL_METHOD(&_1$$3, &eventsManager, "fire", NULL, 0, &_2$$3, this_ptr, exception); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$3)) { RETURN_MM_BOOL(0); } } @@ -201,7 +222,8 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, _handleException) { */ PHP_METHOD(Phalcon_Cli_Dispatcher, getLastTask) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lastHandler"); @@ -212,7 +234,8 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, getLastTask) { */ PHP_METHOD(Phalcon_Cli_Dispatcher, getActiveTask) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_activeHandler"); @@ -224,15 +247,18 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, getActiveTask) { PHP_METHOD(Phalcon_Cli_Dispatcher, setOptions) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &options_param); - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &options); ZEPHIR_MM_RESTORE(); } @@ -242,7 +268,8 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, setOptions) { */ PHP_METHOD(Phalcon_Cli_Dispatcher, getOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -258,47 +285,60 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, getOptions) { PHP_METHOD(Phalcon_Cli_Dispatcher, getOption) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *option, *filters = NULL, *defaultValue = NULL, *options = NULL, *filter = NULL, *optionValue = NULL, *dependencyInjector = NULL, *_2 = NULL, *_3, *_0$$5, *_1$$5; + zval *option, option_sub, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, __$null, options, filter, optionValue, dependencyInjector, _2, _3, _0$$5, _1$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option_sub); + ZVAL_UNDEF(&filters_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&optionValue); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &option, &filters, &defaultValue); if (!filters) { - filters = ZEPHIR_GLOBAL(global_null); + filters = &filters_sub; + filters = &__$null; } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(optionValue); - if (!(zephir_array_isset_fetch(&optionValue, options, option, 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&optionValue); + if (!(zephir_array_isset_fetch(&optionValue, &options, option, 0 TSRMLS_CC))) { RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); } if (Z_TYPE_P(filters) == IS_NULL) { - RETURN_CCTOR(optionValue); + RETURN_CCTOR(&optionValue); } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$5); - ZVAL_STRING(_0$$5, "A dependency injection object is required to access the 'filter' service", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_LONG(_1$$5, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_throwdispatchexception", NULL, 0, _0$$5, _1$$5); - zephir_check_temp_parameter(_0$$5); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_0$$5); + ZVAL_STRING(&_0$$5, "A dependency injection object is required to access the 'filter' service"); + ZVAL_LONG(&_1$$5, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_throwdispatchexception", NULL, 0, &_0$$5, &_1$$5); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_3); - ZVAL_STRING(_3, "filter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, dependencyInjector, "getshared", NULL, 0, _3); - zephir_check_temp_parameter(_3); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "filter"); + ZEPHIR_CALL_METHOD(&_2, &dependencyInjector, "getshared", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(filter, _2); - ZEPHIR_RETURN_CALL_METHOD(filter, "sanitize", NULL, 0, optionValue, filters); + ZEPHIR_CPY_WRT(&filter, &_2); + ZEPHIR_RETURN_CALL_METHOD(&filter, "sanitize", NULL, 0, &optionValue, filters); zephir_check_call_status(); RETURN_MM(); @@ -309,14 +349,18 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, getOption) { */ PHP_METHOD(Phalcon_Cli_Dispatcher, hasOption) { - zval *option, *_0; + zval *option, option_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option_sub); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &option); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - RETURN_BOOL(zephir_array_isset(_0, option)); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_array_isset(&_0, option)); } @@ -326,72 +370,73 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, hasOption) { PHP_METHOD(Phalcon_Cli_Dispatcher, callActionMethod) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *params = NULL, *_0, *_1; - zval *actionMethod = NULL; - zval *handler, *actionMethod_param = NULL, *params_param = NULL, *options = NULL; + zval params, _0, _1; + zval actionMethod; + zval *handler, handler_sub, *actionMethod_param = NULL, *params_param = NULL, options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&actionMethod); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &handler, &actionMethod_param, ¶ms_param); - zephir_get_strval(actionMethod, actionMethod_param); + zephir_get_strval(&actionMethod, actionMethod_param); if (!params_param) { - ZEPHIR_INIT_VAR(params); - array_init(params); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); } else { - params = params_param; + ZEPHIR_OBS_COPY_OR_DUP(¶ms, params_param); } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_0, handler); - zephir_array_fast_append(_0, actionMethod); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_1, params); - zephir_array_fast_append(_1, options); - ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, _0, _1); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, handler); + zephir_array_fast_append(&_0, &actionMethod); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_1, ¶ms); + zephir_array_fast_append(&_1, &options); + ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0, &_1); zephir_check_call_status(); RETURN_MM(); } -zend_object_value zephir_init_properties_Phalcon_Cli_Dispatcher(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Cli_Dispatcher(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_2, *_1$$3, *_3$$4; + zval _0, _2, _1$$3, _3$$4; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_params"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_params"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("_options"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("_options"), &_3$$4); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/cli/dispatcher.zep.h b/ext/phalcon/cli/dispatcher.zep.h index c0540554f7a..c0920e0ec37 100644 --- a/ext/phalcon/cli/dispatcher.zep.h +++ b/ext/phalcon/cli/dispatcher.zep.h @@ -16,60 +16,116 @@ PHP_METHOD(Phalcon_Cli_Dispatcher, getOptions); PHP_METHOD(Phalcon_Cli_Dispatcher, getOption); PHP_METHOD(Phalcon_Cli_Dispatcher, hasOption); PHP_METHOD(Phalcon_Cli_Dispatcher, callActionMethod); -zend_object_value zephir_init_properties_Phalcon_Cli_Dispatcher(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Cli_Dispatcher(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcher_settasksuffix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, taskSuffix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, taskSuffix) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcher_setdefaulttask, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, taskName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, taskName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcher_settaskname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, taskName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, taskName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcher_gettaskname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcher_gettaskname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcher__throwdispatchexception, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, exceptionCode, IS_LONG, 0) +#else ZEND_ARG_INFO(0, exceptionCode) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcher__handleexception, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, exception, Exception, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_dispatcher_getlasttask, 0, 0, Phalcon\\Cli\\TaskInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcher_getlasttask, 0, 0, IS_OBJECT, "Phalcon\\Cli\\TaskInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_dispatcher_getactivetask, 0, 0, Phalcon\\Cli\\TaskInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcher_getactivetask, 0, 0, IS_OBJECT, "Phalcon\\Cli\\TaskInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcher_setoptions, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcher_getoptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcher_getoptions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcher_getoption, 0, 0, 1) ZEND_ARG_INFO(0, option) ZEND_ARG_INFO(0, filters) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcher_hasoption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcher_hasoption, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcher_hasoption, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, option) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcher_callactionmethod, 0, 0, 2) ZEND_ARG_INFO(0, handler) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionMethod, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionMethod) - ZEND_ARG_ARRAY_INFO(0, params, 1) +#endif + ZEND_ARG_ARRAY_INFO(0, params, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cli_dispatcher_method_entry) { PHP_ME(Phalcon_Cli_Dispatcher, setTaskSuffix, arginfo_phalcon_cli_dispatcher_settasksuffix, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Dispatcher, setDefaultTask, arginfo_phalcon_cli_dispatcher_setdefaulttask, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Dispatcher, setTaskName, arginfo_phalcon_cli_dispatcher_settaskname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Dispatcher, getTaskName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Dispatcher, getTaskName, arginfo_phalcon_cli_dispatcher_gettaskname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Dispatcher, _throwDispatchException, arginfo_phalcon_cli_dispatcher__throwdispatchexception, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Cli_Dispatcher, _handleException, arginfo_phalcon_cli_dispatcher__handleexception, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Cli_Dispatcher, getLastTask, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Dispatcher, getActiveTask, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Dispatcher, getLastTask, arginfo_phalcon_cli_dispatcher_getlasttask, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Dispatcher, getActiveTask, arginfo_phalcon_cli_dispatcher_getactivetask, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Dispatcher, setOptions, arginfo_phalcon_cli_dispatcher_setoptions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Dispatcher, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Dispatcher, getOptions, arginfo_phalcon_cli_dispatcher_getoptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Dispatcher, getOption, arginfo_phalcon_cli_dispatcher_getoption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Dispatcher, hasOption, arginfo_phalcon_cli_dispatcher_hasoption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Dispatcher, callActionMethod, arginfo_phalcon_cli_dispatcher_callactionmethod, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/cli/dispatcherinterface.zep.h b/ext/phalcon/cli/dispatcherinterface.zep.h index f21a10f44af..a9c2448b120 100644 --- a/ext/phalcon/cli/dispatcherinterface.zep.h +++ b/ext/phalcon/cli/dispatcherinterface.zep.h @@ -4,23 +4,56 @@ extern zend_class_entry *phalcon_cli_dispatcherinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Cli_DispatcherInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcherinterface_settasksuffix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, taskSuffix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, taskSuffix) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcherinterface_setdefaulttask, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, taskName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, taskName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_dispatcherinterface_settaskname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, taskName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, taskName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcherinterface_gettaskname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcherinterface_gettaskname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_dispatcherinterface_getlasttask, 0, 0, Phalcon\\Cli\\TaskInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcherinterface_getlasttask, 0, 0, IS_OBJECT, "Phalcon\\Cli\\TaskInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_dispatcherinterface_getactivetask, 0, 0, Phalcon\\Cli\\TaskInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_dispatcherinterface_getactivetask, 0, 0, IS_OBJECT, "Phalcon\\Cli\\TaskInterface", 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cli_dispatcherinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Cli_DispatcherInterface, setTaskSuffix, arginfo_phalcon_cli_dispatcherinterface_settasksuffix) PHP_ABSTRACT_ME(Phalcon_Cli_DispatcherInterface, setDefaultTask, arginfo_phalcon_cli_dispatcherinterface_setdefaulttask) PHP_ABSTRACT_ME(Phalcon_Cli_DispatcherInterface, setTaskName, arginfo_phalcon_cli_dispatcherinterface_settaskname) - PHP_ABSTRACT_ME(Phalcon_Cli_DispatcherInterface, getTaskName, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_DispatcherInterface, getLastTask, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_DispatcherInterface, getActiveTask, NULL) + PHP_ABSTRACT_ME(Phalcon_Cli_DispatcherInterface, getTaskName, arginfo_phalcon_cli_dispatcherinterface_gettaskname) + PHP_ABSTRACT_ME(Phalcon_Cli_DispatcherInterface, getLastTask, arginfo_phalcon_cli_dispatcherinterface_getlasttask) + PHP_ABSTRACT_ME(Phalcon_Cli_DispatcherInterface, getActiveTask, arginfo_phalcon_cli_dispatcherinterface_getactivetask) PHP_FE_END }; diff --git a/ext/phalcon/cli/router.zep.c b/ext/phalcon/cli/router.zep.c index b09b22b682a..c08b83cf69b 100644 --- a/ext/phalcon/cli/router.zep.c +++ b/ext/phalcon/cli/router.zep.c @@ -86,10 +86,18 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Router) { */ PHP_METHOD(Phalcon_Cli_Router, __construct) { - zval *_1$$3, *_3$$3; + zval _1$$3, _3$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *defaultRoutes_param = NULL, *routes = NULL, *_0$$3, *_2$$3 = NULL, *_4$$3; + zval *defaultRoutes_param = NULL, routes, _0$$3, _2$$3, _4$$3; zend_bool defaultRoutes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routes); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &defaultRoutes_param); @@ -101,35 +109,33 @@ PHP_METHOD(Phalcon_Cli_Router, __construct) { } - ZEPHIR_INIT_VAR(routes); - array_init(routes); + ZEPHIR_INIT_VAR(&routes); + array_init(&routes); if (defaultRoutes == 1) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_cli_router_route_ce); - ZEPHIR_INIT_VAR(_1$$3); - zephir_create_array(_1$$3, 1, 0 TSRMLS_CC); - add_assoc_long_ex(_1$$3, SS("task"), 1); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "#^(?::delimiter)?([a-zA-Z0-9\\_\\-]+)[:delimiter]{0,1}$#", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 145, _2$$3, _1$$3); - zephir_check_temp_parameter(_2$$3); + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_cli_router_route_ce); + ZEPHIR_INIT_VAR(&_1$$3); + zephir_create_array(&_1$$3, 1, 0 TSRMLS_CC); + add_assoc_long_ex(&_1$$3, SL("task"), 1); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "#^(?::delimiter)?([a-zA-Z0-9\\_\\-]+)[:delimiter]{0,1}$#"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 125, &_2$$3, &_1$$3); zephir_check_call_status(); - zephir_array_append(&routes, _0$$3, PH_SEPARATE, "phalcon/cli/router.zep", 93); - ZEPHIR_INIT_NVAR(_2$$3); - object_init_ex(_2$$3, phalcon_cli_router_route_ce); - ZEPHIR_INIT_VAR(_3$$3); - zephir_create_array(_3$$3, 3, 0 TSRMLS_CC); - add_assoc_long_ex(_3$$3, SS("task"), 1); - add_assoc_long_ex(_3$$3, SS("action"), 2); - add_assoc_long_ex(_3$$3, SS("params"), 3); - ZEPHIR_INIT_VAR(_4$$3); - ZVAL_STRING(_4$$3, "#^(?::delimiter)?([a-zA-Z0-9\\_\\-]+):delimiter([a-zA-Z0-9\\.\\_]+)(:delimiter.*)*$#", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _2$$3, "__construct", NULL, 145, _4$$3, _3$$3); - zephir_check_temp_parameter(_4$$3); + zephir_array_append(&routes, &_0$$3, PH_SEPARATE, "phalcon/cli/router.zep", 93); + ZEPHIR_INIT_NVAR(&_2$$3); + object_init_ex(&_2$$3, phalcon_cli_router_route_ce); + ZEPHIR_INIT_VAR(&_3$$3); + zephir_create_array(&_3$$3, 3, 0 TSRMLS_CC); + add_assoc_long_ex(&_3$$3, SL("task"), 1); + add_assoc_long_ex(&_3$$3, SL("action"), 2); + add_assoc_long_ex(&_3$$3, SL("params"), 3); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "#^(?::delimiter)?([a-zA-Z0-9\\_\\-]+):delimiter([a-zA-Z0-9\\.\\_]+)(:delimiter.*)*$#"); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 125, &_4$$3, &_3$$3); zephir_check_call_status(); - zephir_array_append(&routes, _2$$3, PH_SEPARATE, "phalcon/cli/router.zep", 99); + zephir_array_append(&routes, &_2$$3, PH_SEPARATE, "phalcon/cli/router.zep", 99); } - zephir_update_property_this(getThis(), SL("_routes"), routes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_routes"), &routes); ZEPHIR_MM_RESTORE(); } @@ -139,13 +145,16 @@ PHP_METHOD(Phalcon_Cli_Router, __construct) { */ PHP_METHOD(Phalcon_Cli_Router, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -154,7 +163,8 @@ PHP_METHOD(Phalcon_Cli_Router, setDI) { */ PHP_METHOD(Phalcon_Cli_Router, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -166,15 +176,18 @@ PHP_METHOD(Phalcon_Cli_Router, getDI) { PHP_METHOD(Phalcon_Cli_Router, setDefaultModule) { zval *moduleName_param = NULL; - zval *moduleName = NULL; + zval moduleName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&moduleName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &moduleName_param); - zephir_get_strval(moduleName, moduleName_param); + zephir_get_strval(&moduleName, moduleName_param); - zephir_update_property_this(getThis(), SL("_defaultModule"), moduleName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultModule"), &moduleName); ZEPHIR_MM_RESTORE(); } @@ -185,15 +198,18 @@ PHP_METHOD(Phalcon_Cli_Router, setDefaultModule) { PHP_METHOD(Phalcon_Cli_Router, setDefaultTask) { zval *taskName_param = NULL; - zval *taskName = NULL; + zval taskName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&taskName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &taskName_param); - zephir_get_strval(taskName, taskName_param); + zephir_get_strval(&taskName, taskName_param); - zephir_update_property_this(getThis(), SL("_defaultTask"), taskName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultTask"), &taskName); ZEPHIR_MM_RESTORE(); } @@ -204,15 +220,18 @@ PHP_METHOD(Phalcon_Cli_Router, setDefaultTask) { PHP_METHOD(Phalcon_Cli_Router, setDefaultAction) { zval *actionName_param = NULL; - zval *actionName = NULL; + zval actionName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&actionName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &actionName_param); - zephir_get_strval(actionName, actionName_param); + zephir_get_strval(&actionName, actionName_param); - zephir_update_property_this(getThis(), SL("_defaultAction"), actionName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultAction"), &actionName); ZEPHIR_MM_RESTORE(); } @@ -232,27 +251,35 @@ PHP_METHOD(Phalcon_Cli_Router, setDefaultAction) { */ PHP_METHOD(Phalcon_Cli_Router, setDefaults) { - zval *defaults_param = NULL, *module = NULL, *task = NULL, *action = NULL, *params = NULL; - zval *defaults = NULL; + zval *defaults_param = NULL, module, task, action, params; + zval defaults; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &defaults_param); + ZVAL_UNDEF(&defaults); + ZVAL_UNDEF(&module); + ZVAL_UNDEF(&task); + ZVAL_UNDEF(&action); + ZVAL_UNDEF(¶ms); + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &defaults_param); - defaults = defaults_param; + ZEPHIR_OBS_COPY_OR_DUP(&defaults, defaults_param); - if (zephir_array_isset_string_fetch(&module, defaults, SS("module"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_defaultModule"), module TSRMLS_CC); + if (zephir_array_isset_string_fetch(&module, &defaults, SL("module"), 1)) { + zephir_update_property_zval(this_ptr, SL("_defaultModule"), &module); } - if (zephir_array_isset_string_fetch(&task, defaults, SS("task"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_defaultTask"), task TSRMLS_CC); + if (zephir_array_isset_string_fetch(&task, &defaults, SL("task"), 1)) { + zephir_update_property_zval(this_ptr, SL("_defaultTask"), &task); } - if (zephir_array_isset_string_fetch(&action, defaults, SS("action"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_defaultAction"), action TSRMLS_CC); + if (zephir_array_isset_string_fetch(&action, &defaults, SL("action"), 1)) { + zephir_update_property_zval(this_ptr, SL("_defaultAction"), &action); } - if (zephir_array_isset_string_fetch(¶ms, defaults, SS("params"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_defaultParams"), params TSRMLS_CC); + if (zephir_array_isset_string_fetch(¶ms, &defaults, SL("params"), 1)) { + zephir_update_property_zval(this_ptr, SL("_defaultParams"), ¶ms); } - RETURN_THISW(); + RETURN_THIS(); } @@ -263,37 +290,75 @@ PHP_METHOD(Phalcon_Cli_Router, setDefaults) { */ PHP_METHOD(Phalcon_Cli_Router, handle) { - zval *_17$$30 = NULL; - zval *_5$$9 = NULL, *_10$$16 = NULL, *_12$$19 = NULL; - HashTable *_3$$3, *_7$$12; - HashPosition _2$$3, _6$$12; + zval _15$$30; + zend_string *_6$$12; + zend_ulong _5$$12; + zval _3$$9, _8$$16, _10$$19; zend_bool _0$$3; - zephir_fcall_cache_entry *_20 = NULL; + zephir_fcall_cache_entry *_18 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *arguments = NULL, *moduleName = NULL, *taskName = NULL, *actionName = NULL, *params = NULL, *route = NULL, *parts = NULL, *pattern = NULL, *routeFound = NULL, *matches = NULL, *paths = NULL, *beforeMatch = NULL, *converters = NULL, *converter = NULL, *part = NULL, *position = NULL, *matchPosition = NULL, *strParams = NULL, *_1$$3, **_4$$3, **_8$$12, *_9$$16 = NULL, *_11$$19 = NULL, *_13$$21, *_14$$21, *_15$$21, *_16$$21, _18$$30, *_19$$31 = NULL, *_21$$33; + zval *arguments = NULL, arguments_sub, __$true, __$false, __$null, moduleName, taskName, actionName, params, route, parts, pattern, routeFound, matches, paths, beforeMatch, converters, converter, part, position, matchPosition, strParams, _1$$3, *_2$$3, *_4$$12, _7$$16, _9$$19, _11$$21, _12$$21, _13$$21, _14$$21, _16$$30, _17$$31, _19$$33; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&arguments_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&moduleName); + ZVAL_UNDEF(&taskName); + ZVAL_UNDEF(&actionName); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&parts); + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&routeFound); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&paths); + ZVAL_UNDEF(&beforeMatch); + ZVAL_UNDEF(&converters); + ZVAL_UNDEF(&converter); + ZVAL_UNDEF(&part); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&matchPosition); + ZVAL_UNDEF(&strParams); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_7$$16); + ZVAL_UNDEF(&_9$$19); + ZVAL_UNDEF(&_11$$21); + ZVAL_UNDEF(&_12$$21); + ZVAL_UNDEF(&_13$$21); + ZVAL_UNDEF(&_14$$21); + ZVAL_UNDEF(&_16$$30); + ZVAL_UNDEF(&_17$$31); + ZVAL_UNDEF(&_19$$33); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_8$$16); + ZVAL_UNDEF(&_10$$19); + ZVAL_UNDEF(&_15$$30); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &arguments); if (!arguments) { - arguments = ZEPHIR_GLOBAL(global_null); + arguments = &arguments_sub; + arguments = &__$null; } - ZEPHIR_INIT_VAR(routeFound); - ZVAL_BOOL(routeFound, 0); - ZEPHIR_INIT_VAR(parts); - array_init(parts); - ZEPHIR_INIT_VAR(params); - array_init(params); - ZEPHIR_INIT_VAR(matches); - ZVAL_NULL(matches); + ZEPHIR_INIT_VAR(&routeFound); + ZVAL_BOOL(&routeFound, 0); + ZEPHIR_INIT_VAR(&parts); + array_init(&parts); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); + ZEPHIR_INIT_VAR(&matches); + ZVAL_NULL(&matches); if (0) { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$false); } - zephir_update_property_this(getThis(), SL("_matchedRoute"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_matchedRoute"), &__$null); if (Z_TYPE_P(arguments) != IS_ARRAY) { _0$$3 = Z_TYPE_P(arguments) != IS_STRING; if (_0$$3) { @@ -303,174 +368,179 @@ PHP_METHOD(Phalcon_Cli_Router, handle) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cli_router_exception_ce, "Arguments must be an array or string", "phalcon/cli/router.zep", 207); return; } - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); - zephir_is_iterable(_1$$3, &_3$$3, &_2$$3, 0, 1, "phalcon/cli/router.zep", 307); - for ( - ; zend_hash_get_current_data_ex(_3$$3, (void**) &_4$$3, &_2$$3) == SUCCESS - ; zend_hash_move_backwards_ex(_3$$3, &_2$$3) - ) { - ZEPHIR_GET_HVALUE(route, _4$$3); - ZEPHIR_CALL_METHOD(&pattern, route, "getcompiledpattern", NULL, 0); + zephir_read_property(&_1$$3, this_ptr, SL("_routes"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_1$$3, 0, "phalcon/cli/router.zep", 307); + ZEND_HASH_REVERSE_FOREACH_VAL(Z_ARRVAL_P(&_1$$3), _2$$3) + { + ZEPHIR_INIT_NVAR(&route); + ZVAL_COPY(&route, _2$$3); + ZEPHIR_CALL_METHOD(&pattern, &route, "getcompiledpattern", NULL, 0); zephir_check_call_status(); - if (zephir_memnstr_str(pattern, SL("^"), "phalcon/cli/router.zep", 217)) { - ZEPHIR_INIT_NVAR(routeFound); - zephir_preg_match(routeFound, pattern, arguments, matches, 0, 0 , 0 TSRMLS_CC); + if (zephir_memnstr_str(&pattern, SL("^"), "phalcon/cli/router.zep", 217)) { + ZEPHIR_INIT_NVAR(&routeFound); + zephir_preg_match(&routeFound, &pattern, arguments, &matches, 0, 0 , 0 TSRMLS_CC); } else { - ZEPHIR_INIT_NVAR(routeFound); - ZVAL_BOOL(routeFound, ZEPHIR_IS_EQUAL(pattern, arguments)); + ZEPHIR_INIT_NVAR(&routeFound); + ZVAL_BOOL(&routeFound, ZEPHIR_IS_EQUAL(&pattern, arguments)); } - if (zephir_is_true(routeFound)) { - ZEPHIR_CALL_METHOD(&beforeMatch, route, "getbeforematch", NULL, 0); + if (zephir_is_true(&routeFound)) { + ZEPHIR_CALL_METHOD(&beforeMatch, &route, "getbeforematch", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(beforeMatch) != IS_NULL) { - if (!(zephir_is_callable(beforeMatch TSRMLS_CC))) { + if (Z_TYPE_P(&beforeMatch) != IS_NULL) { + if (!(zephir_is_callable(&beforeMatch TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cli_router_exception_ce, "Before-Match callback is not callable in matched route", "phalcon/cli/router.zep", 235); return; } - ZEPHIR_INIT_NVAR(_5$$9); - zephir_create_array(_5$$9, 3, 0 TSRMLS_CC); - zephir_array_fast_append(_5$$9, arguments); - zephir_array_fast_append(_5$$9, route); - zephir_array_fast_append(_5$$9, this_ptr); - ZEPHIR_INIT_NVAR(routeFound); - ZEPHIR_CALL_USER_FUNC_ARRAY(routeFound, beforeMatch, _5$$9); + ZEPHIR_INIT_NVAR(&_3$$9); + zephir_create_array(&_3$$9, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&_3$$9, arguments); + zephir_array_fast_append(&_3$$9, &route); + zephir_array_fast_append(&_3$$9, this_ptr); + ZEPHIR_INIT_NVAR(&routeFound); + ZEPHIR_CALL_USER_FUNC_ARRAY(&routeFound, &beforeMatch, &_3$$9); zephir_check_call_status(); } } - if (zephir_is_true(routeFound)) { - ZEPHIR_CALL_METHOD(&paths, route, "getpaths", NULL, 0); + if (zephir_is_true(&routeFound)) { + ZEPHIR_CALL_METHOD(&paths, &route, "getpaths", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(parts, paths); - if (Z_TYPE_P(matches) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&converters, route, "getconverters", NULL, 0); + ZEPHIR_CPY_WRT(&parts, &paths); + if (Z_TYPE_P(&matches) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(&converters, &route, "getconverters", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(paths, &_7$$12, &_6$$12, 0, 0, "phalcon/cli/router.zep", 296); - for ( - ; zend_hash_get_current_data_ex(_7$$12, (void**) &_8$$12, &_6$$12) == SUCCESS - ; zend_hash_move_forward_ex(_7$$12, &_6$$12) - ) { - ZEPHIR_GET_HMKEY(part, _7$$12, _6$$12); - ZEPHIR_GET_HVALUE(position, _8$$12); - ZEPHIR_OBS_NVAR(matchPosition); - if (zephir_array_isset_fetch(&matchPosition, matches, position, 0 TSRMLS_CC)) { - if (Z_TYPE_P(converters) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(converter); - if (zephir_array_isset_fetch(&converter, converters, part, 0 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_9$$16); - ZEPHIR_INIT_NVAR(_10$$16); - zephir_create_array(_10$$16, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_10$$16, matchPosition); - ZEPHIR_CALL_USER_FUNC_ARRAY(_9$$16, converter, _10$$16); + zephir_is_iterable(&paths, 0, "phalcon/cli/router.zep", 296); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&paths), _5$$12, _6$$12, _4$$12) + { + ZEPHIR_INIT_NVAR(&part); + if (_6$$12 != NULL) { + ZVAL_STR_COPY(&part, _6$$12); + } else { + ZVAL_LONG(&part, _5$$12); + } + ZEPHIR_INIT_NVAR(&position); + ZVAL_COPY(&position, _4$$12); + ZEPHIR_OBS_NVAR(&matchPosition); + if (zephir_array_isset_fetch(&matchPosition, &matches, &position, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&converters) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&converter); + if (zephir_array_isset_fetch(&converter, &converters, &part, 0 TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_7$$16); + ZEPHIR_INIT_NVAR(&_8$$16); + zephir_create_array(&_8$$16, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_8$$16, &matchPosition); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_7$$16, &converter, &_8$$16); zephir_check_call_status(); - zephir_array_update_zval(&parts, part, &_9$$16, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&parts, &part, &_7$$16, PH_COPY | PH_SEPARATE); continue; } } - zephir_array_update_zval(&parts, part, &matchPosition, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&parts, &part, &matchPosition, PH_COPY | PH_SEPARATE); } else { - if (Z_TYPE_P(converters) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(converter); - if (zephir_array_isset_fetch(&converter, converters, part, 0 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_11$$19); - ZEPHIR_INIT_NVAR(_12$$19); - zephir_create_array(_12$$19, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_12$$19, position); - ZEPHIR_CALL_USER_FUNC_ARRAY(_11$$19, converter, _12$$19); + if (Z_TYPE_P(&converters) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&converter); + if (zephir_array_isset_fetch(&converter, &converters, &part, 0 TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_9$$19); + ZEPHIR_INIT_NVAR(&_10$$19); + zephir_create_array(&_10$$19, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_10$$19, &position); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_9$$19, &converter, &_10$$19); zephir_check_call_status(); - zephir_array_update_zval(&parts, part, &_11$$19, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&parts, &part, &_9$$19, PH_COPY | PH_SEPARATE); } } } - } - zephir_update_property_this(getThis(), SL("_matches"), matches TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&position); + ZEPHIR_INIT_NVAR(&part); + zephir_update_property_zval(this_ptr, SL("_matches"), &matches); } - zephir_update_property_this(getThis(), SL("_matchedRoute"), route TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_matchedRoute"), &route); break; } - } - if (zephir_is_true(routeFound)) { + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&route); + if (zephir_is_true(&routeFound)) { if (1) { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$false); } } else { if (0) { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$false); } - _13$$21 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultModule"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_module"), _13$$21 TSRMLS_CC); - _14$$21 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultTask"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_task"), _14$$21 TSRMLS_CC); - _15$$21 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultAction"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_action"), _15$$21 TSRMLS_CC); - _16$$21 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultParams"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_params"), _16$$21 TSRMLS_CC); + zephir_read_property(&_11$$21, this_ptr, SL("_defaultModule"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_module"), &_11$$21); + zephir_read_property(&_12$$21, this_ptr, SL("_defaultTask"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_task"), &_12$$21); + zephir_read_property(&_13$$21, this_ptr, SL("_defaultAction"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_action"), &_13$$21); + zephir_read_property(&_14$$21, this_ptr, SL("_defaultParams"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_params"), &_14$$21); RETURN_THIS(); } } else { - ZEPHIR_CPY_WRT(parts, arguments); + ZEPHIR_CPY_WRT(&parts, arguments); } - ZEPHIR_INIT_VAR(moduleName); - ZVAL_NULL(moduleName); - ZEPHIR_INIT_VAR(taskName); - ZVAL_NULL(taskName); - ZEPHIR_INIT_VAR(actionName); - ZVAL_NULL(actionName); - ZEPHIR_OBS_NVAR(moduleName); - if (zephir_array_isset_string_fetch(&moduleName, parts, SS("module"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&parts, SS("module"), PH_SEPARATE); + ZEPHIR_INIT_VAR(&moduleName); + ZVAL_NULL(&moduleName); + ZEPHIR_INIT_VAR(&taskName); + ZVAL_NULL(&taskName); + ZEPHIR_INIT_VAR(&actionName); + ZVAL_NULL(&actionName); + ZEPHIR_OBS_NVAR(&moduleName); + if (zephir_array_isset_string_fetch(&moduleName, &parts, SL("module"), 0)) { + zephir_array_unset_string(&parts, SL("module"), PH_SEPARATE); } else { - ZEPHIR_OBS_NVAR(moduleName); - zephir_read_property_this(&moduleName, this_ptr, SL("_defaultModule"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&moduleName); + zephir_read_property(&moduleName, this_ptr, SL("_defaultModule"), PH_NOISY_CC); } - ZEPHIR_OBS_NVAR(taskName); - if (zephir_array_isset_string_fetch(&taskName, parts, SS("task"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&parts, SS("task"), PH_SEPARATE); + ZEPHIR_OBS_NVAR(&taskName); + if (zephir_array_isset_string_fetch(&taskName, &parts, SL("task"), 0)) { + zephir_array_unset_string(&parts, SL("task"), PH_SEPARATE); } else { - ZEPHIR_OBS_NVAR(taskName); - zephir_read_property_this(&taskName, this_ptr, SL("_defaultTask"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&taskName); + zephir_read_property(&taskName, this_ptr, SL("_defaultTask"), PH_NOISY_CC); } - ZEPHIR_OBS_NVAR(actionName); - if (zephir_array_isset_string_fetch(&actionName, parts, SS("action"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&parts, SS("action"), PH_SEPARATE); + ZEPHIR_OBS_NVAR(&actionName); + if (zephir_array_isset_string_fetch(&actionName, &parts, SL("action"), 0)) { + zephir_array_unset_string(&parts, SL("action"), PH_SEPARATE); } else { - ZEPHIR_OBS_NVAR(actionName); - zephir_read_property_this(&actionName, this_ptr, SL("_defaultAction"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&actionName); + zephir_read_property(&actionName, this_ptr, SL("_defaultAction"), PH_NOISY_CC); } - ZEPHIR_OBS_NVAR(params); - if (zephir_array_isset_string_fetch(¶ms, parts, SS("params"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(params) != IS_ARRAY) { - zephir_get_strval(_17$$30, params); - ZEPHIR_SINIT_VAR(_18$$30); - ZVAL_LONG(&_18$$30, 1); - ZEPHIR_INIT_VAR(strParams); - zephir_substr(strParams, _17$$30, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - if (zephir_is_true(strParams)) { - ZEPHIR_CALL_CE_STATIC(&_19$$31, phalcon_cli_router_route_ce, "getdelimiter", &_20, 144); + ZEPHIR_OBS_NVAR(¶ms); + if (zephir_array_isset_string_fetch(¶ms, &parts, SL("params"), 0)) { + if (Z_TYPE_P(¶ms) != IS_ARRAY) { + zephir_get_strval(&_15$$30, ¶ms); + ZVAL_LONG(&_16$$30, 1); + ZEPHIR_INIT_VAR(&strParams); + zephir_substr(&strParams, &_15$$30, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + if (zephir_is_true(&strParams)) { + ZEPHIR_CALL_CE_STATIC(&_17$$31, phalcon_cli_router_route_ce, "getdelimiter", &_18, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(params); - zephir_fast_explode(params, _19$$31, strParams, LONG_MAX TSRMLS_CC); + ZEPHIR_INIT_NVAR(¶ms); + zephir_fast_explode(¶ms, &_17$$31, &strParams, LONG_MAX TSRMLS_CC); } else { - ZEPHIR_INIT_NVAR(params); - array_init(params); + ZEPHIR_INIT_NVAR(¶ms); + array_init(¶ms); } } - zephir_array_unset_string(&parts, SS("params"), PH_SEPARATE); + zephir_array_unset_string(&parts, SL("params"), PH_SEPARATE); } - if (zephir_fast_count_int(params TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_21$$33); - zephir_fast_array_merge(_21$$33, &(params), &(parts) TSRMLS_CC); - ZEPHIR_CPY_WRT(params, _21$$33); + if (zephir_fast_count_int(¶ms TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_19$$33); + zephir_fast_array_merge(&_19$$33, ¶ms, &parts TSRMLS_CC); + ZEPHIR_CPY_WRT(¶ms, &_19$$33); } else { - ZEPHIR_CPY_WRT(params, parts); + ZEPHIR_CPY_WRT(¶ms, &parts); } - zephir_update_property_this(getThis(), SL("_module"), moduleName TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_task"), taskName TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_action"), actionName TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_params"), params TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_module"), &moduleName); + zephir_update_property_zval(this_ptr, SL("_task"), &taskName); + zephir_update_property_zval(this_ptr, SL("_action"), &actionName); + zephir_update_property_zval(this_ptr, SL("_params"), ¶ms); ZEPHIR_MM_RESTORE(); } @@ -489,33 +559,40 @@ PHP_METHOD(Phalcon_Cli_Router, handle) { PHP_METHOD(Phalcon_Cli_Router, add) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *route = NULL; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, route; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&route); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } - ZEPHIR_INIT_VAR(route); - object_init_ex(route, phalcon_cli_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, route, "__construct", NULL, 145, pattern, paths); + ZEPHIR_INIT_VAR(&route); + object_init_ex(&route, phalcon_cli_router_route_ce); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 125, &pattern, paths); zephir_check_call_status(); - zephir_update_property_array_append(this_ptr, SL("_routes"), route TSRMLS_CC); - RETURN_CCTOR(route); + zephir_update_property_array_append(this_ptr, SL("_routes"), &route TSRMLS_CC); + RETURN_CCTOR(&route); } @@ -524,7 +601,8 @@ PHP_METHOD(Phalcon_Cli_Router, add) { */ PHP_METHOD(Phalcon_Cli_Router, getModuleName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_module"); @@ -535,7 +613,8 @@ PHP_METHOD(Phalcon_Cli_Router, getModuleName) { */ PHP_METHOD(Phalcon_Cli_Router, getTaskName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_task"); @@ -546,7 +625,8 @@ PHP_METHOD(Phalcon_Cli_Router, getTaskName) { */ PHP_METHOD(Phalcon_Cli_Router, getActionName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_action"); @@ -559,7 +639,8 @@ PHP_METHOD(Phalcon_Cli_Router, getActionName) { */ PHP_METHOD(Phalcon_Cli_Router, getParams) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_params"); @@ -570,7 +651,8 @@ PHP_METHOD(Phalcon_Cli_Router, getParams) { */ PHP_METHOD(Phalcon_Cli_Router, getMatchedRoute) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_matchedRoute"); @@ -583,7 +665,8 @@ PHP_METHOD(Phalcon_Cli_Router, getMatchedRoute) { */ PHP_METHOD(Phalcon_Cli_Router, getMatches) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_matches"); @@ -594,7 +677,8 @@ PHP_METHOD(Phalcon_Cli_Router, getMatches) { */ PHP_METHOD(Phalcon_Cli_Router, wasMatched) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_wasMatched"); @@ -605,7 +689,8 @@ PHP_METHOD(Phalcon_Cli_Router, wasMatched) { */ PHP_METHOD(Phalcon_Cli_Router, getRoutes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_routes"); @@ -619,29 +704,33 @@ PHP_METHOD(Phalcon_Cli_Router, getRoutes) { */ PHP_METHOD(Phalcon_Cli_Router, getRouteById) { - HashTable *_2; - HashPosition _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, *route = NULL, *_0, **_3, *_4$$3 = NULL; + zval *id, id_sub, route, _0, *_1, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &id); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/cli/router.zep", 485); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(route, _3); - ZEPHIR_CALL_METHOD(&_4$$3, route, "getrouteid", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_routes"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/cli/router.zep", 485); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&route); + ZVAL_COPY(&route, _1); + ZEPHIR_CALL_METHOD(&_2$$3, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EQUAL(_4$$3, id)) { - RETURN_CCTOR(route); + if (ZEPHIR_IS_EQUAL(&_2$$3, id)) { + RETURN_CCTOR(&route); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&route); RETURN_MM_BOOL(0); } @@ -651,78 +740,75 @@ PHP_METHOD(Phalcon_Cli_Router, getRouteById) { */ PHP_METHOD(Phalcon_Cli_Router, getRouteByName) { - HashTable *_2; - HashPosition _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *route = NULL, *_0, **_3, *_4$$3 = NULL; - zval *name = NULL; + zval *name_param = NULL, route, _0, *_1, _2$$3; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/cli/router.zep", 500); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(route, _3); - ZEPHIR_CALL_METHOD(&_4$$3, route, "getname", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_routes"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/cli/router.zep", 500); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&route); + ZVAL_COPY(&route, _1); + ZEPHIR_CALL_METHOD(&_2$$3, &route, "getname", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EQUAL(_4$$3, name)) { - RETURN_CCTOR(route); + if (ZEPHIR_IS_EQUAL(&_2$$3, &name)) { + RETURN_CCTOR(&route); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&route); RETURN_MM_BOOL(0); } -zend_object_value zephir_init_properties_Phalcon_Cli_Router(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Cli_Router(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_2, *_1$$3, *_3$$4; + zval _0, _2, _1$$3, _3$$4; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultParams"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_defaultParams"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_defaultParams"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_defaultParams"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("_params"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("_params"), &_3$$4); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/cli/router.zep.h b/ext/phalcon/cli/router.zep.h index 69499593f03..7aa30d8b4ca 100644 --- a/ext/phalcon/cli/router.zep.h +++ b/ext/phalcon/cli/router.zep.h @@ -22,29 +22,56 @@ PHP_METHOD(Phalcon_Cli_Router, wasMatched); PHP_METHOD(Phalcon_Cli_Router, getRoutes); PHP_METHOD(Phalcon_Cli_Router, getRouteById); PHP_METHOD(Phalcon_Cli_Router, getRouteByName); -zend_object_value zephir_init_properties_Phalcon_Cli_Router(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Cli_Router(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router___construct, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultRoutes, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, defaultRoutes) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_router_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_setdefaultmodule, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, moduleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, moduleName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_setdefaulttask, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, taskName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, taskName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_setdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_setdefaults, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_router_setdefaults, 0, 1, Phalcon\\Cli\\Router, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_setdefaults, 0, 1, IS_OBJECT, "Phalcon\\Cli\\Router", 0) +#endif ZEND_ARG_ARRAY_INFO(0, defaults, 0) ZEND_END_ARG_INFO() @@ -52,37 +79,91 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_handle, 0, 0, 0) ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_add, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_router_add, 0, 1, Phalcon\\Cli\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_add, 0, 1, IS_OBJECT, "Phalcon\\Cli\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_getmodulename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_getmodulename, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_gettaskname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_gettaskname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_getactionname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_getactionname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_router_getmatchedroute, 0, 0, Phalcon\\Cli\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_getmatchedroute, 0, 0, IS_OBJECT, "Phalcon\\Cli\\RouteInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_wasmatched, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_wasmatched, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_router_getroutes, 0, 0, Phalcon\\Cli\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_getroutes, 0, 0, IS_OBJECT, "Phalcon\\Cli\\Router\\Route", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_getroutebyid, 0, 0, 1) ZEND_ARG_INFO(0, id) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_getroutebyname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cli_router_method_entry) { PHP_ME(Phalcon_Cli_Router, __construct, arginfo_phalcon_cli_router___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Cli_Router, setDI, arginfo_phalcon_cli_router_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router, getDI, arginfo_phalcon_cli_router_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, setDefaultModule, arginfo_phalcon_cli_router_setdefaultmodule, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, setDefaultTask, arginfo_phalcon_cli_router_setdefaulttask, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, setDefaultAction, arginfo_phalcon_cli_router_setdefaultaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, setDefaults, arginfo_phalcon_cli_router_setdefaults, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, handle, arginfo_phalcon_cli_router_handle, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, add, arginfo_phalcon_cli_router_add, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router, getModuleName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router, getTaskName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router, getActionName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router, getModuleName, arginfo_phalcon_cli_router_getmodulename, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router, getTaskName, arginfo_phalcon_cli_router_gettaskname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router, getActionName, arginfo_phalcon_cli_router_getactionname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, getParams, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router, getMatchedRoute, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router, getMatchedRoute, arginfo_phalcon_cli_router_getmatchedroute, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, getMatches, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router, wasMatched, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router, getRoutes, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router, wasMatched, arginfo_phalcon_cli_router_wasmatched, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router, getRoutes, arginfo_phalcon_cli_router_getroutes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, getRouteById, arginfo_phalcon_cli_router_getroutebyid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router, getRouteByName, arginfo_phalcon_cli_router_getroutebyname, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/cli/router/route.zep.c b/ext/phalcon/cli/router/route.zep.c index 2f29f799cdf..8da074f22d7 100644 --- a/ext/phalcon/cli/router/route.zep.c +++ b/ext/phalcon/cli/router/route.zep.c @@ -53,7 +53,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Router_Route) { zend_declare_property_null(phalcon_cli_router_route_ce, SL("_delimiterPath"), ZEND_ACC_PROTECTED|ZEND_ACC_STATIC TSRMLS_CC); - zend_declare_class_constant_string(phalcon_cli_router_route_ce, SL("DEFAULT_DELIMITER"), " " TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_cli_router_route_ce, SL("DEFAULT_DELIMITER"), " "); return SUCCESS; @@ -68,47 +68,57 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Router_Route) { PHP_METHOD(Phalcon_Cli_Router_Route, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *routeId = NULL, *uniqueId = NULL, *delimiter = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, routeId, uniqueId, delimiter, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&routeId); + ZVAL_UNDEF(&uniqueId); + ZVAL_UNDEF(&delimiter); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } - ZEPHIR_OBS_VAR(delimiter); - zephir_read_static_property_ce(&delimiter, phalcon_cli_router_route_ce, SL("_delimiterPath") TSRMLS_CC); - if (!(zephir_is_true(delimiter))) { - ZEPHIR_INIT_NVAR(delimiter); - ZVAL_STRING(delimiter, " ", 1); + ZEPHIR_OBS_VAR(&delimiter); + zephir_read_static_property_ce(&delimiter, phalcon_cli_router_route_ce, SL("_delimiterPath"), PH_NOISY_CC); + if (!(zephir_is_true(&delimiter))) { + ZEPHIR_INIT_NVAR(&delimiter); + ZVAL_STRING(&delimiter, " "); } - zephir_update_property_this(getThis(), SL("_delimiter"), delimiter TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "reconfigure", NULL, 0, pattern, paths); + zephir_update_property_zval(this_ptr, SL("_delimiter"), &delimiter); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "reconfigure", NULL, 0, &pattern, paths); zephir_check_call_status(); - ZEPHIR_OBS_VAR(uniqueId); - zephir_read_static_property_ce(&uniqueId, phalcon_cli_router_route_ce, SL("_uniqueId") TSRMLS_CC); - if (Z_TYPE_P(uniqueId) == IS_NULL) { - ZEPHIR_INIT_NVAR(uniqueId); - ZVAL_LONG(uniqueId, 0); + ZEPHIR_OBS_VAR(&uniqueId); + zephir_read_static_property_ce(&uniqueId, phalcon_cli_router_route_ce, SL("_uniqueId"), PH_NOISY_CC); + if (Z_TYPE_P(&uniqueId) == IS_NULL) { + ZEPHIR_INIT_NVAR(&uniqueId); + ZVAL_LONG(&uniqueId, 0); } - ZEPHIR_CPY_WRT(routeId, uniqueId); - zephir_update_property_this(getThis(), SL("_id"), routeId TSRMLS_CC); + ZEPHIR_CPY_WRT(&routeId, &uniqueId); + zephir_update_property_zval(this_ptr, SL("_id"), &routeId); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, (zephir_get_numberval(uniqueId) + 1)); - zephir_update_static_property_ce(phalcon_cli_router_route_ce, SL("_uniqueId"), &_0 TSRMLS_CC); + ZVAL_LONG(&_0, (zephir_get_numberval(&uniqueId) + 1)); + zend_update_static_property(phalcon_cli_router_route_ce, ZEND_STRL("_uniqueId"), &_0); ZEPHIR_MM_RESTORE(); } @@ -118,100 +128,125 @@ PHP_METHOD(Phalcon_Cli_Router_Route, __construct) { */ PHP_METHOD(Phalcon_Cli_Router_Route, compilePattern) { - zval *pattern_param = NULL, *idPattern = NULL, *part = NULL, *_0$$3, *_4$$3, *_6$$3, *_8$$3, *_10$$3, *_12$$3, *_16$$3, *_1$$4, *_2$$4, _3$$4, *_5$$5, *_7$$6, *_9$$7, *_11$$8, *_13$$9, *_14$$9, *_15$$9, *_17$$10, *_18$$10, *_19$$10; - zval *pattern = NULL; + zval *pattern_param = NULL, idPattern, part, _0$$3, _4$$3, _6$$3, _8$$3, _10$$3, _12$$3, _16$$3, _1$$4, _2$$4, _3$$4, _5$$5, _7$$6, _9$$7, _11$$8, _13$$9, _14$$9, _15$$9, _17$$10, _18$$10, _19$$10; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&idPattern); + ZVAL_UNDEF(&part); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_8$$3); + ZVAL_UNDEF(&_10$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_16$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_14$$9); + ZVAL_UNDEF(&_15$$9); + ZVAL_UNDEF(&_17$$10); + ZVAL_UNDEF(&_18$$10); + ZVAL_UNDEF(&_19$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &pattern_param); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } - if (zephir_memnstr_str(pattern, SL(":"), "phalcon/cli/router/route.zep", 94)) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(idPattern); - ZEPHIR_CONCAT_VS(idPattern, _0$$3, "([a-zA-Z0-9\\_\\-]+)"); - if (zephir_memnstr_str(pattern, SL(":delimiter"), "phalcon/cli/router/route.zep", 100)) { - ZEPHIR_INIT_VAR(_1$$4); - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_3$$4); - ZVAL_STRING(&_3$$4, ":delimiter", 0); - zephir_fast_str_replace(&_1$$4, &_3$$4, _2$$4, pattern TSRMLS_CC); - zephir_get_strval(pattern, _1$$4); + if (zephir_memnstr_str(&pattern, SL(":"), "phalcon/cli/router/route.zep", 94)) { + zephir_read_property(&_0$$3, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&idPattern); + ZEPHIR_CONCAT_VS(&idPattern, &_0$$3, "([a-zA-Z0-9\\_\\-]+)"); + if (zephir_memnstr_str(&pattern, SL(":delimiter"), "phalcon/cli/router/route.zep", 100)) { + ZEPHIR_INIT_VAR(&_1$$4); + zephir_read_property(&_2$$4, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_3$$4); + ZVAL_STRING(&_3$$4, ":delimiter"); + zephir_fast_str_replace(&_1$$4, &_3$$4, &_2$$4, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_1$$4); } - _4$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(part); - ZEPHIR_CONCAT_VS(part, _4$$3, ":module"); - if (zephir_memnstr(pattern, part, "phalcon/cli/router/route.zep", 106)) { - ZEPHIR_INIT_VAR(_5$$5); - zephir_fast_str_replace(&_5$$5, part, idPattern, pattern TSRMLS_CC); - zephir_get_strval(pattern, _5$$5); + zephir_read_property(&_4$$3, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&part); + ZEPHIR_CONCAT_VS(&part, &_4$$3, ":module"); + if (zephir_memnstr(&pattern, &part, "phalcon/cli/router/route.zep", 106)) { + ZEPHIR_INIT_VAR(&_5$$5); + zephir_fast_str_replace(&_5$$5, &part, &idPattern, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_5$$5); } - _6$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(part); - ZEPHIR_CONCAT_VS(part, _6$$3, ":task"); - if (zephir_memnstr(pattern, part, "phalcon/cli/router/route.zep", 112)) { - ZEPHIR_INIT_VAR(_7$$6); - zephir_fast_str_replace(&_7$$6, part, idPattern, pattern TSRMLS_CC); - zephir_get_strval(pattern, _7$$6); + zephir_read_property(&_6$$3, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&part); + ZEPHIR_CONCAT_VS(&part, &_6$$3, ":task"); + if (zephir_memnstr(&pattern, &part, "phalcon/cli/router/route.zep", 112)) { + ZEPHIR_INIT_VAR(&_7$$6); + zephir_fast_str_replace(&_7$$6, &part, &idPattern, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_7$$6); } - _8$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(part); - ZEPHIR_CONCAT_VS(part, _8$$3, ":namespace"); - if (zephir_memnstr(pattern, part, "phalcon/cli/router/route.zep", 118)) { - ZEPHIR_INIT_VAR(_9$$7); - zephir_fast_str_replace(&_9$$7, part, idPattern, pattern TSRMLS_CC); - zephir_get_strval(pattern, _9$$7); + zephir_read_property(&_8$$3, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&part); + ZEPHIR_CONCAT_VS(&part, &_8$$3, ":namespace"); + if (zephir_memnstr(&pattern, &part, "phalcon/cli/router/route.zep", 118)) { + ZEPHIR_INIT_VAR(&_9$$7); + zephir_fast_str_replace(&_9$$7, &part, &idPattern, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_9$$7); } - _10$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(part); - ZEPHIR_CONCAT_VS(part, _10$$3, ":action"); - if (zephir_memnstr(pattern, part, "phalcon/cli/router/route.zep", 124)) { - ZEPHIR_INIT_VAR(_11$$8); - zephir_fast_str_replace(&_11$$8, part, idPattern, pattern TSRMLS_CC); - zephir_get_strval(pattern, _11$$8); + zephir_read_property(&_10$$3, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&part); + ZEPHIR_CONCAT_VS(&part, &_10$$3, ":action"); + if (zephir_memnstr(&pattern, &part, "phalcon/cli/router/route.zep", 124)) { + ZEPHIR_INIT_VAR(&_11$$8); + zephir_fast_str_replace(&_11$$8, &part, &idPattern, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_11$$8); } - _12$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(part); - ZEPHIR_CONCAT_VS(part, _12$$3, ":params"); - if (zephir_memnstr(pattern, part, "phalcon/cli/router/route.zep", 130)) { - ZEPHIR_INIT_VAR(_13$$9); - _14$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_15$$9); - ZEPHIR_CONCAT_SVS(_15$$9, "(", _14$$9, ".*)*"); - zephir_fast_str_replace(&_13$$9, part, _15$$9, pattern TSRMLS_CC); - zephir_get_strval(pattern, _13$$9); + zephir_read_property(&_12$$3, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&part); + ZEPHIR_CONCAT_VS(&part, &_12$$3, ":params"); + if (zephir_memnstr(&pattern, &part, "phalcon/cli/router/route.zep", 130)) { + ZEPHIR_INIT_VAR(&_13$$9); + zephir_read_property(&_14$$9, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_15$$9); + ZEPHIR_CONCAT_SVS(&_15$$9, "(", &_14$$9, ".*)*"); + zephir_fast_str_replace(&_13$$9, &part, &_15$$9, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_13$$9); } - _16$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(part); - ZEPHIR_CONCAT_VS(part, _16$$3, ":int"); - if (zephir_memnstr(pattern, part, "phalcon/cli/router/route.zep", 136)) { - ZEPHIR_INIT_VAR(_17$$10); - _18$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_19$$10); - ZEPHIR_CONCAT_VS(_19$$10, _18$$10, "([0-9]+)"); - zephir_fast_str_replace(&_17$$10, part, _19$$10, pattern TSRMLS_CC); - zephir_get_strval(pattern, _17$$10); + zephir_read_property(&_16$$3, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&part); + ZEPHIR_CONCAT_VS(&part, &_16$$3, ":int"); + if (zephir_memnstr(&pattern, &part, "phalcon/cli/router/route.zep", 136)) { + ZEPHIR_INIT_VAR(&_17$$10); + zephir_read_property(&_18$$10, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_19$$10); + ZEPHIR_CONCAT_VS(&_19$$10, &_18$$10, "([0-9]+)"); + zephir_fast_str_replace(&_17$$10, &part, &_19$$10, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_17$$10); } } - if (zephir_memnstr_str(pattern, SL("("), "phalcon/cli/router/route.zep", 142)) { - ZEPHIR_CONCAT_SVS(return_value, "#^", pattern, "$#"); + if (zephir_memnstr_str(&pattern, SL("("), "phalcon/cli/router/route.zep", 142)) { + ZEPHIR_CONCAT_SVS(return_value, "#^", &pattern, "$#"); RETURN_MM(); } - if (zephir_memnstr_str(pattern, SL("["), "phalcon/cli/router/route.zep", 147)) { - ZEPHIR_CONCAT_SVS(return_value, "#^", pattern, "$#"); + if (zephir_memnstr_str(&pattern, SL("["), "phalcon/cli/router/route.zep", 147)) { + ZEPHIR_CONCAT_SVS(return_value, "#^", &pattern, "$#"); RETURN_MM(); } - RETURN_CTOR(pattern); + RETURN_CTOR(&pattern); } @@ -227,21 +262,44 @@ PHP_METHOD(Phalcon_Cli_Router_Route, extractNamedParams) { zend_bool notValid = 0, _6$$12, _7$$12, _8$$12, _9$$12, _10$$12, _11$$12, _12$$12, _13$$12, _14$$12, _15$$12, _16$$12, _17$$12, _25$$18; zend_long tmp = 0, cursor = 0, cursorVar = 0, marker = 0, bracketCount, parenthesesCount, foundPattern, intermediate, numberMatches; char ch = 0; - zval *pattern_param = NULL, *matches = NULL, _1$$11 = zval_used_for_init, _2$$11 = zval_used_for_init, *_3$$11 = NULL, _18$$16 = zval_used_for_init, _19$$16 = zval_used_for_init, *_20$$16 = NULL, _22$$16 = zval_used_for_init, *_23$$16 = NULL, *_27$$19 = NULL, *_28$$28, *_29$$28 = NULL, *_30$$28 = NULL; - zval *pattern = NULL, *route = NULL, *item = NULL, *variable = NULL, *regexp = NULL, *_4$$11 = NULL, *_21$$16 = NULL, *_24$$16 = NULL; + zval *pattern_param = NULL, matches, _1$$11, _2$$11, _3$$11, _18$$16, _19$$16, _20$$16, _22$$16, _23$$16, _27$$19, _28$$28, _29$$28, _30$$28; + zval pattern, route, item, variable, regexp, _4$$11, _21$$16, _24$$16; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&variable); + ZVAL_UNDEF(®exp); + ZVAL_UNDEF(&_4$$11); + ZVAL_UNDEF(&_21$$16); + ZVAL_UNDEF(&_24$$16); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&_1$$11); + ZVAL_UNDEF(&_2$$11); + ZVAL_UNDEF(&_3$$11); + ZVAL_UNDEF(&_18$$16); + ZVAL_UNDEF(&_19$$16); + ZVAL_UNDEF(&_20$$16); + ZVAL_UNDEF(&_22$$16); + ZVAL_UNDEF(&_23$$16); + ZVAL_UNDEF(&_27$$19); + ZVAL_UNDEF(&_28$$28); + ZVAL_UNDEF(&_29$$28); + ZVAL_UNDEF(&_30$$28); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &pattern_param); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } @@ -250,16 +308,16 @@ PHP_METHOD(Phalcon_Cli_Router_Route, extractNamedParams) { foundPattern = 0; intermediate = 0; numberMatches = 0; - if (zephir_fast_strlen_ev(pattern) <= 0) { + if (zephir_fast_strlen_ev(&pattern) <= 0) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(matches); - array_init(matches); - ZEPHIR_INIT_VAR(route); - ZVAL_EMPTY_STRING(route); - for (_0 = 0; _0 < Z_STRLEN_P(pattern); _0++) { + ZEPHIR_INIT_VAR(&matches); + array_init(&matches); + ZEPHIR_INIT_VAR(&route); + ZVAL_STRING(&route, ""); + for (_0 = 0; _0 < Z_STRLEN_P(&pattern); _0++) { cursor = _0; - ch = ZEPHIR_STRING_OFFSET(pattern, _0); + ch = ZEPHIR_STRING_OFFSET(&pattern, _0); if (parenthesesCount == 0) { if (ch == '{') { if (bracketCount == 0) { @@ -274,21 +332,19 @@ PHP_METHOD(Phalcon_Cli_Router_Route, extractNamedParams) { if (intermediate > 0) { if (bracketCount == 0) { numberMatches++; - ZEPHIR_INIT_NVAR(variable); - ZVAL_EMPTY_STRING(variable); - ZEPHIR_INIT_NVAR(regexp); - ZVAL_EMPTY_STRING(regexp); - ZEPHIR_SINIT_NVAR(_1$$11); + ZEPHIR_INIT_NVAR(&variable); + ZVAL_STRING(&variable, ""); + ZEPHIR_INIT_NVAR(®exp); + ZVAL_STRING(®exp, ""); ZVAL_LONG(&_1$$11, marker); - ZEPHIR_SINIT_NVAR(_2$$11); ZVAL_LONG(&_2$$11, (cursor - marker)); - ZEPHIR_INIT_NVAR(_3$$11); - zephir_substr(_3$$11, pattern, zephir_get_intval(&_1$$11), zephir_get_intval(&_2$$11), 0); - zephir_get_strval(_4$$11, _3$$11); - ZEPHIR_CPY_WRT(item, _4$$11); - for (_5$$11 = 0; _5$$11 < Z_STRLEN_P(item); _5$$11++) { + ZEPHIR_INIT_NVAR(&_3$$11); + zephir_substr(&_3$$11, &pattern, zephir_get_intval(&_1$$11), zephir_get_intval(&_2$$11), 0); + zephir_get_strval(&_4$$11, &_3$$11); + ZEPHIR_CPY_WRT(&item, &_4$$11); + for (_5$$11 = 0; _5$$11 < Z_STRLEN_P(&item); _5$$11++) { cursorVar = _5$$11; - ch = ZEPHIR_STRING_OFFSET(item, _5$$11); + ch = ZEPHIR_STRING_OFFSET(&item, _5$$11); if (ch == '\0') { break; } @@ -346,20 +402,17 @@ PHP_METHOD(Phalcon_Cli_Router_Route, extractNamedParams) { } if (_17$$12) { if (ch == ':') { - ZEPHIR_SINIT_NVAR(_18$$16); ZVAL_LONG(&_18$$16, 0); - ZEPHIR_SINIT_NVAR(_19$$16); ZVAL_LONG(&_19$$16, cursorVar); - ZEPHIR_INIT_NVAR(_20$$16); - zephir_substr(_20$$16, item, 0 , zephir_get_intval(&_19$$16), 0); - zephir_get_strval(_21$$16, _20$$16); - ZEPHIR_CPY_WRT(variable, _21$$16); - ZEPHIR_SINIT_NVAR(_22$$16); + ZEPHIR_INIT_NVAR(&_20$$16); + zephir_substr(&_20$$16, &item, 0 , zephir_get_intval(&_19$$16), 0); + zephir_get_strval(&_21$$16, &_20$$16); + ZEPHIR_CPY_WRT(&variable, &_21$$16); ZVAL_LONG(&_22$$16, (cursorVar + 1)); - ZEPHIR_INIT_NVAR(_23$$16); - zephir_substr(_23$$16, item, zephir_get_intval(&_22$$16), 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_get_strval(_24$$16, _23$$16); - ZEPHIR_CPY_WRT(regexp, _24$$16); + ZEPHIR_INIT_NVAR(&_23$$16); + zephir_substr(&_23$$16, &item, zephir_get_intval(&_22$$16), 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_get_strval(&_24$$16, &_23$$16); + ZEPHIR_CPY_WRT(®exp, &_24$$16); break; } } else { @@ -369,14 +422,14 @@ PHP_METHOD(Phalcon_Cli_Router_Route, extractNamedParams) { } if (!(notValid)) { tmp = numberMatches; - _25$$18 = zephir_is_true(variable); + _25$$18 = zephir_is_true(&variable); if (_25$$18) { - _25$$18 = zephir_is_true(regexp); + _25$$18 = zephir_is_true(®exp); } if (_25$$18) { foundPattern = 0; - for (_26$$19 = 0; _26$$19 < Z_STRLEN_P(regexp); _26$$19++) { - ch = ZEPHIR_STRING_OFFSET(regexp, _26$$19); + for (_26$$19 = 0; _26$$19 < Z_STRLEN_P(®exp); _26$$19++) { + ch = ZEPHIR_STRING_OFFSET(®exp, _26$$19); if (ch == '\0') { break; } @@ -393,26 +446,26 @@ PHP_METHOD(Phalcon_Cli_Router_Route, extractNamedParams) { } if (foundPattern != 2) { zephir_concat_self_str(&route, "(", sizeof("(")-1 TSRMLS_CC); - zephir_concat_self(&route, regexp TSRMLS_CC); + zephir_concat_self(&route, ®exp TSRMLS_CC); zephir_concat_self_str(&route, ")", sizeof(")")-1 TSRMLS_CC); } else { - zephir_concat_self(&route, regexp TSRMLS_CC); + zephir_concat_self(&route, ®exp TSRMLS_CC); } - ZEPHIR_INIT_NVAR(_27$$19); - ZVAL_LONG(_27$$19, tmp); - zephir_array_update_zval(&matches, variable, &_27$$19, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_27$$19); + ZVAL_LONG(&_27$$19, tmp); + zephir_array_update_zval(&matches, &variable, &_27$$19, PH_COPY | PH_SEPARATE); } else { - _28$$28 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); + zephir_read_property(&_28$$28, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_LNVAR(_29$$28); - ZEPHIR_CONCAT_SVS(_29$$28, "([^", _28$$28, "]*)"); - zephir_concat_self(&route, _29$$28 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_30$$28); - ZVAL_LONG(_30$$28, tmp); - zephir_array_update_zval(&matches, item, &_30$$28, PH_COPY | PH_SEPARATE); + ZEPHIR_CONCAT_SVS(&_29$$28, "([^", &_28$$28, "]*)"); + zephir_concat_self(&route, &_29$$28 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_30$$28); + ZVAL_LONG(&_30$$28, tmp); + zephir_array_update_zval(&matches, &item, &_30$$28, PH_COPY | PH_SEPARATE); } } else { zephir_concat_self_str(&route, "{", sizeof("{")-1 TSRMLS_CC); - zephir_concat_self(&route, item TSRMLS_CC); + zephir_concat_self(&route, &item TSRMLS_CC); zephir_concat_self_str(&route, "}", sizeof("}")-1 TSRMLS_CC); } continue; @@ -440,8 +493,8 @@ PHP_METHOD(Phalcon_Cli_Router_Route, extractNamedParams) { } } zephir_create_array(return_value, 2, 0 TSRMLS_CC); - zephir_array_fast_append(return_value, route); - zephir_array_fast_append(return_value, matches); + zephir_array_fast_append(return_value, &route); + zephir_array_fast_append(return_value, &matches); RETURN_MM(); } @@ -455,126 +508,148 @@ PHP_METHOD(Phalcon_Cli_Router_Route, extractNamedParams) { PHP_METHOD(Phalcon_Cli_Router_Route, reConfigure) { zend_long ZEPHIR_LAST_CALL_STATUS, _0$$4; - zval *pattern_param = NULL, *paths = NULL, *moduleName = NULL, *taskName = NULL, *actionName = NULL, *parts = NULL, *routePaths = NULL, *realClassName = NULL, *namespaceName = NULL, *pcrePattern = NULL, *compiledPattern = NULL, *extracted = NULL, *_1$$9, *_2$$18, *_3$$18, *_4$$21, *_5$$21, _6$$21; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, moduleName, taskName, actionName, parts, routePaths, realClassName, namespaceName, pcrePattern, compiledPattern, extracted, _1$$9, _2$$18, _3$$18, _4$$21, _5$$21, _6$$21; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&moduleName); + ZVAL_UNDEF(&taskName); + ZVAL_UNDEF(&actionName); + ZVAL_UNDEF(&parts); + ZVAL_UNDEF(&routePaths); + ZVAL_UNDEF(&realClassName); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&pcrePattern); + ZVAL_UNDEF(&compiledPattern); + ZVAL_UNDEF(&extracted); + ZVAL_UNDEF(&_1$$9); + ZVAL_UNDEF(&_2$$18); + ZVAL_UNDEF(&_3$$18); + ZVAL_UNDEF(&_4$$21); + ZVAL_UNDEF(&_5$$21); + ZVAL_UNDEF(&_6$$21); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (Z_TYPE_P(paths) != IS_NULL) { if (Z_TYPE_P(paths) == IS_STRING) { - ZEPHIR_INIT_VAR(moduleName); - ZVAL_NULL(moduleName); - ZEPHIR_INIT_VAR(taskName); - ZVAL_NULL(taskName); - ZEPHIR_INIT_VAR(actionName); - ZVAL_NULL(actionName); - ZEPHIR_INIT_VAR(parts); - zephir_fast_explode_str(parts, SL("::"), paths, LONG_MAX TSRMLS_CC); + ZEPHIR_INIT_VAR(&moduleName); + ZVAL_NULL(&moduleName); + ZEPHIR_INIT_VAR(&taskName); + ZVAL_NULL(&taskName); + ZEPHIR_INIT_VAR(&actionName); + ZVAL_NULL(&actionName); + ZEPHIR_INIT_VAR(&parts); + zephir_fast_explode_str(&parts, SL("::"), paths, LONG_MAX TSRMLS_CC); do { - _0$$4 = zephir_fast_count_int(parts TSRMLS_CC); + _0$$4 = zephir_fast_count_int(&parts TSRMLS_CC); if (_0$$4 == 3) { - ZEPHIR_OBS_NVAR(moduleName); - zephir_array_fetch_long(&moduleName, parts, 0, PH_NOISY, "phalcon/cli/router/route.zep", 318 TSRMLS_CC); - ZEPHIR_OBS_NVAR(taskName); - zephir_array_fetch_long(&taskName, parts, 1, PH_NOISY, "phalcon/cli/router/route.zep", 319 TSRMLS_CC); - ZEPHIR_OBS_NVAR(actionName); - zephir_array_fetch_long(&actionName, parts, 2, PH_NOISY, "phalcon/cli/router/route.zep", 320 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&moduleName); + zephir_array_fetch_long(&moduleName, &parts, 0, PH_NOISY, "phalcon/cli/router/route.zep", 318 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&taskName); + zephir_array_fetch_long(&taskName, &parts, 1, PH_NOISY, "phalcon/cli/router/route.zep", 319 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&actionName); + zephir_array_fetch_long(&actionName, &parts, 2, PH_NOISY, "phalcon/cli/router/route.zep", 320 TSRMLS_CC); break; } if (_0$$4 == 2) { - ZEPHIR_OBS_NVAR(taskName); - zephir_array_fetch_long(&taskName, parts, 0, PH_NOISY, "phalcon/cli/router/route.zep", 324 TSRMLS_CC); - ZEPHIR_OBS_NVAR(actionName); - zephir_array_fetch_long(&actionName, parts, 1, PH_NOISY, "phalcon/cli/router/route.zep", 325 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&taskName); + zephir_array_fetch_long(&taskName, &parts, 0, PH_NOISY, "phalcon/cli/router/route.zep", 324 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&actionName); + zephir_array_fetch_long(&actionName, &parts, 1, PH_NOISY, "phalcon/cli/router/route.zep", 325 TSRMLS_CC); break; } if (_0$$4 == 1) { - ZEPHIR_OBS_NVAR(taskName); - zephir_array_fetch_long(&taskName, parts, 0, PH_NOISY, "phalcon/cli/router/route.zep", 329 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&taskName); + zephir_array_fetch_long(&taskName, &parts, 0, PH_NOISY, "phalcon/cli/router/route.zep", 329 TSRMLS_CC); break; } } while(0); - ZEPHIR_INIT_VAR(routePaths); - array_init(routePaths); - if (Z_TYPE_P(moduleName) != IS_NULL) { + ZEPHIR_INIT_VAR(&routePaths); + array_init(&routePaths); + if (Z_TYPE_P(&moduleName) != IS_NULL) { zephir_array_update_string(&routePaths, SL("module"), &moduleName, PH_COPY | PH_SEPARATE); } - if (Z_TYPE_P(taskName) != IS_NULL) { - if (zephir_memnstr_str(taskName, SL("\\"), "phalcon/cli/router/route.zep", 344)) { - ZEPHIR_INIT_VAR(realClassName); - zephir_get_class_ns(realClassName, taskName, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(namespaceName); - zephir_get_ns_class(namespaceName, taskName, 0 TSRMLS_CC); - if (zephir_is_true(namespaceName)) { + if (Z_TYPE_P(&taskName) != IS_NULL) { + if (zephir_memnstr_str(&taskName, SL("\\"), "phalcon/cli/router/route.zep", 344)) { + ZEPHIR_INIT_VAR(&realClassName); + zephir_get_class_ns(&realClassName, &taskName, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&namespaceName); + zephir_get_ns_class(&namespaceName, &taskName, 0 TSRMLS_CC); + if (zephir_is_true(&namespaceName)) { zephir_array_update_string(&routePaths, SL("namespace"), &namespaceName, PH_COPY | PH_SEPARATE); } } else { - ZEPHIR_CPY_WRT(realClassName, taskName); + ZEPHIR_CPY_WRT(&realClassName, &taskName); } - ZEPHIR_INIT_VAR(_1$$9); - zephir_uncamelize(_1$$9, realClassName, NULL ); + ZEPHIR_INIT_VAR(&_1$$9); + zephir_uncamelize(&_1$$9, &realClassName, NULL ); zephir_array_update_string(&routePaths, SL("task"), &_1$$9, PH_COPY | PH_SEPARATE); } - if (Z_TYPE_P(actionName) != IS_NULL) { + if (Z_TYPE_P(&actionName) != IS_NULL) { zephir_array_update_string(&routePaths, SL("action"), &actionName, PH_COPY | PH_SEPARATE); } } else { - ZEPHIR_CPY_WRT(routePaths, paths); + ZEPHIR_CPY_WRT(&routePaths, paths); } } else { - ZEPHIR_INIT_NVAR(routePaths); - array_init(routePaths); + ZEPHIR_INIT_NVAR(&routePaths); + array_init(&routePaths); } - if (Z_TYPE_P(routePaths) != IS_ARRAY) { + if (Z_TYPE_P(&routePaths) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_cli_router_exception_ce, "The route contains invalid paths", "phalcon/cli/router/route.zep", 376); return; } - if (!(zephir_start_with_str(pattern, SL("#")))) { - if (zephir_memnstr_str(pattern, SL("{"), "phalcon/cli/router/route.zep", 384)) { - ZEPHIR_CALL_METHOD(&extracted, this_ptr, "extractnamedparams", NULL, 0, pattern); + if (!(zephir_start_with_str(&pattern, SL("#")))) { + if (zephir_memnstr_str(&pattern, SL("{"), "phalcon/cli/router/route.zep", 384)) { + ZEPHIR_CALL_METHOD(&extracted, this_ptr, "extractnamedparams", NULL, 0, &pattern); zephir_check_call_status(); - ZEPHIR_OBS_VAR(pcrePattern); - zephir_array_fetch_long(&pcrePattern, extracted, 0, PH_NOISY, "phalcon/cli/router/route.zep", 389 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2$$18); - zephir_array_fetch_long(&_3$$18, extracted, 1, PH_NOISY | PH_READONLY, "phalcon/cli/router/route.zep", 390 TSRMLS_CC); - zephir_fast_array_merge(_2$$18, &(routePaths), &(_3$$18) TSRMLS_CC); - ZEPHIR_CPY_WRT(routePaths, _2$$18); + ZEPHIR_OBS_VAR(&pcrePattern); + zephir_array_fetch_long(&pcrePattern, &extracted, 0, PH_NOISY, "phalcon/cli/router/route.zep", 389 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$18); + zephir_array_fetch_long(&_3$$18, &extracted, 1, PH_NOISY | PH_READONLY, "phalcon/cli/router/route.zep", 390 TSRMLS_CC); + zephir_fast_array_merge(&_2$$18, &routePaths, &_3$$18 TSRMLS_CC); + ZEPHIR_CPY_WRT(&routePaths, &_2$$18); } else { - ZEPHIR_CPY_WRT(pcrePattern, pattern); + ZEPHIR_CPY_WRT(&pcrePattern, &pattern); } - ZEPHIR_CALL_METHOD(&compiledPattern, this_ptr, "compilepattern", NULL, 0, pcrePattern); + ZEPHIR_CALL_METHOD(&compiledPattern, this_ptr, "compilepattern", NULL, 0, &pcrePattern); zephir_check_call_status(); } else { - if (zephir_memnstr_str(pattern, SL(":delimiter"), "phalcon/cli/router/route.zep", 401)) { - ZEPHIR_INIT_VAR(_4$$21); - _5$$21 = zephir_fetch_nproperty_this(this_ptr, SL("_delimiter"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_6$$21); - ZVAL_STRING(&_6$$21, ":delimiter", 0); - zephir_fast_str_replace(&_4$$21, &_6$$21, _5$$21, pattern TSRMLS_CC); - zephir_get_strval(pattern, _4$$21); + if (zephir_memnstr_str(&pattern, SL(":delimiter"), "phalcon/cli/router/route.zep", 401)) { + ZEPHIR_INIT_VAR(&_4$$21); + zephir_read_property(&_5$$21, this_ptr, SL("_delimiter"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_6$$21); + ZVAL_STRING(&_6$$21, ":delimiter"); + zephir_fast_str_replace(&_4$$21, &_6$$21, &_5$$21, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_4$$21); } - ZEPHIR_CPY_WRT(compiledPattern, pattern); + ZEPHIR_CPY_WRT(&compiledPattern, &pattern); } - zephir_update_property_this(getThis(), SL("_pattern"), pattern TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_compiledPattern"), compiledPattern TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_paths"), routePaths TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_pattern"), &pattern); + zephir_update_property_zval(this_ptr, SL("_compiledPattern"), &compiledPattern); + zephir_update_property_zval(this_ptr, SL("_paths"), &routePaths); ZEPHIR_MM_RESTORE(); } @@ -584,7 +659,8 @@ PHP_METHOD(Phalcon_Cli_Router_Route, reConfigure) { */ PHP_METHOD(Phalcon_Cli_Router_Route, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -605,24 +681,27 @@ PHP_METHOD(Phalcon_Cli_Router_Route, getName) { PHP_METHOD(Phalcon_Cli_Router_Route, setName) { zval *name_param = NULL; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); RETURN_THIS(); } @@ -637,13 +716,16 @@ PHP_METHOD(Phalcon_Cli_Router_Route, setName) { */ PHP_METHOD(Phalcon_Cli_Router_Route, beforeMatch) { - zval *callback; + zval *callback, callback_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&callback_sub); zephir_fetch_params(0, 1, 0, &callback); - zephir_update_property_this(getThis(), SL("_beforeMatch"), callback TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_beforeMatch"), callback); RETURN_THISW(); } @@ -655,7 +737,8 @@ PHP_METHOD(Phalcon_Cli_Router_Route, beforeMatch) { */ PHP_METHOD(Phalcon_Cli_Router_Route, getBeforeMatch) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_beforeMatch"); @@ -666,7 +749,8 @@ PHP_METHOD(Phalcon_Cli_Router_Route, getBeforeMatch) { */ PHP_METHOD(Phalcon_Cli_Router_Route, getRouteId) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_id"); @@ -677,7 +761,8 @@ PHP_METHOD(Phalcon_Cli_Router_Route, getRouteId) { */ PHP_METHOD(Phalcon_Cli_Router_Route, getPattern) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_pattern"); @@ -688,7 +773,8 @@ PHP_METHOD(Phalcon_Cli_Router_Route, getPattern) { */ PHP_METHOD(Phalcon_Cli_Router_Route, getCompiledPattern) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_compiledPattern"); @@ -699,7 +785,8 @@ PHP_METHOD(Phalcon_Cli_Router_Route, getCompiledPattern) { */ PHP_METHOD(Phalcon_Cli_Router_Route, getPaths) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_paths"); @@ -710,25 +797,37 @@ PHP_METHOD(Phalcon_Cli_Router_Route, getPaths) { */ PHP_METHOD(Phalcon_Cli_Router_Route, getReversedPaths) { - HashTable *_2; - HashPosition _1; - zval *reversed = NULL, *path = NULL, *position = NULL, *_0, **_3; + zend_string *_3; + zend_ulong _2; + zval reversed, path, position, _0, *_1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&reversed); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(reversed); - array_init(reversed); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_paths"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/cli/router/route.zep", 516); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(path, _2, _1); - ZEPHIR_GET_HVALUE(position, _3); - zephir_array_update_zval(&reversed, position, &path, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(reversed); + ZEPHIR_INIT_VAR(&reversed); + array_init(&reversed); + zephir_read_property(&_0, this_ptr, SL("_paths"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/cli/router/route.zep", 516); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&path); + if (_3 != NULL) { + ZVAL_STR_COPY(&path, _3); + } else { + ZVAL_LONG(&path, _2); + } + ZEPHIR_INIT_NVAR(&position); + ZVAL_COPY(&position, _1); + zephir_array_update_zval(&reversed, &position, &path, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&position); + ZEPHIR_INIT_NVAR(&path); + RETURN_CCTOR(&reversed); } @@ -741,25 +840,29 @@ PHP_METHOD(Phalcon_Cli_Router_Route, getReversedPaths) { */ PHP_METHOD(Phalcon_Cli_Router_Route, convert) { - zval *name_param = NULL, *converter; - zval *name = NULL; + zval *name_param = NULL, *converter, converter_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&converter_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &converter); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - zephir_update_property_array(this_ptr, SL("_converters"), name, converter TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_converters"), &name, converter TSRMLS_CC); RETURN_THIS(); } @@ -769,7 +872,8 @@ PHP_METHOD(Phalcon_Cli_Router_Route, convert) { */ PHP_METHOD(Phalcon_Cli_Router_Route, getConverters) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_converters"); @@ -780,9 +884,13 @@ PHP_METHOD(Phalcon_Cli_Router_Route, getConverters) { */ PHP_METHOD(Phalcon_Cli_Router_Route, reset) { - + zval __$null; + zval *this_ptr = getThis(); - zephir_update_static_property_ce(phalcon_cli_router_route_ce, SL("_uniqueId"), &ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + ZVAL_NULL(&__$null); + + + zend_update_static_property(phalcon_cli_router_route_ce, ZEND_STRL("_uniqueId"), &__$null); } @@ -792,29 +900,32 @@ PHP_METHOD(Phalcon_Cli_Router_Route, reset) { PHP_METHOD(Phalcon_Cli_Router_Route, delimiter) { zval *delimiter_param = NULL; - zval *delimiter = NULL; + zval delimiter; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&delimiter); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &delimiter_param); if (!delimiter_param) { - ZEPHIR_INIT_VAR(delimiter); - ZVAL_EMPTY_STRING(delimiter); + ZEPHIR_INIT_VAR(&delimiter); + ZVAL_STRING(&delimiter, ""); } else { if (UNEXPECTED(Z_TYPE_P(delimiter_param) != IS_STRING && Z_TYPE_P(delimiter_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'delimiter' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'delimiter' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(delimiter_param) == IS_STRING)) { - zephir_get_strval(delimiter, delimiter_param); + zephir_get_strval(&delimiter, delimiter_param); } else { - ZEPHIR_INIT_VAR(delimiter); - ZVAL_EMPTY_STRING(delimiter); + ZEPHIR_INIT_VAR(&delimiter); + ZVAL_EMPTY_STRING(&delimiter); } } - zephir_update_static_property_ce(phalcon_cli_router_route_ce, SL("_delimiterPath"), &delimiter TSRMLS_CC); + zend_update_static_property(phalcon_cli_router_route_ce, ZEND_STRL("_delimiterPath"), &delimiter); ZEPHIR_MM_RESTORE(); } @@ -824,17 +935,20 @@ PHP_METHOD(Phalcon_Cli_Router_Route, delimiter) { */ PHP_METHOD(Phalcon_Cli_Router_Route, getDelimiter) { - zval *delimiter = NULL; + zval delimiter; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&delimiter); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(delimiter); - zephir_read_static_property_ce(&delimiter, phalcon_cli_router_route_ce, SL("_delimiterPath") TSRMLS_CC); - if (!(zephir_is_true(delimiter))) { - ZEPHIR_INIT_NVAR(delimiter); - ZVAL_STRING(delimiter, " ", 1); + ZEPHIR_OBS_VAR(&delimiter); + zephir_read_static_property_ce(&delimiter, phalcon_cli_router_route_ce, SL("_delimiterPath"), PH_NOISY_CC); + if (!(zephir_is_true(&delimiter))) { + ZEPHIR_INIT_NVAR(&delimiter); + ZVAL_STRING(&delimiter, " "); } - RETURN_CCTOR(delimiter); + RETURN_CCTOR(&delimiter); } diff --git a/ext/phalcon/cli/router/route.zep.h b/ext/phalcon/cli/router/route.zep.h index 8cffa30b93e..8f7554c0ff5 100644 --- a/ext/phalcon/cli/router/route.zep.h +++ b/ext/phalcon/cli/router/route.zep.h @@ -23,38 +23,138 @@ PHP_METHOD(Phalcon_Cli_Router_Route, delimiter); PHP_METHOD(Phalcon_Cli_Router_Route, getDelimiter); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_route___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_route_compilepattern, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_compilepattern, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_compilepattern, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_route_extractnamedparams, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_route_reconfigure, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_route_setname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_router_route_setname, 0, 1, Phalcon\\Cli\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_setname, 0, 1, IS_OBJECT, "Phalcon\\Cli\\Router\\Route", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_route_beforematch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_router_route_beforematch, 0, 1, Phalcon\\Cli\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_beforematch, 0, 1, IS_OBJECT, "Phalcon\\Cli\\Router\\Route", 0) +#endif ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_route_convert, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getrouteid, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getrouteid, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getpattern, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getpattern, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getcompiledpattern, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getcompiledpattern, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getpaths, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getpaths, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getreversedpaths, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getreversedpaths, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_router_route_convert, 0, 2, Phalcon\\Cli\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_convert, 0, 2, IS_OBJECT, "Phalcon\\Cli\\Router\\Route", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, converter) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getconverters, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getconverters, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_route_delimiter, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, delimiter, IS_STRING, 1) +#else ZEND_ARG_INFO(0, delimiter) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getdelimiter, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_route_getdelimiter, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cli_router_route_method_entry) { @@ -62,19 +162,19 @@ ZEPHIR_INIT_FUNCS(phalcon_cli_router_route_method_entry) { PHP_ME(Phalcon_Cli_Router_Route, compilePattern, arginfo_phalcon_cli_router_route_compilepattern, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router_Route, extractNamedParams, arginfo_phalcon_cli_router_route_extractnamedparams, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router_Route, reConfigure, arginfo_phalcon_cli_router_route_reconfigure, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router_Route, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router_Route, getName, arginfo_phalcon_cli_router_route_getname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router_Route, setName, arginfo_phalcon_cli_router_route_setname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router_Route, beforeMatch, arginfo_phalcon_cli_router_route_beforematch, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router_Route, getBeforeMatch, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router_Route, getRouteId, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router_Route, getPattern, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router_Route, getCompiledPattern, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router_Route, getPaths, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router_Route, getReversedPaths, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router_Route, getRouteId, arginfo_phalcon_cli_router_route_getrouteid, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router_Route, getPattern, arginfo_phalcon_cli_router_route_getpattern, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router_Route, getCompiledPattern, arginfo_phalcon_cli_router_route_getcompiledpattern, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router_Route, getPaths, arginfo_phalcon_cli_router_route_getpaths, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router_Route, getReversedPaths, arginfo_phalcon_cli_router_route_getreversedpaths, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router_Route, convert, arginfo_phalcon_cli_router_route_convert, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Cli_Router_Route, getConverters, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Cli_Router_Route, getConverters, arginfo_phalcon_cli_router_route_getconverters, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Cli_Router_Route, reset, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Cli_Router_Route, delimiter, arginfo_phalcon_cli_router_route_delimiter, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Cli_Router_Route, getDelimiter, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Cli_Router_Route, getDelimiter, arginfo_phalcon_cli_router_route_getdelimiter, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/ext/phalcon/cli/router/routeinterface.zep.h b/ext/phalcon/cli/router/routeinterface.zep.h index c155cd73229..75761df58fe 100644 --- a/ext/phalcon/cli/router/routeinterface.zep.h +++ b/ext/phalcon/cli/router/routeinterface.zep.h @@ -3,29 +3,87 @@ extern zend_class_entry *phalcon_cli_router_routeinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Cli_Router_RouteInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_routeinterface_compilepattern, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_compilepattern, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_compilepattern, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_routeinterface_reconfigure, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_router_routeinterface_setname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getrouteid, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getrouteid, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getpattern, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getpattern, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getcompiledpattern, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getcompiledpattern, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getpaths, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getpaths, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getreversedpaths, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_router_routeinterface_getreversedpaths, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cli_router_routeinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, compilePattern, arginfo_phalcon_cli_router_routeinterface_compilepattern) PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, reConfigure, arginfo_phalcon_cli_router_routeinterface_reconfigure) - PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getName, NULL) + PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getName, arginfo_phalcon_cli_router_routeinterface_getname) PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, setName, arginfo_phalcon_cli_router_routeinterface_setname) - PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getRouteId, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getPattern, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getCompiledPattern, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getPaths, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getReversedPaths, NULL) + PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getRouteId, arginfo_phalcon_cli_router_routeinterface_getrouteid) + PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getPattern, arginfo_phalcon_cli_router_routeinterface_getpattern) + PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getCompiledPattern, arginfo_phalcon_cli_router_routeinterface_getcompiledpattern) + PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getPaths, arginfo_phalcon_cli_router_routeinterface_getpaths) + PHP_ABSTRACT_ME(Phalcon_Cli_Router_RouteInterface, getReversedPaths, arginfo_phalcon_cli_router_routeinterface_getreversedpaths) ZEND_FENTRY(reset, NULL, NULL, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/cli/routerinterface.zep.h b/ext/phalcon/cli/routerinterface.zep.h index 238675e756f..b46903a5e02 100644 --- a/ext/phalcon/cli/routerinterface.zep.h +++ b/ext/phalcon/cli/routerinterface.zep.h @@ -4,15 +4,27 @@ extern zend_class_entry *phalcon_cli_routerinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Cli_RouterInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_routerinterface_setdefaultmodule, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, moduleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, moduleName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_routerinterface_setdefaulttask, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, taskName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, taskName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_routerinterface_setdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_routerinterface_setdefaults, 0, 0, 1) @@ -23,17 +35,93 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_routerinterface_handle, 0, 0, 0) ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_routerinterface_add, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_routerinterface_add, 0, 1, Phalcon\\Cli\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_add, 0, 1, IS_OBJECT, "Phalcon\\Cli\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_routerinterface_getroutebyid, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getmodulename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getmodulename, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_gettaskname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_gettaskname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getactionname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getactionname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getparams, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getparams, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_routerinterface_getmatchedroute, 0, 0, Phalcon\\Cli\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getmatchedroute, 0, 0, IS_OBJECT, "Phalcon\\Cli\\Router\\RouteInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getmatches, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getmatches, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_wasmatched, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_wasmatched, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_routerinterface_getroutes, 0, 0, Phalcon\\Cli\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getroutes, 0, 0, IS_OBJECT, "Phalcon\\Cli\\Router\\RouteInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_routerinterface_getroutebyid, 0, 1, Phalcon\\Cli\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getroutebyid, 0, 1, IS_OBJECT, "Phalcon\\Cli\\Router\\RouteInterface", 0) +#endif ZEND_ARG_INFO(0, id) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cli_routerinterface_getroutebyname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cli_routerinterface_getroutebyname, 0, 1, Phalcon\\Cli\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cli_routerinterface_getroutebyname, 0, 1, IS_OBJECT, "Phalcon\\Cli\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_cli_routerinterface_method_entry) { @@ -43,14 +131,14 @@ ZEPHIR_INIT_FUNCS(phalcon_cli_routerinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, setDefaults, arginfo_phalcon_cli_routerinterface_setdefaults) PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, handle, arginfo_phalcon_cli_routerinterface_handle) PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, add, arginfo_phalcon_cli_routerinterface_add) - PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getModuleName, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getTaskName, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getActionName, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getParams, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getMatchedRoute, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getMatches, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, wasMatched, NULL) - PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getRoutes, NULL) + PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getModuleName, arginfo_phalcon_cli_routerinterface_getmodulename) + PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getTaskName, arginfo_phalcon_cli_routerinterface_gettaskname) + PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getActionName, arginfo_phalcon_cli_routerinterface_getactionname) + PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getParams, arginfo_phalcon_cli_routerinterface_getparams) + PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getMatchedRoute, arginfo_phalcon_cli_routerinterface_getmatchedroute) + PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getMatches, arginfo_phalcon_cli_routerinterface_getmatches) + PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, wasMatched, arginfo_phalcon_cli_routerinterface_wasmatched) + PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getRoutes, arginfo_phalcon_cli_routerinterface_getroutes) PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getRouteById, arginfo_phalcon_cli_routerinterface_getroutebyid) PHP_ABSTRACT_ME(Phalcon_Cli_RouterInterface, getRouteByName, arginfo_phalcon_cli_routerinterface_getroutebyname) PHP_FE_END diff --git a/ext/phalcon/cli/task.zep.c b/ext/phalcon/cli/task.zep.c index fc7fee7427a..f98b9444bc5 100644 --- a/ext/phalcon/cli/task.zep.c +++ b/ext/phalcon/cli/task.zep.c @@ -56,10 +56,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Cli_Task) { PHP_METHOD(Phalcon_Cli_Task, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); - if ((zephir_method_exists_ex(this_ptr, SS("onconstruct") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(this_ptr, SL("onconstruct") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "onconstruct", NULL, 0); zephir_check_call_status(); } diff --git a/ext/phalcon/config.zep.c b/ext/phalcon/config.zep.c index 6c62539192d..f3024011d11 100644 --- a/ext/phalcon/config.zep.c +++ b/ext/phalcon/config.zep.c @@ -13,8 +13,8 @@ #include "kernel/main.h" #include "ext/spl/spl_iterators.h" -#include "kernel/fcall.h" #include "kernel/memory.h" +#include "kernel/fcall.h" #include "ext/spl/spl_exceptions.h" #include "kernel/exception.h" #include "kernel/object.h" @@ -55,7 +55,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Config) { zend_declare_property_null(phalcon_config_ce, SL("_pathDelimiter"), ZEND_ACC_PROTECTED|ZEND_ACC_STATIC TSRMLS_CC); - zend_declare_class_constant_string(phalcon_config_ce, SL("DEFAULT_PATH_DELIMITER"), "." TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_config_ce, SL("DEFAULT_PATH_DELIMITER"), "."); zend_class_implements(phalcon_config_ce TSRMLS_CC, 1, zend_ce_arrayaccess); zend_class_implements(phalcon_config_ce TSRMLS_CC, 1, spl_ce_Countable); @@ -68,34 +68,45 @@ ZEPHIR_INIT_CLASS(Phalcon_Config) { */ PHP_METHOD(Phalcon_Config, __construct) { - HashTable *_1; - HashPosition _0; + zend_string *_2; + zend_ulong _1; zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *arrayConfig_param = NULL, *key = NULL, *value = NULL, **_2; - zval *arrayConfig = NULL; + zval *arrayConfig_param = NULL, key, value, *_0; + zval arrayConfig; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&arrayConfig); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &arrayConfig_param); if (!arrayConfig_param) { - ZEPHIR_INIT_VAR(arrayConfig); - array_init(arrayConfig); + ZEPHIR_INIT_VAR(&arrayConfig); + array_init(&arrayConfig); } else { - arrayConfig = arrayConfig_param; + ZEPHIR_OBS_COPY_OR_DUP(&arrayConfig, arrayConfig_param); } - zephir_is_iterable(arrayConfig, &_1, &_0, 0, 0, "phalcon/config.zep", 67); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(key, _1, _0); - ZEPHIR_GET_HVALUE(value, _2); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "offsetset", &_3, 0, key, value); + zephir_is_iterable(&arrayConfig, 0, "phalcon/config.zep", 67); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&arrayConfig), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&key); + if (_2 != NULL) { + ZVAL_STR_COPY(&key, _2); + } else { + ZVAL_LONG(&key, _1); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "offsetset", &_3, 0, &key, &value); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); ZEPHIR_MM_RESTORE(); } @@ -112,7 +123,11 @@ PHP_METHOD(Phalcon_Config, __construct) { PHP_METHOD(Phalcon_Config, offsetExists) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index = NULL, *_0 = NULL; + zval *index = NULL, index_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index); @@ -120,9 +135,9 @@ PHP_METHOD(Phalcon_Config, offsetExists) { ZEPHIR_SEPARATE_PARAM(index); - ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 18, index); + ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 13, index); zephir_check_call_status(); - ZEPHIR_CPY_WRT(index, _0); + ZEPHIR_CPY_WRT(index, &_0); RETURN_MM_BOOL(zephir_isset_property_zval(this_ptr, index TSRMLS_CC)); } @@ -138,64 +153,78 @@ PHP_METHOD(Phalcon_Config, path) { zephir_fcall_cache_entry *_1 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, *defaultValue = NULL, *delimiter = NULL, *key = NULL, *keys = NULL, *config = NULL, *_0$$3, *_2$$7 = NULL, *_3$$5 = NULL; - zval *path = NULL; + zval *path_param = NULL, *defaultValue = NULL, defaultValue_sub, *delimiter = NULL, delimiter_sub, __$null, key, keys, config, _0$$3, _2$$7, _3$$5; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_UNDEF(&delimiter_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&config); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_3$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &path_param, &defaultValue, &delimiter); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } if (!delimiter) { - ZEPHIR_CPY_WRT(delimiter, ZEPHIR_GLOBAL(global_null)); + delimiter = &delimiter_sub; + ZEPHIR_CPY_WRT(delimiter, &__$null); } else { ZEPHIR_SEPARATE_PARAM(delimiter); } - if (zephir_isset_property_zval(this_ptr, path TSRMLS_CC)) { - ZEPHIR_OBS_VAR(_0$$3); - zephir_read_property_zval(&_0$$3, this_ptr, path, PH_NOISY_CC); - RETURN_CCTOR(_0$$3); + if (zephir_isset_property_zval(this_ptr, &path TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property_zval(&_0$$3, this_ptr, &path, PH_NOISY_CC); + RETURN_CCTOR(&_0$$3); } if (ZEPHIR_IS_EMPTY(delimiter)) { - ZEPHIR_CALL_SELF(&delimiter, "getpathdelimiter", NULL, 0); + ZEPHIR_CALL_SELF(delimiter, "getpathdelimiter", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CPY_WRT(config, this_ptr); - ZEPHIR_INIT_VAR(keys); - zephir_fast_explode(keys, delimiter, path, LONG_MAX TSRMLS_CC); + ZEPHIR_CPY_WRT(&config, this_ptr); + ZEPHIR_INIT_VAR(&keys); + zephir_fast_explode(&keys, delimiter, &path, LONG_MAX TSRMLS_CC); while (1) { - if (!(!(ZEPHIR_IS_EMPTY(keys)))) { + if (!(!(ZEPHIR_IS_EMPTY(&keys)))) { break; } - ZEPHIR_MAKE_REF(keys); - ZEPHIR_CALL_FUNCTION(&key, "array_shift", &_1, 19, keys); - ZEPHIR_UNREF(keys); + ZEPHIR_MAKE_REF(&keys); + ZEPHIR_CALL_FUNCTION(&key, "array_shift", &_1, 14, &keys); + ZEPHIR_UNREF(&keys); zephir_check_call_status(); - if (!(zephir_isset_property_zval(config, key TSRMLS_CC))) { + if (!(zephir_isset_property_zval(&config, &key TSRMLS_CC))) { break; } - if (ZEPHIR_IS_EMPTY(keys)) { - ZEPHIR_OBS_NVAR(_2$$7); - zephir_read_property_zval(&_2$$7, config, key, PH_NOISY_CC); - RETURN_CCTOR(_2$$7); + if (ZEPHIR_IS_EMPTY(&keys)) { + ZEPHIR_OBS_NVAR(&_2$$7); + zephir_read_property_zval(&_2$$7, &config, &key, PH_NOISY_CC); + RETURN_CCTOR(&_2$$7); } - ZEPHIR_OBS_NVAR(_3$$5); - zephir_read_property_zval(&_3$$5, config, key, PH_NOISY_CC); - ZEPHIR_CPY_WRT(config, _3$$5); - if (ZEPHIR_IS_EMPTY(config)) { + ZEPHIR_OBS_NVAR(&_3$$5); + zephir_read_property_zval(&_3$$5, &config, &key, PH_NOISY_CC); + ZEPHIR_CPY_WRT(&config, &_3$$5); + if (ZEPHIR_IS_EMPTY(&config)) { break; } } @@ -215,24 +244,32 @@ PHP_METHOD(Phalcon_Config, path) { PHP_METHOD(Phalcon_Config, get) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index = NULL, *defaultValue = NULL, *_0 = NULL, *_1$$3; + zval *index = NULL, index_sub, *defaultValue = NULL, defaultValue_sub, __$null, _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &index, &defaultValue); ZEPHIR_SEPARATE_PARAM(index); if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } - ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 18, index); + ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 13, index); zephir_check_call_status(); - ZEPHIR_CPY_WRT(index, _0); + ZEPHIR_CPY_WRT(index, &_0); if (zephir_isset_property_zval(this_ptr, index TSRMLS_CC)) { - ZEPHIR_OBS_VAR(_1$$3); + ZEPHIR_OBS_VAR(&_1$$3); zephir_read_property_zval(&_1$$3, this_ptr, index, PH_NOISY_CC); - RETURN_CCTOR(_1$$3); + RETURN_CCTOR(&_1$$3); } RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); @@ -251,7 +288,12 @@ PHP_METHOD(Phalcon_Config, get) { PHP_METHOD(Phalcon_Config, offsetGet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index = NULL, *_0 = NULL, *_1; + zval *index = NULL, index_sub, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index); @@ -259,12 +301,12 @@ PHP_METHOD(Phalcon_Config, offsetGet) { ZEPHIR_SEPARATE_PARAM(index); - ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 18, index); + ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 13, index); zephir_check_call_status(); - ZEPHIR_CPY_WRT(index, _0); - ZEPHIR_OBS_VAR(_1); + ZEPHIR_CPY_WRT(index, &_0); + ZEPHIR_OBS_VAR(&_1); zephir_read_property_zval(&_1, this_ptr, index, PH_NOISY_CC); - RETURN_CCTOR(_1); + RETURN_CCTOR(&_1); } @@ -280,7 +322,13 @@ PHP_METHOD(Phalcon_Config, offsetGet) { PHP_METHOD(Phalcon_Config, offsetSet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index = NULL, *value, *_0 = NULL, *_1$$3; + zval *index = NULL, index_sub, *value, value_sub, _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &index, &value); @@ -288,17 +336,17 @@ PHP_METHOD(Phalcon_Config, offsetSet) { ZEPHIR_SEPARATE_PARAM(index); - ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 18, index); + ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 13, index); zephir_check_call_status(); - ZEPHIR_CPY_WRT(index, _0); + ZEPHIR_CPY_WRT(index, &_0); if (Z_TYPE_P(value) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_config_ce); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 20, value); + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_config_ce); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 15, value); zephir_check_call_status(); - zephir_update_property_zval_zval(getThis(), index, _1$$3 TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, index, &_1$$3 TSRMLS_CC); } else { - zephir_update_property_zval_zval(getThis(), index, value TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, index, value TSRMLS_CC); } ZEPHIR_MM_RESTORE(); @@ -314,7 +362,12 @@ PHP_METHOD(Phalcon_Config, offsetSet) { PHP_METHOD(Phalcon_Config, offsetUnset) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index = NULL, *_0 = NULL; + zval *index = NULL, index_sub, __$null, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index); @@ -322,10 +375,10 @@ PHP_METHOD(Phalcon_Config, offsetUnset) { ZEPHIR_SEPARATE_PARAM(index); - ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 18, index); + ZEPHIR_CALL_FUNCTION(&_0, "strval", NULL, 13, index); zephir_check_call_status(); - ZEPHIR_CPY_WRT(index, _0); - zephir_update_property_zval_zval(getThis(), index, ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + ZEPHIR_CPY_WRT(index, &_0); + zephir_update_property_zval_zval(this_ptr, index, &__$null TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -348,14 +401,17 @@ PHP_METHOD(Phalcon_Config, offsetUnset) { PHP_METHOD(Phalcon_Config, merge) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config; + zval *config, config_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_merge", NULL, 21, config); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_merge", NULL, 16, config); zephir_check_call_status(); RETURN_MM(); @@ -372,37 +428,50 @@ PHP_METHOD(Phalcon_Config, merge) { */ PHP_METHOD(Phalcon_Config, toArray) { - HashTable *_2; - HashPosition _1; - zval *key = NULL, *value = NULL, *arrayConfig = NULL, *_0 = NULL, **_3, *_4$$5 = NULL; + zend_string *_3; + zend_ulong _2; + zval key, value, arrayConfig, _0, *_1, _4$$5; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&arrayConfig); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(arrayConfig); - array_init(arrayConfig); - ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 22, this_ptr); + ZEPHIR_INIT_VAR(&arrayConfig); + array_init(&arrayConfig); + ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 17, this_ptr); zephir_check_call_status(); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/config.zep", 243); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(key, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); - if (Z_TYPE_P(value) == IS_OBJECT) { - if ((zephir_method_exists_ex(value, SS("toarray") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(&_4$$5, value, "toarray", NULL, 0); + zephir_is_iterable(&_0, 0, "phalcon/config.zep", 243); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + if (Z_TYPE_P(&value) == IS_OBJECT) { + if ((zephir_method_exists_ex(&value, SL("toarray") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD(&_4$$5, &value, "toarray", NULL, 0); zephir_check_call_status(); - zephir_array_update_zval(&arrayConfig, key, &_4$$5, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&arrayConfig, &key, &_4$$5, PH_COPY | PH_SEPARATE); } else { - zephir_array_update_zval(&arrayConfig, key, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&arrayConfig, &key, &value, PH_COPY | PH_SEPARATE); } } else { - zephir_array_update_zval(&arrayConfig, key, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&arrayConfig, &key, &value, PH_COPY | PH_SEPARATE); } - } - RETURN_CCTOR(arrayConfig); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + RETURN_CCTOR(&arrayConfig); } @@ -421,14 +490,17 @@ PHP_METHOD(Phalcon_Config, toArray) { */ PHP_METHOD(Phalcon_Config, count) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 22, this_ptr); + ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 17, this_ptr); zephir_check_call_status(); - RETURN_MM_LONG(zephir_fast_count_int(_0 TSRMLS_CC)); + RETURN_MM_LONG(zephir_fast_count_int(&_0 TSRMLS_CC)); } @@ -439,16 +511,19 @@ PHP_METHOD(Phalcon_Config, __set_state) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *data_param = NULL; - zval *data = NULL; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data_param); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); object_init_ex(return_value, phalcon_config_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 20, data); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 15, &data); zephir_check_call_status(); RETURN_MM(); @@ -460,29 +535,32 @@ PHP_METHOD(Phalcon_Config, __set_state) { PHP_METHOD(Phalcon_Config, setPathDelimiter) { zval *delimiter_param = NULL; - zval *delimiter = NULL; + zval delimiter; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&delimiter); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &delimiter_param); if (!delimiter_param) { - ZEPHIR_INIT_VAR(delimiter); - ZVAL_EMPTY_STRING(delimiter); + ZEPHIR_INIT_VAR(&delimiter); + ZVAL_STRING(&delimiter, ""); } else { if (UNEXPECTED(Z_TYPE_P(delimiter_param) != IS_STRING && Z_TYPE_P(delimiter_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'delimiter' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'delimiter' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(delimiter_param) == IS_STRING)) { - zephir_get_strval(delimiter, delimiter_param); + zephir_get_strval(&delimiter, delimiter_param); } else { - ZEPHIR_INIT_VAR(delimiter); - ZVAL_EMPTY_STRING(delimiter); + ZEPHIR_INIT_VAR(&delimiter); + ZVAL_EMPTY_STRING(&delimiter); } } - zephir_update_static_property_ce(phalcon_config_ce, SL("_pathDelimiter"), &delimiter TSRMLS_CC); + zend_update_static_property(phalcon_config_ce, ZEND_STRL("_pathDelimiter"), &delimiter); ZEPHIR_MM_RESTORE(); } @@ -492,17 +570,20 @@ PHP_METHOD(Phalcon_Config, setPathDelimiter) { */ PHP_METHOD(Phalcon_Config, getPathDelimiter) { - zval *delimiter = NULL; + zval delimiter; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&delimiter); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(delimiter); - zephir_read_static_property_ce(&delimiter, phalcon_config_ce, SL("_pathDelimiter") TSRMLS_CC); - if (!(zephir_is_true(delimiter))) { - ZEPHIR_INIT_NVAR(delimiter); - ZVAL_STRING(delimiter, ".", 1); + ZEPHIR_OBS_VAR(&delimiter); + zephir_read_static_property_ce(&delimiter, phalcon_config_ce, SL("_pathDelimiter"), PH_NOISY_CC); + if (!(zephir_is_true(&delimiter))) { + ZEPHIR_INIT_NVAR(&delimiter); + ZVAL_STRING(&delimiter, "."); } - RETURN_CCTOR(delimiter); + RETURN_CCTOR(&delimiter); } @@ -517,17 +598,30 @@ PHP_METHOD(Phalcon_Config, getPathDelimiter) { PHP_METHOD(Phalcon_Config, _merge) { zend_bool _5$$5, _6$$6; - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *instance = NULL, *key = NULL, *value = NULL, *number = NULL, *localObject = NULL, *property = NULL, *_0 = NULL, **_3, *_8$$8 = NULL; + zval *config, config_sub, *instance = NULL, instance_sub, __$null, key, value, number, localObject, property, _0, *_1, _8$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&instance_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&number); + ZVAL_UNDEF(&localObject); + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_8$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &config, &instance); if (!instance) { - ZEPHIR_CPY_WRT(instance, ZEPHIR_GLOBAL(global_null)); + instance = &instance_sub; + ZEPHIR_CPY_WRT(instance, &__$null); } else { ZEPHIR_SEPARATE_PARAM(instance); } @@ -538,53 +632,59 @@ PHP_METHOD(Phalcon_Config, _merge) { } ZEPHIR_CALL_METHOD(&number, instance, "count", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 22, config); + ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 17, config); zephir_check_call_status(); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/config.zep", 336); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(key, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); - ZEPHIR_CALL_FUNCTION(&property, "strval", &_4, 18, key); + zephir_is_iterable(&_0, 0, "phalcon/config.zep", 336); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + ZEPHIR_CALL_FUNCTION(&property, "strval", &_4, 13, &key); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(localObject); - if (zephir_fetch_property_zval(&localObject, instance, property, PH_SILENT_CC)) { - _5$$5 = Z_TYPE_P(localObject) == IS_OBJECT; + ZEPHIR_OBS_NVAR(&localObject); + if (zephir_fetch_property_zval(&localObject, instance, &property, PH_SILENT_CC)) { + _5$$5 = Z_TYPE_P(&localObject) == IS_OBJECT; if (_5$$5) { - _5$$5 = Z_TYPE_P(value) == IS_OBJECT; + _5$$5 = Z_TYPE_P(&value) == IS_OBJECT; } if (_5$$5) { - _6$$6 = zephir_instance_of_ev(localObject, phalcon_config_ce TSRMLS_CC); + _6$$6 = zephir_instance_of_ev(&localObject, phalcon_config_ce TSRMLS_CC); if (_6$$6) { - _6$$6 = zephir_instance_of_ev(value, phalcon_config_ce TSRMLS_CC); + _6$$6 = zephir_instance_of_ev(&value, phalcon_config_ce TSRMLS_CC); } if (_6$$6) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_merge", &_7, 21, value, localObject); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_merge", &_7, 16, &value, &localObject); zephir_check_call_status(); continue; } } } - if (zephir_is_numeric(key)) { - ZEPHIR_CALL_FUNCTION(&_8$$8, "strval", &_4, 18, key); + if (zephir_is_numeric(&key)) { + ZEPHIR_CALL_FUNCTION(&_8$$8, "strval", &_4, 13, &key); zephir_check_call_status(); - ZEPHIR_CPY_WRT(key, _8$$8); + ZEPHIR_CPY_WRT(&key, &_8$$8); while (1) { - ZEPHIR_CALL_METHOD(&_8$$8, instance, "offsetexists", NULL, 0, key); + ZEPHIR_CALL_METHOD(&_8$$8, instance, "offsetexists", NULL, 0, &key); zephir_check_call_status(); - if (!(zephir_is_true(_8$$8))) { + if (!(zephir_is_true(&_8$$8))) { break; } - ZEPHIR_CALL_FUNCTION(&key, "strval", &_4, 18, number); + ZEPHIR_CALL_FUNCTION(&key, "strval", &_4, 13, &number); zephir_check_call_status(); - ZEPHIR_SEPARATE(number); - zephir_increment(number); + ZEPHIR_SEPARATE(&number); + zephir_increment(&number); } } - zephir_update_property_zval_zval(instance, key, value TSRMLS_CC); - } + zephir_update_property_zval_zval(instance, &key, &value TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); RETVAL_ZVAL(instance, 1, 0); RETURN_MM(); diff --git a/ext/phalcon/config.zep.h b/ext/phalcon/config.zep.h index 109e38045fa..745960c1360 100644 --- a/ext/phalcon/config.zep.h +++ b/ext/phalcon/config.zep.h @@ -22,12 +22,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config___construct, 0, 0, 0) ZEND_ARG_ARRAY_INFO(0, arrayConfig, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_offsetexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_offsetexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_offsetexists, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_path, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, defaultValue) ZEND_ARG_INFO(0, delimiter) ZEND_END_ARG_INFO() @@ -37,7 +45,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_get, 0, 0, 1) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_offsetget, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_offsetget, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_offsetget, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() @@ -50,19 +62,56 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_offsetunset, 0, 0, 1) ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_merge, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_config_merge, 0, 1, Phalcon\\Config, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_merge, 0, 1, IS_OBJECT, "Phalcon\\Config", 0) +#endif ZEND_ARG_OBJ_INFO(0, config, Phalcon\\Config, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_toarray, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_toarray, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_count, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_config___set_state, 0, 1, Phalcon\\Config, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config___set_state, 0, 1, IS_OBJECT, "Phalcon\\Config", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_setpathdelimiter, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, delimiter, IS_STRING, 1) +#else ZEND_ARG_INFO(0, delimiter) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_getpathdelimiter, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_getpathdelimiter, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config__merge, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_config__merge, 0, 1, Phalcon\\Config, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config__merge, 0, 1, IS_OBJECT, "Phalcon\\Config", 0) +#endif ZEND_ARG_OBJ_INFO(0, config, Phalcon\\Config, 0) ZEND_ARG_INFO(0, instance) ZEND_END_ARG_INFO() @@ -76,11 +125,11 @@ ZEPHIR_INIT_FUNCS(phalcon_config_method_entry) { PHP_ME(Phalcon_Config, offsetSet, arginfo_phalcon_config_offsetset, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Config, offsetUnset, arginfo_phalcon_config_offsetunset, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Config, merge, arginfo_phalcon_config_merge, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Config, toArray, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Config, count, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Config, toArray, arginfo_phalcon_config_toarray, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Config, count, arginfo_phalcon_config_count, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Config, __set_state, arginfo_phalcon_config___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Config, setPathDelimiter, arginfo_phalcon_config_setpathdelimiter, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Config, getPathDelimiter, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Config, getPathDelimiter, arginfo_phalcon_config_getpathdelimiter, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Config, _merge, arginfo_phalcon_config__merge, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_FE_END }; diff --git a/ext/phalcon/config/adapter/grouped.zep.c b/ext/phalcon/config/adapter/grouped.zep.c index 9e64152ba5b..6b1bbb66a2f 100644 --- a/ext/phalcon/config/adapter/grouped.zep.c +++ b/ext/phalcon/config/adapter/grouped.zep.c @@ -85,75 +85,83 @@ ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Grouped) { */ PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct) { - HashTable *_3; - HashPosition _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_0 = NULL, *_6 = NULL, *_8 = NULL, *_9 = NULL; - zval *defaultAdapter = NULL; - zval *arrayConfig_param = NULL, *defaultAdapter_param = NULL, *configName = NULL, *configInstance = NULL, *configArray = NULL, *_1, **_4, *_5$$3, *_7$$9 = NULL; - zval *arrayConfig = NULL; + zephir_fcall_cache_entry *_0 = NULL, *_4 = NULL, *_6 = NULL, *_7 = NULL; + zval defaultAdapter; + zval *arrayConfig_param = NULL, *defaultAdapter_param = NULL, configName, configInstance, configArray, _1, *_2, _3$$3, _5$$9; + zval arrayConfig; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&arrayConfig); + ZVAL_UNDEF(&configName); + ZVAL_UNDEF(&configInstance); + ZVAL_UNDEF(&configArray); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&defaultAdapter); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &arrayConfig_param, &defaultAdapter_param); - arrayConfig = arrayConfig_param; + ZEPHIR_OBS_COPY_OR_DUP(&arrayConfig, arrayConfig_param); if (!defaultAdapter_param) { - ZEPHIR_INIT_VAR(defaultAdapter); - ZVAL_STRING(defaultAdapter, "php", 1); + ZEPHIR_INIT_VAR(&defaultAdapter); + ZVAL_STRING(&defaultAdapter, "php"); } else { if (UNEXPECTED(Z_TYPE_P(defaultAdapter_param) != IS_STRING && Z_TYPE_P(defaultAdapter_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'defaultAdapter' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'defaultAdapter' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(defaultAdapter_param) == IS_STRING)) { - zephir_get_strval(defaultAdapter, defaultAdapter_param); + zephir_get_strval(&defaultAdapter, defaultAdapter_param); } else { - ZEPHIR_INIT_VAR(defaultAdapter); - ZVAL_EMPTY_STRING(defaultAdapter); + ZEPHIR_INIT_VAR(&defaultAdapter); + ZVAL_EMPTY_STRING(&defaultAdapter); } } - ZEPHIR_INIT_VAR(_1); - array_init(_1); - ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_grouped_ce, getThis(), "__construct", &_0, 20, _1); + ZEPHIR_INIT_VAR(&_1); + array_init(&_1); + ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_grouped_ce, getThis(), "__construct", &_0, 0, &_1); zephir_check_call_status(); - zephir_is_iterable(arrayConfig, &_3, &_2, 0, 0, "phalcon/config/adapter/grouped.zep", 115); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HVALUE(configName, _4); - ZEPHIR_CPY_WRT(configInstance, configName); - if (Z_TYPE_P(configName) == IS_STRING) { - ZEPHIR_INIT_NVAR(configInstance); - zephir_create_array(configInstance, 2, 0 TSRMLS_CC); + zephir_is_iterable(&arrayConfig, 0, "phalcon/config/adapter/grouped.zep", 115); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arrayConfig), _2) + { + ZEPHIR_INIT_NVAR(&configName); + ZVAL_COPY(&configName, _2); + ZEPHIR_CPY_WRT(&configInstance, &configName); + if (Z_TYPE_P(&configName) == IS_STRING) { + ZEPHIR_INIT_NVAR(&configInstance); + zephir_create_array(&configInstance, 2, 0 TSRMLS_CC); zephir_array_update_string(&configInstance, SL("filePath"), &configName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&configInstance, SL("adapter"), &defaultAdapter, PH_COPY | PH_SEPARATE); - } else if (!(zephir_array_isset_string(configInstance, SS("adapter")))) { + } else if (!(zephir_array_isset_string(&configInstance, SL("adapter")))) { zephir_array_update_string(&configInstance, SL("adapter"), &defaultAdapter, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_string(&_5$$3, configInstance, SL("adapter"), PH_NOISY | PH_READONLY, "phalcon/config/adapter/grouped.zep", 100 TSRMLS_CC); - if (ZEPHIR_IS_STRING_IDENTICAL(_5$$3, "array")) { - if (!(zephir_array_isset_string(configInstance, SS("config")))) { + zephir_array_fetch_string(&_3$$3, &configInstance, SL("adapter"), PH_NOISY | PH_READONLY, "phalcon/config/adapter/grouped.zep", 100 TSRMLS_CC); + if (ZEPHIR_IS_STRING_IDENTICAL(&_3$$3, "array")) { + if (!(zephir_array_isset_string(&configInstance, SL("config")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "To use 'array' adapter you have to specify the 'config' as an array.", "phalcon/config/adapter/grouped.zep", 104); return; } else { - ZEPHIR_OBS_NVAR(configArray); - zephir_array_fetch_string(&configArray, configInstance, SL("config"), PH_NOISY, "phalcon/config/adapter/grouped.zep", 106 TSRMLS_CC); - ZEPHIR_INIT_NVAR(configInstance); - object_init_ex(configInstance, phalcon_config_ce); - ZEPHIR_CALL_METHOD(NULL, configInstance, "__construct", &_6, 20, configArray); + ZEPHIR_OBS_NVAR(&configArray); + zephir_array_fetch_string(&configArray, &configInstance, SL("config"), PH_NOISY, "phalcon/config/adapter/grouped.zep", 106 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&configInstance); + object_init_ex(&configInstance, phalcon_config_ce); + ZEPHIR_CALL_METHOD(NULL, &configInstance, "__construct", &_4, 15, &configArray); zephir_check_call_status(); } } else { - ZEPHIR_CALL_CE_STATIC(&_7$$9, phalcon_config_factory_ce, "load", &_8, 0, configInstance); + ZEPHIR_CALL_CE_STATIC(&_5$$9, phalcon_config_factory_ce, "load", &_6, 0, &configInstance); zephir_check_call_status(); - ZEPHIR_CPY_WRT(configInstance, _7$$9); + ZEPHIR_CPY_WRT(&configInstance, &_5$$9); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_merge", &_9, 21, configInstance); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_merge", &_7, 16, &configInstance); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&configName); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/config/adapter/grouped.zep.h b/ext/phalcon/config/adapter/grouped.zep.h index 29def203340..40e19360288 100644 --- a/ext/phalcon/config/adapter/grouped.zep.h +++ b/ext/phalcon/config/adapter/grouped.zep.h @@ -7,7 +7,11 @@ PHP_METHOD(Phalcon_Config_Adapter_Grouped, __construct); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_adapter_grouped___construct, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, arrayConfig, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultAdapter, IS_STRING, 0) +#else ZEND_ARG_INFO(0, defaultAdapter) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_config_adapter_grouped_method_entry) { diff --git a/ext/phalcon/config/adapter/ini.zep.c b/ext/phalcon/config/adapter/ini.zep.c index 2ee17cfbc3b..54b9b0ff387 100644 --- a/ext/phalcon/config/adapter/ini.zep.c +++ b/ext/phalcon/config/adapter/ini.zep.c @@ -78,28 +78,50 @@ ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Ini) { */ PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct) { - HashTable *_4, *_7$$6; - HashPosition _3, _6$$6; + zend_string *_5, *_8$$6; + zend_ulong _4, _7$$6; zephir_fcall_cache_entry *_11 = NULL, *_15 = NULL, *_16 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *filePath_param = NULL, *mode = NULL, *iniConfig = NULL, *config = NULL, *section = NULL, *sections = NULL, *directives = NULL, *path = NULL, *lastValue = NULL, **_5, *_0$$4, *_1$$4, *_2$$4, **_8$$6, *_9$$7 = NULL, *_12$$8 = NULL, _13$$8 = zval_used_for_init, *_14$$9 = NULL; - zval *filePath = NULL, *_10$$7 = NULL; + zval *filePath_param = NULL, *mode = NULL, mode_sub, __$true, __$null, iniConfig, config, section, sections, directives, path, lastValue, *_3, _0$$4, _1$$4, _2$$4, *_6$$6, _9$$7, _12$$8, _13$$8, _14$$9; + zval filePath, _10$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filePath); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&mode_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&iniConfig); + ZVAL_UNDEF(&config); + ZVAL_UNDEF(§ion); + ZVAL_UNDEF(§ions); + ZVAL_UNDEF(&directives); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&lastValue); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_12$$8); + ZVAL_UNDEF(&_13$$8); + ZVAL_UNDEF(&_14$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &filePath_param, &mode); if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) { - zephir_get_strval(filePath, filePath_param); + zephir_get_strval(&filePath, filePath_param); } else { - ZEPHIR_INIT_VAR(filePath); - ZVAL_EMPTY_STRING(filePath); + ZEPHIR_INIT_VAR(&filePath); + ZVAL_EMPTY_STRING(&filePath); } if (!mode) { - ZEPHIR_CPY_WRT(mode, ZEPHIR_GLOBAL(global_null)); + mode = &mode_sub; + ZEPHIR_CPY_WRT(mode, &__$null); } else { ZEPHIR_SEPARATE_PARAM(mode); } @@ -109,60 +131,72 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct) { ZEPHIR_INIT_NVAR(mode); ZVAL_LONG(mode, 1); } - ZEPHIR_CALL_FUNCTION(&iniConfig, "parse_ini_file", NULL, 146, filePath, ZEPHIR_GLOBAL(global_true), mode); + ZEPHIR_CALL_FUNCTION(&iniConfig, "parse_ini_file", NULL, 126, &filePath, &__$true, mode); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(iniConfig)) { - ZEPHIR_INIT_VAR(_0$$4); - object_init_ex(_0$$4, phalcon_config_exception_ce); - ZEPHIR_INIT_VAR(_1$$4); - zephir_basename(_1$$4, filePath TSRMLS_CC); - ZEPHIR_INIT_VAR(_2$$4); - ZEPHIR_CONCAT_SVS(_2$$4, "Configuration file ", _1$$4, " can't be loaded"); - ZEPHIR_CALL_METHOD(NULL, _0$$4, "__construct", NULL, 9, _2$$4); + if (ZEPHIR_IS_FALSE_IDENTICAL(&iniConfig)) { + ZEPHIR_INIT_VAR(&_0$$4); + object_init_ex(&_0$$4, phalcon_config_exception_ce); + ZEPHIR_INIT_VAR(&_1$$4); + zephir_basename(&_1$$4, &filePath TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$4); + ZEPHIR_CONCAT_SVS(&_2$$4, "Configuration file ", &_1$$4, " can't be loaded"); + ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 4, &_2$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$4, "phalcon/config/adapter/ini.zep", 85 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$4, "phalcon/config/adapter/ini.zep", 85 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(config); - array_init(config); - zephir_is_iterable(iniConfig, &_4, &_3, 0, 0, "phalcon/config/adapter/ini.zep", 106); - for ( - ; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS - ; zend_hash_move_forward_ex(_4, &_3) - ) { - ZEPHIR_GET_HMKEY(section, _4, _3); - ZEPHIR_GET_HVALUE(directives, _5); - if (Z_TYPE_P(directives) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(sections); - array_init(sections); - zephir_is_iterable(directives, &_7$$6, &_6$$6, 0, 0, "phalcon/config/adapter/ini.zep", 98); - for ( - ; zend_hash_get_current_data_ex(_7$$6, (void**) &_8$$6, &_6$$6) == SUCCESS - ; zend_hash_move_forward_ex(_7$$6, &_6$$6) - ) { - ZEPHIR_GET_HMKEY(path, _7$$6, _6$$6); - ZEPHIR_GET_HVALUE(lastValue, _8$$6); - zephir_get_strval(_10$$7, path); - ZEPHIR_CALL_METHOD(&_9$$7, this_ptr, "_parseinistring", &_11, 0, _10$$7, lastValue); + ZEPHIR_INIT_VAR(&config); + array_init(&config); + zephir_is_iterable(&iniConfig, 0, "phalcon/config/adapter/ini.zep", 106); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&iniConfig), _4, _5, _3) + { + ZEPHIR_INIT_NVAR(§ion); + if (_5 != NULL) { + ZVAL_STR_COPY(§ion, _5); + } else { + ZVAL_LONG(§ion, _4); + } + ZEPHIR_INIT_NVAR(&directives); + ZVAL_COPY(&directives, _3); + if (Z_TYPE_P(&directives) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(§ions); + array_init(§ions); + zephir_is_iterable(&directives, 0, "phalcon/config/adapter/ini.zep", 98); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&directives), _7$$6, _8$$6, _6$$6) + { + ZEPHIR_INIT_NVAR(&path); + if (_8$$6 != NULL) { + ZVAL_STR_COPY(&path, _8$$6); + } else { + ZVAL_LONG(&path, _7$$6); + } + ZEPHIR_INIT_NVAR(&lastValue); + ZVAL_COPY(&lastValue, _6$$6); + zephir_get_strval(&_10$$7, &path); + ZEPHIR_CALL_METHOD(&_9$$7, this_ptr, "_parseinistring", &_11, 0, &_10$$7, &lastValue); zephir_check_call_status(); - zephir_array_append(§ions, _9$$7, PH_SEPARATE, "phalcon/config/adapter/ini.zep", 96); - } - if (zephir_fast_count_int(sections TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_12$$8); - ZEPHIR_SINIT_NVAR(_13$$8); - ZVAL_STRING(&_13$$8, "array_replace_recursive", 0); - ZEPHIR_CALL_USER_FUNC_ARRAY(_12$$8, &_13$$8, sections); + zephir_array_append(§ions, &_9$$7, PH_SEPARATE, "phalcon/config/adapter/ini.zep", 96); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&lastValue); + ZEPHIR_INIT_NVAR(&path); + if (zephir_fast_count_int(§ions TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_12$$8); + ZEPHIR_INIT_NVAR(&_13$$8); + ZVAL_STRING(&_13$$8, "array_replace_recursive"); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_12$$8, &_13$$8, §ions); zephir_check_call_status(); - zephir_array_update_zval(&config, section, &_12$$8, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&config, §ion, &_12$$8, PH_COPY | PH_SEPARATE); } } else { - ZEPHIR_CALL_METHOD(&_14$$9, this_ptr, "_cast", &_15, 0, directives); + ZEPHIR_CALL_METHOD(&_14$$9, this_ptr, "_cast", &_15, 0, &directives); zephir_check_call_status(); - zephir_array_update_zval(&config, section, &_14$$9, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&config, §ion, &_14$$9, PH_COPY | PH_SEPARATE); } - } - ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_ini_ce, getThis(), "__construct", &_16, 20, config); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&directives); + ZEPHIR_INIT_NVAR(§ion); + ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_ini_ce, getThis(), "__construct", &_16, 0, &config); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -187,50 +221,59 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, __construct) { PHP_METHOD(Phalcon_Config_Adapter_Ini, _parseIniString) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, *value = NULL, *pos = NULL, *key = NULL, *_0 = NULL, _1, _2, _3, *_4; - zval *path = NULL; + zval *path_param = NULL, *value = NULL, value_sub, pos, key, _0, _1, _2, _3, _4; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&pos); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &path_param, &value); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } ZEPHIR_SEPARATE_PARAM(value); ZEPHIR_CALL_METHOD(&_0, this_ptr, "_cast", NULL, 0, value); zephir_check_call_status(); - ZEPHIR_CPY_WRT(value, _0); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, ".", 0); - ZEPHIR_INIT_VAR(pos); - zephir_fast_strpos(pos, path, &_1, 0 ); - if (ZEPHIR_IS_FALSE_IDENTICAL(pos)) { + ZEPHIR_CPY_WRT(value, &_0); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "."); + ZEPHIR_INIT_VAR(&pos); + zephir_fast_strpos(&pos, &path, &_1, 0 ); + if (ZEPHIR_IS_FALSE_IDENTICAL(&pos)) { zephir_create_array(return_value, 1, 0 TSRMLS_CC); - zephir_array_update_zval(&return_value, path, &value, PH_COPY); + zephir_array_update_zval(return_value, &path, value, PH_COPY); RETURN_MM(); } - ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, 0); - ZEPHIR_INIT_VAR(key); - zephir_substr(key, path, 0 , zephir_get_intval(pos), 0); - ZEPHIR_SINIT_VAR(_3); - ZVAL_LONG(&_3, (zephir_get_numberval(pos) + 1)); - ZEPHIR_INIT_VAR(_4); - zephir_substr(_4, path, zephir_get_intval(&_3), 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_get_strval(path, _4); + ZEPHIR_INIT_VAR(&key); + zephir_substr(&key, &path, 0 , zephir_get_intval(&pos), 0); + ZVAL_LONG(&_3, (zephir_get_numberval(&pos) + 1)); + ZEPHIR_INIT_VAR(&_4); + zephir_substr(&_4, &path, zephir_get_intval(&_3), 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_get_strval(&path, &_4); zephir_create_array(return_value, 1, 0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "_parseinistring", NULL, 147, path, value); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "_parseinistring", NULL, 127, &path, value); zephir_check_call_status(); - zephir_array_update_zval(&return_value, key, &_0, PH_COPY); + zephir_array_update_zval(return_value, &key, &_0, PH_COPY); RETURN_MM(); } @@ -243,11 +286,23 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, _parseIniString) { PHP_METHOD(Phalcon_Config_Adapter_Ini, _cast) { zend_bool _5$$5, _6$$5, _8$$5, _9$$5; - HashTable *_1$$3; - HashPosition _0$$3; + zend_string *_2$$3; + zend_ulong _1$$3; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *ini, *key = NULL, *val = NULL, **_2$$3, *_3$$4 = NULL, *_7$$5, *_10$$5, *_11$$9, *_12$$9, _13$$9; + zval *ini, ini_sub, key, val, *_0$$3, _3$$4, _7$$5, _10$$5, _11$$9, _12$$9, _13$$9, _14$$9; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&ini_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&val); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_11$$9); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_14$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &ini); @@ -256,19 +311,23 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, _cast) { if (Z_TYPE_P(ini) == IS_ARRAY) { - zephir_is_iterable(ini, &_1$$3, &_0$$3, 1, 0, "phalcon/config/adapter/ini.zep", 152); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(val, _2$$3); - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_cast", &_4, 148, val); + zephir_is_iterable(ini, 1, "phalcon/config/adapter/ini.zep", 152); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(ini), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&key, _2$$3); + } else { + ZVAL_LONG(&key, _1$$3); + } + ZEPHIR_INIT_NVAR(&val); + ZVAL_COPY(&val, _0$$3); + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_cast", &_4, 128, &val); zephir_check_call_status(); - zephir_array_update_zval(&ini, key, &_3$$4, PH_COPY | PH_SEPARATE); - } - zend_hash_destroy(_1$$3); - FREE_HASHTABLE(_1$$3); + zephir_array_update_zval(ini, &key, &_3$$4, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&val); + ZEPHIR_INIT_NVAR(&key); } if (Z_TYPE_P(ini) == IS_STRING) { _5$$5 = ZEPHIR_IS_STRING_IDENTICAL(ini, "true"); @@ -277,9 +336,9 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, _cast) { } _6$$5 = _5$$5; if (!(_6$$5)) { - ZEPHIR_INIT_VAR(_7$$5); - zephir_fast_strtolower(_7$$5, ini); - _6$$5 = ZEPHIR_IS_STRING_IDENTICAL(_7$$5, "on"); + ZEPHIR_INIT_VAR(&_7$$5); + zephir_fast_strtolower(&_7$$5, ini); + _6$$5 = ZEPHIR_IS_STRING_IDENTICAL(&_7$$5, "on"); } if (_6$$5) { RETURN_MM_BOOL(1); @@ -290,9 +349,9 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, _cast) { } _9$$5 = _8$$5; if (!(_9$$5)) { - ZEPHIR_INIT_VAR(_10$$5); - zephir_fast_strtolower(_10$$5, ini); - _9$$5 = ZEPHIR_IS_STRING_IDENTICAL(_10$$5, "off"); + ZEPHIR_INIT_VAR(&_10$$5); + zephir_fast_strtolower(&_10$$5, ini); + _9$$5 = ZEPHIR_IS_STRING_IDENTICAL(&_10$$5, "off"); } if (_9$$5) { RETURN_MM_BOOL(0); @@ -301,12 +360,14 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, _cast) { RETURN_MM_NULL(); } if (zephir_is_numeric(ini)) { - ZEPHIR_INIT_VAR(_11$$9); - ZEPHIR_INIT_VAR(_12$$9); - ZEPHIR_SINIT_VAR(_13$$9); - ZVAL_STRING(&_13$$9, "/[.]+/", 0); - zephir_preg_match(_12$$9, &_13$$9, ini, _11$$9, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(_12$$9)) { + ZEPHIR_INIT_VAR(&_11$$9); + ZEPHIR_INIT_VAR(&_12$$9); + ZVAL_STRING(&_12$$9, "/[.]+/"); + ZEPHIR_INIT_VAR(&_13$$9); + ZEPHIR_INIT_VAR(&_14$$9); + ZVAL_STRING(&_14$$9, "/[.]+/"); + zephir_preg_match(&_13$$9, &_14$$9, ini, &_11$$9, 0, 0 , 0 TSRMLS_CC); + if (zephir_is_true(&_13$$9)) { RETURN_MM_DOUBLE(zephir_get_doubleval(ini)); } else { RETURN_MM_LONG(zephir_get_intval(ini)); diff --git a/ext/phalcon/config/adapter/ini.zep.h b/ext/phalcon/config/adapter/ini.zep.h index d21286cf11c..bedc52074ca 100644 --- a/ext/phalcon/config/adapter/ini.zep.h +++ b/ext/phalcon/config/adapter/ini.zep.h @@ -8,12 +8,24 @@ PHP_METHOD(Phalcon_Config_Adapter_Ini, _parseIniString); PHP_METHOD(Phalcon_Config_Adapter_Ini, _cast); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_adapter_ini___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filePath) +#endif ZEND_ARG_INFO(0, mode) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_adapter_ini__parseinistring, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_adapter_ini__parseinistring, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_adapter_ini__parseinistring, 0, 2, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/config/adapter/json.zep.c b/ext/phalcon/config/adapter/json.zep.c index be73cc20cc6..73016270175 100644 --- a/ext/phalcon/config/adapter/json.zep.c +++ b/ext/phalcon/config/adapter/json.zep.c @@ -56,29 +56,35 @@ PHP_METHOD(Phalcon_Config_Adapter_Json, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *filePath_param = NULL, *_1, *_2; - zval *filePath = NULL; + zval *filePath_param = NULL, __$true, _1, _2; + zval filePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filePath); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &filePath_param); if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) { - zephir_get_strval(filePath, filePath_param); + zephir_get_strval(&filePath, filePath_param); } else { - ZEPHIR_INIT_VAR(filePath); - ZVAL_EMPTY_STRING(filePath); + ZEPHIR_INIT_VAR(&filePath); + ZVAL_EMPTY_STRING(&filePath); } - ZEPHIR_INIT_VAR(_1); - ZEPHIR_INIT_VAR(_2); - zephir_file_get_contents(_2, filePath TSRMLS_CC); - zephir_json_decode(_1, &(_1), _2, zephir_get_intval(ZEPHIR_GLOBAL(global_true)) TSRMLS_CC); - ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_json_ce, getThis(), "__construct", &_0, 20, _1); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_INIT_VAR(&_2); + zephir_file_get_contents(&_2, &filePath TSRMLS_CC); + zephir_json_decode(&_1, &_2, zephir_get_intval(&__$true) ); + ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_json_ce, getThis(), "__construct", &_0, 0, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/config/adapter/json.zep.h b/ext/phalcon/config/adapter/json.zep.h index 667dd84fbc7..e9cd9091c79 100644 --- a/ext/phalcon/config/adapter/json.zep.h +++ b/ext/phalcon/config/adapter/json.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Json); PHP_METHOD(Phalcon_Config_Adapter_Json, __construct); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_adapter_json___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filePath) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_config_adapter_json_method_entry) { diff --git a/ext/phalcon/config/adapter/php.zep.c b/ext/phalcon/config/adapter/php.zep.c index b157be1e59a..5fb3b1f4f2f 100644 --- a/ext/phalcon/config/adapter/php.zep.c +++ b/ext/phalcon/config/adapter/php.zep.c @@ -70,29 +70,33 @@ PHP_METHOD(Phalcon_Config_Adapter_Php, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *filePath_param = NULL, *_1 = NULL; - zval *filePath = NULL; + zval *filePath_param = NULL, _1; + zval filePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filePath); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &filePath_param); if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) { - zephir_get_strval(filePath, filePath_param); + zephir_get_strval(&filePath, filePath_param); } else { - ZEPHIR_INIT_VAR(filePath); - ZVAL_EMPTY_STRING(filePath); + ZEPHIR_INIT_VAR(&filePath); + ZVAL_EMPTY_STRING(&filePath); } ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(&_1); - if (zephir_require_zval_ret(&_1, filePath TSRMLS_CC) == FAILURE) { + if (zephir_require_zval_ret(&_1, &filePath TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } - ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_php_ce, getThis(), "__construct", &_0, 20, _1); + ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_php_ce, getThis(), "__construct", &_0, 0, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/config/adapter/php.zep.h b/ext/phalcon/config/adapter/php.zep.h index 79a9dbd2054..44021eedc63 100644 --- a/ext/phalcon/config/adapter/php.zep.h +++ b/ext/phalcon/config/adapter/php.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Php); PHP_METHOD(Phalcon_Config_Adapter_Php, __construct); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_adapter_php___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filePath) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_config_adapter_php_method_entry) { diff --git a/ext/phalcon/config/adapter/yaml.zep.c b/ext/phalcon/config/adapter/yaml.zep.c index 8980baa9bb8..fae8143c43b 100644 --- a/ext/phalcon/config/adapter/yaml.zep.c +++ b/ext/phalcon/config/adapter/yaml.zep.c @@ -75,67 +75,77 @@ PHP_METHOD(Phalcon_Config_Adapter_Yaml, __construct) { zephir_fcall_cache_entry *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, ndocs; - zval *callbacks = NULL; - zval *filePath_param = NULL, *callbacks_param = NULL, *yamlConfig = NULL, _0, *_1 = NULL, *_2$$4, *_3$$4, *_4$$6, *_5$$6, *_6$$6; - zval *filePath = NULL; + zval callbacks; + zval *filePath_param = NULL, *callbacks_param = NULL, yamlConfig, _0, _1, _2$$4, _3$$4, _4$$6, _5$$6, _6$$6; + zval filePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filePath); + ZVAL_UNDEF(&yamlConfig); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&callbacks); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &filePath_param, &callbacks_param); if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) { - zephir_get_strval(filePath, filePath_param); + zephir_get_strval(&filePath, filePath_param); } else { - ZEPHIR_INIT_VAR(filePath); - ZVAL_EMPTY_STRING(filePath); + ZEPHIR_INIT_VAR(&filePath); + ZVAL_EMPTY_STRING(&filePath); } if (!callbacks_param) { - ZEPHIR_INIT_VAR(callbacks); - array_init(callbacks); + ZEPHIR_INIT_VAR(&callbacks); + array_init(&callbacks); } else { - callbacks = callbacks_param; + ZEPHIR_OBS_COPY_OR_DUP(&callbacks, callbacks_param); } ndocs = 0; - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "yaml", 0); - ZEPHIR_CALL_FUNCTION(&_1, "extension_loaded", NULL, 149, &_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "yaml"); + ZEPHIR_CALL_FUNCTION(&_1, "extension_loaded", NULL, 129, &_0); zephir_check_call_status(); - if (!(zephir_is_true(_1))) { + if (!(zephir_is_true(&_1))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_config_exception_ce, "Yaml extension not loaded", "phalcon/config/adapter/yaml.zep", 76); return; } - if (!ZEPHIR_IS_STRING_IDENTICAL(callbacks, "")) { - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_LONG(_2$$4, 0); - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_LONG(_3$$4, ndocs); - ZEPHIR_MAKE_REF(_3$$4); - ZEPHIR_CALL_FUNCTION(&yamlConfig, "yaml_parse_file", NULL, 150, filePath, _2$$4, _3$$4, callbacks); - ZEPHIR_UNREF(_3$$4); + if (!ZEPHIR_IS_STRING_IDENTICAL(&callbacks, "")) { + ZVAL_LONG(&_2$$4, 0); + ZVAL_LONG(&_3$$4, ndocs); + ZEPHIR_MAKE_REF(&_3$$4); + ZEPHIR_CALL_FUNCTION(&yamlConfig, "yaml_parse_file", NULL, 130, &filePath, &_2$$4, &_3$$4, &callbacks); + ZEPHIR_UNREF(&_3$$4); zephir_check_call_status(); } else { - ZEPHIR_CALL_FUNCTION(&yamlConfig, "yaml_parse_file", NULL, 150, filePath); + ZEPHIR_CALL_FUNCTION(&yamlConfig, "yaml_parse_file", NULL, 130, &filePath); zephir_check_call_status(); } - if (ZEPHIR_IS_FALSE_IDENTICAL(yamlConfig)) { - ZEPHIR_INIT_VAR(_4$$6); - object_init_ex(_4$$6, phalcon_config_exception_ce); - ZEPHIR_INIT_VAR(_5$$6); - zephir_basename(_5$$6, filePath TSRMLS_CC); - ZEPHIR_INIT_VAR(_6$$6); - ZEPHIR_CONCAT_SVS(_6$$6, "Configuration file ", _5$$6, " can't be loaded"); - ZEPHIR_CALL_METHOD(NULL, _4$$6, "__construct", NULL, 9, _6$$6); + if (ZEPHIR_IS_FALSE_IDENTICAL(&yamlConfig)) { + ZEPHIR_INIT_VAR(&_4$$6); + object_init_ex(&_4$$6, phalcon_config_exception_ce); + ZEPHIR_INIT_VAR(&_5$$6); + zephir_basename(&_5$$6, &filePath TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$6); + ZEPHIR_CONCAT_SVS(&_6$$6, "Configuration file ", &_5$$6, " can't be loaded"); + ZEPHIR_CALL_METHOD(NULL, &_4$$6, "__construct", NULL, 4, &_6$$6); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$6, "phalcon/config/adapter/yaml.zep", 86 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$6, "phalcon/config/adapter/yaml.zep", 86 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_yaml_ce, getThis(), "__construct", &_7, 20, yamlConfig); + ZEPHIR_CALL_PARENT(NULL, phalcon_config_adapter_yaml_ce, getThis(), "__construct", &_7, 0, &yamlConfig); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/config/adapter/yaml.zep.h b/ext/phalcon/config/adapter/yaml.zep.h index f0f9fed43c3..7f029f6306b 100644 --- a/ext/phalcon/config/adapter/yaml.zep.h +++ b/ext/phalcon/config/adapter/yaml.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Config_Adapter_Yaml); PHP_METHOD(Phalcon_Config_Adapter_Yaml, __construct); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_adapter_yaml___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filePath) +#endif ZEND_ARG_ARRAY_INFO(0, callbacks, 1) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/config/factory.zep.c b/ext/phalcon/config/factory.zep.c index b5df8e0e48b..f1145857e09 100644 --- a/ext/phalcon/config/factory.zep.c +++ b/ext/phalcon/config/factory.zep.c @@ -49,17 +49,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Config_Factory) { PHP_METHOD(Phalcon_Config_Factory, load) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *_0; + zval *config, config_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Phalcon\\Config\\Adapter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, _0, config); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Phalcon\\Config\\Adapter"); + ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, &_0, config); zephir_check_call_status(); RETURN_MM(); @@ -67,103 +70,125 @@ PHP_METHOD(Phalcon_Config_Factory, load) { PHP_METHOD(Phalcon_Config_Factory, loadClass) { - zend_class_entry *_14$$8, *_10$$11, *_12$$13; - zend_bool _2; + zend_class_entry *_15$$8, *_11$$11, *_13$$13; + zend_bool _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *namespace_param = NULL, *config = NULL, *adapter = NULL, *className = NULL, *mode = NULL, *callbacks = NULL, *filePath = NULL, *extension = NULL, *oldConfig = NULL, _0$$3 = zval_used_for_init, *_1$$3 = NULL, *_3$$5 = NULL, *_4$$8, _5$$8, *_6$$8, *_13$$8 = NULL, *_7$$9 = NULL, *_8$$9, *_9$$11 = NULL, *_11$$13 = NULL; - zval *namespace = NULL; + zval *namespace_param = NULL, *config = NULL, config_sub, adapter, className, mode, callbacks, filePath, extension, oldConfig, _0$$3, _1$$3, _2$$3, _4$$5, _5$$8, _6$$8, _7$$8, _14$$8, _8$$9, _9$$9, _10$$11, _12$$13; + zval namespace; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespace); + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&callbacks); + ZVAL_UNDEF(&filePath); + ZVAL_UNDEF(&extension); + ZVAL_UNDEF(&oldConfig); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_14$$8); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_10$$11); + ZVAL_UNDEF(&_12$$13); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &namespace_param, &config); - zephir_get_strval(namespace, namespace_param); + zephir_get_strval(&namespace, namespace_param); ZEPHIR_SEPARATE_PARAM(config); if (Z_TYPE_P(config) == IS_STRING) { - ZEPHIR_CPY_WRT(oldConfig, config); - ZEPHIR_SINIT_VAR(_0$$3); - ZVAL_STRING(&_0$$3, ".", 0); - ZEPHIR_CALL_FUNCTION(&_1$$3, "strrchr", NULL, 151, config, &_0$$3); + ZEPHIR_CPY_WRT(&oldConfig, config); + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "."); + ZEPHIR_CALL_FUNCTION(&_1$$3, "strrchr", NULL, 131, config, &_0$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_0$$3); - ZVAL_LONG(&_0$$3, 1); - ZEPHIR_INIT_VAR(extension); - zephir_substr(extension, _1$$3, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - if (ZEPHIR_IS_EMPTY(extension)) { + ZVAL_LONG(&_2$$3, 1); + ZEPHIR_INIT_VAR(&extension); + zephir_substr(&extension, &_1$$3, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + if (ZEPHIR_IS_EMPTY(&extension)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "You need to provide extension in file path", "phalcon/config/factory.zep", 59); return; } ZEPHIR_INIT_NVAR(config); zephir_create_array(config, 2, 0 TSRMLS_CC); - zephir_array_update_string(&config, SL("adapter"), &extension, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&config, SL("filePath"), &oldConfig, PH_COPY | PH_SEPARATE); + zephir_array_update_string(config, SL("adapter"), &extension, PH_COPY | PH_SEPARATE); + zephir_array_update_string(config, SL("filePath"), &oldConfig, PH_COPY | PH_SEPARATE); } - _2 = Z_TYPE_P(config) == IS_OBJECT; - if (_2) { - _2 = zephir_instance_of_ev(config, phalcon_config_ce TSRMLS_CC); + _3 = Z_TYPE_P(config) == IS_OBJECT; + if (_3) { + _3 = zephir_instance_of_ev(config, phalcon_config_ce TSRMLS_CC); } - if (_2) { - ZEPHIR_CALL_METHOD(&_3$$5, config, "toarray", NULL, 0); + if (_3) { + ZEPHIR_CALL_METHOD(&_4$$5, config, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(config, _3$$5); + ZEPHIR_CPY_WRT(config, &_4$$5); } if (Z_TYPE_P(config) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "Config must be array or Phalcon\\Config object", "phalcon/config/factory.zep", 73); return; } - ZEPHIR_OBS_VAR(filePath); - if (!(zephir_array_isset_string_fetch(&filePath, config, SS("filePath"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&filePath); + if (!(zephir_array_isset_string_fetch(&filePath, config, SL("filePath"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "You must provide 'filePath' option in factory config parameter.", "phalcon/config/factory.zep", 77); return; } - ZEPHIR_OBS_VAR(adapter); - if (zephir_array_isset_string_fetch(&adapter, config, SS("adapter"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_4$$8); - zephir_camelize(_4$$8, adapter, NULL ); - ZEPHIR_INIT_VAR(className); - ZEPHIR_CONCAT_VSV(className, namespace, "\\", _4$$8); - ZEPHIR_SINIT_VAR(_5$$8); - ZVAL_STRING(&_5$$8, ".", 0); - ZEPHIR_INIT_VAR(_6$$8); - zephir_fast_strpos(_6$$8, filePath, &_5$$8, 0 ); - if (!(zephir_is_true(_6$$8))) { - ZEPHIR_CALL_FUNCTION(&_7$$9, "lcfirst", NULL, 71, adapter); + ZEPHIR_OBS_VAR(&adapter); + if (zephir_array_isset_string_fetch(&adapter, config, SL("adapter"), 0)) { + ZEPHIR_INIT_VAR(&_5$$8); + zephir_camelize(&_5$$8, &adapter, NULL ); + ZEPHIR_INIT_VAR(&className); + ZEPHIR_CONCAT_VSV(&className, &namespace, "\\", &_5$$8); + ZEPHIR_INIT_VAR(&_6$$8); + ZVAL_STRING(&_6$$8, "."); + ZEPHIR_INIT_VAR(&_7$$8); + zephir_fast_strpos(&_7$$8, &filePath, &_6$$8, 0 ); + if (!(zephir_is_true(&_7$$8))) { + ZEPHIR_CALL_FUNCTION(&_8$$9, "lcfirst", NULL, 64, &adapter); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_8$$9); - ZEPHIR_CONCAT_VSV(_8$$9, filePath, ".", _7$$9); - ZEPHIR_CPY_WRT(filePath, _8$$9); + ZEPHIR_INIT_VAR(&_9$$9); + ZEPHIR_CONCAT_VSV(&_9$$9, &filePath, ".", &_8$$9); + ZEPHIR_CPY_WRT(&filePath, &_9$$9); } - if (ZEPHIR_IS_STRING(className, "Phalcon\\Config\\Adapter\\Ini")) { - ZEPHIR_OBS_VAR(mode); - if (zephir_array_isset_string_fetch(&mode, config, SS("mode"), 0 TSRMLS_CC)) { - zephir_fetch_safe_class(_9$$11, className); - _10$$11 = zend_fetch_class(Z_STRVAL_P(_9$$11), Z_STRLEN_P(_9$$11), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(return_value, _10$$11); + if (ZEPHIR_IS_STRING(&className, "Phalcon\\Config\\Adapter\\Ini")) { + ZEPHIR_OBS_VAR(&mode); + if (zephir_array_isset_string_fetch(&mode, config, SL("mode"), 0)) { + zephir_fetch_safe_class(&_10$$11, &className); + _11$$11 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_10$$11), Z_STRLEN_P(&_10$$11), ZEND_FETCH_CLASS_AUTO); + object_init_ex(return_value, _11$$11); if (zephir_has_constructor(return_value TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, filePath, mode); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &filePath, &mode); zephir_check_call_status(); } RETURN_MM(); } - } else if (ZEPHIR_IS_STRING(className, "Phalcon\\Config\\Adapter\\Yaml")) { - ZEPHIR_OBS_VAR(callbacks); - if (zephir_array_isset_string_fetch(&callbacks, config, SS("callbacks"), 0 TSRMLS_CC)) { - zephir_fetch_safe_class(_11$$13, className); - _12$$13 = zend_fetch_class(Z_STRVAL_P(_11$$13), Z_STRLEN_P(_11$$13), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(return_value, _12$$13); + } else if (ZEPHIR_IS_STRING(&className, "Phalcon\\Config\\Adapter\\Yaml")) { + ZEPHIR_OBS_VAR(&callbacks); + if (zephir_array_isset_string_fetch(&callbacks, config, SL("callbacks"), 0)) { + zephir_fetch_safe_class(&_12$$13, &className); + _13$$13 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_12$$13), Z_STRLEN_P(&_12$$13), ZEND_FETCH_CLASS_AUTO); + object_init_ex(return_value, _13$$13); if (zephir_has_constructor(return_value TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, filePath, callbacks); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &filePath, &callbacks); zephir_check_call_status(); } RETURN_MM(); } } - zephir_fetch_safe_class(_13$$8, className); - _14$$8 = zend_fetch_class(Z_STRVAL_P(_13$$8), Z_STRLEN_P(_13$$8), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(return_value, _14$$8); + zephir_fetch_safe_class(&_14$$8, &className); + _15$$8 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_14$$8), Z_STRLEN_P(&_14$$8), ZEND_FETCH_CLASS_AUTO); + object_init_ex(return_value, _15$$8); if (zephir_has_constructor(return_value TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, filePath); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &filePath); zephir_check_call_status(); } RETURN_MM(); diff --git a/ext/phalcon/config/factory.zep.h b/ext/phalcon/config/factory.zep.h index 0f41590e2d2..3e77210e4bc 100644 --- a/ext/phalcon/config/factory.zep.h +++ b/ext/phalcon/config/factory.zep.h @@ -6,12 +6,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Config_Factory); PHP_METHOD(Phalcon_Config_Factory, load); PHP_METHOD(Phalcon_Config_Factory, loadClass); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_factory_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_config_factory_load, 0, 1, Phalcon\\Config, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_config_factory_load, 0, 1, IS_OBJECT, "Phalcon\\Config", 0) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_config_factory_loadclass, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespace) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/crypt.zep.c b/ext/phalcon/crypt.zep.c index f8ec430e6bc..ee857928691 100644 --- a/ext/phalcon/crypt.zep.c +++ b/ext/phalcon/crypt.zep.c @@ -78,19 +78,19 @@ ZEPHIR_INIT_CLASS(Phalcon_Crypt) { */ zend_declare_property_bool(phalcon_crypt_ce, SL("useSigning"), 0, ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_DEFAULT"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_DEFAULT"), 0); - zend_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_ANSI_X_923"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_ANSI_X_923"), 1); - zend_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_PKCS7"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_PKCS7"), 2); - zend_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_ISO_10126"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_ISO_10126"), 3); - zend_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_ISO_IEC_7816_4"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_ISO_IEC_7816_4"), 4); - zend_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_ZERO"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_ZERO"), 5); - zend_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_SPACE"), 6 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_crypt_ce, SL("PADDING_SPACE"), 6); zend_class_implements(phalcon_crypt_ce TSRMLS_CC, 1, phalcon_cryptinterface_ce); return SUCCESS; @@ -104,25 +104,29 @@ PHP_METHOD(Phalcon_Crypt, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool useSigning; - zval *cipher_param = NULL, *useSigning_param = NULL, *_0; - zval *cipher = NULL; + zval *cipher_param = NULL, *useSigning_param = NULL, _0; + zval cipher; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cipher); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &cipher_param, &useSigning_param); if (!cipher_param) { - ZEPHIR_INIT_VAR(cipher); - ZVAL_STRING(cipher, "aes-256-cfb", 1); + ZEPHIR_INIT_VAR(&cipher); + ZVAL_STRING(&cipher, "aes-256-cfb"); } else { if (UNEXPECTED(Z_TYPE_P(cipher_param) != IS_STRING && Z_TYPE_P(cipher_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cipher' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cipher' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(cipher_param) == IS_STRING)) { - zephir_get_strval(cipher, cipher_param); + zephir_get_strval(&cipher, cipher_param); } else { - ZEPHIR_INIT_VAR(cipher); - ZVAL_EMPTY_STRING(cipher); + ZEPHIR_INIT_VAR(&cipher); + ZVAL_EMPTY_STRING(&cipher); } } if (!useSigning_param) { @@ -134,15 +138,14 @@ PHP_METHOD(Phalcon_Crypt, __construct) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initializeavailableciphers", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcipher", NULL, 0, cipher); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcipher", NULL, 0, &cipher); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_0); if (useSigning) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "usesigning", NULL, 0, _0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "usesigning", NULL, 0, &_0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -153,21 +156,24 @@ PHP_METHOD(Phalcon_Crypt, __construct) { */ PHP_METHOD(Phalcon_Crypt, setPadding) { - zval *scheme_param = NULL, *_0; + zval *scheme_param = NULL, _0; zend_long scheme; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &scheme_param); if (UNEXPECTED(Z_TYPE_P(scheme_param) != IS_LONG)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'scheme' must be a int") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'scheme' must be of the type int") TSRMLS_CC); RETURN_NULL(); } scheme = Z_LVAL_P(scheme_param); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, scheme); - zephir_update_property_this(getThis(), SL("_padding"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, scheme); + zephir_update_property_zval(this_ptr, SL("_padding"), &_0); RETURN_THISW(); } @@ -184,30 +190,34 @@ PHP_METHOD(Phalcon_Crypt, setPadding) { PHP_METHOD(Phalcon_Crypt, setCipher) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *cipher_param = NULL, *_0 = NULL; - zval *cipher = NULL; + zval *cipher_param = NULL, _0; + zval cipher; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cipher); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &cipher_param); if (UNEXPECTED(Z_TYPE_P(cipher_param) != IS_STRING && Z_TYPE_P(cipher_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cipher' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cipher' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(cipher_param) == IS_STRING)) { - zephir_get_strval(cipher, cipher_param); + zephir_get_strval(&cipher, cipher_param); } else { - ZEPHIR_INIT_VAR(cipher); - ZVAL_EMPTY_STRING(cipher); + ZEPHIR_INIT_VAR(&cipher); + ZVAL_EMPTY_STRING(&cipher); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "assertcipherisavailable", NULL, 0, cipher); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "assertcipherisavailable", NULL, 0, &cipher); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getivlength", NULL, 0, cipher); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getivlength", NULL, 0, &cipher); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("ivLength"), _0 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_cipher"), cipher TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("ivLength"), &_0); + zephir_update_property_zval(this_ptr, SL("_cipher"), &cipher); RETURN_THIS(); } @@ -217,7 +227,8 @@ PHP_METHOD(Phalcon_Crypt, setCipher) { */ PHP_METHOD(Phalcon_Crypt, getCipher) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_cipher"); @@ -242,24 +253,27 @@ PHP_METHOD(Phalcon_Crypt, getCipher) { PHP_METHOD(Phalcon_Crypt, setKey) { zval *key_param = NULL; - zval *key = NULL; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - zephir_update_property_this(getThis(), SL("_key"), key TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_key"), &key); RETURN_THIS(); } @@ -269,7 +283,8 @@ PHP_METHOD(Phalcon_Crypt, setKey) { */ PHP_METHOD(Phalcon_Crypt, getKey) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_key"); @@ -284,26 +299,29 @@ PHP_METHOD(Phalcon_Crypt, setHashAlgo) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *hashAlgo_param = NULL; - zval *hashAlgo = NULL; + zval hashAlgo; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&hashAlgo); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &hashAlgo_param); if (UNEXPECTED(Z_TYPE_P(hashAlgo_param) != IS_STRING && Z_TYPE_P(hashAlgo_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'hashAlgo' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'hashAlgo' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(hashAlgo_param) == IS_STRING)) { - zephir_get_strval(hashAlgo, hashAlgo_param); + zephir_get_strval(&hashAlgo, hashAlgo_param); } else { - ZEPHIR_INIT_VAR(hashAlgo); - ZVAL_EMPTY_STRING(hashAlgo); + ZEPHIR_INIT_VAR(&hashAlgo); + ZVAL_EMPTY_STRING(&hashAlgo); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "asserthashalgorithmavailable", NULL, 0, hashAlgo); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "asserthashalgorithmavailable", NULL, 0, &hashAlgo); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("hashAlgo"), hashAlgo TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("hashAlgo"), &hashAlgo); RETURN_THIS(); } @@ -313,7 +331,8 @@ PHP_METHOD(Phalcon_Crypt, setHashAlgo) { */ PHP_METHOD(Phalcon_Crypt, getHashAlgo) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "hashAlgo"); @@ -326,8 +345,12 @@ PHP_METHOD(Phalcon_Crypt, getHashAlgo) { */ PHP_METHOD(Phalcon_Crypt, useSigning) { - zval *useSigning_param = NULL; + zval *useSigning_param = NULL, __$true, __$false; zend_bool useSigning; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &useSigning_param); @@ -335,9 +358,9 @@ PHP_METHOD(Phalcon_Crypt, useSigning) { if (useSigning) { - zephir_update_property_this(getThis(), SL("useSigning"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("useSigning"), &__$true); } else { - zephir_update_property_this(getThis(), SL("useSigning"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("useSigning"), &__$false); } RETURN_THISW(); @@ -353,80 +376,101 @@ PHP_METHOD(Phalcon_Crypt, _cryptPadText) { zend_bool _0, _7$$7; zephir_fcall_cache_entry *_11 = NULL; zend_long blockSize, paddingType, ZEPHIR_LAST_CALL_STATUS, i = 0, paddingSize, _8$$7, _9$$7; - zval *text_param = NULL, *mode_param = NULL, *blockSize_param = NULL, *paddingType_param = NULL, *padding = NULL, _23, _24, *_25, _1$$5 = zval_used_for_init, *_2$$5 = NULL, *_3$$5 = NULL, *_4$$5 = NULL, _5$$6 = zval_used_for_init, *_6$$6 = NULL, _13$$7, *_14$$7 = NULL, *_10$$8 = NULL, *_12$$8 = NULL, _15$$9 = zval_used_for_init, *_16$$9 = NULL, *_17$$9 = NULL, *_18$$9 = NULL, _19$$10 = zval_used_for_init, *_20$$10 = NULL, _21$$11, _22$$11; - zval *text = NULL, *mode = NULL; + zval *text_param = NULL, *mode_param = NULL, *blockSize_param = NULL, *paddingType_param = NULL, padding, _23, _24, _25, _1$$5, _2$$5, _3$$5, _4$$5, _5$$6, _6$$6, _13$$7, _14$$7, _10$$8, _12$$8, _15$$9, _16$$9, _17$$9, _18$$9, _19$$10, _20$$10, _21$$11, _22$$11; + zval text, mode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&padding); + ZVAL_UNDEF(&_23); + ZVAL_UNDEF(&_24); + ZVAL_UNDEF(&_25); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_13$$7); + ZVAL_UNDEF(&_14$$7); + ZVAL_UNDEF(&_10$$8); + ZVAL_UNDEF(&_12$$8); + ZVAL_UNDEF(&_15$$9); + ZVAL_UNDEF(&_16$$9); + ZVAL_UNDEF(&_17$$9); + ZVAL_UNDEF(&_18$$9); + ZVAL_UNDEF(&_19$$10); + ZVAL_UNDEF(&_20$$10); + ZVAL_UNDEF(&_21$$11); + ZVAL_UNDEF(&_22$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &text_param, &mode_param, &blockSize_param, &paddingType_param); - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(mode, mode_param); + zephir_get_strval(&mode, mode_param); } else { - ZEPHIR_INIT_VAR(mode); - ZVAL_EMPTY_STRING(mode); + ZEPHIR_INIT_VAR(&mode); + ZVAL_EMPTY_STRING(&mode); } if (UNEXPECTED(Z_TYPE_P(blockSize_param) != IS_LONG)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'blockSize' must be a int") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'blockSize' must be of the type int") TSRMLS_CC); RETURN_MM_NULL(); } blockSize = Z_LVAL_P(blockSize_param); if (UNEXPECTED(Z_TYPE_P(paddingType_param) != IS_LONG)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'paddingType' must be a int") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'paddingType' must be of the type int") TSRMLS_CC); RETURN_MM_NULL(); } paddingType = Z_LVAL_P(paddingType_param); paddingSize = 0; - ZEPHIR_INIT_VAR(padding); - ZVAL_NULL(padding); - _0 = ZEPHIR_IS_STRING(mode, "cbc"); + ZEPHIR_INIT_VAR(&padding); + ZVAL_NULL(&padding); + _0 = ZEPHIR_IS_STRING(&mode, "cbc"); if (!(_0)) { - _0 = ZEPHIR_IS_STRING(mode, "ecb"); + _0 = ZEPHIR_IS_STRING(&mode, "ecb"); } if (_0) { - paddingSize = (blockSize - (zephir_safe_mod_long_long(zephir_fast_strlen_ev(text), blockSize TSRMLS_CC))); + paddingSize = (blockSize - (zephir_safe_mod_long_long(zephir_fast_strlen_ev(&text), blockSize TSRMLS_CC))); if (paddingSize >= 256) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "Block size is bigger than 256", "phalcon/crypt.zep", 218); return; } do { if (paddingType == 1) { - ZEPHIR_SINIT_VAR(_1$$5); ZVAL_LONG(&_1$$5, 0); - ZEPHIR_CALL_FUNCTION(&_2$$5, "chr", NULL, 152, &_1$$5); + ZEPHIR_CALL_FUNCTION(&_2$$5, "chr", NULL, 132, &_1$$5); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_1$$5); ZVAL_LONG(&_1$$5, (paddingSize - 1)); - ZEPHIR_CALL_FUNCTION(&_3$$5, "str_repeat", NULL, 153, _2$$5, &_1$$5); + ZEPHIR_CALL_FUNCTION(&_3$$5, "str_repeat", NULL, 133, &_2$$5, &_1$$5); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_1$$5); ZVAL_LONG(&_1$$5, paddingSize); - ZEPHIR_CALL_FUNCTION(&_4$$5, "chr", NULL, 152, &_1$$5); + ZEPHIR_CALL_FUNCTION(&_4$$5, "chr", NULL, 132, &_1$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(padding); - ZEPHIR_CONCAT_VV(padding, _3$$5, _4$$5); + ZEPHIR_INIT_NVAR(&padding); + ZEPHIR_CONCAT_VV(&padding, &_3$$5, &_4$$5); break; } if (paddingType == 2) { - ZEPHIR_SINIT_VAR(_5$$6); ZVAL_LONG(&_5$$6, paddingSize); - ZEPHIR_CALL_FUNCTION(&_6$$6, "chr", NULL, 152, &_5$$6); + ZEPHIR_CALL_FUNCTION(&_6$$6, "chr", NULL, 132, &_5$$6); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_5$$6); ZVAL_LONG(&_5$$6, paddingSize); - ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 153, _6$$6, &_5$$6); + ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 133, &_6$$6, &_5$$6); zephir_check_call_status(); break; } if (paddingType == 3) { - ZEPHIR_INIT_NVAR(padding); - ZVAL_STRING(padding, "", 1); + ZEPHIR_INIT_NVAR(&padding); + ZVAL_STRING(&padding, ""); _9$$7 = (paddingSize - 2); _8$$7 = 0; _7$$7 = 0; @@ -441,54 +485,47 @@ PHP_METHOD(Phalcon_Crypt, _cryptPadText) { _7$$7 = 1; } i = _8$$7; - ZEPHIR_CALL_FUNCTION(&_10$$8, "rand", &_11, 129); + ZEPHIR_CALL_FUNCTION(&_10$$8, "rand", &_11, 110); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_12$$8, "chr", NULL, 152, _10$$8); + ZEPHIR_CALL_FUNCTION(&_12$$8, "chr", NULL, 132, &_10$$8); zephir_check_call_status(); - zephir_concat_self(&padding, _12$$8 TSRMLS_CC); + zephir_concat_self(&padding, &_12$$8 TSRMLS_CC); } } - ZEPHIR_SINIT_VAR(_13$$7); ZVAL_LONG(&_13$$7, paddingSize); - ZEPHIR_CALL_FUNCTION(&_14$$7, "chr", NULL, 152, &_13$$7); + ZEPHIR_CALL_FUNCTION(&_14$$7, "chr", NULL, 132, &_13$$7); zephir_check_call_status(); - zephir_concat_self(&padding, _14$$7 TSRMLS_CC); + zephir_concat_self(&padding, &_14$$7 TSRMLS_CC); break; } if (paddingType == 4) { - ZEPHIR_SINIT_VAR(_15$$9); ZVAL_LONG(&_15$$9, 0x80); - ZEPHIR_CALL_FUNCTION(&_16$$9, "chr", NULL, 152, &_15$$9); + ZEPHIR_CALL_FUNCTION(&_16$$9, "chr", NULL, 132, &_15$$9); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_15$$9); ZVAL_LONG(&_15$$9, 0); - ZEPHIR_CALL_FUNCTION(&_17$$9, "chr", NULL, 152, &_15$$9); + ZEPHIR_CALL_FUNCTION(&_17$$9, "chr", NULL, 132, &_15$$9); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_15$$9); ZVAL_LONG(&_15$$9, (paddingSize - 1)); - ZEPHIR_CALL_FUNCTION(&_18$$9, "str_repeat", NULL, 153, _17$$9, &_15$$9); + ZEPHIR_CALL_FUNCTION(&_18$$9, "str_repeat", NULL, 133, &_17$$9, &_15$$9); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(padding); - ZEPHIR_CONCAT_VV(padding, _16$$9, _18$$9); + ZEPHIR_INIT_NVAR(&padding); + ZEPHIR_CONCAT_VV(&padding, &_16$$9, &_18$$9); break; } if (paddingType == 5) { - ZEPHIR_SINIT_VAR(_19$$10); ZVAL_LONG(&_19$$10, 0); - ZEPHIR_CALL_FUNCTION(&_20$$10, "chr", NULL, 152, &_19$$10); + ZEPHIR_CALL_FUNCTION(&_20$$10, "chr", NULL, 132, &_19$$10); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_19$$10); ZVAL_LONG(&_19$$10, paddingSize); - ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 153, _20$$10, &_19$$10); + ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 133, &_20$$10, &_19$$10); zephir_check_call_status(); break; } if (paddingType == 6) { - ZEPHIR_SINIT_VAR(_21$$11); - ZVAL_STRING(&_21$$11, " ", 0); - ZEPHIR_SINIT_VAR(_22$$11); + ZEPHIR_INIT_VAR(&_21$$11); + ZVAL_STRING(&_21$$11, " "); ZVAL_LONG(&_22$$11, paddingSize); - ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 153, &_21$$11, &_22$$11); + ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 133, &_21$$11, &_22$$11); zephir_check_call_status(); break; } @@ -498,19 +535,17 @@ PHP_METHOD(Phalcon_Crypt, _cryptPadText) { } if (!(paddingSize)) { - RETURN_CTOR(text); + RETURN_CTOR(&text); } if (paddingSize > blockSize) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "Invalid padding size", "phalcon/crypt.zep", 262); return; } - ZEPHIR_SINIT_VAR(_23); ZVAL_LONG(&_23, 0); - ZEPHIR_SINIT_VAR(_24); ZVAL_LONG(&_24, paddingSize); - ZEPHIR_INIT_VAR(_25); - zephir_substr(_25, padding, 0 , zephir_get_intval(&_24), 0); - ZEPHIR_CONCAT_VV(return_value, text, _25); + ZEPHIR_INIT_VAR(&_25); + zephir_substr(&_25, &padding, 0 , zephir_get_intval(&_24), 0); + ZEPHIR_CONCAT_VV(return_value, &text, &_25); RETURN_MM(); } @@ -531,123 +566,135 @@ PHP_METHOD(Phalcon_Crypt, _cryptUnpadText) { zend_bool _0, _1, _2, _19$$11, _21$$11, _23$$15, _25$$15, _26$$17, _28$$17, _29$$3; long length = 0; zend_long blockSize, paddingType, ZEPHIR_LAST_CALL_STATUS, i = 0, paddingSize, ord = 0; - zval *text_param = NULL, *mode_param = NULL, *blockSize_param = NULL, *paddingType_param = NULL, *padding = NULL, *last = NULL, _3$$4, _4$$4, *_5$$4 = NULL, _6$$5 = zval_used_for_init, *_7$$5 = NULL, *_8$$5 = NULL, *_9$$5, _10$$7, _11$$7, *_12$$7 = NULL, _13$$8 = zval_used_for_init, *_14$$8 = NULL, *_15$$8, _16$$10, _17$$10, *_18$$10 = NULL, _30$$21, _31$$21; - zval *text = NULL, *mode = NULL; + zval *text_param = NULL, *mode_param = NULL, *blockSize_param = NULL, *paddingType_param = NULL, padding, last, _3$$4, _4$$4, _5$$4, _6$$5, _7$$5, _8$$5, _9$$5, _10$$7, _11$$7, _12$$7, _13$$8, _14$$8, _15$$8, _16$$10, _17$$10, _18$$10, _30$$21, _31$$21; + zval text, mode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&padding); + ZVAL_UNDEF(&last); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_11$$7); + ZVAL_UNDEF(&_12$$7); + ZVAL_UNDEF(&_13$$8); + ZVAL_UNDEF(&_14$$8); + ZVAL_UNDEF(&_15$$8); + ZVAL_UNDEF(&_16$$10); + ZVAL_UNDEF(&_17$$10); + ZVAL_UNDEF(&_18$$10); + ZVAL_UNDEF(&_30$$21); + ZVAL_UNDEF(&_31$$21); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &text_param, &mode_param, &blockSize_param, &paddingType_param); - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); if (UNEXPECTED(Z_TYPE_P(mode_param) != IS_STRING && Z_TYPE_P(mode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'mode' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(mode_param) == IS_STRING)) { - zephir_get_strval(mode, mode_param); + zephir_get_strval(&mode, mode_param); } else { - ZEPHIR_INIT_VAR(mode); - ZVAL_EMPTY_STRING(mode); + ZEPHIR_INIT_VAR(&mode); + ZVAL_EMPTY_STRING(&mode); } if (UNEXPECTED(Z_TYPE_P(blockSize_param) != IS_LONG)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'blockSize' must be a int") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'blockSize' must be of the type int") TSRMLS_CC); RETURN_MM_NULL(); } blockSize = Z_LVAL_P(blockSize_param); if (UNEXPECTED(Z_TYPE_P(paddingType_param) != IS_LONG)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'paddingType' must be a int") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'paddingType' must be of the type int") TSRMLS_CC); RETURN_MM_NULL(); } paddingType = Z_LVAL_P(paddingType_param); paddingSize = 0; - length = zephir_fast_strlen_ev(text); + length = zephir_fast_strlen_ev(&text); _0 = length > 0; if (_0) { _0 = (zephir_safe_mod_long_long(length, blockSize TSRMLS_CC) == 0); } _1 = _0; if (_1) { - _2 = ZEPHIR_IS_STRING(mode, "cbc"); + _2 = ZEPHIR_IS_STRING(&mode, "cbc"); if (!(_2)) { - _2 = ZEPHIR_IS_STRING(mode, "ecb"); + _2 = ZEPHIR_IS_STRING(&mode, "ecb"); } _1 = _2; } if (_1) { do { if (paddingType == 1) { - ZEPHIR_SINIT_VAR(_3$$4); ZVAL_LONG(&_3$$4, (length - 1)); - ZEPHIR_SINIT_VAR(_4$$4); ZVAL_LONG(&_4$$4, 1); - ZEPHIR_INIT_VAR(last); - zephir_substr(last, text, zephir_get_intval(&_3$$4), 1 , 0); - ZEPHIR_CALL_FUNCTION(&_5$$4, "ord", NULL, 154, last); + ZEPHIR_INIT_VAR(&last); + zephir_substr(&last, &text, zephir_get_intval(&_3$$4), 1 , 0); + ZEPHIR_CALL_FUNCTION(&_5$$4, "ord", NULL, 134, &last); zephir_check_call_status(); - ord = zephir_get_intval(_5$$4); + ord = zephir_get_intval(&_5$$4); if (ord <= blockSize) { paddingSize = ord; - ZEPHIR_SINIT_VAR(_6$$5); ZVAL_LONG(&_6$$5, 0); - ZEPHIR_CALL_FUNCTION(&_7$$5, "chr", NULL, 152, &_6$$5); + ZEPHIR_CALL_FUNCTION(&_7$$5, "chr", NULL, 132, &_6$$5); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_6$$5); ZVAL_LONG(&_6$$5, (paddingSize - 1)); - ZEPHIR_CALL_FUNCTION(&_8$$5, "str_repeat", NULL, 153, _7$$5, &_6$$5); + ZEPHIR_CALL_FUNCTION(&_8$$5, "str_repeat", NULL, 133, &_7$$5, &_6$$5); zephir_check_call_status(); - ZEPHIR_INIT_VAR(padding); - ZEPHIR_CONCAT_VV(padding, _8$$5, last); - ZEPHIR_SINIT_NVAR(_6$$5); + ZEPHIR_INIT_VAR(&padding); + ZEPHIR_CONCAT_VV(&padding, &_8$$5, &last); ZVAL_LONG(&_6$$5, (length - paddingSize)); - ZEPHIR_INIT_VAR(_9$$5); - zephir_substr(_9$$5, text, zephir_get_intval(&_6$$5), 0, ZEPHIR_SUBSTR_NO_LENGTH); - if (!ZEPHIR_IS_EQUAL(_9$$5, padding)) { + ZEPHIR_INIT_VAR(&_9$$5); + zephir_substr(&_9$$5, &text, zephir_get_intval(&_6$$5), 0, ZEPHIR_SUBSTR_NO_LENGTH); + if (!ZEPHIR_IS_EQUAL(&_9$$5, &padding)) { paddingSize = 0; } } break; } if (paddingType == 2) { - ZEPHIR_SINIT_VAR(_10$$7); ZVAL_LONG(&_10$$7, (length - 1)); - ZEPHIR_SINIT_VAR(_11$$7); ZVAL_LONG(&_11$$7, 1); - ZEPHIR_INIT_NVAR(last); - zephir_substr(last, text, zephir_get_intval(&_10$$7), 1 , 0); - ZEPHIR_CALL_FUNCTION(&_12$$7, "ord", NULL, 154, last); + ZEPHIR_INIT_NVAR(&last); + zephir_substr(&last, &text, zephir_get_intval(&_10$$7), 1 , 0); + ZEPHIR_CALL_FUNCTION(&_12$$7, "ord", NULL, 134, &last); zephir_check_call_status(); - ord = zephir_get_intval(_12$$7); + ord = zephir_get_intval(&_12$$7); if (ord <= blockSize) { paddingSize = ord; - ZEPHIR_SINIT_VAR(_13$$8); ZVAL_LONG(&_13$$8, paddingSize); - ZEPHIR_CALL_FUNCTION(&_14$$8, "chr", NULL, 152, &_13$$8); + ZEPHIR_CALL_FUNCTION(&_14$$8, "chr", NULL, 132, &_13$$8); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_13$$8); ZVAL_LONG(&_13$$8, paddingSize); - ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 153, _14$$8, &_13$$8); + ZEPHIR_CALL_FUNCTION(&padding, "str_repeat", NULL, 133, &_14$$8, &_13$$8); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_13$$8); ZVAL_LONG(&_13$$8, (length - paddingSize)); - ZEPHIR_INIT_VAR(_15$$8); - zephir_substr(_15$$8, text, zephir_get_intval(&_13$$8), 0, ZEPHIR_SUBSTR_NO_LENGTH); - if (!ZEPHIR_IS_EQUAL(_15$$8, padding)) { + ZEPHIR_INIT_VAR(&_15$$8); + zephir_substr(&_15$$8, &text, zephir_get_intval(&_13$$8), 0, ZEPHIR_SUBSTR_NO_LENGTH); + if (!ZEPHIR_IS_EQUAL(&_15$$8, &padding)) { paddingSize = 0; } } break; } if (paddingType == 3) { - ZEPHIR_SINIT_VAR(_16$$10); ZVAL_LONG(&_16$$10, (length - 1)); - ZEPHIR_SINIT_VAR(_17$$10); ZVAL_LONG(&_17$$10, 1); - ZEPHIR_INIT_NVAR(last); - zephir_substr(last, text, zephir_get_intval(&_16$$10), 1 , 0); - ZEPHIR_CALL_FUNCTION(&_18$$10, "ord", NULL, 154, last); + ZEPHIR_INIT_NVAR(&last); + zephir_substr(&last, &text, zephir_get_intval(&_16$$10), 1 , 0); + ZEPHIR_CALL_FUNCTION(&_18$$10, "ord", NULL, 134, &last); zephir_check_call_status(); - paddingSize = zephir_get_intval(_18$$10); + paddingSize = zephir_get_intval(&_18$$10); break; } if (paddingType == 4) { @@ -655,7 +702,7 @@ PHP_METHOD(Phalcon_Crypt, _cryptUnpadText) { while (1) { _19$$11 = i > 0; if (_19$$11) { - _20$$11 = ZEPHIR_STRING_OFFSET(text, i); + _20$$11 = ZEPHIR_STRING_OFFSET(&text, i); _19$$11 = _20$$11 == 0x00; } _21$$11 = _19$$11; @@ -668,7 +715,7 @@ PHP_METHOD(Phalcon_Crypt, _cryptUnpadText) { paddingSize++; i--; } - _22$$11 = ZEPHIR_STRING_OFFSET(text, i); + _22$$11 = ZEPHIR_STRING_OFFSET(&text, i); if (_22$$11 == 0x80) { paddingSize++; } else { @@ -681,7 +728,7 @@ PHP_METHOD(Phalcon_Crypt, _cryptUnpadText) { while (1) { _23$$15 = i >= 0; if (_23$$15) { - _24$$15 = ZEPHIR_STRING_OFFSET(text, i); + _24$$15 = ZEPHIR_STRING_OFFSET(&text, i); _23$$15 = _24$$15 == 0x00; } _25$$15 = _23$$15; @@ -701,7 +748,7 @@ PHP_METHOD(Phalcon_Crypt, _cryptUnpadText) { while (1) { _26$$17 = i >= 0; if (_26$$17) { - _27$$17 = ZEPHIR_STRING_OFFSET(text, i); + _27$$17 = ZEPHIR_STRING_OFFSET(&text, i); _26$$17 = _27$$17 == 0x20; } _28$$17 = _26$$17; @@ -725,20 +772,18 @@ PHP_METHOD(Phalcon_Crypt, _cryptUnpadText) { } if (_29$$3) { if (paddingSize < length) { - ZEPHIR_SINIT_VAR(_30$$21); ZVAL_LONG(&_30$$21, 0); - ZEPHIR_SINIT_VAR(_31$$21); ZVAL_LONG(&_31$$21, (length - paddingSize)); - zephir_substr(return_value, text, 0 , zephir_get_intval(&_31$$21), 0); + zephir_substr(return_value, &text, 0 , zephir_get_intval(&_31$$21), 0); RETURN_MM(); } - RETURN_MM_STRING("", 1); + RETURN_MM_STRING(""); } else { paddingSize = 0; } } if (!(paddingSize)) { - RETURN_CTOR(text); + RETURN_CTOR(&text); } ZEPHIR_MM_RESTORE(); @@ -758,110 +803,130 @@ PHP_METHOD(Phalcon_Crypt, encrypt) { zend_bool _7, _8; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *text_param = NULL, *key_param = NULL, *encryptKey = NULL, *ivLength = NULL, *iv = NULL, *cipher = NULL, *mode = NULL, *blockSize = NULL, *paddingType = NULL, *padded = NULL, *encrypted = NULL, _0 = zval_used_for_init, *_1 = NULL, *_2, *_3, _9, *_4$$7, *_5$$7, *_6$$7 = NULL, *digest$$10 = NULL, *hashAlgo$$10 = NULL; - zval *text = NULL, *key = NULL; + zval *text_param = NULL, *key_param = NULL, __$true, encryptKey, ivLength, iv, cipher, mode, blockSize, paddingType, padded, encrypted, _0, _1, _2, _3, _4$$7, _5$$7, _6$$7, digest$$10, hashAlgo$$10; + zval text, key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&key); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&encryptKey); + ZVAL_UNDEF(&ivLength); + ZVAL_UNDEF(&iv); + ZVAL_UNDEF(&cipher); + ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&blockSize); + ZVAL_UNDEF(&paddingType); + ZVAL_UNDEF(&padded); + ZVAL_UNDEF(&encrypted); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&digest$$10); + ZVAL_UNDEF(&hashAlgo$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &text_param, &key_param); if (UNEXPECTED(Z_TYPE_P(text_param) != IS_STRING && Z_TYPE_P(text_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(text_param) == IS_STRING)) { - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); } else { - ZEPHIR_INIT_VAR(text); - ZVAL_EMPTY_STRING(text); + ZEPHIR_INIT_VAR(&text); + ZVAL_EMPTY_STRING(&text); } if (!key_param) { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_STRING(&key, ""); } else { if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } } - if (EXPECTED(ZEPHIR_IS_EMPTY(key))) { - ZEPHIR_OBS_VAR(encryptKey); - zephir_read_property_this(&encryptKey, this_ptr, SL("_key"), PH_NOISY_CC); + if (EXPECTED(ZEPHIR_IS_EMPTY(&key))) { + ZEPHIR_OBS_VAR(&encryptKey); + zephir_read_property(&encryptKey, this_ptr, SL("_key"), PH_NOISY_CC); } else { - ZEPHIR_CPY_WRT(encryptKey, key); + ZEPHIR_CPY_WRT(&encryptKey, &key); } - if (ZEPHIR_IS_EMPTY(encryptKey)) { + if (ZEPHIR_IS_EMPTY(&encryptKey)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "Encryption key cannot be empty", "phalcon/crypt.zep", 387); return; } - ZEPHIR_OBS_VAR(cipher); - zephir_read_property_this(&cipher, this_ptr, SL("_cipher"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "-", 0); - ZEPHIR_CALL_FUNCTION(&_1, "strrpos", NULL, 155, cipher, &_0); + ZEPHIR_OBS_VAR(&cipher); + zephir_read_property(&cipher, this_ptr, SL("_cipher"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "-"); + ZEPHIR_CALL_FUNCTION(&_1, "strrpos", NULL, 135, &cipher, &_0); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_0); - ZVAL_LONG(&_0, (zephir_get_numberval(_1) - zephir_fast_strlen_ev(cipher))); - ZEPHIR_INIT_VAR(_2); - zephir_substr(_2, cipher, zephir_get_intval(&_0), 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_INIT_VAR(mode); - zephir_fast_strtolower(mode, _2); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "assertcipherisavailable", NULL, 0, cipher); + ZVAL_LONG(&_2, (zephir_get_numberval(&_1) - zephir_fast_strlen_ev(&cipher))); + ZEPHIR_INIT_NVAR(&_0); + zephir_substr(&_0, &cipher, zephir_get_intval(&_2), 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_INIT_VAR(&mode); + zephir_fast_strtolower(&mode, &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "assertcipherisavailable", NULL, 0, &cipher); zephir_check_call_status(); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("ivLength"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(ivLength, _3); - if (EXPECTED(ZEPHIR_GT_LONG(ivLength, 0))) { - ZEPHIR_CPY_WRT(blockSize, ivLength); + zephir_read_property(&_3, this_ptr, SL("ivLength"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&ivLength, &_3); + if (EXPECTED(ZEPHIR_GT_LONG(&ivLength, 0))) { + ZEPHIR_CPY_WRT(&blockSize, &ivLength); } else { - ZEPHIR_INIT_VAR(_4$$7); - ZEPHIR_CONCAT_SV(_4$$7, "-", mode); - ZEPHIR_INIT_VAR(_5$$7); - ZVAL_STRING(_5$$7, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_6$$7, "str_ireplace", NULL, 156, _4$$7, _5$$7, cipher); - zephir_check_temp_parameter(_5$$7); + ZEPHIR_INIT_VAR(&_4$$7); + ZEPHIR_CONCAT_SV(&_4$$7, "-", &mode); + ZEPHIR_INIT_VAR(&_5$$7); + ZVAL_STRING(&_5$$7, ""); + ZEPHIR_CALL_FUNCTION(&_6$$7, "str_ireplace", NULL, 136, &_4$$7, &_5$$7, &cipher); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getivlength", NULL, 0, _6$$7); + ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getivlength", NULL, 0, &_6$$7); zephir_check_call_status(); } - ZEPHIR_CALL_FUNCTION(&iv, "openssl_random_pseudo_bytes", NULL, 157, ivLength); + ZEPHIR_CALL_FUNCTION(&iv, "openssl_random_pseudo_bytes", NULL, 137, &ivLength); zephir_check_call_status(); - ZEPHIR_OBS_VAR(paddingType); - zephir_read_property_this(&paddingType, this_ptr, SL("_padding"), PH_NOISY_CC); - _7 = !ZEPHIR_IS_LONG(paddingType, 0); + ZEPHIR_OBS_VAR(&paddingType); + zephir_read_property(&paddingType, this_ptr, SL("_padding"), PH_NOISY_CC); + _7 = !ZEPHIR_IS_LONG(&paddingType, 0); if (_7) { - _8 = ZEPHIR_IS_STRING(mode, "cbc"); + _8 = ZEPHIR_IS_STRING(&mode, "cbc"); if (!(_8)) { - _8 = ZEPHIR_IS_STRING(mode, "ecb"); + _8 = ZEPHIR_IS_STRING(&mode, "ecb"); } _7 = _8; } if (_7) { - ZEPHIR_CALL_METHOD(&padded, this_ptr, "_cryptpadtext", NULL, 0, text, mode, blockSize, paddingType); + ZEPHIR_CALL_METHOD(&padded, this_ptr, "_cryptpadtext", NULL, 0, &text, &mode, &blockSize, &paddingType); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(padded, text); + ZEPHIR_CPY_WRT(&padded, &text); } - ZEPHIR_SINIT_VAR(_9); - ZVAL_LONG(&_9, 1); - ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 158, padded, cipher, encryptKey, &_9, iv); + ZVAL_LONG(&_3, 1); + ZEPHIR_CALL_FUNCTION(&encrypted, "openssl_encrypt", NULL, 138, &padded, &cipher, &encryptKey, &_3, &iv); zephir_check_call_status(); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("useSigning"), PH_NOISY_CC); - if (zephir_is_true(_3)) { + zephir_read_property(&_3, this_ptr, SL("useSigning"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_3)) { ZEPHIR_CALL_METHOD(&hashAlgo$$10, this_ptr, "gethashalgo", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&digest$$10, "hash_hmac", NULL, 159, hashAlgo$$10, padded, encryptKey, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(&digest$$10, "hash_hmac", NULL, 139, &hashAlgo$$10, &padded, &encryptKey, &__$true); zephir_check_call_status(); - ZEPHIR_CONCAT_VVV(return_value, iv, digest$$10, encrypted); + ZEPHIR_CONCAT_VVV(return_value, &iv, &digest$$10, &encrypted); RETURN_MM(); } - ZEPHIR_CONCAT_VV(return_value, iv, encrypted); + ZEPHIR_CONCAT_VV(return_value, &iv, &encrypted); RETURN_MM(); } @@ -880,147 +945,177 @@ PHP_METHOD(Phalcon_Crypt, encrypt) { */ PHP_METHOD(Phalcon_Crypt, decrypt) { - zend_bool _16, _12$$8; + zend_bool _17, _12$$8; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *text_param = NULL, *key_param = NULL, *decryptKey = NULL, *ivLength = NULL, *cipher = NULL, *mode = NULL, *blockSize = NULL, *decrypted = NULL, *ciphertext = NULL, *hashAlgo = NULL, *hashLength = NULL, *iv = NULL, *hash = NULL, _0 = zval_used_for_init, *_1 = NULL, *_2, *_3, _7 = zval_used_for_init, _8, *_4$$7, *_5$$7, *_6$$7 = NULL, _9$$8 = zval_used_for_init, *_10$$8 = NULL, _11$$8 = zval_used_for_init, *_15$$8 = NULL, *_13$$9 = NULL, *_14$$9, *_17$$11 = NULL, *_18$$11; - zval *text = NULL, *key = NULL; + zval *text_param = NULL, *key_param = NULL, __$true, __$null, decryptKey, ivLength, cipher, mode, blockSize, decrypted, ciphertext, hashAlgo, hashLength, iv, hash, _0, _1, _2, _3, _7, _16, _4$$7, _5$$7, _6$$7, _8$$8, _9$$8, _10$$8, _11$$8, _15$$8, _13$$9, _14$$9, _18$$11, _19$$11; + zval text, key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&key); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&decryptKey); + ZVAL_UNDEF(&ivLength); + ZVAL_UNDEF(&cipher); + ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&blockSize); + ZVAL_UNDEF(&decrypted); + ZVAL_UNDEF(&ciphertext); + ZVAL_UNDEF(&hashAlgo); + ZVAL_UNDEF(&hashLength); + ZVAL_UNDEF(&iv); + ZVAL_UNDEF(&hash); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_16); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$8); + ZVAL_UNDEF(&_10$$8); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_15$$8); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_14$$9); + ZVAL_UNDEF(&_18$$11); + ZVAL_UNDEF(&_19$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &text_param, &key_param); if (UNEXPECTED(Z_TYPE_P(text_param) != IS_STRING && Z_TYPE_P(text_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(text_param) == IS_STRING)) { - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); } else { - ZEPHIR_INIT_VAR(text); - ZVAL_EMPTY_STRING(text); + ZEPHIR_INIT_VAR(&text); + ZVAL_EMPTY_STRING(&text); } if (!key_param) { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_STRING(&key, ""); } else { if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } } - if (EXPECTED(ZEPHIR_IS_EMPTY(key))) { - ZEPHIR_OBS_VAR(decryptKey); - zephir_read_property_this(&decryptKey, this_ptr, SL("_key"), PH_NOISY_CC); + if (EXPECTED(ZEPHIR_IS_EMPTY(&key))) { + ZEPHIR_OBS_VAR(&decryptKey); + zephir_read_property(&decryptKey, this_ptr, SL("_key"), PH_NOISY_CC); } else { - ZEPHIR_CPY_WRT(decryptKey, key); + ZEPHIR_CPY_WRT(&decryptKey, &key); } - if (ZEPHIR_IS_EMPTY(decryptKey)) { + if (ZEPHIR_IS_EMPTY(&decryptKey)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "Decryption key cannot be empty", "phalcon/crypt.zep", 449); return; } - ZEPHIR_OBS_VAR(cipher); - zephir_read_property_this(&cipher, this_ptr, SL("_cipher"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "-", 0); - ZEPHIR_CALL_FUNCTION(&_1, "strrpos", NULL, 155, cipher, &_0); + ZEPHIR_OBS_VAR(&cipher); + zephir_read_property(&cipher, this_ptr, SL("_cipher"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "-"); + ZEPHIR_CALL_FUNCTION(&_1, "strrpos", NULL, 135, &cipher, &_0); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_0); - ZVAL_LONG(&_0, (zephir_get_numberval(_1) - zephir_fast_strlen_ev(cipher))); - ZEPHIR_INIT_VAR(_2); - zephir_substr(_2, cipher, zephir_get_intval(&_0), 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_INIT_VAR(mode); - zephir_fast_strtolower(mode, _2); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "assertcipherisavailable", NULL, 0, cipher); + ZVAL_LONG(&_2, (zephir_get_numberval(&_1) - zephir_fast_strlen_ev(&cipher))); + ZEPHIR_INIT_NVAR(&_0); + zephir_substr(&_0, &cipher, zephir_get_intval(&_2), 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_INIT_VAR(&mode); + zephir_fast_strtolower(&mode, &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "assertcipherisavailable", NULL, 0, &cipher); zephir_check_call_status(); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("ivLength"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(ivLength, _3); - if (EXPECTED(ZEPHIR_GT_LONG(ivLength, 0))) { - ZEPHIR_CPY_WRT(blockSize, ivLength); + zephir_read_property(&_3, this_ptr, SL("ivLength"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&ivLength, &_3); + if (EXPECTED(ZEPHIR_GT_LONG(&ivLength, 0))) { + ZEPHIR_CPY_WRT(&blockSize, &ivLength); } else { - ZEPHIR_INIT_VAR(_4$$7); - ZEPHIR_CONCAT_SV(_4$$7, "-", mode); - ZEPHIR_INIT_VAR(_5$$7); - ZVAL_STRING(_5$$7, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_6$$7, "str_ireplace", NULL, 156, _4$$7, _5$$7, cipher); - zephir_check_temp_parameter(_5$$7); + ZEPHIR_INIT_VAR(&_4$$7); + ZEPHIR_CONCAT_SV(&_4$$7, "-", &mode); + ZEPHIR_INIT_VAR(&_5$$7); + ZVAL_STRING(&_5$$7, ""); + ZEPHIR_CALL_FUNCTION(&_6$$7, "str_ireplace", NULL, 136, &_4$$7, &_5$$7, &cipher); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getivlength", NULL, 0, _6$$7); + ZEPHIR_CALL_METHOD(&blockSize, this_ptr, "getivlength", NULL, 0, &_6$$7); zephir_check_call_status(); } - ZEPHIR_SINIT_VAR(_7); - ZVAL_LONG(&_7, 0); - ZEPHIR_SINIT_VAR(_8); - ZVAL_STRING(&_8, "8bit", 0); - ZEPHIR_CALL_FUNCTION(&iv, "mb_substr", NULL, 160, text, &_7, ivLength, &_8); + ZVAL_LONG(&_3, 0); + ZEPHIR_INIT_VAR(&_7); + ZVAL_STRING(&_7, "8bit"); + ZEPHIR_CALL_FUNCTION(&iv, "mb_substr", NULL, 140, &text, &_3, &ivLength, &_7); zephir_check_call_status(); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("useSigning"), PH_NOISY_CC); - if (zephir_is_true(_3)) { + zephir_read_property(&_3, this_ptr, SL("useSigning"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_3)) { ZEPHIR_CALL_METHOD(&hashAlgo, this_ptr, "gethashalgo", NULL, 0); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_9$$8); - ZVAL_STRING(&_9$$8, "", 0); - ZEPHIR_CALL_FUNCTION(&_10$$8, "hash", NULL, 161, hashAlgo, &_9$$8, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_INIT_VAR(&_8$$8); + ZVAL_STRING(&_8$$8, ""); + ZEPHIR_CALL_FUNCTION(&_9$$8, "hash", NULL, 141, &hashAlgo, &_8$$8, &__$true); zephir_check_call_status(); - ZEPHIR_INIT_VAR(hashLength); - ZVAL_LONG(hashLength, zephir_fast_strlen_ev(_10$$8)); - ZEPHIR_SINIT_NVAR(_9$$8); - ZVAL_STRING(&_9$$8, "8bit", 0); - ZEPHIR_CALL_FUNCTION(&hash, "mb_substr", NULL, 160, text, ivLength, hashLength, &_9$$8); + ZEPHIR_INIT_VAR(&hashLength); + ZVAL_LONG(&hashLength, zephir_fast_strlen_ev(&_9$$8)); + ZEPHIR_INIT_NVAR(&_8$$8); + ZVAL_STRING(&_8$$8, "8bit"); + ZEPHIR_CALL_FUNCTION(&hash, "mb_substr", NULL, 140, &text, &ivLength, &hashLength, &_8$$8); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_9$$8); - zephir_add_function(&_9$$8, ivLength, hashLength); - ZEPHIR_SINIT_VAR(_11$$8); - ZVAL_STRING(&_11$$8, "8bit", 0); - ZEPHIR_CALL_FUNCTION(&ciphertext, "mb_substr", NULL, 160, text, &_9$$8, ZEPHIR_GLOBAL(global_null), &_11$$8); + ZEPHIR_SINIT_VAR(_10$$8); + zephir_add_function(&_10$$8, &ivLength, &hashLength); + ZEPHIR_INIT_NVAR(&_8$$8); + ZVAL_STRING(&_8$$8, "8bit"); + ZEPHIR_CALL_FUNCTION(&ciphertext, "mb_substr", NULL, 140, &text, &_10$$8, &__$null, &_8$$8); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_11$$8); ZVAL_LONG(&_11$$8, 1); - ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 162, ciphertext, cipher, decryptKey, &_11$$8, iv); + ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 142, &ciphertext, &cipher, &decryptKey, &_11$$8, &iv); zephir_check_call_status(); - _12$$8 = ZEPHIR_IS_STRING(mode, "cbc"); + _12$$8 = ZEPHIR_IS_STRING(&mode, "cbc"); if (!(_12$$8)) { - _12$$8 = ZEPHIR_IS_STRING(mode, "ecb"); + _12$$8 = ZEPHIR_IS_STRING(&mode, "ecb"); } if (_12$$8) { - _14$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_padding"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_13$$9, this_ptr, "_cryptunpadtext", NULL, 0, decrypted, mode, blockSize, _14$$9); + zephir_read_property(&_14$$9, this_ptr, SL("_padding"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_13$$9, this_ptr, "_cryptunpadtext", NULL, 0, &decrypted, &mode, &blockSize, &_14$$9); zephir_check_call_status(); - ZEPHIR_CPY_WRT(decrypted, _13$$9); + ZEPHIR_CPY_WRT(&decrypted, &_13$$9); } - ZEPHIR_CALL_FUNCTION(&_15$$8, "hash_hmac", NULL, 159, hashAlgo, decrypted, decryptKey, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(&_15$$8, "hash_hmac", NULL, 139, &hashAlgo, &decrypted, &decryptKey, &__$true); zephir_check_call_status(); - if (!ZEPHIR_IS_IDENTICAL(_15$$8, hash)) { + if (!ZEPHIR_IS_IDENTICAL(&_15$$8, &hash)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_mismatch_ce, "Hash does not match.", "phalcon/crypt.zep", 481); return; } - RETURN_CCTOR(decrypted); + RETURN_CCTOR(&decrypted); } - ZEPHIR_SINIT_NVAR(_7); - ZVAL_STRING(&_7, "8bit", 0); - ZEPHIR_CALL_FUNCTION(&ciphertext, "mb_substr", NULL, 160, text, ivLength, ZEPHIR_GLOBAL(global_null), &_7); + ZEPHIR_INIT_NVAR(&_7); + ZVAL_STRING(&_7, "8bit"); + ZEPHIR_CALL_FUNCTION(&ciphertext, "mb_substr", NULL, 140, &text, &ivLength, &__$null, &_7); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_7); - ZVAL_LONG(&_7, 1); - ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 162, ciphertext, cipher, decryptKey, &_7, iv); + ZVAL_LONG(&_16, 1); + ZEPHIR_CALL_FUNCTION(&decrypted, "openssl_decrypt", NULL, 142, &ciphertext, &cipher, &decryptKey, &_16, &iv); zephir_check_call_status(); - _16 = ZEPHIR_IS_STRING(mode, "cbc"); - if (!(_16)) { - _16 = ZEPHIR_IS_STRING(mode, "ecb"); + _17 = ZEPHIR_IS_STRING(&mode, "cbc"); + if (!(_17)) { + _17 = ZEPHIR_IS_STRING(&mode, "ecb"); } - if (_16) { - _18$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_padding"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_17$$11, this_ptr, "_cryptunpadtext", NULL, 0, decrypted, mode, blockSize, _18$$11); + if (_17) { + zephir_read_property(&_19$$11, this_ptr, SL("_padding"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_18$$11, this_ptr, "_cryptunpadtext", NULL, 0, &decrypted, &mode, &blockSize, &_19$$11); zephir_check_call_status(); - ZEPHIR_CPY_WRT(decrypted, _17$$11); + ZEPHIR_CPY_WRT(&decrypted, &_18$$11); } - RETURN_CCTOR(decrypted); + RETURN_CCTOR(&decrypted); } @@ -1031,55 +1126,67 @@ PHP_METHOD(Phalcon_Crypt, encryptBase64) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool safe; - zval *text_param = NULL, *key = NULL, *safe_param = NULL, *_0$$3 = NULL, *_1$$3 = NULL, _2$$3 = zval_used_for_init, _3$$3, *_4$$3 = NULL, *_5 = NULL; - zval *text = NULL; + zval *text_param = NULL, *key = NULL, key_sub, *safe_param = NULL, __$null, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3, _5; + zval text; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&key_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &text_param, &key, &safe_param); if (UNEXPECTED(Z_TYPE_P(text_param) != IS_STRING && Z_TYPE_P(text_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(text_param) == IS_STRING)) { - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); } else { - ZEPHIR_INIT_VAR(text); - ZVAL_EMPTY_STRING(text); + ZEPHIR_INIT_VAR(&text); + ZVAL_EMPTY_STRING(&text); } if (!key) { - key = ZEPHIR_GLOBAL(global_null); + key = &key_sub; + key = &__$null; } if (!safe_param) { safe = 0; } else { - if (UNEXPECTED(Z_TYPE_P(safe_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'safe' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(safe_param) != IS_TRUE && Z_TYPE_P(safe_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'safe' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - safe = Z_BVAL_P(safe_param); + safe = (Z_TYPE_P(safe_param) == IS_TRUE); } if (safe == 1) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "encrypt", NULL, 0, text, key); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "encrypt", NULL, 0, &text, key); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1$$3, "base64_encode", NULL, 134, _0$$3); + ZEPHIR_CALL_FUNCTION(&_1$$3, "base64_encode", NULL, 115, &_0$$3); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_2$$3); - ZVAL_STRING(&_2$$3, "+/", 0); - ZEPHIR_SINIT_VAR(_3$$3); - ZVAL_STRING(&_3$$3, "-_", 0); - ZEPHIR_CALL_FUNCTION(&_4$$3, "strtr", NULL, 27, _1$$3, &_2$$3, &_3$$3); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "+/"); + ZEPHIR_INIT_VAR(&_3$$3); + ZVAL_STRING(&_3$$3, "-_"); + ZEPHIR_CALL_FUNCTION(&_4$$3, "strtr", NULL, 22, &_1$$3, &_2$$3, &_3$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_2$$3); - ZVAL_STRING(&_2$$3, "=", 0); - zephir_fast_trim(return_value, _4$$3, &_2$$3, ZEPHIR_TRIM_RIGHT TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_2$$3); + ZVAL_STRING(&_2$$3, "="); + zephir_fast_trim(return_value, &_4$$3, &_2$$3, ZEPHIR_TRIM_RIGHT TSRMLS_CC); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&_5, this_ptr, "encrypt", NULL, 0, text, key); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "encrypt", NULL, 0, &text, key); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 134, _5); + ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 115, &_5); zephir_check_call_status(); RETURN_MM(); @@ -1094,60 +1201,72 @@ PHP_METHOD(Phalcon_Crypt, decryptBase64) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool safe; - zval *text_param = NULL, *key = NULL, *safe_param = NULL, _0$$3 = zval_used_for_init, _1$$3 = zval_used_for_init, *_2$$3 = NULL, *_3$$3, *_4$$3, *_5$$3 = NULL, *_6 = NULL; - zval *text = NULL; + zval *text_param = NULL, *key = NULL, key_sub, *safe_param = NULL, __$null, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6; + zval text; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&key_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &text_param, &key, &safe_param); if (UNEXPECTED(Z_TYPE_P(text_param) != IS_STRING && Z_TYPE_P(text_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'text' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(text_param) == IS_STRING)) { - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); } else { - ZEPHIR_INIT_VAR(text); - ZVAL_EMPTY_STRING(text); + ZEPHIR_INIT_VAR(&text); + ZVAL_EMPTY_STRING(&text); } if (!key) { - key = ZEPHIR_GLOBAL(global_null); + key = &key_sub; + key = &__$null; } if (!safe_param) { safe = 0; } else { - if (UNEXPECTED(Z_TYPE_P(safe_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'safe' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(safe_param) != IS_TRUE && Z_TYPE_P(safe_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'safe' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - safe = Z_BVAL_P(safe_param); + safe = (Z_TYPE_P(safe_param) == IS_TRUE); } if (safe == 1) { - ZEPHIR_SINIT_VAR(_0$$3); - ZVAL_STRING(&_0$$3, "-_", 0); - ZEPHIR_SINIT_VAR(_1$$3); - ZVAL_STRING(&_1$$3, "+/", 0); - ZEPHIR_CALL_FUNCTION(&_2$$3, "strtr", NULL, 27, text, &_0$$3, &_1$$3); + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "-_"); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "+/"); + ZEPHIR_CALL_FUNCTION(&_2$$3, "strtr", NULL, 22, &text, &_0$$3, &_1$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_0$$3); - ZVAL_STRING(&_0$$3, "===", 0); - ZEPHIR_SINIT_NVAR(_1$$3); - ZVAL_DOUBLE(&_1$$3, zephir_safe_mod_long_long(((zephir_fast_strlen_ev(text) + 3)), 4 TSRMLS_CC)); - ZEPHIR_INIT_VAR(_3$$3); - zephir_substr(_3$$3, &_0$$3, zephir_get_intval(&_1$$3), 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_INIT_VAR(_4$$3); - ZEPHIR_CONCAT_VV(_4$$3, _2$$3, _3$$3); - ZEPHIR_CALL_FUNCTION(&_5$$3, "base64_decode", NULL, 135, _4$$3); + ZEPHIR_INIT_NVAR(&_0$$3); + ZVAL_STRING(&_0$$3, "==="); + ZVAL_DOUBLE(&_3$$3, zephir_safe_mod_long_long(((zephir_fast_strlen_ev(&text) + 3)), 4 TSRMLS_CC)); + ZEPHIR_INIT_NVAR(&_1$$3); + zephir_substr(&_1$$3, &_0$$3, zephir_get_intval(&_3$$3), 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_INIT_VAR(&_4$$3); + ZEPHIR_CONCAT_VV(&_4$$3, &_2$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(&_5$$3, "base64_decode", NULL, 116, &_4$$3); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "decrypt", NULL, 0, _5$$3, key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "decrypt", NULL, 0, &_5$$3, key); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_6, "base64_decode", NULL, 135, text); + ZEPHIR_CALL_FUNCTION(&_6, "base64_decode", NULL, 116, &text); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "decrypt", NULL, 0, _6, key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "decrypt", NULL, 0, &_6, key); zephir_check_call_status(); RETURN_MM(); @@ -1158,20 +1277,25 @@ PHP_METHOD(Phalcon_Crypt, decryptBase64) { */ PHP_METHOD(Phalcon_Crypt, getAvailableCiphers) { - zval *availableCiphers = NULL, *_0, *_1$$3; + zval availableCiphers, _0, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&availableCiphers); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("availableCiphers"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(availableCiphers, _0); - if (UNEXPECTED(Z_TYPE_P(availableCiphers) != IS_ARRAY)) { + zephir_read_property(&_0, this_ptr, SL("availableCiphers"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&availableCiphers, &_0); + if (UNEXPECTED(Z_TYPE_P(&availableCiphers) != IS_ARRAY)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initializeavailableciphers", NULL, 0); zephir_check_call_status(); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("availableCiphers"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(availableCiphers, _1$$3); + zephir_read_property(&_1$$3, this_ptr, SL("availableCiphers"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&availableCiphers, &_1$$3); } - RETURN_CCTOR(availableCiphers); + RETURN_CCTOR(&availableCiphers); } @@ -1180,19 +1304,22 @@ PHP_METHOD(Phalcon_Crypt, getAvailableCiphers) { */ PHP_METHOD(Phalcon_Crypt, getAvailableHashAlgos) { - zval *algos = NULL; + zval algos; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&algos); ZEPHIR_MM_GROW(); - if (EXPECTED((zephir_function_exists_ex(SS("hash_hmac_algos") TSRMLS_CC) == SUCCESS))) { - ZEPHIR_CALL_FUNCTION(&algos, "hash_hmac_algos", NULL, 0); + if (EXPECTED((zephir_function_exists_ex(SL("hash_hmac_algos") TSRMLS_CC) == SUCCESS))) { + ZEPHIR_CALL_FUNCTION(&algos, "hash_hmac_algos", NULL, 143); zephir_check_call_status(); } else { - ZEPHIR_CALL_FUNCTION(&algos, "hash_algos", NULL, 163); + ZEPHIR_CALL_FUNCTION(&algos, "hash_algos", NULL, 144); zephir_check_call_status(); } - RETURN_CCTOR(algos); + RETURN_CCTOR(&algos); } @@ -1204,36 +1331,43 @@ PHP_METHOD(Phalcon_Crypt, getAvailableHashAlgos) { PHP_METHOD(Phalcon_Crypt, assertCipherIsAvailable) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *cipher_param = NULL, *availableCiphers = NULL, *_0$$3, _1$$3, *_2$$3 = NULL; - zval *cipher = NULL; + zval *cipher_param = NULL, availableCiphers, _0$$3, _1$$3, _2$$3; + zval cipher; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cipher); + ZVAL_UNDEF(&availableCiphers); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &cipher_param); if (UNEXPECTED(Z_TYPE_P(cipher_param) != IS_STRING && Z_TYPE_P(cipher_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cipher' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cipher' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(cipher_param) == IS_STRING)) { - zephir_get_strval(cipher, cipher_param); + zephir_get_strval(&cipher, cipher_param); } else { - ZEPHIR_INIT_VAR(cipher); - ZVAL_EMPTY_STRING(cipher); + ZEPHIR_INIT_VAR(&cipher); + ZVAL_EMPTY_STRING(&cipher); } ZEPHIR_CALL_METHOD(&availableCiphers, this_ptr, "getavailableciphers", NULL, 0); zephir_check_call_status(); - if (!(zephir_fast_in_array(cipher, availableCiphers TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_crypt_exception_ce); - ZEPHIR_SINIT_VAR(_1$$3); - ZVAL_STRING(&_1$$3, "The cipher algorithm \"%s\" is not supported on this system.", 0); - ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 164, &_1$$3, cipher); + if (!(zephir_fast_in_array(&cipher, &availableCiphers TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_crypt_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "The cipher algorithm \"%s\" is not supported on this system."); + ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 145, &_1$$3, &cipher); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 9, _2$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/crypt.zep", 570 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/crypt.zep", 570 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -1249,36 +1383,43 @@ PHP_METHOD(Phalcon_Crypt, assertCipherIsAvailable) { PHP_METHOD(Phalcon_Crypt, assertHashAlgorithmAvailable) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *hashAlgo_param = NULL, *availableAlgorithms = NULL, *_0$$3, _1$$3, *_2$$3 = NULL; - zval *hashAlgo = NULL; + zval *hashAlgo_param = NULL, availableAlgorithms, _0$$3, _1$$3, _2$$3; + zval hashAlgo; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&hashAlgo); + ZVAL_UNDEF(&availableAlgorithms); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &hashAlgo_param); if (UNEXPECTED(Z_TYPE_P(hashAlgo_param) != IS_STRING && Z_TYPE_P(hashAlgo_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'hashAlgo' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'hashAlgo' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(hashAlgo_param) == IS_STRING)) { - zephir_get_strval(hashAlgo, hashAlgo_param); + zephir_get_strval(&hashAlgo, hashAlgo_param); } else { - ZEPHIR_INIT_VAR(hashAlgo); - ZVAL_EMPTY_STRING(hashAlgo); + ZEPHIR_INIT_VAR(&hashAlgo); + ZVAL_EMPTY_STRING(&hashAlgo); } ZEPHIR_CALL_METHOD(&availableAlgorithms, this_ptr, "getavailablehashalgos", NULL, 0); zephir_check_call_status(); - if (!(zephir_fast_in_array(hashAlgo, availableAlgorithms TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_crypt_exception_ce); - ZEPHIR_SINIT_VAR(_1$$3); - ZVAL_STRING(&_1$$3, "The hash algorithm \"%s\" is not supported on this system.", 0); - ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 164, &_1$$3, hashAlgo); + if (!(zephir_fast_in_array(&hashAlgo, &availableAlgorithms TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_crypt_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "The hash algorithm \"%s\" is not supported on this system."); + ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 145, &_1$$3, &hashAlgo); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 9, _2$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/crypt.zep", 591 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/crypt.zep", 591 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -1295,28 +1436,31 @@ PHP_METHOD(Phalcon_Crypt, getIvLength) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *cipher_param = NULL; - zval *cipher = NULL; + zval cipher; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cipher); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &cipher_param); if (UNEXPECTED(Z_TYPE_P(cipher_param) != IS_STRING && Z_TYPE_P(cipher_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cipher' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cipher' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(cipher_param) == IS_STRING)) { - zephir_get_strval(cipher, cipher_param); + zephir_get_strval(&cipher, cipher_param); } else { - ZEPHIR_INIT_VAR(cipher); - ZVAL_EMPTY_STRING(cipher); + ZEPHIR_INIT_VAR(&cipher); + ZVAL_EMPTY_STRING(&cipher); } - if (!((zephir_function_exists_ex(SS("openssl_cipher_iv_length") TSRMLS_CC) == SUCCESS))) { + if (!((zephir_function_exists_ex(SL("openssl_cipher_iv_length") TSRMLS_CC) == SUCCESS))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "openssl extension is required", "phalcon/crypt.zep", 603); return; } - ZEPHIR_RETURN_CALL_FUNCTION("openssl_cipher_iv_length", NULL, 165, cipher); + ZEPHIR_RETURN_CALL_FUNCTION("openssl_cipher_iv_length", NULL, 146, &cipher); zephir_check_call_status(); RETURN_MM(); @@ -1329,18 +1473,22 @@ PHP_METHOD(Phalcon_Crypt, getIvLength) { */ PHP_METHOD(Phalcon_Crypt, initializeAvailableCiphers) { - zval *_0 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval __$true, _0; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - if (!((zephir_function_exists_ex(SS("openssl_get_cipher_methods") TSRMLS_CC) == SUCCESS))) { + if (!((zephir_function_exists_ex(SL("openssl_get_cipher_methods") TSRMLS_CC) == SUCCESS))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_crypt_exception_ce, "openssl extension is required", "phalcon/crypt.zep", 617); return; } - ZEPHIR_CALL_FUNCTION(&_0, "openssl_get_cipher_methods", NULL, 166, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(&_0, "openssl_get_cipher_methods", NULL, 147, &__$true); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("availableCiphers"), _0 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("availableCiphers"), &_0); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/crypt.zep.h b/ext/phalcon/crypt.zep.h index e8703b9748b..dd81bf28ab5 100644 --- a/ext/phalcon/crypt.zep.h +++ b/ext/phalcon/crypt.zep.h @@ -26,87 +26,266 @@ PHP_METHOD(Phalcon_Crypt, getIvLength); PHP_METHOD(Phalcon_Crypt, initializeAvailableCiphers); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt___construct, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) +#else ZEND_ARG_INFO(0, cipher) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useSigning, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useSigning) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_setpadding, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_crypt_setpadding, 0, 1, Phalcon\\CryptInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_setpadding, 0, 1, IS_OBJECT, "Phalcon\\CryptInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, scheme, IS_LONG, 0) +#else ZEND_ARG_INFO(0, scheme) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_setcipher, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_crypt_setcipher, 0, 1, Phalcon\\CryptInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_setcipher, 0, 1, IS_OBJECT, "Phalcon\\CryptInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) +#else ZEND_ARG_INFO(0, cipher) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_setkey, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getcipher, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getcipher, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_crypt_setkey, 0, 1, Phalcon\\CryptInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_setkey, 0, 1, IS_OBJECT, "Phalcon\\CryptInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_sethashalgo, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getkey, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getkey, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_crypt_sethashalgo, 0, 1, Phalcon\\Crypt, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_sethashalgo, 0, 1, IS_OBJECT, "Phalcon\\Crypt", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, hashAlgo, IS_STRING, 0) +#else ZEND_ARG_INFO(0, hashAlgo) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_gethashalgo, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_gethashalgo, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_usesigning, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_crypt_usesigning, 0, 1, Phalcon\\Crypt, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_usesigning, 0, 1, IS_OBJECT, "Phalcon\\Crypt", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useSigning, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useSigning) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt__cryptpadtext, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) +#else ZEND_ARG_INFO(0, mode) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, blockSize, IS_LONG, 0) +#else ZEND_ARG_INFO(0, blockSize) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, paddingType, IS_LONG, 0) +#else ZEND_ARG_INFO(0, paddingType) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt__cryptunpadtext, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) +#else ZEND_ARG_INFO(0, mode) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, blockSize, IS_LONG, 0) +#else ZEND_ARG_INFO(0, blockSize) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, paddingType, IS_LONG, 0) +#else ZEND_ARG_INFO(0, paddingType) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_encrypt, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_encrypt, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_encrypt, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_decrypt, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_decrypt, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_decrypt, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_encryptbase64, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_encryptbase64, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_encryptbase64, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif ZEND_ARG_INFO(0, key) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, safe, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, safe) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_decryptbase64, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_decryptbase64, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_decryptbase64, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif ZEND_ARG_INFO(0, key) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, safe, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, safe) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getavailableciphers, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getavailableciphers, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getavailablehashalgos, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getavailablehashalgos, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_assertcipherisavailable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) +#else ZEND_ARG_INFO(0, cipher) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_asserthashalgorithmavailable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, hashAlgo, IS_STRING, 0) +#else ZEND_ARG_INFO(0, hashAlgo) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_crypt_getivlength, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getivlength, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_crypt_getivlength, 0, 1, IS_LONG, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) +#else ZEND_ARG_INFO(0, cipher) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_crypt_method_entry) { PHP_ME(Phalcon_Crypt, __construct, arginfo_phalcon_crypt___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Crypt, setPadding, arginfo_phalcon_crypt_setpadding, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Crypt, setCipher, arginfo_phalcon_crypt_setcipher, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Crypt, getCipher, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Crypt, getCipher, arginfo_phalcon_crypt_getcipher, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Crypt, setKey, arginfo_phalcon_crypt_setkey, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Crypt, getKey, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Crypt, getKey, arginfo_phalcon_crypt_getkey, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Crypt, setHashAlgo, arginfo_phalcon_crypt_sethashalgo, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Crypt, getHashAlgo, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Crypt, getHashAlgo, arginfo_phalcon_crypt_gethashalgo, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Crypt, useSigning, arginfo_phalcon_crypt_usesigning, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Crypt, _cryptPadText, arginfo_phalcon_crypt__cryptpadtext, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Crypt, _cryptUnpadText, arginfo_phalcon_crypt__cryptunpadtext, ZEND_ACC_PROTECTED) @@ -114,8 +293,8 @@ ZEPHIR_INIT_FUNCS(phalcon_crypt_method_entry) { PHP_ME(Phalcon_Crypt, decrypt, arginfo_phalcon_crypt_decrypt, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Crypt, encryptBase64, arginfo_phalcon_crypt_encryptbase64, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Crypt, decryptBase64, arginfo_phalcon_crypt_decryptbase64, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Crypt, getAvailableCiphers, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Crypt, getAvailableHashAlgos, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Crypt, getAvailableCiphers, arginfo_phalcon_crypt_getavailableciphers, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Crypt, getAvailableHashAlgos, arginfo_phalcon_crypt_getavailablehashalgos, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Crypt, assertCipherIsAvailable, arginfo_phalcon_crypt_assertcipherisavailable, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Crypt, assertHashAlgorithmAvailable, arginfo_phalcon_crypt_asserthashalgorithmavailable, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Crypt, getIvLength, arginfo_phalcon_crypt_getivlength, ZEND_ACC_PROTECTED) diff --git a/ext/phalcon/cryptinterface.zep.h b/ext/phalcon/cryptinterface.zep.h index f56ef848ca2..b40adbbbbb8 100644 --- a/ext/phalcon/cryptinterface.zep.h +++ b/ext/phalcon/cryptinterface.zep.h @@ -3,43 +3,120 @@ extern zend_class_entry *phalcon_cryptinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_CryptInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cryptinterface_setcipher, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cryptinterface_setcipher, 0, 1, Phalcon\\CryptInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_setcipher, 0, 1, IS_OBJECT, "Phalcon\\CryptInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cipher, IS_STRING, 0) +#else ZEND_ARG_INFO(0, cipher) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cryptinterface_setkey, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_getcipher, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_getcipher, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_cryptinterface_setkey, 0, 1, Phalcon\\CryptInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_setkey, 0, 1, IS_OBJECT, "Phalcon\\CryptInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_getkey, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_getkey, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cryptinterface_encrypt, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_encrypt, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_encrypt, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cryptinterface_decrypt, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_decrypt, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_decrypt, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cryptinterface_encryptbase64, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_encryptbase64, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_encryptbase64, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_cryptinterface_decryptbase64, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_decryptbase64, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_decryptbase64, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_getavailableciphers, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_cryptinterface_getavailableciphers, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_cryptinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_CryptInterface, setCipher, arginfo_phalcon_cryptinterface_setcipher) - PHP_ABSTRACT_ME(Phalcon_CryptInterface, getCipher, NULL) + PHP_ABSTRACT_ME(Phalcon_CryptInterface, getCipher, arginfo_phalcon_cryptinterface_getcipher) PHP_ABSTRACT_ME(Phalcon_CryptInterface, setKey, arginfo_phalcon_cryptinterface_setkey) - PHP_ABSTRACT_ME(Phalcon_CryptInterface, getKey, NULL) + PHP_ABSTRACT_ME(Phalcon_CryptInterface, getKey, arginfo_phalcon_cryptinterface_getkey) PHP_ABSTRACT_ME(Phalcon_CryptInterface, encrypt, arginfo_phalcon_cryptinterface_encrypt) PHP_ABSTRACT_ME(Phalcon_CryptInterface, decrypt, arginfo_phalcon_cryptinterface_decrypt) PHP_ABSTRACT_ME(Phalcon_CryptInterface, encryptBase64, arginfo_phalcon_cryptinterface_encryptbase64) PHP_ABSTRACT_ME(Phalcon_CryptInterface, decryptBase64, arginfo_phalcon_cryptinterface_decryptbase64) - PHP_ABSTRACT_ME(Phalcon_CryptInterface, getAvailableCiphers, NULL) + PHP_ABSTRACT_ME(Phalcon_CryptInterface, getAvailableCiphers, arginfo_phalcon_cryptinterface_getavailableciphers) PHP_FE_END }; diff --git a/ext/phalcon/db.zep.c b/ext/phalcon/db.zep.c index 74e4fc8b578..6a390d0f6ba 100644 --- a/ext/phalcon/db.zep.c +++ b/ext/phalcon/db.zep.c @@ -64,39 +64,39 @@ ZEPHIR_INIT_CLASS(Phalcon_Db) { ZEPHIR_REGISTER_CLASS(Phalcon, Db, phalcon, db, phalcon_db_method_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_LAZY"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_LAZY"), 1); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_ASSOC"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_ASSOC"), 2); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_NAMED"), 11 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_NAMED"), 11); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_NUM"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_NUM"), 3); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_BOTH"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_BOTH"), 4); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_OBJ"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_OBJ"), 5); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_BOUND"), 6 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_BOUND"), 6); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_COLUMN"), 7 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_COLUMN"), 7); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_CLASS"), 8 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_CLASS"), 8); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_INTO"), 9 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_INTO"), 9); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_FUNC"), 10 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_FUNC"), 10); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_GROUP"), 65536 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_GROUP"), 65536); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_UNIQUE"), 196608 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_UNIQUE"), 196608); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_KEY_PAIR"), 12 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_KEY_PAIR"), 12); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_CLASSTYPE"), 262144 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_CLASSTYPE"), 262144); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_SERIALIZE"), 524288 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_SERIALIZE"), 524288); - zend_declare_class_constant_long(phalcon_db_ce, SL("FETCH_PROPS_LATE"), 1048576 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_ce, SL("FETCH_PROPS_LATE"), 1048576); return SUCCESS; @@ -107,22 +107,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Db) { */ PHP_METHOD(Phalcon_Db, setup) { - zval *options_param = NULL, *escapeIdentifiers = NULL, *forceCasting = NULL; - zval *options = NULL; + zval *options_param = NULL, escapeIdentifiers, forceCasting; + zval options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&escapeIdentifiers); + ZVAL_UNDEF(&forceCasting); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &options_param); - options = options_param; + ZEPHIR_OBS_COPY_OR_DUP(&options, options_param); - ZEPHIR_OBS_VAR(escapeIdentifiers); - if (zephir_array_isset_string_fetch(&escapeIdentifiers, options, SS("escapeSqlIdentifiers"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(db).escape_identifiers = zend_is_true(escapeIdentifiers); + ZEPHIR_OBS_VAR(&escapeIdentifiers); + if (zephir_array_isset_string_fetch(&escapeIdentifiers, &options, SL("escapeSqlIdentifiers"), 0)) { + ZEPHIR_GLOBAL(db).escape_identifiers = zend_is_true(&escapeIdentifiers); } - ZEPHIR_OBS_VAR(forceCasting); - if (zephir_array_isset_string_fetch(&forceCasting, options, SS("forceCasting"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(db).force_casting = zend_is_true(forceCasting); + ZEPHIR_OBS_VAR(&forceCasting); + if (zephir_array_isset_string_fetch(&forceCasting, &options, SL("forceCasting"), 0)) { + ZEPHIR_GLOBAL(db).force_casting = zend_is_true(&forceCasting); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/db/adapter.zep.c b/ext/phalcon/db/adapter.zep.c index 4e51521af27..6a5fb88a065 100644 --- a/ext/phalcon/db/adapter.zep.c +++ b/ext/phalcon/db/adapter.zep.c @@ -115,7 +115,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter) { */ PHP_METHOD(Phalcon_Db_Adapter, getDialectType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dialectType"); @@ -126,7 +127,8 @@ PHP_METHOD(Phalcon_Db_Adapter, getDialectType) { */ PHP_METHOD(Phalcon_Db_Adapter, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -137,7 +139,8 @@ PHP_METHOD(Phalcon_Db_Adapter, getType) { */ PHP_METHOD(Phalcon_Db_Adapter, getSqlVariables) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sqlVariables"); @@ -150,43 +153,52 @@ PHP_METHOD(Phalcon_Db_Adapter, __construct) { zend_class_entry *_4$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *descriptor_param = NULL, *dialectClass = NULL, *connectionId = NULL, *_0, *_1$$3, *_2$$4, *_3$$4 = NULL; - zval *descriptor = NULL; + zval *descriptor_param = NULL, dialectClass, connectionId, _0, _1$$3, _2$$4, _3$$4; + zval descriptor; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&descriptor); + ZVAL_UNDEF(&dialectClass); + ZVAL_UNDEF(&connectionId); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &descriptor_param); - descriptor = descriptor_param; + ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param); - ZEPHIR_OBS_VAR(connectionId); - zephir_read_static_property_ce(&connectionId, phalcon_db_adapter_ce, SL("_connectionConsecutive") TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_connectionId"), connectionId TSRMLS_CC); + ZEPHIR_OBS_VAR(&connectionId); + zephir_read_static_property_ce(&connectionId, phalcon_db_adapter_ce, SL("_connectionConsecutive"), PH_NOISY_CC); + zephir_update_property_zval(this_ptr, SL("_connectionId"), &connectionId); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, (zephir_get_numberval(connectionId) + 1)); - zephir_update_static_property_ce(phalcon_db_adapter_ce, SL("_connectionConsecutive"), &_0 TSRMLS_CC); - ZEPHIR_OBS_VAR(dialectClass); - if (!(zephir_array_isset_string_fetch(&dialectClass, descriptor, SS("dialectClass"), 0 TSRMLS_CC))) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dialectType"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(dialectClass); - ZEPHIR_CONCAT_SV(dialectClass, "phalcon\\db\\dialect\\", _1$$3); - } - if (Z_TYPE_P(dialectClass) == IS_STRING) { - ZEPHIR_INIT_VAR(_2$$4); - zephir_fetch_safe_class(_3$$4, dialectClass); - _4$$4 = zend_fetch_class(Z_STRVAL_P(_3$$4), Z_STRLEN_P(_3$$4), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(_2$$4, _4$$4); - if (zephir_has_constructor(_2$$4 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, _2$$4, "__construct", NULL, 0); + ZVAL_LONG(&_0, (zephir_get_numberval(&connectionId) + 1)); + zend_update_static_property(phalcon_db_adapter_ce, ZEND_STRL("_connectionConsecutive"), &_0); + ZEPHIR_OBS_VAR(&dialectClass); + if (!(zephir_array_isset_string_fetch(&dialectClass, &descriptor, SL("dialectClass"), 0))) { + zephir_read_property(&_1$$3, this_ptr, SL("_dialectType"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&dialectClass); + ZEPHIR_CONCAT_SV(&dialectClass, "phalcon\\db\\dialect\\", &_1$$3); + } + if (Z_TYPE_P(&dialectClass) == IS_STRING) { + ZEPHIR_INIT_VAR(&_2$$4); + zephir_fetch_safe_class(&_3$$4, &dialectClass); + _4$$4 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_3$$4), Z_STRLEN_P(&_3$$4), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&_2$$4, _4$$4); + if (zephir_has_constructor(&_2$$4 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_dialect"), _2$$4 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dialect"), &_2$$4); } else { - if (Z_TYPE_P(dialectClass) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_dialect"), dialectClass TSRMLS_CC); + if (Z_TYPE_P(&dialectClass) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_dialect"), &dialectClass); } } - zephir_update_property_this(getThis(), SL("_descriptor"), descriptor TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_descriptor"), &descriptor); ZEPHIR_MM_RESTORE(); } @@ -196,13 +208,16 @@ PHP_METHOD(Phalcon_Db_Adapter, __construct) { */ PHP_METHOD(Phalcon_Db_Adapter, setEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); } @@ -211,7 +226,8 @@ PHP_METHOD(Phalcon_Db_Adapter, setEventsManager) { */ PHP_METHOD(Phalcon_Db_Adapter, getEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -222,13 +238,16 @@ PHP_METHOD(Phalcon_Db_Adapter, getEventsManager) { */ PHP_METHOD(Phalcon_Db_Adapter, setDialect) { - zval *dialect; + zval *dialect, dialect_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dialect_sub); zephir_fetch_params(0, 1, 0, &dialect); - zephir_update_property_this(getThis(), SL("_dialect"), dialect TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dialect"), dialect); } @@ -237,7 +256,8 @@ PHP_METHOD(Phalcon_Db_Adapter, setDialect) { */ PHP_METHOD(Phalcon_Db_Adapter, getDialect) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dialect"); @@ -259,42 +279,53 @@ PHP_METHOD(Phalcon_Db_Adapter, getDialect) { PHP_METHOD(Phalcon_Db_Adapter, fetchOne) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sqlQuery_param = NULL, *fetchMode = NULL, *bindParams = NULL, *bindTypes = NULL, *result = NULL; - zval *sqlQuery = NULL; + zval *sqlQuery_param = NULL, *fetchMode = NULL, fetchMode_sub, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, result; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); + ZVAL_UNDEF(&fetchMode_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&result); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &sqlQuery_param, &fetchMode, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) { - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); } else { - ZEPHIR_INIT_VAR(sqlQuery); - ZVAL_EMPTY_STRING(sqlQuery); + ZEPHIR_INIT_VAR(&sqlQuery); + ZVAL_EMPTY_STRING(&sqlQuery); } if (!fetchMode) { + fetchMode = &fetchMode_sub; ZEPHIR_INIT_VAR(fetchMode); ZVAL_LONG(fetchMode, 2); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_CALL_METHOD(&result, this_ptr, "query", NULL, 0, sqlQuery, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(&result, this_ptr, "query", NULL, 0, &sqlQuery, bindParams, bindTypes); zephir_check_call_status(); - if (Z_TYPE_P(result) == IS_OBJECT) { + if (Z_TYPE_P(&result) == IS_OBJECT) { if (Z_TYPE_P(fetchMode) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, result, "setfetchmode", NULL, 0, fetchMode); + ZEPHIR_CALL_METHOD(NULL, &result, "setfetchmode", NULL, 0, fetchMode); zephir_check_call_status(); } - ZEPHIR_RETURN_CALL_METHOD(result, "fetch", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&result, "fetch", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -339,38 +370,50 @@ PHP_METHOD(Phalcon_Db_Adapter, fetchOne) { PHP_METHOD(Phalcon_Db_Adapter, fetchAll) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sqlQuery_param = NULL, *fetchMode = NULL, *bindParams = NULL, *bindTypes = NULL, *results = NULL, *result = NULL; - zval *sqlQuery = NULL; + zval *sqlQuery_param = NULL, *fetchMode = NULL, fetchMode_sub, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, results, result; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); + ZVAL_UNDEF(&fetchMode_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&results); + ZVAL_UNDEF(&result); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &sqlQuery_param, &fetchMode, &bindParams, &bindTypes); - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); if (!fetchMode) { + fetchMode = &fetchMode_sub; ZEPHIR_INIT_VAR(fetchMode); ZVAL_LONG(fetchMode, 2); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_INIT_VAR(results); - array_init(results); - ZEPHIR_CALL_METHOD(&result, this_ptr, "query", NULL, 0, sqlQuery, bindParams, bindTypes); + ZEPHIR_INIT_VAR(&results); + array_init(&results); + ZEPHIR_CALL_METHOD(&result, this_ptr, "query", NULL, 0, &sqlQuery, bindParams, bindTypes); zephir_check_call_status(); - if (Z_TYPE_P(result) == IS_OBJECT) { + if (Z_TYPE_P(&result) == IS_OBJECT) { if (Z_TYPE_P(fetchMode) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, result, "setfetchmode", NULL, 0, fetchMode); + ZEPHIR_CALL_METHOD(NULL, &result, "setfetchmode", NULL, 0, fetchMode); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&results, result, "fetchall", NULL, 0); + ZEPHIR_CALL_METHOD(&results, &result, "fetchall", NULL, 0); zephir_check_call_status(); } - RETURN_CCTOR(results); + RETURN_CCTOR(&results); } @@ -399,30 +442,40 @@ PHP_METHOD(Phalcon_Db_Adapter, fetchColumn) { zend_bool _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sqlQuery, *placeholders = NULL, *column = NULL, *row = NULL, *columnValue = NULL, *_0; + zval *sqlQuery, sqlQuery_sub, *placeholders = NULL, placeholders_sub, *column = NULL, column_sub, __$null, row, columnValue, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery_sub); + ZVAL_UNDEF(&placeholders_sub); + ZVAL_UNDEF(&column_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&row); + ZVAL_UNDEF(&columnValue); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &sqlQuery, &placeholders, &column); if (!placeholders) { - placeholders = ZEPHIR_GLOBAL(global_null); + placeholders = &placeholders_sub; + placeholders = &__$null; } if (!column) { + column = &column_sub; ZEPHIR_INIT_VAR(column); ZVAL_LONG(column, 0); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 4); - ZEPHIR_CALL_METHOD(&row, this_ptr, "fetchone", NULL, 0, sqlQuery, _0, placeholders); + ZVAL_LONG(&_0, 4); + ZEPHIR_CALL_METHOD(&row, this_ptr, "fetchone", NULL, 0, sqlQuery, &_0, placeholders); zephir_check_call_status(); - _1 = !(ZEPHIR_IS_EMPTY(row)); + _1 = !(ZEPHIR_IS_EMPTY(&row)); if (_1) { - _1 = zephir_array_isset_fetch(&columnValue, row, column, 1 TSRMLS_CC); + _1 = zephir_array_isset_fetch(&columnValue, &row, column, 1 TSRMLS_CC); } if (_1) { - RETURN_CTOR(columnValue); + RETURN_CTOR(&columnValue); } RETURN_MM_BOOL(0); @@ -451,112 +504,146 @@ PHP_METHOD(Phalcon_Db_Adapter, fetchColumn) { */ PHP_METHOD(Phalcon_Db_Adapter, insert) { - zval *_6$$5 = NULL, *_7$$7 = NULL; + zval _6$$5, _7$$7; zend_bool _5$$4; - HashTable *_3, *_11$$12; - HashPosition _2, _10$$12; + zend_string *_4; + zend_ulong _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *values = NULL; - zval *table, *values_param = NULL, *fields = NULL, *dataTypes = NULL, *placeholders = NULL, *insertValues = NULL, *bindDataTypes = NULL, *bindType = NULL, *position = NULL, *value = NULL, *escapedTable = NULL, *joinedValues = NULL, *escapedFields = NULL, *field = NULL, *insertSql = NULL, **_4, *_0$$3, *_1$$3, *_8$$8 = NULL, *_9$$9 = NULL, **_12$$12, *_14$$12, *_13$$13 = NULL; + zval values; + zval *table, table_sub, *values_param = NULL, *fields = NULL, fields_sub, *dataTypes = NULL, dataTypes_sub, __$null, placeholders, insertValues, bindDataTypes, bindType, position, value, escapedTable, joinedValues, escapedFields, field, insertSql, *_2, _0$$3, _1$$3, _8$$8, _9$$9, *_10$$12, _12$$12, _11$$13; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table_sub); + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&dataTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&placeholders); + ZVAL_UNDEF(&insertValues); + ZVAL_UNDEF(&bindDataTypes); + ZVAL_UNDEF(&bindType); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&escapedTable); + ZVAL_UNDEF(&joinedValues); + ZVAL_UNDEF(&escapedFields); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&insertSql); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_12$$12); + ZVAL_UNDEF(&_11$$13); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 2, &table, &values_param, &fields, &dataTypes); - values = values_param; + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); if (!fields) { - fields = ZEPHIR_GLOBAL(global_null); + fields = &fields_sub; + fields = &__$null; } if (!dataTypes) { - dataTypes = ZEPHIR_GLOBAL(global_null); + dataTypes = &dataTypes_sub; + dataTypes = &__$null; } - if (!(zephir_fast_count_int(values TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_db_exception_ce); - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_CONCAT_SVS(_1$$3, "Unable to insert into ", table, " without data"); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 9, _1$$3); + if (!(zephir_fast_count_int(&values TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_db_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_CONCAT_SVS(&_1$$3, "Unable to insert into ", table, " without data"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 4, &_1$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/db/adapter.zep", 310 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/db/adapter.zep", 310 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(placeholders); - array_init(placeholders); - ZEPHIR_INIT_VAR(insertValues); - array_init(insertValues); - ZEPHIR_INIT_VAR(bindDataTypes); - array_init(bindDataTypes); - zephir_is_iterable(values, &_3, &_2, 0, 0, "phalcon/db/adapter.zep", 344); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HMKEY(position, _3, _2); - ZEPHIR_GET_HVALUE(value, _4); - _5$$4 = Z_TYPE_P(value) == IS_OBJECT; + ZEPHIR_INIT_VAR(&placeholders); + array_init(&placeholders); + ZEPHIR_INIT_VAR(&insertValues); + array_init(&insertValues); + ZEPHIR_INIT_VAR(&bindDataTypes); + array_init(&bindDataTypes); + zephir_is_iterable(&values, 0, "phalcon/db/adapter.zep", 344); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&values), _3, _4, _2) + { + ZEPHIR_INIT_NVAR(&position); + if (_4 != NULL) { + ZVAL_STR_COPY(&position, _4); + } else { + ZVAL_LONG(&position, _3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _2); + _5$$4 = Z_TYPE_P(&value) == IS_OBJECT; if (_5$$4) { - _5$$4 = zephir_instance_of_ev(value, phalcon_db_rawvalue_ce TSRMLS_CC); + _5$$4 = zephir_instance_of_ev(&value, phalcon_db_rawvalue_ce TSRMLS_CC); } if (_5$$4) { - zephir_get_strval(_6$$5, value); - zephir_array_append(&placeholders, _6$$5, PH_SEPARATE, "phalcon/db/adapter.zep", 323); + zephir_get_strval(&_6$$5, &value); + zephir_array_append(&placeholders, &_6$$5, PH_SEPARATE, "phalcon/db/adapter.zep", 323); } else { - if (Z_TYPE_P(value) == IS_OBJECT) { - zephir_get_strval(_7$$7, value); - ZEPHIR_CPY_WRT(value, _7$$7); + if (Z_TYPE_P(&value) == IS_OBJECT) { + zephir_get_strval(&_7$$7, &value); + ZEPHIR_CPY_WRT(&value, &_7$$7); } - if (Z_TYPE_P(value) == IS_NULL) { - ZEPHIR_INIT_NVAR(_8$$8); - ZVAL_STRING(_8$$8, "null", 1); - zephir_array_append(&placeholders, _8$$8, PH_SEPARATE, "phalcon/db/adapter.zep", 330); + if (Z_TYPE_P(&value) == IS_NULL) { + ZEPHIR_INIT_NVAR(&_8$$8); + ZVAL_STRING(&_8$$8, "null"); + zephir_array_append(&placeholders, &_8$$8, PH_SEPARATE, "phalcon/db/adapter.zep", 330); } else { - ZEPHIR_INIT_NVAR(_9$$9); - ZVAL_STRING(_9$$9, "?", 1); - zephir_array_append(&placeholders, _9$$9, PH_SEPARATE, "phalcon/db/adapter.zep", 332); - zephir_array_append(&insertValues, value, PH_SEPARATE, "phalcon/db/adapter.zep", 333); + ZEPHIR_INIT_NVAR(&_9$$9); + ZVAL_STRING(&_9$$9, "?"); + zephir_array_append(&placeholders, &_9$$9, PH_SEPARATE, "phalcon/db/adapter.zep", 332); + zephir_array_append(&insertValues, &value, PH_SEPARATE, "phalcon/db/adapter.zep", 333); if (Z_TYPE_P(dataTypes) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(bindType); - if (!(zephir_array_isset_fetch(&bindType, dataTypes, position, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&bindType); + if (!(zephir_array_isset_fetch(&bindType, dataTypes, &position, 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Incomplete number of bind types", "phalcon/db/adapter.zep", 336); return; } - zephir_array_append(&bindDataTypes, bindType, PH_SEPARATE, "phalcon/db/adapter.zep", 338); + zephir_array_append(&bindDataTypes, &bindType, PH_SEPARATE, "phalcon/db/adapter.zep", 338); } } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&position); ZEPHIR_CALL_METHOD(&escapedTable, this_ptr, "escapeidentifier", NULL, 0, table); zephir_check_call_status(); - ZEPHIR_INIT_VAR(joinedValues); - zephir_fast_join_str(joinedValues, SL(", "), placeholders TSRMLS_CC); - ZEPHIR_INIT_VAR(insertSql); + ZEPHIR_INIT_VAR(&joinedValues); + zephir_fast_join_str(&joinedValues, SL(", "), &placeholders TSRMLS_CC); + ZEPHIR_INIT_VAR(&insertSql); if (Z_TYPE_P(fields) == IS_ARRAY) { - ZEPHIR_INIT_VAR(escapedFields); - array_init(escapedFields); - zephir_is_iterable(fields, &_11$$12, &_10$$12, 0, 0, "phalcon/db/adapter.zep", 356); - for ( - ; zend_hash_get_current_data_ex(_11$$12, (void**) &_12$$12, &_10$$12) == SUCCESS - ; zend_hash_move_forward_ex(_11$$12, &_10$$12) - ) { - ZEPHIR_GET_HVALUE(field, _12$$12); - ZEPHIR_CALL_METHOD(&_13$$13, this_ptr, "escapeidentifier", NULL, 0, field); + ZEPHIR_INIT_VAR(&escapedFields); + array_init(&escapedFields); + zephir_is_iterable(fields, 0, "phalcon/db/adapter.zep", 356); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(fields), _10$$12) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _10$$12); + ZEPHIR_CALL_METHOD(&_11$$13, this_ptr, "escapeidentifier", NULL, 0, &field); zephir_check_call_status(); - zephir_array_append(&escapedFields, _13$$13, PH_SEPARATE, "phalcon/db/adapter.zep", 353); - } - ZEPHIR_INIT_VAR(_14$$12); - zephir_fast_join_str(_14$$12, SL(", "), escapedFields TSRMLS_CC); - ZEPHIR_CONCAT_SVSVSVS(insertSql, "INSERT INTO ", escapedTable, " (", _14$$12, ") VALUES (", joinedValues, ")"); + zephir_array_append(&escapedFields, &_11$$13, PH_SEPARATE, "phalcon/db/adapter.zep", 353); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_INIT_VAR(&_12$$12); + zephir_fast_join_str(&_12$$12, SL(", "), &escapedFields TSRMLS_CC); + ZEPHIR_CONCAT_SVSVSVS(&insertSql, "INSERT INTO ", &escapedTable, " (", &_12$$12, ") VALUES (", &joinedValues, ")"); } else { - ZEPHIR_CONCAT_SVSVS(insertSql, "INSERT INTO ", escapedTable, " VALUES (", joinedValues, ")"); + ZEPHIR_CONCAT_SVSVS(&insertSql, "INSERT INTO ", &escapedTable, " VALUES (", &joinedValues, ")"); } - if (!(zephir_fast_count_int(bindDataTypes TSRMLS_CC))) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, insertSql, insertValues); + if (!(zephir_fast_count_int(&bindDataTypes TSRMLS_CC))) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &insertSql, &insertValues); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, insertSql, insertValues, bindDataTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &insertSql, &insertValues, &bindDataTypes); zephir_check_call_status(); RETURN_MM(); @@ -586,24 +673,35 @@ PHP_METHOD(Phalcon_Db_Adapter, insert) { */ PHP_METHOD(Phalcon_Db_Adapter, insertAsDict) { - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table, *data, *dataTypes = NULL, *values = NULL, *fields = NULL, *field = NULL, *value = NULL, **_3; + zval *table, table_sub, *data, data_sub, *dataTypes = NULL, dataTypes_sub, __$null, values, fields, field, value, *_1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&dataTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &table, &data, &dataTypes); if (!dataTypes) { - dataTypes = ZEPHIR_GLOBAL(global_null); + dataTypes = &dataTypes_sub; + dataTypes = &__$null; } - ZEPHIR_INIT_VAR(values); - array_init(values); - ZEPHIR_INIT_VAR(fields); - array_init(fields); + ZEPHIR_INIT_VAR(&values); + array_init(&values); + ZEPHIR_INIT_VAR(&fields); + array_init(&fields); _0 = Z_TYPE_P(data) != IS_ARRAY; if (!(_0)) { _0 = ZEPHIR_IS_EMPTY(data); @@ -611,17 +709,23 @@ PHP_METHOD(Phalcon_Db_Adapter, insertAsDict) { if (_0) { RETURN_MM_BOOL(0); } - zephir_is_iterable(data, &_2, &_1, 0, 0, "phalcon/db/adapter.zep", 407); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(field, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); - zephir_array_append(&fields, field, PH_SEPARATE, "phalcon/db/adapter.zep", 403); - zephir_array_append(&values, value, PH_SEPARATE, "phalcon/db/adapter.zep", 404); - } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "insert", NULL, 0, table, values, fields, dataTypes); + zephir_is_iterable(data, 0, "phalcon/db/adapter.zep", 407); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&field); + if (_3 != NULL) { + ZVAL_STR_COPY(&field, _3); + } else { + ZVAL_LONG(&field, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/db/adapter.zep", 403); + zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/db/adapter.zep", 404); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "insert", NULL, 0, table, &values, &fields, dataTypes); zephir_check_call_status(); RETURN_MM(); @@ -670,86 +774,121 @@ PHP_METHOD(Phalcon_Db_Adapter, insertAsDict) { */ PHP_METHOD(Phalcon_Db_Adapter, update) { - zval *_5$$5 = NULL, *_7$$7 = NULL; + zval _5$$5, _7$$7; zend_bool _4$$3; - HashTable *_1; - HashPosition _0; + zend_string *_2; + zend_ulong _1; zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table, *fields, *values, *whereCondition = NULL, *dataTypes = NULL, *placeholders = NULL, *updateValues = NULL, *position = NULL, *value = NULL, *field = NULL, *bindDataTypes = NULL, *escapedField = NULL, *bindType = NULL, *escapedTable = NULL, *setClause = NULL, *updateSql = NULL, *conditions = NULL, *whereBind = NULL, *whereTypes = NULL, **_2, *_6$$5 = NULL, *_8$$8 = NULL, *_9$$9 = NULL; + zval *table, table_sub, *fields, fields_sub, *values, values_sub, *whereCondition = NULL, whereCondition_sub, *dataTypes = NULL, dataTypes_sub, __$null, placeholders, updateValues, position, value, field, bindDataTypes, escapedField, bindType, escapedTable, setClause, updateSql, conditions, whereBind, whereTypes, *_0, _6$$5, _8$$8, _9$$9; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table_sub); + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&values_sub); + ZVAL_UNDEF(&whereCondition_sub); + ZVAL_UNDEF(&dataTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&placeholders); + ZVAL_UNDEF(&updateValues); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&bindDataTypes); + ZVAL_UNDEF(&escapedField); + ZVAL_UNDEF(&bindType); + ZVAL_UNDEF(&escapedTable); + ZVAL_UNDEF(&setClause); + ZVAL_UNDEF(&updateSql); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&whereBind); + ZVAL_UNDEF(&whereTypes); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 2, &table, &fields, &values, &whereCondition, &dataTypes); if (!whereCondition) { - whereCondition = ZEPHIR_GLOBAL(global_null); + whereCondition = &whereCondition_sub; + whereCondition = &__$null; } if (!dataTypes) { - dataTypes = ZEPHIR_GLOBAL(global_null); - } - - - ZEPHIR_INIT_VAR(placeholders); - array_init(placeholders); - ZEPHIR_INIT_VAR(updateValues); - array_init(updateValues); - ZEPHIR_INIT_VAR(bindDataTypes); - array_init(bindDataTypes); - zephir_is_iterable(values, &_1, &_0, 0, 0, "phalcon/db/adapter.zep", 494); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(position, _1, _0); - ZEPHIR_GET_HVALUE(value, _2); - ZEPHIR_OBS_NVAR(field); - if (!(zephir_array_isset_fetch(&field, fields, position, 0 TSRMLS_CC))) { + dataTypes = &dataTypes_sub; + dataTypes = &__$null; + } + + + ZEPHIR_INIT_VAR(&placeholders); + array_init(&placeholders); + ZEPHIR_INIT_VAR(&updateValues); + array_init(&updateValues); + ZEPHIR_INIT_VAR(&bindDataTypes); + array_init(&bindDataTypes); + zephir_is_iterable(values, 0, "phalcon/db/adapter.zep", 494); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(values), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&position); + if (_2 != NULL) { + ZVAL_STR_COPY(&position, _2); + } else { + ZVAL_LONG(&position, _1); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + ZEPHIR_OBS_NVAR(&field); + if (!(zephir_array_isset_fetch(&field, fields, &position, 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The number of values in the update is not the same as fields", "phalcon/db/adapter.zep", 468); return; } - ZEPHIR_CALL_METHOD(&escapedField, this_ptr, "escapeidentifier", &_3, 0, field); + ZEPHIR_CALL_METHOD(&escapedField, this_ptr, "escapeidentifier", &_3, 0, &field); zephir_check_call_status(); - _4$$3 = Z_TYPE_P(value) == IS_OBJECT; + _4$$3 = Z_TYPE_P(&value) == IS_OBJECT; if (_4$$3) { - _4$$3 = zephir_instance_of_ev(value, phalcon_db_rawvalue_ce TSRMLS_CC); + _4$$3 = zephir_instance_of_ev(&value, phalcon_db_rawvalue_ce TSRMLS_CC); } if (_4$$3) { - zephir_get_strval(_5$$5, value); + zephir_get_strval(&_5$$5, &value); ZEPHIR_INIT_LNVAR(_6$$5); - ZEPHIR_CONCAT_VSV(_6$$5, escapedField, " = ", _5$$5); - zephir_array_append(&placeholders, _6$$5, PH_SEPARATE, "phalcon/db/adapter.zep", 473); + ZEPHIR_CONCAT_VSV(&_6$$5, &escapedField, " = ", &_5$$5); + zephir_array_append(&placeholders, &_6$$5, PH_SEPARATE, "phalcon/db/adapter.zep", 473); } else { - if (Z_TYPE_P(value) == IS_OBJECT) { - zephir_get_strval(_7$$7, value); - ZEPHIR_CPY_WRT(value, _7$$7); + if (Z_TYPE_P(&value) == IS_OBJECT) { + zephir_get_strval(&_7$$7, &value); + ZEPHIR_CPY_WRT(&value, &_7$$7); } - if (Z_TYPE_P(value) == IS_NULL) { + if (Z_TYPE_P(&value) == IS_NULL) { ZEPHIR_INIT_LNVAR(_8$$8); - ZEPHIR_CONCAT_VS(_8$$8, escapedField, " = null"); - zephir_array_append(&placeholders, _8$$8, PH_SEPARATE, "phalcon/db/adapter.zep", 480); + ZEPHIR_CONCAT_VS(&_8$$8, &escapedField, " = null"); + zephir_array_append(&placeholders, &_8$$8, PH_SEPARATE, "phalcon/db/adapter.zep", 480); } else { - zephir_array_append(&updateValues, value, PH_SEPARATE, "phalcon/db/adapter.zep", 482); + zephir_array_append(&updateValues, &value, PH_SEPARATE, "phalcon/db/adapter.zep", 482); if (Z_TYPE_P(dataTypes) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(bindType); - if (!(zephir_array_isset_fetch(&bindType, dataTypes, position, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&bindType); + if (!(zephir_array_isset_fetch(&bindType, dataTypes, &position, 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Incomplete number of bind types", "phalcon/db/adapter.zep", 485); return; } - zephir_array_append(&bindDataTypes, bindType, PH_SEPARATE, "phalcon/db/adapter.zep", 487); + zephir_array_append(&bindDataTypes, &bindType, PH_SEPARATE, "phalcon/db/adapter.zep", 487); } ZEPHIR_INIT_LNVAR(_9$$9); - ZEPHIR_CONCAT_VS(_9$$9, escapedField, " = ?"); - zephir_array_append(&placeholders, _9$$9, PH_SEPARATE, "phalcon/db/adapter.zep", 489); + ZEPHIR_CONCAT_VS(&_9$$9, &escapedField, " = ?"); + zephir_array_append(&placeholders, &_9$$9, PH_SEPARATE, "phalcon/db/adapter.zep", 489); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&position); ZEPHIR_CALL_METHOD(&escapedTable, this_ptr, "escapeidentifier", &_3, 0, table); zephir_check_call_status(); - ZEPHIR_INIT_VAR(setClause); - zephir_fast_join_str(setClause, SL(", "), placeholders TSRMLS_CC); - ZEPHIR_INIT_VAR(updateSql); + ZEPHIR_INIT_VAR(&setClause); + zephir_fast_join_str(&setClause, SL(", "), &placeholders TSRMLS_CC); + ZEPHIR_INIT_VAR(&updateSql); if (Z_TYPE_P(whereCondition) != IS_NULL) { - ZEPHIR_CONCAT_SVSVS(updateSql, "UPDATE ", escapedTable, " SET ", setClause, " WHERE "); + ZEPHIR_CONCAT_SVSVS(&updateSql, "UPDATE ", &escapedTable, " SET ", &setClause, " WHERE "); if (Z_TYPE_P(whereCondition) == IS_STRING) { zephir_concat_self(&updateSql, whereCondition TSRMLS_CC); } else { @@ -757,28 +896,28 @@ PHP_METHOD(Phalcon_Db_Adapter, update) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid WHERE clause conditions", "phalcon/db/adapter.zep", 513); return; } - ZEPHIR_OBS_VAR(conditions); - if (zephir_array_isset_string_fetch(&conditions, whereCondition, SS("conditions"), 0 TSRMLS_CC)) { - zephir_concat_self(&updateSql, conditions TSRMLS_CC); + ZEPHIR_OBS_VAR(&conditions); + if (zephir_array_isset_string_fetch(&conditions, whereCondition, SL("conditions"), 0)) { + zephir_concat_self(&updateSql, &conditions TSRMLS_CC); } - ZEPHIR_OBS_VAR(whereBind); - if (zephir_array_isset_string_fetch(&whereBind, whereCondition, SS("bind"), 0 TSRMLS_CC)) { - zephir_merge_append(updateValues, whereBind); + ZEPHIR_OBS_VAR(&whereBind); + if (zephir_array_isset_string_fetch(&whereBind, whereCondition, SL("bind"), 0)) { + zephir_merge_append(&updateValues, &whereBind); } - ZEPHIR_OBS_VAR(whereTypes); - if (zephir_array_isset_string_fetch(&whereTypes, whereCondition, SS("bindTypes"), 0 TSRMLS_CC)) { - zephir_merge_append(bindDataTypes, whereTypes); + ZEPHIR_OBS_VAR(&whereTypes); + if (zephir_array_isset_string_fetch(&whereTypes, whereCondition, SL("bindTypes"), 0)) { + zephir_merge_append(&bindDataTypes, &whereTypes); } } } else { - ZEPHIR_CONCAT_SVSV(updateSql, "UPDATE ", escapedTable, " SET ", setClause); + ZEPHIR_CONCAT_SVSV(&updateSql, "UPDATE ", &escapedTable, " SET ", &setClause); } - if (!(zephir_fast_count_int(bindDataTypes TSRMLS_CC))) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, updateSql, updateValues); + if (!(zephir_fast_count_int(&bindDataTypes TSRMLS_CC))) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &updateSql, &updateValues); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, updateSql, updateValues, bindDataTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &updateSql, &updateValues, &bindDataTypes); zephir_check_call_status(); RETURN_MM(); @@ -810,27 +949,40 @@ PHP_METHOD(Phalcon_Db_Adapter, update) { */ PHP_METHOD(Phalcon_Db_Adapter, updateAsDict) { - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table, *data, *whereCondition = NULL, *dataTypes = NULL, *values = NULL, *fields = NULL, *field = NULL, *value = NULL, **_3; + zval *table, table_sub, *data, data_sub, *whereCondition = NULL, whereCondition_sub, *dataTypes = NULL, dataTypes_sub, __$null, values, fields, field, value, *_1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&whereCondition_sub); + ZVAL_UNDEF(&dataTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 2, &table, &data, &whereCondition, &dataTypes); if (!whereCondition) { - whereCondition = ZEPHIR_GLOBAL(global_null); + whereCondition = &whereCondition_sub; + whereCondition = &__$null; } if (!dataTypes) { - dataTypes = ZEPHIR_GLOBAL(global_null); + dataTypes = &dataTypes_sub; + dataTypes = &__$null; } - ZEPHIR_INIT_VAR(values); - array_init(values); - ZEPHIR_INIT_VAR(fields); - array_init(fields); + ZEPHIR_INIT_VAR(&values); + array_init(&values); + ZEPHIR_INIT_VAR(&fields); + array_init(&fields); _0 = Z_TYPE_P(data) != IS_ARRAY; if (!(_0)) { _0 = ZEPHIR_IS_EMPTY(data); @@ -838,17 +990,23 @@ PHP_METHOD(Phalcon_Db_Adapter, updateAsDict) { if (_0) { RETURN_MM_BOOL(0); } - zephir_is_iterable(data, &_2, &_1, 0, 0, "phalcon/db/adapter.zep", 589); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(field, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); - zephir_array_append(&fields, field, PH_SEPARATE, "phalcon/db/adapter.zep", 585); - zephir_array_append(&values, value, PH_SEPARATE, "phalcon/db/adapter.zep", 586); - } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "update", NULL, 0, table, fields, values, whereCondition, dataTypes); + zephir_is_iterable(data, 0, "phalcon/db/adapter.zep", 589); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(data), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&field); + if (_3 != NULL) { + ZVAL_STR_COPY(&field, _3); + } else { + ZVAL_LONG(&field, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/db/adapter.zep", 585); + zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/db/adapter.zep", 586); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "update", NULL, 0, table, &fields, &values, whereCondition, dataTypes); zephir_check_call_status(); RETURN_MM(); @@ -877,31 +1035,43 @@ PHP_METHOD(Phalcon_Db_Adapter, updateAsDict) { PHP_METHOD(Phalcon_Db_Adapter, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table, *whereCondition = NULL, *placeholders = NULL, *dataTypes = NULL, *sql = NULL, *escapedTable = NULL; + zval *table, table_sub, *whereCondition = NULL, whereCondition_sub, *placeholders = NULL, placeholders_sub, *dataTypes = NULL, dataTypes_sub, __$null, sql, escapedTable; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table_sub); + ZVAL_UNDEF(&whereCondition_sub); + ZVAL_UNDEF(&placeholders_sub); + ZVAL_UNDEF(&dataTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&escapedTable); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &table, &whereCondition, &placeholders, &dataTypes); if (!whereCondition) { - whereCondition = ZEPHIR_GLOBAL(global_null); + whereCondition = &whereCondition_sub; + whereCondition = &__$null; } if (!placeholders) { - placeholders = ZEPHIR_GLOBAL(global_null); + placeholders = &placeholders_sub; + placeholders = &__$null; } if (!dataTypes) { - dataTypes = ZEPHIR_GLOBAL(global_null); + dataTypes = &dataTypes_sub; + dataTypes = &__$null; } ZEPHIR_CALL_METHOD(&escapedTable, this_ptr, "escapeidentifier", NULL, 0, table); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); + ZEPHIR_INIT_VAR(&sql); if (!(ZEPHIR_IS_EMPTY(whereCondition))) { - ZEPHIR_CONCAT_SVSV(sql, "DELETE FROM ", escapedTable, " WHERE ", whereCondition); + ZEPHIR_CONCAT_SVSV(&sql, "DELETE FROM ", &escapedTable, " WHERE ", whereCondition); } else { - ZEPHIR_CONCAT_SV(sql, "DELETE FROM ", escapedTable); + ZEPHIR_CONCAT_SV(&sql, "DELETE FROM ", &escapedTable); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, sql, placeholders, dataTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &sql, placeholders, dataTypes); zephir_check_call_status(); RETURN_MM(); @@ -928,7 +1098,17 @@ PHP_METHOD(Phalcon_Db_Adapter, delete) { PHP_METHOD(Phalcon_Db_Adapter, escapeIdentifier) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *identifier, *_0$$3, *_1$$3 = NULL, *_2$$3, *_3$$3, *_4$$3 = NULL, *_5$$3, *_6; + zval *identifier, identifier_sub, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&identifier_sub); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &identifier); @@ -936,19 +1116,19 @@ PHP_METHOD(Phalcon_Db_Adapter, escapeIdentifier) { if (Z_TYPE_P(identifier) == IS_ARRAY) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); + zephir_read_property(&_0$$3, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_long(&_2$$3, identifier, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 651 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_1$$3, _0$$3, "escape", NULL, 0, _2$$3); + ZEPHIR_CALL_METHOD(&_1$$3, &_0$$3, "escape", NULL, 0, &_2$$3); zephir_check_call_status(); - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); + zephir_read_property(&_3$$3, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); zephir_array_fetch_long(&_5$$3, identifier, 1, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 651 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_4$$3, _3$$3, "escape", NULL, 0, _5$$3); + ZEPHIR_CALL_METHOD(&_4$$3, &_3$$3, "escape", NULL, 0, &_5$$3); zephir_check_call_status(); - ZEPHIR_CONCAT_VSV(return_value, _1$$3, ".", _4$$3); + ZEPHIR_CONCAT_VSV(return_value, &_1$$3, ".", &_4$$3); RETURN_MM(); } - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_6, "escape", NULL, 0, identifier); + zephir_read_property(&_6, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_6, "escape", NULL, 0, identifier); zephir_check_call_status(); RETURN_MM(); @@ -963,15 +1143,19 @@ PHP_METHOD(Phalcon_Db_Adapter, escapeIdentifier) { PHP_METHOD(Phalcon_Db_Adapter, getColumnList) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *columnList, *_0; + zval *columnList, columnList_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&columnList_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &columnList); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getcolumnlist", NULL, 0, columnList); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getcolumnlist", NULL, 0, columnList); zephir_check_call_status(); RETURN_MM(); @@ -987,29 +1171,33 @@ PHP_METHOD(Phalcon_Db_Adapter, getColumnList) { PHP_METHOD(Phalcon_Db_Adapter, limit) { zend_long number, ZEPHIR_LAST_CALL_STATUS; - zval *sqlQuery_param = NULL, *number_param = NULL, *_0, *_1; - zval *sqlQuery = NULL; + zval *sqlQuery_param = NULL, *number_param = NULL, _0, _1; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &sqlQuery_param, &number_param); if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) { - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); } else { - ZEPHIR_INIT_VAR(sqlQuery); - ZVAL_EMPTY_STRING(sqlQuery); + ZEPHIR_INIT_VAR(&sqlQuery); + ZVAL_EMPTY_STRING(&sqlQuery); } number = zephir_get_intval(number_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, number); - ZEPHIR_RETURN_CALL_METHOD(_0, "limit", NULL, 0, sqlQuery, _1); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_1, number); + ZEPHIR_RETURN_CALL_METHOD(&_0, "limit", NULL, 0, &sqlQuery, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1027,48 +1215,56 @@ PHP_METHOD(Phalcon_Db_Adapter, limit) { PHP_METHOD(Phalcon_Db_Adapter, tableExists) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, *_4; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, _0, _1, _2, _3, _4; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "tableexists", NULL, 0, tableName, schemaName); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "tableexists", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchone", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchone", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_array_fetch_long(&_4, _0, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 691 TSRMLS_CC); - RETURN_MM_BOOL(ZEPHIR_GT_LONG(_4, 0)); + zephir_array_fetch_long(&_4, &_0, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 691 TSRMLS_CC); + RETURN_MM_BOOL(ZEPHIR_GT_LONG(&_4, 0)); } @@ -1084,48 +1280,56 @@ PHP_METHOD(Phalcon_Db_Adapter, tableExists) { PHP_METHOD(Phalcon_Db_Adapter, viewExists) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *viewName_param = NULL, *schemaName_param = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, *_4; - zval *viewName = NULL, *schemaName = NULL; + zval *viewName_param = NULL, *schemaName_param = NULL, _0, _1, _2, _3, _4; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &viewName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "viewexists", NULL, 0, viewName, schemaName); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "viewexists", NULL, 0, &viewName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchone", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchone", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_array_fetch_long(&_4, _0, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 705 TSRMLS_CC); - RETURN_MM_BOOL(ZEPHIR_GT_LONG(_4, 0)); + zephir_array_fetch_long(&_4, &_0, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 705 TSRMLS_CC); + RETURN_MM_BOOL(ZEPHIR_GT_LONG(&_4, 0)); } @@ -1135,26 +1339,30 @@ PHP_METHOD(Phalcon_Db_Adapter, viewExists) { PHP_METHOD(Phalcon_Db_Adapter, forUpdate) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sqlQuery_param = NULL, *_0; - zval *sqlQuery = NULL; + zval *sqlQuery_param = NULL, _0; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlQuery_param); if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) { - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); } else { - ZEPHIR_INIT_VAR(sqlQuery); - ZVAL_EMPTY_STRING(sqlQuery); + ZEPHIR_INIT_VAR(&sqlQuery); + ZVAL_EMPTY_STRING(&sqlQuery); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "forupdate", NULL, 0, sqlQuery); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "forupdate", NULL, 0, &sqlQuery); zephir_check_call_status(); RETURN_MM(); @@ -1166,26 +1374,30 @@ PHP_METHOD(Phalcon_Db_Adapter, forUpdate) { PHP_METHOD(Phalcon_Db_Adapter, sharedLock) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sqlQuery_param = NULL, *_0; - zval *sqlQuery = NULL; + zval *sqlQuery_param = NULL, _0; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlQuery_param); if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) { - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); } else { - ZEPHIR_INIT_VAR(sqlQuery); - ZVAL_EMPTY_STRING(sqlQuery); + ZEPHIR_INIT_VAR(&sqlQuery); + ZVAL_EMPTY_STRING(&sqlQuery); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "sharedlock", NULL, 0, sqlQuery); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "sharedlock", NULL, 0, &sqlQuery); zephir_check_call_status(); RETURN_MM(); @@ -1197,49 +1409,57 @@ PHP_METHOD(Phalcon_Db_Adapter, sharedLock) { PHP_METHOD(Phalcon_Db_Adapter, createTable) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, *columns = NULL, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval definition; + zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, columns, _0, _1; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - ZEPHIR_OBS_VAR(columns); - if (!(zephir_array_isset_string_fetch(&columns, definition, SS("columns"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&columns); + if (!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/db/adapter.zep", 732); return; } - if (!(zephir_fast_count_int(columns TSRMLS_CC))) { + if (!(zephir_fast_count_int(&columns TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/db/adapter.zep", 736); return; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "createtable", NULL, 0, tableName, schemaName, definition); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "createtable", NULL, 0, &tableName, &schemaName, &definition); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1252,35 +1472,42 @@ PHP_METHOD(Phalcon_Db_Adapter, dropTable) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool ifExists; - zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, *_0, *_1 = NULL, *_2; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, _0, _1, _2; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &tableName_param, &schemaName_param, &ifExists_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } } if (!ifExists_param) { @@ -1290,16 +1517,15 @@ PHP_METHOD(Phalcon_Db_Adapter, dropTable) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); if (ifExists) { - ZVAL_BOOL(_2, 1); + ZVAL_BOOL(&_2, 1); } else { - ZVAL_BOOL(_2, 0); + ZVAL_BOOL(&_2, 0); } - ZEPHIR_CALL_METHOD(&_1, _0, "droptable", NULL, 0, tableName, schemaName, _2); + ZEPHIR_CALL_METHOD(&_1, &_0, "droptable", NULL, 0, &tableName, &schemaName, &_2); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1311,40 +1537,47 @@ PHP_METHOD(Phalcon_Db_Adapter, dropTable) { PHP_METHOD(Phalcon_Db_Adapter, createView) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, *_0, *_1 = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval definition; + zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, _0, _1; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &viewName_param, &definition_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - if (!(zephir_array_isset_string(definition, SS("sql")))) { + if (!(zephir_array_isset_string(&definition, SL("sql")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/db/adapter.zep", 756); return; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "createview", NULL, 0, viewName, definition, schemaName); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "createview", NULL, 0, &viewName, &definition, &schemaName); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1357,35 +1590,42 @@ PHP_METHOD(Phalcon_Db_Adapter, dropView) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool ifExists; - zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, *_0, *_1 = NULL, *_2; - zval *viewName = NULL, *schemaName = NULL; + zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, _0, _1, _2; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &viewName_param, &schemaName_param, &ifExists_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } } if (!ifExists_param) { @@ -1395,16 +1635,15 @@ PHP_METHOD(Phalcon_Db_Adapter, dropView) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); if (ifExists) { - ZVAL_BOOL(_2, 1); + ZVAL_BOOL(&_2, 1); } else { - ZVAL_BOOL(_2, 0); + ZVAL_BOOL(&_2, 0); } - ZEPHIR_CALL_METHOD(&_1, _0, "dropview", NULL, 0, viewName, schemaName, _2); + ZEPHIR_CALL_METHOD(&_1, &_0, "dropview", NULL, 0, &viewName, &schemaName, &_2); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1416,38 +1655,45 @@ PHP_METHOD(Phalcon_Db_Adapter, dropView) { PHP_METHOD(Phalcon_Db_Adapter, addColumn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *column, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, _0, _1; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &column); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "addcolumn", NULL, 0, tableName, schemaName, column); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "addcolumn", NULL, 0, &tableName, &schemaName, column); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1459,41 +1705,51 @@ PHP_METHOD(Phalcon_Db_Adapter, addColumn) { PHP_METHOD(Phalcon_Db_Adapter, modifyColumn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *column, *currentColumn = NULL, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null, _0, _1; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(¤tColumn_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (!currentColumn) { - currentColumn = ZEPHIR_GLOBAL(global_null); + currentColumn = ¤tColumn_sub; + currentColumn = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "modifycolumn", NULL, 0, tableName, schemaName, column, currentColumn); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "modifycolumn", NULL, 0, &tableName, &schemaName, column, currentColumn); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1505,39 +1761,46 @@ PHP_METHOD(Phalcon_Db_Adapter, modifyColumn) { PHP_METHOD(Phalcon_Db_Adapter, dropColumn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL, *columnName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL, _0, _1; + zval tableName, schemaName, columnName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &columnName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - zephir_get_strval(columnName, columnName_param); + zephir_get_strval(&columnName, columnName_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "dropcolumn", NULL, 0, tableName, schemaName, columnName); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "dropcolumn", NULL, 0, &tableName, &schemaName, &columnName); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1549,38 +1812,45 @@ PHP_METHOD(Phalcon_Db_Adapter, dropColumn) { PHP_METHOD(Phalcon_Db_Adapter, addIndex) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *index, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, _0, _1; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "addindex", NULL, 0, tableName, schemaName, index); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "addindex", NULL, 0, &tableName, &schemaName, index); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1592,38 +1862,45 @@ PHP_METHOD(Phalcon_Db_Adapter, addIndex) { PHP_METHOD(Phalcon_Db_Adapter, dropIndex) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *indexName, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *indexName, indexName_sub, _0, _1; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&indexName_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &indexName); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "dropindex", NULL, 0, tableName, schemaName, indexName); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "dropindex", NULL, 0, &tableName, &schemaName, indexName); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1635,38 +1912,45 @@ PHP_METHOD(Phalcon_Db_Adapter, dropIndex) { PHP_METHOD(Phalcon_Db_Adapter, addPrimaryKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *index, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, _0, _1; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "addprimarykey", NULL, 0, tableName, schemaName, index); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "addprimarykey", NULL, 0, &tableName, &schemaName, index); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1678,38 +1962,44 @@ PHP_METHOD(Phalcon_Db_Adapter, addPrimaryKey) { PHP_METHOD(Phalcon_Db_Adapter, dropPrimaryKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, _0, _1; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "dropprimarykey", NULL, 0, tableName, schemaName); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "dropprimarykey", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1721,38 +2011,45 @@ PHP_METHOD(Phalcon_Db_Adapter, dropPrimaryKey) { PHP_METHOD(Phalcon_Db_Adapter, addForeignKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *reference, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub, _0, _1; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&reference_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &reference); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "addforeignkey", NULL, 0, tableName, schemaName, reference); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "addforeignkey", NULL, 0, &tableName, &schemaName, reference); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1764,48 +2061,55 @@ PHP_METHOD(Phalcon_Db_Adapter, addForeignKey) { PHP_METHOD(Phalcon_Db_Adapter, dropForeignKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL, *_0, *_1 = NULL; - zval *tableName = NULL, *schemaName = NULL, *referenceName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL, _0, _1; + zval tableName, schemaName, referenceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&referenceName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &referenceName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(referenceName_param) != IS_STRING && Z_TYPE_P(referenceName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referenceName_param) == IS_STRING)) { - zephir_get_strval(referenceName, referenceName_param); + zephir_get_strval(&referenceName, referenceName_param); } else { - ZEPHIR_INIT_VAR(referenceName); - ZVAL_EMPTY_STRING(referenceName); + ZEPHIR_INIT_VAR(&referenceName); + ZVAL_EMPTY_STRING(&referenceName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "dropforeignkey", NULL, 0, tableName, schemaName, referenceName); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "dropforeignkey", NULL, 0, &tableName, &schemaName, &referenceName); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -1817,15 +2121,19 @@ PHP_METHOD(Phalcon_Db_Adapter, dropForeignKey) { PHP_METHOD(Phalcon_Db_Adapter, getColumnDefinition) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *column, *_0; + zval *column, column_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &column); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getcolumndefinition", NULL, 0, column); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getcolumndefinition", NULL, 0, column); zephir_check_call_status(); RETURN_MM(); @@ -1842,51 +2150,58 @@ PHP_METHOD(Phalcon_Db_Adapter, getColumnDefinition) { */ PHP_METHOD(Phalcon_Db_Adapter, listTables) { - HashTable *_5; - HashPosition _4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *schemaName_param = NULL, *table = NULL, *allTables = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, *_7$$3; - zval *schemaName = NULL; + zval *schemaName_param = NULL, table, allTables, _0, _1, _2, _3, *_4, _5$$3; + zval schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&allTables); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &schemaName_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } } - ZEPHIR_INIT_VAR(allTables); - array_init(allTables); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "listtables", NULL, 0, schemaName); + ZEPHIR_INIT_VAR(&allTables); + array_init(&allTables); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "listtables", NULL, 0, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter.zep", 867); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(table, _6); - zephir_array_fetch_long(&_7$$3, table, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 865 TSRMLS_CC); - zephir_array_append(&allTables, _7$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 865); - } - RETURN_CCTOR(allTables); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter.zep", 867); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&table); + ZVAL_COPY(&table, _4); + zephir_array_fetch_long(&_5$$3, &table, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 865 TSRMLS_CC); + zephir_array_append(&allTables, &_5$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 865); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&table); + RETURN_CCTOR(&allTables); } @@ -1901,51 +2216,58 @@ PHP_METHOD(Phalcon_Db_Adapter, listTables) { */ PHP_METHOD(Phalcon_Db_Adapter, listViews) { - HashTable *_5; - HashPosition _4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *schemaName_param = NULL, *table = NULL, *allTables = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, *_7$$3; - zval *schemaName = NULL; + zval *schemaName_param = NULL, table, allTables, _0, _1, _2, _3, *_4, _5$$3; + zval schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&allTables); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &schemaName_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } } - ZEPHIR_INIT_VAR(allTables); - array_init(allTables); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "listviews", NULL, 0, schemaName); + ZEPHIR_INIT_VAR(&allTables); + array_init(&allTables); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "listviews", NULL, 0, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter.zep", 887); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(table, _6); - zephir_array_fetch_long(&_7$$3, table, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 885 TSRMLS_CC); - zephir_array_append(&allTables, _7$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 885); - } - RETURN_CCTOR(allTables); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter.zep", 887); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&table); + ZVAL_COPY(&table, _4); + zephir_array_fetch_long(&_5$$3, &table, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 885 TSRMLS_CC); + zephir_array_append(&allTables, &_5$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 885); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&table); + RETURN_CCTOR(&allTables); } @@ -1964,77 +2286,99 @@ PHP_METHOD(Phalcon_Db_Adapter, listViews) { */ PHP_METHOD(Phalcon_Db_Adapter, describeIndexes) { - HashTable *_5, *_9; - HashPosition _4, _8; - zephir_fcall_cache_entry *_12 = NULL; + zend_string *_8; + zend_ulong _7; + zephir_fcall_cache_entry *_10 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *indexes = NULL, *index = NULL, *keyName = NULL, *indexObjects = NULL, *name = NULL, *indexColumns = NULL, *columns = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, **_10, *_7$$3, *_11$$6 = NULL; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, indexes, index, keyName, indexObjects, name, indexColumns, columns, _0, _1, _2, _3, *_4, *_6, _5$$3, _9$$6; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&indexes); + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&indexObjects); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&indexColumns); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_9$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(indexes); - array_init(indexes); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "describeindexes", NULL, 0, table, schema); + ZEPHIR_INIT_VAR(&indexes); + array_init(&indexes); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "describeindexes", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter.zep", 921); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(index, _6); - zephir_array_fetch_long(&keyName, index, 2, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 910 TSRMLS_CC); - if (!(zephir_array_isset(indexes, keyName))) { - ZEPHIR_INIT_NVAR(columns); - array_init(columns); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter.zep", 921); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&index); + ZVAL_COPY(&index, _4); + zephir_array_fetch_long(&keyName, &index, 2, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 910 TSRMLS_CC); + if (!(zephir_array_isset(&indexes, &keyName))) { + ZEPHIR_INIT_NVAR(&columns); + array_init(&columns); + } else { + ZEPHIR_OBS_NVAR(&columns); + zephir_array_fetch(&columns, &indexes, &keyName, PH_NOISY, "phalcon/db/adapter.zep", 914 TSRMLS_CC); + } + zephir_array_fetch_long(&_5$$3, &index, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 917 TSRMLS_CC); + zephir_array_append(&columns, &_5$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 917); + zephir_array_update_zval(&indexes, &keyName, &columns, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&index); + ZEPHIR_INIT_VAR(&indexObjects); + array_init(&indexObjects); + zephir_is_iterable(&indexes, 0, "phalcon/db/adapter.zep", 930); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&indexes), _7, _8, _6) + { + ZEPHIR_INIT_NVAR(&name); + if (_8 != NULL) { + ZVAL_STR_COPY(&name, _8); } else { - ZEPHIR_OBS_NVAR(columns); - zephir_array_fetch(&columns, indexes, keyName, PH_NOISY, "phalcon/db/adapter.zep", 914 TSRMLS_CC); + ZVAL_LONG(&name, _7); } - zephir_array_fetch_long(&_7$$3, index, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 917 TSRMLS_CC); - zephir_array_append(&columns, _7$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 917); - zephir_array_update_zval(&indexes, keyName, &columns, PH_COPY | PH_SEPARATE); - } - ZEPHIR_INIT_VAR(indexObjects); - array_init(indexObjects); - zephir_is_iterable(indexes, &_9, &_8, 0, 0, "phalcon/db/adapter.zep", 930); - for ( - ; zend_hash_get_current_data_ex(_9, (void**) &_10, &_8) == SUCCESS - ; zend_hash_move_forward_ex(_9, &_8) - ) { - ZEPHIR_GET_HMKEY(name, _9, _8); - ZEPHIR_GET_HVALUE(indexColumns, _10); - ZEPHIR_INIT_NVAR(_11$$6); - object_init_ex(_11$$6, phalcon_db_index_ce); - ZEPHIR_CALL_METHOD(NULL, _11$$6, "__construct", &_12, 24, name, indexColumns); + ZEPHIR_INIT_NVAR(&indexColumns); + ZVAL_COPY(&indexColumns, _6); + ZEPHIR_INIT_NVAR(&_9$$6); + object_init_ex(&_9$$6, phalcon_db_index_ce); + ZEPHIR_CALL_METHOD(NULL, &_9$$6, "__construct", &_10, 19, &name, &indexColumns); zephir_check_call_status(); - zephir_array_update_zval(&indexObjects, name, &_11$$6, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(indexObjects); + zephir_array_update_zval(&indexObjects, &name, &_9$$6, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&indexColumns); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&indexObjects); } @@ -2049,116 +2393,149 @@ PHP_METHOD(Phalcon_Db_Adapter, describeIndexes) { */ PHP_METHOD(Phalcon_Db_Adapter, describeReferences) { - zval *_13$$3 = NULL, *_18$$6 = NULL; - HashTable *_5, *_15; - HashPosition _4, _14; - zephir_fcall_cache_entry *_20 = NULL; + zval _11$$3, _16$$6; + zend_string *_14; + zend_ulong _13; + zephir_fcall_cache_entry *_18 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *references = NULL, *reference = NULL, *arrayReference = NULL, *constraintName = NULL, *referenceObjects = NULL, *name = NULL, *referencedSchema = NULL, *referencedTable = NULL, *columns = NULL, *referencedColumns = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, **_16, *_7$$5, *_8$$5, *_9$$5, *_10$$5, *_11$$3, *_12$$3, *_17$$6 = NULL, *_19$$6 = NULL; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, references, reference, arrayReference, constraintName, referenceObjects, name, referencedSchema, referencedTable, columns, referencedColumns, _0, _1, _2, _3, *_4, *_12, _5$$5, _6$$5, _7$$5, _8$$5, _9$$3, _10$$3, _15$$6, _17$$6; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&references); + ZVAL_UNDEF(&reference); + ZVAL_UNDEF(&arrayReference); + ZVAL_UNDEF(&constraintName); + ZVAL_UNDEF(&referenceObjects); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&referencedSchema); + ZVAL_UNDEF(&referencedTable); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&referencedColumns); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_10$$3); + ZVAL_UNDEF(&_15$$6); + ZVAL_UNDEF(&_17$$6); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_16$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); - } - - - ZEPHIR_INIT_VAR(references); - array_init(references); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "describereferences", NULL, 0, table, schema); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); - zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter.zep", 976); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(reference, _6); - zephir_array_fetch_long(&constraintName, reference, 2, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 952 TSRMLS_CC); - if (!(zephir_array_isset(references, constraintName))) { - ZEPHIR_OBS_NVAR(referencedSchema); - zephir_array_fetch_long(&referencedSchema, reference, 3, PH_NOISY, "phalcon/db/adapter.zep", 954 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedTable); - zephir_array_fetch_long(&referencedTable, reference, 4, PH_NOISY, "phalcon/db/adapter.zep", 955 TSRMLS_CC); - ZEPHIR_INIT_NVAR(columns); - array_init(columns); - ZEPHIR_INIT_NVAR(referencedColumns); - array_init(referencedColumns); + zephir_get_strval(&schema, schema_param); + } + + + ZEPHIR_INIT_VAR(&references); + array_init(&references); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "describereferences", NULL, 0, &table, &schema); + zephir_check_call_status(); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); + zephir_check_call_status(); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter.zep", 976); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&reference); + ZVAL_COPY(&reference, _4); + zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 952 TSRMLS_CC); + if (!(zephir_array_isset(&references, &constraintName))) { + ZEPHIR_OBS_NVAR(&referencedSchema); + zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/db/adapter.zep", 954 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedTable); + zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/db/adapter.zep", 955 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&columns); + array_init(&columns); + ZEPHIR_INIT_NVAR(&referencedColumns); + array_init(&referencedColumns); } else { - zephir_array_fetch(&_7$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 959 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedSchema); - zephir_array_fetch_string(&referencedSchema, _7$$5, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter.zep", 959 TSRMLS_CC); - zephir_array_fetch(&_8$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 960 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedTable); - zephir_array_fetch_string(&referencedTable, _8$$5, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter.zep", 960 TSRMLS_CC); - zephir_array_fetch(&_9$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 961 TSRMLS_CC); - ZEPHIR_OBS_NVAR(columns); - zephir_array_fetch_string(&columns, _9$$5, SL("columns"), PH_NOISY, "phalcon/db/adapter.zep", 961 TSRMLS_CC); - zephir_array_fetch(&_10$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 962 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedColumns); - zephir_array_fetch_string(&referencedColumns, _10$$5, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter.zep", 962 TSRMLS_CC); + zephir_array_fetch(&_5$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 959 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedSchema); + zephir_array_fetch_string(&referencedSchema, &_5$$5, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter.zep", 959 TSRMLS_CC); + zephir_array_fetch(&_6$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 960 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedTable); + zephir_array_fetch_string(&referencedTable, &_6$$5, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter.zep", 960 TSRMLS_CC); + zephir_array_fetch(&_7$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 961 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&columns); + zephir_array_fetch_string(&columns, &_7$$5, SL("columns"), PH_NOISY, "phalcon/db/adapter.zep", 961 TSRMLS_CC); + zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 962 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedColumns); + zephir_array_fetch_string(&referencedColumns, &_8$$5, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter.zep", 962 TSRMLS_CC); } - zephir_array_fetch_long(&_11$$3, reference, 1, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 965 TSRMLS_CC); - zephir_array_append(&columns, _11$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 965); - zephir_array_fetch_long(&_12$$3, reference, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 966 TSRMLS_CC); - zephir_array_append(&referencedColumns, _12$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 966); - ZEPHIR_INIT_NVAR(_13$$3); - zephir_create_array(_13$$3, 4, 0 TSRMLS_CC); - zephir_array_update_string(&_13$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_13$$3, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_13$$3, SL("columns"), &columns, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_13$$3, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&references, constraintName, &_13$$3, PH_COPY | PH_SEPARATE); - } - ZEPHIR_INIT_VAR(referenceObjects); - array_init(referenceObjects); - zephir_is_iterable(references, &_15, &_14, 0, 0, "phalcon/db/adapter.zep", 986); - for ( - ; zend_hash_get_current_data_ex(_15, (void**) &_16, &_14) == SUCCESS - ; zend_hash_move_forward_ex(_15, &_14) - ) { - ZEPHIR_GET_HMKEY(name, _15, _14); - ZEPHIR_GET_HVALUE(arrayReference, _16); - ZEPHIR_INIT_NVAR(_17$$6); - object_init_ex(_17$$6, phalcon_db_reference_ce); - ZEPHIR_INIT_NVAR(_18$$6); - zephir_create_array(_18$$6, 4, 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(_19$$6); - zephir_array_fetch_string(&_19$$6, arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter.zep", 979 TSRMLS_CC); - zephir_array_update_string(&_18$$6, SL("referencedSchema"), &_19$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_19$$6); - zephir_array_fetch_string(&_19$$6, arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter.zep", 980 TSRMLS_CC); - zephir_array_update_string(&_18$$6, SL("referencedTable"), &_19$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_19$$6); - zephir_array_fetch_string(&_19$$6, arrayReference, SL("columns"), PH_NOISY, "phalcon/db/adapter.zep", 981 TSRMLS_CC); - zephir_array_update_string(&_18$$6, SL("columns"), &_19$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_19$$6); - zephir_array_fetch_string(&_19$$6, arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter.zep", 983 TSRMLS_CC); - zephir_array_update_string(&_18$$6, SL("referencedColumns"), &_19$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _17$$6, "__construct", &_20, 25, name, _18$$6); + zephir_array_fetch_long(&_9$$3, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 965 TSRMLS_CC); + zephir_array_append(&columns, &_9$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 965); + zephir_array_fetch_long(&_10$$3, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 966 TSRMLS_CC); + zephir_array_append(&referencedColumns, &_10$$3, PH_SEPARATE, "phalcon/db/adapter.zep", 966); + ZEPHIR_INIT_NVAR(&_11$$3); + zephir_create_array(&_11$$3, 4, 0 TSRMLS_CC); + zephir_array_update_string(&_11$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_11$$3, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_11$$3, SL("columns"), &columns, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_11$$3, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&references, &constraintName, &_11$$3, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&reference); + ZEPHIR_INIT_VAR(&referenceObjects); + array_init(&referenceObjects); + zephir_is_iterable(&references, 0, "phalcon/db/adapter.zep", 986); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _13, _14, _12) + { + ZEPHIR_INIT_NVAR(&name); + if (_14 != NULL) { + ZVAL_STR_COPY(&name, _14); + } else { + ZVAL_LONG(&name, _13); + } + ZEPHIR_INIT_NVAR(&arrayReference); + ZVAL_COPY(&arrayReference, _12); + ZEPHIR_INIT_NVAR(&_15$$6); + object_init_ex(&_15$$6, phalcon_db_reference_ce); + ZEPHIR_INIT_NVAR(&_16$$6); + zephir_create_array(&_16$$6, 4, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_17$$6); + zephir_array_fetch_string(&_17$$6, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter.zep", 979 TSRMLS_CC); + zephir_array_update_string(&_16$$6, SL("referencedSchema"), &_17$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_17$$6); + zephir_array_fetch_string(&_17$$6, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter.zep", 980 TSRMLS_CC); + zephir_array_update_string(&_16$$6, SL("referencedTable"), &_17$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_17$$6); + zephir_array_fetch_string(&_17$$6, &arrayReference, SL("columns"), PH_NOISY, "phalcon/db/adapter.zep", 981 TSRMLS_CC); + zephir_array_update_string(&_16$$6, SL("columns"), &_17$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_17$$6); + zephir_array_fetch_string(&_17$$6, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter.zep", 983 TSRMLS_CC); + zephir_array_update_string(&_16$$6, SL("referencedColumns"), &_17$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, &_15$$6, "__construct", &_18, 20, &name, &_16$$6); zephir_check_call_status(); - zephir_array_update_zval(&referenceObjects, name, &_17$$6, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(referenceObjects); + zephir_array_update_zval(&referenceObjects, &name, &_15$$6, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&arrayReference); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&referenceObjects); } @@ -2174,40 +2551,48 @@ PHP_METHOD(Phalcon_Db_Adapter, describeReferences) { PHP_METHOD(Phalcon_Db_Adapter, tableOptions) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *sql = NULL, *_0, *_1$$3 = NULL, *_2$$3, *_3$$3; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, sql, _0, _1$$3, _2$$3, _3$$3; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&sql, _0, "tableoptions", NULL, 0, tableName, schemaName); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&sql, &_0, "tableoptions", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - if (zephir_is_true(sql)) { - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_LONG(_2$$3, 2); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "fetchall", NULL, 0, sql, _2$$3); + if (zephir_is_true(&sql)) { + ZVAL_LONG(&_2$$3, 2); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "fetchall", NULL, 0, &sql, &_2$$3); zephir_check_call_status(); - zephir_array_fetch_long(&_3$$3, _1$$3, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 1004 TSRMLS_CC); - RETURN_CTOR(_3$$3); + zephir_array_fetch_long(&_3$$3, &_1$$3, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter.zep", 1004 TSRMLS_CC); + RETURN_CTOR(&_3$$3); } array_init(return_value); RETURN_MM(); @@ -2220,35 +2605,41 @@ PHP_METHOD(Phalcon_Db_Adapter, tableOptions) { PHP_METHOD(Phalcon_Db_Adapter, createSavepoint) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *dialect = NULL, *_0 = NULL, *_1 = NULL; - zval *name = NULL; + zval *name_param = NULL, dialect, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&dialect); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(dialect); - zephir_read_property_this(&dialect, this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0, dialect, "supportssavepoints", NULL, 0); + ZEPHIR_OBS_VAR(&dialect); + zephir_read_property(&dialect, this_ptr, SL("_dialect"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&_0, &dialect, "supportssavepoints", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Savepoints are not supported by this database adapter.", "phalcon/db/adapter.zep", 1019); return; } - ZEPHIR_CALL_METHOD(&_1, dialect, "createsavepoint", NULL, 0, name); + ZEPHIR_CALL_METHOD(&_1, &dialect, "createsavepoint", NULL, 0, &name); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -2260,40 +2651,47 @@ PHP_METHOD(Phalcon_Db_Adapter, createSavepoint) { PHP_METHOD(Phalcon_Db_Adapter, releaseSavepoint) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *dialect = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL; - zval *name = NULL; + zval *name_param = NULL, dialect, _0, _1, _2; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&dialect); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(dialect); - zephir_read_property_this(&dialect, this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0, dialect, "supportssavepoints", NULL, 0); + ZEPHIR_OBS_VAR(&dialect); + zephir_read_property(&dialect, this_ptr, SL("_dialect"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&_0, &dialect, "supportssavepoints", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Savepoints are not supported by this database adapter", "phalcon/db/adapter.zep", 1035); return; } - ZEPHIR_CALL_METHOD(&_1, dialect, "supportsreleasesavepoints", NULL, 0); + ZEPHIR_CALL_METHOD(&_1, &dialect, "supportsreleasesavepoints", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_1))) { + if (!(zephir_is_true(&_1))) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&_2, dialect, "releasesavepoint", NULL, 0, name); + ZEPHIR_CALL_METHOD(&_2, &dialect, "releasesavepoint", NULL, 0, &name); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_2); zephir_check_call_status(); RETURN_MM(); @@ -2305,35 +2703,41 @@ PHP_METHOD(Phalcon_Db_Adapter, releaseSavepoint) { PHP_METHOD(Phalcon_Db_Adapter, rollbackSavepoint) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *dialect = NULL, *_0 = NULL, *_1 = NULL; - zval *name = NULL; + zval *name_param = NULL, dialect, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&dialect); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(dialect); - zephir_read_property_this(&dialect, this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0, dialect, "supportssavepoints", NULL, 0); + ZEPHIR_OBS_VAR(&dialect); + zephir_read_property(&dialect, this_ptr, SL("_dialect"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&_0, &dialect, "supportssavepoints", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Savepoints are not supported by this database adapter", "phalcon/db/adapter.zep", 1055); return; } - ZEPHIR_CALL_METHOD(&_1, dialect, "rollbacksavepoint", NULL, 0, name); + ZEPHIR_CALL_METHOD(&_1, &dialect, "rollbacksavepoint", NULL, 0, &name); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -2345,8 +2749,15 @@ PHP_METHOD(Phalcon_Db_Adapter, rollbackSavepoint) { PHP_METHOD(Phalcon_Db_Adapter, setNestedTransactionsWithSavepoints) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *nestedTransactionsWithSavepoints_param = NULL, *_0, *_1, *_2 = NULL; + zval *nestedTransactionsWithSavepoints_param = NULL, __$true, __$false, _0, _1, _2; zend_bool nestedTransactionsWithSavepoints; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &nestedTransactionsWithSavepoints_param); @@ -2354,22 +2765,22 @@ PHP_METHOD(Phalcon_Db_Adapter, setNestedTransactionsWithSavepoints) { nestedTransactionsWithSavepoints = zephir_get_boolval(nestedTransactionsWithSavepoints_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_transactionLevel"), PH_NOISY_CC); - if (ZEPHIR_GT_LONG(_0, 0)) { + zephir_read_property(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_GT_LONG(&_0, 0)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Nested transaction with savepoints behavior cannot be changed while a transaction is open", "phalcon/db/adapter.zep", 1068); return; } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "supportssavepoints", NULL, 0); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "supportssavepoints", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_2))) { + if (!(zephir_is_true(&_2))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Savepoints are not supported by this database adapter", "phalcon/db/adapter.zep", 1072); return; } if (nestedTransactionsWithSavepoints) { - zephir_update_property_this(getThis(), SL("_transactionsWithSavepoints"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_transactionsWithSavepoints"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_transactionsWithSavepoints"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_transactionsWithSavepoints"), &__$false); } RETURN_THIS(); @@ -2380,7 +2791,8 @@ PHP_METHOD(Phalcon_Db_Adapter, setNestedTransactionsWithSavepoints) { */ PHP_METHOD(Phalcon_Db_Adapter, isNestedTransactionsWithSavepoints) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_transactionsWithSavepoints"); @@ -2391,11 +2803,14 @@ PHP_METHOD(Phalcon_Db_Adapter, isNestedTransactionsWithSavepoints) { */ PHP_METHOD(Phalcon_Db_Adapter, getNestedTransactionSavepointName) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_transactionLevel"), PH_NOISY_CC); - ZEPHIR_CONCAT_SV(return_value, "PHALCON_SAVEPOINT_", _0); + + zephir_read_property(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CONCAT_SV(return_value, "PHALCON_SAVEPOINT_", &_0); return; } @@ -2422,16 +2837,18 @@ PHP_METHOD(Phalcon_Db_Adapter, getNestedTransactionSavepointName) { */ PHP_METHOD(Phalcon_Db_Adapter, getDefaultIdValue) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); object_init_ex(return_value, phalcon_db_rawvalue_ce); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "null", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 26, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "null"); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 21, &_0); zephir_check_call_status(); RETURN_MM(); @@ -2457,16 +2874,18 @@ PHP_METHOD(Phalcon_Db_Adapter, getDefaultIdValue) { */ PHP_METHOD(Phalcon_Db_Adapter, getDefaultValue) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); object_init_ex(return_value, phalcon_db_rawvalue_ce); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "DEFAULT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 26, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "DEFAULT"); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 21, &_0); zephir_check_call_status(); RETURN_MM(); @@ -2477,7 +2896,8 @@ PHP_METHOD(Phalcon_Db_Adapter, getDefaultValue) { */ PHP_METHOD(Phalcon_Db_Adapter, supportSequences) { - + zval *this_ptr = getThis(); + RETURN_BOOL(0); @@ -2488,7 +2908,8 @@ PHP_METHOD(Phalcon_Db_Adapter, supportSequences) { */ PHP_METHOD(Phalcon_Db_Adapter, useExplicitIdValue) { - + zval *this_ptr = getThis(); + RETURN_BOOL(0); @@ -2499,7 +2920,8 @@ PHP_METHOD(Phalcon_Db_Adapter, useExplicitIdValue) { */ PHP_METHOD(Phalcon_Db_Adapter, getDescriptor) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_descriptor"); @@ -2512,7 +2934,8 @@ PHP_METHOD(Phalcon_Db_Adapter, getDescriptor) { */ PHP_METHOD(Phalcon_Db_Adapter, getConnectionId) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_connectionId"); @@ -2523,7 +2946,8 @@ PHP_METHOD(Phalcon_Db_Adapter, getConnectionId) { */ PHP_METHOD(Phalcon_Db_Adapter, getSQLStatement) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sqlStatement"); @@ -2534,7 +2958,8 @@ PHP_METHOD(Phalcon_Db_Adapter, getSQLStatement) { */ PHP_METHOD(Phalcon_Db_Adapter, getRealSQLStatement) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sqlStatement"); @@ -2547,40 +2972,32 @@ PHP_METHOD(Phalcon_Db_Adapter, getRealSQLStatement) { */ PHP_METHOD(Phalcon_Db_Adapter, getSQLBindTypes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sqlBindTypes"); } -zend_object_value zephir_init_properties_Phalcon_Db_Adapter(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Db_Adapter(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_descriptor"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_descriptor"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_descriptor"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_descriptor"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/db/adapter.zep.h b/ext/phalcon/db/adapter.zep.h index ec3b227e0e7..c74a9a5fe99 100644 --- a/ext/phalcon/db/adapter.zep.h +++ b/ext/phalcon/db/adapter.zep.h @@ -60,7 +60,14 @@ PHP_METHOD(Phalcon_Db_Adapter, getConnectionId); PHP_METHOD(Phalcon_Db_Adapter, getSQLStatement); PHP_METHOD(Phalcon_Db_Adapter, getRealSQLStatement); PHP_METHOD(Phalcon_Db_Adapter, getSQLBindTypes); -zend_object_value zephir_init_properties_Phalcon_Db_Adapter(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Db_Adapter(zend_class_entry *class_type TSRMLS_DC); + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getsqlvariables, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getsqlvariables, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter___construct, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, descriptor, 0) @@ -70,19 +77,49 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_seteventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_setdialect, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dialect, Phalcon\\Db\\DialectInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_fetchone, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_getdialect, 0, 0, Phalcon\\Db\\DialectInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getdialect, 0, 0, IS_OBJECT, "Phalcon\\Db\\DialectInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_fetchone, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_fetchone, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_ARG_INFO(0, fetchMode) ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_fetchall, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_fetchall, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_fetchall, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_ARG_INFO(0, fetchMode) ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) @@ -94,20 +131,32 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_fetchcolumn, 0, 0, 1) ZEND_ARG_INFO(0, column) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_insert, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_insert, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_insert, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, table) ZEND_ARG_ARRAY_INFO(0, values, 0) ZEND_ARG_INFO(0, fields) ZEND_ARG_INFO(0, dataTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_insertasdict, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_insertasdict, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_insertasdict, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, table) ZEND_ARG_INFO(0, data) ZEND_ARG_INFO(0, dataTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_update, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_update, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_update, 0, 3, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, table) ZEND_ARG_INFO(0, fields) ZEND_ARG_INFO(0, values) @@ -115,181 +164,572 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_update, 0, 0, 3) ZEND_ARG_INFO(0, dataTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_updateasdict, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_updateasdict, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_updateasdict, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, table) ZEND_ARG_INFO(0, data) ZEND_ARG_INFO(0, whereCondition) ZEND_ARG_INFO(0, dataTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, table) ZEND_ARG_INFO(0, whereCondition) ZEND_ARG_INFO(0, placeholders) ZEND_ARG_INFO(0, dataTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_escapeidentifier, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_escapeidentifier, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_escapeidentifier, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, identifier) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_getcolumnlist, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getcolumnlist, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getcolumnlist, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, columnList) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_limit, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_limit, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_limit, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, number, IS_LONG, 0) +#else ZEND_ARG_INFO(0, number) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_tableexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_tableexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_tableexists, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_viewexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_viewexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_viewexists, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_forupdate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_forupdate, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_forupdate, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_sharedlock, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_sharedlock, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_sharedlock, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_createtable, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_createtable, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_createtable, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_droptable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_droptable, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_droptable, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_createview, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_createview, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_createview, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_dropview, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropview, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropview, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_addcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_addcolumn, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_addcolumn, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_modifycolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_modifycolumn, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_modifycolumn, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_ARG_OBJ_INFO(0, currentColumn, Phalcon\\Db\\ColumnInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_dropcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropcolumn, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropcolumn, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, columnName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, columnName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_addindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_addindex, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_addindex, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_dropindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropindex, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropindex, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_INFO(0, indexName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_addprimarykey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_addprimarykey, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_addprimarykey, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_dropprimarykey, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropprimarykey, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropprimarykey, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_addforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_addforeignkey, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_addforeignkey, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, reference, Phalcon\\Db\\ReferenceInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_dropforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropforeignkey, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_dropforeignkey, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_getcolumndefinition, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getcolumndefinition, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getcolumndefinition, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_listtables, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_listtables, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_listtables, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_listviews, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_listviews, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_listviews, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_describeindexes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_describeindexes, 0, 1, Phalcon\\Db\\IndexInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_describeindexes, 0, 1, IS_OBJECT, "Phalcon\\Db\\IndexInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_describereferences, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_describereferences, 0, 1, Phalcon\\Db\\ReferenceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_describereferences, 0, 1, IS_OBJECT, "Phalcon\\Db\\ReferenceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_tableoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_tableoptions, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_tableoptions, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_createsavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_createsavepoint, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_createsavepoint, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_releasesavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_releasesavepoint, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_releasesavepoint, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_rollbacksavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_rollbacksavepoint, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_rollbacksavepoint, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_setnestedtransactionswithsavepoints, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_setnestedtransactionswithsavepoints, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_setnestedtransactionswithsavepoints, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, nestedTransactionsWithSavepoints, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, nestedTransactionsWithSavepoints) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_isnestedtransactionswithsavepoints, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_isnestedtransactionswithsavepoints, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getnestedtransactionsavepointname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getnestedtransactionsavepointname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_getdefaultidvalue, 0, 0, Phalcon\\Db\\RawValue, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getdefaultidvalue, 0, 0, IS_OBJECT, "Phalcon\\Db\\RawValue", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_getdefaultvalue, 0, 0, Phalcon\\Db\\RawValue, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getdefaultvalue, 0, 0, IS_OBJECT, "Phalcon\\Db\\RawValue", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_supportsequences, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_supportsequences, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_useexplicitidvalue, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_useexplicitidvalue, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getdescriptor, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getdescriptor, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getsqlstatement, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getsqlstatement, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getrealsqlstatement, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_getrealsqlstatement, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_adapter_method_entry) { PHP_ME(Phalcon_Db_Adapter, getDialectType, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, getType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, getSqlVariables, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, getSqlVariables, arginfo_phalcon_db_adapter_getsqlvariables, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, __construct, arginfo_phalcon_db_adapter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Db_Adapter, setEventsManager, arginfo_phalcon_db_adapter_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, getEventsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, getEventsManager, arginfo_phalcon_db_adapter_geteventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, setDialect, arginfo_phalcon_db_adapter_setdialect, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, getDialect, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, getDialect, arginfo_phalcon_db_adapter_getdialect, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, fetchOne, arginfo_phalcon_db_adapter_fetchone, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, fetchAll, arginfo_phalcon_db_adapter_fetchall, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, fetchColumn, arginfo_phalcon_db_adapter_fetchcolumn, ZEND_ACC_PUBLIC) @@ -328,16 +768,16 @@ ZEPHIR_INIT_FUNCS(phalcon_db_adapter_method_entry) { PHP_ME(Phalcon_Db_Adapter, releaseSavepoint, arginfo_phalcon_db_adapter_releasesavepoint, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, rollbackSavepoint, arginfo_phalcon_db_adapter_rollbacksavepoint, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, setNestedTransactionsWithSavepoints, arginfo_phalcon_db_adapter_setnestedtransactionswithsavepoints, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, isNestedTransactionsWithSavepoints, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, getNestedTransactionSavepointName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, getDefaultIdValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, getDefaultValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, supportSequences, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, useExplicitIdValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, getDescriptor, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, isNestedTransactionsWithSavepoints, arginfo_phalcon_db_adapter_isnestedtransactionswithsavepoints, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, getNestedTransactionSavepointName, arginfo_phalcon_db_adapter_getnestedtransactionsavepointname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, getDefaultIdValue, arginfo_phalcon_db_adapter_getdefaultidvalue, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, getDefaultValue, arginfo_phalcon_db_adapter_getdefaultvalue, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, supportSequences, arginfo_phalcon_db_adapter_supportsequences, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, useExplicitIdValue, arginfo_phalcon_db_adapter_useexplicitidvalue, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, getDescriptor, arginfo_phalcon_db_adapter_getdescriptor, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, getConnectionId, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, getSQLStatement, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter, getRealSQLStatement, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, getSQLStatement, arginfo_phalcon_db_adapter_getsqlstatement, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter, getRealSQLStatement, arginfo_phalcon_db_adapter_getrealsqlstatement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter, getSQLBindTypes, NULL, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/adapter/pdo.zep.c b/ext/phalcon/db/adapter/pdo.zep.c index d65dbc7c928..c6e7d5f8422 100644 --- a/ext/phalcon/db/adapter/pdo.zep.c +++ b/ext/phalcon/db/adapter/pdo.zep.c @@ -71,17 +71,20 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, __construct) { zephir_fcall_cache_entry *_0 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *descriptor_param = NULL; - zval *descriptor = NULL; + zval descriptor; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&descriptor); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &descriptor_param); - descriptor = descriptor_param; + ZEPHIR_OBS_COPY_OR_DUP(&descriptor, descriptor_param); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "connect", NULL, 0, descriptor); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "connect", NULL, 0, &descriptor); zephir_check_call_status(); - ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_ce, getThis(), "__construct", &_0, 36, descriptor); + ZEPHIR_CALL_PARENT(NULL, phalcon_db_adapter_pdo_ce, getThis(), "__construct", &_0, 0, &descriptor); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -113,120 +116,155 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, __construct) { PHP_METHOD(Phalcon_Db_Adapter_Pdo, connect) { zend_bool _5$$10; - HashTable *_3, *_15$$15; - HashPosition _2, _14$$15; + zend_string *_4, *_16$$15; + zend_ulong _3, _15$$15; zephir_fcall_cache_entry *_9 = NULL, *_13 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *descriptor_param = NULL, *username = NULL, *password = NULL, *dsnParts = NULL, *dsnAttributes = NULL, *persistent = NULL, *options = NULL, *key = NULL, *value = NULL, **_4, *_18, *_19, *_20, *_21, *_0$$3, *_6$$10 = NULL, *_7$$10 = NULL, *_8$$10 = NULL, *_10$$11 = NULL, *_11$$11 = NULL, *_12$$11 = NULL, **_16$$15, *_17$$16 = NULL; - zval *descriptor = NULL, *_1$$3 = NULL; + zval *descriptor_param = NULL, __$true, username, password, dsnParts, dsnAttributes, persistent, options, key, value, *_2, _18, _19, _20, _21, _0$$3, _6$$10, _7$$10, _8$$10, _10$$11, _11$$11, _12$$11, *_14$$15, _17$$16; + zval descriptor, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&descriptor); + ZVAL_UNDEF(&_1$$3); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&username); + ZVAL_UNDEF(&password); + ZVAL_UNDEF(&dsnParts); + ZVAL_UNDEF(&dsnAttributes); + ZVAL_UNDEF(&persistent); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_18); + ZVAL_UNDEF(&_19); + ZVAL_UNDEF(&_20); + ZVAL_UNDEF(&_21); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&_7$$10); + ZVAL_UNDEF(&_8$$10); + ZVAL_UNDEF(&_10$$11); + ZVAL_UNDEF(&_11$$11); + ZVAL_UNDEF(&_12$$11); + ZVAL_UNDEF(&_17$$16); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &descriptor_param); if (!descriptor_param) { - ZEPHIR_INIT_VAR(descriptor); - array_init(descriptor); + ZEPHIR_INIT_VAR(&descriptor); + array_init(&descriptor); } else { - zephir_get_arrval(descriptor, descriptor_param); + zephir_get_arrval(&descriptor, descriptor_param); } - if (ZEPHIR_IS_EMPTY(descriptor)) { - ZEPHIR_OBS_VAR(_0$$3); - zephir_read_property_this(&_0$$3, this_ptr, SL("_descriptor"), PH_NOISY_CC); - zephir_get_arrval(_1$$3, _0$$3); - ZEPHIR_CPY_WRT(descriptor, _1$$3); + if (ZEPHIR_IS_EMPTY(&descriptor)) { + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property(&_0$$3, this_ptr, SL("_descriptor"), PH_NOISY_CC); + zephir_get_arrval(&_1$$3, &_0$$3); + ZEPHIR_CPY_WRT(&descriptor, &_1$$3); } - ZEPHIR_OBS_VAR(username); - if (zephir_array_isset_string_fetch(&username, descriptor, SS("username"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&descriptor, SS("username"), PH_SEPARATE); + ZEPHIR_OBS_VAR(&username); + if (zephir_array_isset_string_fetch(&username, &descriptor, SL("username"), 0)) { + zephir_array_unset_string(&descriptor, SL("username"), PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(username); - ZVAL_NULL(username); + ZEPHIR_INIT_NVAR(&username); + ZVAL_NULL(&username); } - ZEPHIR_OBS_VAR(password); - if (zephir_array_isset_string_fetch(&password, descriptor, SS("password"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&descriptor, SS("password"), PH_SEPARATE); + ZEPHIR_OBS_VAR(&password); + if (zephir_array_isset_string_fetch(&password, &descriptor, SL("password"), 0)) { + zephir_array_unset_string(&descriptor, SL("password"), PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(password); - ZVAL_NULL(password); + ZEPHIR_INIT_NVAR(&password); + ZVAL_NULL(&password); } - ZEPHIR_OBS_VAR(options); - if (zephir_array_isset_string_fetch(&options, descriptor, SS("options"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&descriptor, SS("options"), PH_SEPARATE); + ZEPHIR_OBS_VAR(&options); + if (zephir_array_isset_string_fetch(&options, &descriptor, SL("options"), 0)) { + zephir_array_unset_string(&descriptor, SL("options"), PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(options); - array_init(options); + ZEPHIR_INIT_NVAR(&options); + array_init(&options); } - zephir_is_iterable(options, &_3, &_2, 1, 0, "phalcon/db/adapter/pdo.zep", 144); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HMKEY(key, _3, _2); - ZEPHIR_GET_HVALUE(value, _4); - _5$$10 = Z_TYPE_P(key) == IS_STRING; + zephir_is_iterable(&options, 1, "phalcon/db/adapter/pdo.zep", 144); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&options), _3, _4, _2) + { + ZEPHIR_INIT_NVAR(&key); + if (_4 != NULL) { + ZVAL_STR_COPY(&key, _4); + } else { + ZVAL_LONG(&key, _3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _2); + _5$$10 = Z_TYPE_P(&key) == IS_STRING; if (_5$$10) { - ZEPHIR_CALL_METHOD(&_6$$10, key, "upper", NULL, 0); + ZEPHIR_CALL_METHOD(&_6$$10, &key, "upper", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_7$$10); - ZEPHIR_CONCAT_SV(_7$$10, "\\PDO::", _6$$10); - ZEPHIR_CALL_FUNCTION(&_8$$10, "defined", &_9, 37, _7$$10); + ZEPHIR_CONCAT_SV(&_7$$10, "\\PDO::", &_6$$10); + ZEPHIR_CALL_FUNCTION(&_8$$10, "defined", &_9, 31, &_7$$10); zephir_check_call_status(); - _5$$10 = zephir_is_true(_8$$10); + _5$$10 = zephir_is_true(&_8$$10); } if (_5$$10) { - ZEPHIR_CALL_METHOD(&_10$$11, key, "upper", NULL, 0); + ZEPHIR_CALL_METHOD(&_10$$11, &key, "upper", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_11$$11); - ZEPHIR_CONCAT_SV(_11$$11, "\\PDO::", _10$$11); - ZEPHIR_CALL_FUNCTION(&_12$$11, "constant", &_13, 38, _11$$11); + ZEPHIR_CONCAT_SV(&_11$$11, "\\PDO::", &_10$$11); + ZEPHIR_CALL_FUNCTION(&_12$$11, "constant", &_13, 32, &_11$$11); zephir_check_call_status(); - zephir_array_update_zval(&options, _12$$11, &value, PH_COPY | PH_SEPARATE); - zephir_array_unset(&options, key, PH_SEPARATE); + zephir_array_update_zval(&options, &_12$$11, &value, PH_COPY | PH_SEPARATE); + zephir_array_unset(&options, &key, PH_SEPARATE); } - } - zend_hash_destroy(_3); - FREE_HASHTABLE(_3); - ZEPHIR_OBS_VAR(persistent); - if (zephir_array_isset_string_fetch(&persistent, descriptor, SS("persistent"), 0 TSRMLS_CC)) { - if (zephir_is_true(persistent)) { - zephir_array_update_long(&options, 12, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_OBS_VAR(&persistent); + if (zephir_array_isset_string_fetch(&persistent, &descriptor, SL("persistent"), 0)) { + if (zephir_is_true(&persistent)) { + zephir_array_update_long(&options, 12, &__$true, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } - zephir_array_unset_string(&descriptor, SS("persistent"), PH_SEPARATE); + zephir_array_unset_string(&descriptor, SL("persistent"), PH_SEPARATE); } - if (zephir_array_isset_string(descriptor, SS("dialectClass"))) { - zephir_array_unset_string(&descriptor, SS("dialectClass"), PH_SEPARATE); + if (zephir_array_isset_string(&descriptor, SL("dialectClass"))) { + zephir_array_unset_string(&descriptor, SL("dialectClass"), PH_SEPARATE); } - ZEPHIR_OBS_VAR(dsnAttributes); - if (!(zephir_array_isset_string_fetch(&dsnAttributes, descriptor, SS("dsn"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(dsnParts); - array_init(dsnParts); - zephir_is_iterable(descriptor, &_15$$15, &_14$$15, 0, 0, "phalcon/db/adapter/pdo.zep", 166); - for ( - ; zend_hash_get_current_data_ex(_15$$15, (void**) &_16$$15, &_14$$15) == SUCCESS - ; zend_hash_move_forward_ex(_15$$15, &_14$$15) - ) { - ZEPHIR_GET_HMKEY(key, _15$$15, _14$$15); - ZEPHIR_GET_HVALUE(value, _16$$15); + ZEPHIR_OBS_VAR(&dsnAttributes); + if (!(zephir_array_isset_string_fetch(&dsnAttributes, &descriptor, SL("dsn"), 0))) { + ZEPHIR_INIT_VAR(&dsnParts); + array_init(&dsnParts); + zephir_is_iterable(&descriptor, 0, "phalcon/db/adapter/pdo.zep", 166); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&descriptor), _15$$15, _16$$15, _14$$15) + { + ZEPHIR_INIT_NVAR(&key); + if (_16$$15 != NULL) { + ZVAL_STR_COPY(&key, _16$$15); + } else { + ZVAL_LONG(&key, _15$$15); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _14$$15); ZEPHIR_INIT_LNVAR(_17$$16); - ZEPHIR_CONCAT_VSV(_17$$16, key, "=", value); - zephir_array_append(&dsnParts, _17$$16, PH_SEPARATE, "phalcon/db/adapter/pdo.zep", 164); - } - ZEPHIR_INIT_NVAR(dsnAttributes); - zephir_fast_join_str(dsnAttributes, SL(";"), dsnParts TSRMLS_CC); + ZEPHIR_CONCAT_VSV(&_17$$16, &key, "=", &value); + zephir_array_append(&dsnParts, &_17$$16, PH_SEPARATE, "phalcon/db/adapter/pdo.zep", 164); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_INIT_NVAR(&dsnAttributes); + zephir_fast_join_str(&dsnAttributes, SL(";"), &dsnParts TSRMLS_CC); } - ZEPHIR_INIT_VAR(_18); - ZVAL_LONG(_18, 2); + ZEPHIR_INIT_VAR(&_18); + ZVAL_LONG(&_18, 2); zephir_array_update_long(&options, 3, &_18, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - ZEPHIR_INIT_VAR(_19); - object_init_ex(_19, php_pdo_get_dbh_ce()); - _20 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_21); - ZEPHIR_CONCAT_VSV(_21, _20, ":", dsnAttributes); - ZEPHIR_CALL_METHOD(NULL, _19, "__construct", NULL, 0, _21, username, password, options); + ZEPHIR_INIT_VAR(&_19); + object_init_ex(&_19, php_pdo_get_dbh_ce()); + zephir_read_property(&_20, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_21); + ZEPHIR_CONCAT_VSV(&_21, &_20, ":", &dsnAttributes); + ZEPHIR_CALL_METHOD(NULL, &_19, "__construct", NULL, 0, &_21, &username, &password, &options); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_pdo"), _19 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_pdo"), &_19); RETURN_MM_BOOL(1); } @@ -255,26 +293,30 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, connect) { PHP_METHOD(Phalcon_Db_Adapter_Pdo, prepare) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sqlStatement_param = NULL, *_0; - zval *sqlStatement = NULL; + zval *sqlStatement_param = NULL, _0; + zval sqlStatement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlStatement); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlStatement_param); if (UNEXPECTED(Z_TYPE_P(sqlStatement_param) != IS_STRING && Z_TYPE_P(sqlStatement_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlStatement' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlStatement' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlStatement_param) == IS_STRING)) { - zephir_get_strval(sqlStatement, sqlStatement_param); + zephir_get_strval(&sqlStatement, sqlStatement_param); } else { - ZEPHIR_INIT_VAR(sqlStatement); - ZVAL_EMPTY_STRING(sqlStatement); + ZEPHIR_INIT_VAR(&sqlStatement); + ZVAL_EMPTY_STRING(&sqlStatement); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pdo"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "prepare", NULL, 0, sqlStatement); + zephir_read_property(&_0, this_ptr, SL("_pdo"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "prepare", NULL, 0, &sqlStatement); zephir_check_call_status(); RETURN_MM(); @@ -308,134 +350,168 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, prepare) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo, executePrepared) { - zval *_6$$13 = NULL; + zval _6$$13; zend_bool _3$$3; - HashTable *_1, *_9$$22, *_14$$28; - HashPosition _0, _8$$22, _13$$28; + zend_string *_2, *_10$$22, *_15$$28; + zend_ulong _1, _9$$22, _14$$28; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL; - zval *placeholders = NULL; - zval *statement, *placeholders_param = NULL, *dataTypes, *wildcard = NULL, *value = NULL, *type = NULL, *castValue = NULL, *parameter = NULL, *position = NULL, *itemValue = NULL, **_2, _4$$12 = zval_used_for_init, **_10$$22, *_11$$24 = NULL, *_12$$25 = NULL, **_15$$28, *_16$$29 = NULL; + zval placeholders; + zval *statement, statement_sub, *placeholders_param = NULL, *dataTypes, dataTypes_sub, wildcard, value, type, castValue, parameter, position, itemValue, *_0, _4$$12, *_8$$22, _11$$24, _12$$25, *_13$$28, _16$$29; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement_sub); + ZVAL_UNDEF(&dataTypes_sub); + ZVAL_UNDEF(&wildcard); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&castValue); + ZVAL_UNDEF(¶meter); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&itemValue); + ZVAL_UNDEF(&_4$$12); + ZVAL_UNDEF(&_11$$24); + ZVAL_UNDEF(&_12$$25); + ZVAL_UNDEF(&_16$$29); + ZVAL_UNDEF(&placeholders); + ZVAL_UNDEF(&_6$$13); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &statement, &placeholders_param, &dataTypes); - placeholders = placeholders_param; - - - zephir_is_iterable(placeholders, &_1, &_0, 0, 0, "phalcon/db/adapter/pdo.zep", 316); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(wildcard, _1, _0); - ZEPHIR_GET_HVALUE(value, _2); - if (Z_TYPE_P(wildcard) == IS_LONG) { - ZEPHIR_INIT_NVAR(parameter); - ZVAL_LONG(parameter, (zephir_get_numberval(wildcard) + 1)); - } else if (Z_TYPE_P(wildcard) == IS_STRING) { - ZEPHIR_CPY_WRT(parameter, wildcard); + ZEPHIR_OBS_COPY_OR_DUP(&placeholders, placeholders_param); + + + zephir_is_iterable(&placeholders, 0, "phalcon/db/adapter/pdo.zep", 316); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&placeholders), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&wildcard); + if (_2 != NULL) { + ZVAL_STR_COPY(&wildcard, _2); + } else { + ZVAL_LONG(&wildcard, _1); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + if (Z_TYPE_P(&wildcard) == IS_LONG) { + ZEPHIR_INIT_NVAR(¶meter); + ZVAL_LONG(¶meter, (zephir_get_numberval(&wildcard) + 1)); + } else if (Z_TYPE_P(&wildcard) == IS_STRING) { + ZEPHIR_CPY_WRT(¶meter, &wildcard); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid bind parameter (1)", "phalcon/db/adapter/pdo.zep", 243); return; } _3$$3 = Z_TYPE_P(dataTypes) == IS_ARRAY; if (_3$$3) { - ZEPHIR_OBS_NVAR(type); - _3$$3 = zephir_array_isset_fetch(&type, dataTypes, wildcard, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&type); + _3$$3 = zephir_array_isset_fetch(&type, dataTypes, &wildcard, 0 TSRMLS_CC); } if (_3$$3) { - if (ZEPHIR_IS_LONG(type, 32)) { - ZEPHIR_INIT_NVAR(castValue); - ZVAL_DOUBLE(castValue, zephir_get_doubleval(value)); - ZEPHIR_INIT_NVAR(type); - ZVAL_LONG(type, 1024); + if (ZEPHIR_IS_LONG(&type, 32)) { + ZEPHIR_INIT_NVAR(&castValue); + ZVAL_DOUBLE(&castValue, zephir_get_doubleval(&value)); + ZEPHIR_INIT_NVAR(&type); + ZVAL_LONG(&type, 1024); } else { if (ZEPHIR_GLOBAL(db).force_casting) { - if (Z_TYPE_P(value) != IS_ARRAY) { + if (Z_TYPE_P(&value) != IS_ARRAY) { do { - if (ZEPHIR_IS_LONG(type, 1)) { - ZEPHIR_SINIT_NVAR(_4$$12); + if (ZEPHIR_IS_LONG(&type, 1)) { ZVAL_LONG(&_4$$12, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_5, 39, value, &_4$$12); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_5, 33, &value, &_4$$12); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(type, 2)) { - zephir_get_strval(_6$$13, value); - ZEPHIR_CPY_WRT(castValue, _6$$13); + if (ZEPHIR_IS_LONG(&type, 2)) { + zephir_get_strval(&_6$$13, &value); + ZEPHIR_CPY_WRT(&castValue, &_6$$13); break; } - if (ZEPHIR_IS_LONG(type, 0)) { - ZEPHIR_INIT_NVAR(castValue); - ZVAL_NULL(castValue); + if (ZEPHIR_IS_LONG(&type, 0)) { + ZEPHIR_INIT_NVAR(&castValue); + ZVAL_NULL(&castValue); break; } - if (ZEPHIR_IS_LONG(type, 5)) { - ZEPHIR_INIT_NVAR(castValue); - ZVAL_BOOL(castValue, zephir_get_boolval(value)); + if (ZEPHIR_IS_LONG(&type, 5)) { + ZEPHIR_INIT_NVAR(&castValue); + ZVAL_BOOL(&castValue, zephir_get_boolval(&value)); break; } - ZEPHIR_CPY_WRT(castValue, value); + ZEPHIR_CPY_WRT(&castValue, &value); break; } while(0); } else { - ZEPHIR_CPY_WRT(castValue, value); + ZEPHIR_CPY_WRT(&castValue, &value); } } else { - ZEPHIR_CPY_WRT(castValue, value); + ZEPHIR_CPY_WRT(&castValue, &value); } } - if (Z_TYPE_P(castValue) != IS_ARRAY) { - if (ZEPHIR_IS_LONG(type, 1024)) { - ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, parameter, castValue); + if (Z_TYPE_P(&castValue) != IS_ARRAY) { + if (ZEPHIR_IS_LONG(&type, 1024)) { + ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, ¶meter, &castValue); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, parameter, castValue, type); + ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, ¶meter, &castValue, &type); zephir_check_call_status(); } } else { - zephir_is_iterable(castValue, &_9$$22, &_8$$22, 0, 0, "phalcon/db/adapter/pdo.zep", 304); - for ( - ; zend_hash_get_current_data_ex(_9$$22, (void**) &_10$$22, &_8$$22) == SUCCESS - ; zend_hash_move_forward_ex(_9$$22, &_8$$22) - ) { - ZEPHIR_GET_HMKEY(position, _9$$22, _8$$22); - ZEPHIR_GET_HVALUE(itemValue, _10$$22); - if (ZEPHIR_IS_LONG(type, 1024)) { + zephir_is_iterable(&castValue, 0, "phalcon/db/adapter/pdo.zep", 304); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&castValue), _9$$22, _10$$22, _8$$22) + { + ZEPHIR_INIT_NVAR(&position); + if (_10$$22 != NULL) { + ZVAL_STR_COPY(&position, _10$$22); + } else { + ZVAL_LONG(&position, _9$$22); + } + ZEPHIR_INIT_NVAR(&itemValue); + ZVAL_COPY(&itemValue, _8$$22); + if (ZEPHIR_IS_LONG(&type, 1024)) { ZEPHIR_INIT_LNVAR(_11$$24); - ZEPHIR_CONCAT_VV(_11$$24, parameter, position); - ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, _11$$24, itemValue); + ZEPHIR_CONCAT_VV(&_11$$24, ¶meter, &position); + ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, &_11$$24, &itemValue); zephir_check_call_status(); } else { ZEPHIR_INIT_LNVAR(_12$$25); - ZEPHIR_CONCAT_VV(_12$$25, parameter, position); - ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, _12$$25, itemValue, type); + ZEPHIR_CONCAT_VV(&_12$$25, ¶meter, &position); + ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, &_12$$25, &itemValue, &type); zephir_check_call_status(); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&itemValue); + ZEPHIR_INIT_NVAR(&position); } } else { - if (Z_TYPE_P(value) != IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, parameter, value); + if (Z_TYPE_P(&value) != IS_ARRAY) { + ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, ¶meter, &value); zephir_check_call_status(); } else { - zephir_is_iterable(value, &_14$$28, &_13$$28, 0, 0, "phalcon/db/adapter/pdo.zep", 312); - for ( - ; zend_hash_get_current_data_ex(_14$$28, (void**) &_15$$28, &_13$$28) == SUCCESS - ; zend_hash_move_forward_ex(_14$$28, &_13$$28) - ) { - ZEPHIR_GET_HMKEY(position, _14$$28, _13$$28); - ZEPHIR_GET_HVALUE(itemValue, _15$$28); + zephir_is_iterable(&value, 0, "phalcon/db/adapter/pdo.zep", 312); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&value), _14$$28, _15$$28, _13$$28) + { + ZEPHIR_INIT_NVAR(&position); + if (_15$$28 != NULL) { + ZVAL_STR_COPY(&position, _15$$28); + } else { + ZVAL_LONG(&position, _14$$28); + } + ZEPHIR_INIT_NVAR(&itemValue); + ZVAL_COPY(&itemValue, _13$$28); ZEPHIR_INIT_LNVAR(_16$$29); - ZEPHIR_CONCAT_VV(_16$$29, parameter, position); - ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, _16$$29, itemValue); + ZEPHIR_CONCAT_VV(&_16$$29, ¶meter, &position); + ZEPHIR_CALL_METHOD(NULL, statement, "bindvalue", &_7, 0, &_16$$29, &itemValue); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&itemValue); + ZEPHIR_INIT_NVAR(&position); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&wildcard); ZEPHIR_CALL_METHOD(NULL, statement, "execute", NULL, 0); zephir_check_call_status(); RETVAL_ZVAL(statement, 1, 0); @@ -464,80 +540,96 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, executePrepared) { PHP_METHOD(Phalcon_Db_Adapter_Pdo, query) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sqlStatement_param = NULL, *bindParams = NULL, *bindTypes = NULL, *eventsManager = NULL, *pdo = NULL, *statement = NULL, *params = NULL, *types = NULL, *_0, *_1$$3 = NULL, *_2$$3, *_3$$7 = NULL, *_4$$10; - zval *sqlStatement = NULL; + zval *sqlStatement_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, eventsManager, pdo, statement, params, types, _0, _1$$3, _2$$3, _3$$7, _4$$10; + zval sqlStatement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlStatement); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&pdo); + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&types); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &sqlStatement_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(sqlStatement_param) != IS_STRING && Z_TYPE_P(sqlStatement_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlStatement' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlStatement' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlStatement_param) == IS_STRING)) { - zephir_get_strval(sqlStatement, sqlStatement_param); + zephir_get_strval(&sqlStatement, sqlStatement_param); } else { - ZEPHIR_INIT_VAR(sqlStatement); - ZVAL_EMPTY_STRING(sqlStatement); + ZEPHIR_INIT_VAR(&sqlStatement); + ZVAL_EMPTY_STRING(&sqlStatement); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_sqlStatement"), sqlStatement TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlVariables"), bindParams TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlBindTypes"), bindTypes TSRMLS_CC); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "db:beforeQuery", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$3, eventsManager, "fire", NULL, 0, _2$$3, this_ptr); - zephir_check_temp_parameter(_2$$3); + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_sqlStatement"), &sqlStatement); + zephir_update_property_zval(this_ptr, SL("_sqlVariables"), bindParams); + zephir_update_property_zval(this_ptr, SL("_sqlBindTypes"), bindTypes); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "db:beforeQuery"); + ZEPHIR_CALL_METHOD(&_1$$3, &eventsManager, "fire", NULL, 0, &_2$$3, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$3)) { RETURN_MM_BOOL(0); } } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pdo"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(pdo, _0); + zephir_read_property(&_0, this_ptr, SL("_pdo"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&pdo, &_0); if (Z_TYPE_P(bindParams) == IS_ARRAY) { - ZEPHIR_CPY_WRT(params, bindParams); - ZEPHIR_CPY_WRT(types, bindTypes); + ZEPHIR_CPY_WRT(¶ms, bindParams); + ZEPHIR_CPY_WRT(&types, bindTypes); } else { - ZEPHIR_INIT_NVAR(params); - array_init(params); - ZEPHIR_INIT_NVAR(types); - array_init(types); + ZEPHIR_INIT_NVAR(¶ms); + array_init(¶ms); + ZEPHIR_INIT_NVAR(&types); + array_init(&types); } - ZEPHIR_CALL_METHOD(&statement, pdo, "prepare", NULL, 0, sqlStatement); + ZEPHIR_CALL_METHOD(&statement, &pdo, "prepare", NULL, 0, &sqlStatement); zephir_check_call_status(); - if (Z_TYPE_P(statement) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "executeprepared", NULL, 0, statement, params, types); + if (Z_TYPE_P(&statement) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "executeprepared", NULL, 0, &statement, ¶ms, &types); zephir_check_call_status(); - ZEPHIR_CPY_WRT(statement, _3$$7); + ZEPHIR_CPY_WRT(&statement, &_3$$7); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Cannot prepare statement", "phalcon/db/adapter/pdo.zep", 369); return; } - if (Z_TYPE_P(statement) == IS_OBJECT) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_4$$10); - ZVAL_STRING(_4$$10, "db:afterQuery", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _4$$10, this_ptr); - zephir_check_temp_parameter(_4$$10); + if (Z_TYPE_P(&statement) == IS_OBJECT) { + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_4$$10); + ZVAL_STRING(&_4$$10, "db:afterQuery"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_4$$10, this_ptr); zephir_check_call_status(); } object_init_ex(return_value, phalcon_db_result_pdo_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 40, this_ptr, statement, sqlStatement, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 34, this_ptr, &statement, &sqlStatement, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(statement); + RETURN_CCTOR(&statement); } @@ -563,69 +655,84 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, query) { PHP_METHOD(Phalcon_Db_Adapter_Pdo, execute) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sqlStatement_param = NULL, *bindParams = NULL, *bindTypes = NULL, *eventsManager = NULL, *affectedRows = NULL, *pdo = NULL, *newStatement = NULL, *statement = NULL, *_0, *_1$$3 = NULL, *_2$$3, *_3$$9; - zval *sqlStatement = NULL; + zval *sqlStatement_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, eventsManager, affectedRows, pdo, newStatement, statement, _0, _1$$3, _2$$3, _3$$9; + zval sqlStatement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlStatement); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&affectedRows); + ZVAL_UNDEF(&pdo); + ZVAL_UNDEF(&newStatement); + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &sqlStatement_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(sqlStatement_param) != IS_STRING && Z_TYPE_P(sqlStatement_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlStatement' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlStatement' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlStatement_param) == IS_STRING)) { - zephir_get_strval(sqlStatement, sqlStatement_param); + zephir_get_strval(&sqlStatement, sqlStatement_param); } else { - ZEPHIR_INIT_VAR(sqlStatement); - ZVAL_EMPTY_STRING(sqlStatement); + ZEPHIR_INIT_VAR(&sqlStatement); + ZVAL_EMPTY_STRING(&sqlStatement); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_sqlStatement"), sqlStatement TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlVariables"), bindParams TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlBindTypes"), bindTypes TSRMLS_CC); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "db:beforeQuery", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$3, eventsManager, "fire", NULL, 0, _2$$3, this_ptr); - zephir_check_temp_parameter(_2$$3); + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_sqlStatement"), &sqlStatement); + zephir_update_property_zval(this_ptr, SL("_sqlVariables"), bindParams); + zephir_update_property_zval(this_ptr, SL("_sqlBindTypes"), bindTypes); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "db:beforeQuery"); + ZEPHIR_CALL_METHOD(&_1$$3, &eventsManager, "fire", NULL, 0, &_2$$3, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$3)) { RETURN_MM_BOOL(0); } } - ZEPHIR_INIT_VAR(affectedRows); - ZVAL_LONG(affectedRows, 0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pdo"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(pdo, _0); + ZEPHIR_INIT_VAR(&affectedRows); + ZVAL_LONG(&affectedRows, 0); + zephir_read_property(&_0, this_ptr, SL("_pdo"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&pdo, &_0); if (Z_TYPE_P(bindParams) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&statement, pdo, "prepare", NULL, 0, sqlStatement); + ZEPHIR_CALL_METHOD(&statement, &pdo, "prepare", NULL, 0, &sqlStatement); zephir_check_call_status(); - if (Z_TYPE_P(statement) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&newStatement, this_ptr, "executeprepared", NULL, 0, statement, bindParams, bindTypes); + if (Z_TYPE_P(&statement) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&newStatement, this_ptr, "executeprepared", NULL, 0, &statement, bindParams, bindTypes); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&affectedRows, newStatement, "rowcount", NULL, 0); + ZEPHIR_CALL_METHOD(&affectedRows, &newStatement, "rowcount", NULL, 0); zephir_check_call_status(); } } else { - ZEPHIR_CALL_METHOD(&affectedRows, pdo, "exec", NULL, 0, sqlStatement); + ZEPHIR_CALL_METHOD(&affectedRows, &pdo, "exec", NULL, 0, &sqlStatement); zephir_check_call_status(); } - if (Z_TYPE_P(affectedRows) == IS_LONG) { - zephir_update_property_this(getThis(), SL("_affectedRows"), affectedRows TSRMLS_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_3$$9); - ZVAL_STRING(_3$$9, "db:afterQuery", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _3$$9, this_ptr); - zephir_check_temp_parameter(_3$$9); + if (Z_TYPE_P(&affectedRows) == IS_LONG) { + zephir_update_property_zval(this_ptr, SL("_affectedRows"), &affectedRows); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_3$$9); + ZVAL_STRING(&_3$$9, "db:afterQuery"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_3$$9, this_ptr); zephir_check_call_status(); } } @@ -646,7 +753,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, execute) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo, affectedRows) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_affectedRows"); @@ -658,12 +766,16 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, affectedRows) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo, close) { - zval *pdo = NULL; + zval __$null, pdo; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&pdo); - pdo = zephir_fetch_nproperty_this(this_ptr, SL("_pdo"), PH_NOISY_CC); - if (Z_TYPE_P(pdo) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_pdo"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_read_property(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&pdo) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_pdo"), &__$null); } RETURN_BOOL(1); @@ -679,17 +791,21 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, close) { PHP_METHOD(Phalcon_Db_Adapter_Pdo, escapeString) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *str_param = NULL, *_0; - zval *str = NULL; + zval *str_param = NULL, _0; + zval str; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&str); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &str_param); - zephir_get_strval(str, str_param); + zephir_get_strval(&str, str_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pdo"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "quote", NULL, 0, str); + zephir_read_property(&_0, this_ptr, SL("_pdo"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "quote", NULL, 0, &str); zephir_check_call_status(); RETURN_MM(); @@ -711,61 +827,72 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, escapeString) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo, convertBoundParams) { - HashTable *_3$$3; - HashPosition _2$$3; zend_long ZEPHIR_LAST_CALL_STATUS, setOrder = 0; - zval *params = NULL; - zval *sql_param = NULL, *params_param = NULL, *boundSql = NULL, *placeHolders = NULL, *bindPattern = NULL, *matches = NULL, *placeMatch = NULL, *value = NULL, *_0, *_1 = NULL, **_4$$3, *_7$$3, *_5$$4, *_6$$6; - zval *sql = NULL; + zval params; + zval *sql_param = NULL, *params_param = NULL, boundSql, placeHolders, bindPattern, matches, placeMatch, value, _0, _1, _2, *_3$$3, _6$$3, _4$$4, _5$$6; + zval sql; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&boundSql); + ZVAL_UNDEF(&placeHolders); + ZVAL_UNDEF(&bindPattern); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&placeMatch); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(¶ms); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &sql_param, ¶ms_param); if (UNEXPECTED(Z_TYPE_P(sql_param) != IS_STRING && Z_TYPE_P(sql_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sql' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sql' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sql_param) == IS_STRING)) { - zephir_get_strval(sql, sql_param); + zephir_get_strval(&sql, sql_param); } else { - ZEPHIR_INIT_VAR(sql); - ZVAL_EMPTY_STRING(sql); + ZEPHIR_INIT_VAR(&sql); + ZVAL_EMPTY_STRING(&sql); } if (!params_param) { - ZEPHIR_INIT_VAR(params); - array_init(params); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); } else { - zephir_get_arrval(params, params_param); + zephir_get_arrval(¶ms, params_param); } - ZEPHIR_INIT_VAR(placeHolders); - array_init(placeHolders); - ZEPHIR_INIT_VAR(bindPattern); - ZVAL_STRING(bindPattern, "/\\?([0-9]+)|:([a-zA-Z0-9_]+):/", 1); - ZEPHIR_INIT_VAR(matches); - ZVAL_NULL(matches); + ZEPHIR_INIT_VAR(&placeHolders); + array_init(&placeHolders); + ZEPHIR_INIT_VAR(&bindPattern); + ZVAL_STRING(&bindPattern, "/\\?([0-9]+)|:([a-zA-Z0-9_]+):/"); + ZEPHIR_INIT_VAR(&matches); + ZVAL_NULL(&matches); setOrder = 2; - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, setOrder); - ZEPHIR_MAKE_REF(matches); - ZEPHIR_CALL_FUNCTION(&_1, "preg_match_all", NULL, 41, bindPattern, sql, matches, _0); - ZEPHIR_UNREF(matches); - zephir_check_call_status(); - if (zephir_is_true(_1)) { - zephir_is_iterable(matches, &_3$$3, &_2$$3, 0, 0, "phalcon/db/adapter/pdo.zep", 531); - for ( - ; zend_hash_get_current_data_ex(_3$$3, (void**) &_4$$3, &_2$$3) == SUCCESS - ; zend_hash_move_forward_ex(_3$$3, &_2$$3) - ) { - ZEPHIR_GET_HVALUE(placeMatch, _4$$3); - ZEPHIR_OBS_NVAR(value); - zephir_array_fetch_long(&_5$$4, placeMatch, 1, PH_READONLY, "phalcon/db/adapter/pdo.zep", 518 TSRMLS_CC); - if (!(zephir_array_isset_fetch(&value, params, _5$$4, 0 TSRMLS_CC))) { - if (zephir_array_isset_long(placeMatch, 2)) { - ZEPHIR_OBS_NVAR(value); - zephir_array_fetch_long(&_6$$6, placeMatch, 2, PH_READONLY, "phalcon/db/adapter/pdo.zep", 520 TSRMLS_CC); - if (!(zephir_array_isset_fetch(&value, params, _6$$6, 0 TSRMLS_CC))) { + ZVAL_LONG(&_0, setOrder); + ZEPHIR_INIT_VAR(&_1); + ZVAL_LONG(&_2, setOrder); + zephir_preg_match(&_1, &bindPattern, &sql, &matches, 1, zephir_get_intval(&_0) , 0 TSRMLS_CC); + if (zephir_is_true(&_1)) { + zephir_is_iterable(&matches, 0, "phalcon/db/adapter/pdo.zep", 531); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&matches), _3$$3) + { + ZEPHIR_INIT_NVAR(&placeMatch); + ZVAL_COPY(&placeMatch, _3$$3); + ZEPHIR_OBS_NVAR(&value); + zephir_array_fetch_long(&_4$$4, &placeMatch, 1, PH_READONLY, "phalcon/db/adapter/pdo.zep", 518 TSRMLS_CC); + if (!(zephir_array_isset_fetch(&value, ¶ms, &_4$$4, 0 TSRMLS_CC))) { + if (zephir_array_isset_long(&placeMatch, 2)) { + ZEPHIR_OBS_NVAR(&value); + zephir_array_fetch_long(&_5$$6, &placeMatch, 2, PH_READONLY, "phalcon/db/adapter/pdo.zep", 520 TSRMLS_CC); + if (!(zephir_array_isset_fetch(&value, ¶ms, &_5$$6, 0 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Matched parameter wasn't found in parameters list", "phalcon/db/adapter/pdo.zep", 521); return; } @@ -774,19 +901,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, convertBoundParams) { return; } } - zephir_array_append(&placeHolders, value, PH_SEPARATE, "phalcon/db/adapter/pdo.zep", 528); - } - ZEPHIR_INIT_VAR(_7$$3); - ZVAL_STRING(_7$$3, "?", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&boundSql, "preg_replace", NULL, 42, bindPattern, _7$$3, sql); - zephir_check_temp_parameter(_7$$3); + zephir_array_append(&placeHolders, &value, PH_SEPARATE, "phalcon/db/adapter/pdo.zep", 528); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&placeMatch); + ZEPHIR_INIT_VAR(&_6$$3); + ZVAL_STRING(&_6$$3, "?"); + ZEPHIR_CALL_FUNCTION(&boundSql, "preg_replace", NULL, 35, &bindPattern, &_6$$3, &sql); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(boundSql, sql); + ZEPHIR_CPY_WRT(&boundSql, &sql); } zephir_create_array(return_value, 2, 0 TSRMLS_CC); - zephir_array_update_string(&return_value, SL("sql"), &boundSql, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("params"), &placeHolders, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("sql"), &boundSql, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("params"), &placeHolders, PH_COPY | PH_SEPARATE); RETURN_MM(); } @@ -818,22 +945,28 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, convertBoundParams) { PHP_METHOD(Phalcon_Db_Adapter_Pdo, lastInsertId) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sequenceName = NULL, *pdo = NULL; + zval *sequenceName = NULL, sequenceName_sub, __$null, pdo; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sequenceName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&pdo); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &sequenceName); if (!sequenceName) { - sequenceName = ZEPHIR_GLOBAL(global_null); + sequenceName = &sequenceName_sub; + sequenceName = &__$null; } - ZEPHIR_OBS_VAR(pdo); - zephir_read_property_this(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); - if (Z_TYPE_P(pdo) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&pdo); + zephir_read_property(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); + if (Z_TYPE_P(&pdo) != IS_OBJECT) { RETURN_MM_BOOL(0); } - ZEPHIR_RETURN_CALL_METHOD(pdo, "lastinsertid", NULL, 0, sequenceName); + ZEPHIR_RETURN_CALL_METHOD(&pdo, "lastinsertid", NULL, 0, sequenceName); zephir_check_call_status(); RETURN_MM(); @@ -845,8 +978,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, lastInsertId) { PHP_METHOD(Phalcon_Db_Adapter_Pdo, begin) { zend_long ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0; - zval *nesting_param = NULL, *pdo = NULL, *eventsManager = NULL, *savepointName = NULL, *_0, *_1$$4, *_2$$5, *_5$$6 = NULL, *_6$$7, *_7$$8; + zval *nesting_param = NULL, pdo, eventsManager, savepointName, _0, _1$$4, _2$$5, _5$$6, _6$$7, _7$$8; zend_bool nesting, _3$$6, _4$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pdo); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&savepointName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &nesting_param); @@ -858,26 +1002,25 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, begin) { } - ZEPHIR_OBS_VAR(pdo); - zephir_read_property_this(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); - if (Z_TYPE_P(pdo) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&pdo); + zephir_read_property(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); + if (Z_TYPE_P(&pdo) != IS_OBJECT) { RETURN_MM_BOOL(0); } RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_transactionLevel") TSRMLS_CC)); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC); - transactionLevel = zephir_get_intval(_0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC); + transactionLevel = zephir_get_intval(&_0); if (transactionLevel == 1) { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _1$$4); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$5); - ZVAL_STRING(_2$$5, "db:beginTransaction", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _2$$5, this_ptr); - zephir_check_temp_parameter(_2$$5); + zephir_read_property(&_1$$4, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_1$$4); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$5); + ZVAL_STRING(&_2$$5, "db:beginTransaction"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$5, this_ptr); zephir_check_call_status(); } - ZEPHIR_RETURN_CALL_METHOD(pdo, "begintransaction", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&pdo, "begintransaction", NULL, 0); zephir_check_call_status(); RETURN_MM(); } else { @@ -889,21 +1032,20 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, begin) { if (_4$$6) { ZEPHIR_CALL_METHOD(&_5$$6, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0); zephir_check_call_status(); - _4$$6 = zephir_is_true(_5$$6); + _4$$6 = zephir_is_true(&_5$$6); } if (_4$$6) { - _6$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _6$$7); + zephir_read_property(&_6$$7, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_6$$7); ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_7$$8); - ZVAL_STRING(_7$$8, "db:createSavepoint", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _7$$8, this_ptr, savepointName); - zephir_check_temp_parameter(_7$$8); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_7$$8); + ZVAL_STRING(&_7$$8, "db:createSavepoint"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$8, this_ptr, &savepointName); zephir_check_call_status(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "createsavepoint", NULL, 0, savepointName); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "createsavepoint", NULL, 0, &savepointName); zephir_check_call_status(); RETURN_MM(); } @@ -918,8 +1060,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, begin) { PHP_METHOD(Phalcon_Db_Adapter_Pdo, rollback) { zend_long ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0; - zval *nesting_param = NULL, *pdo = NULL, *eventsManager = NULL, *savepointName = NULL, *_0, *_1$$5, *_2$$6, *_5$$7 = NULL, *_6$$8, *_7$$9; + zval *nesting_param = NULL, pdo, eventsManager, savepointName, _0, _1$$5, _2$$6, _5$$7, _6$$8, _7$$9; zend_bool nesting, _3$$7, _4$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pdo); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&savepointName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &nesting_param); @@ -931,30 +1084,29 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, rollback) { } - ZEPHIR_OBS_VAR(pdo); - zephir_read_property_this(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); - if (Z_TYPE_P(pdo) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&pdo); + zephir_read_property(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); + if (Z_TYPE_P(&pdo) != IS_OBJECT) { RETURN_MM_BOOL(0); } - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC); - transactionLevel = zephir_get_intval(_0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC); + transactionLevel = zephir_get_intval(&_0); if (!(transactionLevel)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "There is no active transaction", "phalcon/db/adapter/pdo.zep", 651); return; } if (transactionLevel == 1) { - _1$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _1$$5); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$6); - ZVAL_STRING(_2$$6, "db:rollbackTransaction", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _2$$6, this_ptr); - zephir_check_temp_parameter(_2$$6); + zephir_read_property(&_1$$5, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_1$$5); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$6); + ZVAL_STRING(&_2$$6, "db:rollbackTransaction"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$6, this_ptr); zephir_check_call_status(); } RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_transactionLevel") TSRMLS_CC)); - ZEPHIR_RETURN_CALL_METHOD(pdo, "rollback", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&pdo, "rollback", NULL, 0); zephir_check_call_status(); RETURN_MM(); } else { @@ -966,22 +1118,21 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, rollback) { if (_4$$7) { ZEPHIR_CALL_METHOD(&_5$$7, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0); zephir_check_call_status(); - _4$$7 = zephir_is_true(_5$$7); + _4$$7 = zephir_is_true(&_5$$7); } if (_4$$7) { ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0); zephir_check_call_status(); - _6$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _6$$8); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_7$$9); - ZVAL_STRING(_7$$9, "db:rollbackSavepoint", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _7$$9, this_ptr, savepointName); - zephir_check_temp_parameter(_7$$9); + zephir_read_property(&_6$$8, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_6$$8); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_7$$9); + ZVAL_STRING(&_7$$9, "db:rollbackSavepoint"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$9, this_ptr, &savepointName); zephir_check_call_status(); } RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_transactionLevel") TSRMLS_CC)); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "rollbacksavepoint", NULL, 0, savepointName); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "rollbacksavepoint", NULL, 0, &savepointName); zephir_check_call_status(); RETURN_MM(); } @@ -999,8 +1150,19 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, rollback) { PHP_METHOD(Phalcon_Db_Adapter_Pdo, commit) { zend_long ZEPHIR_LAST_CALL_STATUS, transactionLevel = 0; - zval *nesting_param = NULL, *pdo = NULL, *eventsManager = NULL, *savepointName = NULL, *_0, *_1$$5, *_2$$6, *_5$$7 = NULL, *_6$$8, *_7$$9; + zval *nesting_param = NULL, pdo, eventsManager, savepointName, _0, _1$$5, _2$$6, _5$$7, _6$$8, _7$$9; zend_bool nesting, _3$$7, _4$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pdo); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&savepointName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &nesting_param); @@ -1012,30 +1174,29 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, commit) { } - ZEPHIR_OBS_VAR(pdo); - zephir_read_property_this(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); - if (Z_TYPE_P(pdo) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&pdo); + zephir_read_property(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); + if (Z_TYPE_P(&pdo) != IS_OBJECT) { RETURN_MM_BOOL(0); } - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC); - transactionLevel = zephir_get_intval(_0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_transactionLevel"), PH_NOISY_CC); + transactionLevel = zephir_get_intval(&_0); if (!(transactionLevel)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "There is no active transaction", "phalcon/db/adapter/pdo.zep", 724); return; } if (transactionLevel == 1) { - _1$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _1$$5); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$6); - ZVAL_STRING(_2$$6, "db:commitTransaction", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _2$$6, this_ptr); - zephir_check_temp_parameter(_2$$6); + zephir_read_property(&_1$$5, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_1$$5); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$6); + ZVAL_STRING(&_2$$6, "db:commitTransaction"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$6, this_ptr); zephir_check_call_status(); } RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_transactionLevel") TSRMLS_CC)); - ZEPHIR_RETURN_CALL_METHOD(pdo, "commit", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&pdo, "commit", NULL, 0); zephir_check_call_status(); RETURN_MM(); } else { @@ -1047,22 +1208,21 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, commit) { if (_4$$7) { ZEPHIR_CALL_METHOD(&_5$$7, this_ptr, "isnestedtransactionswithsavepoints", NULL, 0); zephir_check_call_status(); - _4$$7 = zephir_is_true(_5$$7); + _4$$7 = zephir_is_true(&_5$$7); } if (_4$$7) { - _6$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _6$$8); + zephir_read_property(&_6$$8, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_6$$8); ZEPHIR_CALL_METHOD(&savepointName, this_ptr, "getnestedtransactionsavepointname", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_7$$9); - ZVAL_STRING(_7$$9, "db:releaseSavepoint", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _7$$9, this_ptr, savepointName); - zephir_check_temp_parameter(_7$$9); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_7$$9); + ZVAL_STRING(&_7$$9, "db:releaseSavepoint"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_7$$9, this_ptr, &savepointName); zephir_check_call_status(); } RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_transactionLevel") TSRMLS_CC)); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "releasesavepoint", NULL, 0, savepointName); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "releasesavepoint", NULL, 0, &savepointName); zephir_check_call_status(); RETURN_MM(); } @@ -1079,7 +1239,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, commit) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo, getTransactionLevel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_transactionLevel"); @@ -1099,15 +1260,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, getTransactionLevel) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo, isUnderTransaction) { - zval *pdo = NULL; + zval pdo; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pdo); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(pdo); - zephir_read_property_this(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); - if (Z_TYPE_P(pdo) == IS_OBJECT) { - ZEPHIR_RETURN_CALL_METHOD(pdo, "intransaction", NULL, 0); + ZEPHIR_OBS_VAR(&pdo); + zephir_read_property(&pdo, this_ptr, SL("_pdo"), PH_NOISY_CC); + if (Z_TYPE_P(&pdo) == IS_OBJECT) { + ZEPHIR_RETURN_CALL_METHOD(&pdo, "intransaction", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -1120,7 +1284,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, isUnderTransaction) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo, getInternalHandler) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_pdo"); @@ -1133,13 +1298,16 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo, getInternalHandler) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo, getErrorInfo) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pdo"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "errorinfo", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_pdo"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "errorinfo", NULL, 0); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/db/adapter/pdo.zep.h b/ext/phalcon/db/adapter/pdo.zep.h index ac73e936b0e..182ab3f22ba 100644 --- a/ext/phalcon/db/adapter/pdo.zep.h +++ b/ext/phalcon/db/adapter/pdo.zep.h @@ -26,55 +26,158 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo___construct, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, descriptor, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_connect, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_connect, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_connect, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, descriptor, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_prepare, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_prepare, 0, 1, PDOStatement, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_prepare, 0, 1, IS_OBJECT, "PDOStatement", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlStatement, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlStatement) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_executeprepared, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_executeprepared, 0, 3, PDOStatement, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_executeprepared, 0, 3, IS_OBJECT, "PDOStatement", 0) +#endif ZEND_ARG_OBJ_INFO(0, statement, PDOStatement, 0) ZEND_ARG_ARRAY_INFO(0, placeholders, 0) ZEND_ARG_INFO(0, dataTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_query, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlStatement, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlStatement) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_execute, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_execute, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_execute, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlStatement, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlStatement) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_escapestring, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_affectedrows, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_affectedrows, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_escapestring, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_escapestring, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +#else ZEND_ARG_INFO(0, str) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_convertboundparams, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_convertboundparams, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_convertboundparams, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sql, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sql) - ZEND_ARG_ARRAY_INFO(0, params, 1) +#endif + ZEND_ARG_ARRAY_INFO(0, params, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_lastinsertid, 0, 0, 0) ZEND_ARG_INFO(0, sequenceName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_begin, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_begin, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_begin, 0, 0, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, nesting) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_rollback, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_rollback, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_rollback, 0, 0, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, nesting) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_commit, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_commit, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_commit, 0, 0, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, nesting) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_gettransactionlevel, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_gettransactionlevel, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_isundertransaction, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_isundertransaction, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_getinternalhandler, 0, 0, Pdo, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_getinternalhandler, 0, 0, IS_OBJECT, "Pdo", 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_adapter_pdo_method_entry) { @@ -84,17 +187,17 @@ ZEPHIR_INIT_FUNCS(phalcon_db_adapter_pdo_method_entry) { PHP_ME(Phalcon_Db_Adapter_Pdo, executePrepared, arginfo_phalcon_db_adapter_pdo_executeprepared, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo, query, arginfo_phalcon_db_adapter_pdo_query, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo, execute, arginfo_phalcon_db_adapter_pdo_execute, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo, affectedRows, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo, close, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo, affectedRows, arginfo_phalcon_db_adapter_pdo_affectedrows, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo, close, arginfo_phalcon_db_adapter_pdo_close, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo, escapeString, arginfo_phalcon_db_adapter_pdo_escapestring, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo, convertBoundParams, arginfo_phalcon_db_adapter_pdo_convertboundparams, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo, lastInsertId, arginfo_phalcon_db_adapter_pdo_lastinsertid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo, begin, arginfo_phalcon_db_adapter_pdo_begin, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo, rollback, arginfo_phalcon_db_adapter_pdo_rollback, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo, commit, arginfo_phalcon_db_adapter_pdo_commit, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo, getTransactionLevel, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo, isUnderTransaction, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo, getInternalHandler, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo, getTransactionLevel, arginfo_phalcon_db_adapter_pdo_gettransactionlevel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo, isUnderTransaction, arginfo_phalcon_db_adapter_pdo_isundertransaction, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo, getInternalHandler, arginfo_phalcon_db_adapter_pdo_getinternalhandler, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo, getErrorInfo, NULL, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/adapter/pdo/factory.zep.c b/ext/phalcon/db/adapter/pdo/factory.zep.c index 8a042e34421..04a98d82bd1 100644 --- a/ext/phalcon/db/adapter/pdo/factory.zep.c +++ b/ext/phalcon/db/adapter/pdo/factory.zep.c @@ -47,17 +47,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_Pdo_Factory) { PHP_METHOD(Phalcon_Db_Adapter_Pdo_Factory, load) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *_0; + zval *config, config_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Phalcon\\Db\\Adapter\\Pdo", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, _0, config); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Phalcon\\Db\\Adapter\\Pdo"); + ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, &_0, config); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/db/adapter/pdo/factory.zep.h b/ext/phalcon/db/adapter/pdo/factory.zep.h index 119211daeed..a1cad9a9019 100644 --- a/ext/phalcon/db/adapter/pdo/factory.zep.h +++ b/ext/phalcon/db/adapter/pdo/factory.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_Pdo_Factory); PHP_METHOD(Phalcon_Db_Adapter_Pdo_Factory, load); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_factory_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_factory_load, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_factory_load, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/db/adapter/pdo/mysql.zep.c b/ext/phalcon/db/adapter/pdo/mysql.zep.c index 9ad17b2bca3..c67751af800 100644 --- a/ext/phalcon/db/adapter/pdo/mysql.zep.c +++ b/ext/phalcon/db/adapter/pdo/mysql.zep.c @@ -64,209 +64,258 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Adapter_Pdo_Mysql) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeColumns) { - HashTable *_5; - HashPosition _4; - zephir_fcall_cache_entry *_40 = NULL; + zephir_fcall_cache_entry *_38 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *columns = NULL, *columnType = NULL, *field = NULL, *definition = NULL, *oldColumn = NULL, *sizePattern = NULL, *matches = NULL, *matchOne = NULL, *matchTwo = NULL, *columnName = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, *_7$$4 = NULL, *_8$$5 = NULL, *_9$$5 = NULL, *_10$$6 = NULL, *_11$$6 = NULL, *_12$$7 = NULL, *_13$$8 = NULL, *_14$$9 = NULL, *_15$$10 = NULL, *_16$$11 = NULL, *_17$$12 = NULL, *_18$$13 = NULL, *_19$$13 = NULL, *_20$$14 = NULL, *_21$$14 = NULL, *_22$$15 = NULL, *_23$$15 = NULL, *_24$$16 = NULL, *_25$$16 = NULL, *_26$$17 = NULL, *_27$$18 = NULL, *_28$$19 = NULL, *_29$$20 = NULL, *_30$$21 = NULL, *_31$$22 = NULL, *_32$$24 = NULL, *_33$$25 = NULL, *_34$$3, *_35$$3, *_36$$3, *_37$$3 = NULL, *_39$$3 = NULL, *_38$$32; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, __$true, columns, columnType, field, definition, oldColumn, sizePattern, matches, matchOne, matchTwo, columnName, _0, _1, _2, _3, *_4, _5$$4, _6$$5, _7$$5, _8$$6, _9$$6, _10$$7, _11$$8, _12$$9, _13$$10, _14$$11, _15$$12, _16$$13, _17$$13, _18$$14, _19$$14, _20$$15, _21$$15, _22$$16, _23$$16, _24$$17, _25$$18, _26$$19, _27$$20, _28$$21, _29$$22, _30$$24, _31$$25, _32$$3, _33$$3, _34$$3, _35$$3, _37$$3, _36$$32; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&columnType); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&oldColumn); + ZVAL_UNDEF(&sizePattern); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&matchOne); + ZVAL_UNDEF(&matchTwo); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_13$$10); + ZVAL_UNDEF(&_14$$11); + ZVAL_UNDEF(&_15$$12); + ZVAL_UNDEF(&_16$$13); + ZVAL_UNDEF(&_17$$13); + ZVAL_UNDEF(&_18$$14); + ZVAL_UNDEF(&_19$$14); + ZVAL_UNDEF(&_20$$15); + ZVAL_UNDEF(&_21$$15); + ZVAL_UNDEF(&_22$$16); + ZVAL_UNDEF(&_23$$16); + ZVAL_UNDEF(&_24$$17); + ZVAL_UNDEF(&_25$$18); + ZVAL_UNDEF(&_26$$19); + ZVAL_UNDEF(&_27$$20); + ZVAL_UNDEF(&_28$$21); + ZVAL_UNDEF(&_29$$22); + ZVAL_UNDEF(&_30$$24); + ZVAL_UNDEF(&_31$$25); + ZVAL_UNDEF(&_32$$3); + ZVAL_UNDEF(&_33$$3); + ZVAL_UNDEF(&_34$$3); + ZVAL_UNDEF(&_35$$3); + ZVAL_UNDEF(&_37$$3); + ZVAL_UNDEF(&_36$$32); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(oldColumn); - ZVAL_NULL(oldColumn); - ZEPHIR_INIT_VAR(sizePattern); - ZVAL_STRING(sizePattern, "#\\(([0-9]+)(?:,\\s*([0-9]+))*\\)#", 1); - ZEPHIR_INIT_VAR(columns); - array_init(columns); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "describecolumns", NULL, 0, table, schema); + ZEPHIR_INIT_VAR(&oldColumn); + ZVAL_NULL(&oldColumn); + ZEPHIR_INIT_VAR(&sizePattern); + ZVAL_STRING(&sizePattern, "#\\(([0-9]+)(?:,\\s*([0-9]+))*\\)#"); + ZEPHIR_INIT_VAR(&columns); + array_init(&columns); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "describecolumns", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/mysql.zep", 264); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(field, _6); - ZEPHIR_INIT_NVAR(definition); - zephir_create_array(definition, 1, 0 TSRMLS_CC); - add_assoc_long_ex(definition, SS("bindType"), 2); - ZEPHIR_OBS_NVAR(columnType); - zephir_array_fetch_long(&columnType, field, 1, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 92 TSRMLS_CC); - if (zephir_memnstr_str(columnType, SL("enum"), "phalcon/db/adapter/pdo/mysql.zep", 94)) { - ZEPHIR_INIT_NVAR(_7$$4); - ZVAL_LONG(_7$$4, 5); - zephir_array_update_string(&definition, SL("type"), &_7$$4, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("bigint"), "phalcon/db/adapter/pdo/mysql.zep", 99)) { - ZEPHIR_INIT_NVAR(_8$$5); - ZVAL_LONG(_8$$5, 14); - zephir_array_update_string(&definition, SL("type"), &_8$$5, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_9$$5); - ZVAL_LONG(_9$$5, 1); - zephir_array_update_string(&definition, SL("bindType"), &_9$$5, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("int"), "phalcon/db/adapter/pdo/mysql.zep", 106)) { - ZEPHIR_INIT_NVAR(_10$$6); - ZVAL_LONG(_10$$6, 0); - zephir_array_update_string(&definition, SL("type"), &_10$$6, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_11$$6); - ZVAL_LONG(_11$$6, 1); - zephir_array_update_string(&definition, SL("bindType"), &_11$$6, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("varchar"), "phalcon/db/adapter/pdo/mysql.zep", 113)) { - ZEPHIR_INIT_NVAR(_12$$7); - ZVAL_LONG(_12$$7, 2); - zephir_array_update_string(&definition, SL("type"), &_12$$7, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("datetime"), "phalcon/db/adapter/pdo/mysql.zep", 118)) { - ZEPHIR_INIT_NVAR(_13$$8); - ZVAL_LONG(_13$$8, 4); - zephir_array_update_string(&definition, SL("type"), &_13$$8, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("char"), "phalcon/db/adapter/pdo/mysql.zep", 123)) { - ZEPHIR_INIT_NVAR(_14$$9); - ZVAL_LONG(_14$$9, 5); - zephir_array_update_string(&definition, SL("type"), &_14$$9, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("date"), "phalcon/db/adapter/pdo/mysql.zep", 128)) { - ZEPHIR_INIT_NVAR(_15$$10); - ZVAL_LONG(_15$$10, 1); - zephir_array_update_string(&definition, SL("type"), &_15$$10, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("timestamp"), "phalcon/db/adapter/pdo/mysql.zep", 133)) { - ZEPHIR_INIT_NVAR(_16$$11); - ZVAL_LONG(_16$$11, 17); - zephir_array_update_string(&definition, SL("type"), &_16$$11, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("text"), "phalcon/db/adapter/pdo/mysql.zep", 138)) { - ZEPHIR_INIT_NVAR(_17$$12); - ZVAL_LONG(_17$$12, 6); - zephir_array_update_string(&definition, SL("type"), &_17$$12, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("decimal"), "phalcon/db/adapter/pdo/mysql.zep", 143)) { - ZEPHIR_INIT_NVAR(_18$$13); - ZVAL_LONG(_18$$13, 3); - zephir_array_update_string(&definition, SL("type"), &_18$$13, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_19$$13); - ZVAL_LONG(_19$$13, 32); - zephir_array_update_string(&definition, SL("bindType"), &_19$$13, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("double"), "phalcon/db/adapter/pdo/mysql.zep", 150)) { - ZEPHIR_INIT_NVAR(_20$$14); - ZVAL_LONG(_20$$14, 9); - zephir_array_update_string(&definition, SL("type"), &_20$$14, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_21$$14); - ZVAL_LONG(_21$$14, 32); - zephir_array_update_string(&definition, SL("bindType"), &_21$$14, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("float"), "phalcon/db/adapter/pdo/mysql.zep", 157)) { - ZEPHIR_INIT_NVAR(_22$$15); - ZVAL_LONG(_22$$15, 7); - zephir_array_update_string(&definition, SL("type"), &_22$$15, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_23$$15); - ZVAL_LONG(_23$$15, 32); - zephir_array_update_string(&definition, SL("bindType"), &_23$$15, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("bit"), "phalcon/db/adapter/pdo/mysql.zep", 164)) { - ZEPHIR_INIT_NVAR(_24$$16); - ZVAL_LONG(_24$$16, 8); - zephir_array_update_string(&definition, SL("type"), &_24$$16, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_25$$16); - ZVAL_LONG(_25$$16, 5); - zephir_array_update_string(&definition, SL("bindType"), &_25$$16, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("tinyblob"), "phalcon/db/adapter/pdo/mysql.zep", 170)) { - ZEPHIR_INIT_NVAR(_26$$17); - ZVAL_LONG(_26$$17, 10); - zephir_array_update_string(&definition, SL("type"), &_26$$17, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("mediumblob"), "phalcon/db/adapter/pdo/mysql.zep", 175)) { - ZEPHIR_INIT_NVAR(_27$$18); - ZVAL_LONG(_27$$18, 12); - zephir_array_update_string(&definition, SL("type"), &_27$$18, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("longblob"), "phalcon/db/adapter/pdo/mysql.zep", 180)) { - ZEPHIR_INIT_NVAR(_28$$19); - ZVAL_LONG(_28$$19, 13); - zephir_array_update_string(&definition, SL("type"), &_28$$19, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("blob"), "phalcon/db/adapter/pdo/mysql.zep", 185)) { - ZEPHIR_INIT_NVAR(_29$$20); - ZVAL_LONG(_29$$20, 11); - zephir_array_update_string(&definition, SL("type"), &_29$$20, PH_COPY | PH_SEPARATE); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter/pdo/mysql.zep", 264); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _4); + ZEPHIR_INIT_NVAR(&definition); + zephir_create_array(&definition, 1, 0 TSRMLS_CC); + add_assoc_long_ex(&definition, SL("bindType"), 2); + ZEPHIR_OBS_NVAR(&columnType); + zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 92 TSRMLS_CC); + if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/db/adapter/pdo/mysql.zep", 94)) { + ZEPHIR_INIT_NVAR(&_5$$4); + ZVAL_LONG(&_5$$4, 5); + zephir_array_update_string(&definition, SL("type"), &_5$$4, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/db/adapter/pdo/mysql.zep", 99)) { + ZEPHIR_INIT_NVAR(&_6$$5); + ZVAL_LONG(&_6$$5, 14); + zephir_array_update_string(&definition, SL("type"), &_6$$5, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_7$$5); + ZVAL_LONG(&_7$$5, 1); + zephir_array_update_string(&definition, SL("bindType"), &_7$$5, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("int"), "phalcon/db/adapter/pdo/mysql.zep", 106)) { + ZEPHIR_INIT_NVAR(&_8$$6); + ZVAL_LONG(&_8$$6, 0); + zephir_array_update_string(&definition, SL("type"), &_8$$6, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_LONG(&_9$$6, 1); + zephir_array_update_string(&definition, SL("bindType"), &_9$$6, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/db/adapter/pdo/mysql.zep", 113)) { + ZEPHIR_INIT_NVAR(&_10$$7); + ZVAL_LONG(&_10$$7, 2); + zephir_array_update_string(&definition, SL("type"), &_10$$7, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/db/adapter/pdo/mysql.zep", 118)) { + ZEPHIR_INIT_NVAR(&_11$$8); + ZVAL_LONG(&_11$$8, 4); + zephir_array_update_string(&definition, SL("type"), &_11$$8, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/db/adapter/pdo/mysql.zep", 123)) { + ZEPHIR_INIT_NVAR(&_12$$9); + ZVAL_LONG(&_12$$9, 5); + zephir_array_update_string(&definition, SL("type"), &_12$$9, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/db/adapter/pdo/mysql.zep", 128)) { + ZEPHIR_INIT_NVAR(&_13$$10); + ZVAL_LONG(&_13$$10, 1); + zephir_array_update_string(&definition, SL("type"), &_13$$10, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/db/adapter/pdo/mysql.zep", 133)) { + ZEPHIR_INIT_NVAR(&_14$$11); + ZVAL_LONG(&_14$$11, 17); + zephir_array_update_string(&definition, SL("type"), &_14$$11, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/db/adapter/pdo/mysql.zep", 138)) { + ZEPHIR_INIT_NVAR(&_15$$12); + ZVAL_LONG(&_15$$12, 6); + zephir_array_update_string(&definition, SL("type"), &_15$$12, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/db/adapter/pdo/mysql.zep", 143)) { + ZEPHIR_INIT_NVAR(&_16$$13); + ZVAL_LONG(&_16$$13, 3); + zephir_array_update_string(&definition, SL("type"), &_16$$13, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_17$$13); + ZVAL_LONG(&_17$$13, 32); + zephir_array_update_string(&definition, SL("bindType"), &_17$$13, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("double"), "phalcon/db/adapter/pdo/mysql.zep", 150)) { + ZEPHIR_INIT_NVAR(&_18$$14); + ZVAL_LONG(&_18$$14, 9); + zephir_array_update_string(&definition, SL("type"), &_18$$14, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_19$$14); + ZVAL_LONG(&_19$$14, 32); + zephir_array_update_string(&definition, SL("bindType"), &_19$$14, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/db/adapter/pdo/mysql.zep", 157)) { + ZEPHIR_INIT_NVAR(&_20$$15); + ZVAL_LONG(&_20$$15, 7); + zephir_array_update_string(&definition, SL("type"), &_20$$15, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_21$$15); + ZVAL_LONG(&_21$$15, 32); + zephir_array_update_string(&definition, SL("bindType"), &_21$$15, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("bit"), "phalcon/db/adapter/pdo/mysql.zep", 164)) { + ZEPHIR_INIT_NVAR(&_22$$16); + ZVAL_LONG(&_22$$16, 8); + zephir_array_update_string(&definition, SL("type"), &_22$$16, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_23$$16); + ZVAL_LONG(&_23$$16, 5); + zephir_array_update_string(&definition, SL("bindType"), &_23$$16, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("tinyblob"), "phalcon/db/adapter/pdo/mysql.zep", 170)) { + ZEPHIR_INIT_NVAR(&_24$$17); + ZVAL_LONG(&_24$$17, 10); + zephir_array_update_string(&definition, SL("type"), &_24$$17, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("mediumblob"), "phalcon/db/adapter/pdo/mysql.zep", 175)) { + ZEPHIR_INIT_NVAR(&_25$$18); + ZVAL_LONG(&_25$$18, 12); + zephir_array_update_string(&definition, SL("type"), &_25$$18, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("longblob"), "phalcon/db/adapter/pdo/mysql.zep", 180)) { + ZEPHIR_INIT_NVAR(&_26$$19); + ZVAL_LONG(&_26$$19, 13); + zephir_array_update_string(&definition, SL("type"), &_26$$19, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("blob"), "phalcon/db/adapter/pdo/mysql.zep", 185)) { + ZEPHIR_INIT_NVAR(&_27$$20); + ZVAL_LONG(&_27$$20, 11); + zephir_array_update_string(&definition, SL("type"), &_27$$20, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(_30$$21); - ZVAL_LONG(_30$$21, 2); - zephir_array_update_string(&definition, SL("type"), &_30$$21, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_28$$21); + ZVAL_LONG(&_28$$21, 2); + zephir_array_update_string(&definition, SL("type"), &_28$$21, PH_COPY | PH_SEPARATE); } - if (zephir_memnstr_str(columnType, SL("("), "phalcon/db/adapter/pdo/mysql.zep", 200)) { - ZEPHIR_INIT_NVAR(matches); - ZVAL_NULL(matches); - ZEPHIR_INIT_NVAR(_31$$22); - zephir_preg_match(_31$$22, sizePattern, columnType, matches, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(_31$$22)) { - ZEPHIR_OBS_NVAR(matchOne); - if (zephir_array_isset_long_fetch(&matchOne, matches, 1, 0 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_32$$24); - ZVAL_LONG(_32$$24, zephir_get_intval(matchOne)); - zephir_array_update_string(&definition, SL("size"), &_32$$24, PH_COPY | PH_SEPARATE); + if (zephir_memnstr_str(&columnType, SL("("), "phalcon/db/adapter/pdo/mysql.zep", 200)) { + ZEPHIR_INIT_NVAR(&matches); + ZVAL_NULL(&matches); + ZEPHIR_INIT_NVAR(&_29$$22); + zephir_preg_match(&_29$$22, &sizePattern, &columnType, &matches, 0, 0 , 0 TSRMLS_CC); + if (zephir_is_true(&_29$$22)) { + ZEPHIR_OBS_NVAR(&matchOne); + if (zephir_array_isset_long_fetch(&matchOne, &matches, 1, 0 TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_30$$24); + ZVAL_LONG(&_30$$24, zephir_get_intval(&matchOne)); + zephir_array_update_string(&definition, SL("size"), &_30$$24, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_NVAR(matchTwo); - if (zephir_array_isset_long_fetch(&matchTwo, matches, 2, 0 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_33$$25); - ZVAL_LONG(_33$$25, zephir_get_intval(matchTwo)); - zephir_array_update_string(&definition, SL("scale"), &_33$$25, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&matchTwo); + if (zephir_array_isset_long_fetch(&matchTwo, &matches, 2, 0 TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_31$$25); + ZVAL_LONG(&_31$$25, zephir_get_intval(&matchTwo)); + zephir_array_update_string(&definition, SL("scale"), &_31$$25, PH_COPY | PH_SEPARATE); } } } - if (zephir_memnstr_str(columnType, SL("unsigned"), "phalcon/db/adapter/pdo/mysql.zep", 215)) { - zephir_array_update_string(&definition, SL("unsigned"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/db/adapter/pdo/mysql.zep", 215)) { + zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE); } - if (Z_TYPE_P(oldColumn) == IS_NULL) { - zephir_array_update_string(&definition, SL("first"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&oldColumn) == IS_NULL) { + zephir_array_update_string(&definition, SL("first"), &__$true, PH_COPY | PH_SEPARATE); } else { zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_34$$3, field, 3, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 231 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_34$$3, "PRI")) { - zephir_array_update_string(&definition, SL("primary"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_32$$3, &field, 3, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 231 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_32$$3, "PRI")) { + zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_35$$3, field, 2, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 238 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_35$$3, "NO")) { - zephir_array_update_string(&definition, SL("notNull"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_33$$3, &field, 2, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 238 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_33$$3, "NO")) { + zephir_array_update_string(&definition, SL("notNull"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_36$$3, field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 245 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_36$$3, "auto_increment")) { - zephir_array_update_string(&definition, SL("autoIncrement"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_34$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 245 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_34$$3, "auto_increment")) { + zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_NVAR(_37$$3); - zephir_array_fetch_long(&_37$$3, field, 4, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 252 TSRMLS_CC); - if (Z_TYPE_P(_37$$3) != IS_NULL) { - zephir_array_fetch_long(&_38$$32, field, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 253 TSRMLS_CC); - zephir_array_update_string(&definition, SL("default"), &_38$$32, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_35$$3); + zephir_array_fetch_long(&_35$$3, &field, 4, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 252 TSRMLS_CC); + if (Z_TYPE_P(&_35$$3) != IS_NULL) { + zephir_array_fetch_long(&_36$$32, &field, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 253 TSRMLS_CC); + zephir_array_update_string(&definition, SL("default"), &_36$$32, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&columnName, field, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 259 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_39$$3); - object_init_ex(_39$$3, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, _39$$3, "__construct", &_40, 167, columnName, definition); + zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 259 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_37$$3); + object_init_ex(&_37$$3, phalcon_db_column_ce); + ZEPHIR_CALL_METHOD(NULL, &_37$$3, "__construct", &_38, 148, &columnName, &definition); zephir_check_call_status(); - zephir_array_append(&columns, _39$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/mysql.zep", 260); - ZEPHIR_CPY_WRT(oldColumn, columnName); - } - RETURN_CCTOR(columns); + zephir_array_append(&columns, &_37$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/mysql.zep", 260); + ZEPHIR_CPY_WRT(&oldColumn, &columnName); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + RETURN_CCTOR(&columns); } @@ -285,103 +334,135 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeColumns) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeIndexes) { - HashTable *_5, *_16; - HashPosition _4, _15; - zephir_fcall_cache_entry *_21 = NULL; + zend_string *_15; + zend_ulong _14; + zephir_fcall_cache_entry *_19 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *indexes = NULL, *index = NULL, *keyName = NULL, *indexType = NULL, *indexObjects = NULL, *columns = NULL, *name = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, **_17, *_7$$4 = NULL, *_8$$3, *_10$$3, *_11$$3, *_9$$6, *_12$$7 = NULL, *_13$$8 = NULL, *_14$$9 = NULL, *_18$$11 = NULL, *_19$$11, *_20$$11; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, __$null, indexes, index, keyName, indexType, indexObjects, columns, name, _0, _1, _2, _3, *_4, *_13, _5$$4, _6$$3, _8$$3, _9$$3, _7$$6, _10$$7, _11$$8, _12$$9, _16$$11, _17$$11, _18$$11; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&indexes); + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&indexType); + ZVAL_UNDEF(&indexObjects); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_8$$3); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_16$$11); + ZVAL_UNDEF(&_17$$11); + ZVAL_UNDEF(&_18$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(indexes); - array_init(indexes); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "describeindexes", NULL, 0, table, schema); + ZEPHIR_INIT_VAR(&indexes); + array_init(&indexes); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "describeindexes", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 2); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 2); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/mysql.zep", 313); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(index, _6); - zephir_array_fetch_string(&keyName, index, SL("Key_name"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 286 TSRMLS_CC); - zephir_array_fetch_string(&indexType, index, SL("Index_type"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 287 TSRMLS_CC); - if (!(zephir_array_isset(indexes, keyName))) { - ZEPHIR_INIT_NVAR(_7$$4); - array_init(_7$$4); - zephir_array_update_zval(&indexes, keyName, &_7$$4, PH_COPY | PH_SEPARATE); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter/pdo/mysql.zep", 313); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&index); + ZVAL_COPY(&index, _4); + zephir_array_fetch_string(&keyName, &index, SL("Key_name"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 286 TSRMLS_CC); + zephir_array_fetch_string(&indexType, &index, SL("Index_type"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 287 TSRMLS_CC); + if (!(zephir_array_isset(&indexes, &keyName))) { + ZEPHIR_INIT_NVAR(&_5$$4); + array_init(&_5$$4); + zephir_array_update_zval(&indexes, &keyName, &_5$$4, PH_COPY | PH_SEPARATE); } - zephir_array_fetch(&_8$$3, indexes, keyName, PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 293 TSRMLS_CC); - if (!(zephir_array_isset_string(_8$$3, SS("columns")))) { - ZEPHIR_INIT_NVAR(columns); - array_init(columns); + zephir_array_fetch(&_6$$3, &indexes, &keyName, PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 293 TSRMLS_CC); + if (!(zephir_array_isset_string(&_6$$3, SL("columns")))) { + ZEPHIR_INIT_NVAR(&columns); + array_init(&columns); } else { - zephir_array_fetch(&_9$$6, indexes, keyName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 296 TSRMLS_CC); - ZEPHIR_OBS_NVAR(columns); - zephir_array_fetch_string(&columns, _9$$6, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 296 TSRMLS_CC); + zephir_array_fetch(&_7$$6, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 296 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&columns); + zephir_array_fetch_string(&columns, &_7$$6, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 296 TSRMLS_CC); } - zephir_array_fetch_string(&_10$$3, index, SL("Column_name"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 299 TSRMLS_CC); - zephir_array_append(&columns, _10$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/mysql.zep", 299); - zephir_array_update_multi(&indexes, &columns TSRMLS_CC, SL("zs"), 3, keyName, SL("columns")); - zephir_array_fetch_string(&_11$$3, index, SL("Non_unique"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 306 TSRMLS_CC); - if (ZEPHIR_IS_STRING(keyName, "PRIMARY")) { - ZEPHIR_INIT_NVAR(_12$$7); - ZVAL_STRING(_12$$7, "PRIMARY", 1); - zephir_array_update_multi(&indexes, &_12$$7 TSRMLS_CC, SL("zs"), 3, keyName, SL("type")); - } else if (ZEPHIR_IS_STRING(indexType, "FULLTEXT")) { - ZEPHIR_INIT_NVAR(_13$$8); - ZVAL_STRING(_13$$8, "FULLTEXT", 1); - zephir_array_update_multi(&indexes, &_13$$8 TSRMLS_CC, SL("zs"), 3, keyName, SL("type")); - } else if (ZEPHIR_IS_LONG(_11$$3, 0)) { - ZEPHIR_INIT_NVAR(_14$$9); - ZVAL_STRING(_14$$9, "UNIQUE", 1); - zephir_array_update_multi(&indexes, &_14$$9 TSRMLS_CC, SL("zs"), 3, keyName, SL("type")); + zephir_array_fetch_string(&_8$$3, &index, SL("Column_name"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 299 TSRMLS_CC); + zephir_array_append(&columns, &_8$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/mysql.zep", 299); + zephir_array_update_multi(&indexes, &columns TSRMLS_CC, SL("zs"), 3, &keyName, SL("columns")); + zephir_array_fetch_string(&_9$$3, &index, SL("Non_unique"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 306 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&keyName, "PRIMARY")) { + ZEPHIR_INIT_NVAR(&_10$$7); + ZVAL_STRING(&_10$$7, "PRIMARY"); + zephir_array_update_multi(&indexes, &_10$$7 TSRMLS_CC, SL("zs"), 3, &keyName, SL("type")); + } else if (ZEPHIR_IS_STRING(&indexType, "FULLTEXT")) { + ZEPHIR_INIT_NVAR(&_11$$8); + ZVAL_STRING(&_11$$8, "FULLTEXT"); + zephir_array_update_multi(&indexes, &_11$$8 TSRMLS_CC, SL("zs"), 3, &keyName, SL("type")); + } else if (ZEPHIR_IS_LONG(&_9$$3, 0)) { + ZEPHIR_INIT_NVAR(&_12$$9); + ZVAL_STRING(&_12$$9, "UNIQUE"); + zephir_array_update_multi(&indexes, &_12$$9 TSRMLS_CC, SL("zs"), 3, &keyName, SL("type")); } else { - zephir_array_update_multi(&indexes, &ZEPHIR_GLOBAL(global_null) TSRMLS_CC, SL("zs"), 3, keyName, SL("type")); + zephir_array_update_multi(&indexes, &__$null TSRMLS_CC, SL("zs"), 3, &keyName, SL("type")); } - } - ZEPHIR_INIT_VAR(indexObjects); - array_init(indexObjects); - zephir_is_iterable(indexes, &_16, &_15, 0, 0, "phalcon/db/adapter/pdo/mysql.zep", 318); - for ( - ; zend_hash_get_current_data_ex(_16, (void**) &_17, &_15) == SUCCESS - ; zend_hash_move_forward_ex(_16, &_15) - ) { - ZEPHIR_GET_HMKEY(name, _16, _15); - ZEPHIR_GET_HVALUE(index, _17); - ZEPHIR_INIT_NVAR(_18$$11); - object_init_ex(_18$$11, phalcon_db_index_ce); - zephir_array_fetch_string(&_19$$11, index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 315 TSRMLS_CC); - zephir_array_fetch_string(&_20$$11, index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 315 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, _18$$11, "__construct", &_21, 24, name, _19$$11, _20$$11); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&index); + ZEPHIR_INIT_VAR(&indexObjects); + array_init(&indexObjects); + zephir_is_iterable(&indexes, 0, "phalcon/db/adapter/pdo/mysql.zep", 318); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&indexes), _14, _15, _13) + { + ZEPHIR_INIT_NVAR(&name); + if (_15 != NULL) { + ZVAL_STR_COPY(&name, _15); + } else { + ZVAL_LONG(&name, _14); + } + ZEPHIR_INIT_NVAR(&index); + ZVAL_COPY(&index, _13); + ZEPHIR_INIT_NVAR(&_16$$11); + object_init_ex(&_16$$11, phalcon_db_index_ce); + zephir_array_fetch_string(&_17$$11, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 315 TSRMLS_CC); + zephir_array_fetch_string(&_18$$11, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 315 TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &_16$$11, "__construct", &_19, 19, &name, &_17$$11, &_18$$11); zephir_check_call_status(); - zephir_array_update_zval(&indexObjects, name, &_18$$11, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(indexObjects); + zephir_array_update_zval(&indexObjects, &name, &_16$$11, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&index); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&indexObjects); } @@ -396,134 +477,171 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeIndexes) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeReferences) { - zval *_15$$3 = NULL, *_20$$6 = NULL; - HashTable *_5, *_17; - HashPosition _4, _16; - zephir_fcall_cache_entry *_22 = NULL; + zval _13$$3, _18$$6; + zend_string *_16; + zend_ulong _15; + zephir_fcall_cache_entry *_20 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *references = NULL, *reference = NULL, *arrayReference = NULL, *constraintName = NULL, *referenceObjects = NULL, *name = NULL, *referencedSchema = NULL, *referencedTable = NULL, *columns = NULL, *referencedColumns = NULL, *referenceUpdate = NULL, *referenceDelete = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, **_18, *_7$$5, *_8$$5, *_9$$5, *_10$$5, *_11$$5, *_12$$5, *_13$$3, *_14$$3, *_19$$6 = NULL, *_21$$6 = NULL; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, references, reference, arrayReference, constraintName, referenceObjects, name, referencedSchema, referencedTable, columns, referencedColumns, referenceUpdate, referenceDelete, _0, _1, _2, _3, *_4, *_14, _5$$5, _6$$5, _7$$5, _8$$5, _9$$5, _10$$5, _11$$3, _12$$3, _17$$6, _19$$6; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&references); + ZVAL_UNDEF(&reference); + ZVAL_UNDEF(&arrayReference); + ZVAL_UNDEF(&constraintName); + ZVAL_UNDEF(&referenceObjects); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&referencedSchema); + ZVAL_UNDEF(&referencedTable); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&referencedColumns); + ZVAL_UNDEF(&referenceUpdate); + ZVAL_UNDEF(&referenceDelete); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_17$$6); + ZVAL_UNDEF(&_19$$6); + ZVAL_UNDEF(&_13$$3); + ZVAL_UNDEF(&_18$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(references); - array_init(references); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "describereferences", NULL, 0, table, schema); + ZEPHIR_INIT_VAR(&references); + array_init(&references); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "describereferences", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/mysql.zep", 372); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(reference, _6); - zephir_array_fetch_long(&constraintName, reference, 2, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 341 TSRMLS_CC); - if (!(zephir_array_isset(references, constraintName))) { - ZEPHIR_OBS_NVAR(referencedSchema); - zephir_array_fetch_long(&referencedSchema, reference, 3, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 343 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedTable); - zephir_array_fetch_long(&referencedTable, reference, 4, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 344 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referenceUpdate); - zephir_array_fetch_long(&referenceUpdate, reference, 6, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 345 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referenceDelete); - zephir_array_fetch_long(&referenceDelete, reference, 7, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 346 TSRMLS_CC); - ZEPHIR_INIT_NVAR(columns); - array_init(columns); - ZEPHIR_INIT_NVAR(referencedColumns); - array_init(referencedColumns); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter/pdo/mysql.zep", 372); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&reference); + ZVAL_COPY(&reference, _4); + zephir_array_fetch_long(&constraintName, &reference, 2, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 341 TSRMLS_CC); + if (!(zephir_array_isset(&references, &constraintName))) { + ZEPHIR_OBS_NVAR(&referencedSchema); + zephir_array_fetch_long(&referencedSchema, &reference, 3, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 343 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedTable); + zephir_array_fetch_long(&referencedTable, &reference, 4, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 344 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referenceUpdate); + zephir_array_fetch_long(&referenceUpdate, &reference, 6, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 345 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referenceDelete); + zephir_array_fetch_long(&referenceDelete, &reference, 7, PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 346 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&columns); + array_init(&columns); + ZEPHIR_INIT_NVAR(&referencedColumns); + array_init(&referencedColumns); } else { - zephir_array_fetch(&_7$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 351 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedSchema); - zephir_array_fetch_string(&referencedSchema, _7$$5, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 351 TSRMLS_CC); - zephir_array_fetch(&_8$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 352 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedTable); - zephir_array_fetch_string(&referencedTable, _8$$5, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 352 TSRMLS_CC); - zephir_array_fetch(&_9$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 353 TSRMLS_CC); - ZEPHIR_OBS_NVAR(columns); - zephir_array_fetch_string(&columns, _9$$5, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 353 TSRMLS_CC); - zephir_array_fetch(&_10$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 354 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedColumns); - zephir_array_fetch_string(&referencedColumns, _10$$5, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 354 TSRMLS_CC); - zephir_array_fetch(&_11$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 355 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referenceUpdate); - zephir_array_fetch_string(&referenceUpdate, _11$$5, SL("onUpdate"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 355 TSRMLS_CC); - zephir_array_fetch(&_12$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 356 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referenceDelete); - zephir_array_fetch_string(&referenceDelete, _12$$5, SL("onDelete"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 356 TSRMLS_CC); + zephir_array_fetch(&_5$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 351 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedSchema); + zephir_array_fetch_string(&referencedSchema, &_5$$5, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 351 TSRMLS_CC); + zephir_array_fetch(&_6$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 352 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedTable); + zephir_array_fetch_string(&referencedTable, &_6$$5, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 352 TSRMLS_CC); + zephir_array_fetch(&_7$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 353 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&columns); + zephir_array_fetch_string(&columns, &_7$$5, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 353 TSRMLS_CC); + zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 354 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedColumns); + zephir_array_fetch_string(&referencedColumns, &_8$$5, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 354 TSRMLS_CC); + zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 355 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referenceUpdate); + zephir_array_fetch_string(&referenceUpdate, &_9$$5, SL("onUpdate"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 355 TSRMLS_CC); + zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 356 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referenceDelete); + zephir_array_fetch_string(&referenceDelete, &_10$$5, SL("onDelete"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 356 TSRMLS_CC); } - zephir_array_fetch_long(&_13$$3, reference, 1, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 359 TSRMLS_CC); - zephir_array_append(&columns, _13$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/mysql.zep", 359); - zephir_array_fetch_long(&_14$$3, reference, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 360 TSRMLS_CC); - zephir_array_append(&referencedColumns, _14$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/mysql.zep", 360); - ZEPHIR_INIT_NVAR(_15$$3); - zephir_create_array(_15$$3, 6, 0 TSRMLS_CC); - zephir_array_update_string(&_15$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_15$$3, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_15$$3, SL("columns"), &columns, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_15$$3, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_15$$3, SL("onUpdate"), &referenceUpdate, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_15$$3, SL("onDelete"), &referenceDelete, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&references, constraintName, &_15$$3, PH_COPY | PH_SEPARATE); - } - ZEPHIR_INIT_VAR(referenceObjects); - array_init(referenceObjects); - zephir_is_iterable(references, &_17, &_16, 0, 0, "phalcon/db/adapter/pdo/mysql.zep", 384); - for ( - ; zend_hash_get_current_data_ex(_17, (void**) &_18, &_16) == SUCCESS - ; zend_hash_move_forward_ex(_17, &_16) - ) { - ZEPHIR_GET_HMKEY(name, _17, _16); - ZEPHIR_GET_HVALUE(arrayReference, _18); - ZEPHIR_INIT_NVAR(_19$$6); - object_init_ex(_19$$6, phalcon_db_reference_ce); - ZEPHIR_INIT_NVAR(_20$$6); - zephir_create_array(_20$$6, 6, 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(_21$$6); - zephir_array_fetch_string(&_21$$6, arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 375 TSRMLS_CC); - zephir_array_update_string(&_20$$6, SL("referencedSchema"), &_21$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_21$$6); - zephir_array_fetch_string(&_21$$6, arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 376 TSRMLS_CC); - zephir_array_update_string(&_20$$6, SL("referencedTable"), &_21$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_21$$6); - zephir_array_fetch_string(&_21$$6, arrayReference, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 377 TSRMLS_CC); - zephir_array_update_string(&_20$$6, SL("columns"), &_21$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_21$$6); - zephir_array_fetch_string(&_21$$6, arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 378 TSRMLS_CC); - zephir_array_update_string(&_20$$6, SL("referencedColumns"), &_21$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_21$$6); - zephir_array_fetch_string(&_21$$6, arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 379 TSRMLS_CC); - zephir_array_update_string(&_20$$6, SL("onUpdate"), &_21$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_21$$6); - zephir_array_fetch_string(&_21$$6, arrayReference, SL("onDelete"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 381 TSRMLS_CC); - zephir_array_update_string(&_20$$6, SL("onDelete"), &_21$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _19$$6, "__construct", &_22, 25, name, _20$$6); + zephir_array_fetch_long(&_11$$3, &reference, 1, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 359 TSRMLS_CC); + zephir_array_append(&columns, &_11$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/mysql.zep", 359); + zephir_array_fetch_long(&_12$$3, &reference, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/mysql.zep", 360 TSRMLS_CC); + zephir_array_append(&referencedColumns, &_12$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/mysql.zep", 360); + ZEPHIR_INIT_NVAR(&_13$$3); + zephir_create_array(&_13$$3, 6, 0 TSRMLS_CC); + zephir_array_update_string(&_13$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_13$$3, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_13$$3, SL("columns"), &columns, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_13$$3, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_13$$3, SL("onUpdate"), &referenceUpdate, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_13$$3, SL("onDelete"), &referenceDelete, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&references, &constraintName, &_13$$3, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&reference); + ZEPHIR_INIT_VAR(&referenceObjects); + array_init(&referenceObjects); + zephir_is_iterable(&references, 0, "phalcon/db/adapter/pdo/mysql.zep", 384); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _15, _16, _14) + { + ZEPHIR_INIT_NVAR(&name); + if (_16 != NULL) { + ZVAL_STR_COPY(&name, _16); + } else { + ZVAL_LONG(&name, _15); + } + ZEPHIR_INIT_NVAR(&arrayReference); + ZVAL_COPY(&arrayReference, _14); + ZEPHIR_INIT_NVAR(&_17$$6); + object_init_ex(&_17$$6, phalcon_db_reference_ce); + ZEPHIR_INIT_NVAR(&_18$$6); + zephir_create_array(&_18$$6, 6, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 375 TSRMLS_CC); + zephir_array_update_string(&_18$$6, SL("referencedSchema"), &_19$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 376 TSRMLS_CC); + zephir_array_update_string(&_18$$6, SL("referencedTable"), &_19$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 377 TSRMLS_CC); + zephir_array_update_string(&_18$$6, SL("columns"), &_19$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 378 TSRMLS_CC); + zephir_array_update_string(&_18$$6, SL("referencedColumns"), &_19$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("onUpdate"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 379 TSRMLS_CC); + zephir_array_update_string(&_18$$6, SL("onUpdate"), &_19$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("onDelete"), PH_NOISY, "phalcon/db/adapter/pdo/mysql.zep", 381 TSRMLS_CC); + zephir_array_update_string(&_18$$6, SL("onDelete"), &_19$$6, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, &_17$$6, "__construct", &_20, 20, &name, &_18$$6); zephir_check_call_status(); - zephir_array_update_zval(&referenceObjects, name, &_19$$6, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(referenceObjects); + zephir_array_update_zval(&referenceObjects, &name, &_17$$6, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&arrayReference); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&referenceObjects); } @@ -533,49 +651,60 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeReferences) { PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, addForeignKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *reference, *foreignKeyCheck = NULL, *_0, *_1 = NULL, *_2 = NULL, *_3, *_4 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub, foreignKeyCheck, _0, _1, _2, _3, _4; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&reference_sub); + ZVAL_UNDEF(&foreignKeyCheck); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &reference); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "getforeignkeychecks", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "getforeignkeychecks", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&foreignKeyCheck, this_ptr, "prepare", NULL, 0, _1); + ZEPHIR_CALL_METHOD(&foreignKeyCheck, this_ptr, "prepare", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2, foreignKeyCheck, "execute", NULL, 0); + ZEPHIR_CALL_METHOD(&_2, &foreignKeyCheck, "execute", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_2))) { + if (!(zephir_is_true(&_2))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_application_exception_ce, "DATABASE PARAMETER 'FOREIGN_KEY_CHECKS' HAS TO BE 1", "phalcon/db/adapter/pdo/mysql.zep", 396); return; } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_4, _3, "addforeignkey", NULL, 0, tableName, schemaName, reference); + zephir_read_property(&_3, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_4, &_3, "addforeignkey", NULL, 0, &tableName, &schemaName, reference); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _4); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_4); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/db/adapter/pdo/mysql.zep.h b/ext/phalcon/db/adapter/pdo/mysql.zep.h index 41ff8613dc2..5c92a6c1fe8 100644 --- a/ext/phalcon/db/adapter/pdo/mysql.zep.h +++ b/ext/phalcon/db/adapter/pdo/mysql.zep.h @@ -8,24 +8,72 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeIndexes); PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, describeReferences); PHP_METHOD(Phalcon_Db_Adapter_Pdo_Mysql, addForeignKey); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_describecolumns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_describecolumns, 0, 1, Phalcon\\Db\\ColumnInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_describecolumns, 0, 1, IS_OBJECT, "Phalcon\\Db\\ColumnInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_describeindexes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_describeindexes, 0, 1, Phalcon\\Db\\IndexInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_describeindexes, 0, 1, IS_OBJECT, "Phalcon\\Db\\IndexInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_describereferences, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_describereferences, 0, 1, Phalcon\\Db\\ReferenceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_describereferences, 0, 1, IS_OBJECT, "Phalcon\\Db\\ReferenceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_addforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_addforeignkey, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_mysql_addforeignkey, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, reference, Phalcon\\Db\\ReferenceInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/db/adapter/pdo/postgresql.zep.c b/ext/phalcon/db/adapter/pdo/postgresql.zep.c index aee8934fc83..abbbb76da3e 100644 --- a/ext/phalcon/db/adapter/pdo/postgresql.zep.c +++ b/ext/phalcon/db/adapter/pdo/postgresql.zep.c @@ -63,54 +63,65 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, connect) { zend_bool _3$$6; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_5 = NULL; - zval *descriptor_param = NULL, *schema = NULL, *sql = NULL, *status = NULL, *_0$$3, *_2$$6, *_4$$6; - zval *descriptor = NULL, *_1$$3 = NULL; + zval *descriptor_param = NULL, __$null, schema, sql, status, _0$$3, _2$$6, _4$$6; + zval descriptor, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&descriptor); + ZVAL_UNDEF(&_1$$3); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &descriptor_param); if (!descriptor_param) { - ZEPHIR_INIT_VAR(descriptor); - array_init(descriptor); + ZEPHIR_INIT_VAR(&descriptor); + array_init(&descriptor); } else { - zephir_get_arrval(descriptor, descriptor_param); + zephir_get_arrval(&descriptor, descriptor_param); } - if (ZEPHIR_IS_EMPTY(descriptor)) { - ZEPHIR_OBS_VAR(_0$$3); - zephir_read_property_this(&_0$$3, this_ptr, SL("_descriptor"), PH_NOISY_CC); - zephir_get_arrval(_1$$3, _0$$3); - ZEPHIR_CPY_WRT(descriptor, _1$$3); + if (ZEPHIR_IS_EMPTY(&descriptor)) { + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property(&_0$$3, this_ptr, SL("_descriptor"), PH_NOISY_CC); + zephir_get_arrval(&_1$$3, &_0$$3); + ZEPHIR_CPY_WRT(&descriptor, &_1$$3); } - ZEPHIR_OBS_VAR(schema); - if (zephir_array_isset_string_fetch(&schema, descriptor, SS("schema"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&descriptor, SS("schema"), PH_SEPARATE); + ZEPHIR_OBS_VAR(&schema); + if (zephir_array_isset_string_fetch(&schema, &descriptor, SL("schema"), 0)) { + zephir_array_unset_string(&descriptor, SL("schema"), PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(schema); - ZVAL_STRING(schema, "", 1); + ZEPHIR_INIT_NVAR(&schema); + ZVAL_STRING(&schema, ""); } - if (zephir_array_isset_string(descriptor, SS("password"))) { - ZEPHIR_OBS_VAR(_2$$6); - zephir_array_fetch_string(&_2$$6, descriptor, SL("password"), PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 73 TSRMLS_CC); - _3$$6 = Z_TYPE_P(_2$$6) == IS_STRING; + if (zephir_array_isset_string(&descriptor, SL("password"))) { + ZEPHIR_OBS_VAR(&_2$$6); + zephir_array_fetch_string(&_2$$6, &descriptor, SL("password"), PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 73 TSRMLS_CC); + _3$$6 = Z_TYPE_P(&_2$$6) == IS_STRING; if (_3$$6) { - zephir_array_fetch_string(&_4$$6, descriptor, SL("password"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 73 TSRMLS_CC); - _3$$6 = zephir_fast_strlen_ev(_4$$6) == 0; + zephir_array_fetch_string(&_4$$6, &descriptor, SL("password"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 73 TSRMLS_CC); + _3$$6 = zephir_fast_strlen_ev(&_4$$6) == 0; } if (_3$$6) { - zephir_array_update_string(&descriptor, SL("password"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); + zephir_array_update_string(&descriptor, SL("password"), &__$null, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_PARENT(&status, phalcon_db_adapter_pdo_postgresql_ce, getThis(), "connect", &_5, 168, descriptor); + ZEPHIR_CALL_PARENT(&status, phalcon_db_adapter_pdo_postgresql_ce, getThis(), "connect", &_5, 0, &descriptor); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(schema))) { - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SVS(sql, "SET search_path TO '", schema, "'"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "execute", NULL, 0, sql); + if (!(ZEPHIR_IS_EMPTY(&schema))) { + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SVS(&sql, "SET search_path TO '", &schema, "'"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "execute", NULL, 0, &sql); zephir_check_call_status(); } - RETURN_CCTOR(status); + RETURN_CCTOR(&status); } @@ -125,218 +136,271 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, connect) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) { - HashTable *_5; - HashPosition _4; - zephir_fcall_cache_entry *_43 = NULL, *_47 = NULL, *_49 = NULL; + zephir_fcall_cache_entry *_41 = NULL, *_44 = NULL, *_46 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *columns = NULL, *columnType = NULL, *field = NULL, *definition = NULL, *oldColumn = NULL, *columnName = NULL, *charSize = NULL, *numericSize = NULL, *numericScale = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, *_7$$4 = NULL, *_8$$4 = NULL, *_9$$5 = NULL, *_10$$5 = NULL, *_11$$6 = NULL, *_12$$6 = NULL, *_13$$7 = NULL, *_14$$7 = NULL, *_15$$8 = NULL, *_16$$8 = NULL, *_17$$9 = NULL, *_18$$10 = NULL, *_19$$10 = NULL, *_20$$11 = NULL, *_21$$12 = NULL, *_22$$12 = NULL, *_23$$13 = NULL, *_24$$14 = NULL, *_25$$15 = NULL, *_26$$15 = NULL, *_27$$16 = NULL, *_28$$16 = NULL, *_29$$16 = NULL, *_30$$17 = NULL, *_31$$18 = NULL, *_32$$19 = NULL, *_33$$19 = NULL, *_34$$20 = NULL, *_35$$3, *_36$$3, *_37$$3, *_38$$3 = NULL, *_48$$3 = NULL, *_39$$26, *_40$$26 = NULL, *_41$$26 = NULL, *_42$$26 = NULL, *_44$$26, _45$$26 = zval_used_for_init, *_46$$26 = NULL; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, __$true, __$null, columns, columnType, field, definition, oldColumn, columnName, charSize, numericSize, numericScale, _0, _1, _2, _3, *_4, _5$$4, _6$$4, _7$$5, _8$$5, _9$$6, _10$$6, _11$$7, _12$$7, _13$$8, _14$$8, _15$$9, _16$$10, _17$$10, _18$$11, _19$$12, _20$$12, _21$$13, _22$$14, _23$$15, _24$$15, _25$$16, _26$$16, _27$$16, _28$$17, _29$$18, _30$$19, _31$$19, _32$$20, _33$$3, _34$$3, _35$$3, _36$$3, _45$$3, _37$$26, _38$$26, _39$$26, _40$$26, _42$$26, _43$$26; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&columnType); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&oldColumn); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&charSize); + ZVAL_UNDEF(&numericSize); + ZVAL_UNDEF(&numericScale); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_10$$6); + ZVAL_UNDEF(&_11$$7); + ZVAL_UNDEF(&_12$$7); + ZVAL_UNDEF(&_13$$8); + ZVAL_UNDEF(&_14$$8); + ZVAL_UNDEF(&_15$$9); + ZVAL_UNDEF(&_16$$10); + ZVAL_UNDEF(&_17$$10); + ZVAL_UNDEF(&_18$$11); + ZVAL_UNDEF(&_19$$12); + ZVAL_UNDEF(&_20$$12); + ZVAL_UNDEF(&_21$$13); + ZVAL_UNDEF(&_22$$14); + ZVAL_UNDEF(&_23$$15); + ZVAL_UNDEF(&_24$$15); + ZVAL_UNDEF(&_25$$16); + ZVAL_UNDEF(&_26$$16); + ZVAL_UNDEF(&_27$$16); + ZVAL_UNDEF(&_28$$17); + ZVAL_UNDEF(&_29$$18); + ZVAL_UNDEF(&_30$$19); + ZVAL_UNDEF(&_31$$19); + ZVAL_UNDEF(&_32$$20); + ZVAL_UNDEF(&_33$$3); + ZVAL_UNDEF(&_34$$3); + ZVAL_UNDEF(&_35$$3); + ZVAL_UNDEF(&_36$$3); + ZVAL_UNDEF(&_45$$3); + ZVAL_UNDEF(&_37$$26); + ZVAL_UNDEF(&_38$$26); + ZVAL_UNDEF(&_39$$26); + ZVAL_UNDEF(&_40$$26); + ZVAL_UNDEF(&_42$$26); + ZVAL_UNDEF(&_43$$26); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(oldColumn); - ZVAL_NULL(oldColumn); - ZEPHIR_INIT_VAR(columns); - array_init(columns); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "describecolumns", NULL, 0, table, schema); + ZEPHIR_INIT_VAR(&oldColumn); + ZVAL_NULL(&oldColumn); + ZEPHIR_INIT_VAR(&columns); + array_init(&columns); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "describecolumns", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/postgresql.zep", 284); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(field, _6); - ZEPHIR_INIT_NVAR(definition); - zephir_create_array(definition, 1, 0 TSRMLS_CC); - add_assoc_long_ex(definition, SS("bindType"), 2); - ZEPHIR_OBS_NVAR(columnType); - zephir_array_fetch_long(&columnType, field, 1, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 118 TSRMLS_CC); - ZEPHIR_OBS_NVAR(charSize); - zephir_array_fetch_long(&charSize, field, 2, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 119 TSRMLS_CC); - ZEPHIR_OBS_NVAR(numericSize); - zephir_array_fetch_long(&numericSize, field, 3, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 120 TSRMLS_CC); - ZEPHIR_OBS_NVAR(numericScale); - zephir_array_fetch_long(&numericScale, field, 4, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 121 TSRMLS_CC); - if (zephir_memnstr_str(columnType, SL("smallint(1)"), "phalcon/db/adapter/pdo/postgresql.zep", 123)) { - ZEPHIR_INIT_NVAR(_7$$4); - ZVAL_LONG(_7$$4, 8); - zephir_array_update_string(&definition, SL("type"), &_7$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_8$$4); - ZVAL_LONG(_8$$4, 5); - zephir_array_update_string(&definition, SL("bindType"), &_8$$4, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("bigint"), "phalcon/db/adapter/pdo/postgresql.zep", 129)) { - ZEPHIR_INIT_NVAR(_9$$5); - ZVAL_LONG(_9$$5, 14); - zephir_array_update_string(&definition, SL("type"), &_9$$5, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_10$$5); - ZVAL_LONG(_10$$5, 1); - zephir_array_update_string(&definition, SL("bindType"), &_10$$5, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("int"), "phalcon/db/adapter/pdo/postgresql.zep", 136)) { - ZEPHIR_INIT_NVAR(_11$$6); - ZVAL_LONG(_11$$6, 0); - zephir_array_update_string(&definition, SL("type"), &_11$$6, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter/pdo/postgresql.zep", 284); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _4); + ZEPHIR_INIT_NVAR(&definition); + zephir_create_array(&definition, 1, 0 TSRMLS_CC); + add_assoc_long_ex(&definition, SL("bindType"), 2); + ZEPHIR_OBS_NVAR(&columnType); + zephir_array_fetch_long(&columnType, &field, 1, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 118 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&charSize); + zephir_array_fetch_long(&charSize, &field, 2, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 119 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&numericSize); + zephir_array_fetch_long(&numericSize, &field, 3, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 120 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&numericScale); + zephir_array_fetch_long(&numericScale, &field, 4, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 121 TSRMLS_CC); + if (zephir_memnstr_str(&columnType, SL("smallint(1)"), "phalcon/db/adapter/pdo/postgresql.zep", 123)) { + ZEPHIR_INIT_NVAR(&_5$$4); + ZVAL_LONG(&_5$$4, 8); + zephir_array_update_string(&definition, SL("type"), &_5$$4, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_6$$4); + ZVAL_LONG(&_6$$4, 5); + zephir_array_update_string(&definition, SL("bindType"), &_6$$4, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/db/adapter/pdo/postgresql.zep", 129)) { + ZEPHIR_INIT_NVAR(&_7$$5); + ZVAL_LONG(&_7$$5, 14); + zephir_array_update_string(&definition, SL("type"), &_7$$5, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_8$$5); + ZVAL_LONG(&_8$$5, 1); + zephir_array_update_string(&definition, SL("bindType"), &_8$$5, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("int"), "phalcon/db/adapter/pdo/postgresql.zep", 136)) { + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_LONG(&_9$$6, 0); + zephir_array_update_string(&definition, SL("type"), &_9$$6, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_12$$6); - ZVAL_LONG(_12$$6, 1); - zephir_array_update_string(&definition, SL("bindType"), &_12$$6, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("double precision"), "phalcon/db/adapter/pdo/postgresql.zep", 144)) { - ZEPHIR_INIT_NVAR(_13$$7); - ZVAL_LONG(_13$$7, 9); - zephir_array_update_string(&definition, SL("type"), &_13$$7, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_10$$6); + ZVAL_LONG(&_10$$6, 1); + zephir_array_update_string(&definition, SL("bindType"), &_10$$6, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("double precision"), "phalcon/db/adapter/pdo/postgresql.zep", 144)) { + ZEPHIR_INIT_NVAR(&_11$$7); + ZVAL_LONG(&_11$$7, 9); + zephir_array_update_string(&definition, SL("type"), &_11$$7, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_14$$7); - ZVAL_LONG(_14$$7, 32); - zephir_array_update_string(&definition, SL("bindType"), &_14$$7, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("real"), "phalcon/db/adapter/pdo/postgresql.zep", 152)) { - ZEPHIR_INIT_NVAR(_15$$8); - ZVAL_LONG(_15$$8, 7); - zephir_array_update_string(&definition, SL("type"), &_15$$8, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_12$$7); + ZVAL_LONG(&_12$$7, 32); + zephir_array_update_string(&definition, SL("bindType"), &_12$$7, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("real"), "phalcon/db/adapter/pdo/postgresql.zep", 152)) { + ZEPHIR_INIT_NVAR(&_13$$8); + ZVAL_LONG(&_13$$8, 7); + zephir_array_update_string(&definition, SL("type"), &_13$$8, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_16$$8); - ZVAL_LONG(_16$$8, 32); - zephir_array_update_string(&definition, SL("bindType"), &_16$$8, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("varying"), "phalcon/db/adapter/pdo/postgresql.zep", 160)) { - ZEPHIR_INIT_NVAR(_17$$9); - ZVAL_LONG(_17$$9, 2); - zephir_array_update_string(&definition, SL("type"), &_17$$9, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_14$$8); + ZVAL_LONG(&_14$$8, 32); + zephir_array_update_string(&definition, SL("bindType"), &_14$$8, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("varying"), "phalcon/db/adapter/pdo/postgresql.zep", 160)) { + ZEPHIR_INIT_NVAR(&_15$$9); + ZVAL_LONG(&_15$$9, 2); + zephir_array_update_string(&definition, SL("type"), &_15$$9, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("date"), "phalcon/db/adapter/pdo/postgresql.zep", 166)) { - ZEPHIR_INIT_NVAR(_18$$10); - ZVAL_LONG(_18$$10, 1); - zephir_array_update_string(&definition, SL("type"), &_18$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_19$$10); - ZVAL_LONG(_19$$10, 0); - zephir_array_update_string(&definition, SL("size"), &_19$$10, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("timestamp"), "phalcon/db/adapter/pdo/postgresql.zep", 172)) { - ZEPHIR_INIT_NVAR(_20$$11); - ZVAL_LONG(_20$$11, 17); - zephir_array_update_string(&definition, SL("type"), &_20$$11, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("numeric"), "phalcon/db/adapter/pdo/postgresql.zep", 177)) { - ZEPHIR_INIT_NVAR(_21$$12); - ZVAL_LONG(_21$$12, 3); - zephir_array_update_string(&definition, SL("type"), &_21$$12, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/db/adapter/pdo/postgresql.zep", 166)) { + ZEPHIR_INIT_NVAR(&_16$$10); + ZVAL_LONG(&_16$$10, 1); + zephir_array_update_string(&definition, SL("type"), &_16$$10, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_17$$10); + ZVAL_LONG(&_17$$10, 0); + zephir_array_update_string(&definition, SL("size"), &_17$$10, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/db/adapter/pdo/postgresql.zep", 172)) { + ZEPHIR_INIT_NVAR(&_18$$11); + ZVAL_LONG(&_18$$11, 17); + zephir_array_update_string(&definition, SL("type"), &_18$$11, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("numeric"), "phalcon/db/adapter/pdo/postgresql.zep", 177)) { + ZEPHIR_INIT_NVAR(&_19$$12); + ZVAL_LONG(&_19$$12, 3); + zephir_array_update_string(&definition, SL("type"), &_19$$12, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("scale"), &numericScale, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_22$$12); - ZVAL_LONG(_22$$12, 32); - zephir_array_update_string(&definition, SL("bindType"), &_22$$12, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("char"), "phalcon/db/adapter/pdo/postgresql.zep", 186)) { - ZEPHIR_INIT_NVAR(_23$$13); - ZVAL_LONG(_23$$13, 5); - zephir_array_update_string(&definition, SL("type"), &_23$$13, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_20$$12); + ZVAL_LONG(&_20$$12, 32); + zephir_array_update_string(&definition, SL("bindType"), &_20$$12, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/db/adapter/pdo/postgresql.zep", 186)) { + ZEPHIR_INIT_NVAR(&_21$$13); + ZVAL_LONG(&_21$$13, 5); + zephir_array_update_string(&definition, SL("type"), &_21$$13, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("text"), "phalcon/db/adapter/pdo/postgresql.zep", 192)) { - ZEPHIR_INIT_NVAR(_24$$14); - ZVAL_LONG(_24$$14, 6); - zephir_array_update_string(&definition, SL("type"), &_24$$14, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/db/adapter/pdo/postgresql.zep", 192)) { + ZEPHIR_INIT_NVAR(&_22$$14); + ZVAL_LONG(&_22$$14, 6); + zephir_array_update_string(&definition, SL("type"), &_22$$14, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("size"), &charSize, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("float"), "phalcon/db/adapter/pdo/postgresql.zep", 198)) { - ZEPHIR_INIT_NVAR(_25$$15); - ZVAL_LONG(_25$$15, 7); - zephir_array_update_string(&definition, SL("type"), &_25$$15, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/db/adapter/pdo/postgresql.zep", 198)) { + ZEPHIR_INIT_NVAR(&_23$$15); + ZVAL_LONG(&_23$$15, 7); + zephir_array_update_string(&definition, SL("type"), &_23$$15, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); zephir_array_update_string(&definition, SL("size"), &numericSize, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_26$$15); - ZVAL_LONG(_26$$15, 32); - zephir_array_update_string(&definition, SL("bindType"), &_26$$15, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("bool"), "phalcon/db/adapter/pdo/postgresql.zep", 206)) { - ZEPHIR_INIT_NVAR(_27$$16); - ZVAL_LONG(_27$$16, 8); - zephir_array_update_string(&definition, SL("type"), &_27$$16, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_28$$16); - ZVAL_LONG(_28$$16, 0); - zephir_array_update_string(&definition, SL("size"), &_28$$16, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_29$$16); - ZVAL_LONG(_29$$16, 5); - zephir_array_update_string(&definition, SL("bindType"), &_29$$16, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("jsonb"), "phalcon/db/adapter/pdo/postgresql.zep", 213)) { - ZEPHIR_INIT_NVAR(_30$$17); - ZVAL_LONG(_30$$17, 16); - zephir_array_update_string(&definition, SL("type"), &_30$$17, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("json"), "phalcon/db/adapter/pdo/postgresql.zep", 218)) { - ZEPHIR_INIT_NVAR(_31$$18); - ZVAL_LONG(_31$$18, 15); - zephir_array_update_string(&definition, SL("type"), &_31$$18, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("uuid"), "phalcon/db/adapter/pdo/postgresql.zep", 223)) { - ZEPHIR_INIT_NVAR(_32$$19); - ZVAL_LONG(_32$$19, 5); - zephir_array_update_string(&definition, SL("type"), &_32$$19, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_33$$19); - ZVAL_LONG(_33$$19, 36); - zephir_array_update_string(&definition, SL("size"), &_33$$19, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_24$$15); + ZVAL_LONG(&_24$$15, 32); + zephir_array_update_string(&definition, SL("bindType"), &_24$$15, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("bool"), "phalcon/db/adapter/pdo/postgresql.zep", 206)) { + ZEPHIR_INIT_NVAR(&_25$$16); + ZVAL_LONG(&_25$$16, 8); + zephir_array_update_string(&definition, SL("type"), &_25$$16, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_26$$16); + ZVAL_LONG(&_26$$16, 0); + zephir_array_update_string(&definition, SL("size"), &_26$$16, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_27$$16); + ZVAL_LONG(&_27$$16, 5); + zephir_array_update_string(&definition, SL("bindType"), &_27$$16, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("jsonb"), "phalcon/db/adapter/pdo/postgresql.zep", 213)) { + ZEPHIR_INIT_NVAR(&_28$$17); + ZVAL_LONG(&_28$$17, 16); + zephir_array_update_string(&definition, SL("type"), &_28$$17, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("json"), "phalcon/db/adapter/pdo/postgresql.zep", 218)) { + ZEPHIR_INIT_NVAR(&_29$$18); + ZVAL_LONG(&_29$$18, 15); + zephir_array_update_string(&definition, SL("type"), &_29$$18, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("uuid"), "phalcon/db/adapter/pdo/postgresql.zep", 223)) { + ZEPHIR_INIT_NVAR(&_30$$19); + ZVAL_LONG(&_30$$19, 5); + zephir_array_update_string(&definition, SL("type"), &_30$$19, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_31$$19); + ZVAL_LONG(&_31$$19, 36); + zephir_array_update_string(&definition, SL("size"), &_31$$19, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(_34$$20); - ZVAL_LONG(_34$$20, 2); - zephir_array_update_string(&definition, SL("type"), &_34$$20, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_32$$20); + ZVAL_LONG(&_32$$20, 2); + zephir_array_update_string(&definition, SL("type"), &_32$$20, PH_COPY | PH_SEPARATE); } - if (Z_TYPE_P(oldColumn) == IS_NULL) { - zephir_array_update_string(&definition, SL("first"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&oldColumn) == IS_NULL) { + zephir_array_update_string(&definition, SL("first"), &__$true, PH_COPY | PH_SEPARATE); } else { zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_35$$3, field, 6, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 248 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_35$$3, "PRI")) { - zephir_array_update_string(&definition, SL("primary"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_33$$3, &field, 6, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 248 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_33$$3, "PRI")) { + zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_36$$3, field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 255 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_36$$3, "NO")) { - zephir_array_update_string(&definition, SL("notNull"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_34$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 255 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_34$$3, "NO")) { + zephir_array_update_string(&definition, SL("notNull"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_37$$3, field, 7, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 262 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_37$$3, "auto_increment")) { - zephir_array_update_string(&definition, SL("autoIncrement"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_35$$3, &field, 7, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 262 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_35$$3, "auto_increment")) { + zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_NVAR(_38$$3); - zephir_array_fetch_long(&_38$$3, field, 9, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 269 TSRMLS_CC); - if (Z_TYPE_P(_38$$3) != IS_NULL) { - zephir_array_fetch_long(&_39$$26, field, 9, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 270 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_40$$26); - ZVAL_STRING(_40$$26, "/^'|'?::[[:alnum:][:space:]]+$/", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_41$$26); - ZVAL_STRING(_41$$26, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_42$$26, "preg_replace", &_43, 42, _40$$26, _41$$26, _39$$26); - zephir_check_temp_parameter(_40$$26); - zephir_check_temp_parameter(_41$$26); + ZEPHIR_OBS_NVAR(&_36$$3); + zephir_array_fetch_long(&_36$$3, &field, 9, PH_NOISY, "phalcon/db/adapter/pdo/postgresql.zep", 269 TSRMLS_CC); + if (Z_TYPE_P(&_36$$3) != IS_NULL) { + zephir_array_fetch_long(&_37$$26, &field, 9, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 270 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_38$$26); + ZVAL_STRING(&_38$$26, "/^'|'?::[[:alnum:][:space:]]+$/"); + ZEPHIR_INIT_NVAR(&_39$$26); + ZVAL_STRING(&_39$$26, ""); + ZEPHIR_CALL_FUNCTION(&_40$$26, "preg_replace", &_41, 35, &_38$$26, &_39$$26, &_37$$26); zephir_check_call_status(); - zephir_array_update_string(&definition, SL("default"), &_42$$26, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_44$$26, definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 271 TSRMLS_CC); - ZEPHIR_SINIT_NVAR(_45$$26); - ZVAL_STRING(&_45$$26, "null", 0); - ZEPHIR_CALL_FUNCTION(&_46$$26, "strcasecmp", &_47, 16, _44$$26, &_45$$26); + zephir_array_update_string(&definition, SL("default"), &_40$$26, PH_COPY | PH_SEPARATE); + zephir_array_fetch_string(&_42$$26, &definition, SL("default"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 271 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_38$$26); + ZVAL_STRING(&_38$$26, "null"); + ZEPHIR_CALL_FUNCTION(&_43$$26, "strcasecmp", &_44, 11, &_42$$26, &_38$$26); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_46$$26, 0)) { - zephir_array_update_string(&definition, SL("default"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_LONG(&_43$$26, 0)) { + zephir_array_update_string(&definition, SL("default"), &__$null, PH_COPY | PH_SEPARATE); } } - zephir_array_fetch_long(&columnName, field, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 279 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_48$$3); - object_init_ex(_48$$3, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, _48$$3, "__construct", &_49, 167, columnName, definition); + zephir_array_fetch_long(&columnName, &field, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 279 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_45$$3); + object_init_ex(&_45$$3, phalcon_db_column_ce); + ZEPHIR_CALL_METHOD(NULL, &_45$$3, "__construct", &_46, 148, &columnName, &definition); zephir_check_call_status(); - zephir_array_append(&columns, _48$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/postgresql.zep", 280); - ZEPHIR_CPY_WRT(oldColumn, columnName); - } - RETURN_CCTOR(columns); + zephir_array_append(&columns, &_45$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/postgresql.zep", 280); + ZEPHIR_CPY_WRT(&oldColumn, &columnName); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + RETURN_CCTOR(&columns); } @@ -345,74 +409,87 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, createTable) { - HashTable *_2$$6; - HashPosition _1$$6; - zephir_fcall_cache_entry *_5 = NULL; + zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, *sql = NULL, *queries = NULL, *query = NULL, *exception = NULL, *columns = NULL, *_0, **_3$$6, *_4$$7 = NULL, *_6$$5, *_7$$10, *_8$$10; - zval *tableName = NULL, *schemaName = NULL; + zval definition; + zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, sql, queries, query, exception, columns, _0, *_1$$6, _2$$7, _4$$5, _5$$10, _6$$10; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&queries); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&exception); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$10); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - ZEPHIR_OBS_VAR(columns); - if (!(zephir_array_isset_string_fetch(&columns, definition, SS("columns"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&columns); + if (!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/db/adapter/pdo/postgresql.zep", 295); return; } - if (!(zephir_fast_count_int(columns TSRMLS_CC))) { + if (!(zephir_fast_count_int(&columns TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The table must contain at least one column", "phalcon/db/adapter/pdo/postgresql.zep", 299); return; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&sql, _0, "createtable", NULL, 0, tableName, schemaName, definition); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&sql, &_0, "createtable", NULL, 0, &tableName, &schemaName, &definition); zephir_check_call_status(); - ZEPHIR_INIT_VAR(queries); - zephir_fast_explode_str(queries, SL(";"), sql, LONG_MAX TSRMLS_CC); - if (zephir_fast_count_int(queries TSRMLS_CC) > 1) { + ZEPHIR_INIT_VAR(&queries); + zephir_fast_explode_str(&queries, SL(";"), &sql, LONG_MAX TSRMLS_CC); + if (zephir_fast_count_int(&queries TSRMLS_CC) > 1) { /* try_start_1: */ ZEPHIR_CALL_METHOD(NULL, this_ptr, "begin", NULL, 0); zephir_check_call_status_or_jump(try_end_1); - zephir_is_iterable(queries, &_2$$6, &_1$$6, 0, 0, "phalcon/db/adapter/pdo/postgresql.zep", 315); - for ( - ; zend_hash_get_current_data_ex(_2$$6, (void**) &_3$$6, &_1$$6) == SUCCESS - ; zend_hash_move_forward_ex(_2$$6, &_1$$6) - ) { - ZEPHIR_GET_HVALUE(query, _3$$6); - if (ZEPHIR_IS_EMPTY(query)) { + zephir_is_iterable(&queries, 0, "phalcon/db/adapter/pdo/postgresql.zep", 315); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&queries), _1$$6) + { + ZEPHIR_INIT_NVAR(&query); + ZVAL_COPY(&query, _1$$6); + if (ZEPHIR_IS_EMPTY(&query)) { continue; } - ZEPHIR_INIT_LNVAR(_4$$7); - ZEPHIR_CONCAT_VS(_4$$7, query, ";"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "query", &_5, 0, _4$$7); + ZEPHIR_INIT_LNVAR(_2$$7); + ZEPHIR_CONCAT_VS(&_2$$7, &query, ";"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "query", &_3, 0, &_2$$7); zephir_check_call_status_or_jump(try_end_1); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&query); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "commit", NULL, 0); zephir_check_call_status_or_jump(try_end_1); RETURN_MM(); @@ -420,23 +497,24 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, createTable) { try_end_1: if (EG(exception)) { - ZEPHIR_INIT_VAR(_6$$5); - ZEPHIR_CPY_WRT(_6$$5, EG(exception)); - if (zephir_instance_of_ev(_6$$5, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_4$$5); + ZVAL_OBJ(&_4$$5, EG(exception)); + Z_ADDREF_P(&_4$$5); + if (zephir_instance_of_ev(&_4$$5, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(exception, _6$$5); + ZEPHIR_CPY_WRT(&exception, &_4$$5); ZEPHIR_CALL_METHOD(NULL, this_ptr, "rollback", NULL, 0); zephir_check_call_status(); - zephir_throw_exception_debug(exception, "phalcon/db/adapter/pdo/postgresql.zep", 319 TSRMLS_CC); + zephir_throw_exception_debug(&exception, "phalcon/db/adapter/pdo/postgresql.zep", 319 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } else { - zephir_array_fetch_long(&_7$$10, queries, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 322 TSRMLS_CC); - ZEPHIR_INIT_VAR(_8$$10); - ZEPHIR_CONCAT_VS(_8$$10, _7$$10, ";"); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, _8$$10); + zephir_array_fetch_long(&_5$$10, &queries, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 322 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$10); + ZEPHIR_CONCAT_VS(&_6$$10, &_5$$10, ";"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, &_6$$10); zephir_check_call_status(); RETURN_MM(); } @@ -449,66 +527,82 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, createTable) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, modifyColumn) { - HashTable *_2$$4; - HashPosition _1$$4; - zephir_fcall_cache_entry *_5 = NULL; + zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *column, *currentColumn = NULL, *sql = NULL, *queries = NULL, *query = NULL, *exception = NULL, *_0, **_3$$4, *_4$$5 = NULL, *_6$$3, *_7$$8 = NULL, *_8$$8, *_9$$8; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null, sql, queries, query, exception, _0, *_1$$4, _2$$5, _4$$3, _5$$8, _6$$8, _7$$8; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(¤tColumn_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&queries); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&exception); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (!currentColumn) { - currentColumn = ZEPHIR_GLOBAL(global_null); + currentColumn = ¤tColumn_sub; + currentColumn = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&sql, _0, "modifycolumn", NULL, 0, tableName, schemaName, column, currentColumn); + zephir_read_property(&_0, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&sql, &_0, "modifycolumn", NULL, 0, &tableName, &schemaName, column, currentColumn); zephir_check_call_status(); - ZEPHIR_INIT_VAR(queries); - zephir_fast_explode_str(queries, SL(";"), sql, LONG_MAX TSRMLS_CC); - if (zephir_fast_count_int(queries TSRMLS_CC) > 1) { + ZEPHIR_INIT_VAR(&queries); + zephir_fast_explode_str(&queries, SL(";"), &sql, LONG_MAX TSRMLS_CC); + if (zephir_fast_count_int(&queries TSRMLS_CC) > 1) { /* try_start_1: */ ZEPHIR_CALL_METHOD(NULL, this_ptr, "begin", NULL, 0); zephir_check_call_status_or_jump(try_end_1); - zephir_is_iterable(queries, &_2$$4, &_1$$4, 0, 0, "phalcon/db/adapter/pdo/postgresql.zep", 347); - for ( - ; zend_hash_get_current_data_ex(_2$$4, (void**) &_3$$4, &_1$$4) == SUCCESS - ; zend_hash_move_forward_ex(_2$$4, &_1$$4) - ) { - ZEPHIR_GET_HVALUE(query, _3$$4); - if (ZEPHIR_IS_EMPTY(query)) { + zephir_is_iterable(&queries, 0, "phalcon/db/adapter/pdo/postgresql.zep", 347); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&queries), _1$$4) + { + ZEPHIR_INIT_NVAR(&query); + ZVAL_COPY(&query, _1$$4); + if (ZEPHIR_IS_EMPTY(&query)) { continue; } - ZEPHIR_INIT_LNVAR(_4$$5); - ZEPHIR_CONCAT_VS(_4$$5, query, ";"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "query", &_5, 0, _4$$5); + ZEPHIR_INIT_LNVAR(_2$$5); + ZEPHIR_CONCAT_VS(&_2$$5, &query, ";"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "query", &_3, 0, &_2$$5); zephir_check_call_status_or_jump(try_end_1); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&query); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "commit", NULL, 0); zephir_check_call_status_or_jump(try_end_1); RETURN_MM(); @@ -516,30 +610,31 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, modifyColumn) { try_end_1: if (EG(exception)) { - ZEPHIR_INIT_VAR(_6$$3); - ZEPHIR_CPY_WRT(_6$$3, EG(exception)); - if (zephir_instance_of_ev(_6$$3, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_OBJ(&_4$$3, EG(exception)); + Z_ADDREF_P(&_4$$3); + if (zephir_instance_of_ev(&_4$$3, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(exception, _6$$3); + ZEPHIR_CPY_WRT(&exception, &_4$$3); ZEPHIR_CALL_METHOD(NULL, this_ptr, "rollback", NULL, 0); zephir_check_call_status(); - zephir_throw_exception_debug(exception, "phalcon/db/adapter/pdo/postgresql.zep", 352 TSRMLS_CC); + zephir_throw_exception_debug(&exception, "phalcon/db/adapter/pdo/postgresql.zep", 352 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } else { - ZEPHIR_INIT_VAR(_7$$8); - if (!(ZEPHIR_IS_EMPTY(sql))) { - zephir_array_fetch_long(&_8$$8, queries, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 356 TSRMLS_CC); - ZEPHIR_INIT_VAR(_9$$8); - ZEPHIR_CONCAT_VS(_9$$8, _8$$8, ";"); - ZEPHIR_CALL_METHOD(&_7$$8, this_ptr, "execute", NULL, 0, _9$$8); + ZEPHIR_INIT_VAR(&_5$$8); + if (!(ZEPHIR_IS_EMPTY(&sql))) { + zephir_array_fetch_long(&_6$$8, &queries, 0, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/postgresql.zep", 356 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_7$$8); + ZEPHIR_CONCAT_VS(&_7$$8, &_6$$8, ";"); + ZEPHIR_CALL_METHOD(&_5$$8, this_ptr, "execute", NULL, 0, &_7$$8); zephir_check_call_status(); } else { - ZVAL_BOOL(_7$$8, 1); + ZVAL_BOOL(&_5$$8, 1); } - RETURN_CCTOR(_7$$8); + RETURN_CCTOR(&_5$$8); } RETURN_MM_BOOL(1); @@ -550,7 +645,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, modifyColumn) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, useExplicitIdValue) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); @@ -578,16 +674,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, useExplicitIdValue) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, getDefaultIdValue) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); object_init_ex(return_value, phalcon_db_rawvalue_ce); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "DEFAULT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 26, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "DEFAULT"); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 21, &_0); zephir_check_call_status(); RETURN_MM(); @@ -598,7 +696,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, getDefaultIdValue) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, supportSequences) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); diff --git a/ext/phalcon/db/adapter/pdo/postgresql.zep.h b/ext/phalcon/db/adapter/pdo/postgresql.zep.h index 692de950d05..dbc1576dd9e 100644 --- a/ext/phalcon/db/adapter/pdo/postgresql.zep.h +++ b/ext/phalcon/db/adapter/pdo/postgresql.zep.h @@ -11,35 +11,96 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, useExplicitIdValue); PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, getDefaultIdValue); PHP_METHOD(Phalcon_Db_Adapter_Pdo_Postgresql, supportSequences); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_connect, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_connect, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_connect, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, descriptor, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_describecolumns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_describecolumns, 0, 1, Phalcon\\Db\\ColumnInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_describecolumns, 0, 1, IS_OBJECT, "Phalcon\\Db\\ColumnInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_createtable, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_createtable, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_createtable, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_modifycolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_modifycolumn, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_modifycolumn, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_ARG_OBJ_INFO(0, currentColumn, Phalcon\\Db\\ColumnInterface, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_useexplicitidvalue, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_useexplicitidvalue, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_getdefaultidvalue, 0, 0, Phalcon\\Db\\RawValue, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_getdefaultidvalue, 0, 0, IS_OBJECT, "Phalcon\\Db\\RawValue", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_supportsequences, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_postgresql_supportsequences, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_db_adapter_pdo_postgresql_method_entry) { PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, connect, arginfo_phalcon_db_adapter_pdo_postgresql_connect, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, describeColumns, arginfo_phalcon_db_adapter_pdo_postgresql_describecolumns, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, createTable, arginfo_phalcon_db_adapter_pdo_postgresql_createtable, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, modifyColumn, arginfo_phalcon_db_adapter_pdo_postgresql_modifycolumn, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, useExplicitIdValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, getDefaultIdValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, supportSequences, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, useExplicitIdValue, arginfo_phalcon_db_adapter_pdo_postgresql_useexplicitidvalue, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, getDefaultIdValue, arginfo_phalcon_db_adapter_pdo_postgresql_getdefaultidvalue, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo_Postgresql, supportSequences, arginfo_phalcon_db_adapter_pdo_postgresql_supportsequences, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/adapter/pdo/sqlite.zep.c b/ext/phalcon/db/adapter/pdo/sqlite.zep.c index 16d884411d6..c42d34cb031 100644 --- a/ext/phalcon/db/adapter/pdo/sqlite.zep.c +++ b/ext/phalcon/db/adapter/pdo/sqlite.zep.c @@ -58,33 +58,39 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, connect) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_2 = NULL; - zval *descriptor_param = NULL, *dbname = NULL, *_0$$3; - zval *descriptor = NULL, *_1$$3 = NULL; + zval *descriptor_param = NULL, dbname, _0$$3; + zval descriptor, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&descriptor); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&dbname); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &descriptor_param); if (!descriptor_param) { - ZEPHIR_INIT_VAR(descriptor); - array_init(descriptor); + ZEPHIR_INIT_VAR(&descriptor); + array_init(&descriptor); } else { - zephir_get_arrval(descriptor, descriptor_param); + zephir_get_arrval(&descriptor, descriptor_param); } - if (ZEPHIR_IS_EMPTY(descriptor)) { - ZEPHIR_OBS_VAR(_0$$3); - zephir_read_property_this(&_0$$3, this_ptr, SL("_descriptor"), PH_NOISY_CC); - zephir_get_arrval(_1$$3, _0$$3); - ZEPHIR_CPY_WRT(descriptor, _1$$3); + if (ZEPHIR_IS_EMPTY(&descriptor)) { + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property(&_0$$3, this_ptr, SL("_descriptor"), PH_NOISY_CC); + zephir_get_arrval(&_1$$3, &_0$$3); + ZEPHIR_CPY_WRT(&descriptor, &_1$$3); } - ZEPHIR_OBS_VAR(dbname); - if (!(zephir_array_isset_string_fetch(&dbname, descriptor, SS("dbname"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&dbname); + if (!(zephir_array_isset_string_fetch(&dbname, &descriptor, SL("dbname"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "dbname must be specified", "phalcon/db/adapter/pdo/sqlite.zep", 68); return; } zephir_array_update_string(&descriptor, SL("dsn"), &dbname, PH_COPY | PH_SEPARATE); - ZEPHIR_RETURN_CALL_PARENT(phalcon_db_adapter_pdo_sqlite_ce, getThis(), "connect", &_2, 168, descriptor); + ZEPHIR_RETURN_CALL_PARENT(phalcon_db_adapter_pdo_sqlite_ce, getThis(), "connect", &_2, 0, &descriptor); zephir_check_call_status(); RETURN_MM(); @@ -101,199 +107,245 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, connect) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) { - zend_bool _7$$3, _36$$3; - HashTable *_5; - HashPosition _4; - zephir_fcall_cache_entry *_35 = NULL, *_42 = NULL, *_44 = NULL; + zend_bool _5$$3, _34$$3; + zephir_fcall_cache_entry *_33 = NULL, *_40 = NULL, *_41 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *columns = NULL, *columnType = NULL, *field = NULL, *definition = NULL, *oldColumn = NULL, *sizePattern = NULL, *matches = NULL, *matchOne = NULL, *matchTwo = NULL, *columnName = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, *_30$$3, *_31$$3, *_32$$3, _33$$3 = zval_used_for_init, *_34$$3 = NULL, *_37$$3, *_43$$3 = NULL, *_8$$4 = NULL, *_9$$4 = NULL, *_10$$5 = NULL, *_11$$5 = NULL, *_12$$6 = NULL, *_13$$6 = NULL, *_14$$6, *_15$$8 = NULL, *_16$$9 = NULL, *_17$$10 = NULL, *_18$$11 = NULL, *_19$$11 = NULL, *_20$$12 = NULL, *_21$$13 = NULL, *_22$$14 = NULL, *_23$$15 = NULL, *_24$$15 = NULL, *_25$$16 = NULL, *_26$$17 = NULL, *_27$$18 = NULL, *_28$$20 = NULL, *_29$$21 = NULL, *_38$$27, *_39$$27 = NULL, *_40$$27 = NULL, *_41$$27 = NULL; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, __$true, columns, columnType, field, definition, oldColumn, sizePattern, matches, matchOne, matchTwo, columnName, _0, _1, _2, _3, *_4, _28$$3, _29$$3, _30$$3, _31$$3, _32$$3, _35$$3, _6$$4, _7$$4, _8$$5, _9$$5, _10$$6, _11$$6, _12$$6, _13$$8, _14$$9, _15$$10, _16$$11, _17$$11, _18$$12, _19$$13, _20$$14, _21$$15, _22$$15, _23$$16, _24$$17, _25$$18, _26$$20, _27$$21, _36$$27, _37$$27, _38$$27, _39$$27; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&columnType); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&oldColumn); + ZVAL_UNDEF(&sizePattern); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&matchOne); + ZVAL_UNDEF(&matchTwo); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_28$$3); + ZVAL_UNDEF(&_29$$3); + ZVAL_UNDEF(&_30$$3); + ZVAL_UNDEF(&_31$$3); + ZVAL_UNDEF(&_32$$3); + ZVAL_UNDEF(&_35$$3); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$6); + ZVAL_UNDEF(&_11$$6); + ZVAL_UNDEF(&_12$$6); + ZVAL_UNDEF(&_13$$8); + ZVAL_UNDEF(&_14$$9); + ZVAL_UNDEF(&_15$$10); + ZVAL_UNDEF(&_16$$11); + ZVAL_UNDEF(&_17$$11); + ZVAL_UNDEF(&_18$$12); + ZVAL_UNDEF(&_19$$13); + ZVAL_UNDEF(&_20$$14); + ZVAL_UNDEF(&_21$$15); + ZVAL_UNDEF(&_22$$15); + ZVAL_UNDEF(&_23$$16); + ZVAL_UNDEF(&_24$$17); + ZVAL_UNDEF(&_25$$18); + ZVAL_UNDEF(&_26$$20); + ZVAL_UNDEF(&_27$$21); + ZVAL_UNDEF(&_36$$27); + ZVAL_UNDEF(&_37$$27); + ZVAL_UNDEF(&_38$$27); + ZVAL_UNDEF(&_39$$27); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(oldColumn); - ZVAL_NULL(oldColumn); - ZEPHIR_INIT_VAR(sizePattern); - ZVAL_STRING(sizePattern, "#\\(([0-9]+)(?:,\\s*([0-9]+))*\\)#", 1); - ZEPHIR_INIT_VAR(columns); - array_init(columns); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "describecolumns", NULL, 0, table, schema); + ZEPHIR_INIT_VAR(&oldColumn); + ZVAL_NULL(&oldColumn); + ZEPHIR_INIT_VAR(&sizePattern); + ZVAL_STRING(&sizePattern, "#\\(([0-9]+)(?:,\\s*([0-9]+))*\\)#"); + ZEPHIR_INIT_VAR(&columns); + array_init(&columns); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "describecolumns", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 252); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(field, _6); - ZEPHIR_INIT_NVAR(definition); - zephir_create_array(definition, 1, 0 TSRMLS_CC); - add_assoc_long_ex(definition, SS("bindType"), 2); - ZEPHIR_OBS_NVAR(columnType); - zephir_array_fetch_long(&columnType, field, 2, PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 108 TSRMLS_CC); - _7$$3 = zephir_memnstr_str(columnType, SL("int"), "phalcon/db/adapter/pdo/sqlite.zep", 124); - if (!(_7$$3)) { - _7$$3 = zephir_memnstr_str(columnType, SL("INT"), "phalcon/db/adapter/pdo/sqlite.zep", 124); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 252); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _4); + ZEPHIR_INIT_NVAR(&definition); + zephir_create_array(&definition, 1, 0 TSRMLS_CC); + add_assoc_long_ex(&definition, SL("bindType"), 2); + ZEPHIR_OBS_NVAR(&columnType); + zephir_array_fetch_long(&columnType, &field, 2, PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 108 TSRMLS_CC); + _5$$3 = zephir_memnstr_str(&columnType, SL("int"), "phalcon/db/adapter/pdo/sqlite.zep", 124); + if (!(_5$$3)) { + _5$$3 = zephir_memnstr_str(&columnType, SL("INT"), "phalcon/db/adapter/pdo/sqlite.zep", 124); } - if (zephir_memnstr_str(columnType, SL("tinyint(1)"), "phalcon/db/adapter/pdo/sqlite.zep", 110)) { - ZEPHIR_INIT_NVAR(_8$$4); - ZVAL_LONG(_8$$4, 8); - zephir_array_update_string(&definition, SL("type"), &_8$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_9$$4); - ZVAL_LONG(_9$$4, 5); - zephir_array_update_string(&definition, SL("bindType"), &_9$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(columnType); - ZVAL_STRING(columnType, "boolean", 1); - } else if (zephir_memnstr_str(columnType, SL("bigint"), "phalcon/db/adapter/pdo/sqlite.zep", 117)) { - ZEPHIR_INIT_NVAR(_10$$5); - ZVAL_LONG(_10$$5, 14); - zephir_array_update_string(&definition, SL("type"), &_10$$5, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_11$$5); - ZVAL_LONG(_11$$5, 1); - zephir_array_update_string(&definition, SL("bindType"), &_11$$5, PH_COPY | PH_SEPARATE); - } else if (_7$$3) { - ZEPHIR_INIT_NVAR(_12$$6); - ZVAL_LONG(_12$$6, 0); - zephir_array_update_string(&definition, SL("type"), &_12$$6, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_13$$6); - ZVAL_LONG(_13$$6, 1); - zephir_array_update_string(&definition, SL("bindType"), &_13$$6, PH_COPY | PH_SEPARATE); - zephir_array_fetch_long(&_14$$6, field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 132 TSRMLS_CC); - if (zephir_is_true(_14$$6)) { - zephir_array_update_string(&definition, SL("autoIncrement"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (zephir_memnstr_str(&columnType, SL("tinyint(1)"), "phalcon/db/adapter/pdo/sqlite.zep", 110)) { + ZEPHIR_INIT_NVAR(&_6$$4); + ZVAL_LONG(&_6$$4, 8); + zephir_array_update_string(&definition, SL("type"), &_6$$4, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_7$$4); + ZVAL_LONG(&_7$$4, 5); + zephir_array_update_string(&definition, SL("bindType"), &_7$$4, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&columnType); + ZVAL_STRING(&columnType, "boolean"); + } else if (zephir_memnstr_str(&columnType, SL("bigint"), "phalcon/db/adapter/pdo/sqlite.zep", 117)) { + ZEPHIR_INIT_NVAR(&_8$$5); + ZVAL_LONG(&_8$$5, 14); + zephir_array_update_string(&definition, SL("type"), &_8$$5, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_9$$5); + ZVAL_LONG(&_9$$5, 1); + zephir_array_update_string(&definition, SL("bindType"), &_9$$5, PH_COPY | PH_SEPARATE); + } else if (_5$$3) { + ZEPHIR_INIT_NVAR(&_10$$6); + ZVAL_LONG(&_10$$6, 0); + zephir_array_update_string(&definition, SL("type"), &_10$$6, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_11$$6); + ZVAL_LONG(&_11$$6, 1); + zephir_array_update_string(&definition, SL("bindType"), &_11$$6, PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_12$$6, &field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 132 TSRMLS_CC); + if (zephir_is_true(&_12$$6)) { + zephir_array_update_string(&definition, SL("autoIncrement"), &__$true, PH_COPY | PH_SEPARATE); } - } else if (zephir_memnstr_str(columnType, SL("varchar"), "phalcon/db/adapter/pdo/sqlite.zep", 135)) { - ZEPHIR_INIT_NVAR(_15$$8); - ZVAL_LONG(_15$$8, 2); - zephir_array_update_string(&definition, SL("type"), &_15$$8, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("date"), "phalcon/db/adapter/pdo/sqlite.zep", 140)) { - ZEPHIR_INIT_NVAR(_16$$9); - ZVAL_LONG(_16$$9, 1); - zephir_array_update_string(&definition, SL("type"), &_16$$9, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("timestamp"), "phalcon/db/adapter/pdo/sqlite.zep", 145)) { - ZEPHIR_INIT_NVAR(_17$$10); - ZVAL_LONG(_17$$10, 17); - zephir_array_update_string(&definition, SL("type"), &_17$$10, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("decimal"), "phalcon/db/adapter/pdo/sqlite.zep", 150)) { - ZEPHIR_INIT_NVAR(_18$$11); - ZVAL_LONG(_18$$11, 3); - zephir_array_update_string(&definition, SL("type"), &_18$$11, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_19$$11); - ZVAL_LONG(_19$$11, 32); - zephir_array_update_string(&definition, SL("bindType"), &_19$$11, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("char"), "phalcon/db/adapter/pdo/sqlite.zep", 157)) { - ZEPHIR_INIT_NVAR(_20$$12); - ZVAL_LONG(_20$$12, 5); - zephir_array_update_string(&definition, SL("type"), &_20$$12, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("datetime"), "phalcon/db/adapter/pdo/sqlite.zep", 162)) { - ZEPHIR_INIT_NVAR(_21$$13); - ZVAL_LONG(_21$$13, 4); - zephir_array_update_string(&definition, SL("type"), &_21$$13, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("text"), "phalcon/db/adapter/pdo/sqlite.zep", 167)) { - ZEPHIR_INIT_NVAR(_22$$14); - ZVAL_LONG(_22$$14, 6); - zephir_array_update_string(&definition, SL("type"), &_22$$14, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("float"), "phalcon/db/adapter/pdo/sqlite.zep", 172)) { - ZEPHIR_INIT_NVAR(_23$$15); - ZVAL_LONG(_23$$15, 7); - zephir_array_update_string(&definition, SL("type"), &_23$$15, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&definition, SL("isNumeric"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_24$$15); - ZVAL_LONG(_24$$15, 3); - zephir_array_update_string(&definition, SL("bindType"), &_24$$15, PH_COPY | PH_SEPARATE); - } else if (zephir_memnstr_str(columnType, SL("enum"), "phalcon/db/adapter/pdo/sqlite.zep", 179)) { - ZEPHIR_INIT_NVAR(_25$$16); - ZVAL_LONG(_25$$16, 5); - zephir_array_update_string(&definition, SL("type"), &_25$$16, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("varchar"), "phalcon/db/adapter/pdo/sqlite.zep", 135)) { + ZEPHIR_INIT_NVAR(&_13$$8); + ZVAL_LONG(&_13$$8, 2); + zephir_array_update_string(&definition, SL("type"), &_13$$8, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("date"), "phalcon/db/adapter/pdo/sqlite.zep", 140)) { + ZEPHIR_INIT_NVAR(&_14$$9); + ZVAL_LONG(&_14$$9, 1); + zephir_array_update_string(&definition, SL("type"), &_14$$9, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("timestamp"), "phalcon/db/adapter/pdo/sqlite.zep", 145)) { + ZEPHIR_INIT_NVAR(&_15$$10); + ZVAL_LONG(&_15$$10, 17); + zephir_array_update_string(&definition, SL("type"), &_15$$10, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("decimal"), "phalcon/db/adapter/pdo/sqlite.zep", 150)) { + ZEPHIR_INIT_NVAR(&_16$$11); + ZVAL_LONG(&_16$$11, 3); + zephir_array_update_string(&definition, SL("type"), &_16$$11, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_17$$11); + ZVAL_LONG(&_17$$11, 32); + zephir_array_update_string(&definition, SL("bindType"), &_17$$11, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("char"), "phalcon/db/adapter/pdo/sqlite.zep", 157)) { + ZEPHIR_INIT_NVAR(&_18$$12); + ZVAL_LONG(&_18$$12, 5); + zephir_array_update_string(&definition, SL("type"), &_18$$12, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("datetime"), "phalcon/db/adapter/pdo/sqlite.zep", 162)) { + ZEPHIR_INIT_NVAR(&_19$$13); + ZVAL_LONG(&_19$$13, 4); + zephir_array_update_string(&definition, SL("type"), &_19$$13, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("text"), "phalcon/db/adapter/pdo/sqlite.zep", 167)) { + ZEPHIR_INIT_NVAR(&_20$$14); + ZVAL_LONG(&_20$$14, 6); + zephir_array_update_string(&definition, SL("type"), &_20$$14, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("float"), "phalcon/db/adapter/pdo/sqlite.zep", 172)) { + ZEPHIR_INIT_NVAR(&_21$$15); + ZVAL_LONG(&_21$$15, 7); + zephir_array_update_string(&definition, SL("type"), &_21$$15, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("isNumeric"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_22$$15); + ZVAL_LONG(&_22$$15, 3); + zephir_array_update_string(&definition, SL("bindType"), &_22$$15, PH_COPY | PH_SEPARATE); + } else if (zephir_memnstr_str(&columnType, SL("enum"), "phalcon/db/adapter/pdo/sqlite.zep", 179)) { + ZEPHIR_INIT_NVAR(&_23$$16); + ZVAL_LONG(&_23$$16, 5); + zephir_array_update_string(&definition, SL("type"), &_23$$16, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(_26$$17); - ZVAL_LONG(_26$$17, 2); - zephir_array_update_string(&definition, SL("type"), &_26$$17, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_24$$17); + ZVAL_LONG(&_24$$17, 2); + zephir_array_update_string(&definition, SL("type"), &_24$$17, PH_COPY | PH_SEPARATE); } - if (zephir_memnstr_str(columnType, SL("("), "phalcon/db/adapter/pdo/sqlite.zep", 194)) { - ZEPHIR_INIT_NVAR(matches); - ZVAL_NULL(matches); - ZEPHIR_INIT_NVAR(_27$$18); - zephir_preg_match(_27$$18, sizePattern, columnType, matches, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(_27$$18)) { - ZEPHIR_OBS_NVAR(matchOne); - if (zephir_array_isset_long_fetch(&matchOne, matches, 1, 0 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_28$$20); - ZVAL_LONG(_28$$20, zephir_get_intval(matchOne)); - zephir_array_update_string(&definition, SL("size"), &_28$$20, PH_COPY | PH_SEPARATE); + if (zephir_memnstr_str(&columnType, SL("("), "phalcon/db/adapter/pdo/sqlite.zep", 194)) { + ZEPHIR_INIT_NVAR(&matches); + ZVAL_NULL(&matches); + ZEPHIR_INIT_NVAR(&_25$$18); + zephir_preg_match(&_25$$18, &sizePattern, &columnType, &matches, 0, 0 , 0 TSRMLS_CC); + if (zephir_is_true(&_25$$18)) { + ZEPHIR_OBS_NVAR(&matchOne); + if (zephir_array_isset_long_fetch(&matchOne, &matches, 1, 0 TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_26$$20); + ZVAL_LONG(&_26$$20, zephir_get_intval(&matchOne)); + zephir_array_update_string(&definition, SL("size"), &_26$$20, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_NVAR(matchTwo); - if (zephir_array_isset_long_fetch(&matchTwo, matches, 2, 0 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_29$$21); - ZVAL_LONG(_29$$21, zephir_get_intval(matchTwo)); - zephir_array_update_string(&definition, SL("scale"), &_29$$21, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&matchTwo); + if (zephir_array_isset_long_fetch(&matchTwo, &matches, 2, 0 TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_27$$21); + ZVAL_LONG(&_27$$21, zephir_get_intval(&matchTwo)); + zephir_array_update_string(&definition, SL("scale"), &_27$$21, PH_COPY | PH_SEPARATE); } } } - if (zephir_memnstr_str(columnType, SL("unsigned"), "phalcon/db/adapter/pdo/sqlite.zep", 209)) { - zephir_array_update_string(&definition, SL("unsigned"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (zephir_memnstr_str(&columnType, SL("unsigned"), "phalcon/db/adapter/pdo/sqlite.zep", 209)) { + zephir_array_update_string(&definition, SL("unsigned"), &__$true, PH_COPY | PH_SEPARATE); } - if (Z_TYPE_P(oldColumn) == IS_NULL) { - zephir_array_update_string(&definition, SL("first"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&oldColumn) == IS_NULL) { + zephir_array_update_string(&definition, SL("first"), &__$true, PH_COPY | PH_SEPARATE); } else { zephir_array_update_string(&definition, SL("after"), &oldColumn, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_30$$3, field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 225 TSRMLS_CC); - if (zephir_is_true(_30$$3)) { - zephir_array_update_string(&definition, SL("primary"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_28$$3, &field, 5, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 225 TSRMLS_CC); + if (zephir_is_true(&_28$$3)) { + zephir_array_update_string(&definition, SL("primary"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_31$$3, field, 3, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 232 TSRMLS_CC); - if (zephir_is_true(_31$$3)) { - zephir_array_update_string(&definition, SL("notNull"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_29$$3, &field, 3, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 232 TSRMLS_CC); + if (zephir_is_true(&_29$$3)) { + zephir_array_update_string(&definition, SL("notNull"), &__$true, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&_32$$3, field, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 240 TSRMLS_CC); - ZEPHIR_SINIT_NVAR(_33$$3); - ZVAL_STRING(&_33$$3, "null", 0); - ZEPHIR_CALL_FUNCTION(&_34$$3, "strcasecmp", &_35, 16, _32$$3, &_33$$3); + zephir_array_fetch_long(&_30$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 240 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_31$$3); + ZVAL_STRING(&_31$$3, "null"); + ZEPHIR_CALL_FUNCTION(&_32$$3, "strcasecmp", &_33, 11, &_30$$3, &_31$$3); zephir_check_call_status(); - _36$$3 = !ZEPHIR_IS_LONG(_34$$3, 0); - if (_36$$3) { - zephir_array_fetch_long(&_37$$3, field, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 240 TSRMLS_CC); - _36$$3 = !ZEPHIR_IS_STRING(_37$$3, ""); + _34$$3 = !ZEPHIR_IS_LONG(&_32$$3, 0); + if (_34$$3) { + zephir_array_fetch_long(&_35$$3, &field, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 240 TSRMLS_CC); + _34$$3 = !ZEPHIR_IS_STRING(&_35$$3, ""); } - if (_36$$3) { - zephir_array_fetch_long(&_38$$27, field, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 241 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_39$$27); - ZVAL_STRING(_39$$27, "/^'|'$/", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_40$$27); - ZVAL_STRING(_40$$27, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_41$$27, "preg_replace", &_42, 42, _39$$27, _40$$27, _38$$27); - zephir_check_temp_parameter(_39$$27); - zephir_check_temp_parameter(_40$$27); + if (_34$$3) { + zephir_array_fetch_long(&_36$$27, &field, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 241 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_37$$27); + ZVAL_STRING(&_37$$27, "/^'|'$/"); + ZEPHIR_INIT_NVAR(&_38$$27); + ZVAL_STRING(&_38$$27, ""); + ZEPHIR_CALL_FUNCTION(&_39$$27, "preg_replace", &_40, 35, &_37$$27, &_38$$27, &_36$$27); zephir_check_call_status(); - zephir_array_update_string(&definition, SL("default"), &_41$$27, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&definition, SL("default"), &_39$$27, PH_COPY | PH_SEPARATE); } - zephir_array_fetch_long(&columnName, field, 1, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 247 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_43$$3); - object_init_ex(_43$$3, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, _43$$3, "__construct", &_44, 167, columnName, definition); + zephir_array_fetch_long(&columnName, &field, 1, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 247 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_31$$3); + object_init_ex(&_31$$3, phalcon_db_column_ce); + ZEPHIR_CALL_METHOD(NULL, &_31$$3, "__construct", &_41, 148, &columnName, &definition); zephir_check_call_status(); - zephir_array_append(&columns, _43$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/sqlite.zep", 248); - ZEPHIR_CPY_WRT(oldColumn, columnName); - } - RETURN_CCTOR(columns); + zephir_array_append(&columns, &_31$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/sqlite.zep", 248); + ZEPHIR_CPY_WRT(&oldColumn, &columnName); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + RETURN_CCTOR(&columns); } @@ -312,125 +364,167 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) { - HashTable *_5, *_28, *_15$$3; - HashPosition _4, _27, _14$$3; - zephir_fcall_cache_entry *_20 = NULL, *_33 = NULL; + zend_string *_25; + zend_ulong _24; + zephir_fcall_cache_entry *_15 = NULL, *_29 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *indexes = NULL, *index = NULL, *keyName = NULL, *indexObjects = NULL, *name = NULL, *columns = NULL, *describeIndex = NULL, *indexSql = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, **_29, *_7$$4 = NULL, *_8$$3, *_10$$3 = NULL, *_11$$3, *_12$$3 = NULL, *_13$$3 = NULL, **_16$$3, *_18$$3, *_19$$3 = NULL, *_21$$3, *_9$$6, *_17$$7, *_22$$8 = NULL, *_23$$8 = NULL, _24$$8 = zval_used_for_init, *_25$$9 = NULL, *_26$$10 = NULL, *_30$$12 = NULL, *_31$$12, *_32$$12; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, __$null, indexes, index, keyName, indexObjects, name, columns, describeIndex, indexSql, _0, _1, _2, _3, *_4, *_23, _5$$4, _6$$3, _8$$3, _9$$3, _10$$3, _11$$3, *_12$$3, _14$$3, _16$$3, _7$$6, _13$$7, _17$$8, _18$$8, _19$$8, _20$$8, _21$$9, _22$$10, _26$$12, _27$$12, _28$$12; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&indexes); + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&indexObjects); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&describeIndex); + ZVAL_UNDEF(&indexSql); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_8$$3); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_10$$3); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_14$$3); + ZVAL_UNDEF(&_16$$3); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_13$$7); + ZVAL_UNDEF(&_17$$8); + ZVAL_UNDEF(&_18$$8); + ZVAL_UNDEF(&_19$$8); + ZVAL_UNDEF(&_20$$8); + ZVAL_UNDEF(&_21$$9); + ZVAL_UNDEF(&_22$$10); + ZVAL_UNDEF(&_26$$12); + ZVAL_UNDEF(&_27$$12); + ZVAL_UNDEF(&_28$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(indexes); - array_init(indexes); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "describeindexes", NULL, 0, table, schema); + ZEPHIR_INIT_VAR(&indexes); + array_init(&indexes); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "describeindexes", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 2); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 2); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 304); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(index, _6); - ZEPHIR_OBS_NVAR(keyName); - zephir_array_fetch_string(&keyName, index, SL("name"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 274 TSRMLS_CC); - if (!(zephir_array_isset(indexes, keyName))) { - ZEPHIR_INIT_NVAR(_7$$4); - array_init(_7$$4); - zephir_array_update_zval(&indexes, keyName, &_7$$4, PH_COPY | PH_SEPARATE); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 304); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _4) + { + ZEPHIR_INIT_NVAR(&index); + ZVAL_COPY(&index, _4); + ZEPHIR_OBS_NVAR(&keyName); + zephir_array_fetch_string(&keyName, &index, SL("name"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 274 TSRMLS_CC); + if (!(zephir_array_isset(&indexes, &keyName))) { + ZEPHIR_INIT_NVAR(&_5$$4); + array_init(&_5$$4); + zephir_array_update_zval(&indexes, &keyName, &_5$$4, PH_COPY | PH_SEPARATE); } - zephir_array_fetch(&_8$$3, indexes, keyName, PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 280 TSRMLS_CC); - if (!(zephir_array_isset_string(_8$$3, SS("columns")))) { - ZEPHIR_INIT_NVAR(columns); - array_init(columns); + zephir_array_fetch(&_6$$3, &indexes, &keyName, PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 280 TSRMLS_CC); + if (!(zephir_array_isset_string(&_6$$3, SL("columns")))) { + ZEPHIR_INIT_NVAR(&columns); + array_init(&columns); } else { - zephir_array_fetch(&_9$$6, indexes, keyName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 283 TSRMLS_CC); - ZEPHIR_OBS_NVAR(columns); - zephir_array_fetch_string(&columns, _9$$6, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 283 TSRMLS_CC); + zephir_array_fetch(&_7$$6, &indexes, &keyName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 283 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&columns); + zephir_array_fetch_string(&columns, &_7$$6, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 283 TSRMLS_CC); } - _11$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_12$$3, _11$$3, "describeindex", NULL, 0, keyName); + zephir_read_property(&_9$$3, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_10$$3, &_9$$3, "describeindex", NULL, 0, &keyName); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_13$$3); - ZVAL_LONG(_13$$3, 2); - ZEPHIR_CALL_METHOD(&_10$$3, this_ptr, "fetchall", NULL, 0, _12$$3, _13$$3); + ZVAL_LONG(&_11$$3, 2); + ZEPHIR_CALL_METHOD(&_8$$3, this_ptr, "fetchall", NULL, 0, &_10$$3, &_11$$3); zephir_check_call_status(); - zephir_is_iterable(_10$$3, &_15$$3, &_14$$3, 0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 290); - for ( - ; zend_hash_get_current_data_ex(_15$$3, (void**) &_16$$3, &_14$$3) == SUCCESS - ; zend_hash_move_forward_ex(_15$$3, &_14$$3) - ) { - ZEPHIR_GET_HVALUE(describeIndex, _16$$3); - zephir_array_fetch_string(&_17$$7, describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 287 TSRMLS_CC); - zephir_array_append(&columns, _17$$7, PH_SEPARATE, "phalcon/db/adapter/pdo/sqlite.zep", 287); - } - zephir_array_update_multi(&indexes, &columns TSRMLS_CC, SL("zs"), 3, keyName, SL("columns")); - _18$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_19$$3, _18$$3, "listindexessql", NULL, 0, table, schema, keyName); + zephir_is_iterable(&_8$$3, 0, "phalcon/db/adapter/pdo/sqlite.zep", 290); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_8$$3), _12$$3) + { + ZEPHIR_INIT_NVAR(&describeIndex); + ZVAL_COPY(&describeIndex, _12$$3); + zephir_array_fetch_string(&_13$$7, &describeIndex, SL("name"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 287 TSRMLS_CC); + zephir_array_append(&columns, &_13$$7, PH_SEPARATE, "phalcon/db/adapter/pdo/sqlite.zep", 287); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&describeIndex); + zephir_array_update_multi(&indexes, &columns TSRMLS_CC, SL("zs"), 3, &keyName, SL("columns")); + zephir_read_property(&_11$$3, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_14$$3, &_11$$3, "listindexessql", NULL, 0, &table, &schema, &keyName); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&indexSql, this_ptr, "fetchcolumn", &_20, 0, _19$$3); + ZEPHIR_CALL_METHOD(&indexSql, this_ptr, "fetchcolumn", &_15, 0, &_14$$3); zephir_check_call_status(); - zephir_array_fetch_string(&_21$$3, index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 293 TSRMLS_CC); - if (zephir_is_true(_21$$3)) { - ZEPHIR_INIT_NVAR(_22$$8); - ZEPHIR_INIT_NVAR(_23$$8); - ZEPHIR_SINIT_NVAR(_24$$8); - ZVAL_STRING(&_24$$8, "# UNIQUE #i", 0); - zephir_preg_match(_23$$8, &_24$$8, indexSql, _22$$8, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(_23$$8)) { - ZEPHIR_INIT_NVAR(_25$$9); - ZVAL_STRING(_25$$9, "UNIQUE", 1); - zephir_array_update_multi(&indexes, &_25$$9 TSRMLS_CC, SL("zs"), 3, keyName, SL("type")); + zephir_array_fetch_string(&_16$$3, &index, SL("unique"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 293 TSRMLS_CC); + if (zephir_is_true(&_16$$3)) { + ZEPHIR_INIT_NVAR(&_17$$8); + ZEPHIR_INIT_NVAR(&_18$$8); + ZVAL_STRING(&_18$$8, "# UNIQUE #i"); + ZEPHIR_INIT_NVAR(&_19$$8); + ZEPHIR_INIT_NVAR(&_20$$8); + ZVAL_STRING(&_20$$8, "# UNIQUE #i"); + zephir_preg_match(&_19$$8, &_20$$8, &indexSql, &_17$$8, 0, 0 , 0 TSRMLS_CC); + if (zephir_is_true(&_19$$8)) { + ZEPHIR_INIT_NVAR(&_21$$9); + ZVAL_STRING(&_21$$9, "UNIQUE"); + zephir_array_update_multi(&indexes, &_21$$9 TSRMLS_CC, SL("zs"), 3, &keyName, SL("type")); } else { - ZEPHIR_INIT_NVAR(_26$$10); - ZVAL_STRING(_26$$10, "PRIMARY", 1); - zephir_array_update_multi(&indexes, &_26$$10 TSRMLS_CC, SL("zs"), 3, keyName, SL("type")); + ZEPHIR_INIT_NVAR(&_22$$10); + ZVAL_STRING(&_22$$10, "PRIMARY"); + zephir_array_update_multi(&indexes, &_22$$10 TSRMLS_CC, SL("zs"), 3, &keyName, SL("type")); } } else { - zephir_array_update_multi(&indexes, &ZEPHIR_GLOBAL(global_null) TSRMLS_CC, SL("zs"), 3, keyName, SL("type")); + zephir_array_update_multi(&indexes, &__$null TSRMLS_CC, SL("zs"), 3, &keyName, SL("type")); } - } - ZEPHIR_INIT_VAR(indexObjects); - array_init(indexObjects); - zephir_is_iterable(indexes, &_28, &_27, 0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 309); - for ( - ; zend_hash_get_current_data_ex(_28, (void**) &_29, &_27) == SUCCESS - ; zend_hash_move_forward_ex(_28, &_27) - ) { - ZEPHIR_GET_HMKEY(name, _28, _27); - ZEPHIR_GET_HVALUE(index, _29); - ZEPHIR_INIT_NVAR(_30$$12); - object_init_ex(_30$$12, phalcon_db_index_ce); - zephir_array_fetch_string(&_31$$12, index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 306 TSRMLS_CC); - zephir_array_fetch_string(&_32$$12, index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 306 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, _30$$12, "__construct", &_33, 24, name, _31$$12, _32$$12); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&index); + ZEPHIR_INIT_VAR(&indexObjects); + array_init(&indexObjects); + zephir_is_iterable(&indexes, 0, "phalcon/db/adapter/pdo/sqlite.zep", 309); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&indexes), _24, _25, _23) + { + ZEPHIR_INIT_NVAR(&name); + if (_25 != NULL) { + ZVAL_STR_COPY(&name, _25); + } else { + ZVAL_LONG(&name, _24); + } + ZEPHIR_INIT_NVAR(&index); + ZVAL_COPY(&index, _23); + ZEPHIR_INIT_NVAR(&_26$$12); + object_init_ex(&_26$$12, phalcon_db_index_ce); + zephir_array_fetch_string(&_27$$12, &index, SL("columns"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 306 TSRMLS_CC); + zephir_array_fetch_string(&_28$$12, &index, SL("type"), PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 306 TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &_26$$12, "__construct", &_29, 19, &name, &_27$$12, &_28$$12); zephir_check_call_status(); - zephir_array_update_zval(&indexObjects, name, &_30$$12, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(indexObjects); + zephir_array_update_zval(&indexObjects, &name, &_26$$12, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&index); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&indexObjects); } @@ -443,118 +537,158 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) { - zval *_13$$3 = NULL, *_18$$6 = NULL; - HashTable *_5, *_15; - HashPosition _4, _14; + zval _13$$3, _18$$6; + zend_string *_6, *_16; + zend_ulong _5, _15; zephir_fcall_cache_entry *_20 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *references = NULL, *reference = NULL, *arrayReference = NULL, *constraintName = NULL, *referenceObjects = NULL, *name = NULL, *referencedSchema = NULL, *referencedTable = NULL, *columns = NULL, *referencedColumns = NULL, *number = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, **_6, **_16, *_7$$5, *_8$$5, *_9$$5, *_10$$5, *_11$$3, *_12$$3, *_17$$6 = NULL, *_19$$6 = NULL; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, references, reference, arrayReference, constraintName, referenceObjects, name, referencedSchema, referencedTable, columns, referencedColumns, number, _0, _1, _2, _3, *_4, *_14, _7$$5, _8$$5, _9$$5, _10$$5, _11$$3, _12$$3, _17$$6, _19$$6; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&references); + ZVAL_UNDEF(&reference); + ZVAL_UNDEF(&arrayReference); + ZVAL_UNDEF(&constraintName); + ZVAL_UNDEF(&referenceObjects); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&referencedSchema); + ZVAL_UNDEF(&referencedTable); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&referencedColumns); + ZVAL_UNDEF(&number); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_17$$6); + ZVAL_UNDEF(&_19$$6); + ZVAL_UNDEF(&_13$$3); + ZVAL_UNDEF(&_18$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(references); - array_init(references); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dialect"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "describereferences", NULL, 0, table, schema); + ZEPHIR_INIT_VAR(&references); + array_init(&references); + zephir_read_property(&_1, this_ptr, SL("_dialect"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "describereferences", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 3); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, _2, _3); + ZVAL_LONG(&_3, 3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "fetchall", NULL, 0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_0, &_5, &_4, 0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 354); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HMKEY(number, _5, _4); - ZEPHIR_GET_HVALUE(reference, _6); - ZEPHIR_INIT_NVAR(constraintName); - ZEPHIR_CONCAT_SV(constraintName, "foreign_key_", number); - if (!(zephir_array_isset(references, constraintName))) { - ZEPHIR_INIT_NVAR(referencedSchema); - ZVAL_NULL(referencedSchema); - ZEPHIR_OBS_NVAR(referencedTable); - zephir_array_fetch_long(&referencedTable, reference, 2, PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 333 TSRMLS_CC); - ZEPHIR_INIT_NVAR(columns); - array_init(columns); - ZEPHIR_INIT_NVAR(referencedColumns); - array_init(referencedColumns); + zephir_is_iterable(&_0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 354); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _5, _6, _4) + { + ZEPHIR_INIT_NVAR(&number); + if (_6 != NULL) { + ZVAL_STR_COPY(&number, _6); } else { - zephir_array_fetch(&_7$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 337 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedSchema); - zephir_array_fetch_string(&referencedSchema, _7$$5, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 337 TSRMLS_CC); - zephir_array_fetch(&_8$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 338 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedTable); - zephir_array_fetch_string(&referencedTable, _8$$5, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 338 TSRMLS_CC); - zephir_array_fetch(&_9$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 339 TSRMLS_CC); - ZEPHIR_OBS_NVAR(columns); - zephir_array_fetch_string(&columns, _9$$5, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 339 TSRMLS_CC); - zephir_array_fetch(&_10$$5, references, constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 340 TSRMLS_CC); - ZEPHIR_OBS_NVAR(referencedColumns); - zephir_array_fetch_string(&referencedColumns, _10$$5, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 340 TSRMLS_CC); + ZVAL_LONG(&number, _5); } - zephir_array_fetch_long(&_11$$3, reference, 3, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 343 TSRMLS_CC); - zephir_array_append(&columns, _11$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/sqlite.zep", 343); - zephir_array_fetch_long(&_12$$3, reference, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 344 TSRMLS_CC); - zephir_array_append(&referencedColumns, _12$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/sqlite.zep", 344); - ZEPHIR_INIT_NVAR(_13$$3); - zephir_create_array(_13$$3, 4, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&reference); + ZVAL_COPY(&reference, _4); + ZEPHIR_INIT_NVAR(&constraintName); + ZEPHIR_CONCAT_SV(&constraintName, "foreign_key_", &number); + if (!(zephir_array_isset(&references, &constraintName))) { + ZEPHIR_INIT_NVAR(&referencedSchema); + ZVAL_NULL(&referencedSchema); + ZEPHIR_OBS_NVAR(&referencedTable); + zephir_array_fetch_long(&referencedTable, &reference, 2, PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 333 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&columns); + array_init(&columns); + ZEPHIR_INIT_NVAR(&referencedColumns); + array_init(&referencedColumns); + } else { + zephir_array_fetch(&_7$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 337 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedSchema); + zephir_array_fetch_string(&referencedSchema, &_7$$5, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 337 TSRMLS_CC); + zephir_array_fetch(&_8$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 338 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedTable); + zephir_array_fetch_string(&referencedTable, &_8$$5, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 338 TSRMLS_CC); + zephir_array_fetch(&_9$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 339 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&columns); + zephir_array_fetch_string(&columns, &_9$$5, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 339 TSRMLS_CC); + zephir_array_fetch(&_10$$5, &references, &constraintName, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 340 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&referencedColumns); + zephir_array_fetch_string(&referencedColumns, &_10$$5, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 340 TSRMLS_CC); + } + zephir_array_fetch_long(&_11$$3, &reference, 3, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 343 TSRMLS_CC); + zephir_array_append(&columns, &_11$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/sqlite.zep", 343); + zephir_array_fetch_long(&_12$$3, &reference, 4, PH_NOISY | PH_READONLY, "phalcon/db/adapter/pdo/sqlite.zep", 344 TSRMLS_CC); + zephir_array_append(&referencedColumns, &_12$$3, PH_SEPARATE, "phalcon/db/adapter/pdo/sqlite.zep", 344); + ZEPHIR_INIT_NVAR(&_13$$3); + zephir_create_array(&_13$$3, 4, 0 TSRMLS_CC); zephir_array_update_string(&_13$$3, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_13$$3, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_13$$3, SL("columns"), &columns, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_13$$3, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&references, constraintName, &_13$$3, PH_COPY | PH_SEPARATE); - } - ZEPHIR_INIT_VAR(referenceObjects); - array_init(referenceObjects); - zephir_is_iterable(references, &_15, &_14, 0, 0, "phalcon/db/adapter/pdo/sqlite.zep", 364); - for ( - ; zend_hash_get_current_data_ex(_15, (void**) &_16, &_14) == SUCCESS - ; zend_hash_move_forward_ex(_15, &_14) - ) { - ZEPHIR_GET_HMKEY(name, _15, _14); - ZEPHIR_GET_HVALUE(arrayReference, _16); - ZEPHIR_INIT_NVAR(_17$$6); - object_init_ex(_17$$6, phalcon_db_reference_ce); - ZEPHIR_INIT_NVAR(_18$$6); - zephir_create_array(_18$$6, 4, 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(_19$$6); - zephir_array_fetch_string(&_19$$6, arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 357 TSRMLS_CC); + zephir_array_update_zval(&references, &constraintName, &_13$$3, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&reference); + ZEPHIR_INIT_NVAR(&number); + ZEPHIR_INIT_VAR(&referenceObjects); + array_init(&referenceObjects); + zephir_is_iterable(&references, 0, "phalcon/db/adapter/pdo/sqlite.zep", 364); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&references), _15, _16, _14) + { + ZEPHIR_INIT_NVAR(&name); + if (_16 != NULL) { + ZVAL_STR_COPY(&name, _16); + } else { + ZVAL_LONG(&name, _15); + } + ZEPHIR_INIT_NVAR(&arrayReference); + ZVAL_COPY(&arrayReference, _14); + ZEPHIR_INIT_NVAR(&_17$$6); + object_init_ex(&_17$$6, phalcon_db_reference_ce); + ZEPHIR_INIT_NVAR(&_18$$6); + zephir_create_array(&_18$$6, 4, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("referencedSchema"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 357 TSRMLS_CC); zephir_array_update_string(&_18$$6, SL("referencedSchema"), &_19$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_19$$6); - zephir_array_fetch_string(&_19$$6, arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 358 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("referencedTable"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 358 TSRMLS_CC); zephir_array_update_string(&_18$$6, SL("referencedTable"), &_19$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_19$$6); - zephir_array_fetch_string(&_19$$6, arrayReference, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 359 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("columns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 359 TSRMLS_CC); zephir_array_update_string(&_18$$6, SL("columns"), &_19$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_19$$6); - zephir_array_fetch_string(&_19$$6, arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 361 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_19$$6); + zephir_array_fetch_string(&_19$$6, &arrayReference, SL("referencedColumns"), PH_NOISY, "phalcon/db/adapter/pdo/sqlite.zep", 361 TSRMLS_CC); zephir_array_update_string(&_18$$6, SL("referencedColumns"), &_19$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _17$$6, "__construct", &_20, 25, name, _18$$6); + ZEPHIR_CALL_METHOD(NULL, &_17$$6, "__construct", &_20, 20, &name, &_18$$6); zephir_check_call_status(); - zephir_array_update_zval(&referenceObjects, name, &_17$$6, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(referenceObjects); + zephir_array_update_zval(&referenceObjects, &name, &_17$$6, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&arrayReference); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&referenceObjects); } @@ -563,7 +697,8 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, useExplicitIdValue) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); @@ -589,16 +724,18 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, useExplicitIdValue) { */ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, getDefaultValue) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); object_init_ex(return_value, phalcon_db_rawvalue_ce); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "NULL", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 26, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "NULL"); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 21, &_0); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/db/adapter/pdo/sqlite.zep.h b/ext/phalcon/db/adapter/pdo/sqlite.zep.h index 4c545c1e67a..7cbffe39929 100644 --- a/ext/phalcon/db/adapter/pdo/sqlite.zep.h +++ b/ext/phalcon/db/adapter/pdo/sqlite.zep.h @@ -10,23 +10,77 @@ PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences); PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, useExplicitIdValue); PHP_METHOD(Phalcon_Db_Adapter_Pdo_Sqlite, getDefaultValue); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_connect, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_connect, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_connect, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, descriptor, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_describecolumns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_describecolumns, 0, 1, Phalcon\\Db\\ColumnInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_describecolumns, 0, 1, IS_OBJECT, "Phalcon\\Db\\ColumnInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_describeindexes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_describeindexes, 0, 1, Phalcon\\Db\\IndexInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_describeindexes, 0, 1, IS_OBJECT, "Phalcon\\Db\\IndexInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_describereferences, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_describereferences, 0, 1, Phalcon\\Db\\ReferenceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_describereferences, 0, 1, IS_OBJECT, "Phalcon\\Db\\ReferenceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_useexplicitidvalue, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_useexplicitidvalue, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_getdefaultvalue, 0, 0, Phalcon\\Db\\RawValue, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapter_pdo_sqlite_getdefaultvalue, 0, 0, IS_OBJECT, "Phalcon\\Db\\RawValue", 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_adapter_pdo_sqlite_method_entry) { @@ -34,7 +88,7 @@ ZEPHIR_INIT_FUNCS(phalcon_db_adapter_pdo_sqlite_method_entry) { PHP_ME(Phalcon_Db_Adapter_Pdo_Sqlite, describeColumns, arginfo_phalcon_db_adapter_pdo_sqlite_describecolumns, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo_Sqlite, describeIndexes, arginfo_phalcon_db_adapter_pdo_sqlite_describeindexes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Adapter_Pdo_Sqlite, describeReferences, arginfo_phalcon_db_adapter_pdo_sqlite_describereferences, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo_Sqlite, useExplicitIdValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Adapter_Pdo_Sqlite, getDefaultValue, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo_Sqlite, useExplicitIdValue, arginfo_phalcon_db_adapter_pdo_sqlite_useexplicitidvalue, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Adapter_Pdo_Sqlite, getDefaultValue, arginfo_phalcon_db_adapter_pdo_sqlite_getdefaultvalue, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/adapterinterface.zep.h b/ext/phalcon/db/adapterinterface.zep.h index ecf73004a3d..e5d955a6596 100644 --- a/ext/phalcon/db/adapterinterface.zep.h +++ b/ext/phalcon/db/adapterinterface.zep.h @@ -4,13 +4,21 @@ extern zend_class_entry *phalcon_db_adapterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Db_AdapterInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchone, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_ARG_INFO(0, fetchMode) ZEND_ARG_INFO(0, placeholders) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_fetchall, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_ARG_INFO(0, fetchMode) ZEND_ARG_INFO(0, placeholders) ZEND_END_ARG_INFO() @@ -42,192 +50,652 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_getcolumnlist, 0, 0, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_limit, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, number, IS_LONG, 0) +#else ZEND_ARG_INFO(0, number) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_tableexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_tableexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_tableexists, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_viewexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_viewexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_viewexists, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_forupdate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_forupdate, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_forupdate, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_sharedlock, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_sharedlock, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_sharedlock, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_createtable, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_createtable, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_createtable, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_droptable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_droptable, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_droptable, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_createview, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_createview, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_createview, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_dropview, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropview, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropview, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_addcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_addcolumn, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_addcolumn, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_modifycolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_modifycolumn, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_modifycolumn, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_ARG_OBJ_INFO(0, currentColumn, Phalcon\\Db\\ColumnInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_dropcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropcolumn, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropcolumn, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, columnName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, columnName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_addindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_addindex, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_addindex, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_dropindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropindex, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropindex, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, indexName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, indexName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_addprimarykey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_addprimarykey, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_addprimarykey, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_dropprimarykey, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropprimarykey, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropprimarykey, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_addforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_addforeignkey, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_addforeignkey, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, reference, Phalcon\\Db\\ReferenceInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_dropforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropforeignkey, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_dropforeignkey, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_getcolumndefinition, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getcolumndefinition, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getcolumndefinition, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_listtables, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_listtables, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_listtables, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_listviews, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_listviews, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_listviews, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_connect, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getsqlstatement, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getsqlstatement, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getrealsqlstatement, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getrealsqlstatement, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapterinterface_getdialect, 0, 0, Phalcon\\Db\\DialectInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getdialect, 0, 0, IS_OBJECT, "Phalcon\\Db\\DialectInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_connect, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_connect, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, descriptor, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_query, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlStatement, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlStatement) +#endif ZEND_ARG_INFO(0, placeholders) ZEND_ARG_INFO(0, dataTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_execute, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_execute, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_execute, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlStatement, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlStatement) +#endif ZEND_ARG_INFO(0, placeholders) ZEND_ARG_INFO(0, dataTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_escapeidentifier, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_affectedrows, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_affectedrows, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_escapeidentifier, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_escapeidentifier, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, identifier) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_escapestring, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_escapestring, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_escapestring, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +#else ZEND_ARG_INFO(0, str) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_lastinsertid, 0, 0, 0) ZEND_ARG_INFO(0, sequenceName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_begin, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_begin, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_begin, 0, 0, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, nesting) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_rollback, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_rollback, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_rollback, 0, 0, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, nesting) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_commit, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_commit, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_commit, 0, 0, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, nesting, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, nesting) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_isundertransaction, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_isundertransaction, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_describeindexes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapterinterface_getinternalhandler, 0, 0, Pdo, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getinternalhandler, 0, 0, IS_OBJECT, "Pdo", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapterinterface_describeindexes, 0, 1, Phalcon\\Db\\IndexInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_describeindexes, 0, 1, IS_OBJECT, "Phalcon\\Db\\IndexInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_describereferences, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapterinterface_describereferences, 0, 1, Phalcon\\Db\\ReferenceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_describereferences, 0, 1, IS_OBJECT, "Phalcon\\Db\\ReferenceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_tableoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_tableoptions, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_tableoptions, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_useexplicitidvalue, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_useexplicitidvalue, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapterinterface_getdefaultidvalue, 0, 0, Phalcon\\Db\\RawValue, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getdefaultidvalue, 0, 0, IS_OBJECT, "Phalcon\\Db\\RawValue", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_createsavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_supportsequences, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_supportsequences, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_createsavepoint, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_createsavepoint, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_releasesavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_releasesavepoint, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_releasesavepoint, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_rollbacksavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_rollbacksavepoint, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_rollbacksavepoint, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_setnestedtransactionswithsavepoints, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapterinterface_setnestedtransactionswithsavepoints, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_setnestedtransactionswithsavepoints, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, nestedTransactionsWithSavepoints, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, nestedTransactionsWithSavepoints) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_isnestedtransactionswithsavepoints, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_isnestedtransactionswithsavepoints, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getnestedtransactionsavepointname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_getnestedtransactionsavepointname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_adapterinterface_describecolumns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_adapterinterface_describecolumns, 0, 1, Phalcon\\Db\\ColumnInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_adapterinterface_describecolumns, 0, 1, IS_OBJECT, "Phalcon\\Db\\ColumnInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_adapterinterface_method_entry) { @@ -260,38 +728,38 @@ ZEPHIR_INIT_FUNCS(phalcon_db_adapterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, listViews, arginfo_phalcon_db_adapterinterface_listviews) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getDescriptor, NULL) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getConnectionId, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getSQLStatement, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getRealSQLStatement, NULL) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getSQLStatement, arginfo_phalcon_db_adapterinterface_getsqlstatement) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getRealSQLStatement, arginfo_phalcon_db_adapterinterface_getrealsqlstatement) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getSQLVariables, NULL) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getSQLBindTypes, NULL) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getType, NULL) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getDialectType, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getDialect, NULL) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getDialect, arginfo_phalcon_db_adapterinterface_getdialect) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, connect, arginfo_phalcon_db_adapterinterface_connect) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, query, arginfo_phalcon_db_adapterinterface_query) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, execute, arginfo_phalcon_db_adapterinterface_execute) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, affectedRows, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, close, NULL) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, affectedRows, arginfo_phalcon_db_adapterinterface_affectedrows) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, close, arginfo_phalcon_db_adapterinterface_close) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, escapeIdentifier, arginfo_phalcon_db_adapterinterface_escapeidentifier) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, escapeString, arginfo_phalcon_db_adapterinterface_escapestring) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, lastInsertId, arginfo_phalcon_db_adapterinterface_lastinsertid) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, begin, arginfo_phalcon_db_adapterinterface_begin) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, rollback, arginfo_phalcon_db_adapterinterface_rollback) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, commit, arginfo_phalcon_db_adapterinterface_commit) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, isUnderTransaction, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getInternalHandler, NULL) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, isUnderTransaction, arginfo_phalcon_db_adapterinterface_isundertransaction) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getInternalHandler, arginfo_phalcon_db_adapterinterface_getinternalhandler) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, describeIndexes, arginfo_phalcon_db_adapterinterface_describeindexes) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, describeReferences, arginfo_phalcon_db_adapterinterface_describereferences) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, tableOptions, arginfo_phalcon_db_adapterinterface_tableoptions) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, useExplicitIdValue, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getDefaultIdValue, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, supportSequences, NULL) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, useExplicitIdValue, arginfo_phalcon_db_adapterinterface_useexplicitidvalue) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getDefaultIdValue, arginfo_phalcon_db_adapterinterface_getdefaultidvalue) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, supportSequences, arginfo_phalcon_db_adapterinterface_supportsequences) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, createSavepoint, arginfo_phalcon_db_adapterinterface_createsavepoint) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, releaseSavepoint, arginfo_phalcon_db_adapterinterface_releasesavepoint) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, rollbackSavepoint, arginfo_phalcon_db_adapterinterface_rollbacksavepoint) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, setNestedTransactionsWithSavepoints, arginfo_phalcon_db_adapterinterface_setnestedtransactionswithsavepoints) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, isNestedTransactionsWithSavepoints, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getNestedTransactionSavepointName, NULL) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, isNestedTransactionsWithSavepoints, arginfo_phalcon_db_adapterinterface_isnestedtransactionswithsavepoints) + PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, getNestedTransactionSavepointName, arginfo_phalcon_db_adapterinterface_getnestedtransactionsavepointname) PHP_ABSTRACT_ME(Phalcon_Db_AdapterInterface, describeColumns, arginfo_phalcon_db_adapterinterface_describecolumns) PHP_FE_END }; diff --git a/ext/phalcon/db/column.zep.c b/ext/phalcon/db/column.zep.c index 4f564b330b4..11c0149b620 100644 --- a/ext/phalcon/db/column.zep.c +++ b/ext/phalcon/db/column.zep.c @@ -157,127 +157,127 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Column) { /** * Integer abstract type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_INTEGER"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_INTEGER"), 0); /** * Date abstract type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DATE"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DATE"), 1); /** * Varchar abstract type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_VARCHAR"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_VARCHAR"), 2); /** * Decimal abstract type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DECIMAL"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DECIMAL"), 3); /** * Datetime abstract type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DATETIME"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DATETIME"), 4); /** * Char abstract type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_CHAR"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_CHAR"), 5); /** * Text abstract data type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TEXT"), 6 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TEXT"), 6); /** * Float abstract data type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_FLOAT"), 7 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_FLOAT"), 7); /** * Boolean abstract data type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BOOLEAN"), 8 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BOOLEAN"), 8); /** * Double abstract data type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DOUBLE"), 9 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_DOUBLE"), 9); /** * Tinyblob abstract data type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TINYBLOB"), 10 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TINYBLOB"), 10); /** * Blob abstract data type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BLOB"), 11 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BLOB"), 11); /** * Mediumblob abstract data type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_MEDIUMBLOB"), 12 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_MEDIUMBLOB"), 12); /** * Longblob abstract data type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_LONGBLOB"), 13 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_LONGBLOB"), 13); /** * Big integer abstract data type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BIGINTEGER"), 14 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_BIGINTEGER"), 14); /** * Json abstract type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_JSON"), 15 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_JSON"), 15); /** * Jsonb abstract type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_JSONB"), 16 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_JSONB"), 16); /** * Datetime abstract type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TIMESTAMP"), 17 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("TYPE_TIMESTAMP"), 17); /** * Bind Type Null */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_NULL"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_NULL"), 0); /** * Bind Type Integer */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_INT"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_INT"), 1); /** * Bind Type String */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_STR"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_STR"), 2); /** * Bind Type Blob */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_BLOB"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_BLOB"), 3); /** * Bind Type Bool */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_BOOL"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_BOOL"), 5); /** * Bind Type Decimal */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_DECIMAL"), 32 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_PARAM_DECIMAL"), 32); /** * Skip binding by type */ - zend_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_SKIP"), 1024 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_db_column_ce, SL("BIND_SKIP"), 1024); zend_class_implements(phalcon_db_column_ce TSRMLS_CC, 1, phalcon_db_columninterface_ce); return SUCCESS; @@ -289,7 +289,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Column) { */ PHP_METHOD(Phalcon_Db_Column, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -300,7 +301,8 @@ PHP_METHOD(Phalcon_Db_Column, getName) { */ PHP_METHOD(Phalcon_Db_Column, getSchemaName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_schemaName"); @@ -311,7 +313,8 @@ PHP_METHOD(Phalcon_Db_Column, getSchemaName) { */ PHP_METHOD(Phalcon_Db_Column, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -322,7 +325,8 @@ PHP_METHOD(Phalcon_Db_Column, getType) { */ PHP_METHOD(Phalcon_Db_Column, getTypeReference) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_typeReference"); @@ -333,7 +337,8 @@ PHP_METHOD(Phalcon_Db_Column, getTypeReference) { */ PHP_METHOD(Phalcon_Db_Column, getTypeValues) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_typeValues"); @@ -344,7 +349,8 @@ PHP_METHOD(Phalcon_Db_Column, getTypeValues) { */ PHP_METHOD(Phalcon_Db_Column, getSize) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_size"); @@ -355,7 +361,8 @@ PHP_METHOD(Phalcon_Db_Column, getSize) { */ PHP_METHOD(Phalcon_Db_Column, getScale) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_scale"); @@ -366,7 +373,8 @@ PHP_METHOD(Phalcon_Db_Column, getScale) { */ PHP_METHOD(Phalcon_Db_Column, getDefault) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_default"); @@ -377,59 +385,79 @@ PHP_METHOD(Phalcon_Db_Column, getDefault) { */ PHP_METHOD(Phalcon_Db_Column, __construct) { - zval *definition = NULL; - zval *name_param = NULL, *definition_param = NULL, *type = NULL, *notNull = NULL, *primary = NULL, *size = NULL, *scale = NULL, *dunsigned = NULL, *first = NULL, *after = NULL, *bindType = NULL, *isNumeric = NULL, *autoIncrement = NULL, *defaultValue = NULL, *typeReference = NULL, *typeValues = NULL; - zval *name = NULL; + zval definition; + zval *name_param = NULL, *definition_param = NULL, __$true, __$false, type, notNull, primary, size, scale, dunsigned, first, after, bindType, isNumeric, autoIncrement, defaultValue, typeReference, typeValues; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(¬Null); + ZVAL_UNDEF(&primary); + ZVAL_UNDEF(&size); + ZVAL_UNDEF(&scale); + ZVAL_UNDEF(&dunsigned); + ZVAL_UNDEF(&first); + ZVAL_UNDEF(&after); + ZVAL_UNDEF(&bindType); + ZVAL_UNDEF(&isNumeric); + ZVAL_UNDEF(&autoIncrement); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&typeReference); + ZVAL_UNDEF(&typeValues); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &definition_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); - ZEPHIR_OBS_VAR(type); - if (zephir_array_isset_string_fetch(&type, definition, SS("type"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); + ZEPHIR_OBS_VAR(&type); + if (zephir_array_isset_string_fetch(&type, &definition, SL("type"), 0)) { + zephir_update_property_zval(this_ptr, SL("_type"), &type); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Column type is required", "phalcon/db/column.zep", 299); return; } - ZEPHIR_OBS_VAR(typeReference); - if (zephir_array_isset_string_fetch(&typeReference, definition, SS("typeReference"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_typeReference"), typeReference TSRMLS_CC); + ZEPHIR_OBS_VAR(&typeReference); + if (zephir_array_isset_string_fetch(&typeReference, &definition, SL("typeReference"), 0)) { + zephir_update_property_zval(this_ptr, SL("_typeReference"), &typeReference); } - ZEPHIR_OBS_VAR(typeValues); - if (zephir_array_isset_string_fetch(&typeValues, definition, SS("typeValues"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_typeValues"), typeValues TSRMLS_CC); + ZEPHIR_OBS_VAR(&typeValues); + if (zephir_array_isset_string_fetch(&typeValues, &definition, SL("typeValues"), 0)) { + zephir_update_property_zval(this_ptr, SL("_typeValues"), &typeValues); } - ZEPHIR_OBS_VAR(notNull); - if (zephir_array_isset_string_fetch(¬Null, definition, SS("notNull"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_notNull"), notNull TSRMLS_CC); + ZEPHIR_OBS_VAR(¬Null); + if (zephir_array_isset_string_fetch(¬Null, &definition, SL("notNull"), 0)) { + zephir_update_property_zval(this_ptr, SL("_notNull"), ¬Null); } - ZEPHIR_OBS_VAR(primary); - if (zephir_array_isset_string_fetch(&primary, definition, SS("primary"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_primary"), primary TSRMLS_CC); + ZEPHIR_OBS_VAR(&primary); + if (zephir_array_isset_string_fetch(&primary, &definition, SL("primary"), 0)) { + zephir_update_property_zval(this_ptr, SL("_primary"), &primary); } - ZEPHIR_OBS_VAR(size); - if (zephir_array_isset_string_fetch(&size, definition, SS("size"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_size"), size TSRMLS_CC); + ZEPHIR_OBS_VAR(&size); + if (zephir_array_isset_string_fetch(&size, &definition, SL("size"), 0)) { + zephir_update_property_zval(this_ptr, SL("_size"), &size); } - ZEPHIR_OBS_VAR(scale); - if (zephir_array_isset_string_fetch(&scale, definition, SS("scale"), 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&scale); + if (zephir_array_isset_string_fetch(&scale, &definition, SL("scale"), 0)) { do { - if (ZEPHIR_IS_LONG(type, 0) || ZEPHIR_IS_LONG(type, 7) || ZEPHIR_IS_LONG(type, 3) || ZEPHIR_IS_LONG(type, 9) || ZEPHIR_IS_LONG(type, 14)) { - zephir_update_property_this(getThis(), SL("_scale"), scale TSRMLS_CC); + if (ZEPHIR_IS_LONG(&type, 0) || ZEPHIR_IS_LONG(&type, 7) || ZEPHIR_IS_LONG(&type, 3) || ZEPHIR_IS_LONG(&type, 9) || ZEPHIR_IS_LONG(&type, 14)) { + zephir_update_property_zval(this_ptr, SL("_scale"), &scale); break; } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Column type does not support scale parameter", "phalcon/db/column.zep", 343); @@ -437,33 +465,33 @@ PHP_METHOD(Phalcon_Db_Column, __construct) { } while(0); } - ZEPHIR_OBS_VAR(defaultValue); - if (zephir_array_isset_string_fetch(&defaultValue, definition, SS("default"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_default"), defaultValue TSRMLS_CC); + ZEPHIR_OBS_VAR(&defaultValue); + if (zephir_array_isset_string_fetch(&defaultValue, &definition, SL("default"), 0)) { + zephir_update_property_zval(this_ptr, SL("_default"), &defaultValue); } - ZEPHIR_OBS_VAR(dunsigned); - if (zephir_array_isset_string_fetch(&dunsigned, definition, SS("unsigned"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_unsigned"), dunsigned TSRMLS_CC); + ZEPHIR_OBS_VAR(&dunsigned); + if (zephir_array_isset_string_fetch(&dunsigned, &definition, SL("unsigned"), 0)) { + zephir_update_property_zval(this_ptr, SL("_unsigned"), &dunsigned); } - ZEPHIR_OBS_VAR(isNumeric); - if (zephir_array_isset_string_fetch(&isNumeric, definition, SS("isNumeric"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_isNumeric"), isNumeric TSRMLS_CC); + ZEPHIR_OBS_VAR(&isNumeric); + if (zephir_array_isset_string_fetch(&isNumeric, &definition, SL("isNumeric"), 0)) { + zephir_update_property_zval(this_ptr, SL("_isNumeric"), &isNumeric); } - ZEPHIR_OBS_VAR(autoIncrement); - if (zephir_array_isset_string_fetch(&autoIncrement, definition, SS("autoIncrement"), 0 TSRMLS_CC)) { - if (!(zephir_is_true(autoIncrement))) { + ZEPHIR_OBS_VAR(&autoIncrement); + if (zephir_array_isset_string_fetch(&autoIncrement, &definition, SL("autoIncrement"), 0)) { + if (!(zephir_is_true(&autoIncrement))) { if (0) { - zephir_update_property_this(getThis(), SL("_autoIncrement"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_autoIncrement"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_autoIncrement"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_autoIncrement"), &__$false); } } else { do { - if (ZEPHIR_IS_LONG(type, 0) || ZEPHIR_IS_LONG(type, 14)) { + if (ZEPHIR_IS_LONG(&type, 0) || ZEPHIR_IS_LONG(&type, 14)) { if (1) { - zephir_update_property_this(getThis(), SL("_autoIncrement"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_autoIncrement"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_autoIncrement"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_autoIncrement"), &__$false); } break; } @@ -473,14 +501,14 @@ PHP_METHOD(Phalcon_Db_Column, __construct) { } } - if (zephir_array_isset_string_fetch(&first, definition, SS("first"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_first"), first TSRMLS_CC); + if (zephir_array_isset_string_fetch(&first, &definition, SL("first"), 1)) { + zephir_update_property_zval(this_ptr, SL("_first"), &first); } - if (zephir_array_isset_string_fetch(&after, definition, SS("after"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_after"), after TSRMLS_CC); + if (zephir_array_isset_string_fetch(&after, &definition, SL("after"), 1)) { + zephir_update_property_zval(this_ptr, SL("_after"), &after); } - if (zephir_array_isset_string_fetch(&bindType, definition, SS("bindType"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_bindType"), bindType TSRMLS_CC); + if (zephir_array_isset_string_fetch(&bindType, &definition, SL("bindType"), 1)) { + zephir_update_property_zval(this_ptr, SL("_bindType"), &bindType); } ZEPHIR_MM_RESTORE(); @@ -491,7 +519,8 @@ PHP_METHOD(Phalcon_Db_Column, __construct) { */ PHP_METHOD(Phalcon_Db_Column, isUnsigned) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_unsigned"); @@ -502,7 +531,8 @@ PHP_METHOD(Phalcon_Db_Column, isUnsigned) { */ PHP_METHOD(Phalcon_Db_Column, isNotNull) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_notNull"); @@ -513,7 +543,8 @@ PHP_METHOD(Phalcon_Db_Column, isNotNull) { */ PHP_METHOD(Phalcon_Db_Column, isPrimary) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_primary"); @@ -524,7 +555,8 @@ PHP_METHOD(Phalcon_Db_Column, isPrimary) { */ PHP_METHOD(Phalcon_Db_Column, isAutoIncrement) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_autoIncrement"); @@ -535,7 +567,8 @@ PHP_METHOD(Phalcon_Db_Column, isAutoIncrement) { */ PHP_METHOD(Phalcon_Db_Column, isNumeric) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_isNumeric"); @@ -546,7 +579,8 @@ PHP_METHOD(Phalcon_Db_Column, isNumeric) { */ PHP_METHOD(Phalcon_Db_Column, isFirst) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_first"); @@ -559,7 +593,8 @@ PHP_METHOD(Phalcon_Db_Column, isFirst) { */ PHP_METHOD(Phalcon_Db_Column, getAfterPosition) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_after"); @@ -570,7 +605,8 @@ PHP_METHOD(Phalcon_Db_Column, getAfterPosition) { */ PHP_METHOD(Phalcon_Db_Column, getBindType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_bindType"); @@ -582,80 +618,101 @@ PHP_METHOD(Phalcon_Db_Column, getBindType) { PHP_METHOD(Phalcon_Db_Column, __set_state) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *definition = NULL, *columnType = NULL, *notNull = NULL, *size = NULL, *dunsigned = NULL, *after = NULL, *isNumeric = NULL, *first = NULL, *bindType = NULL, *primary = NULL, *columnName = NULL, *scale = NULL, *defaultValue = NULL, *autoIncrement = NULL, *columnTypeReference = NULL, *columnTypeValues = NULL, *_0$$7, *_1$$12; - zval *data = NULL; + zval *data_param = NULL, definition, columnType, notNull, size, dunsigned, after, isNumeric, first, bindType, primary, columnName, scale, defaultValue, autoIncrement, columnTypeReference, columnTypeValues, _0$$7, _1$$12; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&columnType); + ZVAL_UNDEF(¬Null); + ZVAL_UNDEF(&size); + ZVAL_UNDEF(&dunsigned); + ZVAL_UNDEF(&after); + ZVAL_UNDEF(&isNumeric); + ZVAL_UNDEF(&first); + ZVAL_UNDEF(&bindType); + ZVAL_UNDEF(&primary); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&scale); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&autoIncrement); + ZVAL_UNDEF(&columnTypeReference); + ZVAL_UNDEF(&columnTypeValues); + ZVAL_UNDEF(&_0$$7); + ZVAL_UNDEF(&_1$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data_param); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); - ZEPHIR_OBS_VAR(columnName); - if (!(zephir_array_isset_string_fetch(&columnName, data, SS("_columnName"), 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(columnName); - if (!(zephir_array_isset_string_fetch(&columnName, data, SS("_name"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&columnName); + if (!(zephir_array_isset_string_fetch(&columnName, &data, SL("_columnName"), 0))) { + ZEPHIR_OBS_NVAR(&columnName); + if (!(zephir_array_isset_string_fetch(&columnName, &data, SL("_name"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Column name is required", "phalcon/db/column.zep", 489); return; } } - ZEPHIR_INIT_VAR(definition); - array_init(definition); - if (zephir_array_isset_string_fetch(&columnType, data, SS("_type"), 1 TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&definition); + array_init(&definition); + if (zephir_array_isset_string_fetch(&columnType, &data, SL("_type"), 1)) { zephir_array_update_string(&definition, SL("type"), &columnType, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&columnTypeReference, data, SS("_typeReference"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&columnTypeReference, &data, SL("_typeReference"), 1)) { zephir_array_update_string(&definition, SL("typeReference"), &columnTypeReference, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_INIT_VAR(_0$$7); - ZVAL_LONG(_0$$7, -1); + ZEPHIR_INIT_VAR(&_0$$7); + ZVAL_LONG(&_0$$7, -1); zephir_array_update_string(&definition, SL("typeReference"), &_0$$7, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&columnTypeValues, data, SS("_typeValues"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&columnTypeValues, &data, SL("_typeValues"), 1)) { zephir_array_update_string(&definition, SL("typeValues"), &columnTypeValues, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(¬Null, data, SS("_notNull"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(¬Null, &data, SL("_notNull"), 1)) { zephir_array_update_string(&definition, SL("notNull"), ¬Null, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&primary, data, SS("_primary"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&primary, &data, SL("_primary"), 1)) { zephir_array_update_string(&definition, SL("primary"), &primary, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&size, data, SS("_size"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&size, &data, SL("_size"), 1)) { zephir_array_update_string(&definition, SL("size"), &size, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&scale, data, SS("_scale"), 1 TSRMLS_CC)) { - zephir_array_fetch_string(&_1$$12, definition, SL("type"), PH_NOISY | PH_READONLY, "phalcon/db/column.zep", 523 TSRMLS_CC); + if (zephir_array_isset_string_fetch(&scale, &data, SL("_scale"), 1)) { + zephir_array_fetch_string(&_1$$12, &definition, SL("type"), PH_NOISY | PH_READONLY, "phalcon/db/column.zep", 523 TSRMLS_CC); do { - if (ZEPHIR_IS_LONG(_1$$12, 0) || ZEPHIR_IS_LONG(_1$$12, 7) || ZEPHIR_IS_LONG(_1$$12, 3) || ZEPHIR_IS_LONG(_1$$12, 9) || ZEPHIR_IS_LONG(_1$$12, 14)) { + if (ZEPHIR_IS_LONG(&_1$$12, 0) || ZEPHIR_IS_LONG(&_1$$12, 7) || ZEPHIR_IS_LONG(&_1$$12, 3) || ZEPHIR_IS_LONG(&_1$$12, 9) || ZEPHIR_IS_LONG(&_1$$12, 14)) { zephir_array_update_string(&definition, SL("scale"), &scale, PH_COPY | PH_SEPARATE); break; } } while(0); } - if (zephir_array_isset_string_fetch(&defaultValue, data, SS("_default"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&defaultValue, &data, SL("_default"), 1)) { zephir_array_update_string(&definition, SL("default"), &defaultValue, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&dunsigned, data, SS("_unsigned"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&dunsigned, &data, SL("_unsigned"), 1)) { zephir_array_update_string(&definition, SL("unsigned"), &dunsigned, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&autoIncrement, data, SS("_autoIncrement"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&autoIncrement, &data, SL("_autoIncrement"), 1)) { zephir_array_update_string(&definition, SL("autoIncrement"), &autoIncrement, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&isNumeric, data, SS("_isNumeric"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&isNumeric, &data, SL("_isNumeric"), 1)) { zephir_array_update_string(&definition, SL("isNumeric"), &isNumeric, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&first, data, SS("_first"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&first, &data, SL("_first"), 1)) { zephir_array_update_string(&definition, SL("first"), &first, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&after, data, SS("_after"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&after, &data, SL("_after"), 1)) { zephir_array_update_string(&definition, SL("after"), &after, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&bindType, data, SS("_bindType"), 1 TSRMLS_CC)) { + if (zephir_array_isset_string_fetch(&bindType, &data, SL("_bindType"), 1)) { zephir_array_update_string(&definition, SL("bindType"), &bindType, PH_COPY | PH_SEPARATE); } object_init_ex(return_value, phalcon_db_column_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 167, columnName, definition); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 148, &columnName, &definition); zephir_check_call_status(); RETURN_MM(); @@ -666,18 +723,22 @@ PHP_METHOD(Phalcon_Db_Column, __set_state) { */ PHP_METHOD(Phalcon_Db_Column, hasDefault) { - zval *_0 = NULL, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "isautoincrement", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_0)) { + if (zephir_is_true(&_0)) { RETURN_MM_BOOL(0); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_default"), PH_NOISY_CC); - RETURN_MM_BOOL(Z_TYPE_P(_1) != IS_NULL); + zephir_read_property(&_1, this_ptr, SL("_default"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(Z_TYPE_P(&_1) != IS_NULL); } diff --git a/ext/phalcon/db/column.zep.h b/ext/phalcon/db/column.zep.h index 894f17a7918..e96bbd6c88c 100644 --- a/ext/phalcon/db/column.zep.h +++ b/ext/phalcon/db/column.zep.h @@ -23,34 +23,133 @@ PHP_METHOD(Phalcon_Db_Column, getBindType); PHP_METHOD(Phalcon_Db_Column, __set_state); PHP_METHOD(Phalcon_Db_Column, hasDefault); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getschemaname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getschemaname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_gettypereference, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_gettypereference, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getsize, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getsize, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getscale, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getscale, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_column___construct, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_column___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isunsigned, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isunsigned, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isnotnull, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isnotnull, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isprimary, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isprimary, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isautoincrement, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isautoincrement, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isnumeric, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isnumeric, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isfirst, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_isfirst, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getbindtype, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_getbindtype, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_column___set_state, 0, 1, Phalcon\\Db\\ColumnInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column___set_state, 0, 1, IS_OBJECT, "Phalcon\\Db\\ColumnInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_hasdefault, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_column_hasdefault, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_db_column_method_entry) { - PHP_ME(Phalcon_Db_Column, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, getSchemaName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, getName, arginfo_phalcon_db_column_getname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, getSchemaName, arginfo_phalcon_db_column_getschemaname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Column, getType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, getTypeReference, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, getTypeReference, arginfo_phalcon_db_column_gettypereference, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Column, getTypeValues, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, getSize, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, getScale, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, getSize, arginfo_phalcon_db_column_getsize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, getScale, arginfo_phalcon_db_column_getscale, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Column, getDefault, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Column, __construct, arginfo_phalcon_db_column___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Db_Column, isUnsigned, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, isNotNull, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, isPrimary, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, isAutoIncrement, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, isNumeric, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, isFirst, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, isUnsigned, arginfo_phalcon_db_column_isunsigned, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, isNotNull, arginfo_phalcon_db_column_isnotnull, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, isPrimary, arginfo_phalcon_db_column_isprimary, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, isAutoIncrement, arginfo_phalcon_db_column_isautoincrement, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, isNumeric, arginfo_phalcon_db_column_isnumeric, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, isFirst, arginfo_phalcon_db_column_isfirst, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Column, getAfterPosition, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Column, getBindType, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, getBindType, arginfo_phalcon_db_column_getbindtype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Column, __set_state, arginfo_phalcon_db_column___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Db_Column, hasDefault, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Column, hasDefault, arginfo_phalcon_db_column_hasdefault, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/columninterface.zep.h b/ext/phalcon/db/columninterface.zep.h index 23c510a484a..eaa6d137905 100644 --- a/ext/phalcon/db/columninterface.zep.h +++ b/ext/phalcon/db/columninterface.zep.h @@ -3,7 +3,18 @@ extern zend_class_entry *phalcon_db_columninterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Db_ColumnInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_columninterface___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_columninterface_hasdefault, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_columninterface_hasdefault, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_columninterface___set_state, 0, 1, Phalcon\\Db\\ColumnInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_columninterface___set_state, 0, 1, IS_OBJECT, "Phalcon\\Db\\ColumnInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() @@ -24,7 +35,7 @@ ZEPHIR_INIT_FUNCS(phalcon_db_columninterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Db_ColumnInterface, getAfterPosition, NULL) PHP_ABSTRACT_ME(Phalcon_Db_ColumnInterface, getBindType, NULL) PHP_ABSTRACT_ME(Phalcon_Db_ColumnInterface, getDefault, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_ColumnInterface, hasDefault, NULL) + PHP_ABSTRACT_ME(Phalcon_Db_ColumnInterface, hasDefault, arginfo_phalcon_db_columninterface_hasdefault) ZEND_FENTRY(__set_state, NULL, arginfo_phalcon_db_columninterface___set_state, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/dialect.zep.c b/ext/phalcon/db/dialect.zep.c index 483093031af..5d9f18450b3 100644 --- a/ext/phalcon/db/dialect.zep.c +++ b/ext/phalcon/db/dialect.zep.c @@ -47,16 +47,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Dialect) { */ PHP_METHOD(Phalcon_Db_Dialect, registerCustomFunction) { - zval *name_param = NULL, *customFunction; - zval *name = NULL; + zval *name_param = NULL, *customFunction, customFunction_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&customFunction_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &customFunction); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - zephir_update_property_array(this_ptr, SL("_customFunctions"), name, customFunction TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_customFunctions"), &name, customFunction TSRMLS_CC); RETURN_THIS(); } @@ -66,7 +70,8 @@ PHP_METHOD(Phalcon_Db_Dialect, registerCustomFunction) { */ PHP_METHOD(Phalcon_Db_Dialect, getCustomFunctions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_customFunctions"); @@ -77,42 +82,49 @@ PHP_METHOD(Phalcon_Db_Dialect, getCustomFunctions) { */ PHP_METHOD(Phalcon_Db_Dialect, escapeSchema) { - zval *str_param = NULL, *escapeChar_param = NULL, *_0$$4, *_2; - zval *str = NULL, *escapeChar = NULL, *_1$$4 = NULL; + zval *str_param = NULL, *escapeChar_param = NULL, _0$$4, _2; + zval str, escapeChar, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&str); + ZVAL_UNDEF(&escapeChar); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &str_param, &escapeChar_param); if (UNEXPECTED(Z_TYPE_P(str_param) != IS_STRING && Z_TYPE_P(str_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(str_param) == IS_STRING)) { - zephir_get_strval(str, str_param); + zephir_get_strval(&str, str_param); } else { - ZEPHIR_INIT_VAR(str); - ZVAL_EMPTY_STRING(str); + ZEPHIR_INIT_VAR(&str); + ZVAL_EMPTY_STRING(&str); } if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!(ZEPHIR_GLOBAL(db).escape_identifiers)) { - RETURN_CTOR(str); + RETURN_CTOR(&str); } - if (ZEPHIR_IS_STRING(escapeChar, "")) { - ZEPHIR_OBS_VAR(_0$$4); - zephir_read_property_this(&_0$$4, this_ptr, SL("_escapeChar"), PH_NOISY_CC); - zephir_get_strval(_1$$4, _0$$4); - ZEPHIR_CPY_WRT(escapeChar, _1$$4); + if (ZEPHIR_IS_STRING(&escapeChar, "")) { + ZEPHIR_OBS_VAR(&_0$$4); + zephir_read_property(&_0$$4, this_ptr, SL("_escapeChar"), PH_NOISY_CC); + zephir_get_strval(&_1$$4, &_0$$4); + ZEPHIR_CPY_WRT(&escapeChar, &_1$$4); } - ZEPHIR_INIT_VAR(_2); - zephir_fast_trim(_2, str, escapeChar, ZEPHIR_TRIM_BOTH TSRMLS_CC); - ZEPHIR_CONCAT_VVV(return_value, escapeChar, _2, escapeChar); + ZEPHIR_INIT_VAR(&_2); + zephir_fast_trim(&_2, &str, &escapeChar, ZEPHIR_TRIM_BOTH TSRMLS_CC); + ZEPHIR_CONCAT_VVV(return_value, &escapeChar, &_2, &escapeChar); RETURN_MM(); } @@ -123,91 +135,115 @@ PHP_METHOD(Phalcon_Db_Dialect, escapeSchema) { PHP_METHOD(Phalcon_Db_Dialect, escape) { zend_bool _2$$5, _11$$7, _12$$7; - HashTable *_9; - HashPosition _8; - zval *_7 = NULL; - zval *str_param = NULL, *escapeChar_param = NULL, *parts = NULL, *key = NULL, *part = NULL, *newParts = NULL, *_5, *_6, **_10, *_0$$4, *_3$$6, *_13$$7 = NULL, *_15$$7 = NULL; - zval *str = NULL, *escapeChar = NULL, *_1$$4 = NULL, *_4$$6, *_14$$7 = NULL; + zend_string *_10; + zend_ulong _9; + zval _7; + zval *str_param = NULL, *escapeChar_param = NULL, parts, key, part, newParts, _5, _6, *_8, _0$$4, _3$$6, _13$$7, _15$$7; + zval str, escapeChar, _1$$4, _4$$6, _14$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&str); + ZVAL_UNDEF(&escapeChar); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_14$$7); + ZVAL_UNDEF(&parts); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&part); + ZVAL_UNDEF(&newParts); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_13$$7); + ZVAL_UNDEF(&_15$$7); + ZVAL_UNDEF(&_7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &str_param, &escapeChar_param); if (UNEXPECTED(Z_TYPE_P(str_param) != IS_STRING && Z_TYPE_P(str_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'str' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(str_param) == IS_STRING)) { - zephir_get_strval(str, str_param); + zephir_get_strval(&str, str_param); } else { - ZEPHIR_INIT_VAR(str); - ZVAL_EMPTY_STRING(str); + ZEPHIR_INIT_VAR(&str); + ZVAL_EMPTY_STRING(&str); } if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!(ZEPHIR_GLOBAL(db).escape_identifiers)) { - RETURN_CTOR(str); + RETURN_CTOR(&str); } - if (ZEPHIR_IS_STRING(escapeChar, "")) { - ZEPHIR_OBS_VAR(_0$$4); - zephir_read_property_this(&_0$$4, this_ptr, SL("_escapeChar"), PH_NOISY_CC); - zephir_get_strval(_1$$4, _0$$4); - ZEPHIR_CPY_WRT(escapeChar, _1$$4); + if (ZEPHIR_IS_STRING(&escapeChar, "")) { + ZEPHIR_OBS_VAR(&_0$$4); + zephir_read_property(&_0$$4, this_ptr, SL("_escapeChar"), PH_NOISY_CC); + zephir_get_strval(&_1$$4, &_0$$4); + ZEPHIR_CPY_WRT(&escapeChar, &_1$$4); } - if (!(zephir_memnstr_str(str, SL("."), "phalcon/db/dialect.zep", 84))) { - _2$$5 = !ZEPHIR_IS_STRING(escapeChar, ""); + if (!(zephir_memnstr_str(&str, SL("."), "phalcon/db/dialect.zep", 84))) { + _2$$5 = !ZEPHIR_IS_STRING(&escapeChar, ""); if (_2$$5) { - _2$$5 = !ZEPHIR_IS_STRING(str, "*"); + _2$$5 = !ZEPHIR_IS_STRING(&str, "*"); } if (_2$$5) { - ZEPHIR_INIT_VAR(_3$$6); - ZEPHIR_INIT_VAR(_4$$6); - ZEPHIR_CONCAT_VV(_4$$6, escapeChar, escapeChar); - zephir_fast_str_replace(&_3$$6, escapeChar, _4$$6, str TSRMLS_CC); - ZEPHIR_CONCAT_VVV(return_value, escapeChar, _3$$6, escapeChar); + ZEPHIR_INIT_VAR(&_3$$6); + ZEPHIR_INIT_VAR(&_4$$6); + ZEPHIR_CONCAT_VV(&_4$$6, &escapeChar, &escapeChar); + zephir_fast_str_replace(&_3$$6, &escapeChar, &_4$$6, &str TSRMLS_CC); + ZEPHIR_CONCAT_VVV(return_value, &escapeChar, &_3$$6, &escapeChar); RETURN_MM(); } - RETURN_CTOR(str); - } - ZEPHIR_INIT_VAR(_5); - ZEPHIR_INIT_VAR(_6); - zephir_fast_trim(_6, str, escapeChar, ZEPHIR_TRIM_BOTH TSRMLS_CC); - zephir_fast_explode_str(_5, SL("."), _6, LONG_MAX TSRMLS_CC); - zephir_get_arrval(_7, _5); - ZEPHIR_CPY_WRT(parts, _7); - ZEPHIR_CPY_WRT(newParts, parts); - zephir_is_iterable(parts, &_9, &_8, 0, 0, "phalcon/db/dialect.zep", 105); - for ( - ; zend_hash_get_current_data_ex(_9, (void**) &_10, &_8) == SUCCESS - ; zend_hash_move_forward_ex(_9, &_8) - ) { - ZEPHIR_GET_HMKEY(key, _9, _8); - ZEPHIR_GET_HVALUE(part, _10); - _11$$7 = ZEPHIR_IS_STRING(escapeChar, ""); + RETURN_CTOR(&str); + } + ZEPHIR_INIT_VAR(&_5); + ZEPHIR_INIT_VAR(&_6); + zephir_fast_trim(&_6, &str, &escapeChar, ZEPHIR_TRIM_BOTH TSRMLS_CC); + zephir_fast_explode_str(&_5, SL("."), &_6, LONG_MAX TSRMLS_CC); + zephir_get_arrval(&_7, &_5); + ZEPHIR_CPY_WRT(&parts, &_7); + ZEPHIR_CPY_WRT(&newParts, &parts); + zephir_is_iterable(&parts, 0, "phalcon/db/dialect.zep", 105); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&parts), _9, _10, _8) + { + ZEPHIR_INIT_NVAR(&key); + if (_10 != NULL) { + ZVAL_STR_COPY(&key, _10); + } else { + ZVAL_LONG(&key, _9); + } + ZEPHIR_INIT_NVAR(&part); + ZVAL_COPY(&part, _8); + _11$$7 = ZEPHIR_IS_STRING(&escapeChar, ""); if (!(_11$$7)) { - _11$$7 = ZEPHIR_IS_STRING(part, ""); + _11$$7 = ZEPHIR_IS_STRING(&part, ""); } _12$$7 = _11$$7; if (!(_12$$7)) { - _12$$7 = ZEPHIR_IS_STRING(part, "*"); + _12$$7 = ZEPHIR_IS_STRING(&part, "*"); } if (_12$$7) { continue; } - ZEPHIR_INIT_NVAR(_13$$7); + ZEPHIR_INIT_NVAR(&_13$$7); ZEPHIR_INIT_LNVAR(_14$$7); - ZEPHIR_CONCAT_VV(_14$$7, escapeChar, escapeChar); - zephir_fast_str_replace(&_13$$7, escapeChar, _14$$7, part TSRMLS_CC); + ZEPHIR_CONCAT_VV(&_14$$7, &escapeChar, &escapeChar); + zephir_fast_str_replace(&_13$$7, &escapeChar, &_14$$7, &part TSRMLS_CC); ZEPHIR_INIT_LNVAR(_15$$7); - ZEPHIR_CONCAT_VVV(_15$$7, escapeChar, _13$$7, escapeChar); - zephir_array_update_zval(&newParts, key, &_15$$7, PH_COPY | PH_SEPARATE); - } - zephir_fast_join_str(return_value, SL("."), newParts TSRMLS_CC); + ZEPHIR_CONCAT_VVV(&_15$$7, &escapeChar, &_13$$7, &escapeChar); + zephir_array_update_zval(&newParts, &key, &_15$$7, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&part); + ZEPHIR_INIT_NVAR(&key); + zephir_fast_join_str(return_value, SL("."), &newParts TSRMLS_CC); RETURN_MM(); } @@ -226,43 +262,52 @@ PHP_METHOD(Phalcon_Db_Dialect, escape) { PHP_METHOD(Phalcon_Db_Dialect, limit) { zend_bool _2$$3; - zval *sqlQuery_param = NULL, *number, *_0$$3, *_1$$3, *_3$$3, *_4$$4, *_5$$4; - zval *sqlQuery = NULL; + zval *sqlQuery_param = NULL, *number, number_sub, _0$$3, _1$$3, _3$$3, _4$$4, _5$$4; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); + ZVAL_UNDEF(&number_sub); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &sqlQuery_param, &number); if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) { - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); } else { - ZEPHIR_INIT_VAR(sqlQuery); - ZVAL_EMPTY_STRING(sqlQuery); + ZEPHIR_INIT_VAR(&sqlQuery); + ZVAL_EMPTY_STRING(&sqlQuery); } if (Z_TYPE_P(number) == IS_ARRAY) { zephir_array_fetch_long(&_0$$3, number, 0, PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 123 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_CONCAT_SV(_1$$3, " LIMIT ", _0$$3); - zephir_concat_self(&sqlQuery, _1$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_CONCAT_SV(&_1$$3, " LIMIT ", &_0$$3); + zephir_concat_self(&sqlQuery, &_1$$3 TSRMLS_CC); _2$$3 = zephir_array_isset_long(number, 1); if (_2$$3) { zephir_array_fetch_long(&_3$$3, number, 1, PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 125 TSRMLS_CC); - _2$$3 = ((zephir_fast_strlen_ev(_3$$3)) ? 1 : 0); + _2$$3 = ((zephir_fast_strlen_ev(&_3$$3)) ? 1 : 0); } if (_2$$3) { zephir_array_fetch_long(&_4$$4, number, 1, PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 126 TSRMLS_CC); - ZEPHIR_INIT_VAR(_5$$4); - ZEPHIR_CONCAT_SV(_5$$4, " OFFSET ", _4$$4); - zephir_concat_self(&sqlQuery, _5$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$4); + ZEPHIR_CONCAT_SV(&_5$$4, " OFFSET ", &_4$$4); + zephir_concat_self(&sqlQuery, &_5$$4 TSRMLS_CC); } - RETURN_CTOR(sqlQuery); + RETURN_CTOR(&sqlQuery); } - ZEPHIR_CONCAT_VSV(return_value, sqlQuery, " LIMIT ", number); + ZEPHIR_CONCAT_VSV(return_value, &sqlQuery, " LIMIT ", number); RETURN_MM(); } @@ -278,24 +323,27 @@ PHP_METHOD(Phalcon_Db_Dialect, limit) { PHP_METHOD(Phalcon_Db_Dialect, forUpdate) { zval *sqlQuery_param = NULL; - zval *sqlQuery = NULL; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlQuery_param); if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) { - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); } else { - ZEPHIR_INIT_VAR(sqlQuery); - ZVAL_EMPTY_STRING(sqlQuery); + ZEPHIR_INIT_VAR(&sqlQuery); + ZVAL_EMPTY_STRING(&sqlQuery); } - ZEPHIR_CONCAT_VS(return_value, sqlQuery, " FOR UPDATE"); + ZEPHIR_CONCAT_VS(return_value, &sqlQuery, " FOR UPDATE"); RETURN_MM(); } @@ -314,42 +362,50 @@ PHP_METHOD(Phalcon_Db_Dialect, forUpdate) { */ PHP_METHOD(Phalcon_Db_Dialect, getColumnList) { - HashTable *_1; - HashPosition _0; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *columnList_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *columns = NULL, *column = NULL, **_2, *_3$$3 = NULL; - zval *columnList = NULL; + zval escapeChar; + zval *columnList_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, columns, column, *_0, _1$$3; + zval columnList; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&columnList); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &columnList_param, &escapeChar_param, &bindCounts); - columnList = columnList_param; + ZEPHIR_OBS_COPY_OR_DUP(&columnList, columnList_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - ZEPHIR_INIT_VAR(columns); - array_init(columns); - zephir_is_iterable(columnList, &_1, &_0, 0, 0, "phalcon/db/dialect.zep", 169); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(column, _2); - ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "getsqlcolumn", &_4, 43, column, escapeChar, bindCounts); + ZEPHIR_INIT_VAR(&columns); + array_init(&columns); + zephir_is_iterable(&columnList, 0, "phalcon/db/dialect.zep", 169); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columnList), _0) + { + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _0); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "getsqlcolumn", &_2, 36, &column, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_append(&columns, _3$$3, PH_SEPARATE, "phalcon/db/dialect.zep", 166); - } - zephir_fast_join_str(return_value, SL(", "), columns TSRMLS_CC); + zephir_array_append(&columns, &_1$$3, PH_SEPARATE, "phalcon/db/dialect.zep", 166); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); + zephir_fast_join_str(return_value, SL(", "), &columns TSRMLS_CC); RETURN_MM(); } @@ -361,84 +417,95 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlColumn) { zend_bool _3, _1$$4, _2$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *column = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *columnExpression = NULL, *columnAlias = NULL, *columnField = NULL, *columnDomain = NULL, *_4, *_0$$3; + zval escapeChar; + zval *column = NULL, column_sub, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, columnExpression, columnAlias, columnField, columnDomain, _4, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&columnExpression); + ZVAL_UNDEF(&columnAlias); + ZVAL_UNDEF(&columnField); + ZVAL_UNDEF(&columnDomain); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &column, &escapeChar_param, &bindCounts); ZEPHIR_SEPARATE_PARAM(column); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } if (Z_TYPE_P(column) != IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_NULL(_0$$3); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparequalified", NULL, 0, column, _0$$3, escapeChar); + ZVAL_NULL(&_0$$3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparequalified", NULL, 0, column, &_0$$3, &escapeChar); zephir_check_call_status(); RETURN_MM(); } - if (!(zephir_array_isset_string(column, SS("type")))) { - ZEPHIR_OBS_VAR(columnField); + if (!(zephir_array_isset_string(column, SL("type")))) { + ZEPHIR_OBS_VAR(&columnField); zephir_array_fetch_long(&columnField, column, 0, PH_NOISY, "phalcon/db/dialect.zep", 188 TSRMLS_CC); - if (Z_TYPE_P(columnField) == IS_ARRAY) { - ZEPHIR_INIT_VAR(columnExpression); - zephir_create_array(columnExpression, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(columnExpression, SS("type"), SL("scalar"), 1); + if (Z_TYPE_P(&columnField) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&columnExpression); + zephir_create_array(&columnExpression, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&columnExpression, SL("type"), SL("scalar")); zephir_array_update_string(&columnExpression, SL("value"), &columnField, PH_COPY | PH_SEPARATE); - } else if (ZEPHIR_IS_STRING(columnField, "*")) { - ZEPHIR_INIT_NVAR(columnExpression); - zephir_create_array(columnExpression, 1, 0 TSRMLS_CC); - add_assoc_stringl_ex(columnExpression, SS("type"), SL("all"), 1); + } else if (ZEPHIR_IS_STRING(&columnField, "*")) { + ZEPHIR_INIT_NVAR(&columnExpression); + zephir_create_array(&columnExpression, 1, 0 TSRMLS_CC); + add_assoc_stringl_ex(&columnExpression, SL("type"), SL("all")); } else { - ZEPHIR_INIT_NVAR(columnExpression); - zephir_create_array(columnExpression, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(columnExpression, SS("type"), SL("qualified"), 1); + ZEPHIR_INIT_NVAR(&columnExpression); + zephir_create_array(&columnExpression, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&columnExpression, SL("type"), SL("qualified")); zephir_array_update_string(&columnExpression, SL("name"), &columnField, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(columnDomain); + ZEPHIR_OBS_VAR(&columnDomain); _1$$4 = zephir_array_isset_long_fetch(&columnDomain, column, 1, 0 TSRMLS_CC); if (_1$$4) { - _1$$4 = !ZEPHIR_IS_STRING(columnDomain, ""); + _1$$4 = !ZEPHIR_IS_STRING(&columnDomain, ""); } if (_1$$4) { zephir_array_update_string(&columnExpression, SL("domain"), &columnDomain, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(columnAlias); + ZEPHIR_OBS_VAR(&columnAlias); _2$$4 = zephir_array_isset_long_fetch(&columnAlias, column, 2, 0 TSRMLS_CC); if (_2$$4) { - _2$$4 = zephir_is_true(columnAlias); + _2$$4 = zephir_is_true(&columnAlias); } if (_2$$4) { zephir_array_update_string(&columnExpression, SL("sqlAlias"), &columnAlias, PH_COPY | PH_SEPARATE); } } else { - ZEPHIR_CPY_WRT(columnExpression, column); + ZEPHIR_CPY_WRT(&columnExpression, column); } - ZEPHIR_CALL_METHOD(&column, this_ptr, "getsqlexpression", NULL, 0, columnExpression, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(column, this_ptr, "getsqlexpression", NULL, 0, &columnExpression, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(columnAlias); - _3 = zephir_array_isset_string_fetch(&columnAlias, columnExpression, SS("sqlAlias"), 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&columnAlias); + _3 = zephir_array_isset_string_fetch(&columnAlias, &columnExpression, SL("sqlAlias"), 0); if (!(_3)) { - ZEPHIR_OBS_NVAR(columnAlias); - _3 = zephir_array_isset_string_fetch(&columnAlias, columnExpression, SS("alias"), 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&columnAlias); + _3 = zephir_array_isset_string_fetch(&columnAlias, &columnExpression, SL("alias"), 0); } if (_3) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparecolumnalias", NULL, 0, column, columnAlias, escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparecolumnalias", NULL, 0, column, &columnAlias, &escapeChar); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(_4); - ZVAL_NULL(_4); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparecolumnalias", NULL, 0, column, _4, escapeChar); + ZVAL_NULL(&_4); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparecolumnalias", NULL, 0, column, &_4, &escapeChar); zephir_check_call_status(); RETURN_MM(); @@ -451,71 +518,95 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) { zend_bool _1$$9; zend_long ZEPHIR_LAST_CALL_STATUS, i = 0, _2$$9; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *type = NULL, *times = NULL, *postTimes = NULL, *placeholders = NULL, *rawValue = NULL, *value = NULL, *_11, *_12, *_0$$7, *_3$$9 = NULL, _4$$11 = zval_used_for_init, *_5$$11 = NULL, *_6$$8, *_7$$14 = NULL, *_8$$14, *_9$$18 = NULL, *_10$$18; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, type, times, postTimes, placeholders, rawValue, value, _11, _12, _0$$7, _3$$9, _4$$11, _5$$11, _6$$8, _7$$14, _8$$14, _9$$18, _10$$18; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(×); + ZVAL_UNDEF(&postTimes); + ZVAL_UNDEF(&placeholders); + ZVAL_UNDEF(&rawValue); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_0$$7); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$11); + ZVAL_UNDEF(&_5$$11); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$14); + ZVAL_UNDEF(&_8$$14); + ZVAL_UNDEF(&_9$$18); + ZVAL_UNDEF(&_10$$18); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - ZEPHIR_OBS_VAR(type); - if (!(zephir_array_isset_string_fetch(&type, expression, SS("type"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&type); + if (!(zephir_array_isset_string_fetch(&type, &expression, SL("type"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL expression", "phalcon/db/dialect.zep", 249); return; } do { - if (ZEPHIR_IS_STRING(type, "scalar")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionscalar", NULL, 44, expression, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "scalar")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionscalar", NULL, 37, &expression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "object")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionobject", NULL, 45, expression, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "object")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionobject", NULL, 38, &expression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "qualified")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionqualified", NULL, 46, expression, escapeChar); + if (ZEPHIR_IS_STRING(&type, "qualified")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionqualified", NULL, 39, &expression, &escapeChar); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "literal")) { - zephir_array_fetch_string(&_0$$7, expression, SL("value"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 276 TSRMLS_CC); - RETURN_CTOR(_0$$7); + if (ZEPHIR_IS_STRING(&type, "literal")) { + zephir_array_fetch_string(&_0$$7, &expression, SL("value"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 276 TSRMLS_CC); + RETURN_CTOR(&_0$$7); } - if (ZEPHIR_IS_STRING(type, "placeholder")) { - ZEPHIR_OBS_VAR(times); - if (zephir_array_isset_string_fetch(×, expression, SS("times"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(placeholders); - array_init(placeholders); - ZEPHIR_OBS_VAR(rawValue); - zephir_array_fetch_string(&rawValue, expression, SL("rawValue"), PH_NOISY, "phalcon/db/dialect.zep", 282 TSRMLS_CC); - ZEPHIR_OBS_VAR(value); - zephir_array_fetch_string(&value, expression, SL("value"), PH_NOISY, "phalcon/db/dialect.zep", 283 TSRMLS_CC); - ZEPHIR_OBS_VAR(postTimes); - if (zephir_array_isset_fetch(&postTimes, bindCounts, rawValue, 0 TSRMLS_CC)) { - ZEPHIR_CPY_WRT(times, postTimes); + if (ZEPHIR_IS_STRING(&type, "placeholder")) { + ZEPHIR_OBS_VAR(×); + if (zephir_array_isset_string_fetch(×, &expression, SL("times"), 0)) { + ZEPHIR_INIT_VAR(&placeholders); + array_init(&placeholders); + ZEPHIR_OBS_VAR(&rawValue); + zephir_array_fetch_string(&rawValue, &expression, SL("rawValue"), PH_NOISY, "phalcon/db/dialect.zep", 282 TSRMLS_CC); + ZEPHIR_OBS_VAR(&value); + zephir_array_fetch_string(&value, &expression, SL("value"), PH_NOISY, "phalcon/db/dialect.zep", 283 TSRMLS_CC); + ZEPHIR_OBS_VAR(&postTimes); + if (zephir_array_isset_fetch(&postTimes, bindCounts, &rawValue, 0 TSRMLS_CC)) { + ZEPHIR_CPY_WRT(×, &postTimes); } - ZEPHIR_CPY_WRT(_3$$9, times); + ZEPHIR_CPY_WRT(&_3$$9, ×); _2$$9 = 1; _1$$9 = 0; - if (ZEPHIR_GE_LONG(_3$$9, _2$$9)) { + if (ZEPHIR_GE_LONG(&_3$$9, _2$$9)) { while (1) { if (_1$$9) { _2$$9++; - if (!(ZEPHIR_GE_LONG(_3$$9, _2$$9))) { + if (!(ZEPHIR_GE_LONG(&_3$$9, _2$$9))) { break; } } else { @@ -525,79 +616,79 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) { ZEPHIR_SINIT_NVAR(_4$$11); ZVAL_LONG(&_4$$11, ((i - 1))); ZEPHIR_INIT_LNVAR(_5$$11); - ZEPHIR_CONCAT_VV(_5$$11, value, &_4$$11); - zephir_array_append(&placeholders, _5$$11, PH_SEPARATE, "phalcon/db/dialect.zep", 290); + ZEPHIR_CONCAT_VV(&_5$$11, &value, &_4$$11); + zephir_array_append(&placeholders, &_5$$11, PH_SEPARATE, "phalcon/db/dialect.zep", 290); } } - zephir_fast_join_str(return_value, SL(", "), placeholders TSRMLS_CC); + zephir_fast_join_str(return_value, SL(", "), &placeholders TSRMLS_CC); RETURN_MM(); } - zephir_array_fetch_string(&_6$$8, expression, SL("value"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 295 TSRMLS_CC); - RETURN_CTOR(_6$$8); + zephir_array_fetch_string(&_6$$8, &expression, SL("value"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 295 TSRMLS_CC); + RETURN_CTOR(&_6$$8); } - if (ZEPHIR_IS_STRING(type, "binary-op")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionbinaryoperations", NULL, 47, expression, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "binary-op")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionbinaryoperations", NULL, 40, &expression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "unary-op")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionunaryoperations", NULL, 48, expression, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "unary-op")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionunaryoperations", NULL, 41, &expression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "parentheses")) { - zephir_array_fetch_string(&_8$$14, expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 313 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_7$$14, this_ptr, "getsqlexpression", NULL, 49, _8$$14, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "parentheses")) { + zephir_array_fetch_string(&_8$$14, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 313 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_7$$14, this_ptr, "getsqlexpression", NULL, 42, &_8$$14, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, "(", _7$$14, ")"); + ZEPHIR_CONCAT_SVS(return_value, "(", &_7$$14, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "functionCall")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionfunctioncall", NULL, 50, expression, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "functionCall")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionfunctioncall", NULL, 43, &expression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "list")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionlist", NULL, 51, expression, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "list")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionlist", NULL, 44, &expression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "all")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionall", NULL, 52, expression, escapeChar); + if (ZEPHIR_IS_STRING(&type, "all")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionall", NULL, 45, &expression, &escapeChar); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "select")) { - zephir_array_fetch_string(&_10$$18, expression, SL("value"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 337 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_9$$18, this_ptr, "select", NULL, 0, _10$$18); + if (ZEPHIR_IS_STRING(&type, "select")) { + zephir_array_fetch_string(&_10$$18, &expression, SL("value"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 337 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_9$$18, this_ptr, "select", NULL, 0, &_10$$18); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, "(", _9$$18, ")"); + ZEPHIR_CONCAT_SVS(return_value, "(", &_9$$18, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "cast")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncastvalue", NULL, 53, expression, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "cast")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncastvalue", NULL, 46, &expression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "convert")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionconvertvalue", NULL, 54, expression, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "convert")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressionconvertvalue", NULL, 47, &expression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "case")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncase", NULL, 55, expression, escapeChar, bindCounts); + if (ZEPHIR_IS_STRING(&type, "case")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpressioncase", NULL, 48, &expression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } } while(0); - ZEPHIR_INIT_VAR(_11); - object_init_ex(_11, phalcon_db_exception_ce); - ZEPHIR_INIT_VAR(_12); - ZEPHIR_CONCAT_SVS(_12, "Invalid SQL expression type '", type, "'"); - ZEPHIR_CALL_METHOD(NULL, _11, "__construct", NULL, 9, _12); + ZEPHIR_INIT_VAR(&_11); + object_init_ex(&_11, phalcon_db_exception_ce); + ZEPHIR_INIT_VAR(&_12); + ZEPHIR_CONCAT_SVS(&_12, "Invalid SQL expression type '", &type, "'"); + ZEPHIR_CALL_METHOD(NULL, &_11, "__construct", NULL, 4, &_12); zephir_check_call_status(); - zephir_throw_exception_debug(_11, "phalcon/db/dialect.zep", 358 TSRMLS_CC); + zephir_throw_exception_debug(&_11, "phalcon/db/dialect.zep", 358 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -609,32 +700,39 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpression) { PHP_METHOD(Phalcon_Db_Dialect, getSqlTable) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *table, *escapeChar_param = NULL, *tableName = NULL, *schemaName = NULL, *aliasName = NULL; + zval escapeChar; + zval *table, table_sub, *escapeChar_param = NULL, tableName, schemaName, aliasName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table_sub); + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&aliasName); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table, &escapeChar_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (Z_TYPE_P(table) == IS_ARRAY) { - ZEPHIR_OBS_VAR(tableName); + ZEPHIR_OBS_VAR(&tableName); zephir_array_fetch_long(&tableName, table, 0, PH_NOISY, "phalcon/db/dialect.zep", 373 TSRMLS_CC); - ZEPHIR_OBS_VAR(schemaName); + ZEPHIR_OBS_VAR(&schemaName); zephir_array_isset_long_fetch(&schemaName, table, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(aliasName); + ZEPHIR_OBS_VAR(&aliasName); zephir_array_isset_long_fetch(&aliasName, table, 2, 0 TSRMLS_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparetable", NULL, 0, tableName, schemaName, aliasName, escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparetable", NULL, 0, &tableName, &schemaName, &aliasName, &escapeChar); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 56, table, escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 49, table, &escapeChar); zephir_check_call_status(); RETURN_MM(); @@ -647,133 +745,165 @@ PHP_METHOD(Phalcon_Db_Dialect, select) { zend_bool _4, _8, _11, _14, _17, _20, _22; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition_param = NULL, *tables = NULL, *columns = NULL, *sql = NULL, *distinct = NULL, *joins = NULL, *where = NULL, *escapeChar = NULL, *groupBy = NULL, *having = NULL, *orderBy = NULL, *limit = NULL, *forUpdate = NULL, *bindCounts = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3, *_5$$9 = NULL, *_6$$9, *_7$$9, *_9$$10 = NULL, *_10$$10, *_12$$11 = NULL, *_13$$11, *_15$$12 = NULL, *_16$$12, *_18$$13 = NULL, *_19$$13; - zval *definition = NULL, *_21$$14; + zval *definition_param = NULL, tables, columns, sql, distinct, joins, where, escapeChar, groupBy, having, orderBy, limit, forUpdate, bindCounts, _0, _1, _2, _3, _5$$9, _6$$9, _7$$9, _9$$10, _10$$10, _12$$11, _13$$11, _15$$12, _16$$12, _18$$13, _19$$13; + zval definition, _21$$14; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&_21$$14); + ZVAL_UNDEF(&tables); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&distinct); + ZVAL_UNDEF(&joins); + ZVAL_UNDEF(&where); + ZVAL_UNDEF(&escapeChar); + ZVAL_UNDEF(&groupBy); + ZVAL_UNDEF(&having); + ZVAL_UNDEF(&orderBy); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&forUpdate); + ZVAL_UNDEF(&bindCounts); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_6$$9); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_10$$10); + ZVAL_UNDEF(&_12$$11); + ZVAL_UNDEF(&_13$$11); + ZVAL_UNDEF(&_15$$12); + ZVAL_UNDEF(&_16$$12); + ZVAL_UNDEF(&_18$$13); + ZVAL_UNDEF(&_19$$13); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &definition_param); - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - ZEPHIR_OBS_VAR(tables); - if (!(zephir_array_isset_string_fetch(&tables, definition, SS("tables"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&tables); + if (!(zephir_array_isset_string_fetch(&tables, &definition, SL("tables"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'tables' is required in the definition array", "phalcon/db/dialect.zep", 400); return; } - ZEPHIR_OBS_VAR(columns); - if (!(zephir_array_isset_string_fetch(&columns, definition, SS("columns"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&columns); + if (!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'columns' is required in the definition array", "phalcon/db/dialect.zep", 404); return; } - ZEPHIR_OBS_VAR(distinct); - if (zephir_array_isset_string_fetch(&distinct, definition, SS("distinct"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(sql); - if (zephir_is_true(distinct)) { - ZVAL_STRING(sql, "SELECT DISTINCT", 1); + ZEPHIR_OBS_VAR(&distinct); + if (zephir_array_isset_string_fetch(&distinct, &definition, SL("distinct"), 0)) { + ZEPHIR_INIT_VAR(&sql); + if (zephir_is_true(&distinct)) { + ZVAL_STRING(&sql, "SELECT DISTINCT"); } else { - ZVAL_STRING(sql, "SELECT ALL", 1); + ZVAL_STRING(&sql, "SELECT ALL"); } } else { - ZEPHIR_INIT_NVAR(sql); - ZVAL_STRING(sql, "SELECT", 1); - } - ZEPHIR_OBS_VAR(bindCounts); - zephir_array_isset_string_fetch(&bindCounts, definition, SS("bindCounts"), 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(escapeChar); - zephir_read_property_this(&escapeChar, this_ptr, SL("_escapeChar"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getcolumnlist", NULL, 57, columns, escapeChar, bindCounts); + ZEPHIR_INIT_NVAR(&sql); + ZVAL_STRING(&sql, "SELECT"); + } + ZEPHIR_OBS_VAR(&bindCounts); + zephir_array_isset_string_fetch(&bindCounts, &definition, SL("bindCounts"), 0); + ZEPHIR_OBS_VAR(&escapeChar); + zephir_read_property(&escapeChar, this_ptr, SL("_escapeChar"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getcolumnlist", NULL, 50, &columns, &escapeChar, &bindCounts); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, " ", _0); - zephir_concat_self(&sql, _1 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "getsqlexpressionfrom", NULL, 58, tables, escapeChar); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, " ", &_0); + zephir_concat_self(&sql, &_1 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "getsqlexpressionfrom", NULL, 51, &tables, &escapeChar); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SV(_3, " ", _2); - zephir_concat_self(&sql, _3 TSRMLS_CC); - ZEPHIR_OBS_VAR(joins); - _4 = zephir_array_isset_string_fetch(&joins, definition, SS("joins"), 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SV(&_3, " ", &_2); + zephir_concat_self(&sql, &_3 TSRMLS_CC); + ZEPHIR_OBS_VAR(&joins); + _4 = zephir_array_isset_string_fetch(&joins, &definition, SL("joins"), 0); if (_4) { - _4 = zephir_is_true(joins); + _4 = zephir_is_true(&joins); } if (_4) { - zephir_array_fetch_string(&_6$$9, definition, SL("joins"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 437 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_5$$9, this_ptr, "getsqlexpressionjoins", NULL, 59, _6$$9, escapeChar, bindCounts); + zephir_array_fetch_string(&_6$$9, &definition, SL("joins"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 437 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_5$$9, this_ptr, "getsqlexpressionjoins", NULL, 52, &_6$$9, &escapeChar, &bindCounts); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_7$$9); - ZEPHIR_CONCAT_SV(_7$$9, " ", _5$$9); - zephir_concat_self(&sql, _7$$9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_7$$9); + ZEPHIR_CONCAT_SV(&_7$$9, " ", &_5$$9); + zephir_concat_self(&sql, &_7$$9 TSRMLS_CC); } - ZEPHIR_OBS_VAR(where); - _8 = zephir_array_isset_string_fetch(&where, definition, SS("where"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&where); + _8 = zephir_array_isset_string_fetch(&where, &definition, SL("where"), 0); if (_8) { - _8 = zephir_is_true(where); + _8 = zephir_is_true(&where); } if (_8) { - ZEPHIR_CALL_METHOD(&_9$$10, this_ptr, "getsqlexpressionwhere", NULL, 60, where, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(&_9$$10, this_ptr, "getsqlexpressionwhere", NULL, 53, &where, &escapeChar, &bindCounts); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_10$$10); - ZEPHIR_CONCAT_SV(_10$$10, " ", _9$$10); - zephir_concat_self(&sql, _10$$10 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_10$$10); + ZEPHIR_CONCAT_SV(&_10$$10, " ", &_9$$10); + zephir_concat_self(&sql, &_10$$10 TSRMLS_CC); } - ZEPHIR_OBS_VAR(groupBy); - _11 = zephir_array_isset_string_fetch(&groupBy, definition, SS("group"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&groupBy); + _11 = zephir_array_isset_string_fetch(&groupBy, &definition, SL("group"), 0); if (_11) { - _11 = zephir_is_true(groupBy); + _11 = zephir_is_true(&groupBy); } if (_11) { - ZEPHIR_CALL_METHOD(&_12$$11, this_ptr, "getsqlexpressiongroupby", NULL, 61, groupBy, escapeChar); + ZEPHIR_CALL_METHOD(&_12$$11, this_ptr, "getsqlexpressiongroupby", NULL, 54, &groupBy, &escapeChar); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_13$$11); - ZEPHIR_CONCAT_SV(_13$$11, " ", _12$$11); - zephir_concat_self(&sql, _13$$11 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_13$$11); + ZEPHIR_CONCAT_SV(&_13$$11, " ", &_12$$11); + zephir_concat_self(&sql, &_13$$11 TSRMLS_CC); } - ZEPHIR_OBS_VAR(having); - _14 = zephir_array_isset_string_fetch(&having, definition, SS("having"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&having); + _14 = zephir_array_isset_string_fetch(&having, &definition, SL("having"), 0); if (_14) { - _14 = zephir_is_true(having); + _14 = zephir_is_true(&having); } if (_14) { - ZEPHIR_CALL_METHOD(&_15$$12, this_ptr, "getsqlexpressionhaving", NULL, 62, having, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(&_15$$12, this_ptr, "getsqlexpressionhaving", NULL, 55, &having, &escapeChar, &bindCounts); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_16$$12); - ZEPHIR_CONCAT_SV(_16$$12, " ", _15$$12); - zephir_concat_self(&sql, _16$$12 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_16$$12); + ZEPHIR_CONCAT_SV(&_16$$12, " ", &_15$$12); + zephir_concat_self(&sql, &_16$$12 TSRMLS_CC); } - ZEPHIR_OBS_VAR(orderBy); - _17 = zephir_array_isset_string_fetch(&orderBy, definition, SS("order"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&orderBy); + _17 = zephir_array_isset_string_fetch(&orderBy, &definition, SL("order"), 0); if (_17) { - _17 = zephir_is_true(orderBy); + _17 = zephir_is_true(&orderBy); } if (_17) { - ZEPHIR_CALL_METHOD(&_18$$13, this_ptr, "getsqlexpressionorderby", NULL, 63, orderBy, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(&_18$$13, this_ptr, "getsqlexpressionorderby", NULL, 56, &orderBy, &escapeChar, &bindCounts); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_19$$13); - ZEPHIR_CONCAT_SV(_19$$13, " ", _18$$13); - zephir_concat_self(&sql, _19$$13 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_19$$13); + ZEPHIR_CONCAT_SV(&_19$$13, " ", &_18$$13); + zephir_concat_self(&sql, &_19$$13 TSRMLS_CC); } - ZEPHIR_OBS_VAR(limit); - _20 = zephir_array_isset_string_fetch(&limit, definition, SS("limit"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&limit); + _20 = zephir_array_isset_string_fetch(&limit, &definition, SL("limit"), 0); if (_20) { - _20 = zephir_is_true(limit); + _20 = zephir_is_true(&limit); } if (_20) { - ZEPHIR_INIT_VAR(_21$$14); - zephir_create_array(_21$$14, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_21$$14); + zephir_create_array(&_21$$14, 2, 0 TSRMLS_CC); zephir_array_update_string(&_21$$14, SL("sql"), &sql, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_21$$14, SL("value"), &limit, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&sql, this_ptr, "getsqlexpressionlimit", NULL, 64, _21$$14, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(&sql, this_ptr, "getsqlexpressionlimit", NULL, 57, &_21$$14, &escapeChar, &bindCounts); zephir_check_call_status(); } - _22 = zephir_array_isset_string_fetch(&forUpdate, definition, SS("forUpdate"), 1 TSRMLS_CC); + _22 = zephir_array_isset_string_fetch(&forUpdate, &definition, SL("forUpdate"), 1); if (_22) { - _22 = zephir_is_true(forUpdate); + _22 = zephir_is_true(&forUpdate); } if (_22) { zephir_concat_self_str(&sql, SL(" FOR UPDATE") TSRMLS_CC); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -782,7 +912,8 @@ PHP_METHOD(Phalcon_Db_Dialect, select) { */ PHP_METHOD(Phalcon_Db_Dialect, supportsSavepoints) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); @@ -794,6 +925,8 @@ PHP_METHOD(Phalcon_Db_Dialect, supportsSavepoints) { PHP_METHOD(Phalcon_Db_Dialect, supportsReleaseSavepoints) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -809,24 +942,27 @@ PHP_METHOD(Phalcon_Db_Dialect, supportsReleaseSavepoints) { PHP_METHOD(Phalcon_Db_Dialect, createSavepoint) { zval *name_param = NULL; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_CONCAT_SV(return_value, "SAVEPOINT ", name); + ZEPHIR_CONCAT_SV(return_value, "SAVEPOINT ", &name); RETURN_MM(); } @@ -837,24 +973,27 @@ PHP_METHOD(Phalcon_Db_Dialect, createSavepoint) { PHP_METHOD(Phalcon_Db_Dialect, releaseSavepoint) { zval *name_param = NULL; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_CONCAT_SV(return_value, "RELEASE SAVEPOINT ", name); + ZEPHIR_CONCAT_SV(return_value, "RELEASE SAVEPOINT ", &name); RETURN_MM(); } @@ -865,24 +1004,27 @@ PHP_METHOD(Phalcon_Db_Dialect, releaseSavepoint) { PHP_METHOD(Phalcon_Db_Dialect, rollbackSavepoint) { zval *name_param = NULL; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_CONCAT_SV(return_value, "ROLLBACK TO SAVEPOINT ", name); + ZEPHIR_CONCAT_SV(return_value, "ROLLBACK TO SAVEPOINT ", &name); RETURN_MM(); } @@ -893,42 +1035,51 @@ PHP_METHOD(Phalcon_Db_Dialect, rollbackSavepoint) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionScalar) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *value = NULL, *_0$$3; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, value, _0$$3; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - if (zephir_array_isset_string(expression, SS("column"))) { - zephir_array_fetch_string(&_0$$3, expression, SL("column"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 533 TSRMLS_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlcolumn", NULL, 43, _0$$3); + if (zephir_array_isset_string(&expression, SL("column"))) { + zephir_array_fetch_string(&_0$$3, &expression, SL("column"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 533 TSRMLS_CC); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlcolumn", NULL, 36, &_0$$3); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_OBS_VAR(value); - if (!(zephir_array_isset_string_fetch(&value, expression, SS("value"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&value); + if (!(zephir_array_isset_string_fetch(&value, &expression, SL("value"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL expression", "phalcon/db/dialect.zep", 537); return; } - if (Z_TYPE_P(value) == IS_ARRAY) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpression", NULL, 0, value, escapeChar, bindCounts); + if (Z_TYPE_P(&value) == IS_ARRAY) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpression", NULL, 0, &value, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(value); + RETURN_CCTOR(&value); } @@ -939,44 +1090,53 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionObject) { zend_bool _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *domain = NULL, *objectExpression = NULL; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, domain, objectExpression; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&objectExpression); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - ZEPHIR_INIT_VAR(domain); - ZVAL_NULL(domain); - ZEPHIR_INIT_VAR(objectExpression); - zephir_create_array(objectExpression, 1, 0 TSRMLS_CC); - add_assoc_stringl_ex(objectExpression, SS("type"), SL("all"), 1); - ZEPHIR_OBS_NVAR(domain); - _0 = zephir_array_isset_string_fetch(&domain, expression, SS("column"), 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&domain); + ZVAL_NULL(&domain); + ZEPHIR_INIT_VAR(&objectExpression); + zephir_create_array(&objectExpression, 1, 0 TSRMLS_CC); + add_assoc_stringl_ex(&objectExpression, SL("type"), SL("all")); + ZEPHIR_OBS_NVAR(&domain); + _0 = zephir_array_isset_string_fetch(&domain, &expression, SL("column"), 0); if (!(_0)) { - ZEPHIR_OBS_NVAR(domain); - _0 = zephir_array_isset_string_fetch(&domain, expression, SS("domain"), 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&domain); + _0 = zephir_array_isset_string_fetch(&domain, &expression, SL("domain"), 0); } _1 = _0; if (_1) { - _1 = !ZEPHIR_IS_STRING(domain, ""); + _1 = !ZEPHIR_IS_STRING(&domain, ""); } if (_1) { zephir_array_update_string(&objectExpression, SL("domain"), &domain, PH_COPY | PH_SEPARATE); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpression", NULL, 0, objectExpression, escapeChar, bindCounts); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getsqlexpression", NULL, 0, &objectExpression, &escapeChar, bindCounts); zephir_check_call_status(); RETURN_MM(); @@ -988,30 +1148,36 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionObject) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionQualified) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *column = NULL, *domain = NULL; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, column, domain; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &expression_param, &escapeChar_param); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } - ZEPHIR_OBS_VAR(column); - zephir_array_fetch_string(&column, expression, SL("name"), PH_NOISY, "phalcon/db/dialect.zep", 571 TSRMLS_CC); - ZEPHIR_OBS_VAR(domain); - if (!(zephir_array_isset_string_fetch(&domain, expression, SS("domain"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(domain); - ZVAL_NULL(domain); + ZEPHIR_OBS_VAR(&column); + zephir_array_fetch_string(&column, &expression, SL("name"), PH_NOISY, "phalcon/db/dialect.zep", 571 TSRMLS_CC); + ZEPHIR_OBS_VAR(&domain); + if (!(zephir_array_isset_string_fetch(&domain, &expression, SL("domain"), 0))) { + ZEPHIR_INIT_NVAR(&domain); + ZVAL_NULL(&domain); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparequalified", NULL, 0, column, domain, escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparequalified", NULL, 0, &column, &domain, &escapeChar); zephir_check_call_status(); RETURN_MM(); @@ -1023,33 +1189,45 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionQualified) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionBinaryOperations) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *left = NULL, *right = NULL, *_0, *_1, *_2; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, left, right, _0, _1, _2; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&left); + ZVAL_UNDEF(&right); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - zephir_array_fetch_string(&_0, expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 590 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, _0, escapeChar, bindCounts); + zephir_array_fetch_string(&_0, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 590 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_fetch_string(&_1, expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 591 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 49, _1, escapeChar, bindCounts); + zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 591 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 42, &_1, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_fetch_string(&_2, expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 593 TSRMLS_CC); - ZEPHIR_CONCAT_VSVSV(return_value, left, " ", _2, " ", right); + zephir_array_fetch_string(&_2, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 593 TSRMLS_CC); + ZEPHIR_CONCAT_VSVSV(return_value, &left, " ", &_2, " ", &right); RETURN_MM(); } @@ -1060,39 +1238,52 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionBinaryOperations) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionUnaryOperations) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *left = NULL, *right = NULL, *_0$$3 = NULL, *_1$$3, *_2$$4, *_3$$4 = NULL; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, left, right, _0$$3, _1$$3, _2$$4, _3$$4; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&left); + ZVAL_UNDEF(&right); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - ZEPHIR_OBS_VAR(left); - if (zephir_array_isset_string_fetch(&left, expression, SS("left"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getsqlexpression", NULL, 0, left, escapeChar, bindCounts); + ZEPHIR_OBS_VAR(&left); + if (zephir_array_isset_string_fetch(&left, &expression, SL("left"), 0)) { + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getsqlexpression", NULL, 0, &left, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_fetch_string(&_1$$3, expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 607 TSRMLS_CC); - ZEPHIR_CONCAT_VSV(return_value, _0$$3, " ", _1$$3); + zephir_array_fetch_string(&_1$$3, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 607 TSRMLS_CC); + ZEPHIR_CONCAT_VSV(return_value, &_0$$3, " ", &_1$$3); RETURN_MM(); } - ZEPHIR_OBS_VAR(right); - if (zephir_array_isset_string_fetch(&right, expression, SS("right"), 0 TSRMLS_CC)) { - zephir_array_fetch_string(&_2$$4, expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 614 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getsqlexpression", NULL, 49, right, escapeChar, bindCounts); + ZEPHIR_OBS_VAR(&right); + if (zephir_array_isset_string_fetch(&right, &expression, SL("right"), 0)) { + zephir_array_fetch_string(&_2$$4, &expression, SL("op"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 614 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getsqlexpression", NULL, 42, &right, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_CONCAT_VSV(return_value, _2$$4, " ", _3$$4); + ZEPHIR_CONCAT_VSV(return_value, &_2$$4, " ", &_3$$4); RETURN_MM(); } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-unary expression", "phalcon/db/dialect.zep", 617); @@ -1107,57 +1298,69 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFunctionCall) { zend_bool _1, _3$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts, *name = NULL, *customFunction = NULL, *arguments = NULL, *_0, *_4$$4; - zval *expression = NULL, *_2$$4; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts, bindCounts_sub, __$false, name, customFunction, arguments, _0, _4$$4; + zval expression, _2$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&customFunction); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } - ZEPHIR_OBS_VAR(name); - zephir_array_fetch_string(&name, expression, SL("name"), PH_NOISY, "phalcon/db/dialect.zep", 627 TSRMLS_CC); - ZEPHIR_OBS_VAR(customFunction); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_customFunctions"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&customFunction, _0, name, 0 TSRMLS_CC)) { - ZEPHIR_RETURN_CALL_ZVAL_FUNCTION(customFunction, NULL, 0, this_ptr, expression, escapeChar); + ZEPHIR_OBS_VAR(&name); + zephir_array_fetch_string(&name, &expression, SL("name"), PH_NOISY, "phalcon/db/dialect.zep", 627 TSRMLS_CC); + ZEPHIR_OBS_VAR(&customFunction); + zephir_read_property(&_0, this_ptr, SL("_customFunctions"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&customFunction, &_0, &name, 0 TSRMLS_CC)) { + ZEPHIR_RETURN_CALL_ZVAL_FUNCTION(&customFunction, NULL, 0, this_ptr, &expression, &escapeChar); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_OBS_VAR(arguments); - _1 = zephir_array_isset_string_fetch(&arguments, expression, SS("arguments"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&arguments); + _1 = zephir_array_isset_string_fetch(&arguments, &expression, SL("arguments"), 0); if (_1) { - _1 = Z_TYPE_P(arguments) == IS_ARRAY; + _1 = Z_TYPE_P(&arguments) == IS_ARRAY; } if (_1) { - ZEPHIR_INIT_VAR(_2$$4); - zephir_create_array(_2$$4, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(_2$$4, SS("type"), SL("list"), 1); - zephir_array_update_string(&_2$$4, SL("parentheses"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_2$$4); + zephir_create_array(&_2$$4, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_2$$4, SL("type"), SL("list")); + zephir_array_update_string(&_2$$4, SL("parentheses"), &__$false, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_2$$4, SL("value"), &arguments, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&arguments, this_ptr, "getsqlexpression", NULL, 0, _2$$4, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(&arguments, this_ptr, "getsqlexpression", NULL, 0, &_2$$4, &escapeChar, bindCounts); zephir_check_call_status(); - _3$$4 = zephir_array_isset_string(expression, SS("distinct")); + _3$$4 = zephir_array_isset_string(&expression, SL("distinct")); if (_3$$4) { - zephir_array_fetch_string(&_4$$4, expression, SL("distinct"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 641 TSRMLS_CC); - _3$$4 = zephir_is_true(_4$$4); + zephir_array_fetch_string(&_4$$4, &expression, SL("distinct"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 641 TSRMLS_CC); + _3$$4 = zephir_is_true(&_4$$4); } if (_3$$4) { - ZEPHIR_CONCAT_VSVS(return_value, name, "(DISTINCT ", arguments, ")"); + ZEPHIR_CONCAT_VSVS(return_value, &name, "(DISTINCT ", &arguments, ")"); RETURN_MM(); } - ZEPHIR_CONCAT_VSVS(return_value, name, "(", arguments, ")"); + ZEPHIR_CONCAT_VSVS(return_value, &name, "(", &arguments, ")"); RETURN_MM(); } - ZEPHIR_CONCAT_VS(return_value, name, "()"); + ZEPHIR_CONCAT_VS(return_value, &name, "()"); RETURN_MM(); } @@ -1167,71 +1370,83 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFunctionCall) { */ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionList) { - HashTable *_3$$4; - HashPosition _2$$4; - zend_bool _0, _1, _7$$4; - zephir_fcall_cache_entry *_6 = NULL; + zend_bool _0, _1, _5$$4; + zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *items = NULL, *item = NULL, *values = NULL, *separator = NULL, **_4$$4, *_8$$4, *_9$$4, *_5$$5 = NULL; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, items, item, values, separator, *_2$$4, _6$$4, _7$$4, _3$$5; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&items); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&separator); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - ZEPHIR_INIT_VAR(items); - array_init(items); - ZEPHIR_INIT_VAR(separator); - ZVAL_STRING(separator, ", ", 1); - if (zephir_array_isset_string(expression, SS("separator"))) { - ZEPHIR_OBS_NVAR(separator); - zephir_array_fetch_string(&separator, expression, SL("separator"), PH_NOISY, "phalcon/db/dialect.zep", 662 TSRMLS_CC); + ZEPHIR_INIT_VAR(&items); + array_init(&items); + ZEPHIR_INIT_VAR(&separator); + ZVAL_STRING(&separator, ", "); + if (zephir_array_isset_string(&expression, SL("separator"))) { + ZEPHIR_OBS_NVAR(&separator); + zephir_array_fetch_string(&separator, &expression, SL("separator"), PH_NOISY, "phalcon/db/dialect.zep", 662 TSRMLS_CC); } - ZEPHIR_OBS_VAR(values); - _0 = zephir_array_isset_long_fetch(&values, expression, 0, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&values); + _0 = zephir_array_isset_long_fetch(&values, &expression, 0, 0 TSRMLS_CC); if (!(_0)) { - ZEPHIR_OBS_NVAR(values); - _0 = zephir_array_isset_string_fetch(&values, expression, SS("value"), 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&values); + _0 = zephir_array_isset_string_fetch(&values, &expression, SL("value"), 0); } _1 = _0; if (_1) { - _1 = Z_TYPE_P(values) == IS_ARRAY; + _1 = Z_TYPE_P(&values) == IS_ARRAY; } if (_1) { - zephir_is_iterable(values, &_3$$4, &_2$$4, 0, 0, "phalcon/db/dialect.zep", 671); - for ( - ; zend_hash_get_current_data_ex(_3$$4, (void**) &_4$$4, &_2$$4) == SUCCESS - ; zend_hash_move_forward_ex(_3$$4, &_2$$4) - ) { - ZEPHIR_GET_HVALUE(item, _4$$4); - ZEPHIR_CALL_METHOD(&_5$$5, this_ptr, "getsqlexpression", &_6, 0, item, escapeChar, bindCounts); + zephir_is_iterable(&values, 0, "phalcon/db/dialect.zep", 671); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&values), _2$$4) + { + ZEPHIR_INIT_NVAR(&item); + ZVAL_COPY(&item, _2$$4); + ZEPHIR_CALL_METHOD(&_3$$5, this_ptr, "getsqlexpression", &_4, 0, &item, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_append(&items, _5$$5, PH_SEPARATE, "phalcon/db/dialect.zep", 668); + zephir_array_append(&items, &_3$$5, PH_SEPARATE, "phalcon/db/dialect.zep", 668); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&item); + _5$$4 = zephir_array_isset_string(&expression, SL("parentheses")); + if (_5$$4) { + zephir_array_fetch_string(&_6$$4, &expression, SL("parentheses"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 671 TSRMLS_CC); + _5$$4 = ZEPHIR_IS_FALSE_IDENTICAL(&_6$$4); } - _7$$4 = zephir_array_isset_string(expression, SS("parentheses")); - if (_7$$4) { - zephir_array_fetch_string(&_8$$4, expression, SL("parentheses"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 671 TSRMLS_CC); - _7$$4 = ZEPHIR_IS_FALSE_IDENTICAL(_8$$4); - } - if (_7$$4) { - zephir_fast_join(return_value, separator, items TSRMLS_CC); + if (_5$$4) { + zephir_fast_join(return_value, &separator, &items TSRMLS_CC); RETURN_MM(); } - ZEPHIR_INIT_VAR(_9$$4); - zephir_fast_join(_9$$4, separator, items TSRMLS_CC); - ZEPHIR_CONCAT_SVS(return_value, "(", _9$$4, ")"); + ZEPHIR_INIT_VAR(&_7$$4); + zephir_fast_join(&_7$$4, &separator, &items TSRMLS_CC); + ZEPHIR_CONCAT_SVS(return_value, "(", &_7$$4, ")"); RETURN_MM(); } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-list expression", "phalcon/db/dialect.zep", 678); @@ -1245,28 +1460,33 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionList) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionAll) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *domain = NULL, *_0; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, domain, _0; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &expression_param, &escapeChar_param); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } - ZEPHIR_OBS_VAR(domain); - zephir_array_isset_string_fetch(&domain, expression, SS("domain"), 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "*", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparequalified", NULL, 0, _0, domain, escapeChar); - zephir_check_temp_parameter(_0); + ZEPHIR_OBS_VAR(&domain); + zephir_array_isset_string_fetch(&domain, &expression, SL("domain"), 0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "*"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "preparequalified", NULL, 0, &_0, &domain, &escapeChar); zephir_check_call_status(); RETURN_MM(); @@ -1278,32 +1498,43 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionAll) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCastValue) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *left = NULL, *right = NULL, *_0, *_1; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, left, right, _0, _1; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&left); + ZVAL_UNDEF(&right); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - zephir_array_fetch_string(&_0, expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 700 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, _0, escapeChar, bindCounts); + zephir_array_fetch_string(&_0, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 700 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_fetch_string(&_1, expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 701 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 49, _1, escapeChar, bindCounts); + zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 701 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 42, &_1, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "CAST(", left, " AS ", right, ")"); + ZEPHIR_CONCAT_SVSVS(return_value, "CAST(", &left, " AS ", &right, ")"); RETURN_MM(); } @@ -1314,32 +1545,43 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCastValue) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionConvertValue) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *left = NULL, *right = NULL, *_0, *_1; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, left, right, _0, _1; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&left); + ZVAL_UNDEF(&right); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - zephir_array_fetch_string(&_0, expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 713 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, _0, escapeChar, bindCounts); + zephir_array_fetch_string(&_0, &expression, SL("left"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 713 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&left, this_ptr, "getsqlexpression", NULL, 0, &_0, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_fetch_string(&_1, expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 714 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 49, _1, escapeChar, bindCounts); + zephir_array_fetch_string(&_1, &expression, SL("right"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 714 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&right, this_ptr, "getsqlexpression", NULL, 42, &_1, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "CONVERT(", left, " USING ", right, ")"); + ZEPHIR_CONCAT_SVSVS(return_value, "CONVERT(", &left, " USING ", &right, ")"); RETURN_MM(); } @@ -1349,61 +1591,80 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionConvertValue) { */ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCase) { - HashTable *_4; - HashPosition _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *sql = NULL, *whenClause = NULL, *_0 = NULL, *_1, *_2, **_5, *_6$$3, *_7$$4 = NULL, *_8$$4, *_9$$4 = NULL, *_10$$4, *_11$$4 = NULL, *_12$$5 = NULL, *_13$$5, *_14$$5 = NULL; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, sql, whenClause, _0, _1, _2, *_3, _4$$3, _5$$4, _6$$4, _7$$4, _8$$4, _9$$4, _10$$5, _11$$5, _12$$5; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&whenClause); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$4); + ZVAL_UNDEF(&_9$$4); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_12$$5); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - zephir_array_fetch_string(&_1, expression, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 726 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getsqlexpression", NULL, 0, _1, escapeChar, bindCounts); + zephir_array_fetch_string(&_1, &expression, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 726 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getsqlexpression", NULL, 0, &_1, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SV(sql, "CASE ", _0); - zephir_array_fetch_string(&_2, expression, SL("when-clauses"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 728 TSRMLS_CC); - zephir_is_iterable(_2, &_4, &_3, 0, 0, "phalcon/db/dialect.zep", 739); - for ( - ; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS - ; zend_hash_move_forward_ex(_4, &_3) - ) { - ZEPHIR_GET_HVALUE(whenClause, _5); - zephir_array_fetch_string(&_6$$3, whenClause, SL("type"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 729 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_6$$3, "when")) { - zephir_array_fetch_string(&_8$$4, whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 731 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "getsqlexpression", NULL, 49, _8$$4, escapeChar, bindCounts); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SV(&sql, "CASE ", &_0); + zephir_array_fetch_string(&_2, &expression, SL("when-clauses"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 728 TSRMLS_CC); + zephir_is_iterable(&_2, 0, "phalcon/db/dialect.zep", 739); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_2), _3) + { + ZEPHIR_INIT_NVAR(&whenClause); + ZVAL_COPY(&whenClause, _3); + zephir_array_fetch_string(&_4$$3, &whenClause, SL("type"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 729 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_4$$3, "when")) { + zephir_array_fetch_string(&_6$$4, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 731 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "getsqlexpression", NULL, 42, &_6$$4, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_fetch_string(&_10$$4, whenClause, SL("then"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 733 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_9$$4, this_ptr, "getsqlexpression", NULL, 49, _10$$4, escapeChar, bindCounts); + zephir_array_fetch_string(&_8$$4, &whenClause, SL("then"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 733 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "getsqlexpression", NULL, 42, &_8$$4, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_11$$4); - ZEPHIR_CONCAT_SVSV(_11$$4, " WHEN ", _7$$4, " THEN ", _9$$4); - zephir_concat_self(&sql, _11$$4 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_9$$4); + ZEPHIR_CONCAT_SVSV(&_9$$4, " WHEN ", &_5$$4, " THEN ", &_7$$4); + zephir_concat_self(&sql, &_9$$4 TSRMLS_CC); } else { - zephir_array_fetch_string(&_13$$5, whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 735 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "getsqlexpression", NULL, 49, _13$$5, escapeChar, bindCounts); + zephir_array_fetch_string(&_11$$5, &whenClause, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 735 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_10$$5, this_ptr, "getsqlexpression", NULL, 42, &_11$$5, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_14$$5); - ZEPHIR_CONCAT_SV(_14$$5, " ELSE ", _12$$5); - zephir_concat_self(&sql, _14$$5 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_12$$5); + ZEPHIR_CONCAT_SV(&_12$$5, " ELSE ", &_10$$5); + zephir_concat_self(&sql, &_12$$5 TSRMLS_CC); } - } - ZEPHIR_CONCAT_VS(return_value, sql, " END"); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&whenClause); + ZEPHIR_CONCAT_VS(return_value, &sql, " END"); RETURN_MM(); } @@ -1413,44 +1674,50 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionCase) { */ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFrom) { - HashTable *_1$$3; - HashPosition _0$$3; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression, *escapeChar_param = NULL, *table = NULL, *tables = NULL, **_2$$3, *_5$$3, *_3$$4 = NULL; + zval escapeChar; + zval *expression, expression_sub, *escapeChar_param = NULL, table, tables, *_0$$3, _3$$3, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression_sub); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&tables); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &expression, &escapeChar_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (Z_TYPE_P(expression) == IS_ARRAY) { - ZEPHIR_INIT_VAR(tables); - array_init(tables); - zephir_is_iterable(expression, &_1$$3, &_0$$3, 0, 0, "phalcon/db/dialect.zep", 757); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(table, _2$$3); - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getsqltable", &_4, 65, table, escapeChar); + ZEPHIR_INIT_VAR(&tables); + array_init(&tables); + zephir_is_iterable(expression, 0, "phalcon/db/dialect.zep", 757); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(expression), _0$$3) + { + ZEPHIR_INIT_NVAR(&table); + ZVAL_COPY(&table, _0$$3); + ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getsqltable", &_2, 58, &table, &escapeChar); zephir_check_call_status(); - zephir_array_append(&tables, _3$$4, PH_SEPARATE, "phalcon/db/dialect.zep", 754); - } - ZEPHIR_INIT_VAR(_5$$3); - zephir_fast_join_str(_5$$3, SL(", "), tables TSRMLS_CC); - ZEPHIR_CPY_WRT(tables, _5$$3); + zephir_array_append(&tables, &_1$$4, PH_SEPARATE, "phalcon/db/dialect.zep", 754); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&table); + ZEPHIR_INIT_VAR(&_3$$3); + zephir_fast_join_str(&_3$$3, SL(", "), &tables TSRMLS_CC); + ZEPHIR_CPY_WRT(&tables, &_3$$3); } else { - ZEPHIR_CPY_WRT(tables, expression); + ZEPHIR_CPY_WRT(&tables, expression); } - ZEPHIR_CONCAT_SV(return_value, "FROM ", tables); + ZEPHIR_CONCAT_SV(return_value, "FROM ", &tables); RETURN_MM(); } @@ -1460,84 +1727,100 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionFrom) { */ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) { - zend_bool _3$$3, _10$$3; - HashTable *_1, *_6$$6; - HashPosition _0, _5$$6; - zephir_fcall_cache_entry *_4 = NULL, *_12 = NULL; + zend_bool _1$$3, _6$$3; + zephir_fcall_cache_entry *_2 = NULL, *_8 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression, *escapeChar_param = NULL, *bindCounts = NULL, *condition = NULL, *join = NULL, *sql = NULL, *joinCondition = NULL, *joinTable = NULL, *joinType = NULL, *joinConditionsArray = NULL, **_2, *_11$$3, *_13$$3 = NULL, **_7$$6, *_9$$6 = NULL, *_8$$7 = NULL; + zval escapeChar; + zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, condition, join, sql, joinCondition, joinTable, joinType, joinConditionsArray, *_0, _7$$3, _9$$3, *_3$$6, _5$$6, _4$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression_sub); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&condition); + ZVAL_UNDEF(&join); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&joinCondition); + ZVAL_UNDEF(&joinTable); + ZVAL_UNDEF(&joinType); + ZVAL_UNDEF(&joinConditionsArray); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); - } - - - ZEPHIR_INIT_VAR(sql); - ZVAL_STRING(sql, "", 1); - ZEPHIR_INIT_VAR(joinType); - ZVAL_STRING(joinType, "", 1); - zephir_is_iterable(expression, &_1, &_0, 0, 0, "phalcon/db/dialect.zep", 805); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(join, _2); - ZEPHIR_OBS_NVAR(joinConditionsArray); - _3$$3 = zephir_array_isset_string_fetch(&joinConditionsArray, join, SS("conditions"), 0 TSRMLS_CC); - if (_3$$3) { - _3$$3 = !(ZEPHIR_IS_EMPTY(joinConditionsArray)); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; + } + + + ZEPHIR_INIT_VAR(&sql); + ZVAL_STRING(&sql, ""); + ZEPHIR_INIT_VAR(&joinType); + ZVAL_STRING(&joinType, ""); + zephir_is_iterable(expression, 0, "phalcon/db/dialect.zep", 805); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(expression), _0) + { + ZEPHIR_INIT_NVAR(&join); + ZVAL_COPY(&join, _0); + ZEPHIR_OBS_NVAR(&joinConditionsArray); + _1$$3 = zephir_array_isset_string_fetch(&joinConditionsArray, &join, SL("conditions"), 0); + if (_1$$3) { + _1$$3 = !(ZEPHIR_IS_EMPTY(&joinConditionsArray)); } - if (_3$$3) { - if (!(zephir_array_isset_long(joinConditionsArray, 0))) { - ZEPHIR_CALL_METHOD(&joinCondition, this_ptr, "getsqlexpression", &_4, 0, joinConditionsArray, escapeChar, bindCounts); + if (_1$$3) { + if (!(zephir_array_isset_long(&joinConditionsArray, 0))) { + ZEPHIR_CALL_METHOD(&joinCondition, this_ptr, "getsqlexpression", &_2, 0, &joinConditionsArray, &escapeChar, bindCounts); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(joinCondition); - array_init(joinCondition); - zephir_is_iterable(joinConditionsArray, &_6$$6, &_5$$6, 0, 0, "phalcon/db/dialect.zep", 790); - for ( - ; zend_hash_get_current_data_ex(_6$$6, (void**) &_7$$6, &_5$$6) == SUCCESS - ; zend_hash_move_forward_ex(_6$$6, &_5$$6) - ) { - ZEPHIR_GET_HVALUE(condition, _7$$6); - ZEPHIR_CALL_METHOD(&_8$$7, this_ptr, "getsqlexpression", &_4, 49, condition, escapeChar, bindCounts); + ZEPHIR_INIT_NVAR(&joinCondition); + array_init(&joinCondition); + zephir_is_iterable(&joinConditionsArray, 0, "phalcon/db/dialect.zep", 790); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&joinConditionsArray), _3$$6) + { + ZEPHIR_INIT_NVAR(&condition); + ZVAL_COPY(&condition, _3$$6); + ZEPHIR_CALL_METHOD(&_4$$7, this_ptr, "getsqlexpression", &_2, 42, &condition, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_append(&joinCondition, _8$$7, PH_SEPARATE, "phalcon/db/dialect.zep", 787); - } - ZEPHIR_INIT_NVAR(_9$$6); - zephir_fast_join_str(_9$$6, SL(" AND "), joinCondition TSRMLS_CC); - ZEPHIR_CPY_WRT(joinCondition, _9$$6); + zephir_array_append(&joinCondition, &_4$$7, PH_SEPARATE, "phalcon/db/dialect.zep", 787); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&condition); + ZEPHIR_INIT_NVAR(&_5$$6); + zephir_fast_join_str(&_5$$6, SL(" AND "), &joinCondition TSRMLS_CC); + ZEPHIR_CPY_WRT(&joinCondition, &_5$$6); } } else { - ZEPHIR_INIT_NVAR(joinCondition); - ZVAL_LONG(joinCondition, 1); + ZEPHIR_INIT_NVAR(&joinCondition); + ZVAL_LONG(&joinCondition, 1); } - ZEPHIR_OBS_NVAR(joinType); - _10$$3 = zephir_array_isset_string_fetch(&joinType, join, SS("type"), 0 TSRMLS_CC); - if (_10$$3) { - _10$$3 = zephir_is_true(joinType); + ZEPHIR_OBS_NVAR(&joinType); + _6$$3 = zephir_array_isset_string_fetch(&joinType, &join, SL("type"), 0); + if (_6$$3) { + _6$$3 = zephir_is_true(&joinType); } - if (_10$$3) { + if (_6$$3) { zephir_concat_self_str(&joinType, SL(" ") TSRMLS_CC); } - zephir_array_fetch_string(&_11$$3, join, SL("source"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 800 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_12, 65, _11$$3, escapeChar); + zephir_array_fetch_string(&_7$$3, &join, SL("source"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 800 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&joinTable, this_ptr, "getsqltable", &_8, 58, &_7$$3, &escapeChar); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_13$$3); - ZEPHIR_CONCAT_SVSVSV(_13$$3, " ", joinType, "JOIN ", joinTable, " ON ", joinCondition); - zephir_concat_self(&sql, _13$$3 TSRMLS_CC); - } - RETURN_CCTOR(sql); + ZEPHIR_INIT_LNVAR(_9$$3); + ZEPHIR_CONCAT_SVSVSV(&_9$$3, " ", &joinType, "JOIN ", &joinTable, " ON ", &joinCondition); + zephir_concat_self(&sql, &_9$$3 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&join); + RETURN_CCTOR(&sql); } @@ -1547,30 +1830,38 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionJoins) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression, *escapeChar_param = NULL, *bindCounts = NULL, *whereSql = NULL; + zval escapeChar; + zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, whereSql; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression_sub); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&whereSql); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } if (Z_TYPE_P(expression) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&whereSql, this_ptr, "getsqlexpression", NULL, 0, expression, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(&whereSql, this_ptr, "getsqlexpression", NULL, 0, expression, &escapeChar, bindCounts); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(whereSql, expression); + ZEPHIR_CPY_WRT(&whereSql, expression); } - ZEPHIR_CONCAT_SV(return_value, "WHERE ", whereSql); + ZEPHIR_CONCAT_SV(return_value, "WHERE ", &whereSql); RETURN_MM(); } @@ -1580,51 +1871,60 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionWhere) { */ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionGroupBy) { - HashTable *_1$$3; - HashPosition _0$$3; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression, *escapeChar_param = NULL, *bindCounts = NULL, *field = NULL, *fields = NULL, **_2$$3, *_5$$3, *_3$$4 = NULL; + zval escapeChar; + zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, field, fields, *_0$$3, _3$$3, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression_sub); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } if (Z_TYPE_P(expression) == IS_ARRAY) { - ZEPHIR_INIT_VAR(fields); - array_init(fields); - zephir_is_iterable(expression, &_1$$3, &_0$$3, 0, 0, "phalcon/db/dialect.zep", 843); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(field, _2$$3); - if (UNEXPECTED(Z_TYPE_P(field) != IS_ARRAY)) { + ZEPHIR_INIT_VAR(&fields); + array_init(&fields); + zephir_is_iterable(expression, 0, "phalcon/db/dialect.zep", 843); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(expression), _0$$3) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _0$$3); + if (UNEXPECTED(Z_TYPE_P(&field) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-GROUP-BY expression", "phalcon/db/dialect.zep", 837); return; } - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "getsqlexpression", &_4, 0, field, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getsqlexpression", &_2, 0, &field, &escapeChar, bindCounts); zephir_check_call_status(); - zephir_array_append(&fields, _3$$4, PH_SEPARATE, "phalcon/db/dialect.zep", 840); - } - ZEPHIR_INIT_VAR(_5$$3); - zephir_fast_join_str(_5$$3, SL(", "), fields TSRMLS_CC); - ZEPHIR_CPY_WRT(fields, _5$$3); + zephir_array_append(&fields, &_1$$4, PH_SEPARATE, "phalcon/db/dialect.zep", 840); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_INIT_VAR(&_3$$3); + zephir_fast_join_str(&_3$$3, SL(", "), &fields TSRMLS_CC); + ZEPHIR_CPY_WRT(&fields, &_3$$3); } else { - ZEPHIR_CPY_WRT(fields, expression); + ZEPHIR_CPY_WRT(&fields, expression); } - ZEPHIR_CONCAT_SV(return_value, "GROUP BY ", fields); + ZEPHIR_CONCAT_SV(return_value, "GROUP BY ", &fields); RETURN_MM(); } @@ -1635,28 +1935,36 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionGroupBy) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionHaving) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, *_0 = NULL; - zval *expression = NULL; + zval escapeChar; + zval *expression_param = NULL, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, _0; + zval expression; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression_param, &escapeChar_param, &bindCounts); - expression = expression_param; + ZEPHIR_OBS_COPY_OR_DUP(&expression, expression_param); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getsqlexpression", NULL, 0, expression, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getsqlexpression", NULL, 0, &expression, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_CONCAT_SV(return_value, "HAVING ", _0); + ZEPHIR_CONCAT_SV(return_value, "HAVING ", &_0); RETURN_MM(); } @@ -1666,65 +1974,77 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionHaving) { */ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionOrderBy) { - zend_bool _5$$4; - HashTable *_1$$3; - HashPosition _0$$3; - zephir_fcall_cache_entry *_4 = NULL; + zend_bool _3$$4; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression, *escapeChar_param = NULL, *bindCounts = NULL, *field = NULL, *fields = NULL, *type = NULL, *fieldSql = NULL, **_2$$3, *_7$$3, *_3$$4, *_6$$6 = NULL; + zval escapeChar; + zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, field, fields, type, fieldSql, *_0$$3, _5$$3, _1$$4, _4$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression_sub); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&fieldSql); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&escapeChar); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - ZEPHIR_INIT_VAR(fieldSql); - ZVAL_NULL(fieldSql); + ZEPHIR_INIT_VAR(&fieldSql); + ZVAL_NULL(&fieldSql); if (Z_TYPE_P(expression) == IS_ARRAY) { - ZEPHIR_INIT_VAR(fields); - array_init(fields); - zephir_is_iterable(expression, &_1$$3, &_0$$3, 0, 0, "phalcon/db/dialect.zep", 889); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(field, _2$$3); - if (UNEXPECTED(Z_TYPE_P(field) != IS_ARRAY)) { + ZEPHIR_INIT_VAR(&fields); + array_init(&fields); + zephir_is_iterable(expression, 0, "phalcon/db/dialect.zep", 889); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(expression), _0$$3) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _0$$3); + if (UNEXPECTED(Z_TYPE_P(&field) != IS_ARRAY)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Invalid SQL-ORDER-BY expression", "phalcon/db/dialect.zep", 874); return; } - zephir_array_fetch_long(&_3$$4, field, 0, PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 877 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&fieldSql, this_ptr, "getsqlexpression", &_4, 0, _3$$4, escapeChar, bindCounts); + zephir_array_fetch_long(&_1$$4, &field, 0, PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 877 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&fieldSql, this_ptr, "getsqlexpression", &_2, 0, &_1$$4, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(type); - _5$$4 = zephir_array_isset_long_fetch(&type, field, 1, 0 TSRMLS_CC); - if (_5$$4) { - _5$$4 = !ZEPHIR_IS_STRING(type, ""); + ZEPHIR_OBS_NVAR(&type); + _3$$4 = zephir_array_isset_long_fetch(&type, &field, 1, 0 TSRMLS_CC); + if (_3$$4) { + _3$$4 = !ZEPHIR_IS_STRING(&type, ""); } - if (_5$$4) { - ZEPHIR_INIT_LNVAR(_6$$6); - ZEPHIR_CONCAT_SV(_6$$6, " ", type); - zephir_concat_self(&fieldSql, _6$$6 TSRMLS_CC); + if (_3$$4) { + ZEPHIR_INIT_LNVAR(_4$$6); + ZEPHIR_CONCAT_SV(&_4$$6, " ", &type); + zephir_concat_self(&fieldSql, &_4$$6 TSRMLS_CC); } - zephir_array_append(&fields, fieldSql, PH_SEPARATE, "phalcon/db/dialect.zep", 886); - } - ZEPHIR_INIT_VAR(_7$$3); - zephir_fast_join_str(_7$$3, SL(", "), fields TSRMLS_CC); - ZEPHIR_CPY_WRT(fields, _7$$3); + zephir_array_append(&fields, &fieldSql, PH_SEPARATE, "phalcon/db/dialect.zep", 886); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_INIT_VAR(&_5$$3); + zephir_fast_join_str(&_5$$3, SL(", "), &fields TSRMLS_CC); + ZEPHIR_CPY_WRT(&fields, &_5$$3); } else { - ZEPHIR_CPY_WRT(fields, expression); + ZEPHIR_CPY_WRT(&fields, expression); } - ZEPHIR_CONCAT_SV(return_value, "ORDER BY ", fields); + ZEPHIR_CONCAT_SV(return_value, "ORDER BY ", &fields); RETURN_MM(); } @@ -1735,64 +2055,79 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionOrderBy) { PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionLimit) { zend_bool _2$$4; - zval *_4; + zval _4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *escapeChar = NULL; - zval *expression, *escapeChar_param = NULL, *bindCounts = NULL, *sql = NULL, *value = NULL, *limit = NULL, *offset = NULL, *_0$$4, *_1$$5, *_3$$7 = NULL; + zval escapeChar; + zval *expression, expression_sub, *escapeChar_param = NULL, *bindCounts = NULL, bindCounts_sub, __$null, sql, value, limit, offset, _0$$4, _1$$5, _3$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expression_sub); + ZVAL_UNDEF(&bindCounts_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&offset); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&escapeChar); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &expression, &escapeChar_param, &bindCounts); if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } if (!bindCounts) { - bindCounts = ZEPHIR_GLOBAL(global_null); + bindCounts = &bindCounts_sub; + bindCounts = &__$null; } - ZEPHIR_INIT_VAR(sql); - ZVAL_STRING(sql, "", 1); - ZEPHIR_INIT_VAR(offset); - ZVAL_NULL(offset); - ZEPHIR_OBS_VAR(value); + ZEPHIR_INIT_VAR(&sql); + ZVAL_STRING(&sql, ""); + ZEPHIR_INIT_VAR(&offset); + ZVAL_NULL(&offset); + ZEPHIR_OBS_VAR(&value); zephir_array_fetch_string(&value, expression, SL("value"), PH_NOISY, "phalcon/db/dialect.zep", 904 TSRMLS_CC); - if (zephir_array_isset_string(expression, SS("sql"))) { - ZEPHIR_OBS_NVAR(sql); + if (zephir_array_isset_string(expression, SL("sql"))) { + ZEPHIR_OBS_NVAR(&sql); zephir_array_fetch_string(&sql, expression, SL("sql"), PH_NOISY, "phalcon/db/dialect.zep", 907 TSRMLS_CC); } - if (Z_TYPE_P(value) == IS_ARRAY) { - ZEPHIR_OBS_VAR(_0$$4); - zephir_array_fetch_string(&_0$$4, value, SL("number"), PH_NOISY, "phalcon/db/dialect.zep", 912 TSRMLS_CC); - if (Z_TYPE_P(_0$$4) == IS_ARRAY) { - zephir_array_fetch_string(&_1$$5, value, SL("number"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 913 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&limit, this_ptr, "getsqlexpression", NULL, 0, _1$$5, escapeChar, bindCounts); + if (Z_TYPE_P(&value) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&_0$$4); + zephir_array_fetch_string(&_0$$4, &value, SL("number"), PH_NOISY, "phalcon/db/dialect.zep", 912 TSRMLS_CC); + if (Z_TYPE_P(&_0$$4) == IS_ARRAY) { + zephir_array_fetch_string(&_1$$5, &value, SL("number"), PH_NOISY | PH_READONLY, "phalcon/db/dialect.zep", 913 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&limit, this_ptr, "getsqlexpression", NULL, 0, &_1$$5, &escapeChar, bindCounts); zephir_check_call_status(); } else { - ZEPHIR_OBS_NVAR(limit); - zephir_array_fetch_string(&limit, value, SL("number"), PH_NOISY, "phalcon/db/dialect.zep", 915 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&limit); + zephir_array_fetch_string(&limit, &value, SL("number"), PH_NOISY, "phalcon/db/dialect.zep", 915 TSRMLS_CC); } - ZEPHIR_OBS_NVAR(offset); - _2$$4 = zephir_array_isset_string_fetch(&offset, value, SS("offset"), 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&offset); + _2$$4 = zephir_array_isset_string_fetch(&offset, &value, SL("offset"), 0); if (_2$$4) { - _2$$4 = Z_TYPE_P(offset) == IS_ARRAY; + _2$$4 = Z_TYPE_P(&offset) == IS_ARRAY; } if (_2$$4) { - ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "getsqlexpression", NULL, 49, offset, escapeChar, bindCounts); + ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "getsqlexpression", NULL, 42, &offset, &escapeChar, bindCounts); zephir_check_call_status(); - ZEPHIR_CPY_WRT(offset, _3$$7); + ZEPHIR_CPY_WRT(&offset, &_3$$7); } } else { - ZEPHIR_CPY_WRT(limit, value); + ZEPHIR_CPY_WRT(&limit, &value); } - ZEPHIR_INIT_VAR(_4); - zephir_create_array(_4, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_4, limit); - zephir_array_fast_append(_4, offset); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "limit", NULL, 0, sql, _4); + ZEPHIR_INIT_VAR(&_4); + zephir_create_array(&_4, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_4, &limit); + zephir_array_fast_append(&_4, &offset); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "limit", NULL, 0, &sql, &_4); zephir_check_call_status(); RETURN_MM(); @@ -1804,43 +2139,49 @@ PHP_METHOD(Phalcon_Db_Dialect, getSqlExpressionLimit) { PHP_METHOD(Phalcon_Db_Dialect, prepareColumnAlias) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *qualified_param = NULL, *alias_param = NULL, *escapeChar_param = NULL, *_0$$3 = NULL; - zval *qualified = NULL, *alias = NULL, *escapeChar = NULL; + zval *qualified_param = NULL, *alias_param = NULL, *escapeChar_param = NULL, _0$$3; + zval qualified, alias, escapeChar; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&qualified); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&escapeChar); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &qualified_param, &alias_param, &escapeChar_param); if (UNEXPECTED(Z_TYPE_P(qualified_param) != IS_STRING && Z_TYPE_P(qualified_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'qualified' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'qualified' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(qualified_param) == IS_STRING)) { - zephir_get_strval(qualified, qualified_param); + zephir_get_strval(&qualified, qualified_param); } else { - ZEPHIR_INIT_VAR(qualified); - ZVAL_EMPTY_STRING(qualified); + ZEPHIR_INIT_VAR(&qualified); + ZVAL_EMPTY_STRING(&qualified); } if (!alias_param) { - ZEPHIR_INIT_VAR(alias); - ZVAL_EMPTY_STRING(alias); + ZEPHIR_INIT_VAR(&alias); + ZVAL_STRING(&alias, ""); } else { - zephir_get_strval(alias, alias_param); + zephir_get_strval(&alias, alias_param); } if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } - if (!ZEPHIR_IS_STRING(alias, "")) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "escape", NULL, 56, alias, escapeChar); + if (!ZEPHIR_IS_STRING(&alias, "")) { + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "escape", NULL, 49, &alias, &escapeChar); zephir_check_call_status(); - ZEPHIR_CONCAT_VSV(return_value, qualified, " AS ", _0$$3); + ZEPHIR_CONCAT_VSV(return_value, &qualified, " AS ", &_0$$3); RETURN_MM(); } - RETURN_CTOR(qualified); + RETURN_CTOR(&qualified); } @@ -1850,60 +2191,71 @@ PHP_METHOD(Phalcon_Db_Dialect, prepareColumnAlias) { PHP_METHOD(Phalcon_Db_Dialect, prepareTable) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *alias_param = NULL, *escapeChar_param = NULL, *_0 = NULL, *_1$$3 = NULL, *_2$$3, *_3$$4 = NULL, *_4$$4; - zval *table = NULL, *schema = NULL, *alias = NULL, *escapeChar = NULL; + zval *table_param = NULL, *schema_param = NULL, *alias_param = NULL, *escapeChar_param = NULL, _0, _1$$3, _2$$3, _3$$4, _4$$4; + zval table, schema, alias, escapeChar; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&escapeChar); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &table_param, &schema_param, &alias_param, &escapeChar_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } if (!alias_param) { - ZEPHIR_INIT_VAR(alias); - ZVAL_EMPTY_STRING(alias); + ZEPHIR_INIT_VAR(&alias); + ZVAL_STRING(&alias, ""); } else { - zephir_get_strval(alias, alias_param); + zephir_get_strval(&alias, alias_param); } if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 56, table, escapeChar); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 49, &table, &escapeChar); zephir_check_call_status(); - zephir_get_strval(table, _0); - if (!ZEPHIR_IS_STRING(schema, "")) { - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "escapeschema", NULL, 66, schema, escapeChar); + zephir_get_strval(&table, &_0); + if (!ZEPHIR_IS_STRING(&schema, "")) { + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "escapeschema", NULL, 59, &schema, &escapeChar); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_VSV(_2$$3, _1$$3, ".", table); - zephir_get_strval(table, _2$$3); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_VSV(&_2$$3, &_1$$3, ".", &table); + zephir_get_strval(&table, &_2$$3); } - if (!ZEPHIR_IS_STRING(alias, "")) { - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "escape", NULL, 56, alias, escapeChar); + if (!ZEPHIR_IS_STRING(&alias, "")) { + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "escape", NULL, 49, &alias, &escapeChar); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4$$4); - ZEPHIR_CONCAT_VSV(_4$$4, table, " AS ", _3$$4); - zephir_get_strval(table, _4$$4); + ZEPHIR_INIT_VAR(&_4$$4); + ZEPHIR_CONCAT_VSV(&_4$$4, &table, " AS ", &_3$$4); + zephir_get_strval(&table, &_4$$4); } - RETURN_CTOR(table); + RETURN_CTOR(&table); } @@ -1914,43 +2266,49 @@ PHP_METHOD(Phalcon_Db_Dialect, prepareQualified) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *column_param = NULL, *domain_param = NULL, *escapeChar_param = NULL; - zval *column = NULL, *domain = NULL, *escapeChar = NULL, *_0$$3; + zval column, domain, escapeChar, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&escapeChar); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &column_param, &domain_param, &escapeChar_param); if (UNEXPECTED(Z_TYPE_P(column_param) != IS_STRING && Z_TYPE_P(column_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'column' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'column' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(column_param) == IS_STRING)) { - zephir_get_strval(column, column_param); + zephir_get_strval(&column, column_param); } else { - ZEPHIR_INIT_VAR(column); - ZVAL_EMPTY_STRING(column); + ZEPHIR_INIT_VAR(&column); + ZVAL_EMPTY_STRING(&column); } if (!domain_param) { - ZEPHIR_INIT_VAR(domain); - ZVAL_EMPTY_STRING(domain); + ZEPHIR_INIT_VAR(&domain); + ZVAL_STRING(&domain, ""); } else { - zephir_get_strval(domain, domain_param); + zephir_get_strval(&domain, domain_param); } if (!escapeChar_param) { - ZEPHIR_INIT_VAR(escapeChar); - ZVAL_EMPTY_STRING(escapeChar); + ZEPHIR_INIT_VAR(&escapeChar); + ZVAL_STRING(&escapeChar, ""); } else { - zephir_get_strval(escapeChar, escapeChar_param); + zephir_get_strval(&escapeChar, escapeChar_param); } - if (!ZEPHIR_IS_STRING(domain, "")) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_VSV(_0$$3, domain, ".", column); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 56, _0$$3, escapeChar); + if (!ZEPHIR_IS_STRING(&domain, "")) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_VSV(&_0$$3, &domain, ".", &column); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 49, &_0$$3, &escapeChar); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 56, column, escapeChar); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "escape", NULL, 49, &column, &escapeChar); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/db/dialect.zep.h b/ext/phalcon/db/dialect.zep.h index 9c08b0b1182..c3ba14fa975 100644 --- a/ext/phalcon/db/dialect.zep.h +++ b/ext/phalcon/db/dialect.zep.h @@ -41,196 +41,521 @@ PHP_METHOD(Phalcon_Db_Dialect, prepareColumnAlias); PHP_METHOD(Phalcon_Db_Dialect, prepareTable); PHP_METHOD(Phalcon_Db_Dialect, prepareQualified); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_registercustomfunction, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_dialect_registercustomfunction, 0, 2, Phalcon\\Db\\Dialect, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_registercustomfunction, 0, 2, IS_OBJECT, "Phalcon\\Db\\Dialect", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, customFunction) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_escapeschema, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getcustomfunctions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getcustomfunctions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_escapeschema, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_escapeschema, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +#else ZEND_ARG_INFO(0, str) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_escape, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_escape, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_escape, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +#else ZEND_ARG_INFO(0, str) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_limit, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_limit, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_limit, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_forupdate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_forupdate, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_forupdate, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getcolumnlist, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getcolumnlist, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getcolumnlist, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, columnList, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlcolumn, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlcolumn, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlcolumn, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, column) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpression, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpression, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpression, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqltable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqltable, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqltable, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, table) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_select, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_select, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_select, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_createsavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_supportssavepoints, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_supportssavepoints, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_supportsreleasesavepoints, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_supportsreleasesavepoints, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_createsavepoint, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_createsavepoint, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_releasesavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_releasesavepoint, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_releasesavepoint, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_rollbacksavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_rollbacksavepoint, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_rollbacksavepoint, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionscalar, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionscalar, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionscalar, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionobject, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionobject, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionobject, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionqualified, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionqualified, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionqualified, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionbinaryoperations, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionbinaryoperations, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionbinaryoperations, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionunaryoperations, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionunaryoperations, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionunaryoperations, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionfunctioncall, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionfunctioncall, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionfunctioncall, 0, 2, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionlist, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionlist, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionlist, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionall, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionall, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionall, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressioncastvalue, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressioncastvalue, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressioncastvalue, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionconvertvalue, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionconvertvalue, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionconvertvalue, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressioncase, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressioncase, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressioncase, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionfrom, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionfrom, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionfrom, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, expression) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionjoins, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionjoins, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionjoins, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, expression) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionwhere, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionwhere, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, expression) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressiongroupby, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressiongroupby, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressiongroupby, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, expression) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionhaving, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionhaving, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionhaving, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expression, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionorderby, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionorderby, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionorderby, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, expression) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionlimit, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionlimit, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_getsqlexpressionlimit, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, expression) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_ARG_INFO(0, bindCounts) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_preparecolumnalias, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_preparecolumnalias, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_preparecolumnalias, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, qualified, IS_STRING, 0) +#else ZEND_ARG_INFO(0, qualified) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 1) +#else ZEND_ARG_INFO(0, alias) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_preparetable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_preparetable, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_preparetable, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 1) +#else ZEND_ARG_INFO(0, alias) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_preparequalified, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_preparequalified, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_preparequalified, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, column, IS_STRING, 0) +#else ZEND_ARG_INFO(0, column) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 1) +#else ZEND_ARG_INFO(0, domain) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, escapeChar, IS_STRING, 1) +#else ZEND_ARG_INFO(0, escapeChar) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_dialect_method_entry) { PHP_ME(Phalcon_Db_Dialect, registerCustomFunction, arginfo_phalcon_db_dialect_registercustomfunction, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Dialect, getCustomFunctions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Dialect, getCustomFunctions, arginfo_phalcon_db_dialect_getcustomfunctions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Dialect, escapeSchema, arginfo_phalcon_db_dialect_escapeschema, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Db_Dialect, escape, arginfo_phalcon_db_dialect_escape, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Db_Dialect, limit, arginfo_phalcon_db_dialect_limit, ZEND_ACC_PUBLIC) @@ -240,8 +565,8 @@ ZEPHIR_INIT_FUNCS(phalcon_db_dialect_method_entry) { PHP_ME(Phalcon_Db_Dialect, getSqlExpression, arginfo_phalcon_db_dialect_getsqlexpression, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Dialect, getSqlTable, arginfo_phalcon_db_dialect_getsqltable, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Db_Dialect, select, arginfo_phalcon_db_dialect_select, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Dialect, supportsSavepoints, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Dialect, supportsReleaseSavepoints, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Dialect, supportsSavepoints, arginfo_phalcon_db_dialect_supportssavepoints, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Dialect, supportsReleaseSavepoints, arginfo_phalcon_db_dialect_supportsreleasesavepoints, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Dialect, createSavepoint, arginfo_phalcon_db_dialect_createsavepoint, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Dialect, releaseSavepoint, arginfo_phalcon_db_dialect_releasesavepoint, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Dialect, rollbackSavepoint, arginfo_phalcon_db_dialect_rollbacksavepoint, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/db/dialect/mysql.zep.c b/ext/phalcon/db/dialect/mysql.zep.c index 1b744fe61c8..9a42a31f0a8 100644 --- a/ext/phalcon/db/dialect/mysql.zep.c +++ b/ext/phalcon/db/dialect/mysql.zep.c @@ -42,265 +42,304 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Dialect_Mysql) { */ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) { - HashTable *_24$$51; - HashPosition _23$$51; - zephir_fcall_cache_entry *_28 = NULL; + zephir_fcall_cache_entry *_26 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *column, *columnSql = NULL, *size = NULL, *scale = NULL, *type = NULL, *typeValues = NULL, *_0$$4 = NULL, *_1$$4, *_2$$4 = NULL, *_3$$9 = NULL, *_4$$9, *_5$$11 = NULL, *_6$$11 = NULL, *_7$$11, *_8$$11 = NULL, *_9$$18 = NULL, *_10$$18, *_11$$27, *_12$$28, *_13$$24 = NULL, *_14$$32, *_15$$33, *_16$$30 = NULL, *_17$$38 = NULL, *_18$$38, *_19$$36 = NULL, *_20$$49, *_21$$49 = NULL, *_22$$49, *value$$51 = NULL, *valueSql$$51 = NULL, **_25$$51, _30$$51, _31$$51, *_32$$51, *_33$$51, _26$$52 = zval_used_for_init, *_27$$52 = NULL, *_29$$52 = NULL, _34$$53, *_35$$53 = NULL, *_36$$53; + zval *column, column_sub, columnSql, size, scale, type, typeValues, _0$$4, _1$$4, _2$$4, _3$$9, _4$$9, _5$$11, _6$$11, _7$$11, _8$$11, _9$$18, _10$$18, _11$$27, _12$$28, _13$$24, _14$$32, _15$$33, _16$$30, _17$$38, _18$$38, _19$$36, _20$$49, _21$$49, _22$$49, value$$51, valueSql$$51, *_23$$51, _28$$51, _29$$51, _30$$51, _31$$51, _24$$52, _25$$52, _27$$52, _32$$53, _33$$53, _34$$53; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&columnSql); + ZVAL_UNDEF(&size); + ZVAL_UNDEF(&scale); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&typeValues); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&_5$$11); + ZVAL_UNDEF(&_6$$11); + ZVAL_UNDEF(&_7$$11); + ZVAL_UNDEF(&_8$$11); + ZVAL_UNDEF(&_9$$18); + ZVAL_UNDEF(&_10$$18); + ZVAL_UNDEF(&_11$$27); + ZVAL_UNDEF(&_12$$28); + ZVAL_UNDEF(&_13$$24); + ZVAL_UNDEF(&_14$$32); + ZVAL_UNDEF(&_15$$33); + ZVAL_UNDEF(&_16$$30); + ZVAL_UNDEF(&_17$$38); + ZVAL_UNDEF(&_18$$38); + ZVAL_UNDEF(&_19$$36); + ZVAL_UNDEF(&_20$$49); + ZVAL_UNDEF(&_21$$49); + ZVAL_UNDEF(&_22$$49); + ZVAL_UNDEF(&value$$51); + ZVAL_UNDEF(&valueSql$$51); + ZVAL_UNDEF(&_28$$51); + ZVAL_UNDEF(&_29$$51); + ZVAL_UNDEF(&_30$$51); + ZVAL_UNDEF(&_31$$51); + ZVAL_UNDEF(&_24$$52); + ZVAL_UNDEF(&_25$$52); + ZVAL_UNDEF(&_27$$52); + ZVAL_UNDEF(&_32$$53); + ZVAL_UNDEF(&_33$$53); + ZVAL_UNDEF(&_34$$53); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &column); - ZEPHIR_INIT_VAR(columnSql); - ZVAL_STRING(columnSql, "", 1); + ZEPHIR_INIT_VAR(&columnSql); + ZVAL_STRING(&columnSql, ""); ZEPHIR_CALL_METHOD(&type, column, "gettype", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(type) == IS_STRING) { - zephir_concat_self(&columnSql, type TSRMLS_CC); + if (Z_TYPE_P(&type) == IS_STRING) { + zephir_concat_self(&columnSql, &type TSRMLS_CC); ZEPHIR_CALL_METHOD(&type, column, "gettypereference", NULL, 0); zephir_check_call_status(); } do { - if (ZEPHIR_IS_LONG(type, 0)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 0)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("INT") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_0$$4, column, "getsize", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_SVS(_1$$4, "(", _0$$4, ")"); - zephir_concat_self(&columnSql, _1$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_SVS(&_1$$4, "(", &_0$$4, ")"); + zephir_concat_self(&columnSql, &_1$$4 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_2$$4, column, "isunsigned", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_2$$4)) { + if (zephir_is_true(&_2$$4)) { zephir_concat_self_str(&columnSql, SL(" UNSIGNED") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 1)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 1)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DATE") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 2)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 2)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("VARCHAR") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_3$$9, column, "getsize", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4$$9); - ZEPHIR_CONCAT_SVS(_4$$9, "(", _3$$9, ")"); - zephir_concat_self(&columnSql, _4$$9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$9); + ZEPHIR_CONCAT_SVS(&_4$$9, "(", &_3$$9, ")"); + zephir_concat_self(&columnSql, &_4$$9 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 3)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 3)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DECIMAL") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_5$$11, column, "getsize", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_6$$11, column, "getscale", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_7$$11); - ZEPHIR_CONCAT_SVSVS(_7$$11, "(", _5$$11, ",", _6$$11, ")"); - zephir_concat_self(&columnSql, _7$$11 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_7$$11); + ZEPHIR_CONCAT_SVSVS(&_7$$11, "(", &_5$$11, ",", &_6$$11, ")"); + zephir_concat_self(&columnSql, &_7$$11 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_8$$11, column, "isunsigned", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_8$$11)) { + if (zephir_is_true(&_8$$11)) { zephir_concat_self_str(&columnSql, SL(" UNSIGNED") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 4)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 4)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DATETIME") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 17)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 17)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TIMESTAMP") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 5)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 5)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("CHAR") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_9$$18, column, "getsize", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_10$$18); - ZEPHIR_CONCAT_SVS(_10$$18, "(", _9$$18, ")"); - zephir_concat_self(&columnSql, _10$$18 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_10$$18); + ZEPHIR_CONCAT_SVS(&_10$$18, "(", &_9$$18, ")"); + zephir_concat_self(&columnSql, &_10$$18 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 6)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 6)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TEXT") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 8)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 8)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TINYINT(1)") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 7)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 7)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("FLOAT") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&size, column, "getsize", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(size)) { + if (zephir_is_true(&size)) { ZEPHIR_CALL_METHOD(&scale, column, "getscale", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(scale)) { - ZEPHIR_INIT_VAR(_11$$27); - ZEPHIR_CONCAT_SVSVS(_11$$27, "(", size, ",", scale, ")"); - zephir_concat_self(&columnSql, _11$$27 TSRMLS_CC); + if (zephir_is_true(&scale)) { + ZEPHIR_INIT_VAR(&_11$$27); + ZEPHIR_CONCAT_SVSVS(&_11$$27, "(", &size, ",", &scale, ")"); + zephir_concat_self(&columnSql, &_11$$27 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_12$$28); - ZEPHIR_CONCAT_SVS(_12$$28, "(", size, ")"); - zephir_concat_self(&columnSql, _12$$28 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_12$$28); + ZEPHIR_CONCAT_SVS(&_12$$28, "(", &size, ")"); + zephir_concat_self(&columnSql, &_12$$28 TSRMLS_CC); } } ZEPHIR_CALL_METHOD(&_13$$24, column, "isunsigned", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_13$$24)) { + if (zephir_is_true(&_13$$24)) { zephir_concat_self_str(&columnSql, SL(" UNSIGNED") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 9)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 9)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DOUBLE") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&size, column, "getsize", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(size)) { + if (zephir_is_true(&size)) { ZEPHIR_CALL_METHOD(&scale, column, "getscale", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_14$$32); - ZEPHIR_CONCAT_SV(_14$$32, "(", size); - zephir_concat_self(&columnSql, _14$$32 TSRMLS_CC); - if (zephir_is_true(scale)) { - ZEPHIR_INIT_VAR(_15$$33); - ZEPHIR_CONCAT_SVS(_15$$33, ",", scale, ")"); - zephir_concat_self(&columnSql, _15$$33 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_14$$32); + ZEPHIR_CONCAT_SV(&_14$$32, "(", &size); + zephir_concat_self(&columnSql, &_14$$32 TSRMLS_CC); + if (zephir_is_true(&scale)) { + ZEPHIR_INIT_VAR(&_15$$33); + ZEPHIR_CONCAT_SVS(&_15$$33, ",", &scale, ")"); + zephir_concat_self(&columnSql, &_15$$33 TSRMLS_CC); } else { zephir_concat_self_str(&columnSql, SL(")") TSRMLS_CC); } } ZEPHIR_CALL_METHOD(&_16$$30, column, "isunsigned", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_16$$30)) { + if (zephir_is_true(&_16$$30)) { zephir_concat_self_str(&columnSql, SL(" UNSIGNED") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 14)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 14)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("BIGINT") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&scale, column, "getsize", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(scale)) { + if (zephir_is_true(&scale)) { ZEPHIR_CALL_METHOD(&_17$$38, column, "getsize", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_18$$38); - ZEPHIR_CONCAT_SVS(_18$$38, "(", _17$$38, ")"); - zephir_concat_self(&columnSql, _18$$38 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_18$$38); + ZEPHIR_CONCAT_SVS(&_18$$38, "(", &_17$$38, ")"); + zephir_concat_self(&columnSql, &_18$$38 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_19$$36, column, "isunsigned", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_19$$36)) { + if (zephir_is_true(&_19$$36)) { zephir_concat_self_str(&columnSql, SL(" UNSIGNED") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 10)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 10)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TINYBLOB") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 11)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 11)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("BLOB") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 12)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 12)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("MEDIUMBLOB") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 13)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 13)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("LONGBLOB") TSRMLS_CC); } break; } - if (ZEPHIR_IS_EMPTY(columnSql)) { - ZEPHIR_INIT_VAR(_20$$49); - object_init_ex(_20$$49, phalcon_db_exception_ce); + if (ZEPHIR_IS_EMPTY(&columnSql)) { + ZEPHIR_INIT_VAR(&_20$$49); + object_init_ex(&_20$$49, phalcon_db_exception_ce); ZEPHIR_CALL_METHOD(&_21$$49, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_22$$49); - ZEPHIR_CONCAT_SV(_22$$49, "Unrecognized MySQL data type at column ", _21$$49); - ZEPHIR_CALL_METHOD(NULL, _20$$49, "__construct", NULL, 9, _22$$49); + ZEPHIR_INIT_VAR(&_22$$49); + ZEPHIR_CONCAT_SV(&_22$$49, "Unrecognized MySQL data type at column ", &_21$$49); + ZEPHIR_CALL_METHOD(NULL, &_20$$49, "__construct", NULL, 4, &_22$$49); zephir_check_call_status(); - zephir_throw_exception_debug(_20$$49, "phalcon/db/dialect/mysql.zep", 197 TSRMLS_CC); + zephir_throw_exception_debug(&_20$$49, "phalcon/db/dialect/mysql.zep", 197 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_CALL_METHOD(&typeValues, column, "gettypevalues", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(typeValues))) { - if (Z_TYPE_P(typeValues) == IS_ARRAY) { - ZEPHIR_INIT_VAR(valueSql$$51); - ZVAL_STRING(valueSql$$51, "", 1); - zephir_is_iterable(typeValues, &_24$$51, &_23$$51, 0, 0, "phalcon/db/dialect/mysql.zep", 208); - for ( - ; zend_hash_get_current_data_ex(_24$$51, (void**) &_25$$51, &_23$$51) == SUCCESS - ; zend_hash_move_forward_ex(_24$$51, &_23$$51) - ) { - ZEPHIR_GET_HVALUE(value$$51, _25$$51); - ZEPHIR_SINIT_NVAR(_26$$52); - ZVAL_STRING(&_26$$52, "\"", 0); - ZEPHIR_CALL_FUNCTION(&_27$$52, "addcslashes", &_28, 169, value$$51, &_26$$52); + if (!(ZEPHIR_IS_EMPTY(&typeValues))) { + if (Z_TYPE_P(&typeValues) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&valueSql$$51); + ZVAL_STRING(&valueSql$$51, ""); + zephir_is_iterable(&typeValues, 0, "phalcon/db/dialect/mysql.zep", 208); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&typeValues), _23$$51) + { + ZEPHIR_INIT_NVAR(&value$$51); + ZVAL_COPY(&value$$51, _23$$51); + ZEPHIR_INIT_NVAR(&_24$$52); + ZVAL_STRING(&_24$$52, "\""); + ZEPHIR_CALL_FUNCTION(&_25$$52, "addcslashes", &_26, 149, &value$$51, &_24$$52); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_29$$52); - ZEPHIR_CONCAT_SVS(_29$$52, "\"", _27$$52, "\", "); - zephir_concat_self(&valueSql$$51, _29$$52 TSRMLS_CC); - } - ZEPHIR_SINIT_VAR(_30$$51); - ZVAL_LONG(&_30$$51, 0); - ZEPHIR_SINIT_VAR(_31$$51); - ZVAL_LONG(&_31$$51, -2); - ZEPHIR_INIT_VAR(_32$$51); - zephir_substr(_32$$51, valueSql$$51, 0 , -2 , 0); - ZEPHIR_INIT_VAR(_33$$51); - ZEPHIR_CONCAT_SVS(_33$$51, "(", _32$$51, ")"); - zephir_concat_self(&columnSql, _33$$51 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_27$$52); + ZEPHIR_CONCAT_SVS(&_27$$52, "\"", &_25$$52, "\", "); + zephir_concat_self(&valueSql$$51, &_27$$52 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value$$51); + ZVAL_LONG(&_28$$51, 0); + ZVAL_LONG(&_29$$51, -2); + ZEPHIR_INIT_VAR(&_30$$51); + zephir_substr(&_30$$51, &valueSql$$51, 0 , -2 , 0); + ZEPHIR_INIT_VAR(&_31$$51); + ZEPHIR_CONCAT_SVS(&_31$$51, "(", &_30$$51, ")"); + zephir_concat_self(&columnSql, &_31$$51 TSRMLS_CC); } else { - ZEPHIR_SINIT_VAR(_34$$53); - ZVAL_STRING(&_34$$53, "\"", 0); - ZEPHIR_CALL_FUNCTION(&_35$$53, "addcslashes", &_28, 169, typeValues, &_34$$53); + ZEPHIR_INIT_VAR(&_32$$53); + ZVAL_STRING(&_32$$53, "\""); + ZEPHIR_CALL_FUNCTION(&_33$$53, "addcslashes", &_26, 149, &typeValues, &_32$$53); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_36$$53); - ZEPHIR_CONCAT_SVS(_36$$53, "(\"", _35$$53, "\")"); - zephir_concat_self(&columnSql, _36$$53 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_34$$53); + ZEPHIR_CONCAT_SVS(&_34$$53, "(\"", &_33$$53, "\")"); + zephir_concat_self(&columnSql, &_34$$53 TSRMLS_CC); } } } while(0); - RETURN_CCTOR(columnSql); + RETURN_CCTOR(&columnSql); } @@ -310,87 +349,107 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getColumnDefinition) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, addColumn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *column, *afterPosition = NULL, *sql = NULL, *defaultValue = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_3 = NULL, *_8 = NULL, *_9 = NULL, *_10 = NULL, *_4$$3, _5$$5, *_6$$5 = NULL, *_7$$5, *_11$$11; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, afterPosition, sql, defaultValue, _0, _1, _2, _3, _8, _9, _10, _4$$3, _5$$5, _6$$5, _7$$5, _11$$11; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&afterPosition); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_11$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &column); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, column, "getname", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, this_ptr, "getcolumndefinition", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SVSVSV(sql, "ALTER TABLE ", _0, " ADD `", _1, "` ", _2); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SVSVSV(&sql, "ALTER TABLE ", &_0, " ADD `", &_1, "` ", &_2); ZEPHIR_CALL_METHOD(&_3, column, "hasdefault", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_3)) { + if (zephir_is_true(&_3)) { ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4$$3); - zephir_fast_strtoupper(_4$$3, defaultValue); - if (zephir_memnstr_str(_4$$3, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/mysql.zep", 229)) { + ZEPHIR_INIT_VAR(&_4$$3); + zephir_fast_strtoupper(&_4$$3, &defaultValue); + if (zephir_memnstr_str(&_4$$3, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/mysql.zep", 229)) { zephir_concat_self_str(&sql, SL(" DEFAULT CURRENT_TIMESTAMP") TSRMLS_CC); } else { - ZEPHIR_SINIT_VAR(_5$$5); - ZVAL_STRING(&_5$$5, "\"", 0); - ZEPHIR_CALL_FUNCTION(&_6$$5, "addcslashes", NULL, 169, defaultValue, &_5$$5); + ZEPHIR_INIT_VAR(&_5$$5); + ZVAL_STRING(&_5$$5, "\""); + ZEPHIR_CALL_FUNCTION(&_6$$5, "addcslashes", NULL, 149, &defaultValue, &_5$$5); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_7$$5); - ZEPHIR_CONCAT_SVS(_7$$5, " DEFAULT \"", _6$$5, "\""); - zephir_concat_self(&sql, _7$$5 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_7$$5); + ZEPHIR_CONCAT_SVS(&_7$$5, " DEFAULT \"", &_6$$5, "\""); + zephir_concat_self(&sql, &_7$$5 TSRMLS_CC); } } ZEPHIR_CALL_METHOD(&_8, column, "isnotnull", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_8)) { + if (zephir_is_true(&_8)) { zephir_concat_self_str(&sql, SL(" NOT NULL") TSRMLS_CC); } else { zephir_concat_self_str(&sql, SL(" NULL") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_9, column, "isautoincrement", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_9)) { + if (zephir_is_true(&_9)) { zephir_concat_self_str(&sql, SL(" AUTO_INCREMENT") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_10, column, "isfirst", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_10)) { + if (zephir_is_true(&_10)) { zephir_concat_self_str(&sql, SL(" FIRST") TSRMLS_CC); } else { ZEPHIR_CALL_METHOD(&afterPosition, column, "getafterposition", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(afterPosition)) { - ZEPHIR_INIT_VAR(_11$$11); - ZEPHIR_CONCAT_SVS(_11$$11, " AFTER `", afterPosition, "`"); - zephir_concat_self(&sql, _11$$11 TSRMLS_CC); + if (zephir_is_true(&afterPosition)) { + ZEPHIR_INIT_VAR(&_11$$11); + ZEPHIR_CONCAT_SVS(&_11$$11, " AFTER `", &afterPosition, "`"); + zephir_concat_self(&sql, &_11$$11 TSRMLS_CC); } } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -400,34 +459,63 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addColumn) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, modifyColumn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *column, *currentColumn = NULL, *afterPosition = NULL, *sql = NULL, *defaultValue = NULL, *columnDefinition = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_8 = NULL, *_13 = NULL, *_14 = NULL, *_15 = NULL, *_3$$4 = NULL, *_4$$4 = NULL, *_5$$4, *_6$$5 = NULL, *_7$$5, *_9$$6, _10$$8, *_11$$8 = NULL, *_12$$8, *_16$$14; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null, afterPosition, sql, defaultValue, columnDefinition, _0, _1, _2, _8, _13, _14, _15, _3$$4, _4$$4, _5$$4, _6$$5, _7$$5, _9$$6, _10$$8, _11$$8, _12$$8, _16$$14; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(¤tColumn_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&afterPosition); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&columnDefinition); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_15); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_10$$8); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_12$$8); + ZVAL_UNDEF(&_16$$14); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (!currentColumn) { - ZEPHIR_CPY_WRT(currentColumn, ZEPHIR_GLOBAL(global_null)); + currentColumn = ¤tColumn_sub; + ZEPHIR_CPY_WRT(currentColumn, &__$null); } else { ZEPHIR_SEPARATE_PARAM(currentColumn); } @@ -435,10 +523,10 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, modifyColumn) { ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SV(sql, "ALTER TABLE ", _0); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SV(&sql, "ALTER TABLE ", &_0); if (Z_TYPE_P(currentColumn) != IS_OBJECT) { ZEPHIR_CPY_WRT(currentColumn, column); } @@ -446,66 +534,66 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, modifyColumn) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, currentColumn, "getname", NULL, 0); zephir_check_call_status(); - if (!ZEPHIR_IS_IDENTICAL(_1, _2)) { + if (!ZEPHIR_IS_IDENTICAL(&_1, &_2)) { ZEPHIR_CALL_METHOD(&_3$$4, currentColumn, "getname", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_4$$4, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_5$$4); - ZEPHIR_CONCAT_SVSVSV(_5$$4, " CHANGE COLUMN `", _3$$4, "` `", _4$$4, "` ", columnDefinition); - zephir_concat_self(&sql, _5$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$4); + ZEPHIR_CONCAT_SVSVSV(&_5$$4, " CHANGE COLUMN `", &_3$$4, "` `", &_4$$4, "` ", &columnDefinition); + zephir_concat_self(&sql, &_5$$4 TSRMLS_CC); } else { ZEPHIR_CALL_METHOD(&_6$$5, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_7$$5); - ZEPHIR_CONCAT_SVSV(_7$$5, " MODIFY `", _6$$5, "` ", columnDefinition); - zephir_concat_self(&sql, _7$$5 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_7$$5); + ZEPHIR_CONCAT_SVSV(&_7$$5, " MODIFY `", &_6$$5, "` ", &columnDefinition); + zephir_concat_self(&sql, &_7$$5 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_8, column, "hasdefault", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_8)) { + if (zephir_is_true(&_8)) { ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_9$$6); - zephir_fast_strtoupper(_9$$6, defaultValue); - if (zephir_memnstr_str(_9$$6, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/mysql.zep", 279)) { + ZEPHIR_INIT_VAR(&_9$$6); + zephir_fast_strtoupper(&_9$$6, &defaultValue); + if (zephir_memnstr_str(&_9$$6, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/mysql.zep", 279)) { zephir_concat_self_str(&sql, SL(" DEFAULT CURRENT_TIMESTAMP") TSRMLS_CC); } else { - ZEPHIR_SINIT_VAR(_10$$8); - ZVAL_STRING(&_10$$8, "\"", 0); - ZEPHIR_CALL_FUNCTION(&_11$$8, "addcslashes", NULL, 169, defaultValue, &_10$$8); + ZEPHIR_INIT_VAR(&_10$$8); + ZVAL_STRING(&_10$$8, "\""); + ZEPHIR_CALL_FUNCTION(&_11$$8, "addcslashes", NULL, 149, &defaultValue, &_10$$8); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_12$$8); - ZEPHIR_CONCAT_SVS(_12$$8, " DEFAULT \"", _11$$8, "\""); - zephir_concat_self(&sql, _12$$8 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_12$$8); + ZEPHIR_CONCAT_SVS(&_12$$8, " DEFAULT \"", &_11$$8, "\""); + zephir_concat_self(&sql, &_12$$8 TSRMLS_CC); } } ZEPHIR_CALL_METHOD(&_13, column, "isnotnull", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_13)) { + if (zephir_is_true(&_13)) { zephir_concat_self_str(&sql, SL(" NOT NULL") TSRMLS_CC); } else { zephir_concat_self_str(&sql, SL(" NULL") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_14, column, "isautoincrement", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_14)) { + if (zephir_is_true(&_14)) { zephir_concat_self_str(&sql, SL(" AUTO_INCREMENT") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_15, column, "isfirst", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_15)) { + if (zephir_is_true(&_15)) { zephir_concat_self_str(&sql, SL(" FIRST") TSRMLS_CC); } else { ZEPHIR_CALL_METHOD(&afterPosition, column, "getafterposition", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(afterPosition)) { - ZEPHIR_INIT_VAR(_16$$14); - ZEPHIR_CONCAT_SVS(_16$$14, " AFTER `", afterPosition, "`"); - zephir_concat_self(&sql, _16$$14 TSRMLS_CC); + if (zephir_is_true(&afterPosition)) { + ZEPHIR_INIT_VAR(&_16$$14); + ZEPHIR_CONCAT_SVS(&_16$$14, " AFTER `", &afterPosition, "`"); + zephir_concat_self(&sql, &_16$$14 TSRMLS_CC); } } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -515,47 +603,53 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, modifyColumn) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropColumn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL, *_0 = NULL; - zval *tableName = NULL, *schemaName = NULL, *columnName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL, _0; + zval tableName, schemaName, columnName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &columnName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(columnName_param) != IS_STRING && Z_TYPE_P(columnName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'columnName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'columnName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(columnName_param) == IS_STRING)) { - zephir_get_strval(columnName, columnName_param); + zephir_get_strval(&columnName, columnName_param); } else { - ZEPHIR_INIT_VAR(columnName); - ZVAL_EMPTY_STRING(columnName); + ZEPHIR_INIT_VAR(&columnName); + ZVAL_EMPTY_STRING(&columnName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", _0, " DROP COLUMN `", columnName, "`"); + ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP COLUMN `", &columnName, "`"); RETURN_MM(); } @@ -566,44 +660,57 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropColumn) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, addIndex) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *index, *sql = NULL, *indexType = NULL, *_0 = NULL, *_2 = NULL, *_3 = NULL, *_4 = NULL, *_5, *_1$$3; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, sql, indexType, _0, _2, _3, _4, _5, _1$$3; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&indexType); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SV(sql, "ALTER TABLE ", _0); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SV(&sql, "ALTER TABLE ", &_0); ZEPHIR_CALL_METHOD(&indexType, index, "gettype", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(indexType))) { - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_CONCAT_SVS(_1$$3, " ADD ", indexType, " INDEX "); - zephir_concat_self(&sql, _1$$3 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&indexType))) { + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_CONCAT_SVS(&_1$$3, " ADD ", &indexType, " INDEX "); + zephir_concat_self(&sql, &_1$$3 TSRMLS_CC); } else { zephir_concat_self_str(&sql, SL(" ADD INDEX ") TSRMLS_CC); } @@ -611,12 +718,12 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addIndex) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_4, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getcolumnlist", NULL, 57, _4); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "getcolumnlist", NULL, 50, &_4); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_5); - ZEPHIR_CONCAT_SVSVS(_5, "`", _2, "` (", _3, ")"); - zephir_concat_self(&sql, _5 TSRMLS_CC); - RETURN_CCTOR(sql); + ZEPHIR_INIT_VAR(&_5); + ZEPHIR_CONCAT_SVSVS(&_5, "`", &_2, "` (", &_3, ")"); + zephir_concat_self(&sql, &_5 TSRMLS_CC); + RETURN_CCTOR(&sql); } @@ -626,47 +733,53 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addIndex) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropIndex) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *indexName_param = NULL, *_0 = NULL; - zval *tableName = NULL, *schemaName = NULL, *indexName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *indexName_param = NULL, _0; + zval tableName, schemaName, indexName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&indexName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &indexName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(indexName_param) != IS_STRING && Z_TYPE_P(indexName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'indexName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'indexName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(indexName_param) == IS_STRING)) { - zephir_get_strval(indexName, indexName_param); + zephir_get_strval(&indexName, indexName_param); } else { - ZEPHIR_INIT_VAR(indexName); - ZVAL_EMPTY_STRING(indexName); + ZEPHIR_INIT_VAR(&indexName); + ZVAL_EMPTY_STRING(&indexName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", _0, " DROP INDEX `", indexName, "`"); + ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP INDEX `", &indexName, "`"); RETURN_MM(); } @@ -677,41 +790,49 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropIndex) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, addPrimaryKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *index, *_0 = NULL, *_1 = NULL, *_2 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, _0, _1, _2; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 57, _2); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 50, &_2); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", _0, " ADD PRIMARY KEY (", _1, ")"); + ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " ADD PRIMARY KEY (", &_1, ")"); RETURN_MM(); } @@ -722,37 +843,42 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addPrimaryKey) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropPrimaryKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *_0 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, _0; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, "ALTER TABLE ", _0, " DROP PRIMARY KEY"); + ZEPHIR_CONCAT_SVS(return_value, "ALTER TABLE ", &_0, " DROP PRIMARY KEY"); RETURN_MM(); } @@ -763,79 +889,101 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropPrimaryKey) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, addForeignKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *reference, *sql = NULL, *onDelete = NULL, *onUpdate = NULL, *_0 = NULL, *_1 = NULL, *_4 = NULL, *_5 = NULL, *_6 = NULL, *_7 = NULL, *_8 = NULL, *_9 = NULL, *_10 = NULL, *_11, *_2$$3 = NULL, *_3$$3, *_12$$4, *_13$$5; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub, sql, onDelete, onUpdate, _0, _1, _4, _5, _6, _7, _8, _9, _10, _11, _2$$3, _3$$3, _12$$4, _13$$5; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&reference_sub); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&onDelete); + ZVAL_UNDEF(&onUpdate); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_12$$4); + ZVAL_UNDEF(&_13$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &reference); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SVS(sql, "ALTER TABLE ", _0, " ADD"); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SVS(&sql, "ALTER TABLE ", &_0, " ADD"); ZEPHIR_CALL_METHOD(&_1, reference, "getname", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_1)) { + if (zephir_is_true(&_1)) { ZEPHIR_CALL_METHOD(&_2$$3, reference, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3$$3); - ZEPHIR_CONCAT_SVS(_3$$3, " CONSTRAINT `", _2$$3, "`"); - zephir_concat_self(&sql, _3$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$3); + ZEPHIR_CONCAT_SVS(&_3$$3, " CONSTRAINT `", &_2$$3, "`"); + zephir_concat_self(&sql, &_3$$3 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_5, reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 57, _5); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 50, &_5); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_7, reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8, reference, "getreferencedschema", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6, this_ptr, "preparetable", NULL, 0, _7, _8); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "preparetable", NULL, 0, &_7, &_8); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_10, reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_9, this_ptr, "getcolumnlist", NULL, 57, _10); + ZEPHIR_CALL_METHOD(&_9, this_ptr, "getcolumnlist", NULL, 50, &_10); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_11); - ZEPHIR_CONCAT_SVSVSVS(_11, " FOREIGN KEY (", _4, ") REFERENCES ", _6, "(", _9, ")"); - zephir_concat_self(&sql, _11 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_11); + ZEPHIR_CONCAT_SVSVSVS(&_11, " FOREIGN KEY (", &_4, ") REFERENCES ", &_6, "(", &_9, ")"); + zephir_concat_self(&sql, &_11 TSRMLS_CC); ZEPHIR_CALL_METHOD(&onDelete, reference, "getondelete", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onDelete))) { - ZEPHIR_INIT_VAR(_12$$4); - ZEPHIR_CONCAT_SV(_12$$4, " ON DELETE ", onDelete); - zephir_concat_self(&sql, _12$$4 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onDelete))) { + ZEPHIR_INIT_VAR(&_12$$4); + ZEPHIR_CONCAT_SV(&_12$$4, " ON DELETE ", &onDelete); + zephir_concat_self(&sql, &_12$$4 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&onUpdate, reference, "getonupdate", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onUpdate))) { - ZEPHIR_INIT_VAR(_13$$5); - ZEPHIR_CONCAT_SV(_13$$5, " ON UPDATE ", onUpdate); - zephir_concat_self(&sql, _13$$5 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onUpdate))) { + ZEPHIR_INIT_VAR(&_13$$5); + ZEPHIR_CONCAT_SV(&_13$$5, " ON UPDATE ", &onUpdate); + zephir_concat_self(&sql, &_13$$5 TSRMLS_CC); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -845,47 +993,53 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, addForeignKey) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropForeignKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL, *_0 = NULL; - zval *tableName = NULL, *schemaName = NULL, *referenceName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL, _0; + zval tableName, schemaName, referenceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&referenceName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &referenceName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(referenceName_param) != IS_STRING && Z_TYPE_P(referenceName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referenceName_param) == IS_STRING)) { - zephir_get_strval(referenceName, referenceName_param); + zephir_get_strval(&referenceName, referenceName_param); } else { - ZEPHIR_INIT_VAR(referenceName); - ZVAL_EMPTY_STRING(referenceName); + ZEPHIR_INIT_VAR(&referenceName); + ZVAL_EMPTY_STRING(&referenceName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", _0, " DROP FOREIGN KEY `", referenceName, "`"); + ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP FOREIGN KEY `", &referenceName, "`"); RETURN_MM(); } @@ -895,202 +1049,252 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropForeignKey) { */ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) { - HashTable *_1, *_16$$15, *_26$$21; - HashPosition _0, _15$$15, _25$$21; - zephir_fcall_cache_entry *_5 = NULL, *_10 = NULL, *_20 = NULL; + zephir_fcall_cache_entry *_3 = NULL, *_8 = NULL, *_16 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, *temporary = NULL, *options = NULL, *table = NULL, *createLines = NULL, *columns = NULL, *column = NULL, *indexes = NULL, *index = NULL, *reference = NULL, *references = NULL, *indexName = NULL, *indexSql = NULL, *sql = NULL, *columnLine = NULL, *indexType = NULL, *referenceSql = NULL, *onDelete = NULL, *onUpdate = NULL, *defaultValue = NULL, **_2, *_36, *_37, *_3$$7 = NULL, *_4$$7 = NULL, *_6$$7 = NULL, *_12$$7 = NULL, *_13$$7 = NULL, *_14$$7 = NULL, *_7$$8 = NULL, _8$$10 = zval_used_for_init, *_9$$10 = NULL, *_11$$10 = NULL, **_17$$15, *_18$$17 = NULL, *_19$$17 = NULL, *_21$$19 = NULL, *_22$$19 = NULL, *_23$$20 = NULL, *_24$$20 = NULL, **_27$$21, *_28$$22 = NULL, *_29$$22 = NULL, *_30$$22 = NULL, *_31$$22 = NULL, *_32$$22 = NULL, *_33$$22 = NULL, *_34$$23 = NULL, *_35$$24 = NULL, *_38$$25 = NULL, *_39$$25; - zval *tableName = NULL, *schemaName = NULL; + zval definition; + zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, temporary, options, table, createLines, columns, column, indexes, index, reference, references, indexName, indexSql, sql, columnLine, indexType, referenceSql, onDelete, onUpdate, defaultValue, *_0, _30, _31, _1$$7, _2$$7, _4$$7, _10$$7, _11$$7, _12$$7, _5$$8, _6$$10, _7$$10, _9$$10, *_13$$15, _14$$17, _15$$17, _17$$19, _18$$19, _19$$20, _20$$20, *_21$$21, _22$$22, _23$$22, _24$$22, _25$$22, _26$$22, _27$$22, _28$$23, _29$$24, _32$$25, _33$$25; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&temporary); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&createLines); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&indexes); + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&reference); + ZVAL_UNDEF(&references); + ZVAL_UNDEF(&indexName); + ZVAL_UNDEF(&indexSql); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&columnLine); + ZVAL_UNDEF(&indexType); + ZVAL_UNDEF(&referenceSql); + ZVAL_UNDEF(&onDelete); + ZVAL_UNDEF(&onUpdate); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&_30); + ZVAL_UNDEF(&_31); + ZVAL_UNDEF(&_1$$7); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_11$$7); + ZVAL_UNDEF(&_12$$7); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&_7$$10); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_14$$17); + ZVAL_UNDEF(&_15$$17); + ZVAL_UNDEF(&_17$$19); + ZVAL_UNDEF(&_18$$19); + ZVAL_UNDEF(&_19$$20); + ZVAL_UNDEF(&_20$$20); + ZVAL_UNDEF(&_22$$22); + ZVAL_UNDEF(&_23$$22); + ZVAL_UNDEF(&_24$$22); + ZVAL_UNDEF(&_25$$22); + ZVAL_UNDEF(&_26$$22); + ZVAL_UNDEF(&_27$$22); + ZVAL_UNDEF(&_28$$23); + ZVAL_UNDEF(&_29$$24); + ZVAL_UNDEF(&_32$$25); + ZVAL_UNDEF(&_33$$25); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - ZEPHIR_OBS_VAR(columns); - if (!(zephir_array_isset_string_fetch(&columns, definition, SS("columns"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&columns); + if (!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'columns' is required in the definition array", "phalcon/db/dialect/mysql.zep", 404); return; } - ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(temporary); - ZVAL_BOOL(temporary, 0); - ZEPHIR_OBS_VAR(options); - if (zephir_array_isset_string_fetch(&options, definition, SS("options"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_NVAR(temporary); - zephir_array_isset_string_fetch(&temporary, options, SS("temporary"), 0 TSRMLS_CC); - } - ZEPHIR_INIT_VAR(sql); - if (zephir_is_true(temporary)) { - ZEPHIR_CONCAT_SVS(sql, "CREATE TEMPORARY TABLE ", table, " (\n\t"); + ZEPHIR_INIT_VAR(&temporary); + ZVAL_BOOL(&temporary, 0); + ZEPHIR_OBS_VAR(&options); + if (zephir_array_isset_string_fetch(&options, &definition, SL("options"), 0)) { + ZEPHIR_OBS_NVAR(&temporary); + zephir_array_isset_string_fetch(&temporary, &options, SL("temporary"), 0); + } + ZEPHIR_INIT_VAR(&sql); + if (zephir_is_true(&temporary)) { + ZEPHIR_CONCAT_SVS(&sql, "CREATE TEMPORARY TABLE ", &table, " (\n\t"); } else { - ZEPHIR_CONCAT_SVS(sql, "CREATE TABLE ", table, " (\n\t"); - } - ZEPHIR_INIT_VAR(createLines); - array_init(createLines); - zephir_is_iterable(columns, &_1, &_0, 0, 0, "phalcon/db/dialect/mysql.zep", 469); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(column, _2); - ZEPHIR_CALL_METHOD(&_3$$7, column, "getname", NULL, 0); + ZEPHIR_CONCAT_SVS(&sql, "CREATE TABLE ", &table, " (\n\t"); + } + ZEPHIR_INIT_VAR(&createLines); + array_init(&createLines); + zephir_is_iterable(&columns, 0, "phalcon/db/dialect/mysql.zep", 469); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _0) + { + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _0); + ZEPHIR_CALL_METHOD(&_1$$7, &column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$7, this_ptr, "getcolumndefinition", &_5, 0, column); + ZEPHIR_CALL_METHOD(&_2$$7, this_ptr, "getcolumndefinition", &_3, 0, &column); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(columnLine); - ZEPHIR_CONCAT_SVSV(columnLine, "`", _3$$7, "` ", _4$$7); - ZEPHIR_CALL_METHOD(&_6$$7, column, "hasdefault", NULL, 0); + ZEPHIR_INIT_NVAR(&columnLine); + ZEPHIR_CONCAT_SVSV(&columnLine, "`", &_1$$7, "` ", &_2$$7); + ZEPHIR_CALL_METHOD(&_4$$7, &column, "hasdefault", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_6$$7)) { - ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0); + if (zephir_is_true(&_4$$7)) { + ZEPHIR_CALL_METHOD(&defaultValue, &column, "getdefault", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_7$$8); - zephir_fast_strtoupper(_7$$8, defaultValue); - if (zephir_memnstr_str(_7$$8, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/mysql.zep", 433)) { + ZEPHIR_INIT_NVAR(&_5$$8); + zephir_fast_strtoupper(&_5$$8, &defaultValue); + if (zephir_memnstr_str(&_5$$8, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/mysql.zep", 433)) { zephir_concat_self_str(&columnLine, SL(" DEFAULT CURRENT_TIMESTAMP") TSRMLS_CC); } else { - ZEPHIR_SINIT_NVAR(_8$$10); - ZVAL_STRING(&_8$$10, "\"", 0); - ZEPHIR_CALL_FUNCTION(&_9$$10, "addcslashes", &_10, 169, defaultValue, &_8$$10); + ZEPHIR_INIT_NVAR(&_6$$10); + ZVAL_STRING(&_6$$10, "\""); + ZEPHIR_CALL_FUNCTION(&_7$$10, "addcslashes", &_8, 149, &defaultValue, &_6$$10); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_11$$10); - ZEPHIR_CONCAT_SVS(_11$$10, " DEFAULT \"", _9$$10, "\""); - zephir_concat_self(&columnLine, _11$$10 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_9$$10); + ZEPHIR_CONCAT_SVS(&_9$$10, " DEFAULT \"", &_7$$10, "\""); + zephir_concat_self(&columnLine, &_9$$10 TSRMLS_CC); } } - ZEPHIR_CALL_METHOD(&_12$$7, column, "isnotnull", NULL, 0); + ZEPHIR_CALL_METHOD(&_10$$7, &column, "isnotnull", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_12$$7)) { + if (zephir_is_true(&_10$$7)) { zephir_concat_self_str(&columnLine, SL(" NOT NULL") TSRMLS_CC); } else { zephir_concat_self_str(&columnLine, SL(" NULL") TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&_13$$7, column, "isautoincrement", NULL, 0); + ZEPHIR_CALL_METHOD(&_11$$7, &column, "isautoincrement", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_13$$7)) { + if (zephir_is_true(&_11$$7)) { zephir_concat_self_str(&columnLine, SL(" AUTO_INCREMENT") TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&_14$$7, column, "isprimary", NULL, 0); + ZEPHIR_CALL_METHOD(&_12$$7, &column, "isprimary", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_14$$7)) { + if (zephir_is_true(&_12$$7)) { zephir_concat_self_str(&columnLine, SL(" PRIMARY KEY") TSRMLS_CC); } - zephir_array_append(&createLines, columnLine, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 463); - } - ZEPHIR_OBS_VAR(indexes); - if (zephir_array_isset_string_fetch(&indexes, definition, SS("indexes"), 0 TSRMLS_CC)) { - zephir_is_iterable(indexes, &_16$$15, &_15$$15, 0, 0, "phalcon/db/dialect/mysql.zep", 491); - for ( - ; zend_hash_get_current_data_ex(_16$$15, (void**) &_17$$15, &_15$$15) == SUCCESS - ; zend_hash_move_forward_ex(_16$$15, &_15$$15) - ) { - ZEPHIR_GET_HVALUE(index, _17$$15); - ZEPHIR_CALL_METHOD(&indexName, index, "getname", NULL, 0); + zephir_array_append(&createLines, &columnLine, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 463); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); + ZEPHIR_OBS_VAR(&indexes); + if (zephir_array_isset_string_fetch(&indexes, &definition, SL("indexes"), 0)) { + zephir_is_iterable(&indexes, 0, "phalcon/db/dialect/mysql.zep", 491); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&indexes), _13$$15) + { + ZEPHIR_INIT_NVAR(&index); + ZVAL_COPY(&index, _13$$15); + ZEPHIR_CALL_METHOD(&indexName, &index, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&indexType, index, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(&indexType, &index, "gettype", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_STRING(indexName, "PRIMARY")) { - ZEPHIR_CALL_METHOD(&_19$$17, index, "getcolumns", NULL, 0); + if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { + ZEPHIR_CALL_METHOD(&_15$$17, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_18$$17, this_ptr, "getcolumnlist", &_20, 57, _19$$17); + ZEPHIR_CALL_METHOD(&_14$$17, this_ptr, "getcolumnlist", &_16, 50, &_15$$17); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(indexSql); - ZEPHIR_CONCAT_SVS(indexSql, "PRIMARY KEY (", _18$$17, ")"); + ZEPHIR_INIT_NVAR(&indexSql); + ZEPHIR_CONCAT_SVS(&indexSql, "PRIMARY KEY (", &_14$$17, ")"); } else { - ZEPHIR_INIT_NVAR(indexSql); - if (!(ZEPHIR_IS_EMPTY(indexType))) { - ZEPHIR_CALL_METHOD(&_22$$19, index, "getcolumns", NULL, 0); + ZEPHIR_INIT_NVAR(&indexSql); + if (!(ZEPHIR_IS_EMPTY(&indexType))) { + ZEPHIR_CALL_METHOD(&_18$$19, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_21$$19, this_ptr, "getcolumnlist", &_20, 57, _22$$19); + ZEPHIR_CALL_METHOD(&_17$$19, this_ptr, "getcolumnlist", &_16, 50, &_18$$19); zephir_check_call_status(); - ZEPHIR_CONCAT_VSVSVS(indexSql, indexType, " KEY `", indexName, "` (", _21$$19, ")"); + ZEPHIR_CONCAT_VSVSVS(&indexSql, &indexType, " KEY `", &indexName, "` (", &_17$$19, ")"); } else { - ZEPHIR_CALL_METHOD(&_24$$20, index, "getcolumns", NULL, 0); + ZEPHIR_CALL_METHOD(&_20$$20, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_23$$20, this_ptr, "getcolumnlist", &_20, 57, _24$$20); + ZEPHIR_CALL_METHOD(&_19$$20, this_ptr, "getcolumnlist", &_16, 50, &_20$$20); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(indexSql, "KEY `", indexName, "` (", _23$$20, ")"); + ZEPHIR_CONCAT_SVSVS(&indexSql, "KEY `", &indexName, "` (", &_19$$20, ")"); } } - zephir_array_append(&createLines, indexSql, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 489); - } - } - ZEPHIR_OBS_VAR(references); - if (zephir_array_isset_string_fetch(&references, definition, SS("references"), 0 TSRMLS_CC)) { - zephir_is_iterable(references, &_26$$21, &_25$$21, 0, 0, "phalcon/db/dialect/mysql.zep", 513); - for ( - ; zend_hash_get_current_data_ex(_26$$21, (void**) &_27$$21, &_25$$21) == SUCCESS - ; zend_hash_move_forward_ex(_26$$21, &_25$$21) - ) { - ZEPHIR_GET_HVALUE(reference, _27$$21); - ZEPHIR_CALL_METHOD(&_28$$22, reference, "getname", NULL, 0); + zephir_array_append(&createLines, &indexSql, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 489); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&index); + } + ZEPHIR_OBS_VAR(&references); + if (zephir_array_isset_string_fetch(&references, &definition, SL("references"), 0)) { + zephir_is_iterable(&references, 0, "phalcon/db/dialect/mysql.zep", 513); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&references), _21$$21) + { + ZEPHIR_INIT_NVAR(&reference); + ZVAL_COPY(&reference, _21$$21); + ZEPHIR_CALL_METHOD(&_22$$22, &reference, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_30$$22, reference, "getcolumns", NULL, 0); + ZEPHIR_CALL_METHOD(&_24$$22, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_29$$22, this_ptr, "getcolumnlist", &_20, 57, _30$$22); + ZEPHIR_CALL_METHOD(&_23$$22, this_ptr, "getcolumnlist", &_16, 50, &_24$$22); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_31$$22, reference, "getreferencedtable", NULL, 0); + ZEPHIR_CALL_METHOD(&_25$$22, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_33$$22, reference, "getreferencedcolumns", NULL, 0); + ZEPHIR_CALL_METHOD(&_27$$22, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_32$$22, this_ptr, "getcolumnlist", &_20, 57, _33$$22); + ZEPHIR_CALL_METHOD(&_26$$22, this_ptr, "getcolumnlist", &_16, 50, &_27$$22); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(referenceSql); - ZEPHIR_CONCAT_SVSVSSVSVS(referenceSql, "CONSTRAINT `", _28$$22, "` FOREIGN KEY (", _29$$22, ")", " REFERENCES `", _31$$22, "`(", _32$$22, ")"); - ZEPHIR_CALL_METHOD(&onDelete, reference, "getondelete", NULL, 0); + ZEPHIR_INIT_NVAR(&referenceSql); + ZEPHIR_CONCAT_SVSVSSVSVS(&referenceSql, "CONSTRAINT `", &_22$$22, "` FOREIGN KEY (", &_23$$22, ")", " REFERENCES `", &_25$$22, "`(", &_26$$22, ")"); + ZEPHIR_CALL_METHOD(&onDelete, &reference, "getondelete", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onDelete))) { - ZEPHIR_INIT_LNVAR(_34$$23); - ZEPHIR_CONCAT_SV(_34$$23, " ON DELETE ", onDelete); - zephir_concat_self(&referenceSql, _34$$23 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onDelete))) { + ZEPHIR_INIT_LNVAR(_28$$23); + ZEPHIR_CONCAT_SV(&_28$$23, " ON DELETE ", &onDelete); + zephir_concat_self(&referenceSql, &_28$$23 TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&onUpdate, reference, "getonupdate", NULL, 0); + ZEPHIR_CALL_METHOD(&onUpdate, &reference, "getonupdate", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onUpdate))) { - ZEPHIR_INIT_LNVAR(_35$$24); - ZEPHIR_CONCAT_SV(_35$$24, " ON UPDATE ", onUpdate); - zephir_concat_self(&referenceSql, _35$$24 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onUpdate))) { + ZEPHIR_INIT_LNVAR(_29$$24); + ZEPHIR_CONCAT_SV(&_29$$24, " ON UPDATE ", &onUpdate); + zephir_concat_self(&referenceSql, &_29$$24 TSRMLS_CC); } - zephir_array_append(&createLines, referenceSql, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 511); - } - } - ZEPHIR_INIT_VAR(_36); - zephir_fast_join_str(_36, SL(",\n\t"), createLines TSRMLS_CC); - ZEPHIR_INIT_VAR(_37); - ZEPHIR_CONCAT_VS(_37, _36, "\n)"); - zephir_concat_self(&sql, _37 TSRMLS_CC); - if (zephir_array_isset_string(definition, SS("options"))) { - ZEPHIR_CALL_METHOD(&_38$$25, this_ptr, "_gettableoptions", NULL, 0, definition); + zephir_array_append(&createLines, &referenceSql, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 511); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&reference); + } + ZEPHIR_INIT_VAR(&_30); + zephir_fast_join_str(&_30, SL(",\n\t"), &createLines TSRMLS_CC); + ZEPHIR_INIT_VAR(&_31); + ZEPHIR_CONCAT_VS(&_31, &_30, "\n)"); + zephir_concat_self(&sql, &_31 TSRMLS_CC); + if (zephir_array_isset_string(&definition, SL("options"))) { + ZEPHIR_CALL_METHOD(&_32$$25, this_ptr, "_gettableoptions", NULL, 0, &definition); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_39$$25); - ZEPHIR_CONCAT_SV(_39$$25, " ", _38$$25); - zephir_concat_self(&sql, _39$$25 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_33$$25); + ZEPHIR_CONCAT_SV(&_33$$25, " ", &_32$$25); + zephir_concat_self(&sql, &_33$$25 TSRMLS_CC); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -1099,47 +1303,55 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, createTable) { */ PHP_METHOD(Phalcon_Db_Dialect_Mysql, truncateTable) { - zval *tableName_param = NULL, *schemaName_param = NULL, *sql = NULL, *table = NULL; - zval *tableName = NULL, *schemaName = NULL, *_0$$3, *_1$$4; + zval *tableName_param = NULL, *schemaName_param = NULL, sql, table; + zval tableName, schemaName, _0$$3, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&table); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_INIT_VAR(table); - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_SVSVS(_0$$3, "`", schemaName, "`.`", tableName, "`"); - ZEPHIR_CPY_WRT(table, _0$$3); + ZEPHIR_INIT_VAR(&table); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_SVSVS(&_0$$3, "`", &schemaName, "`.`", &tableName, "`"); + ZEPHIR_CPY_WRT(&table, &_0$$3); } else { - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_SVS(_1$$4, "`", tableName, "`"); - ZEPHIR_CPY_WRT(table, _1$$4); + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_SVS(&_1$$4, "`", &tableName, "`"); + ZEPHIR_CPY_WRT(&table, &_1$$4); } - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SV(sql, "TRUNCATE TABLE ", table); - RETURN_CCTOR(sql); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SV(&sql, "TRUNCATE TABLE ", &table); + RETURN_CCTOR(&sql); } @@ -1150,48 +1362,54 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropTable) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool ifExists; - zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, *sql = NULL, *table = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, sql, table; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&table); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &tableName_param, &schemaName_param, &ifExists_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } if (!ifExists_param) { ifExists = 1; } else { - if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - ifExists = Z_BVAL_P(ifExists_param); + ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE); } - ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); + ZEPHIR_INIT_VAR(&sql); if (ifExists) { - ZEPHIR_CONCAT_SV(sql, "DROP TABLE IF EXISTS ", table); + ZEPHIR_CONCAT_SV(&sql, "DROP TABLE IF EXISTS ", &table); } else { - ZEPHIR_CONCAT_SV(sql, "DROP TABLE ", table); + ZEPHIR_CONCAT_SV(&sql, "DROP TABLE ", &table); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -1201,40 +1419,47 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropTable) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, createView) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, *viewSql = NULL, *_0 = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval definition; + zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, viewSql, _0; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&viewSql); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &viewName_param, &definition_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - ZEPHIR_OBS_VAR(viewSql); - if (!(zephir_array_isset_string_fetch(&viewSql, definition, SS("sql"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&viewSql); + if (!(zephir_array_isset_string_fetch(&viewSql, &definition, SL("sql"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'sql' is required in the definition array", "phalcon/db/dialect/mysql.zep", 567); return; } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, viewName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", _0, " AS ", viewSql); + ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", &_0, " AS ", &viewSql); RETURN_MM(); } @@ -1246,48 +1471,54 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropView) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool ifExists; - zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, *sql = NULL, *view = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, sql, view; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&view); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &viewName_param, &schemaName_param, &ifExists_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } if (!ifExists_param) { ifExists = 1; } else { - if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - ifExists = Z_BVAL_P(ifExists_param); + ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE); } - ZEPHIR_CALL_METHOD(&view, this_ptr, "preparetable", NULL, 0, viewName, schemaName); + ZEPHIR_CALL_METHOD(&view, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); + ZEPHIR_INIT_VAR(&sql); if (ifExists) { - ZEPHIR_CONCAT_SV(sql, "DROP VIEW IF EXISTS ", view); + ZEPHIR_CONCAT_SV(&sql, "DROP VIEW IF EXISTS ", &view); } else { - ZEPHIR_CONCAT_SV(sql, "DROP VIEW ", view); + ZEPHIR_CONCAT_SV(&sql, "DROP VIEW ", &view); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -1303,34 +1534,38 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, dropView) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, tableExists) { zval *tableName_param = NULL, *schemaName_param = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_CONCAT_SVSVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_NAME`= '", tableName, "' AND `TABLE_SCHEMA` = '", schemaName, "'"); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_CONCAT_SVSVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_NAME`= '", &tableName, "' AND `TABLE_SCHEMA` = '", &schemaName, "'"); RETURN_MM(); } - ZEPHIR_CONCAT_SVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_NAME` = '", tableName, "' AND `TABLE_SCHEMA` = DATABASE()"); + ZEPHIR_CONCAT_SVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_NAME` = '", &tableName, "' AND `TABLE_SCHEMA` = DATABASE()"); RETURN_MM(); } @@ -1341,34 +1576,38 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, tableExists) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, viewExists) { zval *viewName_param = NULL, *schemaName_param = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &viewName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_CONCAT_SVSVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_NAME`= '", viewName, "' AND `TABLE_SCHEMA`='", schemaName, "'"); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_CONCAT_SVSVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_NAME`= '", &viewName, "' AND `TABLE_SCHEMA`='", &schemaName, "'"); RETURN_MM(); } - ZEPHIR_CONCAT_SVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_NAME`='", viewName, "' AND `TABLE_SCHEMA` = DATABASE()"); + ZEPHIR_CONCAT_SVS(return_value, "SELECT IF(COUNT(*) > 0, 1, 0) FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_NAME`='", &viewName, "' AND `TABLE_SCHEMA` = DATABASE()"); RETURN_MM(); } @@ -1385,33 +1624,38 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, viewExists) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, describeColumns) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *_0 = NULL; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, _0; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, table, schema); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_CONCAT_SV(return_value, "DESCRIBE ", _0); + ZEPHIR_CONCAT_SV(return_value, "DESCRIBE ", &_0); RETURN_MM(); } @@ -1428,24 +1672,27 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, describeColumns) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, listTables) { zval *schemaName_param = NULL; - zval *schemaName = NULL; + zval schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &schemaName_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_CONCAT_SVS(return_value, "SHOW TABLES FROM `", schemaName, "`"); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_CONCAT_SVS(return_value, "SHOW TABLES FROM `", &schemaName, "`"); RETURN_MM(); } - RETURN_MM_STRING("SHOW TABLES", 1); + RETURN_MM_STRING("SHOW TABLES"); } @@ -1455,33 +1702,36 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, listTables) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, listViews) { zval *schemaName_param = NULL; - zval *schemaName = NULL; + zval schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &schemaName_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_CONCAT_SVS(return_value, "SELECT `TABLE_NAME` AS view_name FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_SCHEMA` = '", schemaName, "' ORDER BY view_name"); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_CONCAT_SVS(return_value, "SELECT `TABLE_NAME` AS view_name FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_SCHEMA` = '", &schemaName, "' ORDER BY view_name"); RETURN_MM(); } - RETURN_MM_STRING("SELECT `TABLE_NAME` AS view_name FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_SCHEMA` = DATABASE() ORDER BY view_name", 1); + RETURN_MM_STRING("SELECT `TABLE_NAME` AS view_name FROM `INFORMATION_SCHEMA`.`VIEWS` WHERE `TABLE_SCHEMA` = DATABASE() ORDER BY view_name"); } @@ -1491,33 +1741,38 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, listViews) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, describeIndexes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *_0 = NULL; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, _0; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, table, schema); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &table, &schema); zephir_check_call_status(); - ZEPHIR_CONCAT_SV(return_value, "SHOW INDEXES FROM ", _0); + ZEPHIR_CONCAT_SV(return_value, "SHOW INDEXES FROM ", &_0); RETURN_MM(); } @@ -1527,42 +1782,49 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, describeIndexes) { */ PHP_METHOD(Phalcon_Db_Dialect_Mysql, describeReferences) { - zval *table_param = NULL, *schema_param = NULL, *sql = NULL; - zval *table = NULL, *schema = NULL, *_0$$3, *_1$$4; + zval *table_param = NULL, *schema_param = NULL, sql; + zval table, schema, _0$$3, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&sql); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(sql); - ZVAL_STRING(sql, "SELECT DISTINCT KCU.TABLE_NAME, KCU.COLUMN_NAME, KCU.CONSTRAINT_NAME, KCU.REFERENCED_TABLE_SCHEMA, KCU.REFERENCED_TABLE_NAME, KCU.REFERENCED_COLUMN_NAME, RC.UPDATE_RULE, RC.DELETE_RULE FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU LEFT JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC ON RC.CONSTRAINT_NAME = KCU.CONSTRAINT_NAME AND RC.CONSTRAINT_SCHEMA = KCU.CONSTRAINT_SCHEMA WHERE KCU.REFERENCED_TABLE_NAME IS NOT NULL AND ", 1); - if (!(!schema) && Z_STRLEN_P(schema)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_SVSVS(_0$$3, "KCU.CONSTRAINT_SCHEMA = '", schema, "' AND KCU.TABLE_NAME = '", table, "'"); - zephir_concat_self(&sql, _0$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&sql); + ZVAL_STRING(&sql, "SELECT DISTINCT KCU.TABLE_NAME, KCU.COLUMN_NAME, KCU.CONSTRAINT_NAME, KCU.REFERENCED_TABLE_SCHEMA, KCU.REFERENCED_TABLE_NAME, KCU.REFERENCED_COLUMN_NAME, RC.UPDATE_RULE, RC.DELETE_RULE FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU LEFT JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC ON RC.CONSTRAINT_NAME = KCU.CONSTRAINT_NAME AND RC.CONSTRAINT_SCHEMA = KCU.CONSTRAINT_SCHEMA WHERE KCU.REFERENCED_TABLE_NAME IS NOT NULL AND "); + if (!(Z_TYPE_P(&schema) == IS_UNDEF) && Z_STRLEN_P(&schema)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_SVSVS(&_0$$3, "KCU.CONSTRAINT_SCHEMA = '", &schema, "' AND KCU.TABLE_NAME = '", &table, "'"); + zephir_concat_self(&sql, &_0$$3 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_SVS(_1$$4, "KCU.CONSTRAINT_SCHEMA = DATABASE() AND KCU.TABLE_NAME = '", table, "'"); - zephir_concat_self(&sql, _1$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_SVS(&_1$$4, "KCU.CONSTRAINT_SCHEMA = DATABASE() AND KCU.TABLE_NAME = '", &table, "'"); + zephir_concat_self(&sql, &_1$$4 TSRMLS_CC); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -1571,37 +1833,42 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, describeReferences) { */ PHP_METHOD(Phalcon_Db_Dialect_Mysql, tableOptions) { - zval *table_param = NULL, *schema_param = NULL, *sql = NULL; - zval *table = NULL, *schema = NULL; + zval *table_param = NULL, *schema_param = NULL, sql; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&sql); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(sql); - ZVAL_STRING(sql, "SELECT TABLES.TABLE_TYPE AS table_type,TABLES.AUTO_INCREMENT AS auto_increment,TABLES.ENGINE AS engine,TABLES.TABLE_COLLATION AS table_collation FROM INFORMATION_SCHEMA.TABLES WHERE ", 1); - if (!(!schema) && Z_STRLEN_P(schema)) { - ZEPHIR_CONCAT_VSVSVS(return_value, sql, "TABLES.TABLE_SCHEMA = '", schema, "' AND TABLES.TABLE_NAME = '", table, "'"); + ZEPHIR_INIT_VAR(&sql); + ZVAL_STRING(&sql, "SELECT TABLES.TABLE_TYPE AS table_type,TABLES.AUTO_INCREMENT AS auto_increment,TABLES.ENGINE AS engine,TABLES.TABLE_COLLATION AS table_collation FROM INFORMATION_SCHEMA.TABLES WHERE "); + if (!(Z_TYPE_P(&schema) == IS_UNDEF) && Z_STRLEN_P(&schema)) { + ZEPHIR_CONCAT_VSVSVS(return_value, &sql, "TABLES.TABLE_SCHEMA = '", &schema, "' AND TABLES.TABLE_NAME = '", &table, "'"); RETURN_MM(); } - ZEPHIR_CONCAT_VSVS(return_value, sql, "TABLES.TABLE_SCHEMA = DATABASE() AND TABLES.TABLE_NAME = '", table, "'"); + ZEPHIR_CONCAT_VSVS(return_value, &sql, "TABLES.TABLE_SCHEMA = DATABASE() AND TABLES.TABLE_NAME = '", &table, "'"); RETURN_MM(); } @@ -1611,55 +1878,69 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, tableOptions) { */ PHP_METHOD(Phalcon_Db_Dialect_Mysql, _getTableOptions) { - zval *definition_param = NULL, *options = NULL, *engine = NULL, *autoIncrement = NULL, *tableCollation = NULL, *collationParts = NULL, *tableOptions = NULL, *_0$$5, *_1$$7, *_2$$9, *_3$$9, *_4$$9; - zval *definition = NULL; + zval *definition_param = NULL, options, engine, autoIncrement, tableCollation, collationParts, tableOptions, _0$$5, _1$$7, _2$$9, _3$$9, _4$$9; + zval definition; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&engine); + ZVAL_UNDEF(&autoIncrement); + ZVAL_UNDEF(&tableCollation); + ZVAL_UNDEF(&collationParts); + ZVAL_UNDEF(&tableOptions); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$7); + ZVAL_UNDEF(&_2$$9); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &definition_param); - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - ZEPHIR_OBS_VAR(options); - if (zephir_array_isset_string_fetch(&options, definition, SS("options"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(tableOptions); - array_init(tableOptions); - ZEPHIR_OBS_VAR(engine); - if (zephir_array_isset_string_fetch(&engine, options, SS("ENGINE"), 0 TSRMLS_CC)) { - if (zephir_is_true(engine)) { - ZEPHIR_INIT_VAR(_0$$5); - ZEPHIR_CONCAT_SV(_0$$5, "ENGINE=", engine); - zephir_array_append(&tableOptions, _0$$5, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 712); + ZEPHIR_OBS_VAR(&options); + if (zephir_array_isset_string_fetch(&options, &definition, SL("options"), 0)) { + ZEPHIR_INIT_VAR(&tableOptions); + array_init(&tableOptions); + ZEPHIR_OBS_VAR(&engine); + if (zephir_array_isset_string_fetch(&engine, &options, SL("ENGINE"), 0)) { + if (zephir_is_true(&engine)) { + ZEPHIR_INIT_VAR(&_0$$5); + ZEPHIR_CONCAT_SV(&_0$$5, "ENGINE=", &engine); + zephir_array_append(&tableOptions, &_0$$5, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 712); } } - ZEPHIR_OBS_VAR(autoIncrement); - if (zephir_array_isset_string_fetch(&autoIncrement, options, SS("AUTO_INCREMENT"), 0 TSRMLS_CC)) { - if (zephir_is_true(autoIncrement)) { - ZEPHIR_INIT_VAR(_1$$7); - ZEPHIR_CONCAT_SV(_1$$7, "AUTO_INCREMENT=", autoIncrement); - zephir_array_append(&tableOptions, _1$$7, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 721); + ZEPHIR_OBS_VAR(&autoIncrement); + if (zephir_array_isset_string_fetch(&autoIncrement, &options, SL("AUTO_INCREMENT"), 0)) { + if (zephir_is_true(&autoIncrement)) { + ZEPHIR_INIT_VAR(&_1$$7); + ZEPHIR_CONCAT_SV(&_1$$7, "AUTO_INCREMENT=", &autoIncrement); + zephir_array_append(&tableOptions, &_1$$7, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 721); } } - ZEPHIR_OBS_VAR(tableCollation); - if (zephir_array_isset_string_fetch(&tableCollation, options, SS("TABLE_COLLATION"), 0 TSRMLS_CC)) { - if (zephir_is_true(tableCollation)) { - ZEPHIR_INIT_VAR(collationParts); - zephir_fast_explode_str(collationParts, SL("_"), tableCollation, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&_2$$9, collationParts, 0, PH_NOISY | PH_READONLY, "phalcon/db/dialect/mysql.zep", 731 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3$$9); - ZEPHIR_CONCAT_SV(_3$$9, "DEFAULT CHARSET=", _2$$9); - zephir_array_append(&tableOptions, _3$$9, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 731); - ZEPHIR_INIT_VAR(_4$$9); - ZEPHIR_CONCAT_SV(_4$$9, "COLLATE=", tableCollation); - zephir_array_append(&tableOptions, _4$$9, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 732); + ZEPHIR_OBS_VAR(&tableCollation); + if (zephir_array_isset_string_fetch(&tableCollation, &options, SL("TABLE_COLLATION"), 0)) { + if (zephir_is_true(&tableCollation)) { + ZEPHIR_INIT_VAR(&collationParts); + zephir_fast_explode_str(&collationParts, SL("_"), &tableCollation, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&_2$$9, &collationParts, 0, PH_NOISY | PH_READONLY, "phalcon/db/dialect/mysql.zep", 731 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$9); + ZEPHIR_CONCAT_SV(&_3$$9, "DEFAULT CHARSET=", &_2$$9); + zephir_array_append(&tableOptions, &_3$$9, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 731); + ZEPHIR_INIT_VAR(&_4$$9); + ZEPHIR_CONCAT_SV(&_4$$9, "COLLATE=", &tableCollation); + zephir_array_append(&tableOptions, &_4$$9, PH_SEPARATE, "phalcon/db/dialect/mysql.zep", 732); } } - if (zephir_fast_count_int(tableOptions TSRMLS_CC)) { - zephir_fast_join_str(return_value, SL(" "), tableOptions TSRMLS_CC); + if (zephir_fast_count_int(&tableOptions TSRMLS_CC)) { + zephir_fast_join_str(return_value, SL(" "), &tableOptions TSRMLS_CC); RETURN_MM(); } } - RETURN_MM_STRING("", 1); + RETURN_MM_STRING(""); } @@ -1668,13 +1949,16 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, _getTableOptions) { */ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getForeignKeyChecks) { - zval *sql = NULL; + zval sql; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sql); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(sql); - ZVAL_STRING(sql, "SELECT @@foreign_key_checks", 1); - RETURN_CCTOR(sql); + ZEPHIR_INIT_VAR(&sql); + ZVAL_STRING(&sql, "SELECT @@foreign_key_checks"); + RETURN_CCTOR(&sql); } @@ -1689,24 +1973,27 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, getForeignKeyChecks) { PHP_METHOD(Phalcon_Db_Dialect_Mysql, sharedLock) { zval *sqlQuery_param = NULL; - zval *sqlQuery = NULL; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlQuery_param); if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) { - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); } else { - ZEPHIR_INIT_VAR(sqlQuery); - ZVAL_EMPTY_STRING(sqlQuery); + ZEPHIR_INIT_VAR(&sqlQuery); + ZVAL_EMPTY_STRING(&sqlQuery); } - ZEPHIR_CONCAT_VS(return_value, sqlQuery, " LOCK IN SHARE MODE"); + ZEPHIR_CONCAT_VS(return_value, &sqlQuery, " LOCK IN SHARE MODE"); RETURN_MM(); } diff --git a/ext/phalcon/db/dialect/mysql.zep.h b/ext/phalcon/db/dialect/mysql.zep.h index a5b28c8f8ce..41eefa4e2a6 100644 --- a/ext/phalcon/db/dialect/mysql.zep.h +++ b/ext/phalcon/db/dialect/mysql.zep.h @@ -30,137 +30,436 @@ PHP_METHOD(Phalcon_Db_Dialect_Mysql, _getTableOptions); PHP_METHOD(Phalcon_Db_Dialect_Mysql, getForeignKeyChecks); PHP_METHOD(Phalcon_Db_Dialect_Mysql, sharedLock); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_getcolumndefinition, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_getcolumndefinition, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_getcolumndefinition, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_addcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_addcolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_addcolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_modifycolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_modifycolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_modifycolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_ARG_OBJ_INFO(0, currentColumn, Phalcon\\Db\\ColumnInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropcolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropcolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, columnName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, columnName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_addindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_addindex, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_addindex, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropindex, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropindex, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, indexName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, indexName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_addprimarykey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_addprimarykey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_addprimarykey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropprimarykey, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropprimarykey, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropprimarykey, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_addforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_addforeignkey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_addforeignkey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, reference, Phalcon\\Db\\ReferenceInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropforeignkey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropforeignkey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_createtable, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_createtable, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_createtable, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_truncatetable, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_truncatetable, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_truncatetable, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_droptable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_droptable, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_droptable, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_createview, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_createview, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_createview, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropview, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropview, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_dropview, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_tableexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_tableexists, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_tableexists, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_viewexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_viewexists, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_viewexists, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_describecolumns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_describecolumns, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_describecolumns, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_listtables, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_listtables, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_listtables, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_listviews, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_listviews, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_listviews, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_describeindexes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_describeindexes, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_describeindexes, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_describereferences, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_describereferences, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_describereferences, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_tableoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_tableoptions, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_tableoptions, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql__gettableoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql__gettableoptions, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql__gettableoptions, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_mysql_sharedlock, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_getforeignkeychecks, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_getforeignkeychecks, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_sharedlock, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_mysql_sharedlock, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_dialect_mysql_method_entry) { @@ -188,7 +487,7 @@ ZEPHIR_INIT_FUNCS(phalcon_db_dialect_mysql_method_entry) { PHP_ME(Phalcon_Db_Dialect_Mysql, describeReferences, arginfo_phalcon_db_dialect_mysql_describereferences, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Dialect_Mysql, tableOptions, arginfo_phalcon_db_dialect_mysql_tableoptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Dialect_Mysql, _getTableOptions, arginfo_phalcon_db_dialect_mysql__gettableoptions, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Db_Dialect_Mysql, getForeignKeyChecks, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Dialect_Mysql, getForeignKeyChecks, arginfo_phalcon_db_dialect_mysql_getforeignkeychecks, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Dialect_Mysql, sharedLock, arginfo_phalcon_db_dialect_mysql_sharedlock, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/dialect/postgresql.zep.c b/ext/phalcon/db/dialect/postgresql.zep.c index 74139aeb272..074e57810f0 100644 --- a/ext/phalcon/db/dialect/postgresql.zep.c +++ b/ext/phalcon/db/dialect/postgresql.zep.c @@ -42,11 +42,37 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Dialect_Postgresql) { */ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) { - HashTable *_10$$37; - HashPosition _9$$37; - zephir_fcall_cache_entry *_14 = NULL; + zephir_fcall_cache_entry *_12 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *column, *size = NULL, *columnType = NULL, *columnSql = NULL, *typeValues = NULL, *_0$$5 = NULL, *_1$$10, *_2$$12 = NULL, *_3$$12, *_4$$18, *_5$$25 = NULL, *_6$$35, *_7$$35 = NULL, *_8$$35, *value$$37 = NULL, *valueSql$$37 = NULL, **_11$$37, _16$$37, _17$$37, *_18$$37, *_19$$37, _12$$38 = zval_used_for_init, *_13$$38 = NULL, *_15$$38 = NULL, _20$$39, *_21$$39 = NULL, *_22$$39; + zval *column, column_sub, size, columnType, columnSql, typeValues, _0$$5, _1$$10, _2$$12, _3$$12, _4$$18, _5$$25, _6$$35, _7$$35, _8$$35, value$$37, valueSql$$37, *_9$$37, _14$$37, _15$$37, _16$$37, _17$$37, _10$$38, _11$$38, _13$$38, _18$$39, _19$$39, _20$$39; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&size); + ZVAL_UNDEF(&columnType); + ZVAL_UNDEF(&columnSql); + ZVAL_UNDEF(&typeValues); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$10); + ZVAL_UNDEF(&_2$$12); + ZVAL_UNDEF(&_3$$12); + ZVAL_UNDEF(&_4$$18); + ZVAL_UNDEF(&_5$$25); + ZVAL_UNDEF(&_6$$35); + ZVAL_UNDEF(&_7$$35); + ZVAL_UNDEF(&_8$$35); + ZVAL_UNDEF(&value$$37); + ZVAL_UNDEF(&valueSql$$37); + ZVAL_UNDEF(&_14$$37); + ZVAL_UNDEF(&_15$$37); + ZVAL_UNDEF(&_16$$37); + ZVAL_UNDEF(&_17$$37); + ZVAL_UNDEF(&_10$$38); + ZVAL_UNDEF(&_11$$38); + ZVAL_UNDEF(&_13$$38); + ZVAL_UNDEF(&_18$$39); + ZVAL_UNDEF(&_19$$39); + ZVAL_UNDEF(&_20$$39); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &column); @@ -57,19 +83,19 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&columnType, column, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(columnSql); - ZVAL_STRING(columnSql, "", 1); - if (Z_TYPE_P(columnType) == IS_STRING) { - zephir_concat_self(&columnSql, columnType TSRMLS_CC); + ZEPHIR_INIT_VAR(&columnSql); + ZVAL_STRING(&columnSql, ""); + if (Z_TYPE_P(&columnType) == IS_STRING) { + zephir_concat_self(&columnSql, &columnType TSRMLS_CC); ZEPHIR_CALL_METHOD(&columnType, column, "gettypereference", NULL, 0); zephir_check_call_status(); } do { - if (ZEPHIR_IS_LONG(columnType, 0)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 0)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { ZEPHIR_CALL_METHOD(&_0$$5, column, "isautoincrement", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_0$$5)) { + if (zephir_is_true(&_0$$5)) { zephir_concat_self_str(&columnSql, SL("SERIAL") TSRMLS_CC); } else { zephir_concat_self_str(&columnSql, SL("INT") TSRMLS_CC); @@ -77,70 +103,70 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) { } break; } - if (ZEPHIR_IS_LONG(columnType, 1)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 1)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DATE") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(columnType, 2)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 2)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("CHARACTER VARYING") TSRMLS_CC); } - ZEPHIR_INIT_VAR(_1$$10); - ZEPHIR_CONCAT_SVS(_1$$10, "(", size, ")"); - zephir_concat_self(&columnSql, _1$$10 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$10); + ZEPHIR_CONCAT_SVS(&_1$$10, "(", &size, ")"); + zephir_concat_self(&columnSql, &_1$$10 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(columnType, 3)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 3)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("NUMERIC") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_2$$12, column, "getscale", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3$$12); - ZEPHIR_CONCAT_SVSVS(_3$$12, "(", size, ",", _2$$12, ")"); - zephir_concat_self(&columnSql, _3$$12 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$12); + ZEPHIR_CONCAT_SVSVS(&_3$$12, "(", &size, ",", &_2$$12, ")"); + zephir_concat_self(&columnSql, &_3$$12 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(columnType, 4)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 4)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TIMESTAMP") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(columnType, 17)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 17)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TIMESTAMP") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(columnType, 5)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 5)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("CHARACTER") TSRMLS_CC); } - ZEPHIR_INIT_VAR(_4$$18); - ZEPHIR_CONCAT_SVS(_4$$18, "(", size, ")"); - zephir_concat_self(&columnSql, _4$$18 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$18); + ZEPHIR_CONCAT_SVS(&_4$$18, "(", &size, ")"); + zephir_concat_self(&columnSql, &_4$$18 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(columnType, 6)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 6)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TEXT") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(columnType, 7)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 7)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("FLOAT") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(columnType, 14)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 14)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { ZEPHIR_CALL_METHOD(&_5$$25, column, "isautoincrement", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_5$$25)) { + if (zephir_is_true(&_5$$25)) { zephir_concat_self_str(&columnSql, SL("BIGSERIAL") TSRMLS_CC); } else { zephir_concat_self_str(&columnSql, SL("BIGINT") TSRMLS_CC); @@ -148,79 +174,77 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) { } break; } - if (ZEPHIR_IS_LONG(columnType, 15)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 15)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("JSON") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(columnType, 16)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 16)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("JSONB") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(columnType, 8)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&columnType, 8)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("BOOLEAN") TSRMLS_CC); } break; } - if (ZEPHIR_IS_EMPTY(columnSql)) { - ZEPHIR_INIT_VAR(_6$$35); - object_init_ex(_6$$35, phalcon_db_exception_ce); + if (ZEPHIR_IS_EMPTY(&columnSql)) { + ZEPHIR_INIT_VAR(&_6$$35); + object_init_ex(&_6$$35, phalcon_db_exception_ce); ZEPHIR_CALL_METHOD(&_7$$35, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_8$$35); - ZEPHIR_CONCAT_SV(_8$$35, "Unrecognized PostgreSQL data type at column ", _7$$35); - ZEPHIR_CALL_METHOD(NULL, _6$$35, "__construct", NULL, 9, _8$$35); + ZEPHIR_INIT_VAR(&_8$$35); + ZEPHIR_CONCAT_SV(&_8$$35, "Unrecognized PostgreSQL data type at column ", &_7$$35); + ZEPHIR_CALL_METHOD(NULL, &_6$$35, "__construct", NULL, 4, &_8$$35); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$35, "phalcon/db/dialect/postgresql.zep", 150 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$35, "phalcon/db/dialect/postgresql.zep", 150 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_CALL_METHOD(&typeValues, column, "gettypevalues", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(typeValues))) { - if (Z_TYPE_P(typeValues) == IS_ARRAY) { - ZEPHIR_INIT_VAR(valueSql$$37); - ZVAL_STRING(valueSql$$37, "", 1); - zephir_is_iterable(typeValues, &_10$$37, &_9$$37, 0, 0, "phalcon/db/dialect/postgresql.zep", 161); - for ( - ; zend_hash_get_current_data_ex(_10$$37, (void**) &_11$$37, &_9$$37) == SUCCESS - ; zend_hash_move_forward_ex(_10$$37, &_9$$37) - ) { - ZEPHIR_GET_HVALUE(value$$37, _11$$37); - ZEPHIR_SINIT_NVAR(_12$$38); - ZVAL_STRING(&_12$$38, "\\'", 0); - ZEPHIR_CALL_FUNCTION(&_13$$38, "addcslashes", &_14, 169, value$$37, &_12$$38); + if (!(ZEPHIR_IS_EMPTY(&typeValues))) { + if (Z_TYPE_P(&typeValues) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&valueSql$$37); + ZVAL_STRING(&valueSql$$37, ""); + zephir_is_iterable(&typeValues, 0, "phalcon/db/dialect/postgresql.zep", 161); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&typeValues), _9$$37) + { + ZEPHIR_INIT_NVAR(&value$$37); + ZVAL_COPY(&value$$37, _9$$37); + ZEPHIR_INIT_NVAR(&_10$$38); + ZVAL_STRING(&_10$$38, "\\'"); + ZEPHIR_CALL_FUNCTION(&_11$$38, "addcslashes", &_12, 149, &value$$37, &_10$$38); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_15$$38); - ZEPHIR_CONCAT_SVS(_15$$38, "'", _13$$38, "', "); - zephir_concat_self(&valueSql$$37, _15$$38 TSRMLS_CC); - } - ZEPHIR_SINIT_VAR(_16$$37); - ZVAL_LONG(&_16$$37, 0); - ZEPHIR_SINIT_VAR(_17$$37); - ZVAL_LONG(&_17$$37, -2); - ZEPHIR_INIT_VAR(_18$$37); - zephir_substr(_18$$37, valueSql$$37, 0 , -2 , 0); - ZEPHIR_INIT_VAR(_19$$37); - ZEPHIR_CONCAT_SVS(_19$$37, "(", _18$$37, ")"); - zephir_concat_self(&columnSql, _19$$37 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_13$$38); + ZEPHIR_CONCAT_SVS(&_13$$38, "'", &_11$$38, "', "); + zephir_concat_self(&valueSql$$37, &_13$$38 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value$$37); + ZVAL_LONG(&_14$$37, 0); + ZVAL_LONG(&_15$$37, -2); + ZEPHIR_INIT_VAR(&_16$$37); + zephir_substr(&_16$$37, &valueSql$$37, 0 , -2 , 0); + ZEPHIR_INIT_VAR(&_17$$37); + ZEPHIR_CONCAT_SVS(&_17$$37, "(", &_16$$37, ")"); + zephir_concat_self(&columnSql, &_17$$37 TSRMLS_CC); } else { - ZEPHIR_SINIT_VAR(_20$$39); - ZVAL_STRING(&_20$$39, "\\'", 0); - ZEPHIR_CALL_FUNCTION(&_21$$39, "addcslashes", &_14, 169, typeValues, &_20$$39); + ZEPHIR_INIT_VAR(&_18$$39); + ZVAL_STRING(&_18$$39, "\\'"); + ZEPHIR_CALL_FUNCTION(&_19$$39, "addcslashes", &_12, 149, &typeValues, &_18$$39); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_22$$39); - ZEPHIR_CONCAT_SVS(_22$$39, "('", _21$$39, "')"); - zephir_concat_self(&columnSql, _22$$39 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_20$$39); + ZEPHIR_CONCAT_SVS(&_20$$39, "('", &_19$$39, "')"); + zephir_concat_self(&columnSql, &_20$$39 TSRMLS_CC); } } } while(0); - RETURN_CCTOR(columnSql); + RETURN_CCTOR(&columnSql); } @@ -230,62 +254,76 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, getColumnDefinition) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addColumn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *column, *sql = NULL, *columnDefinition = NULL, *_0 = NULL, *_1 = NULL, *_2, *_3 = NULL, *_6 = NULL, *_4$$3 = NULL, *_5$$3; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, sql, columnDefinition, _0, _1, _2, _3, _6, _4$$3, _5$$3; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&columnDefinition); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &column); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SVS(sql, "ALTER TABLE ", _0, " ADD COLUMN "); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SVS(&sql, "ALTER TABLE ", &_0, " ADD COLUMN "); ZEPHIR_CALL_METHOD(&_1, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVSV(_2, "\"", _1, "\" ", columnDefinition); - zephir_concat_self(&sql, _2 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVSV(&_2, "\"", &_1, "\" ", &columnDefinition); + zephir_concat_self(&sql, &_2 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_3, column, "hasdefault", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_3)) { + if (zephir_is_true(&_3)) { ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "_castdefault", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_5$$3); - ZEPHIR_CONCAT_SV(_5$$3, " DEFAULT ", _4$$3); - zephir_concat_self(&sql, _5$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$3); + ZEPHIR_CONCAT_SV(&_5$$3, " DEFAULT ", &_4$$3); + zephir_concat_self(&sql, &_5$$3 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_6, column, "isnotnull", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_6)) { + if (zephir_is_true(&_6)) { zephir_concat_self_str(&sql, SL(" NOT NULL") TSRMLS_CC); } else { zephir_concat_self_str(&sql, SL(" NULL") TSRMLS_CC); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -296,47 +334,88 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, modifyColumn) { zend_bool _20$$9; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *column, *currentColumn = NULL, *sql = NULL, *sqlAlterTable = NULL, *defaultValue = NULL, *columnDefinition = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_6 = NULL, *_7 = NULL, *_10 = NULL, *_11 = NULL, *_17 = NULL, *_18 = NULL, *_3$$4 = NULL, *_4$$4 = NULL, *_5$$4, *_8$$5 = NULL, *_9$$5, *_12$$6 = NULL, *_13$$7 = NULL, *_14$$7, *_15$$8 = NULL, *_16$$8, *_19$$9 = NULL, *_21$$9 = NULL, *_24$$9 = NULL, *_22$$10 = NULL, *_23$$10, *_25$$11, *_26$$12 = NULL, *_27$$12, *_28$$13 = NULL, *_29$$13; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null, sql, sqlAlterTable, defaultValue, columnDefinition, _0, _1, _2, _6, _7, _10, _11, _17, _18, _3$$4, _4$$4, _5$$4, _8$$5, _9$$5, _12$$6, _13$$7, _14$$7, _15$$8, _16$$8, _19$$9, _21$$9, _24$$9, _22$$10, _23$$10, _25$$11, _26$$12, _27$$12, _28$$13, _29$$13; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(¤tColumn_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&sqlAlterTable); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&columnDefinition); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_17); + ZVAL_UNDEF(&_18); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_12$$6); + ZVAL_UNDEF(&_13$$7); + ZVAL_UNDEF(&_14$$7); + ZVAL_UNDEF(&_15$$8); + ZVAL_UNDEF(&_16$$8); + ZVAL_UNDEF(&_19$$9); + ZVAL_UNDEF(&_21$$9); + ZVAL_UNDEF(&_24$$9); + ZVAL_UNDEF(&_22$$10); + ZVAL_UNDEF(&_23$$10); + ZVAL_UNDEF(&_25$$11); + ZVAL_UNDEF(&_26$$12); + ZVAL_UNDEF(&_27$$12); + ZVAL_UNDEF(&_28$$13); + ZVAL_UNDEF(&_29$$13); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (!currentColumn) { - ZEPHIR_CPY_WRT(currentColumn, ZEPHIR_GLOBAL(global_null)); + currentColumn = ¤tColumn_sub; + ZEPHIR_CPY_WRT(currentColumn, &__$null); } else { ZEPHIR_SEPARATE_PARAM(currentColumn); } - ZEPHIR_INIT_VAR(sql); - ZVAL_STRING(sql, "", 1); + ZEPHIR_INIT_VAR(&sql); + ZVAL_STRING(&sql, ""); ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sqlAlterTable); - ZEPHIR_CONCAT_SV(sqlAlterTable, "ALTER TABLE ", _0); + ZEPHIR_INIT_VAR(&sqlAlterTable); + ZEPHIR_CONCAT_SV(&sqlAlterTable, "ALTER TABLE ", &_0); if (Z_TYPE_P(currentColumn) != IS_OBJECT) { ZEPHIR_CPY_WRT(currentColumn, column); } @@ -344,90 +423,90 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, modifyColumn) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, currentColumn, "getname", NULL, 0); zephir_check_call_status(); - if (!ZEPHIR_IS_IDENTICAL(_1, _2)) { + if (!ZEPHIR_IS_IDENTICAL(&_1, &_2)) { ZEPHIR_CALL_METHOD(&_3$$4, currentColumn, "getname", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_4$$4, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_5$$4); - ZEPHIR_CONCAT_VSVSVS(_5$$4, sqlAlterTable, " RENAME COLUMN \"", _3$$4, "\" TO \"", _4$$4, "\";"); - zephir_concat_self(&sql, _5$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$4); + ZEPHIR_CONCAT_VSVSVS(&_5$$4, &sqlAlterTable, " RENAME COLUMN \"", &_3$$4, "\" TO \"", &_4$$4, "\";"); + zephir_concat_self(&sql, &_5$$4 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_6, column, "gettype", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_7, currentColumn, "gettype", NULL, 0); zephir_check_call_status(); - if (!ZEPHIR_IS_IDENTICAL(_6, _7)) { + if (!ZEPHIR_IS_IDENTICAL(&_6, &_7)) { ZEPHIR_CALL_METHOD(&_8$$5, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_9$$5); - ZEPHIR_CONCAT_VSVSVS(_9$$5, sqlAlterTable, " ALTER COLUMN \"", _8$$5, "\" TYPE ", columnDefinition, ";"); - zephir_concat_self(&sql, _9$$5 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_9$$5); + ZEPHIR_CONCAT_VSVSVS(&_9$$5, &sqlAlterTable, " ALTER COLUMN \"", &_8$$5, "\" TYPE ", &columnDefinition, ";"); + zephir_concat_self(&sql, &_9$$5 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_10, column, "isnotnull", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_11, currentColumn, "isnotnull", NULL, 0); zephir_check_call_status(); - if (!ZEPHIR_IS_IDENTICAL(_10, _11)) { + if (!ZEPHIR_IS_IDENTICAL(&_10, &_11)) { ZEPHIR_CALL_METHOD(&_12$$6, column, "isnotnull", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_12$$6)) { + if (zephir_is_true(&_12$$6)) { ZEPHIR_CALL_METHOD(&_13$$7, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_14$$7); - ZEPHIR_CONCAT_VSVS(_14$$7, sqlAlterTable, " ALTER COLUMN \"", _13$$7, "\" SET NOT NULL;"); - zephir_concat_self(&sql, _14$$7 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_14$$7); + ZEPHIR_CONCAT_VSVS(&_14$$7, &sqlAlterTable, " ALTER COLUMN \"", &_13$$7, "\" SET NOT NULL;"); + zephir_concat_self(&sql, &_14$$7 TSRMLS_CC); } else { ZEPHIR_CALL_METHOD(&_15$$8, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_16$$8); - ZEPHIR_CONCAT_VSVS(_16$$8, sqlAlterTable, " ALTER COLUMN \"", _15$$8, "\" DROP NOT NULL;"); - zephir_concat_self(&sql, _16$$8 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_16$$8); + ZEPHIR_CONCAT_VSVS(&_16$$8, &sqlAlterTable, " ALTER COLUMN \"", &_15$$8, "\" DROP NOT NULL;"); + zephir_concat_self(&sql, &_16$$8 TSRMLS_CC); } } ZEPHIR_CALL_METHOD(&_17, column, "getdefault", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_18, currentColumn, "getdefault", NULL, 0); zephir_check_call_status(); - if (!ZEPHIR_IS_IDENTICAL(_17, _18)) { + if (!ZEPHIR_IS_IDENTICAL(&_17, &_18)) { ZEPHIR_CALL_METHOD(&_19$$9, column, "getdefault", NULL, 0); zephir_check_call_status(); - _20$$9 = ZEPHIR_IS_EMPTY(_19$$9); + _20$$9 = ZEPHIR_IS_EMPTY(&_19$$9); if (_20$$9) { ZEPHIR_CALL_METHOD(&_21$$9, currentColumn, "getdefault", NULL, 0); zephir_check_call_status(); - _20$$9 = !(ZEPHIR_IS_EMPTY(_21$$9)); + _20$$9 = !(ZEPHIR_IS_EMPTY(&_21$$9)); } if (_20$$9) { ZEPHIR_CALL_METHOD(&_22$$10, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_23$$10); - ZEPHIR_CONCAT_VSVS(_23$$10, sqlAlterTable, " ALTER COLUMN \"", _22$$10, "\" DROP DEFAULT;"); - zephir_concat_self(&sql, _23$$10 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_23$$10); + ZEPHIR_CONCAT_VSVS(&_23$$10, &sqlAlterTable, " ALTER COLUMN \"", &_22$$10, "\" DROP DEFAULT;"); + zephir_concat_self(&sql, &_23$$10 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_24$$9, column, "hasdefault", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_24$$9)) { + if (zephir_is_true(&_24$$9)) { ZEPHIR_CALL_METHOD(&defaultValue, this_ptr, "_castdefault", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_25$$11); - zephir_fast_strtoupper(_25$$11, columnDefinition); - if (zephir_memnstr_str(_25$$11, SL("BOOLEAN"), "phalcon/db/dialect/postgresql.zep", 237)) { + ZEPHIR_INIT_VAR(&_25$$11); + zephir_fast_strtoupper(&_25$$11, &columnDefinition); + if (zephir_memnstr_str(&_25$$11, SL("BOOLEAN"), "phalcon/db/dialect/postgresql.zep", 237)) { ZEPHIR_CALL_METHOD(&_26$$12, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_27$$12); - ZEPHIR_CONCAT_SVSV(_27$$12, " ALTER COLUMN \"", _26$$12, "\" SET DEFAULT ", defaultValue); - zephir_concat_self(&sql, _27$$12 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_27$$12); + ZEPHIR_CONCAT_SVSV(&_27$$12, " ALTER COLUMN \"", &_26$$12, "\" SET DEFAULT ", &defaultValue); + zephir_concat_self(&sql, &_27$$12 TSRMLS_CC); } else { ZEPHIR_CALL_METHOD(&_28$$13, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_29$$13); - ZEPHIR_CONCAT_VSVSV(_29$$13, sqlAlterTable, " ALTER COLUMN \"", _28$$13, "\" SET DEFAULT ", defaultValue); - zephir_concat_self(&sql, _29$$13 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_29$$13); + ZEPHIR_CONCAT_VSVSV(&_29$$13, &sqlAlterTable, " ALTER COLUMN \"", &_28$$13, "\" SET DEFAULT ", &defaultValue); + zephir_concat_self(&sql, &_29$$13 TSRMLS_CC); } } } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -437,47 +516,53 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, modifyColumn) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropColumn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL, *_0 = NULL; - zval *tableName = NULL, *schemaName = NULL, *columnName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL, _0; + zval tableName, schemaName, columnName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &columnName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(columnName_param) != IS_STRING && Z_TYPE_P(columnName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'columnName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'columnName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(columnName_param) == IS_STRING)) { - zephir_get_strval(columnName, columnName_param); + zephir_get_strval(&columnName, columnName_param); } else { - ZEPHIR_INIT_VAR(columnName); - ZVAL_EMPTY_STRING(columnName); + ZEPHIR_INIT_VAR(&columnName); + ZVAL_EMPTY_STRING(&columnName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", _0, " DROP COLUMN \"", columnName, "\""); + ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP COLUMN \"", &columnName, "\""); RETURN_MM(); } @@ -488,65 +573,80 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropColumn) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addIndex) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *index, *sql = NULL, *indexType = NULL, *_0 = NULL, *_2 = NULL, *_3 = NULL, *_4, *_5 = NULL, *_6 = NULL, *_7, *_1$$4; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, sql, indexType, _0, _2, _3, _4, _5, _6, _7, _1$$4; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&indexType); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } ZEPHIR_CALL_METHOD(&_0, index, "getname", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_STRING_IDENTICAL(_0, "PRIMARY")) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addprimarykey", NULL, 0, tableName, schemaName, index); + if (ZEPHIR_IS_STRING_IDENTICAL(&_0, "PRIMARY")) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "addprimarykey", NULL, 0, &tableName, &schemaName, index); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(sql); - ZVAL_STRING(sql, "CREATE", 1); + ZEPHIR_INIT_VAR(&sql); + ZVAL_STRING(&sql, "CREATE"); ZEPHIR_CALL_METHOD(&indexType, index, "gettype", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(indexType))) { - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_SV(_1$$4, " ", indexType); - zephir_concat_self(&sql, _1$$4 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&indexType))) { + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_SV(&_1$$4, " ", &indexType); + zephir_concat_self(&sql, &_1$$4 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_2, index, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4); - ZEPHIR_CONCAT_SVSV(_4, " INDEX \"", _2, "\" ON ", _3); - zephir_concat_self(&sql, _4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4); + ZEPHIR_CONCAT_SVSV(&_4, " INDEX \"", &_2, "\" ON ", &_3); + zephir_concat_self(&sql, &_4 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_6, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 57, _6); + ZEPHIR_CALL_METHOD(&_5, this_ptr, "getcolumnlist", NULL, 50, &_6); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_7); - ZEPHIR_CONCAT_SVS(_7, " (", _5, ")"); - zephir_concat_self(&sql, _7 TSRMLS_CC); - RETURN_CCTOR(sql); + ZEPHIR_INIT_VAR(&_7); + ZEPHIR_CONCAT_SVS(&_7, " (", &_5, ")"); + zephir_concat_self(&sql, &_7 TSRMLS_CC); + RETURN_CCTOR(&sql); } @@ -556,44 +656,49 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addIndex) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropIndex) { zval *tableName_param = NULL, *schemaName_param = NULL, *indexName_param = NULL; - zval *tableName = NULL, *schemaName = NULL, *indexName = NULL; + zval tableName, schemaName, indexName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&indexName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &indexName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(indexName_param) != IS_STRING && Z_TYPE_P(indexName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'indexName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'indexName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(indexName_param) == IS_STRING)) { - zephir_get_strval(indexName, indexName_param); + zephir_get_strval(&indexName, indexName_param); } else { - ZEPHIR_INIT_VAR(indexName); - ZVAL_EMPTY_STRING(indexName); + ZEPHIR_INIT_VAR(&indexName); + ZVAL_EMPTY_STRING(&indexName); } - ZEPHIR_CONCAT_SVS(return_value, "DROP INDEX \"", indexName, "\""); + ZEPHIR_CONCAT_SVS(return_value, "DROP INDEX \"", &indexName, "\""); RETURN_MM(); } @@ -604,41 +709,49 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropIndex) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addPrimaryKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *index, *_0 = NULL, *_1 = NULL, *_2 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, _0, _1, _2; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 57, _2); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getcolumnlist", NULL, 50, &_2); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", _0, " ADD CONSTRAINT \"PRIMARY\" PRIMARY KEY (", _1, ")"); + ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " ADD CONSTRAINT \"PRIMARY\" PRIMARY KEY (", &_1, ")"); RETURN_MM(); } @@ -649,37 +762,42 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addPrimaryKey) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropPrimaryKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *_0 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, _0; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, "ALTER TABLE ", _0, " DROP CONSTRAINT \"PRIMARY\""); + ZEPHIR_CONCAT_SVS(return_value, "ALTER TABLE ", &_0, " DROP CONSTRAINT \"PRIMARY\""); RETURN_MM(); } @@ -690,75 +808,95 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropPrimaryKey) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addForeignKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *reference, *sql = NULL, *onDelete = NULL, *onUpdate = NULL, *_0 = NULL, *_1 = NULL, *_4 = NULL, *_5 = NULL, *_6 = NULL, *_7 = NULL, *_8 = NULL, *_9, *_2$$3 = NULL, *_3$$3, *_10$$4, *_11$$5; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub, sql, onDelete, onUpdate, _0, _1, _4, _5, _6, _7, _8, _9, _2$$3, _3$$3, _10$$4, _11$$5; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&reference_sub); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&onDelete); + ZVAL_UNDEF(&onUpdate); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_10$$4); + ZVAL_UNDEF(&_11$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &reference); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SVS(sql, "ALTER TABLE ", _0, " ADD"); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SVS(&sql, "ALTER TABLE ", &_0, " ADD"); ZEPHIR_CALL_METHOD(&_1, reference, "getname", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_1)) { + if (zephir_is_true(&_1)) { ZEPHIR_CALL_METHOD(&_2$$3, reference, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3$$3); - ZEPHIR_CONCAT_SVS(_3$$3, " CONSTRAINT \"", _2$$3, "\""); - zephir_concat_self(&sql, _3$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$3); + ZEPHIR_CONCAT_SVS(&_3$$3, " CONSTRAINT \"", &_2$$3, "\""); + zephir_concat_self(&sql, &_3$$3 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_5, reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 57, _5); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 50, &_5); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_6, reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8, reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_7, this_ptr, "getcolumnlist", NULL, 57, _8); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "getcolumnlist", NULL, 50, &_8); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_9); - ZEPHIR_CONCAT_SVSSVSVS(_9, " FOREIGN KEY (", _4, ")", " REFERENCES \"", _6, "\" (", _7, ")"); - zephir_concat_self(&sql, _9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_9); + ZEPHIR_CONCAT_SVSSVSVS(&_9, " FOREIGN KEY (", &_4, ")", " REFERENCES \"", &_6, "\" (", &_7, ")"); + zephir_concat_self(&sql, &_9 TSRMLS_CC); ZEPHIR_CALL_METHOD(&onDelete, reference, "getondelete", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onDelete))) { - ZEPHIR_INIT_VAR(_10$$4); - ZEPHIR_CONCAT_SV(_10$$4, " ON DELETE ", onDelete); - zephir_concat_self(&sql, _10$$4 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onDelete))) { + ZEPHIR_INIT_VAR(&_10$$4); + ZEPHIR_CONCAT_SV(&_10$$4, " ON DELETE ", &onDelete); + zephir_concat_self(&sql, &_10$$4 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&onUpdate, reference, "getonupdate", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onUpdate))) { - ZEPHIR_INIT_VAR(_11$$5); - ZEPHIR_CONCAT_SV(_11$$5, " ON UPDATE ", onUpdate); - zephir_concat_self(&sql, _11$$5 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onUpdate))) { + ZEPHIR_INIT_VAR(&_11$$5); + ZEPHIR_CONCAT_SV(&_11$$5, " ON UPDATE ", &onUpdate); + zephir_concat_self(&sql, &_11$$5 TSRMLS_CC); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -768,47 +906,53 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, addForeignKey) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropForeignKey) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL, *_0 = NULL; - zval *tableName = NULL, *schemaName = NULL, *referenceName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL, _0; + zval tableName, schemaName, referenceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&referenceName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &referenceName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(referenceName_param) != IS_STRING && Z_TYPE_P(referenceName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referenceName_param) == IS_STRING)) { - zephir_get_strval(referenceName, referenceName_param); + zephir_get_strval(&referenceName, referenceName_param); } else { - ZEPHIR_INIT_VAR(referenceName); - ZVAL_EMPTY_STRING(referenceName); + ZEPHIR_INIT_VAR(&referenceName); + ZVAL_EMPTY_STRING(&referenceName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", _0, " DROP CONSTRAINT \"", referenceName, "\""); + ZEPHIR_CONCAT_SVSVS(return_value, "ALTER TABLE ", &_0, " DROP CONSTRAINT \"", &referenceName, "\""); RETURN_MM(); } @@ -818,222 +962,280 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropForeignKey) { */ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) { - HashTable *_1, *_15$$13, *_28$$20; - HashPosition _0, _14$$13, _27$$20; - zephir_fcall_cache_entry *_3 = NULL, *_7 = NULL; + zephir_fcall_cache_entry *_1 = NULL, *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, *temporary = NULL, *options = NULL, *table = NULL, *createLines = NULL, *columns = NULL, *column = NULL, *indexes = NULL, *index = NULL, *reference = NULL, *references = NULL, *indexName = NULL, *indexSql = NULL, *indexSqlAfterCreate = NULL, *sql = NULL, *columnLine = NULL, *indexType = NULL, *referenceSql = NULL, *onDelete = NULL, *onUpdate = NULL, *primaryColumns = NULL, *columnDefinition = NULL, **_2, *_40, *_41, *_44, *_4$$7 = NULL, *_5$$7 = NULL, *_9$$7 = NULL, *_10$$7 = NULL, *_6$$8 = NULL, *_8$$8 = NULL, *_11$$11 = NULL, *_12$$12 = NULL, *_13$$12, **_16$$13, *_17$$15 = NULL, *_18$$15 = NULL, *_19$$17 = NULL, *_20$$17 = NULL, *_21$$18 = NULL, *_22$$18 = NULL, *_23$$18 = NULL, *_24$$18 = NULL, *_25$$18 = NULL, *_26$$18 = NULL, **_29$$20, *_30$$21 = NULL, *_31$$21 = NULL, *_32$$21 = NULL, *_33$$21 = NULL, *_34$$21 = NULL, *_35$$21 = NULL, *_36$$21 = NULL, *_37$$21 = NULL, *_38$$22 = NULL, *_39$$23 = NULL, *_42$$24 = NULL, *_43$$24; - zval *tableName = NULL, *schemaName = NULL; + zval definition; + zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, temporary, options, table, createLines, columns, column, indexes, index, reference, references, indexName, indexSql, indexSqlAfterCreate, sql, columnLine, indexType, referenceSql, onDelete, onUpdate, primaryColumns, columnDefinition, *_0, _34, _35, _38, _2$$7, _3$$7, _7$$7, _8$$7, _4$$8, _6$$8, _9$$11, _10$$12, _11$$12, *_12$$13, _13$$15, _14$$15, _15$$17, _16$$17, _17$$18, _18$$18, _19$$18, _20$$18, _21$$18, _22$$18, *_23$$20, _24$$21, _25$$21, _26$$21, _27$$21, _28$$21, _29$$21, _30$$21, _31$$21, _32$$22, _33$$23, _36$$24, _37$$24; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&temporary); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&createLines); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&indexes); + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&reference); + ZVAL_UNDEF(&references); + ZVAL_UNDEF(&indexName); + ZVAL_UNDEF(&indexSql); + ZVAL_UNDEF(&indexSqlAfterCreate); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&columnLine); + ZVAL_UNDEF(&indexType); + ZVAL_UNDEF(&referenceSql); + ZVAL_UNDEF(&onDelete); + ZVAL_UNDEF(&onUpdate); + ZVAL_UNDEF(&primaryColumns); + ZVAL_UNDEF(&columnDefinition); + ZVAL_UNDEF(&_34); + ZVAL_UNDEF(&_35); + ZVAL_UNDEF(&_38); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_4$$8); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_9$$11); + ZVAL_UNDEF(&_10$$12); + ZVAL_UNDEF(&_11$$12); + ZVAL_UNDEF(&_13$$15); + ZVAL_UNDEF(&_14$$15); + ZVAL_UNDEF(&_15$$17); + ZVAL_UNDEF(&_16$$17); + ZVAL_UNDEF(&_17$$18); + ZVAL_UNDEF(&_18$$18); + ZVAL_UNDEF(&_19$$18); + ZVAL_UNDEF(&_20$$18); + ZVAL_UNDEF(&_21$$18); + ZVAL_UNDEF(&_22$$18); + ZVAL_UNDEF(&_24$$21); + ZVAL_UNDEF(&_25$$21); + ZVAL_UNDEF(&_26$$21); + ZVAL_UNDEF(&_27$$21); + ZVAL_UNDEF(&_28$$21); + ZVAL_UNDEF(&_29$$21); + ZVAL_UNDEF(&_30$$21); + ZVAL_UNDEF(&_31$$21); + ZVAL_UNDEF(&_32$$22); + ZVAL_UNDEF(&_33$$23); + ZVAL_UNDEF(&_36$$24); + ZVAL_UNDEF(&_37$$24); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - ZEPHIR_OBS_VAR(columns); - if (!(zephir_array_isset_string_fetch(&columns, definition, SS("columns"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&columns); + if (!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'columns' is required in the definition array", "phalcon/db/dialect/postgresql.zep", 350); return; } - ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(temporary); - ZVAL_BOOL(temporary, 0); - ZEPHIR_OBS_VAR(options); - if (zephir_array_isset_string_fetch(&options, definition, SS("options"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_NVAR(temporary); - zephir_array_isset_string_fetch(&temporary, options, SS("temporary"), 0 TSRMLS_CC); - } - ZEPHIR_INIT_VAR(sql); - if (zephir_is_true(temporary)) { - ZEPHIR_CONCAT_SVS(sql, "CREATE TEMPORARY TABLE ", table, " (\n\t"); + ZEPHIR_INIT_VAR(&temporary); + ZVAL_BOOL(&temporary, 0); + ZEPHIR_OBS_VAR(&options); + if (zephir_array_isset_string_fetch(&options, &definition, SL("options"), 0)) { + ZEPHIR_OBS_NVAR(&temporary); + zephir_array_isset_string_fetch(&temporary, &options, SL("temporary"), 0); + } + ZEPHIR_INIT_VAR(&sql); + if (zephir_is_true(&temporary)) { + ZEPHIR_CONCAT_SVS(&sql, "CREATE TEMPORARY TABLE ", &table, " (\n\t"); } else { - ZEPHIR_CONCAT_SVS(sql, "CREATE TABLE ", table, " (\n\t"); - } - ZEPHIR_INIT_VAR(createLines); - array_init(createLines); - ZEPHIR_INIT_VAR(primaryColumns); - array_init(primaryColumns); - zephir_is_iterable(columns, &_1, &_0, 0, 0, "phalcon/db/dialect/postgresql.zep", 401); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(column, _2); - ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", &_3, 0, column); + ZEPHIR_CONCAT_SVS(&sql, "CREATE TABLE ", &table, " (\n\t"); + } + ZEPHIR_INIT_VAR(&createLines); + array_init(&createLines); + ZEPHIR_INIT_VAR(&primaryColumns); + array_init(&primaryColumns); + zephir_is_iterable(&columns, 0, "phalcon/db/dialect/postgresql.zep", 401); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _0) + { + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _0); + ZEPHIR_CALL_METHOD(&columnDefinition, this_ptr, "getcolumndefinition", &_1, 0, &column); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$7, column, "getname", NULL, 0); + ZEPHIR_CALL_METHOD(&_2$$7, &column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(columnLine); - ZEPHIR_CONCAT_SVSV(columnLine, "\"", _4$$7, "\" ", columnDefinition); - ZEPHIR_CALL_METHOD(&_5$$7, column, "hasdefault", NULL, 0); + ZEPHIR_INIT_NVAR(&columnLine); + ZEPHIR_CONCAT_SVSV(&columnLine, "\"", &_2$$7, "\" ", &columnDefinition); + ZEPHIR_CALL_METHOD(&_3$$7, &column, "hasdefault", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_5$$7)) { - ZEPHIR_CALL_METHOD(&_6$$8, this_ptr, "_castdefault", &_7, 0, column); + if (zephir_is_true(&_3$$7)) { + ZEPHIR_CALL_METHOD(&_4$$8, this_ptr, "_castdefault", &_5, 0, &column); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_8$$8); - ZEPHIR_CONCAT_SV(_8$$8, " DEFAULT ", _6$$8); - zephir_concat_self(&columnLine, _8$$8 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_6$$8); + ZEPHIR_CONCAT_SV(&_6$$8, " DEFAULT ", &_4$$8); + zephir_concat_self(&columnLine, &_6$$8 TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&_9$$7, column, "isnotnull", NULL, 0); + ZEPHIR_CALL_METHOD(&_7$$7, &column, "isnotnull", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_9$$7)) { + if (zephir_is_true(&_7$$7)) { zephir_concat_self_str(&columnLine, SL(" NOT NULL") TSRMLS_CC); } else { zephir_concat_self_str(&columnLine, SL(" NULL") TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&_10$$7, column, "isprimary", NULL, 0); + ZEPHIR_CALL_METHOD(&_8$$7, &column, "isprimary", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_10$$7)) { - ZEPHIR_CALL_METHOD(&_11$$11, column, "getname", NULL, 0); + if (zephir_is_true(&_8$$7)) { + ZEPHIR_CALL_METHOD(&_9$$11, &column, "getname", NULL, 0); zephir_check_call_status(); - zephir_array_append(&primaryColumns, _11$$11, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 396); + zephir_array_append(&primaryColumns, &_9$$11, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 396); } - zephir_array_append(&createLines, columnLine, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 399); - } - if (!(ZEPHIR_IS_EMPTY(primaryColumns))) { - ZEPHIR_CALL_METHOD(&_12$$12, this_ptr, "getcolumnlist", NULL, 57, primaryColumns); + zephir_array_append(&createLines, &columnLine, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 399); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); + if (!(ZEPHIR_IS_EMPTY(&primaryColumns))) { + ZEPHIR_CALL_METHOD(&_10$$12, this_ptr, "getcolumnlist", NULL, 50, &primaryColumns); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_13$$12); - ZEPHIR_CONCAT_SVS(_13$$12, "PRIMARY KEY (", _12$$12, ")"); - zephir_array_append(&createLines, _13$$12, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 402); - } - ZEPHIR_INIT_VAR(indexSqlAfterCreate); - ZVAL_STRING(indexSqlAfterCreate, "", 1); - ZEPHIR_OBS_VAR(indexes); - if (zephir_array_isset_string_fetch(&indexes, definition, SS("indexes"), 0 TSRMLS_CC)) { - zephir_is_iterable(indexes, &_15$$13, &_14$$13, 0, 0, "phalcon/db/dialect/postgresql.zep", 436); - for ( - ; zend_hash_get_current_data_ex(_15$$13, (void**) &_16$$13, &_14$$13) == SUCCESS - ; zend_hash_move_forward_ex(_15$$13, &_14$$13) - ) { - ZEPHIR_GET_HVALUE(index, _16$$13); - ZEPHIR_CALL_METHOD(&indexName, index, "getname", NULL, 0); + ZEPHIR_INIT_VAR(&_11$$12); + ZEPHIR_CONCAT_SVS(&_11$$12, "PRIMARY KEY (", &_10$$12, ")"); + zephir_array_append(&createLines, &_11$$12, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 402); + } + ZEPHIR_INIT_VAR(&indexSqlAfterCreate); + ZVAL_STRING(&indexSqlAfterCreate, ""); + ZEPHIR_OBS_VAR(&indexes); + if (zephir_array_isset_string_fetch(&indexes, &definition, SL("indexes"), 0)) { + zephir_is_iterable(&indexes, 0, "phalcon/db/dialect/postgresql.zep", 436); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&indexes), _12$$13) + { + ZEPHIR_INIT_NVAR(&index); + ZVAL_COPY(&index, _12$$13); + ZEPHIR_CALL_METHOD(&indexName, &index, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&indexType, index, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(&indexType, &index, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(indexSql); - ZVAL_STRING(indexSql, "", 1); - if (ZEPHIR_IS_STRING(indexName, "PRIMARY")) { - ZEPHIR_CALL_METHOD(&_18$$15, index, "getcolumns", NULL, 0); + ZEPHIR_INIT_NVAR(&indexSql); + ZVAL_STRING(&indexSql, ""); + if (ZEPHIR_IS_STRING(&indexName, "PRIMARY")) { + ZEPHIR_CALL_METHOD(&_14$$15, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_17$$15, this_ptr, "getcolumnlist", NULL, 57, _18$$15); + ZEPHIR_CALL_METHOD(&_13$$15, this_ptr, "getcolumnlist", NULL, 50, &_14$$15); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(indexSql); - ZEPHIR_CONCAT_SVS(indexSql, "CONSTRAINT \"PRIMARY\" PRIMARY KEY (", _17$$15, ")"); + ZEPHIR_INIT_NVAR(&indexSql); + ZEPHIR_CONCAT_SVS(&indexSql, "CONSTRAINT \"PRIMARY\" PRIMARY KEY (", &_13$$15, ")"); } else { - if (!(ZEPHIR_IS_EMPTY(indexType))) { - ZEPHIR_CALL_METHOD(&_20$$17, index, "getcolumns", NULL, 0); + if (!(ZEPHIR_IS_EMPTY(&indexType))) { + ZEPHIR_CALL_METHOD(&_16$$17, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_19$$17, this_ptr, "getcolumnlist", NULL, 57, _20$$17); + ZEPHIR_CALL_METHOD(&_15$$17, this_ptr, "getcolumnlist", NULL, 50, &_16$$17); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(indexSql); - ZEPHIR_CONCAT_SVSVSVS(indexSql, "CONSTRAINT \"", indexName, "\" ", indexType, " (", _19$$17, ")"); + ZEPHIR_INIT_NVAR(&indexSql); + ZEPHIR_CONCAT_SVSVSVS(&indexSql, "CONSTRAINT \"", &indexName, "\" ", &indexType, " (", &_15$$17, ")"); } else { - ZEPHIR_CALL_METHOD(&_21$$18, index, "getname", NULL, 0); + ZEPHIR_CALL_METHOD(&_17$$18, &index, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_22$$18, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_18$$18, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_23$$18); - ZEPHIR_CONCAT_SVSV(_23$$18, "CREATE INDEX \"", _21$$18, "\" ON ", _22$$18); - zephir_concat_self(&indexSqlAfterCreate, _23$$18 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_25$$18, index, "getcolumns", NULL, 0); + ZEPHIR_INIT_LNVAR(_19$$18); + ZEPHIR_CONCAT_SVSV(&_19$$18, "CREATE INDEX \"", &_17$$18, "\" ON ", &_18$$18); + zephir_concat_self(&indexSqlAfterCreate, &_19$$18 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_21$$18, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_24$$18, this_ptr, "getcolumnlist", NULL, 57, _25$$18); + ZEPHIR_CALL_METHOD(&_20$$18, this_ptr, "getcolumnlist", NULL, 50, &_21$$18); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_26$$18); - ZEPHIR_CONCAT_SVS(_26$$18, " (", _24$$18, ");"); - zephir_concat_self(&indexSqlAfterCreate, _26$$18 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_22$$18); + ZEPHIR_CONCAT_SVS(&_22$$18, " (", &_20$$18, ");"); + zephir_concat_self(&indexSqlAfterCreate, &_22$$18 TSRMLS_CC); } } - if (!(ZEPHIR_IS_EMPTY(indexSql))) { - zephir_array_append(&createLines, indexSql, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 433); + if (!(ZEPHIR_IS_EMPTY(&indexSql))) { + zephir_array_append(&createLines, &indexSql, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 433); } - } - } - ZEPHIR_OBS_VAR(references); - if (zephir_array_isset_string_fetch(&references, definition, SS("references"), 0 TSRMLS_CC)) { - zephir_is_iterable(references, &_28$$20, &_27$$20, 0, 0, "phalcon/db/dialect/postgresql.zep", 461); - for ( - ; zend_hash_get_current_data_ex(_28$$20, (void**) &_29$$20, &_27$$20) == SUCCESS - ; zend_hash_move_forward_ex(_28$$20, &_27$$20) - ) { - ZEPHIR_GET_HVALUE(reference, _29$$20); - ZEPHIR_CALL_METHOD(&_30$$21, reference, "getname", NULL, 0); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&index); + } + ZEPHIR_OBS_VAR(&references); + if (zephir_array_isset_string_fetch(&references, &definition, SL("references"), 0)) { + zephir_is_iterable(&references, 0, "phalcon/db/dialect/postgresql.zep", 461); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&references), _23$$20) + { + ZEPHIR_INIT_NVAR(&reference); + ZVAL_COPY(&reference, _23$$20); + ZEPHIR_CALL_METHOD(&_24$$21, &reference, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_32$$21, reference, "getcolumns", NULL, 0); + ZEPHIR_CALL_METHOD(&_26$$21, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_31$$21, this_ptr, "getcolumnlist", NULL, 57, _32$$21); + ZEPHIR_CALL_METHOD(&_25$$21, this_ptr, "getcolumnlist", NULL, 50, &_26$$21); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(referenceSql); - ZEPHIR_CONCAT_SVSVS(referenceSql, "CONSTRAINT \"", _30$$21, "\" FOREIGN KEY (", _31$$21, ") REFERENCES "); - ZEPHIR_CALL_METHOD(&_34$$21, reference, "getreferencedtable", NULL, 0); + ZEPHIR_INIT_NVAR(&referenceSql); + ZEPHIR_CONCAT_SVSVS(&referenceSql, "CONSTRAINT \"", &_24$$21, "\" FOREIGN KEY (", &_25$$21, ") REFERENCES "); + ZEPHIR_CALL_METHOD(&_28$$21, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_33$$21, this_ptr, "preparetable", NULL, 0, _34$$21, schemaName); + ZEPHIR_CALL_METHOD(&_27$$21, this_ptr, "preparetable", NULL, 0, &_28$$21, &schemaName); zephir_check_call_status(); - zephir_concat_self(&referenceSql, _33$$21 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_36$$21, reference, "getreferencedcolumns", NULL, 0); + zephir_concat_self(&referenceSql, &_27$$21 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_30$$21, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_35$$21, this_ptr, "getcolumnlist", NULL, 57, _36$$21); + ZEPHIR_CALL_METHOD(&_29$$21, this_ptr, "getcolumnlist", NULL, 50, &_30$$21); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_37$$21); - ZEPHIR_CONCAT_SVS(_37$$21, " (", _35$$21, ")"); - zephir_concat_self(&referenceSql, _37$$21 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&onDelete, reference, "getondelete", NULL, 0); + ZEPHIR_INIT_LNVAR(_31$$21); + ZEPHIR_CONCAT_SVS(&_31$$21, " (", &_29$$21, ")"); + zephir_concat_self(&referenceSql, &_31$$21 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&onDelete, &reference, "getondelete", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onDelete))) { - ZEPHIR_INIT_LNVAR(_38$$22); - ZEPHIR_CONCAT_SV(_38$$22, " ON DELETE ", onDelete); - zephir_concat_self(&referenceSql, _38$$22 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onDelete))) { + ZEPHIR_INIT_LNVAR(_32$$22); + ZEPHIR_CONCAT_SV(&_32$$22, " ON DELETE ", &onDelete); + zephir_concat_self(&referenceSql, &_32$$22 TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&onUpdate, reference, "getonupdate", NULL, 0); + ZEPHIR_CALL_METHOD(&onUpdate, &reference, "getonupdate", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onUpdate))) { - ZEPHIR_INIT_LNVAR(_39$$23); - ZEPHIR_CONCAT_SV(_39$$23, " ON UPDATE ", onUpdate); - zephir_concat_self(&referenceSql, _39$$23 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onUpdate))) { + ZEPHIR_INIT_LNVAR(_33$$23); + ZEPHIR_CONCAT_SV(&_33$$23, " ON UPDATE ", &onUpdate); + zephir_concat_self(&referenceSql, &_33$$23 TSRMLS_CC); } - zephir_array_append(&createLines, referenceSql, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 459); - } - } - ZEPHIR_INIT_VAR(_40); - zephir_fast_join_str(_40, SL(",\n\t"), createLines TSRMLS_CC); - ZEPHIR_INIT_VAR(_41); - ZEPHIR_CONCAT_VS(_41, _40, "\n)"); - zephir_concat_self(&sql, _41 TSRMLS_CC); - if (zephir_array_isset_string(definition, SS("options"))) { - ZEPHIR_CALL_METHOD(&_42$$24, this_ptr, "_gettableoptions", NULL, 0, definition); + zephir_array_append(&createLines, &referenceSql, PH_SEPARATE, "phalcon/db/dialect/postgresql.zep", 459); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&reference); + } + ZEPHIR_INIT_VAR(&_34); + zephir_fast_join_str(&_34, SL(",\n\t"), &createLines TSRMLS_CC); + ZEPHIR_INIT_VAR(&_35); + ZEPHIR_CONCAT_VS(&_35, &_34, "\n)"); + zephir_concat_self(&sql, &_35 TSRMLS_CC); + if (zephir_array_isset_string(&definition, SL("options"))) { + ZEPHIR_CALL_METHOD(&_36$$24, this_ptr, "_gettableoptions", NULL, 0, &definition); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_43$$24); - ZEPHIR_CONCAT_SV(_43$$24, " ", _42$$24); - zephir_concat_self(&sql, _43$$24 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_37$$24); + ZEPHIR_CONCAT_SV(&_37$$24, " ", &_36$$24); + zephir_concat_self(&sql, &_37$$24 TSRMLS_CC); } - ZEPHIR_INIT_VAR(_44); - ZEPHIR_CONCAT_SV(_44, ";", indexSqlAfterCreate); - zephir_concat_self(&sql, _44 TSRMLS_CC); - RETURN_CCTOR(sql); + ZEPHIR_INIT_VAR(&_38); + ZEPHIR_CONCAT_SV(&_38, ";", &indexSqlAfterCreate); + zephir_concat_self(&sql, &_38 TSRMLS_CC); + RETURN_CCTOR(&sql); } @@ -1042,44 +1244,51 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createTable) { */ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, truncateTable) { - zval *tableName_param = NULL, *schemaName_param = NULL, *sql = NULL, *table = NULL; - zval *tableName = NULL, *schemaName = NULL, *_0$$3; + zval *tableName_param = NULL, *schemaName_param = NULL, sql, table; + zval tableName, schemaName, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&table); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_VSV(_0$$3, schemaName, ".", tableName); - ZEPHIR_CPY_WRT(table, _0$$3); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_VSV(&_0$$3, &schemaName, ".", &tableName); + ZEPHIR_CPY_WRT(&table, &_0$$3); } else { - ZEPHIR_CPY_WRT(table, tableName); + ZEPHIR_CPY_WRT(&table, &tableName); } - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SV(sql, "TRUNCATE TABLE ", table); - RETURN_CCTOR(sql); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SV(&sql, "TRUNCATE TABLE ", &table); + RETURN_CCTOR(&sql); } @@ -1090,48 +1299,54 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropTable) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool ifExists; - zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, *table = NULL, *sql = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, table, sql; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&sql); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &tableName_param, &schemaName_param, &ifExists_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } if (!ifExists_param) { ifExists = 1; } else { - if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - ifExists = Z_BVAL_P(ifExists_param); + ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE); } - ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); + ZEPHIR_INIT_VAR(&sql); if (ifExists) { - ZEPHIR_CONCAT_SV(sql, "DROP TABLE IF EXISTS ", table); + ZEPHIR_CONCAT_SV(&sql, "DROP TABLE IF EXISTS ", &table); } else { - ZEPHIR_CONCAT_SV(sql, "DROP TABLE ", table); + ZEPHIR_CONCAT_SV(&sql, "DROP TABLE ", &table); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -1141,40 +1356,47 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropTable) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, createView) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, *viewSql = NULL, *_0 = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval definition; + zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, viewSql, _0; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&viewSql); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &viewName_param, &definition_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - ZEPHIR_OBS_VAR(viewSql); - if (!(zephir_array_isset_string_fetch(&viewSql, definition, SS("sql"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&viewSql); + if (!(zephir_array_isset_string_fetch(&viewSql, &definition, SL("sql"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'sql' is required in the definition array", "phalcon/db/dialect/postgresql.zep", 516); return; } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, viewName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", _0, " AS ", viewSql); + ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", &_0, " AS ", &viewSql); RETURN_MM(); } @@ -1186,48 +1408,54 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropView) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool ifExists; - zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, *view = NULL, *sql = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, view, sql; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&view); + ZVAL_UNDEF(&sql); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &viewName_param, &schemaName_param, &ifExists_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } if (!ifExists_param) { ifExists = 1; } else { - if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - ifExists = Z_BVAL_P(ifExists_param); + ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE); } - ZEPHIR_CALL_METHOD(&view, this_ptr, "preparetable", NULL, 0, viewName, schemaName); + ZEPHIR_CALL_METHOD(&view, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); + ZEPHIR_INIT_VAR(&sql); if (ifExists) { - ZEPHIR_CONCAT_SV(sql, "DROP VIEW IF EXISTS ", view); + ZEPHIR_CONCAT_SV(&sql, "DROP VIEW IF EXISTS ", &view); } else { - ZEPHIR_CONCAT_SV(sql, "DROP VIEW ", view); + ZEPHIR_CONCAT_SV(&sql, "DROP VIEW ", &view); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -1243,34 +1471,38 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, dropView) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, tableExists) { zval *tableName_param = NULL, *schemaName_param = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_CONCAT_SVSVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM information_schema.tables WHERE table_schema = '", schemaName, "' AND table_name='", tableName, "'"); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_CONCAT_SVSVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM information_schema.tables WHERE table_schema = '", &schemaName, "' AND table_name='", &tableName, "'"); RETURN_MM(); } - ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM information_schema.tables WHERE table_schema = 'public' AND table_name='", tableName, "'"); + ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM information_schema.tables WHERE table_schema = 'public' AND table_name='", &tableName, "'"); RETURN_MM(); } @@ -1281,34 +1513,38 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, tableExists) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, viewExists) { zval *viewName_param = NULL, *schemaName_param = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &viewName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_CONCAT_SVSVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM pg_views WHERE viewname='", viewName, "' AND schemaname='", schemaName, "'"); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_CONCAT_SVSVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM pg_views WHERE viewname='", &viewName, "' AND schemaname='", &schemaName, "'"); RETURN_MM(); } - ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM pg_views WHERE viewname='", viewName, "' AND schemaname='public'"); + ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM pg_views WHERE viewname='", &viewName, "' AND schemaname='public'"); RETURN_MM(); } @@ -1325,34 +1561,38 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, viewExists) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeColumns) { zval *table_param = NULL, *schema_param = NULL; - zval *table = NULL, *schema = NULL; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - if (!(!schema) && Z_STRLEN_P(schema)) { - ZEPHIR_CONCAT_SVSVS(return_value, "SELECT DISTINCT c.column_name AS Field, c.data_type AS Type, c.character_maximum_length AS Size, c.numeric_precision AS NumericSize, c.numeric_scale AS NumericScale, c.is_nullable AS Null, CASE WHEN pkc.column_name NOTNULL THEN 'PRI' ELSE '' END AS Key, CASE WHEN c.data_type LIKE '%int%' AND c.column_default LIKE '%nextval%' THEN 'auto_increment' ELSE '' END AS Extra, c.ordinal_position AS Position, c.column_default FROM information_schema.columns c LEFT JOIN ( SELECT kcu.column_name, kcu.table_name, kcu.table_schema FROM information_schema.table_constraints tc INNER JOIN information_schema.key_column_usage kcu on (kcu.constraint_name = tc.constraint_name and kcu.table_name=tc.table_name and kcu.table_schema=tc.table_schema) WHERE tc.constraint_type='PRIMARY KEY') pkc ON (c.column_name=pkc.column_name AND c.table_schema = pkc.table_schema AND c.table_name=pkc.table_name) WHERE c.table_schema='", schema, "' AND c.table_name='", table, "' ORDER BY c.ordinal_position"); + if (!(Z_TYPE_P(&schema) == IS_UNDEF) && Z_STRLEN_P(&schema)) { + ZEPHIR_CONCAT_SVSVS(return_value, "SELECT DISTINCT c.column_name AS Field, c.data_type AS Type, c.character_maximum_length AS Size, c.numeric_precision AS NumericSize, c.numeric_scale AS NumericScale, c.is_nullable AS Null, CASE WHEN pkc.column_name NOTNULL THEN 'PRI' ELSE '' END AS Key, CASE WHEN c.data_type LIKE '%int%' AND c.column_default LIKE '%nextval%' THEN 'auto_increment' ELSE '' END AS Extra, c.ordinal_position AS Position, c.column_default FROM information_schema.columns c LEFT JOIN ( SELECT kcu.column_name, kcu.table_name, kcu.table_schema FROM information_schema.table_constraints tc INNER JOIN information_schema.key_column_usage kcu on (kcu.constraint_name = tc.constraint_name and kcu.table_name=tc.table_name and kcu.table_schema=tc.table_schema) WHERE tc.constraint_type='PRIMARY KEY') pkc ON (c.column_name=pkc.column_name AND c.table_schema = pkc.table_schema AND c.table_name=pkc.table_name) WHERE c.table_schema='", &schema, "' AND c.table_name='", &table, "' ORDER BY c.ordinal_position"); RETURN_MM(); } - ZEPHIR_CONCAT_SVS(return_value, "SELECT DISTINCT c.column_name AS Field, c.data_type AS Type, c.character_maximum_length AS Size, c.numeric_precision AS NumericSize, c.numeric_scale AS NumericScale, c.is_nullable AS Null, CASE WHEN pkc.column_name NOTNULL THEN 'PRI' ELSE '' END AS Key, CASE WHEN c.data_type LIKE '%int%' AND c.column_default LIKE '%nextval%' THEN 'auto_increment' ELSE '' END AS Extra, c.ordinal_position AS Position, c.column_default FROM information_schema.columns c LEFT JOIN ( SELECT kcu.column_name, kcu.table_name, kcu.table_schema FROM information_schema.table_constraints tc INNER JOIN information_schema.key_column_usage kcu on (kcu.constraint_name = tc.constraint_name and kcu.table_name=tc.table_name and kcu.table_schema=tc.table_schema) WHERE tc.constraint_type='PRIMARY KEY') pkc ON (c.column_name=pkc.column_name AND c.table_schema = pkc.table_schema AND c.table_name=pkc.table_name) WHERE c.table_schema='public' AND c.table_name='", table, "' ORDER BY c.ordinal_position"); + ZEPHIR_CONCAT_SVS(return_value, "SELECT DISTINCT c.column_name AS Field, c.data_type AS Type, c.character_maximum_length AS Size, c.numeric_precision AS NumericSize, c.numeric_scale AS NumericScale, c.is_nullable AS Null, CASE WHEN pkc.column_name NOTNULL THEN 'PRI' ELSE '' END AS Key, CASE WHEN c.data_type LIKE '%int%' AND c.column_default LIKE '%nextval%' THEN 'auto_increment' ELSE '' END AS Extra, c.ordinal_position AS Position, c.column_default FROM information_schema.columns c LEFT JOIN ( SELECT kcu.column_name, kcu.table_name, kcu.table_schema FROM information_schema.table_constraints tc INNER JOIN information_schema.key_column_usage kcu on (kcu.constraint_name = tc.constraint_name and kcu.table_name=tc.table_name and kcu.table_schema=tc.table_schema) WHERE tc.constraint_type='PRIMARY KEY') pkc ON (c.column_name=pkc.column_name AND c.table_schema = pkc.table_schema AND c.table_name=pkc.table_name) WHERE c.table_schema='public' AND c.table_name='", &table, "' ORDER BY c.ordinal_position"); RETURN_MM(); } @@ -1369,24 +1609,27 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeColumns) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, listTables) { zval *schemaName_param = NULL; - zval *schemaName = NULL; + zval schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &schemaName_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_CONCAT_SVS(return_value, "SELECT table_name FROM information_schema.tables WHERE table_schema = '", schemaName, "' ORDER BY table_name"); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_CONCAT_SVS(return_value, "SELECT table_name FROM information_schema.tables WHERE table_schema = '", &schemaName, "' ORDER BY table_name"); RETURN_MM(); } - RETURN_MM_STRING("SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' ORDER BY table_name", 1); + RETURN_MM_STRING("SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' ORDER BY table_name"); } @@ -1398,12 +1641,17 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, listTables) { */ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, listViews) { - zval *schemaName = NULL; + zval *schemaName = NULL, schemaName_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&schemaName_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &schemaName); if (!schemaName) { - schemaName = ZEPHIR_GLOBAL(global_null); + schemaName = &schemaName_sub; + schemaName = &__$null; } @@ -1411,7 +1659,7 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, listViews) { ZEPHIR_CONCAT_SVS(return_value, "SELECT viewname AS view_name FROM pg_views WHERE schemaname = '", schemaName, "' ORDER BY view_name"); return; } - RETURN_STRING("SELECT viewname AS view_name FROM pg_views WHERE schemaname = 'public' ORDER BY view_name", 1); + RETURN_STRING("SELECT viewname AS view_name FROM pg_views WHERE schemaname = 'public' ORDER BY view_name"); } @@ -1421,30 +1669,34 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, listViews) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeIndexes) { zval *table_param = NULL, *schema_param = NULL; - zval *table = NULL, *schema = NULL; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_CONCAT_SVS(return_value, "SELECT 0 as c0, t.relname as table_name, i.relname as key_name, 3 as c3, a.attname as column_name FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND a.attnum = ANY(ix.indkey) AND t.relkind = 'r' AND t.relname = '", table, "' ORDER BY t.relname, i.relname;"); + ZEPHIR_CONCAT_SVS(return_value, "SELECT 0 as c0, t.relname as table_name, i.relname as key_name, 3 as c3, a.attname as column_name FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid = ix.indrelid AND i.oid = ix.indexrelid AND a.attrelid = t.oid AND a.attnum = ANY(ix.indkey) AND t.relkind = 'r' AND t.relname = '", &table, "' ORDER BY t.relname, i.relname;"); RETURN_MM(); } @@ -1454,42 +1706,49 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeIndexes) { */ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeReferences) { - zval *table_param = NULL, *schema_param = NULL, *sql = NULL; - zval *table = NULL, *schema = NULL, *_0$$3, *_1$$4; + zval *table_param = NULL, *schema_param = NULL, sql; + zval table, schema, _0$$3, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&sql); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_INIT_VAR(sql); - ZVAL_STRING(sql, "SELECT DISTINCT tc.table_name as TABLE_NAME, kcu.column_name as COLUMN_NAME, tc.constraint_name as CONSTRAINT_NAME, tc.table_catalog as REFERENCED_TABLE_SCHEMA, ccu.table_name AS REFERENCED_TABLE_NAME, ccu.column_name AS REFERENCED_COLUMN_NAME FROM information_schema.table_constraints AS tc JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name WHERE constraint_type = 'FOREIGN KEY' AND ", 1); - if (!(!schema) && Z_STRLEN_P(schema)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_SVSVS(_0$$3, "tc.table_schema = '", schema, "' AND tc.table_name='", table, "'"); - zephir_concat_self(&sql, _0$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&sql); + ZVAL_STRING(&sql, "SELECT DISTINCT tc.table_name as TABLE_NAME, kcu.column_name as COLUMN_NAME, tc.constraint_name as CONSTRAINT_NAME, tc.table_catalog as REFERENCED_TABLE_SCHEMA, ccu.table_name AS REFERENCED_TABLE_NAME, ccu.column_name AS REFERENCED_COLUMN_NAME FROM information_schema.table_constraints AS tc JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name WHERE constraint_type = 'FOREIGN KEY' AND "); + if (!(Z_TYPE_P(&schema) == IS_UNDEF) && Z_STRLEN_P(&schema)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_SVSVS(&_0$$3, "tc.table_schema = '", &schema, "' AND tc.table_name='", &table, "'"); + zephir_concat_self(&sql, &_0$$3 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_SVS(_1$$4, "tc.table_schema = 'public' AND tc.table_name='", table, "'"); - zephir_concat_self(&sql, _1$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_SVS(&_1$$4, "tc.table_schema = 'public' AND tc.table_name='", &table, "'"); + zephir_concat_self(&sql, &_1$$4 TSRMLS_CC); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -1499,39 +1758,55 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, describeReferences) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, tableOptions) { zval *table_param = NULL, *schema_param = NULL; - zval *table = NULL, *schema = NULL; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - RETURN_MM_STRING("", 1); + RETURN_MM_STRING(""); } PHP_METHOD(Phalcon_Db_Dialect_Postgresql, _castDefault) { - zval *_6$$5 = NULL; + zval _6$$5; zend_bool _2, _3, _4, _5; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *column, *defaultValue = NULL, *preparedValue = NULL, *columnDefinition = NULL, *columnType = NULL, *_0, *_1, _7$$6, *_8$$6 = NULL; + zval *column, column_sub, defaultValue, preparedValue, columnDefinition, columnType, _0, _1, _7$$6, _8$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&preparedValue); + ZVAL_UNDEF(&columnDefinition); + ZVAL_UNDEF(&columnType); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_6$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &column); @@ -1544,58 +1819,62 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, _castDefault) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&columnType, column, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtoupper(_0, columnDefinition); - if (zephir_memnstr_str(_0, SL("BOOLEAN"), "phalcon/db/dialect/postgresql.zep", 656)) { - RETURN_CCTOR(defaultValue); + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtoupper(&_0, &columnDefinition); + if (zephir_memnstr_str(&_0, SL("BOOLEAN"), "phalcon/db/dialect/postgresql.zep", 656)) { + RETURN_CCTOR(&defaultValue); } - ZEPHIR_INIT_VAR(_1); - zephir_fast_strtoupper(_1, defaultValue); - if (zephir_memnstr_str(_1, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/postgresql.zep", 660)) { - RETURN_MM_STRING("CURRENT_TIMESTAMP", 1); + ZEPHIR_INIT_VAR(&_1); + zephir_fast_strtoupper(&_1, &defaultValue); + if (zephir_memnstr_str(&_1, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/postgresql.zep", 660)) { + RETURN_MM_STRING("CURRENT_TIMESTAMP"); } - _2 = ZEPHIR_IS_LONG_IDENTICAL(columnType, 0); + _2 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 0); if (!(_2)) { - _2 = ZEPHIR_IS_LONG_IDENTICAL(columnType, 14); + _2 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 14); } _3 = _2; if (!(_3)) { - _3 = ZEPHIR_IS_LONG_IDENTICAL(columnType, 3); + _3 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 3); } _4 = _3; if (!(_4)) { - _4 = ZEPHIR_IS_LONG_IDENTICAL(columnType, 7); + _4 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 7); } _5 = _4; if (!(_5)) { - _5 = ZEPHIR_IS_LONG_IDENTICAL(columnType, 9); + _5 = ZEPHIR_IS_LONG_IDENTICAL(&columnType, 9); } - ZEPHIR_INIT_VAR(preparedValue); + ZEPHIR_INIT_VAR(&preparedValue); if (_5) { - zephir_get_strval(_6$$5, defaultValue); - ZEPHIR_CPY_WRT(preparedValue, _6$$5); + zephir_get_strval(&_6$$5, &defaultValue); + ZEPHIR_CPY_WRT(&preparedValue, &_6$$5); } else { - ZEPHIR_SINIT_VAR(_7$$6); - ZVAL_STRING(&_7$$6, "\\'", 0); - ZEPHIR_CALL_FUNCTION(&_8$$6, "addcslashes", NULL, 169, defaultValue, &_7$$6); + ZEPHIR_INIT_VAR(&_7$$6); + ZVAL_STRING(&_7$$6, "\\'"); + ZEPHIR_CALL_FUNCTION(&_8$$6, "addcslashes", NULL, 149, &defaultValue, &_7$$6); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(preparedValue, "'", _8$$6, "'"); + ZEPHIR_CONCAT_SVS(&preparedValue, "'", &_8$$6, "'"); } - RETURN_CCTOR(preparedValue); + RETURN_CCTOR(&preparedValue); } PHP_METHOD(Phalcon_Db_Dialect_Postgresql, _getTableOptions) { zval *definition_param = NULL; - zval *definition = NULL; + zval definition; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &definition_param); + ZVAL_UNDEF(&definition); - definition = definition_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &definition_param); + + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - RETURN_STRING("", 1); + RETURN_MM_STRING(""); } @@ -1606,24 +1885,27 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, _getTableOptions) { PHP_METHOD(Phalcon_Db_Dialect_Postgresql, sharedLock) { zval *sqlQuery_param = NULL; - zval *sqlQuery = NULL; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlQuery_param); if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) { - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); } else { - ZEPHIR_INIT_VAR(sqlQuery); - ZVAL_EMPTY_STRING(sqlQuery); + ZEPHIR_INIT_VAR(&sqlQuery); + ZVAL_EMPTY_STRING(&sqlQuery); } - RETURN_CTOR(sqlQuery); + RETURN_CTOR(&sqlQuery); } diff --git a/ext/phalcon/db/dialect/postgresql.zep.h b/ext/phalcon/db/dialect/postgresql.zep.h index fe47a92cd11..7498d66c0c0 100644 --- a/ext/phalcon/db/dialect/postgresql.zep.h +++ b/ext/phalcon/db/dialect/postgresql.zep.h @@ -30,141 +30,429 @@ PHP_METHOD(Phalcon_Db_Dialect_Postgresql, _castDefault); PHP_METHOD(Phalcon_Db_Dialect_Postgresql, _getTableOptions); PHP_METHOD(Phalcon_Db_Dialect_Postgresql, sharedLock); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_getcolumndefinition, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_getcolumndefinition, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_getcolumndefinition, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addcolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addcolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_modifycolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_modifycolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_modifycolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_ARG_OBJ_INFO(0, currentColumn, Phalcon\\Db\\ColumnInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropcolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropcolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, columnName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, columnName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addindex, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addindex, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropindex, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropindex, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, indexName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, indexName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addprimarykey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addprimarykey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addprimarykey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropprimarykey, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropprimarykey, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropprimarykey, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addforeignkey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_addforeignkey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, reference, Phalcon\\Db\\ReferenceInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropforeignkey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropforeignkey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_createtable, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_truncatetable, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_truncatetable, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_truncatetable, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_droptable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_droptable, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_droptable, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_createview, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_createview, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_createview, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropview, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropview, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_dropview, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_tableexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_tableexists, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_tableexists, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_viewexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_viewexists, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_viewexists, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_describecolumns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_describecolumns, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_describecolumns, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_listtables, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_listtables, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_listtables, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_listviews, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_listviews, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_listviews, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, schemaName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_describeindexes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_describeindexes, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_describeindexes, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_describereferences, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_describereferences, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_describereferences, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_tableoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_tableoptions, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_tableoptions, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql__castdefault, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql__castdefault, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql__castdefault, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql__gettableoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql__gettableoptions, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql__gettableoptions, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_postgresql_sharedlock, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_sharedlock, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_postgresql_sharedlock, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_dialect_postgresql_method_entry) { diff --git a/ext/phalcon/db/dialect/sqlite.zep.c b/ext/phalcon/db/dialect/sqlite.zep.c index 4d484fe5417..d54f4d183e7 100644 --- a/ext/phalcon/db/dialect/sqlite.zep.c +++ b/ext/phalcon/db/dialect/sqlite.zep.c @@ -42,205 +42,231 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Dialect_Sqlite) { */ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) { - HashTable *_13$$41; - HashPosition _12$$41; - zephir_fcall_cache_entry *_17 = NULL; + zephir_fcall_cache_entry *_15 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *column, *columnSql = NULL, *type = NULL, *typeValues = NULL, *_0$$8 = NULL, *_1$$8, *_2$$10 = NULL, *_3$$10 = NULL, *_4$$10, *_5$$16 = NULL, *_6$$16, *_7$$24 = NULL, *_8$$27 = NULL, *_9$$39, *_10$$39 = NULL, *_11$$39, *value$$41 = NULL, *valueSql$$41 = NULL, **_14$$41, _19$$41, _20$$41, *_21$$41, *_22$$41, _15$$42 = zval_used_for_init, *_16$$42 = NULL, *_18$$42 = NULL, _23$$43, *_24$$43 = NULL, *_25$$43; + zval *column, column_sub, columnSql, type, typeValues, _0$$8, _1$$8, _2$$10, _3$$10, _4$$10, _5$$16, _6$$16, _7$$24, _8$$27, _9$$39, _10$$39, _11$$39, value$$41, valueSql$$41, *_12$$41, _17$$41, _18$$41, _19$$41, _20$$41, _13$$42, _14$$42, _16$$42, _21$$43, _22$$43, _23$$43; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&columnSql); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&typeValues); + ZVAL_UNDEF(&_0$$8); + ZVAL_UNDEF(&_1$$8); + ZVAL_UNDEF(&_2$$10); + ZVAL_UNDEF(&_3$$10); + ZVAL_UNDEF(&_4$$10); + ZVAL_UNDEF(&_5$$16); + ZVAL_UNDEF(&_6$$16); + ZVAL_UNDEF(&_7$$24); + ZVAL_UNDEF(&_8$$27); + ZVAL_UNDEF(&_9$$39); + ZVAL_UNDEF(&_10$$39); + ZVAL_UNDEF(&_11$$39); + ZVAL_UNDEF(&value$$41); + ZVAL_UNDEF(&valueSql$$41); + ZVAL_UNDEF(&_17$$41); + ZVAL_UNDEF(&_18$$41); + ZVAL_UNDEF(&_19$$41); + ZVAL_UNDEF(&_20$$41); + ZVAL_UNDEF(&_13$$42); + ZVAL_UNDEF(&_14$$42); + ZVAL_UNDEF(&_16$$42); + ZVAL_UNDEF(&_21$$43); + ZVAL_UNDEF(&_22$$43); + ZVAL_UNDEF(&_23$$43); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &column); - ZEPHIR_INIT_VAR(columnSql); - ZVAL_STRING(columnSql, "", 1); + ZEPHIR_INIT_VAR(&columnSql); + ZVAL_STRING(&columnSql, ""); ZEPHIR_CALL_METHOD(&type, column, "gettype", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(type) == IS_STRING) { - zephir_concat_self(&columnSql, type TSRMLS_CC); + if (Z_TYPE_P(&type) == IS_STRING) { + zephir_concat_self(&columnSql, &type TSRMLS_CC); ZEPHIR_CALL_METHOD(&type, column, "gettypereference", NULL, 0); zephir_check_call_status(); } do { - if (ZEPHIR_IS_LONG(type, 0)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 0)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("INTEGER") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 1)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 1)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DATE") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 2)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 2)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("VARCHAR") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_0$$8, column, "getsize", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1$$8); - ZEPHIR_CONCAT_SVS(_1$$8, "(", _0$$8, ")"); - zephir_concat_self(&columnSql, _1$$8 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$8); + ZEPHIR_CONCAT_SVS(&_1$$8, "(", &_0$$8, ")"); + zephir_concat_self(&columnSql, &_1$$8 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 3)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 3)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("NUMERIC") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_2$$10, column, "getsize", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_3$$10, column, "getscale", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4$$10); - ZEPHIR_CONCAT_SVSVS(_4$$10, "(", _2$$10, ",", _3$$10, ")"); - zephir_concat_self(&columnSql, _4$$10 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$10); + ZEPHIR_CONCAT_SVSVS(&_4$$10, "(", &_2$$10, ",", &_3$$10, ")"); + zephir_concat_self(&columnSql, &_4$$10 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 4)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 4)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DATETIME") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 17)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 17)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TIMESTAMP") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 5)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 5)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("CHARACTER") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_5$$16, column, "getsize", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_6$$16); - ZEPHIR_CONCAT_SVS(_6$$16, "(", _5$$16, ")"); - zephir_concat_self(&columnSql, _6$$16 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$16); + ZEPHIR_CONCAT_SVS(&_6$$16, "(", &_5$$16, ")"); + zephir_concat_self(&columnSql, &_6$$16 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 6)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 6)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TEXT") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 8)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 8)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TINYINT") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 7)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 7)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("FLOAT") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 9)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 9)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("DOUBLE") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_7$$24, column, "isunsigned", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_7$$24)) { + if (zephir_is_true(&_7$$24)) { zephir_concat_self_str(&columnSql, SL(" UNSIGNED") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 14)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 14)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("BIGINT") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_8$$27, column, "isunsigned", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_8$$27)) { + if (zephir_is_true(&_8$$27)) { zephir_concat_self_str(&columnSql, SL(" UNSIGNED") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 10)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 10)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("TINYBLOB") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 11)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 11)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("BLOB") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 12)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 12)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("MEDIUMBLOB") TSRMLS_CC); } break; } - if (ZEPHIR_IS_LONG(type, 13)) { - if (ZEPHIR_IS_EMPTY(columnSql)) { + if (ZEPHIR_IS_LONG(&type, 13)) { + if (ZEPHIR_IS_EMPTY(&columnSql)) { zephir_concat_self_str(&columnSql, SL("LONGBLOB") TSRMLS_CC); } break; } - if (ZEPHIR_IS_EMPTY(columnSql)) { - ZEPHIR_INIT_VAR(_9$$39); - object_init_ex(_9$$39, phalcon_db_exception_ce); + if (ZEPHIR_IS_EMPTY(&columnSql)) { + ZEPHIR_INIT_VAR(&_9$$39); + object_init_ex(&_9$$39, phalcon_db_exception_ce); ZEPHIR_CALL_METHOD(&_10$$39, column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_11$$39); - ZEPHIR_CONCAT_SV(_11$$39, "Unrecognized SQLite data type at column ", _10$$39); - ZEPHIR_CALL_METHOD(NULL, _9$$39, "__construct", NULL, 9, _11$$39); + ZEPHIR_INIT_VAR(&_11$$39); + ZEPHIR_CONCAT_SV(&_11$$39, "Unrecognized SQLite data type at column ", &_10$$39); + ZEPHIR_CALL_METHOD(NULL, &_9$$39, "__construct", NULL, 4, &_11$$39); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$39, "phalcon/db/dialect/sqlite.zep", 169 TSRMLS_CC); + zephir_throw_exception_debug(&_9$$39, "phalcon/db/dialect/sqlite.zep", 169 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } ZEPHIR_CALL_METHOD(&typeValues, column, "gettypevalues", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(typeValues))) { - if (Z_TYPE_P(typeValues) == IS_ARRAY) { - ZEPHIR_INIT_VAR(valueSql$$41); - ZVAL_STRING(valueSql$$41, "", 1); - zephir_is_iterable(typeValues, &_13$$41, &_12$$41, 0, 0, "phalcon/db/dialect/sqlite.zep", 180); - for ( - ; zend_hash_get_current_data_ex(_13$$41, (void**) &_14$$41, &_12$$41) == SUCCESS - ; zend_hash_move_forward_ex(_13$$41, &_12$$41) - ) { - ZEPHIR_GET_HVALUE(value$$41, _14$$41); - ZEPHIR_SINIT_NVAR(_15$$42); - ZVAL_STRING(&_15$$42, "\"", 0); - ZEPHIR_CALL_FUNCTION(&_16$$42, "addcslashes", &_17, 169, value$$41, &_15$$42); + if (!(ZEPHIR_IS_EMPTY(&typeValues))) { + if (Z_TYPE_P(&typeValues) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&valueSql$$41); + ZVAL_STRING(&valueSql$$41, ""); + zephir_is_iterable(&typeValues, 0, "phalcon/db/dialect/sqlite.zep", 180); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&typeValues), _12$$41) + { + ZEPHIR_INIT_NVAR(&value$$41); + ZVAL_COPY(&value$$41, _12$$41); + ZEPHIR_INIT_NVAR(&_13$$42); + ZVAL_STRING(&_13$$42, "\""); + ZEPHIR_CALL_FUNCTION(&_14$$42, "addcslashes", &_15, 149, &value$$41, &_13$$42); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_18$$42); - ZEPHIR_CONCAT_SVS(_18$$42, "\"", _16$$42, "\", "); - zephir_concat_self(&valueSql$$41, _18$$42 TSRMLS_CC); - } - ZEPHIR_SINIT_VAR(_19$$41); - ZVAL_LONG(&_19$$41, 0); - ZEPHIR_SINIT_VAR(_20$$41); - ZVAL_LONG(&_20$$41, -2); - ZEPHIR_INIT_VAR(_21$$41); - zephir_substr(_21$$41, valueSql$$41, 0 , -2 , 0); - ZEPHIR_INIT_VAR(_22$$41); - ZEPHIR_CONCAT_SVS(_22$$41, "(", _21$$41, ")"); - zephir_concat_self(&columnSql, _22$$41 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_16$$42); + ZEPHIR_CONCAT_SVS(&_16$$42, "\"", &_14$$42, "\", "); + zephir_concat_self(&valueSql$$41, &_16$$42 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value$$41); + ZVAL_LONG(&_17$$41, 0); + ZVAL_LONG(&_18$$41, -2); + ZEPHIR_INIT_VAR(&_19$$41); + zephir_substr(&_19$$41, &valueSql$$41, 0 , -2 , 0); + ZEPHIR_INIT_VAR(&_20$$41); + ZEPHIR_CONCAT_SVS(&_20$$41, "(", &_19$$41, ")"); + zephir_concat_self(&columnSql, &_20$$41 TSRMLS_CC); } else { - ZEPHIR_SINIT_VAR(_23$$43); - ZVAL_STRING(&_23$$43, "\"", 0); - ZEPHIR_CALL_FUNCTION(&_24$$43, "addcslashes", &_17, 169, typeValues, &_23$$43); + ZEPHIR_INIT_VAR(&_21$$43); + ZVAL_STRING(&_21$$43, "\""); + ZEPHIR_CALL_FUNCTION(&_22$$43, "addcslashes", &_15, 149, &typeValues, &_21$$43); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_25$$43); - ZEPHIR_CONCAT_SVS(_25$$43, "(\"", _24$$43, "\")"); - zephir_concat_self(&columnSql, _25$$43 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_23$$43); + ZEPHIR_CONCAT_SVS(&_23$$43, "(\"", &_22$$43, "\")"); + zephir_concat_self(&columnSql, &_23$$43 TSRMLS_CC); } } } while(0); - RETURN_CCTOR(columnSql); + RETURN_CCTOR(&columnSql); } @@ -250,75 +276,93 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, getColumnDefinition) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addColumn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *column, *sql = NULL, *defaultValue = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_3, *_4 = NULL, *_9 = NULL, *_10 = NULL, *_5$$3, _6$$5, *_7$$5 = NULL, *_8$$5; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, sql, defaultValue, _0, _1, _2, _3, _4, _9, _10, _5$$3, _6$$5, _7$$5, _8$$5; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &column); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SVS(sql, "ALTER TABLE ", _0, " ADD COLUMN "); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SVS(&sql, "ALTER TABLE ", &_0, " ADD COLUMN "); ZEPHIR_CALL_METHOD(&_1, column, "getname", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2, this_ptr, "getcolumndefinition", NULL, 0, column); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SVSV(_3, "\"", _1, "\" ", _2); - zephir_concat_self(&sql, _3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SVSV(&_3, "\"", &_1, "\" ", &_2); + zephir_concat_self(&sql, &_3 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_4, column, "hasdefault", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_4)) { + if (zephir_is_true(&_4)) { ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_5$$3); - zephir_fast_strtoupper(_5$$3, defaultValue); - if (zephir_memnstr_str(_5$$3, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/sqlite.zep", 203)) { + ZEPHIR_INIT_VAR(&_5$$3); + zephir_fast_strtoupper(&_5$$3, &defaultValue); + if (zephir_memnstr_str(&_5$$3, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/sqlite.zep", 203)) { zephir_concat_self_str(&sql, SL(" DEFAULT CURRENT_TIMESTAMP") TSRMLS_CC); } else { - ZEPHIR_SINIT_VAR(_6$$5); - ZVAL_STRING(&_6$$5, "\"", 0); - ZEPHIR_CALL_FUNCTION(&_7$$5, "addcslashes", NULL, 169, defaultValue, &_6$$5); + ZEPHIR_INIT_VAR(&_6$$5); + ZVAL_STRING(&_6$$5, "\""); + ZEPHIR_CALL_FUNCTION(&_7$$5, "addcslashes", NULL, 149, &defaultValue, &_6$$5); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_8$$5); - ZEPHIR_CONCAT_SVS(_8$$5, " DEFAULT \"", _7$$5, "\""); - zephir_concat_self(&sql, _8$$5 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_8$$5); + ZEPHIR_CONCAT_SVS(&_8$$5, " DEFAULT \"", &_7$$5, "\""); + zephir_concat_self(&sql, &_8$$5 TSRMLS_CC); } } ZEPHIR_CALL_METHOD(&_9, column, "isnotnull", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_9)) { + if (zephir_is_true(&_9)) { zephir_concat_self_str(&sql, SL(" NOT NULL") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_10, column, "isautoincrement", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_10)) { + if (zephir_is_true(&_10)) { zephir_concat_self_str(&sql, SL(" PRIMARY KEY AUTOINCREMENT") TSRMLS_CC); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -327,34 +371,42 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addColumn) { */ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, modifyColumn) { - zval *tableName_param = NULL, *schemaName_param = NULL, *column, *currentColumn = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *column, column_sub, *currentColumn = NULL, currentColumn_sub, __$null; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&column_sub); + ZVAL_UNDEF(¤tColumn_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &tableName_param, &schemaName_param, &column, ¤tColumn); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (!currentColumn) { - currentColumn = ZEPHIR_GLOBAL(global_null); + currentColumn = ¤tColumn_sub; + currentColumn = &__$null; } @@ -369,40 +421,45 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, modifyColumn) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropColumn) { zval *tableName_param = NULL, *schemaName_param = NULL, *columnName_param = NULL; - zval *tableName = NULL, *schemaName = NULL, *columnName = NULL; + zval tableName, schemaName, columnName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&columnName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &columnName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(columnName_param) != IS_STRING && Z_TYPE_P(columnName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'columnName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'columnName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(columnName_param) == IS_STRING)) { - zephir_get_strval(columnName, columnName_param); + zephir_get_strval(&columnName, columnName_param); } else { - ZEPHIR_INIT_VAR(columnName); - ZVAL_EMPTY_STRING(columnName); + ZEPHIR_INIT_VAR(&columnName); + ZVAL_EMPTY_STRING(&columnName); } @@ -417,63 +474,77 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropColumn) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addIndex) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tableName_param = NULL, *schemaName_param = NULL, *index, *sql = NULL, *indexType = NULL, *_4 = NULL, *_5 = NULL, *_6, *_0$$5 = NULL, *_1$$5, *_2$$6 = NULL, *_3$$6; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub, sql, indexType, _4, _5, _6, _0$$5, _1$$5, _2$$6, _3$$6; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&indexType); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } ZEPHIR_CALL_METHOD(&indexType, index, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); - if (!(ZEPHIR_IS_EMPTY(indexType))) { - ZEPHIR_CONCAT_SVS(sql, "CREATE ", indexType, " INDEX \""); + ZEPHIR_INIT_VAR(&sql); + if (!(ZEPHIR_IS_EMPTY(&indexType))) { + ZEPHIR_CONCAT_SVS(&sql, "CREATE ", &indexType, " INDEX \""); } else { - ZVAL_STRING(sql, "CREATE INDEX \"", 1); + ZVAL_STRING(&sql, "CREATE INDEX \""); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { ZEPHIR_CALL_METHOD(&_0$$5, index, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1$$5); - ZEPHIR_CONCAT_VSVSVS(_1$$5, schemaName, "\".\"", _0$$5, "\" ON \"", tableName, "\" ("); - zephir_concat_self(&sql, _1$$5 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$5); + ZEPHIR_CONCAT_VSVSVS(&_1$$5, &schemaName, "\".\"", &_0$$5, "\" ON \"", &tableName, "\" ("); + zephir_concat_self(&sql, &_1$$5 TSRMLS_CC); } else { ZEPHIR_CALL_METHOD(&_2$$6, index, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3$$6); - ZEPHIR_CONCAT_VSVS(_3$$6, _2$$6, "\" ON \"", tableName, "\" ("); - zephir_concat_self(&sql, _3$$6 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$6); + ZEPHIR_CONCAT_VSVS(&_3$$6, &_2$$6, "\" ON \"", &tableName, "\" ("); + zephir_concat_self(&sql, &_3$$6 TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_5, index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 57, _5); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "getcolumnlist", NULL, 50, &_5); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_6); - ZEPHIR_CONCAT_VS(_6, _4, ")"); - zephir_concat_self(&sql, _6 TSRMLS_CC); - RETURN_CCTOR(sql); + ZEPHIR_INIT_VAR(&_6); + ZEPHIR_CONCAT_VS(&_6, &_4, ")"); + zephir_concat_self(&sql, &_6 TSRMLS_CC); + RETURN_CCTOR(&sql); } @@ -483,48 +554,53 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addIndex) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropIndex) { zval *tableName_param = NULL, *schemaName_param = NULL, *indexName_param = NULL; - zval *tableName = NULL, *schemaName = NULL, *indexName = NULL; + zval tableName, schemaName, indexName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&indexName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &indexName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(indexName_param) != IS_STRING && Z_TYPE_P(indexName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'indexName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'indexName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(indexName_param) == IS_STRING)) { - zephir_get_strval(indexName, indexName_param); + zephir_get_strval(&indexName, indexName_param); } else { - ZEPHIR_INIT_VAR(indexName); - ZVAL_EMPTY_STRING(indexName); + ZEPHIR_INIT_VAR(&indexName); + ZVAL_EMPTY_STRING(&indexName); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_CONCAT_SVSVS(return_value, "DROP INDEX \"", schemaName, "\".\"", indexName, "\""); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_CONCAT_SVSVS(return_value, "DROP INDEX \"", &schemaName, "\".\"", &indexName, "\""); RETURN_MM(); } - ZEPHIR_CONCAT_SVS(return_value, "DROP INDEX \"", indexName, "\""); + ZEPHIR_CONCAT_SVS(return_value, "DROP INDEX \"", &indexName, "\""); RETURN_MM(); } @@ -534,31 +610,36 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropIndex) { */ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addPrimaryKey) { - zval *tableName_param = NULL, *schemaName_param = NULL, *index; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *index, index_sub; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&index_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &index); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } @@ -573,30 +654,34 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addPrimaryKey) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropPrimaryKey) { zval *tableName_param = NULL, *schemaName_param = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } @@ -610,31 +695,36 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropPrimaryKey) { */ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addForeignKey) { - zval *tableName_param = NULL, *schemaName_param = NULL, *reference; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *reference, reference_sub; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&reference_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &reference); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } @@ -649,40 +739,45 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, addForeignKey) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropForeignKey) { zval *tableName_param = NULL, *schemaName_param = NULL, *referenceName_param = NULL; - zval *tableName = NULL, *schemaName = NULL, *referenceName = NULL; + zval tableName, schemaName, referenceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&referenceName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &referenceName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } if (UNEXPECTED(Z_TYPE_P(referenceName_param) != IS_STRING && Z_TYPE_P(referenceName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referenceName_param) == IS_STRING)) { - zephir_get_strval(referenceName, referenceName_param); + zephir_get_strval(&referenceName, referenceName_param); } else { - ZEPHIR_INIT_VAR(referenceName); - ZVAL_EMPTY_STRING(referenceName); + ZEPHIR_INIT_VAR(&referenceName); + ZVAL_EMPTY_STRING(&referenceName); } @@ -696,207 +791,255 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropForeignKey) { */ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) { - HashTable *_1, *_18$$14, *_31$$18; - HashPosition _0, _17$$14, _30$$18; - zend_bool hasPrimary = 0, _7$$7, _9$$7, _20$$15, _21$$15; - zephir_fcall_cache_entry *_5 = NULL, *_14 = NULL, *_25 = NULL; + zend_bool hasPrimary = 0, _5$$7, _7$$7, _16$$15, _17$$15; + zephir_fcall_cache_entry *_3 = NULL, *_12 = NULL, *_21 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, *columns = NULL, *table = NULL, *temporary = NULL, *options = NULL, *createLines = NULL, *columnLine = NULL, *column = NULL, *indexes = NULL, *index = NULL, *indexName = NULL, *indexType = NULL, *references = NULL, *reference = NULL, *defaultValue = NULL, *referenceSql = NULL, *onDelete = NULL, *onUpdate = NULL, *sql = NULL, **_2, *_41, *_42, *_3$$7 = NULL, *_4$$7 = NULL, *_6$$7 = NULL, *_8$$7 = NULL, *_10$$7 = NULL, *_16$$7 = NULL, *_11$$10 = NULL, _12$$12 = zval_used_for_init, *_13$$12 = NULL, *_15$$12 = NULL, **_19$$14, *_22$$15 = NULL, *_23$$16 = NULL, *_24$$16 = NULL, *_26$$16 = NULL, *_27$$17 = NULL, *_28$$17 = NULL, *_29$$17 = NULL, **_32$$18, *_33$$19 = NULL, *_34$$19 = NULL, *_35$$19 = NULL, *_36$$19 = NULL, *_37$$19 = NULL, *_38$$19 = NULL, *_39$$20 = NULL, *_40$$21 = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval definition; + zval *tableName_param = NULL, *schemaName_param = NULL, *definition_param = NULL, columns, table, temporary, options, createLines, columnLine, column, indexes, index, indexName, indexType, references, reference, defaultValue, referenceSql, onDelete, onUpdate, sql, *_0, _35, _36, _1$$7, _2$$7, _4$$7, _6$$7, _8$$7, _14$$7, _9$$10, _10$$12, _11$$12, _13$$12, *_15$$14, _18$$15, _19$$16, _20$$16, _22$$16, _23$$17, _24$$17, _25$$17, *_26$$18, _27$$19, _28$$19, _29$$19, _30$$19, _31$$19, _32$$19, _33$$20, _34$$21; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&temporary); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&createLines); + ZVAL_UNDEF(&columnLine); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&indexes); + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&indexName); + ZVAL_UNDEF(&indexType); + ZVAL_UNDEF(&references); + ZVAL_UNDEF(&reference); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&referenceSql); + ZVAL_UNDEF(&onDelete); + ZVAL_UNDEF(&onUpdate); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&_35); + ZVAL_UNDEF(&_36); + ZVAL_UNDEF(&_1$$7); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_14$$7); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_10$$12); + ZVAL_UNDEF(&_11$$12); + ZVAL_UNDEF(&_13$$12); + ZVAL_UNDEF(&_18$$15); + ZVAL_UNDEF(&_19$$16); + ZVAL_UNDEF(&_20$$16); + ZVAL_UNDEF(&_22$$16); + ZVAL_UNDEF(&_23$$17); + ZVAL_UNDEF(&_24$$17); + ZVAL_UNDEF(&_25$$17); + ZVAL_UNDEF(&_27$$19); + ZVAL_UNDEF(&_28$$19); + ZVAL_UNDEF(&_29$$19); + ZVAL_UNDEF(&_30$$19); + ZVAL_UNDEF(&_31$$19); + ZVAL_UNDEF(&_32$$19); + ZVAL_UNDEF(&_33$$20); + ZVAL_UNDEF(&_34$$21); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &tableName_param, &schemaName_param, &definition_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(temporary); - ZVAL_BOOL(temporary, 0); - ZEPHIR_OBS_VAR(options); - if (zephir_array_isset_string_fetch(&options, definition, SS("options"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_NVAR(temporary); - zephir_array_isset_string_fetch(&temporary, options, SS("temporary"), 0 TSRMLS_CC); - } - ZEPHIR_OBS_VAR(columns); - if (!(zephir_array_isset_string_fetch(&columns, definition, SS("columns"), 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&temporary); + ZVAL_BOOL(&temporary, 0); + ZEPHIR_OBS_VAR(&options); + if (zephir_array_isset_string_fetch(&options, &definition, SL("options"), 0)) { + ZEPHIR_OBS_NVAR(&temporary); + zephir_array_isset_string_fetch(&temporary, &options, SL("temporary"), 0); + } + ZEPHIR_OBS_VAR(&columns); + if (!(zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'columns' is required in the definition array", "phalcon/db/dialect/sqlite.zep", 322); return; } - ZEPHIR_INIT_VAR(sql); - if (zephir_is_true(temporary)) { - ZEPHIR_CONCAT_SVS(sql, "CREATE TEMPORARY TABLE ", table, " (\n\t"); + ZEPHIR_INIT_VAR(&sql); + if (zephir_is_true(&temporary)) { + ZEPHIR_CONCAT_SVS(&sql, "CREATE TEMPORARY TABLE ", &table, " (\n\t"); } else { - ZEPHIR_CONCAT_SVS(sql, "CREATE TABLE ", table, " (\n\t"); + ZEPHIR_CONCAT_SVS(&sql, "CREATE TABLE ", &table, " (\n\t"); } hasPrimary = 0; - ZEPHIR_INIT_VAR(createLines); - array_init(createLines); - zephir_is_iterable(columns, &_1, &_0, 0, 0, "phalcon/db/dialect/sqlite.zep", 380); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(column, _2); - ZEPHIR_CALL_METHOD(&_3$$7, column, "getname", NULL, 0); + ZEPHIR_INIT_VAR(&createLines); + array_init(&createLines); + zephir_is_iterable(&columns, 0, "phalcon/db/dialect/sqlite.zep", 380); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _0) + { + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _0); + ZEPHIR_CALL_METHOD(&_1$$7, &column, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$7, this_ptr, "getcolumndefinition", &_5, 0, column); + ZEPHIR_CALL_METHOD(&_2$$7, this_ptr, "getcolumndefinition", &_3, 0, &column); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(columnLine); - ZEPHIR_CONCAT_SVSV(columnLine, "`", _3$$7, "` ", _4$$7); - ZEPHIR_CALL_METHOD(&_6$$7, column, "isprimary", NULL, 0); + ZEPHIR_INIT_NVAR(&columnLine); + ZEPHIR_CONCAT_SVSV(&columnLine, "`", &_1$$7, "` ", &_2$$7); + ZEPHIR_CALL_METHOD(&_4$$7, &column, "isprimary", NULL, 0); zephir_check_call_status(); - _7$$7 = zephir_is_true(_6$$7); - if (_7$$7) { - _7$$7 = !hasPrimary; + _5$$7 = zephir_is_true(&_4$$7); + if (_5$$7) { + _5$$7 = !hasPrimary; } - if (_7$$7) { + if (_5$$7) { zephir_concat_self_str(&columnLine, SL(" PRIMARY KEY") TSRMLS_CC); hasPrimary = 1; } - ZEPHIR_CALL_METHOD(&_8$$7, column, "isautoincrement", NULL, 0); + ZEPHIR_CALL_METHOD(&_6$$7, &column, "isautoincrement", NULL, 0); zephir_check_call_status(); - _9$$7 = zephir_is_true(_8$$7); - if (_9$$7) { - _9$$7 = hasPrimary; + _7$$7 = zephir_is_true(&_6$$7); + if (_7$$7) { + _7$$7 = hasPrimary; } - if (_9$$7) { + if (_7$$7) { zephir_concat_self_str(&columnLine, SL(" AUTOINCREMENT") TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&_10$$7, column, "hasdefault", NULL, 0); + ZEPHIR_CALL_METHOD(&_8$$7, &column, "hasdefault", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_10$$7)) { - ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0); + if (zephir_is_true(&_8$$7)) { + ZEPHIR_CALL_METHOD(&defaultValue, &column, "getdefault", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_11$$10); - zephir_fast_strtoupper(_11$$10, defaultValue); - if (zephir_memnstr_str(_11$$10, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/sqlite.zep", 360)) { + ZEPHIR_INIT_NVAR(&_9$$10); + zephir_fast_strtoupper(&_9$$10, &defaultValue); + if (zephir_memnstr_str(&_9$$10, SL("CURRENT_TIMESTAMP"), "phalcon/db/dialect/sqlite.zep", 360)) { zephir_concat_self_str(&columnLine, SL(" DEFAULT CURRENT_TIMESTAMP") TSRMLS_CC); } else { - ZEPHIR_SINIT_NVAR(_12$$12); - ZVAL_STRING(&_12$$12, "\"", 0); - ZEPHIR_CALL_FUNCTION(&_13$$12, "addcslashes", &_14, 169, defaultValue, &_12$$12); + ZEPHIR_INIT_NVAR(&_10$$12); + ZVAL_STRING(&_10$$12, "\""); + ZEPHIR_CALL_FUNCTION(&_11$$12, "addcslashes", &_12, 149, &defaultValue, &_10$$12); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_15$$12); - ZEPHIR_CONCAT_SVS(_15$$12, " DEFAULT \"", _13$$12, "\""); - zephir_concat_self(&columnLine, _15$$12 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_13$$12); + ZEPHIR_CONCAT_SVS(&_13$$12, " DEFAULT \"", &_11$$12, "\""); + zephir_concat_self(&columnLine, &_13$$12 TSRMLS_CC); } } - ZEPHIR_CALL_METHOD(&_16$$7, column, "isnotnull", NULL, 0); + ZEPHIR_CALL_METHOD(&_14$$7, &column, "isnotnull", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_16$$7)) { + if (zephir_is_true(&_14$$7)) { zephir_concat_self_str(&columnLine, SL(" NOT NULL") TSRMLS_CC); } - zephir_array_append(&createLines, columnLine, PH_SEPARATE, "phalcon/db/dialect/sqlite.zep", 374); - } - ZEPHIR_OBS_VAR(indexes); - if (zephir_array_isset_string_fetch(&indexes, definition, SS("indexes"), 0 TSRMLS_CC)) { - zephir_is_iterable(indexes, &_18$$14, &_17$$14, 0, 0, "phalcon/db/dialect/sqlite.zep", 396); - for ( - ; zend_hash_get_current_data_ex(_18$$14, (void**) &_19$$14, &_17$$14) == SUCCESS - ; zend_hash_move_forward_ex(_18$$14, &_17$$14) - ) { - ZEPHIR_GET_HVALUE(index, _19$$14); - ZEPHIR_CALL_METHOD(&indexName, index, "getname", NULL, 0); + zephir_array_append(&createLines, &columnLine, PH_SEPARATE, "phalcon/db/dialect/sqlite.zep", 374); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); + ZEPHIR_OBS_VAR(&indexes); + if (zephir_array_isset_string_fetch(&indexes, &definition, SL("indexes"), 0)) { + zephir_is_iterable(&indexes, 0, "phalcon/db/dialect/sqlite.zep", 396); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&indexes), _15$$14) + { + ZEPHIR_INIT_NVAR(&index); + ZVAL_COPY(&index, _15$$14); + ZEPHIR_CALL_METHOD(&indexName, &index, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&indexType, index, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(&indexType, &index, "gettype", NULL, 0); zephir_check_call_status(); - _20$$15 = ZEPHIR_IS_STRING(indexName, "PRIMARY"); - if (_20$$15) { - _20$$15 = !hasPrimary; + _16$$15 = ZEPHIR_IS_STRING(&indexName, "PRIMARY"); + if (_16$$15) { + _16$$15 = !hasPrimary; } - _21$$15 = !(ZEPHIR_IS_EMPTY(indexType)); - if (_21$$15) { - ZEPHIR_INIT_NVAR(_22$$15); - zephir_fast_strtoupper(_22$$15, indexType); - _21$$15 = zephir_memnstr_str(_22$$15, SL("UNIQUE"), "phalcon/db/dialect/sqlite.zep", 392); + _17$$15 = !(ZEPHIR_IS_EMPTY(&indexType)); + if (_17$$15) { + ZEPHIR_INIT_NVAR(&_18$$15); + zephir_fast_strtoupper(&_18$$15, &indexType); + _17$$15 = zephir_memnstr_str(&_18$$15, SL("UNIQUE"), "phalcon/db/dialect/sqlite.zep", 392); } - if (_20$$15) { - ZEPHIR_CALL_METHOD(&_24$$16, index, "getcolumns", NULL, 0); + if (_16$$15) { + ZEPHIR_CALL_METHOD(&_20$$16, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_23$$16, this_ptr, "getcolumnlist", &_25, 57, _24$$16); + ZEPHIR_CALL_METHOD(&_19$$16, this_ptr, "getcolumnlist", &_21, 50, &_20$$16); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_26$$16); - ZEPHIR_CONCAT_SVS(_26$$16, "PRIMARY KEY (", _23$$16, ")"); - zephir_array_append(&createLines, _26$$16, PH_SEPARATE, "phalcon/db/dialect/sqlite.zep", 391); - } else if (_21$$15) { - ZEPHIR_CALL_METHOD(&_28$$17, index, "getcolumns", NULL, 0); + ZEPHIR_INIT_LNVAR(_22$$16); + ZEPHIR_CONCAT_SVS(&_22$$16, "PRIMARY KEY (", &_19$$16, ")"); + zephir_array_append(&createLines, &_22$$16, PH_SEPARATE, "phalcon/db/dialect/sqlite.zep", 391); + } else if (_17$$15) { + ZEPHIR_CALL_METHOD(&_24$$17, &index, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_27$$17, this_ptr, "getcolumnlist", &_25, 57, _28$$17); + ZEPHIR_CALL_METHOD(&_23$$17, this_ptr, "getcolumnlist", &_21, 50, &_24$$17); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_29$$17); - ZEPHIR_CONCAT_SVS(_29$$17, "UNIQUE (", _27$$17, ")"); - zephir_array_append(&createLines, _29$$17, PH_SEPARATE, "phalcon/db/dialect/sqlite.zep", 393); + ZEPHIR_INIT_LNVAR(_25$$17); + ZEPHIR_CONCAT_SVS(&_25$$17, "UNIQUE (", &_23$$17, ")"); + zephir_array_append(&createLines, &_25$$17, PH_SEPARATE, "phalcon/db/dialect/sqlite.zep", 393); } - } - } - ZEPHIR_OBS_VAR(references); - if (zephir_array_isset_string_fetch(&references, definition, SS("references"), 0 TSRMLS_CC)) { - zephir_is_iterable(references, &_31$$18, &_30$$18, 0, 0, "phalcon/db/dialect/sqlite.zep", 418); - for ( - ; zend_hash_get_current_data_ex(_31$$18, (void**) &_32$$18, &_30$$18) == SUCCESS - ; zend_hash_move_forward_ex(_31$$18, &_30$$18) - ) { - ZEPHIR_GET_HVALUE(reference, _32$$18); - ZEPHIR_CALL_METHOD(&_33$$19, reference, "getname", NULL, 0); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&index); + } + ZEPHIR_OBS_VAR(&references); + if (zephir_array_isset_string_fetch(&references, &definition, SL("references"), 0)) { + zephir_is_iterable(&references, 0, "phalcon/db/dialect/sqlite.zep", 418); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&references), _26$$18) + { + ZEPHIR_INIT_NVAR(&reference); + ZVAL_COPY(&reference, _26$$18); + ZEPHIR_CALL_METHOD(&_27$$19, &reference, "getname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_35$$19, reference, "getcolumns", NULL, 0); + ZEPHIR_CALL_METHOD(&_29$$19, &reference, "getcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_34$$19, this_ptr, "getcolumnlist", &_25, 57, _35$$19); + ZEPHIR_CALL_METHOD(&_28$$19, this_ptr, "getcolumnlist", &_21, 50, &_29$$19); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_36$$19, reference, "getreferencedtable", NULL, 0); + ZEPHIR_CALL_METHOD(&_30$$19, &reference, "getreferencedtable", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_38$$19, reference, "getreferencedcolumns", NULL, 0); + ZEPHIR_CALL_METHOD(&_32$$19, &reference, "getreferencedcolumns", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_37$$19, this_ptr, "getcolumnlist", &_25, 57, _38$$19); + ZEPHIR_CALL_METHOD(&_31$$19, this_ptr, "getcolumnlist", &_21, 50, &_32$$19); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(referenceSql); - ZEPHIR_CONCAT_SVSVSSVSVS(referenceSql, "CONSTRAINT `", _33$$19, "` FOREIGN KEY (", _34$$19, ")", " REFERENCES `", _36$$19, "`(", _37$$19, ")"); - ZEPHIR_CALL_METHOD(&onDelete, reference, "getondelete", NULL, 0); + ZEPHIR_INIT_NVAR(&referenceSql); + ZEPHIR_CONCAT_SVSVSSVSVS(&referenceSql, "CONSTRAINT `", &_27$$19, "` FOREIGN KEY (", &_28$$19, ")", " REFERENCES `", &_30$$19, "`(", &_31$$19, ")"); + ZEPHIR_CALL_METHOD(&onDelete, &reference, "getondelete", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onDelete))) { - ZEPHIR_INIT_LNVAR(_39$$20); - ZEPHIR_CONCAT_SV(_39$$20, " ON DELETE ", onDelete); - zephir_concat_self(&referenceSql, _39$$20 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onDelete))) { + ZEPHIR_INIT_LNVAR(_33$$20); + ZEPHIR_CONCAT_SV(&_33$$20, " ON DELETE ", &onDelete); + zephir_concat_self(&referenceSql, &_33$$20 TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&onUpdate, reference, "getonupdate", NULL, 0); + ZEPHIR_CALL_METHOD(&onUpdate, &reference, "getonupdate", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(onUpdate))) { - ZEPHIR_INIT_LNVAR(_40$$21); - ZEPHIR_CONCAT_SV(_40$$21, " ON UPDATE ", onUpdate); - zephir_concat_self(&referenceSql, _40$$21 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&onUpdate))) { + ZEPHIR_INIT_LNVAR(_34$$21); + ZEPHIR_CONCAT_SV(&_34$$21, " ON UPDATE ", &onUpdate); + zephir_concat_self(&referenceSql, &_34$$21 TSRMLS_CC); } - zephir_array_append(&createLines, referenceSql, PH_SEPARATE, "phalcon/db/dialect/sqlite.zep", 416); - } + zephir_array_append(&createLines, &referenceSql, PH_SEPARATE, "phalcon/db/dialect/sqlite.zep", 416); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&reference); } - ZEPHIR_INIT_VAR(_41); - zephir_fast_join_str(_41, SL(",\n\t"), createLines TSRMLS_CC); - ZEPHIR_INIT_VAR(_42); - ZEPHIR_CONCAT_VS(_42, _41, "\n)"); - zephir_concat_self(&sql, _42 TSRMLS_CC); - RETURN_CCTOR(sql); + ZEPHIR_INIT_VAR(&_35); + zephir_fast_join_str(&_35, SL(",\n\t"), &createLines TSRMLS_CC); + ZEPHIR_INIT_VAR(&_36); + ZEPHIR_CONCAT_VS(&_36, &_35, "\n)"); + zephir_concat_self(&sql, &_36 TSRMLS_CC); + RETURN_CCTOR(&sql); } @@ -905,44 +1048,51 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createTable) { */ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, truncateTable) { - zval *tableName_param = NULL, *schemaName_param = NULL, *sql = NULL, *table = NULL; - zval *tableName = NULL, *schemaName = NULL, *_0$$3; + zval *tableName_param = NULL, *schemaName_param = NULL, sql, table; + zval tableName, schemaName, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&table); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } - if (!(!schemaName) && Z_STRLEN_P(schemaName)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_VSV(_0$$3, schemaName, "\".\"", tableName); - ZEPHIR_CPY_WRT(table, _0$$3); + if (!(Z_TYPE_P(&schemaName) == IS_UNDEF) && Z_STRLEN_P(&schemaName)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_VSV(&_0$$3, &schemaName, "\".\"", &tableName); + ZEPHIR_CPY_WRT(&table, &_0$$3); } else { - ZEPHIR_CPY_WRT(table, tableName); + ZEPHIR_CPY_WRT(&table, &tableName); } - ZEPHIR_INIT_VAR(sql); - ZEPHIR_CONCAT_SVS(sql, "DELETE FROM \"", table, "\""); - RETURN_CCTOR(sql); + ZEPHIR_INIT_VAR(&sql); + ZEPHIR_CONCAT_SVS(&sql, "DELETE FROM \"", &table, "\""); + RETURN_CCTOR(&sql); } @@ -953,48 +1103,54 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropTable) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool ifExists; - zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, *sql = NULL, *table = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval *tableName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, sql, table; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&table); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &tableName_param, &schemaName_param, &ifExists_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } if (!ifExists_param) { ifExists = 1; } else { - if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - ifExists = Z_BVAL_P(ifExists_param); + ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE); } - ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, tableName, schemaName); + ZEPHIR_CALL_METHOD(&table, this_ptr, "preparetable", NULL, 0, &tableName, &schemaName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(sql); + ZEPHIR_INIT_VAR(&sql); if (ifExists) { - ZEPHIR_CONCAT_SV(sql, "DROP TABLE IF EXISTS ", table); + ZEPHIR_CONCAT_SV(&sql, "DROP TABLE IF EXISTS ", &table); } else { - ZEPHIR_CONCAT_SV(sql, "DROP TABLE ", table); + ZEPHIR_CONCAT_SV(&sql, "DROP TABLE ", &table); } - RETURN_CCTOR(sql); + RETURN_CCTOR(&sql); } @@ -1004,40 +1160,47 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropTable) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, createView) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, *viewSql = NULL, *_0 = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval definition; + zval *viewName_param = NULL, *definition_param = NULL, *schemaName_param = NULL, viewSql, _0; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&viewSql); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &viewName_param, &definition_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - ZEPHIR_OBS_VAR(viewSql); - if (!(zephir_array_isset_string_fetch(&viewSql, definition, SS("sql"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&viewSql); + if (!(zephir_array_isset_string_fetch(&viewSql, &definition, SL("sql"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "The index 'sql' is required in the definition array", "phalcon/db/dialect/sqlite.zep", 469); return; } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, viewName, schemaName); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", _0, " AS ", viewSql); + ZEPHIR_CONCAT_SVSV(return_value, "CREATE VIEW ", &_0, " AS ", &viewSql); RETURN_MM(); } @@ -1049,46 +1212,51 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropView) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool ifExists; - zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, *view = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval *viewName_param = NULL, *schemaName_param = NULL, *ifExists_param = NULL, view; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); + ZVAL_UNDEF(&view); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &viewName_param, &schemaName_param, &ifExists_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } if (!ifExists_param) { ifExists = 1; } else { - if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(ifExists_param) != IS_TRUE && Z_TYPE_P(ifExists_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'ifExists' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - ifExists = Z_BVAL_P(ifExists_param); + ifExists = (Z_TYPE_P(ifExists_param) == IS_TRUE); } - ZEPHIR_CALL_METHOD(&view, this_ptr, "preparetable", NULL, 0, viewName, schemaName); + ZEPHIR_CALL_METHOD(&view, this_ptr, "preparetable", NULL, 0, &viewName, &schemaName); zephir_check_call_status(); if (ifExists) { - ZEPHIR_CONCAT_SV(return_value, "DROP VIEW IF EXISTS ", view); + ZEPHIR_CONCAT_SV(return_value, "DROP VIEW IF EXISTS ", &view); RETURN_MM(); } - ZEPHIR_CONCAT_SV(return_value, "DROP VIEW ", view); + ZEPHIR_CONCAT_SV(return_value, "DROP VIEW ", &view); RETURN_MM(); } @@ -1105,30 +1273,34 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, dropView) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, tableExists) { zval *tableName_param = NULL, *schemaName_param = NULL; - zval *tableName = NULL, *schemaName = NULL; + zval tableName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tableName); + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &tableName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(tableName_param) != IS_STRING && Z_TYPE_P(tableName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tableName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tableName_param) == IS_STRING)) { - zephir_get_strval(tableName, tableName_param); + zephir_get_strval(&tableName, tableName_param); } else { - ZEPHIR_INIT_VAR(tableName); - ZVAL_EMPTY_STRING(tableName); + ZEPHIR_INIT_VAR(&tableName); + ZVAL_EMPTY_STRING(&tableName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM sqlite_master WHERE type='table' AND tbl_name='", tableName, "'"); + ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM sqlite_master WHERE type='table' AND tbl_name='", &tableName, "'"); RETURN_MM(); } @@ -1139,30 +1311,34 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, tableExists) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, viewExists) { zval *viewName_param = NULL, *schemaName_param = NULL; - zval *viewName = NULL, *schemaName = NULL; + zval viewName, schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewName); + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &viewName_param, &schemaName_param); if (UNEXPECTED(Z_TYPE_P(viewName_param) != IS_STRING && Z_TYPE_P(viewName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewName_param) == IS_STRING)) { - zephir_get_strval(viewName, viewName_param); + zephir_get_strval(&viewName, viewName_param); } else { - ZEPHIR_INIT_VAR(viewName); - ZVAL_EMPTY_STRING(viewName); + ZEPHIR_INIT_VAR(&viewName); + ZVAL_EMPTY_STRING(&viewName); } if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM sqlite_master WHERE type='view' AND tbl_name='", viewName, "'"); + ZEPHIR_CONCAT_SVS(return_value, "SELECT CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END FROM sqlite_master WHERE type='view' AND tbl_name='", &viewName, "'"); RETURN_MM(); } @@ -1179,30 +1355,34 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, viewExists) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeColumns) { zval *table_param = NULL, *schema_param = NULL; - zval *table = NULL, *schema = NULL; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_CONCAT_SVS(return_value, "PRAGMA table_info('", table, "')"); + ZEPHIR_CONCAT_SVS(return_value, "PRAGMA table_info('", &table, "')"); RETURN_MM(); } @@ -1219,20 +1399,23 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeColumns) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listTables) { zval *schemaName_param = NULL; - zval *schemaName = NULL; + zval schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &schemaName_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } - RETURN_MM_STRING("SELECT tbl_name FROM sqlite_master WHERE type = 'table' ORDER BY tbl_name", 1); + RETURN_MM_STRING("SELECT tbl_name FROM sqlite_master WHERE type = 'table' ORDER BY tbl_name"); } @@ -1242,29 +1425,32 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listTables) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listViews) { zval *schemaName_param = NULL; - zval *schemaName = NULL; + zval schemaName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&schemaName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &schemaName_param); if (!schemaName_param) { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_STRING(&schemaName, ""); } else { if (UNEXPECTED(Z_TYPE_P(schemaName_param) != IS_STRING && Z_TYPE_P(schemaName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schemaName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schemaName_param) == IS_STRING)) { - zephir_get_strval(schemaName, schemaName_param); + zephir_get_strval(&schemaName, schemaName_param); } else { - ZEPHIR_INIT_VAR(schemaName); - ZVAL_EMPTY_STRING(schemaName); + ZEPHIR_INIT_VAR(&schemaName); + ZVAL_EMPTY_STRING(&schemaName); } } - RETURN_MM_STRING("SELECT tbl_name FROM sqlite_master WHERE type = 'view' ORDER BY tbl_name", 1); + RETURN_MM_STRING("SELECT tbl_name FROM sqlite_master WHERE type = 'view' ORDER BY tbl_name"); } @@ -1280,49 +1466,59 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listViews) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listIndexesSql) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *table_param = NULL, *schema_param = NULL, *keyName_param = NULL, *_0 = NULL, *_1, *_2$$3 = NULL, *_3$$3; - zval *table = NULL, *schema = NULL, *keyName = NULL, *sql = NULL; + zval *table_param = NULL, *schema_param = NULL, *keyName_param = NULL, _0, _1, _2$$3, _3$$3; + zval table, schema, keyName, sql; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &table_param, &schema_param, &keyName_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } if (!keyName_param) { - ZEPHIR_INIT_VAR(keyName); - ZVAL_EMPTY_STRING(keyName); + ZEPHIR_INIT_VAR(&keyName); + ZVAL_STRING(&keyName, ""); } else { - zephir_get_strval(keyName, keyName_param); + zephir_get_strval(&keyName, keyName_param); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 56, table); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "escape", NULL, 49, &table); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVS(_1, "SELECT sql FROM sqlite_master WHERE type = 'index' AND tbl_name = ", _0, " COLLATE NOCASE"); - zephir_get_strval(sql, _1); - if (!(!keyName) && Z_STRLEN_P(keyName)) { - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "escape", NULL, 56, keyName); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVS(&_1, "SELECT sql FROM sqlite_master WHERE type = 'index' AND tbl_name = ", &_0, " COLLATE NOCASE"); + zephir_get_strval(&sql, &_1); + if (!(Z_TYPE_P(&keyName) == IS_UNDEF) && Z_STRLEN_P(&keyName)) { + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "escape", NULL, 49, &keyName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3$$3); - ZEPHIR_CONCAT_SVS(_3$$3, " AND name = ", _2$$3, " COLLATE NOCASE"); - zephir_concat_self(&sql, _3$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$3); + ZEPHIR_CONCAT_SVS(&_3$$3, " AND name = ", &_2$$3, " COLLATE NOCASE"); + zephir_concat_self(&sql, &_3$$3 TSRMLS_CC); } - RETURN_CTOR(sql); + RETURN_CTOR(&sql); } @@ -1332,30 +1528,34 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, listIndexesSql) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeIndexes) { zval *table_param = NULL, *schema_param = NULL; - zval *table = NULL, *schema = NULL; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_CONCAT_SVS(return_value, "PRAGMA index_list('", table, "')"); + ZEPHIR_CONCAT_SVS(return_value, "PRAGMA index_list('", &table, "')"); RETURN_MM(); } @@ -1366,24 +1566,27 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeIndexes) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeIndex) { zval *index_param = NULL; - zval *index = NULL; + zval index; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index_param); if (UNEXPECTED(Z_TYPE_P(index_param) != IS_STRING && Z_TYPE_P(index_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(index_param) == IS_STRING)) { - zephir_get_strval(index, index_param); + zephir_get_strval(&index, index_param); } else { - ZEPHIR_INIT_VAR(index); - ZVAL_EMPTY_STRING(index); + ZEPHIR_INIT_VAR(&index); + ZVAL_EMPTY_STRING(&index); } - ZEPHIR_CONCAT_SVS(return_value, "PRAGMA index_info('", index, "')"); + ZEPHIR_CONCAT_SVS(return_value, "PRAGMA index_info('", &index, "')"); RETURN_MM(); } @@ -1394,30 +1597,34 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeIndex) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeReferences) { zval *table_param = NULL, *schema_param = NULL; - zval *table = NULL, *schema = NULL; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - ZEPHIR_CONCAT_SVS(return_value, "PRAGMA foreign_key_list('", table, "')"); + ZEPHIR_CONCAT_SVS(return_value, "PRAGMA foreign_key_list('", &table, "')"); RETURN_MM(); } @@ -1428,30 +1635,34 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeReferences) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, tableOptions) { zval *table_param = NULL, *schema_param = NULL; - zval *table = NULL, *schema = NULL; + zval table, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&schema); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &table_param, &schema_param); if (UNEXPECTED(Z_TYPE_P(table_param) != IS_STRING && Z_TYPE_P(table_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'table' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(table_param) == IS_STRING)) { - zephir_get_strval(table, table_param); + zephir_get_strval(&table, table_param); } else { - ZEPHIR_INIT_VAR(table); - ZVAL_EMPTY_STRING(table); + ZEPHIR_INIT_VAR(&table); + ZVAL_EMPTY_STRING(&table); } if (!schema_param) { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_STRING(&schema, ""); } else { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } - RETURN_MM_STRING("", 1); + RETURN_MM_STRING(""); } @@ -1462,24 +1673,27 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, tableOptions) { PHP_METHOD(Phalcon_Db_Dialect_Sqlite, sharedLock) { zval *sqlQuery_param = NULL; - zval *sqlQuery = NULL; + zval sqlQuery; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlQuery); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlQuery_param); if (UNEXPECTED(Z_TYPE_P(sqlQuery_param) != IS_STRING && Z_TYPE_P(sqlQuery_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sqlQuery' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(sqlQuery_param) == IS_STRING)) { - zephir_get_strval(sqlQuery, sqlQuery_param); + zephir_get_strval(&sqlQuery, sqlQuery_param); } else { - ZEPHIR_INIT_VAR(sqlQuery); - ZVAL_EMPTY_STRING(sqlQuery); + ZEPHIR_INIT_VAR(&sqlQuery); + ZVAL_EMPTY_STRING(&sqlQuery); } - RETURN_CTOR(sqlQuery); + RETURN_CTOR(&sqlQuery); } diff --git a/ext/phalcon/db/dialect/sqlite.zep.h b/ext/phalcon/db/dialect/sqlite.zep.h index c7b1f064a17..005e154cffb 100644 --- a/ext/phalcon/db/dialect/sqlite.zep.h +++ b/ext/phalcon/db/dialect/sqlite.zep.h @@ -30,143 +30,455 @@ PHP_METHOD(Phalcon_Db_Dialect_Sqlite, describeReferences); PHP_METHOD(Phalcon_Db_Dialect_Sqlite, tableOptions); PHP_METHOD(Phalcon_Db_Dialect_Sqlite, sharedLock); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_getcolumndefinition, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_getcolumndefinition, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_getcolumndefinition, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addcolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addcolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_modifycolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_modifycolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_modifycolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_ARG_OBJ_INFO(0, currentColumn, Phalcon\\Db\\ColumnInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropcolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropcolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, columnName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, columnName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addindex, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addindex, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropindex, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropindex, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, indexName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, indexName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addprimarykey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addprimarykey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addprimarykey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropprimarykey, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropprimarykey, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropprimarykey, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addforeignkey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_addforeignkey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, reference, Phalcon\\Db\\ReferenceInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropforeignkey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropforeignkey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_createtable, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_createtable, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_createtable, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_truncatetable, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_truncatetable, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_truncatetable, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_droptable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_droptable, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_droptable, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_createview, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_createview, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_createview, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropview, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropview, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_dropview, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_tableexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_tableexists, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_tableexists, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_viewexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_viewexists, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_viewexists, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describecolumns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describecolumns, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describecolumns, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_listtables, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_listtables, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_listtables, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_listviews, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_listviews, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_listviews, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_listindexessql, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_listindexessql, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_listindexessql, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keyName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, keyName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describeindexes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describeindexes, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describeindexes, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describeindex, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describeindex, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describeindex, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describereferences, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describereferences, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_describereferences, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_tableoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_tableoptions, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_tableoptions, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialect_sqlite_sharedlock, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_sharedlock, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialect_sqlite_sharedlock, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_dialect_sqlite_method_entry) { diff --git a/ext/phalcon/db/dialectinterface.zep.h b/ext/phalcon/db/dialectinterface.zep.h index 7509a6d4985..daa43f5eba9 100644 --- a/ext/phalcon/db/dialectinterface.zep.h +++ b/ext/phalcon/db/dialectinterface.zep.h @@ -3,152 +3,474 @@ extern zend_class_entry *phalcon_db_dialectinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Db_DialectInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_limit, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_limit, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_limit, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_ARG_INFO(0, number) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_forupdate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_forupdate, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_forupdate, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_sharedlock, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_sharedlock, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_sharedlock, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlQuery, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlQuery) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_select, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_select, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_select, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_getcolumnlist, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_getcolumnlist, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_getcolumnlist, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, columnList, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_getcolumndefinition, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_getcolumndefinition, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_getcolumndefinition, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_addcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_addcolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_addcolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_modifycolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_modifycolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_modifycolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, column, Phalcon\\Db\\ColumnInterface, 0) ZEND_ARG_OBJ_INFO(0, currentColumn, Phalcon\\Db\\ColumnInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_dropcolumn, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropcolumn, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropcolumn, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, columnName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, columnName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_addindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_addindex, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_addindex, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_dropindex, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropindex, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropindex, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, indexName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, indexName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_addprimarykey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_addprimarykey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_addprimarykey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, index, Phalcon\\Db\\IndexInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_dropprimarykey, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropprimarykey, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropprimarykey, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_addforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_addforeignkey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_addforeignkey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_OBJ_INFO(0, reference, Phalcon\\Db\\ReferenceInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_dropforeignkey, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropforeignkey, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropforeignkey, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_createtable, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_createview, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_createview, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_createview, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_droptable, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_droptable, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_droptable, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_dropview, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropview, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_dropview, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ifExists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, ifExists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_tableexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_tableexists, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_tableexists, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tableName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_viewexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_viewexists, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_viewexists, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_describecolumns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_describecolumns, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_describecolumns, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_listtables, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_listtables, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_listtables, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schemaName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schemaName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_describeindexes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_describeindexes, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_describeindexes, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_describereferences, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_describereferences, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_describereferences, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_tableoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_tableoptions, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_tableoptions, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) +#else ZEND_ARG_INFO(0, table) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 1) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_createsavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_supportssavepoints, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_supportssavepoints, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_supportsreleasesavepoints, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_supportsreleasesavepoints, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_createsavepoint, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_createsavepoint, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_releasesavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_releasesavepoint, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_releasesavepoint, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_dialectinterface_rollbacksavepoint, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_rollbacksavepoint, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_dialectinterface_rollbacksavepoint, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_dialectinterface_method_entry) { @@ -178,8 +500,8 @@ ZEPHIR_INIT_FUNCS(phalcon_db_dialectinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, describeIndexes, arginfo_phalcon_db_dialectinterface_describeindexes) PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, describeReferences, arginfo_phalcon_db_dialectinterface_describereferences) PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, tableOptions, arginfo_phalcon_db_dialectinterface_tableoptions) - PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, supportsSavepoints, NULL) - PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, supportsReleaseSavepoints, NULL) + PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, supportsSavepoints, arginfo_phalcon_db_dialectinterface_supportssavepoints) + PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, supportsReleaseSavepoints, arginfo_phalcon_db_dialectinterface_supportsreleasesavepoints) PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, createSavepoint, arginfo_phalcon_db_dialectinterface_createsavepoint) PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, releaseSavepoint, arginfo_phalcon_db_dialectinterface_releasesavepoint) PHP_ABSTRACT_ME(Phalcon_Db_DialectInterface, rollbackSavepoint, arginfo_phalcon_db_dialectinterface_rollbacksavepoint) diff --git a/ext/phalcon/db/index.zep.c b/ext/phalcon/db/index.zep.c index 40d200afe3a..b73c1e4bdfc 100644 --- a/ext/phalcon/db/index.zep.c +++ b/ext/phalcon/db/index.zep.c @@ -87,7 +87,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Index) { */ PHP_METHOD(Phalcon_Db_Index, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -98,7 +99,8 @@ PHP_METHOD(Phalcon_Db_Index, getName) { */ PHP_METHOD(Phalcon_Db_Index, getColumns) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_columns"); @@ -109,7 +111,8 @@ PHP_METHOD(Phalcon_Db_Index, getColumns) { */ PHP_METHOD(Phalcon_Db_Index, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -120,33 +123,41 @@ PHP_METHOD(Phalcon_Db_Index, getType) { */ PHP_METHOD(Phalcon_Db_Index, __construct) { - zval *columns = NULL; - zval *name_param = NULL, *columns_param = NULL, *type = NULL; - zval *name = NULL, *_0 = NULL; + zval columns; + zval *name_param = NULL, *columns_param = NULL, *type = NULL, type_sub, __$null; + zval name, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&type_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&columns); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &name_param, &columns_param, &type); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - columns = columns_param; + ZEPHIR_OBS_COPY_OR_DUP(&columns, columns_param); if (!type) { - type = ZEPHIR_GLOBAL(global_null); + type = &type_sub; + type = &__$null; } - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_columns"), columns TSRMLS_CC); - zephir_get_strval(_0, type); - zephir_update_property_this(getThis(), SL("_type"), _0 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); + zephir_update_property_zval(this_ptr, SL("_columns"), &columns); + zephir_get_strval(&_0, type); + zephir_update_property_zval(this_ptr, SL("_type"), &_0); ZEPHIR_MM_RESTORE(); } @@ -157,32 +168,38 @@ PHP_METHOD(Phalcon_Db_Index, __construct) { PHP_METHOD(Phalcon_Db_Index, __set_state) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *indexName = NULL, *columns = NULL, *type = NULL; - zval *data = NULL; + zval *data_param = NULL, indexName, columns, type; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&indexName); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&type); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data_param); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); - ZEPHIR_OBS_VAR(indexName); - if (!(zephir_array_isset_string_fetch(&indexName, data, SS("_name"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&indexName); + if (!(zephir_array_isset_string_fetch(&indexName, &data, SL("_name"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "_name parameter is required", "phalcon/db/index.zep", 95); return; } - ZEPHIR_OBS_VAR(columns); - if (!(zephir_array_isset_string_fetch(&columns, data, SS("_columns"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&columns); + if (!(zephir_array_isset_string_fetch(&columns, &data, SL("_columns"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "_columns parameter is required", "phalcon/db/index.zep", 99); return; } - ZEPHIR_OBS_VAR(type); - if (!(zephir_array_isset_string_fetch(&type, data, SS("_type"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(type); - ZVAL_STRING(type, "", 1); + ZEPHIR_OBS_VAR(&type); + if (!(zephir_array_isset_string_fetch(&type, &data, SL("_type"), 0))) { + ZEPHIR_INIT_NVAR(&type); + ZVAL_STRING(&type, ""); } object_init_ex(return_value, phalcon_db_index_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 24, indexName, columns, type); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 19, &indexName, &columns, &type); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/db/index.zep.h b/ext/phalcon/db/index.zep.h index 909f3b01dd7..ba3efa9642e 100644 --- a/ext/phalcon/db/index.zep.h +++ b/ext/phalcon/db/index.zep.h @@ -9,20 +9,49 @@ PHP_METHOD(Phalcon_Db_Index, getType); PHP_METHOD(Phalcon_Db_Index, __construct); PHP_METHOD(Phalcon_Db_Index, __set_state); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_index_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_index_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_index_getcolumns, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_index_getcolumns, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_index_gettype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_index_gettype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_index___construct, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_ARRAY_INFO(0, columns, 0) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_index___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_index___set_state, 0, 1, Phalcon\\Db\\IndexInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_index___set_state, 0, 1, IS_OBJECT, "Phalcon\\Db\\IndexInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_index_method_entry) { - PHP_ME(Phalcon_Db_Index, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Index, getColumns, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Index, getType, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Index, getName, arginfo_phalcon_db_index_getname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Index, getColumns, arginfo_phalcon_db_index_getcolumns, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Index, getType, arginfo_phalcon_db_index_gettype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Index, __construct, arginfo_phalcon_db_index___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Db_Index, __set_state, arginfo_phalcon_db_index___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END diff --git a/ext/phalcon/db/indexinterface.zep.h b/ext/phalcon/db/indexinterface.zep.h index 807d20e90f1..6cf6439a9fc 100644 --- a/ext/phalcon/db/indexinterface.zep.h +++ b/ext/phalcon/db/indexinterface.zep.h @@ -3,7 +3,11 @@ extern zend_class_entry *phalcon_db_indexinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Db_IndexInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_indexinterface___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_indexinterface___set_state, 0, 1, Phalcon\\Db\\IndexInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_indexinterface___set_state, 0, 1, IS_OBJECT, "Phalcon\\Db\\IndexInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/db/profiler.zep.c b/ext/phalcon/db/profiler.zep.c index 4a3cf1e9889..85122b9f5f3 100644 --- a/ext/phalcon/db/profiler.zep.c +++ b/ext/phalcon/db/profiler.zep.c @@ -110,44 +110,55 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Profiler) { PHP_METHOD(Phalcon_Db_Profiler, startProfile) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sqlStatement, *sqlVariables = NULL, *sqlBindTypes = NULL, *activeProfile = NULL, *_0; + zval *sqlStatement, sqlStatement_sub, *sqlVariables = NULL, sqlVariables_sub, *sqlBindTypes = NULL, sqlBindTypes_sub, __$true, __$null, activeProfile, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlStatement_sub); + ZVAL_UNDEF(&sqlVariables_sub); + ZVAL_UNDEF(&sqlBindTypes_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&activeProfile); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &sqlStatement, &sqlVariables, &sqlBindTypes); if (!sqlVariables) { - sqlVariables = ZEPHIR_GLOBAL(global_null); + sqlVariables = &sqlVariables_sub; + sqlVariables = &__$null; } if (!sqlBindTypes) { - sqlBindTypes = ZEPHIR_GLOBAL(global_null); + sqlBindTypes = &sqlBindTypes_sub; + sqlBindTypes = &__$null; } - ZEPHIR_INIT_VAR(activeProfile); - object_init_ex(activeProfile, phalcon_db_profiler_item_ce); - if (zephir_has_constructor(activeProfile TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, activeProfile, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&activeProfile); + object_init_ex(&activeProfile, phalcon_db_profiler_item_ce); + if (zephir_has_constructor(&activeProfile TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, activeProfile, "setsqlstatement", NULL, 170, sqlStatement); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlstatement", NULL, 150, sqlStatement); zephir_check_call_status(); if (Z_TYPE_P(sqlVariables) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, activeProfile, "setsqlvariables", NULL, 171, sqlVariables); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlvariables", NULL, 151, sqlVariables); zephir_check_call_status(); } if (Z_TYPE_P(sqlBindTypes) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, activeProfile, "setsqlbindtypes", NULL, 172, sqlBindTypes); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setsqlbindtypes", NULL, 152, sqlBindTypes); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_0); - zephir_microtime(_0, ZEPHIR_GLOBAL(global_true) TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, activeProfile, "setinitialtime", NULL, 173, _0); + ZEPHIR_INIT_VAR(&_0); + zephir_microtime(&_0, &__$true TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setinitialtime", NULL, 153, &_0); zephir_check_call_status(); - if ((zephir_method_exists_ex(this_ptr, SS("beforestartprofile") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "beforestartprofile", NULL, 0, activeProfile); + if ((zephir_method_exists_ex(this_ptr, SL("beforestartprofile") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "beforestartprofile", NULL, 0, &activeProfile); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_activeProfile"), activeProfile TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_activeProfile"), &activeProfile); RETURN_THIS(); } @@ -157,28 +168,37 @@ PHP_METHOD(Phalcon_Db_Profiler, startProfile) { */ PHP_METHOD(Phalcon_Db_Profiler, stopProfile) { - zval *finalTime = NULL, *initialTime = NULL, *activeProfile = NULL, *_0, *_1, *_2; zend_long ZEPHIR_LAST_CALL_STATUS; + zval __$true, finalTime, initialTime, activeProfile, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&finalTime); + ZVAL_UNDEF(&initialTime); + ZVAL_UNDEF(&activeProfile); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(finalTime); - zephir_microtime(finalTime, ZEPHIR_GLOBAL(global_true) TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_activeProfile"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(activeProfile, _0); - ZEPHIR_CALL_METHOD(NULL, activeProfile, "setfinaltime", NULL, 0, finalTime); + ZEPHIR_INIT_VAR(&finalTime); + zephir_microtime(&finalTime, &__$true TSRMLS_CC); + zephir_read_property(&_0, this_ptr, SL("_activeProfile"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&activeProfile, &_0); + ZEPHIR_CALL_METHOD(NULL, &activeProfile, "setfinaltime", NULL, 0, &finalTime); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&initialTime, activeProfile, "getinitialtime", NULL, 0); + ZEPHIR_CALL_METHOD(&initialTime, &activeProfile, "getinitialtime", NULL, 0); zephir_check_call_status(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_totalSeconds"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_sub_function(_1, finalTime, initialTime); - ZEPHIR_INIT_VAR(_2); - zephir_add_function(_2, _0, _1); - zephir_update_property_this(getThis(), SL("_totalSeconds"), _2 TSRMLS_CC); - zephir_update_property_array_append(this_ptr, SL("_allProfiles"), activeProfile TSRMLS_CC); - if ((zephir_method_exists_ex(this_ptr, SS("afterendprofile") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "afterendprofile", NULL, 0, activeProfile); + zephir_read_property(&_0, this_ptr, SL("_totalSeconds"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_sub_function(&_1, &finalTime, &initialTime); + ZEPHIR_INIT_VAR(&_2); + zephir_add_function(&_2, &_0, &_1); + zephir_update_property_zval(this_ptr, SL("_totalSeconds"), &_2); + zephir_update_property_array_append(this_ptr, SL("_allProfiles"), &activeProfile TSRMLS_CC); + if ((zephir_method_exists_ex(this_ptr, SL("afterendprofile") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "afterendprofile", NULL, 0, &activeProfile); zephir_check_call_status(); } RETURN_THIS(); @@ -190,11 +210,14 @@ PHP_METHOD(Phalcon_Db_Profiler, stopProfile) { */ PHP_METHOD(Phalcon_Db_Profiler, getNumberTotalStatements) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_allProfiles"), PH_NOISY_CC); - RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC)); + + zephir_read_property(&_0, this_ptr, SL("_allProfiles"), PH_NOISY_CC | PH_READONLY); + RETURN_LONG(zephir_fast_count_int(&_0 TSRMLS_CC)); } @@ -203,7 +226,8 @@ PHP_METHOD(Phalcon_Db_Profiler, getNumberTotalStatements) { */ PHP_METHOD(Phalcon_Db_Profiler, getTotalElapsedSeconds) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_totalSeconds"); @@ -214,7 +238,8 @@ PHP_METHOD(Phalcon_Db_Profiler, getTotalElapsedSeconds) { */ PHP_METHOD(Phalcon_Db_Profiler, getProfiles) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_allProfiles"); @@ -225,13 +250,16 @@ PHP_METHOD(Phalcon_Db_Profiler, getProfiles) { */ PHP_METHOD(Phalcon_Db_Profiler, reset) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_allProfiles"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_allProfiles"), &_0); RETURN_THIS(); } @@ -241,7 +269,8 @@ PHP_METHOD(Phalcon_Db_Profiler, reset) { */ PHP_METHOD(Phalcon_Db_Profiler, getLastProfile) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_activeProfile"); diff --git a/ext/phalcon/db/profiler.zep.h b/ext/phalcon/db/profiler.zep.h index 315d750a50b..a2172bdca2a 100644 --- a/ext/phalcon/db/profiler.zep.h +++ b/ext/phalcon/db/profiler.zep.h @@ -11,19 +11,65 @@ PHP_METHOD(Phalcon_Db_Profiler, getProfiles); PHP_METHOD(Phalcon_Db_Profiler, reset); PHP_METHOD(Phalcon_Db_Profiler, getLastProfile); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_profiler_startprofile, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_profiler_startprofile, 0, 1, Phalcon\\Db\\Profiler, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_startprofile, 0, 1, IS_OBJECT, "Phalcon\\Db\\Profiler", 0) +#endif ZEND_ARG_INFO(0, sqlStatement) ZEND_ARG_INFO(0, sqlVariables) ZEND_ARG_INFO(0, sqlBindTypes) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_profiler_stopprofile, 0, 0, Phalcon\\Db\\Profiler, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_stopprofile, 0, 0, IS_OBJECT, "Phalcon\\Db\\Profiler", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_getnumbertotalstatements, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_getnumbertotalstatements, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_gettotalelapsedseconds, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_gettotalelapsedseconds, 0, 0, IS_DOUBLE, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_profiler_getprofiles, 0, 0, Phalcon\\Db\\Profiler\\Item, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_getprofiles, 0, 0, IS_OBJECT, "Phalcon\\Db\\Profiler\\Item", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_profiler_reset, 0, 0, Phalcon\\Db\\Profiler, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_reset, 0, 0, IS_OBJECT, "Phalcon\\Db\\Profiler", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_profiler_getlastprofile, 0, 0, Phalcon\\Db\\Profiler\\Item, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_getlastprofile, 0, 0, IS_OBJECT, "Phalcon\\Db\\Profiler\\Item", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_db_profiler_method_entry) { PHP_ME(Phalcon_Db_Profiler, startProfile, arginfo_phalcon_db_profiler_startprofile, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler, stopProfile, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler, getNumberTotalStatements, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler, getTotalElapsedSeconds, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler, getProfiles, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler, reset, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler, getLastProfile, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler, stopProfile, arginfo_phalcon_db_profiler_stopprofile, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler, getNumberTotalStatements, arginfo_phalcon_db_profiler_getnumbertotalstatements, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler, getTotalElapsedSeconds, arginfo_phalcon_db_profiler_gettotalelapsedseconds, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler, getProfiles, arginfo_phalcon_db_profiler_getprofiles, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler, reset, arginfo_phalcon_db_profiler_reset, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler, getLastProfile, arginfo_phalcon_db_profiler_getlastprofile, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/profiler/item.zep.c b/ext/phalcon/db/profiler/item.zep.c index e63db78a4ca..6a851415178 100644 --- a/ext/phalcon/db/profiler/item.zep.c +++ b/ext/phalcon/db/profiler/item.zep.c @@ -72,15 +72,18 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Profiler_Item) { PHP_METHOD(Phalcon_Db_Profiler_Item, setSqlStatement) { zval *sqlStatement_param = NULL; - zval *sqlStatement = NULL; + zval sqlStatement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlStatement); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlStatement_param); - zephir_get_strval(sqlStatement, sqlStatement_param); + zephir_get_strval(&sqlStatement, sqlStatement_param); - zephir_update_property_this(getThis(), SL("_sqlStatement"), sqlStatement TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sqlStatement"), &sqlStatement); RETURN_THIS(); } @@ -90,7 +93,8 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, setSqlStatement) { */ PHP_METHOD(Phalcon_Db_Profiler_Item, getSqlStatement) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sqlStatement"); @@ -102,15 +106,18 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, getSqlStatement) { PHP_METHOD(Phalcon_Db_Profiler_Item, setSqlVariables) { zval *sqlVariables_param = NULL; - zval *sqlVariables = NULL; + zval sqlVariables; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlVariables); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlVariables_param); - zephir_get_arrval(sqlVariables, sqlVariables_param); + zephir_get_arrval(&sqlVariables, sqlVariables_param); - zephir_update_property_this(getThis(), SL("_sqlVariables"), sqlVariables TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sqlVariables"), &sqlVariables); RETURN_THIS(); } @@ -120,7 +127,8 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, setSqlVariables) { */ PHP_METHOD(Phalcon_Db_Profiler_Item, getSqlVariables) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sqlVariables"); @@ -132,15 +140,18 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, getSqlVariables) { PHP_METHOD(Phalcon_Db_Profiler_Item, setSqlBindTypes) { zval *sqlBindTypes_param = NULL; - zval *sqlBindTypes = NULL; + zval sqlBindTypes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlBindTypes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sqlBindTypes_param); - zephir_get_arrval(sqlBindTypes, sqlBindTypes_param); + zephir_get_arrval(&sqlBindTypes, sqlBindTypes_param); - zephir_update_property_this(getThis(), SL("_sqlBindTypes"), sqlBindTypes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sqlBindTypes"), &sqlBindTypes); RETURN_THIS(); } @@ -150,7 +161,8 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, setSqlBindTypes) { */ PHP_METHOD(Phalcon_Db_Profiler_Item, getSqlBindTypes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sqlBindTypes"); @@ -161,8 +173,11 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, getSqlBindTypes) { */ PHP_METHOD(Phalcon_Db_Profiler_Item, setInitialTime) { - zval *initialTime_param = NULL, *_0; + zval *initialTime_param = NULL, _0; double initialTime; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &initialTime_param); @@ -170,8 +185,8 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, setInitialTime) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_DOUBLE(_0, initialTime); - zephir_update_property_this(getThis(), SL("_initialTime"), _0 TSRMLS_CC); + ZVAL_DOUBLE(&_0, initialTime); + zephir_update_property_zval(this_ptr, SL("_initialTime"), &_0); RETURN_THISW(); } @@ -181,7 +196,8 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, setInitialTime) { */ PHP_METHOD(Phalcon_Db_Profiler_Item, getInitialTime) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_initialTime"); @@ -192,8 +208,11 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, getInitialTime) { */ PHP_METHOD(Phalcon_Db_Profiler_Item, setFinalTime) { - zval *finalTime_param = NULL, *_0; + zval *finalTime_param = NULL, _0; double finalTime; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &finalTime_param); @@ -201,8 +220,8 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, setFinalTime) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_DOUBLE(_0, finalTime); - zephir_update_property_this(getThis(), SL("_finalTime"), _0 TSRMLS_CC); + ZVAL_DOUBLE(&_0, finalTime); + zephir_update_property_zval(this_ptr, SL("_finalTime"), &_0); RETURN_THISW(); } @@ -212,7 +231,8 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, setFinalTime) { */ PHP_METHOD(Phalcon_Db_Profiler_Item, getFinalTime) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_finalTime"); @@ -223,12 +243,16 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, getFinalTime) { */ PHP_METHOD(Phalcon_Db_Profiler_Item, getTotalElapsedSeconds) { - zval *_0, *_1; + zval _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_finalTime"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_initialTime"), PH_NOISY_CC); - zephir_sub_function(return_value, _0, _1); + zephir_read_property(&_0, this_ptr, SL("_finalTime"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_initialTime"), PH_NOISY_CC | PH_READONLY); + zephir_sub_function(return_value, &_0, &_1); return; } diff --git a/ext/phalcon/db/profiler/item.zep.h b/ext/phalcon/db/profiler/item.zep.h index 8e21ab80b61..847d59485a8 100644 --- a/ext/phalcon/db/profiler/item.zep.h +++ b/ext/phalcon/db/profiler/item.zep.h @@ -16,36 +16,90 @@ PHP_METHOD(Phalcon_Db_Profiler_Item, getFinalTime); PHP_METHOD(Phalcon_Db_Profiler_Item, getTotalElapsedSeconds); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_profiler_item_setsqlstatement, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sqlStatement, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sqlStatement) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getsqlstatement, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getsqlstatement, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_profiler_item_setsqlvariables, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, sqlVariables, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getsqlvariables, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getsqlvariables, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_profiler_item_setsqlbindtypes, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, sqlBindTypes, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getsqlbindtypes, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getsqlbindtypes, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_profiler_item_setinitialtime, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, initialTime, IS_DOUBLE, 0) +#else ZEND_ARG_INFO(0, initialTime) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getinitialtime, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getinitialtime, 0, 0, IS_DOUBLE, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_profiler_item_setfinaltime, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, finalTime, IS_DOUBLE, 0) +#else ZEND_ARG_INFO(0, finalTime) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getfinaltime, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_getfinaltime, 0, 0, IS_DOUBLE, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_gettotalelapsedseconds, 0, 0, IS_DOUBLE, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_profiler_item_gettotalelapsedseconds, 0, 0, IS_DOUBLE, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_profiler_item_method_entry) { PHP_ME(Phalcon_Db_Profiler_Item, setSqlStatement, arginfo_phalcon_db_profiler_item_setsqlstatement, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler_Item, getSqlStatement, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler_Item, getSqlStatement, arginfo_phalcon_db_profiler_item_getsqlstatement, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Profiler_Item, setSqlVariables, arginfo_phalcon_db_profiler_item_setsqlvariables, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler_Item, getSqlVariables, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler_Item, getSqlVariables, arginfo_phalcon_db_profiler_item_getsqlvariables, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Profiler_Item, setSqlBindTypes, arginfo_phalcon_db_profiler_item_setsqlbindtypes, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler_Item, getSqlBindTypes, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler_Item, getSqlBindTypes, arginfo_phalcon_db_profiler_item_getsqlbindtypes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Profiler_Item, setInitialTime, arginfo_phalcon_db_profiler_item_setinitialtime, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler_Item, getInitialTime, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler_Item, getInitialTime, arginfo_phalcon_db_profiler_item_getinitialtime, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Profiler_Item, setFinalTime, arginfo_phalcon_db_profiler_item_setfinaltime, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler_Item, getFinalTime, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Profiler_Item, getTotalElapsedSeconds, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler_Item, getFinalTime, arginfo_phalcon_db_profiler_item_getfinaltime, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Profiler_Item, getTotalElapsedSeconds, arginfo_phalcon_db_profiler_item_gettotalelapsedseconds, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/rawvalue.zep.c b/ext/phalcon/db/rawvalue.zep.c index 619aecc51f0..753a33f518d 100644 --- a/ext/phalcon/db/rawvalue.zep.c +++ b/ext/phalcon/db/rawvalue.zep.c @@ -53,7 +53,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_RawValue) { */ PHP_METHOD(Phalcon_Db_RawValue, getValue) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_value"); @@ -64,7 +65,8 @@ PHP_METHOD(Phalcon_Db_RawValue, getValue) { */ PHP_METHOD(Phalcon_Db_RawValue, __toString) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_value"); @@ -75,9 +77,15 @@ PHP_METHOD(Phalcon_Db_RawValue, __toString) { */ PHP_METHOD(Phalcon_Db_RawValue, __construct) { - zval *_3 = NULL; + zval _3; zend_bool _0; - zval *value, *_1$$3, *_2$$4; + zval *value, value_sub, _1$$3, _2$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &value); @@ -89,19 +97,21 @@ PHP_METHOD(Phalcon_Db_RawValue, __construct) { _0 = ZEPHIR_IS_STRING(value, ""); } if (_0) { - ZEPHIR_INIT_ZVAL_NREF(_1$$3); - ZVAL_STRING(_1$$3, "''", 1); - zephir_update_property_this(getThis(), SL("_value"), _1$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_INIT_NVAR(&_1$$3); + ZVAL_STRING(&_1$$3, "''"); + zephir_update_property_zval(this_ptr, SL("_value"), &_1$$3); RETURN_MM_NULL(); } if (Z_TYPE_P(value) == IS_NULL) { - ZEPHIR_INIT_ZVAL_NREF(_2$$4); - ZVAL_STRING(_2$$4, "NULL", 1); - zephir_update_property_this(getThis(), SL("_value"), _2$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$4); + ZEPHIR_INIT_NVAR(&_2$$4); + ZVAL_STRING(&_2$$4, "NULL"); + zephir_update_property_zval(this_ptr, SL("_value"), &_2$$4); RETURN_MM_NULL(); } - zephir_get_strval(_3, value); - zephir_update_property_this(getThis(), SL("_value"), _3 TSRMLS_CC); + zephir_get_strval(&_3, value); + zephir_update_property_zval(this_ptr, SL("_value"), &_3); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/db/rawvalue.zep.h b/ext/phalcon/db/rawvalue.zep.h index bccd6437687..50c7aa8e711 100644 --- a/ext/phalcon/db/rawvalue.zep.h +++ b/ext/phalcon/db/rawvalue.zep.h @@ -7,13 +7,27 @@ PHP_METHOD(Phalcon_Db_RawValue, getValue); PHP_METHOD(Phalcon_Db_RawValue, __toString); PHP_METHOD(Phalcon_Db_RawValue, __construct); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_rawvalue_getvalue, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_rawvalue_getvalue, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_rawvalue___tostring, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_rawvalue___tostring, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_rawvalue___construct, 0, 0, 1) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_rawvalue_method_entry) { - PHP_ME(Phalcon_Db_RawValue, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_RawValue, __toString, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_RawValue, getValue, arginfo_phalcon_db_rawvalue_getvalue, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_RawValue, __toString, arginfo_phalcon_db_rawvalue___tostring, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_RawValue, __construct, arginfo_phalcon_db_rawvalue___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_FE_END }; diff --git a/ext/phalcon/db/reference.zep.c b/ext/phalcon/db/reference.zep.c index 387c0ad7322..197a336a418 100644 --- a/ext/phalcon/db/reference.zep.c +++ b/ext/phalcon/db/reference.zep.c @@ -104,7 +104,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Reference) { */ PHP_METHOD(Phalcon_Db_Reference, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -112,7 +113,8 @@ PHP_METHOD(Phalcon_Db_Reference, getName) { PHP_METHOD(Phalcon_Db_Reference, getSchemaName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_schemaName"); @@ -120,7 +122,8 @@ PHP_METHOD(Phalcon_Db_Reference, getSchemaName) { PHP_METHOD(Phalcon_Db_Reference, getReferencedSchema) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_referencedSchema"); @@ -131,7 +134,8 @@ PHP_METHOD(Phalcon_Db_Reference, getReferencedSchema) { */ PHP_METHOD(Phalcon_Db_Reference, getReferencedTable) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_referencedTable"); @@ -142,7 +146,8 @@ PHP_METHOD(Phalcon_Db_Reference, getReferencedTable) { */ PHP_METHOD(Phalcon_Db_Reference, getColumns) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_columns"); @@ -153,7 +158,8 @@ PHP_METHOD(Phalcon_Db_Reference, getColumns) { */ PHP_METHOD(Phalcon_Db_Reference, getReferencedColumns) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_referencedColumns"); @@ -164,7 +170,8 @@ PHP_METHOD(Phalcon_Db_Reference, getReferencedColumns) { */ PHP_METHOD(Phalcon_Db_Reference, getOnDelete) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_onDelete"); @@ -175,7 +182,8 @@ PHP_METHOD(Phalcon_Db_Reference, getOnDelete) { */ PHP_METHOD(Phalcon_Db_Reference, getOnUpdate) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_onUpdate"); @@ -186,65 +194,76 @@ PHP_METHOD(Phalcon_Db_Reference, getOnUpdate) { */ PHP_METHOD(Phalcon_Db_Reference, __construct) { - zval *definition = NULL; - zval *name_param = NULL, *definition_param = NULL, *columns = NULL, *schema = NULL, *referencedTable = NULL, *referencedSchema = NULL, *referencedColumns = NULL, *onDelete = NULL, *onUpdate = NULL; - zval *name = NULL; + zval definition; + zval *name_param = NULL, *definition_param = NULL, columns, schema, referencedTable, referencedSchema, referencedColumns, onDelete, onUpdate; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&referencedTable); + ZVAL_UNDEF(&referencedSchema); + ZVAL_UNDEF(&referencedColumns); + ZVAL_UNDEF(&onDelete); + ZVAL_UNDEF(&onUpdate); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &definition_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); - ZEPHIR_OBS_VAR(referencedTable); - if (zephir_array_isset_string_fetch(&referencedTable, definition, SS("referencedTable"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_referencedTable"), referencedTable TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); + ZEPHIR_OBS_VAR(&referencedTable); + if (zephir_array_isset_string_fetch(&referencedTable, &definition, SL("referencedTable"), 0)) { + zephir_update_property_zval(this_ptr, SL("_referencedTable"), &referencedTable); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Referenced table is required", "phalcon/db/reference.zep", 108); return; } - ZEPHIR_OBS_VAR(columns); - if (zephir_array_isset_string_fetch(&columns, definition, SS("columns"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_columns"), columns TSRMLS_CC); + ZEPHIR_OBS_VAR(&columns); + if (zephir_array_isset_string_fetch(&columns, &definition, SL("columns"), 0)) { + zephir_update_property_zval(this_ptr, SL("_columns"), &columns); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Foreign key columns are required", "phalcon/db/reference.zep", 114); return; } - ZEPHIR_OBS_VAR(referencedColumns); - if (zephir_array_isset_string_fetch(&referencedColumns, definition, SS("referencedColumns"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_referencedColumns"), referencedColumns TSRMLS_CC); + ZEPHIR_OBS_VAR(&referencedColumns); + if (zephir_array_isset_string_fetch(&referencedColumns, &definition, SL("referencedColumns"), 0)) { + zephir_update_property_zval(this_ptr, SL("_referencedColumns"), &referencedColumns); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Referenced columns of the foreign key are required", "phalcon/db/reference.zep", 120); return; } - ZEPHIR_OBS_VAR(schema); - if (zephir_array_isset_string_fetch(&schema, definition, SS("schema"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_schemaName"), schema TSRMLS_CC); + ZEPHIR_OBS_VAR(&schema); + if (zephir_array_isset_string_fetch(&schema, &definition, SL("schema"), 0)) { + zephir_update_property_zval(this_ptr, SL("_schemaName"), &schema); } - ZEPHIR_OBS_VAR(referencedSchema); - if (zephir_array_isset_string_fetch(&referencedSchema, definition, SS("referencedSchema"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_referencedSchema"), referencedSchema TSRMLS_CC); + ZEPHIR_OBS_VAR(&referencedSchema); + if (zephir_array_isset_string_fetch(&referencedSchema, &definition, SL("referencedSchema"), 0)) { + zephir_update_property_zval(this_ptr, SL("_referencedSchema"), &referencedSchema); } - ZEPHIR_OBS_VAR(onDelete); - if (zephir_array_isset_string_fetch(&onDelete, definition, SS("onDelete"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_onDelete"), onDelete TSRMLS_CC); + ZEPHIR_OBS_VAR(&onDelete); + if (zephir_array_isset_string_fetch(&onDelete, &definition, SL("onDelete"), 0)) { + zephir_update_property_zval(this_ptr, SL("_onDelete"), &onDelete); } - ZEPHIR_OBS_VAR(onUpdate); - if (zephir_array_isset_string_fetch(&onUpdate, definition, SS("onUpdate"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_onUpdate"), onUpdate TSRMLS_CC); + ZEPHIR_OBS_VAR(&onUpdate); + if (zephir_array_isset_string_fetch(&onUpdate, &definition, SL("onUpdate"), 0)) { + zephir_update_property_zval(this_ptr, SL("_onUpdate"), &onUpdate); } - if (zephir_fast_count_int(columns TSRMLS_CC) != zephir_fast_count_int(referencedColumns TSRMLS_CC)) { + if (zephir_fast_count_int(&columns TSRMLS_CC) != zephir_fast_count_int(&referencedColumns TSRMLS_CC)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "Number of columns is not equals than the number of columns referenced", "phalcon/db/reference.zep", 140); return; } @@ -258,39 +277,50 @@ PHP_METHOD(Phalcon_Db_Reference, __construct) { PHP_METHOD(Phalcon_Db_Reference, __set_state) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *referencedSchema = NULL, *referencedTable = NULL, *columns = NULL, *referencedColumns = NULL, *constraintName = NULL, *onDelete = NULL, *onUpdate = NULL; - zval *data = NULL, *_0; + zval *data_param = NULL, referencedSchema, referencedTable, columns, referencedColumns, constraintName, onDelete, onUpdate; + zval data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&referencedSchema); + ZVAL_UNDEF(&referencedTable); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&referencedColumns); + ZVAL_UNDEF(&constraintName); + ZVAL_UNDEF(&onDelete); + ZVAL_UNDEF(&onUpdate); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data_param); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); - ZEPHIR_OBS_VAR(constraintName); - if (!(zephir_array_isset_string_fetch(&constraintName, data, SS("_referenceName"), 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(constraintName); - if (!(zephir_array_isset_string_fetch(&constraintName, data, SS("_name"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&constraintName); + if (!(zephir_array_isset_string_fetch(&constraintName, &data, SL("_referenceName"), 0))) { + ZEPHIR_OBS_NVAR(&constraintName); + if (!(zephir_array_isset_string_fetch(&constraintName, &data, SL("_name"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_db_exception_ce, "_name parameter is required", "phalcon/db/reference.zep", 155); return; } } - zephir_array_isset_string_fetch(&referencedSchema, data, SS("_referencedSchema"), 1 TSRMLS_CC); - zephir_array_isset_string_fetch(&referencedTable, data, SS("_referencedTable"), 1 TSRMLS_CC); - zephir_array_isset_string_fetch(&columns, data, SS("_columns"), 1 TSRMLS_CC); - zephir_array_isset_string_fetch(&referencedColumns, data, SS("_referencedColumns"), 1 TSRMLS_CC); - zephir_array_isset_string_fetch(&onDelete, data, SS("_onDelete"), 1 TSRMLS_CC); - zephir_array_isset_string_fetch(&onUpdate, data, SS("_onUpdate"), 1 TSRMLS_CC); + zephir_array_isset_string_fetch(&referencedSchema, &data, SL("_referencedSchema"), 1); + zephir_array_isset_string_fetch(&referencedTable, &data, SL("_referencedTable"), 1); + zephir_array_isset_string_fetch(&columns, &data, SL("_columns"), 1); + zephir_array_isset_string_fetch(&referencedColumns, &data, SL("_referencedColumns"), 1); + zephir_array_isset_string_fetch(&onDelete, &data, SL("_onDelete"), 1); + zephir_array_isset_string_fetch(&onUpdate, &data, SL("_onUpdate"), 1); object_init_ex(return_value, phalcon_db_reference_ce); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 6, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 6, 0 TSRMLS_CC); zephir_array_update_string(&_0, SL("referencedSchema"), &referencedSchema, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_0, SL("referencedTable"), &referencedTable, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_0, SL("columns"), &columns, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_0, SL("referencedColumns"), &referencedColumns, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_0, SL("onDelete"), &onDelete, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_0, SL("onUpdate"), &onUpdate, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 25, constraintName, _0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 20, &constraintName, &_0); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/db/reference.zep.h b/ext/phalcon/db/reference.zep.h index 569e7dbf06b..f1b8c735d5c 100644 --- a/ext/phalcon/db/reference.zep.h +++ b/ext/phalcon/db/reference.zep.h @@ -14,24 +14,74 @@ PHP_METHOD(Phalcon_Db_Reference, getOnUpdate); PHP_METHOD(Phalcon_Db_Reference, __construct); PHP_METHOD(Phalcon_Db_Reference, __set_state); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getreferencedtable, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getreferencedtable, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getcolumns, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getcolumns, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getreferencedcolumns, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getreferencedcolumns, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getondelete, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getondelete, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getonupdate, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference_getonupdate, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_reference___construct, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_ARRAY_INFO(0, definition, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_reference___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_reference___set_state, 0, 1, Phalcon\\Db\\ReferenceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_reference___set_state, 0, 1, IS_OBJECT, "Phalcon\\Db\\ReferenceInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_db_reference_method_entry) { - PHP_ME(Phalcon_Db_Reference, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Reference, getName, arginfo_phalcon_db_reference_getname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Reference, getSchemaName, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Reference, getReferencedSchema, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Reference, getReferencedTable, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Reference, getColumns, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Reference, getReferencedColumns, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Reference, getOnDelete, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Reference, getOnUpdate, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Reference, getReferencedTable, arginfo_phalcon_db_reference_getreferencedtable, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Reference, getColumns, arginfo_phalcon_db_reference_getcolumns, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Reference, getReferencedColumns, arginfo_phalcon_db_reference_getreferencedcolumns, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Reference, getOnDelete, arginfo_phalcon_db_reference_getondelete, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Reference, getOnUpdate, arginfo_phalcon_db_reference_getonupdate, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Reference, __construct, arginfo_phalcon_db_reference___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Db_Reference, __set_state, arginfo_phalcon_db_reference___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END diff --git a/ext/phalcon/db/referenceinterface.zep.h b/ext/phalcon/db/referenceinterface.zep.h index 4f2b9fc7d78..488a476b27d 100644 --- a/ext/phalcon/db/referenceinterface.zep.h +++ b/ext/phalcon/db/referenceinterface.zep.h @@ -3,7 +3,11 @@ extern zend_class_entry *phalcon_db_referenceinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Db_ReferenceInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_referenceinterface___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_referenceinterface___set_state, 0, 1, Phalcon\\Db\\ReferenceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_referenceinterface___set_state, 0, 1, IS_OBJECT, "Phalcon\\Db\\ReferenceInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/db/result/pdo.zep.c b/ext/phalcon/db/result/pdo.zep.c index 22aa49d5dc8..07edb80748c 100644 --- a/ext/phalcon/db/result/pdo.zep.c +++ b/ext/phalcon/db/result/pdo.zep.c @@ -85,31 +85,42 @@ ZEPHIR_INIT_CLASS(Phalcon_Db_Result_Pdo) { */ PHP_METHOD(Phalcon_Db_Result_Pdo, __construct) { - zval *connection, *result, *sqlStatement = NULL, *bindParams = NULL, *bindTypes = NULL; + zval *connection, connection_sub, *result, result_sub, *sqlStatement = NULL, sqlStatement_sub, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&connection_sub); + ZVAL_UNDEF(&result_sub); + ZVAL_UNDEF(&sqlStatement_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 2, 3, &connection, &result, &sqlStatement, &bindParams, &bindTypes); if (!sqlStatement) { - sqlStatement = ZEPHIR_GLOBAL(global_null); + sqlStatement = &sqlStatement_sub; + sqlStatement = &__$null; } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - zephir_update_property_this(getThis(), SL("_connection"), connection TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_pdoStatement"), result TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_connection"), connection); + zephir_update_property_zval(this_ptr, SL("_pdoStatement"), result); if (Z_TYPE_P(sqlStatement) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_sqlStatement"), sqlStatement TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sqlStatement"), sqlStatement); } if (Z_TYPE_P(bindParams) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_bindParams"), bindParams TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindParams"), bindParams); } if (Z_TYPE_P(bindTypes) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_bindTypes"), bindTypes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindTypes"), bindTypes); } } @@ -120,13 +131,16 @@ PHP_METHOD(Phalcon_Db_Result_Pdo, __construct) { */ PHP_METHOD(Phalcon_Db_Result_Pdo, execute) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pdoStatement"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "execute", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_pdoStatement"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "execute", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -151,24 +165,34 @@ PHP_METHOD(Phalcon_Db_Result_Pdo, execute) { PHP_METHOD(Phalcon_Db_Result_Pdo, fetch) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fetchStyle = NULL, *cursorOrientation = NULL, *cursorOffset = NULL, *_0; + zval *fetchStyle = NULL, fetchStyle_sub, *cursorOrientation = NULL, cursorOrientation_sub, *cursorOffset = NULL, cursorOffset_sub, __$null, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&fetchStyle_sub); + ZVAL_UNDEF(&cursorOrientation_sub); + ZVAL_UNDEF(&cursorOffset_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &fetchStyle, &cursorOrientation, &cursorOffset); if (!fetchStyle) { - fetchStyle = ZEPHIR_GLOBAL(global_null); + fetchStyle = &fetchStyle_sub; + fetchStyle = &__$null; } if (!cursorOrientation) { - cursorOrientation = ZEPHIR_GLOBAL(global_null); + cursorOrientation = &cursorOrientation_sub; + cursorOrientation = &__$null; } if (!cursorOffset) { - cursorOffset = ZEPHIR_GLOBAL(global_null); + cursorOffset = &cursorOffset_sub; + cursorOffset = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pdoStatement"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "fetch", NULL, 0, fetchStyle, cursorOrientation, cursorOffset); + zephir_read_property(&_0, this_ptr, SL("_pdoStatement"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0, fetchStyle, cursorOrientation, cursorOffset); zephir_check_call_status(); RETURN_MM(); @@ -192,13 +216,16 @@ PHP_METHOD(Phalcon_Db_Result_Pdo, fetch) { */ PHP_METHOD(Phalcon_Db_Result_Pdo, fetchArray) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pdoStatement"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "fetch", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_pdoStatement"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "fetch", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -219,45 +246,55 @@ PHP_METHOD(Phalcon_Db_Result_Pdo, fetchArray) { PHP_METHOD(Phalcon_Db_Result_Pdo, fetchAll) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fetchStyle = NULL, *fetchArgument = NULL, *ctorArgs = NULL, *pdoStatement = NULL; + zval *fetchStyle = NULL, fetchStyle_sub, *fetchArgument = NULL, fetchArgument_sub, *ctorArgs = NULL, ctorArgs_sub, __$null, pdoStatement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&fetchStyle_sub); + ZVAL_UNDEF(&fetchArgument_sub); + ZVAL_UNDEF(&ctorArgs_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&pdoStatement); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &fetchStyle, &fetchArgument, &ctorArgs); if (!fetchStyle) { - fetchStyle = ZEPHIR_GLOBAL(global_null); + fetchStyle = &fetchStyle_sub; + fetchStyle = &__$null; } if (!fetchArgument) { - fetchArgument = ZEPHIR_GLOBAL(global_null); + fetchArgument = &fetchArgument_sub; + fetchArgument = &__$null; } if (!ctorArgs) { - ctorArgs = ZEPHIR_GLOBAL(global_null); + ctorArgs = &ctorArgs_sub; + ctorArgs = &__$null; } - ZEPHIR_OBS_VAR(pdoStatement); - zephir_read_property_this(&pdoStatement, this_ptr, SL("_pdoStatement"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&pdoStatement); + zephir_read_property(&pdoStatement, this_ptr, SL("_pdoStatement"), PH_NOISY_CC); if (Z_TYPE_P(fetchStyle) == IS_LONG) { if (ZEPHIR_IS_LONG(fetchStyle, 8)) { - ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument, ctorArgs); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument, ctorArgs); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_LONG(fetchStyle, 7)) { - ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument); zephir_check_call_status(); RETURN_MM(); } if (ZEPHIR_IS_LONG(fetchStyle, 10)) { - ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle, fetchArgument); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0, fetchStyle); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0, fetchStyle); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(pdoStatement, "fetchall", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&pdoStatement, "fetchall", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -277,59 +314,78 @@ PHP_METHOD(Phalcon_Db_Result_Pdo, fetchAll) { PHP_METHOD(Phalcon_Db_Result_Pdo, numRows) { zend_bool _0$$3; - zval *sqlStatement = NULL, *rowCount = NULL, *connection = NULL, *type = NULL, *pdoStatement = NULL, *matches = NULL, *result = NULL, *row = NULL, *_1$$6, _2$$6, *_3$$7, *_4$$7, *_5$$7, *_6$$7; + zval sqlStatement, rowCount, connection, type, pdoStatement, matches, result, row, _1$$6, _2$$6, _3$$6, _4$$7, _5$$7, _6$$7, _7$$7; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sqlStatement); + ZVAL_UNDEF(&rowCount); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&pdoStatement); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&row); + ZVAL_UNDEF(&_1$$6); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$7); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(rowCount); - zephir_read_property_this(&rowCount, this_ptr, SL("_rowCount"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(rowCount)) { - ZEPHIR_OBS_VAR(connection); - zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&type, connection, "gettype", NULL, 0); + ZEPHIR_OBS_VAR(&rowCount); + zephir_read_property(&rowCount, this_ptr, SL("_rowCount"), PH_NOISY_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&rowCount)) { + ZEPHIR_OBS_VAR(&connection); + zephir_read_property(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&type, &connection, "gettype", NULL, 0); zephir_check_call_status(); - _0$$3 = ZEPHIR_IS_STRING(type, "mysql"); + _0$$3 = ZEPHIR_IS_STRING(&type, "mysql"); if (!(_0$$3)) { - _0$$3 = ZEPHIR_IS_STRING(type, "pgsql"); + _0$$3 = ZEPHIR_IS_STRING(&type, "pgsql"); } if (_0$$3) { - ZEPHIR_OBS_VAR(pdoStatement); - zephir_read_property_this(&pdoStatement, this_ptr, SL("_pdoStatement"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&rowCount, pdoStatement, "rowcount", NULL, 0); + ZEPHIR_OBS_VAR(&pdoStatement); + zephir_read_property(&pdoStatement, this_ptr, SL("_pdoStatement"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&rowCount, &pdoStatement, "rowcount", NULL, 0); zephir_check_call_status(); } - if (ZEPHIR_IS_FALSE_IDENTICAL(rowCount)) { - ZEPHIR_OBS_VAR(sqlStatement); - zephir_read_property_this(&sqlStatement, this_ptr, SL("_sqlStatement"), PH_NOISY_CC); - if (!(zephir_start_with_str(sqlStatement, SL("SELECT COUNT(*) ")))) { - ZEPHIR_INIT_VAR(matches); - ZVAL_NULL(matches); - ZEPHIR_INIT_VAR(_1$$6); - ZEPHIR_SINIT_VAR(_2$$6); - ZVAL_STRING(&_2$$6, "/^SELECT\\s+(.*)/i", 0); - zephir_preg_match(_1$$6, &_2$$6, sqlStatement, matches, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(_1$$6)) { - zephir_array_fetch_long(&_3$$7, matches, 1, PH_NOISY | PH_READONLY, "phalcon/db/result/pdo.zep", 238 TSRMLS_CC); - ZEPHIR_INIT_VAR(_4$$7); - ZEPHIR_CONCAT_SVS(_4$$7, "SELECT COUNT(*) \"numrows\" FROM (SELECT ", _3$$7, ")"); - _5$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_bindParams"), PH_NOISY_CC); - _6$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_bindTypes"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&result, connection, "query", NULL, 0, _4$$7, _5$$7, _6$$7); + if (ZEPHIR_IS_FALSE_IDENTICAL(&rowCount)) { + ZEPHIR_OBS_VAR(&sqlStatement); + zephir_read_property(&sqlStatement, this_ptr, SL("_sqlStatement"), PH_NOISY_CC); + if (!(zephir_start_with_str(&sqlStatement, SL("SELECT COUNT(*) ")))) { + ZEPHIR_INIT_VAR(&matches); + ZVAL_NULL(&matches); + ZEPHIR_INIT_VAR(&_1$$6); + ZVAL_STRING(&_1$$6, "/^SELECT\\s+(.*)/i"); + ZEPHIR_INIT_VAR(&_2$$6); + ZEPHIR_INIT_VAR(&_3$$6); + ZVAL_STRING(&_3$$6, "/^SELECT\\s+(.*)/i"); + zephir_preg_match(&_2$$6, &_3$$6, &sqlStatement, &matches, 0, 0 , 0 TSRMLS_CC); + if (zephir_is_true(&_2$$6)) { + zephir_array_fetch_long(&_4$$7, &matches, 1, PH_NOISY | PH_READONLY, "phalcon/db/result/pdo.zep", 238 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$7); + ZEPHIR_CONCAT_SVS(&_5$$7, "SELECT COUNT(*) \"numrows\" FROM (SELECT ", &_4$$7, ")"); + zephir_read_property(&_6$$7, this_ptr, SL("_bindParams"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_7$$7, this_ptr, SL("_bindTypes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&result, &connection, "query", NULL, 0, &_5$$7, &_6$$7, &_7$$7); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&row, result, "fetch", NULL, 0); + ZEPHIR_CALL_METHOD(&row, &result, "fetch", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(rowCount); - zephir_array_fetch_string(&rowCount, row, SL("numrows"), PH_NOISY, "phalcon/db/result/pdo.zep", 244 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&rowCount); + zephir_array_fetch_string(&rowCount, &row, SL("numrows"), PH_NOISY, "phalcon/db/result/pdo.zep", 244 TSRMLS_CC); } } else { - ZEPHIR_INIT_NVAR(rowCount); - ZVAL_LONG(rowCount, 1); + ZEPHIR_INIT_NVAR(&rowCount); + ZVAL_LONG(&rowCount, 1); } } - zephir_update_property_this(getThis(), SL("_rowCount"), rowCount TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rowCount"), &rowCount); } - RETURN_CCTOR(rowCount); + RETURN_CCTOR(&rowCount); } @@ -352,8 +408,17 @@ PHP_METHOD(Phalcon_Db_Result_Pdo, dataSeek) { zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *number_param = NULL, *connection = NULL, *pdo = NULL, *sqlStatement = NULL, *bindParams = NULL, *statement = NULL, *_0$$4 = NULL, *_1$$4; + zval *number_param = NULL, connection, pdo, sqlStatement, bindParams, statement, _0$$4, _1$$4; long number, n = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&pdo); + ZVAL_UNDEF(&sqlStatement); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &number_param); @@ -361,35 +426,35 @@ PHP_METHOD(Phalcon_Db_Result_Pdo, dataSeek) { number = zephir_get_intval(number_param); - ZEPHIR_OBS_VAR(connection); - zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&pdo, connection, "getinternalhandler", NULL, 0); + ZEPHIR_OBS_VAR(&connection); + zephir_read_property(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&pdo, &connection, "getinternalhandler", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(sqlStatement); - zephir_read_property_this(&sqlStatement, this_ptr, SL("_sqlStatement"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(bindParams); - zephir_read_property_this(&bindParams, this_ptr, SL("_bindParams"), PH_NOISY_CC); - if (Z_TYPE_P(bindParams) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&statement, pdo, "prepare", NULL, 0, sqlStatement); + ZEPHIR_OBS_VAR(&sqlStatement); + zephir_read_property(&sqlStatement, this_ptr, SL("_sqlStatement"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&bindParams); + zephir_read_property(&bindParams, this_ptr, SL("_bindParams"), PH_NOISY_CC); + if (Z_TYPE_P(&bindParams) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(&statement, &pdo, "prepare", NULL, 0, &sqlStatement); zephir_check_call_status(); - if (Z_TYPE_P(statement) == IS_OBJECT) { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_bindTypes"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0$$4, connection, "executeprepared", NULL, 0, statement, bindParams, _1$$4); + if (Z_TYPE_P(&statement) == IS_OBJECT) { + zephir_read_property(&_1$$4, this_ptr, SL("_bindTypes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_0$$4, &connection, "executeprepared", NULL, 0, &statement, &bindParams, &_1$$4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(statement, _0$$4); + ZEPHIR_CPY_WRT(&statement, &_0$$4); } } else { - ZEPHIR_CALL_METHOD(&statement, pdo, "query", NULL, 0, sqlStatement); + ZEPHIR_CALL_METHOD(&statement, &pdo, "query", NULL, 0, &sqlStatement); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_pdoStatement"), statement TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_pdoStatement"), &statement); n = -1; number--; while (1) { if (!(n != number)) { break; } - ZEPHIR_CALL_METHOD(NULL, statement, "fetch", &_2, 0); + ZEPHIR_CALL_METHOD(NULL, &statement, "fetch", &_2, 0); zephir_check_call_status(); n++; } @@ -424,70 +489,86 @@ PHP_METHOD(Phalcon_Db_Result_Pdo, dataSeek) { */ PHP_METHOD(Phalcon_Db_Result_Pdo, setFetchMode) { - zval *fetchMode_param = NULL, *colNoOrClassNameOrObject = NULL, *ctorargs = NULL, *pdoStatement = NULL, *_9 = NULL, *_10, *_0$$3 = NULL, *_1$$3, *_2$$4, *_3$$5 = NULL, *_4$$5, *_5$$6, *_6$$7 = NULL, *_7$$7, *_8$$8, *_11$$9; + zval *fetchMode_param = NULL, *colNoOrClassNameOrObject = NULL, colNoOrClassNameOrObject_sub, *ctorargs = NULL, ctorargs_sub, __$null, pdoStatement, _9, _10, _0$$3, _1$$3, _2$$4, _3$$5, _4$$5, _5$$6, _6$$7, _7$$7, _8$$8, _11$$9; zend_long fetchMode, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&colNoOrClassNameOrObject_sub); + ZVAL_UNDEF(&ctorargs_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&pdoStatement); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_11$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &fetchMode_param, &colNoOrClassNameOrObject, &ctorargs); fetchMode = zephir_get_intval(fetchMode_param); if (!colNoOrClassNameOrObject) { - colNoOrClassNameOrObject = ZEPHIR_GLOBAL(global_null); + colNoOrClassNameOrObject = &colNoOrClassNameOrObject_sub; + colNoOrClassNameOrObject = &__$null; } if (!ctorargs) { - ctorargs = ZEPHIR_GLOBAL(global_null); + ctorargs = &ctorargs_sub; + ctorargs = &__$null; } - ZEPHIR_OBS_VAR(pdoStatement); - zephir_read_property_this(&pdoStatement, this_ptr, SL("_pdoStatement"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&pdoStatement); + zephir_read_property(&pdoStatement, this_ptr, SL("_pdoStatement"), PH_NOISY_CC); if (fetchMode == 8) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_LONG(_1$$3, fetchMode); - ZEPHIR_CALL_METHOD(&_0$$3, pdoStatement, "setfetchmode", NULL, 0, _1$$3, colNoOrClassNameOrObject, ctorargs); + ZVAL_LONG(&_1$$3, fetchMode); + ZEPHIR_CALL_METHOD(&_0$$3, &pdoStatement, "setfetchmode", NULL, 0, &_1$$3, colNoOrClassNameOrObject, ctorargs); zephir_check_call_status(); - if (zephir_is_true(_0$$3)) { + if (zephir_is_true(&_0$$3)) { ZEPHIR_INIT_ZVAL_NREF(_2$$4); - ZVAL_LONG(_2$$4, fetchMode); - zephir_update_property_this(getThis(), SL("_fetchMode"), _2$$4 TSRMLS_CC); + ZVAL_LONG(&_2$$4, fetchMode); + zephir_update_property_zval(this_ptr, SL("_fetchMode"), &_2$$4); RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); } if (fetchMode == 9) { - ZEPHIR_INIT_VAR(_4$$5); - ZVAL_LONG(_4$$5, fetchMode); - ZEPHIR_CALL_METHOD(&_3$$5, pdoStatement, "setfetchmode", NULL, 0, _4$$5, colNoOrClassNameOrObject); + ZVAL_LONG(&_4$$5, fetchMode); + ZEPHIR_CALL_METHOD(&_3$$5, &pdoStatement, "setfetchmode", NULL, 0, &_4$$5, colNoOrClassNameOrObject); zephir_check_call_status(); - if (zephir_is_true(_3$$5)) { + if (zephir_is_true(&_3$$5)) { ZEPHIR_INIT_ZVAL_NREF(_5$$6); - ZVAL_LONG(_5$$6, fetchMode); - zephir_update_property_this(getThis(), SL("_fetchMode"), _5$$6 TSRMLS_CC); + ZVAL_LONG(&_5$$6, fetchMode); + zephir_update_property_zval(this_ptr, SL("_fetchMode"), &_5$$6); RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); } if (fetchMode == 7) { - ZEPHIR_INIT_VAR(_7$$7); - ZVAL_LONG(_7$$7, fetchMode); - ZEPHIR_CALL_METHOD(&_6$$7, pdoStatement, "setfetchmode", NULL, 0, _7$$7, colNoOrClassNameOrObject); + ZVAL_LONG(&_7$$7, fetchMode); + ZEPHIR_CALL_METHOD(&_6$$7, &pdoStatement, "setfetchmode", NULL, 0, &_7$$7, colNoOrClassNameOrObject); zephir_check_call_status(); - if (zephir_is_true(_6$$7)) { + if (zephir_is_true(&_6$$7)) { ZEPHIR_INIT_ZVAL_NREF(_8$$8); - ZVAL_LONG(_8$$8, fetchMode); - zephir_update_property_this(getThis(), SL("_fetchMode"), _8$$8 TSRMLS_CC); + ZVAL_LONG(&_8$$8, fetchMode); + zephir_update_property_zval(this_ptr, SL("_fetchMode"), &_8$$8); RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(_10); - ZVAL_LONG(_10, fetchMode); - ZEPHIR_CALL_METHOD(&_9, pdoStatement, "setfetchmode", NULL, 0, _10); + ZVAL_LONG(&_10, fetchMode); + ZEPHIR_CALL_METHOD(&_9, &pdoStatement, "setfetchmode", NULL, 0, &_10); zephir_check_call_status(); - if (zephir_is_true(_9)) { + if (zephir_is_true(&_9)) { ZEPHIR_INIT_ZVAL_NREF(_11$$9); - ZVAL_LONG(_11$$9, fetchMode); - zephir_update_property_this(getThis(), SL("_fetchMode"), _11$$9 TSRMLS_CC); + ZVAL_LONG(&_11$$9, fetchMode); + zephir_update_property_zval(this_ptr, SL("_fetchMode"), &_11$$9); RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); @@ -499,7 +580,8 @@ PHP_METHOD(Phalcon_Db_Result_Pdo, setFetchMode) { */ PHP_METHOD(Phalcon_Db_Result_Pdo, getInternalResult) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_pdoStatement"); diff --git a/ext/phalcon/db/result/pdo.zep.h b/ext/phalcon/db/result/pdo.zep.h index a9a80853b4a..e3c1504b3da 100644 --- a/ext/phalcon/db/result/pdo.zep.h +++ b/ext/phalcon/db/result/pdo.zep.h @@ -21,37 +21,74 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_result_pdo___construct, 0, 0, 2) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdo_execute, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdo_execute, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_result_pdo_fetch, 0, 0, 0) ZEND_ARG_INFO(0, fetchStyle) ZEND_ARG_INFO(0, cursorOrientation) ZEND_ARG_INFO(0, cursorOffset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_result_pdo_fetchall, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdo_fetchall, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdo_fetchall, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, fetchStyle) ZEND_ARG_INFO(0, fetchArgument) ZEND_ARG_INFO(0, ctorArgs) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdo_numrows, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdo_numrows, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_result_pdo_dataseek, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, number, IS_LONG, 0) +#else ZEND_ARG_INFO(0, number) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_result_pdo_setfetchmode, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdo_setfetchmode, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdo_setfetchmode, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fetchMode, IS_LONG, 0) +#else ZEND_ARG_INFO(0, fetchMode) +#endif ZEND_ARG_INFO(0, colNoOrClassNameOrObject) ZEND_ARG_INFO(0, ctorargs) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_db_result_pdo_getinternalresult, 0, 0, PDOStatement, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_result_pdo_getinternalresult, 0, 0, IS_OBJECT, "PDOStatement", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_db_result_pdo_method_entry) { PHP_ME(Phalcon_Db_Result_Pdo, __construct, arginfo_phalcon_db_result_pdo___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Db_Result_Pdo, execute, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Result_Pdo, execute, arginfo_phalcon_db_result_pdo_execute, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Result_Pdo, fetch, arginfo_phalcon_db_result_pdo_fetch, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Result_Pdo, fetchArray, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Result_Pdo, fetchAll, arginfo_phalcon_db_result_pdo_fetchall, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Result_Pdo, numRows, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Result_Pdo, numRows, arginfo_phalcon_db_result_pdo_numrows, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Result_Pdo, dataSeek, arginfo_phalcon_db_result_pdo_dataseek, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Db_Result_Pdo, setFetchMode, arginfo_phalcon_db_result_pdo_setfetchmode, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Db_Result_Pdo, getInternalResult, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Db_Result_Pdo, getInternalResult, arginfo_phalcon_db_result_pdo_getinternalresult, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/db/resultinterface.zep.h b/ext/phalcon/db/resultinterface.zep.h index c0d2ed88100..5a83e3aed3f 100644 --- a/ext/phalcon/db/resultinterface.zep.h +++ b/ext/phalcon/db/resultinterface.zep.h @@ -4,11 +4,23 @@ extern zend_class_entry *phalcon_db_resultinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Db_ResultInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_resultinterface_dataseek, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, number, IS_LONG, 0) +#else ZEND_ARG_INFO(0, number) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_db_resultinterface_setfetchmode, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_resultinterface_setfetchmode, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_db_resultinterface_setfetchmode, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fetchMode, IS_LONG, 0) +#else ZEND_ARG_INFO(0, fetchMode) +#endif ZEND_ARG_INFO(0, colNoOrClassNameOrObject) ZEND_ARG_INFO(0, ctorargs) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/debug.zep.c b/ext/phalcon/debug.zep.c index 1170b558651..7924b4d5d46 100644 --- a/ext/phalcon/debug.zep.c +++ b/ext/phalcon/debug.zep.c @@ -59,24 +59,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Debug) { PHP_METHOD(Phalcon_Debug, setUri) { zval *uri_param = NULL; - zval *uri = NULL; + zval uri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uri); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &uri_param); if (UNEXPECTED(Z_TYPE_P(uri_param) != IS_STRING && Z_TYPE_P(uri_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) { - zephir_get_strval(uri, uri_param); + zephir_get_strval(&uri, uri_param); } else { - ZEPHIR_INIT_VAR(uri); - ZVAL_EMPTY_STRING(uri); + ZEPHIR_INIT_VAR(&uri); + ZVAL_EMPTY_STRING(&uri); } - zephir_update_property_this(getThis(), SL("_uri"), uri TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_uri"), &uri); RETURN_THIS(); } @@ -86,8 +89,12 @@ PHP_METHOD(Phalcon_Debug, setUri) { */ PHP_METHOD(Phalcon_Debug, setShowBackTrace) { - zval *showBackTrace_param = NULL; + zval *showBackTrace_param = NULL, __$true, __$false; zend_bool showBackTrace; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &showBackTrace_param); @@ -95,9 +102,9 @@ PHP_METHOD(Phalcon_Debug, setShowBackTrace) { if (showBackTrace) { - zephir_update_property_this(getThis(), SL("_showBackTrace"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_showBackTrace"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_showBackTrace"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_showBackTrace"), &__$false); } RETURN_THISW(); @@ -108,8 +115,12 @@ PHP_METHOD(Phalcon_Debug, setShowBackTrace) { */ PHP_METHOD(Phalcon_Debug, setShowFiles) { - zval *showFiles_param = NULL; + zval *showFiles_param = NULL, __$true, __$false; zend_bool showFiles; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &showFiles_param); @@ -117,9 +128,9 @@ PHP_METHOD(Phalcon_Debug, setShowFiles) { if (showFiles) { - zephir_update_property_this(getThis(), SL("_showFiles"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_showFiles"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_showFiles"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_showFiles"), &__$false); } RETURN_THISW(); @@ -131,8 +142,12 @@ PHP_METHOD(Phalcon_Debug, setShowFiles) { */ PHP_METHOD(Phalcon_Debug, setShowFileFragment) { - zval *showFileFragment_param = NULL; + zval *showFileFragment_param = NULL, __$true, __$false; zend_bool showFileFragment; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &showFileFragment_param); @@ -140,9 +155,9 @@ PHP_METHOD(Phalcon_Debug, setShowFileFragment) { if (showFileFragment) { - zephir_update_property_this(getThis(), SL("_showFileFragment"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_showFileFragment"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_showFileFragment"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_showFileFragment"), &__$false); } RETURN_THISW(); @@ -156,6 +171,8 @@ PHP_METHOD(Phalcon_Debug, listen) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *exceptions_param = NULL, *lowSeverity_param = NULL; zend_bool exceptions, lowSeverity; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &exceptions_param, &lowSeverity_param); @@ -189,19 +206,23 @@ PHP_METHOD(Phalcon_Debug, listen) { */ PHP_METHOD(Phalcon_Debug, listenExceptions) { - zval *_1; - zval *_0; + zval _1; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_0, this_ptr); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "onUncaughtException", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_CALL_FUNCTION(NULL, "set_exception_handler", NULL, 174, _0); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, this_ptr); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "onUncaughtException"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_CALL_FUNCTION(NULL, "set_exception_handler", NULL, 154, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -212,27 +233,32 @@ PHP_METHOD(Phalcon_Debug, listenExceptions) { */ PHP_METHOD(Phalcon_Debug, listenLowSeverity) { - zval *_1 = NULL; - zval *_0, *_2; + zval _1; + zval _0, _2; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_0, this_ptr); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "onUncaughtLowSeverity", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 175, _0); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, this_ptr); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "onUncaughtLowSeverity"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_CALL_FUNCTION(NULL, "set_error_handler", NULL, 155, &_0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - zephir_create_array(_2, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_2, this_ptr); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "onUncaughtException", 1); - zephir_array_fast_append(_2, _1); - ZEPHIR_CALL_FUNCTION(NULL, "set_exception_handler", NULL, 174, _2); + ZEPHIR_INIT_VAR(&_2); + zephir_create_array(&_2, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_2, this_ptr); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "onUncaughtException"); + zephir_array_fast_append(&_2, &_1); + ZEPHIR_CALL_FUNCTION(NULL, "set_exception_handler", NULL, 154, &_2); zephir_check_call_status(); RETURN_THIS(); @@ -243,7 +269,8 @@ PHP_METHOD(Phalcon_Debug, listenLowSeverity) { */ PHP_METHOD(Phalcon_Debug, halt) { - + zval *this_ptr = getThis(); + ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_exception_ce, "Halted request", "phalcon/debug.zep", 120); return; @@ -255,32 +282,39 @@ PHP_METHOD(Phalcon_Debug, halt) { */ PHP_METHOD(Phalcon_Debug, debugVar) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key = NULL; - zval *varz, *key_param = NULL, *_1 = NULL, *_2; + zval key; + zval *varz, varz_sub, *key_param = NULL, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&varz_sub); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &varz, &key_param); if (!key_param) { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_STRING(&key, ""); } else { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 3, 0 TSRMLS_CC); - zephir_array_fast_append(_0, varz); - ZEPHIR_CALL_FUNCTION(&_1, "debug_backtrace", NULL, 176); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, varz); + ZEPHIR_CALL_FUNCTION(&_1, "debug_backtrace", NULL, 156); zephir_check_call_status(); - zephir_array_fast_append(_0, _1); - ZEPHIR_INIT_VAR(_2); - zephir_time(_2); - zephir_array_fast_append(_0, _2); - zephir_update_property_array_append(this_ptr, SL("_data"), _0 TSRMLS_CC); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_INIT_VAR(&_2); + zephir_time(&_2); + zephir_array_fast_append(&_0, &_2); + zephir_update_property_array_append(this_ptr, SL("_data"), &_0 TSRMLS_CC); RETURN_THIS(); } @@ -290,9 +324,13 @@ PHP_METHOD(Phalcon_Debug, debugVar) { */ PHP_METHOD(Phalcon_Debug, clearVars) { - + zval __$null; + zval *this_ptr = getThis(); - zephir_update_property_this(getThis(), SL("_data"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + ZVAL_NULL(&__$null); + + + zephir_update_property_zval(this_ptr, SL("_data"), &__$null); RETURN_THISW(); } @@ -303,7 +341,15 @@ PHP_METHOD(Phalcon_Debug, clearVars) { PHP_METHOD(Phalcon_Debug, _escapeString) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *value, *_0$$3, _1$$3, _2$$3, _3$$3, _4$$3; + zval *value, value_sub, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &value); @@ -311,17 +357,16 @@ PHP_METHOD(Phalcon_Debug, _escapeString) { if (Z_TYPE_P(value) == IS_STRING) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_SINIT_VAR(_1$$3); - ZVAL_STRING(&_1$$3, "\n", 0); - ZEPHIR_SINIT_VAR(_2$$3); - ZVAL_STRING(&_2$$3, "\\n", 0); + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "\n"); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "\\n"); zephir_fast_str_replace(&_0$$3, &_1$$3, &_2$$3, value TSRMLS_CC); - ZEPHIR_SINIT_VAR(_3$$3); ZVAL_LONG(&_3$$3, 2); - ZEPHIR_SINIT_VAR(_4$$3); - ZVAL_STRING(&_4$$3, "utf-8", 0); - ZEPHIR_RETURN_CALL_FUNCTION("htmlentities", NULL, 177, _0$$3, &_3$$3, &_4$$3); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "utf-8"); + ZEPHIR_RETURN_CALL_FUNCTION("htmlentities", NULL, 157, &_0$$3, &_3$$3, &_4$$3); zephir_check_call_status(); RETURN_MM(); } @@ -335,74 +380,93 @@ PHP_METHOD(Phalcon_Debug, _escapeString) { */ PHP_METHOD(Phalcon_Debug, _getArrayDump) { - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zend_bool _0; zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *argument_param = NULL, *n = NULL, *numberArguments = NULL, *dump = NULL, *varDump = NULL, *k = NULL, *v = NULL, **_3, *_5$$8 = NULL, *_6$$8 = NULL, *_8$$9 = NULL, *_9$$5 = NULL; - zval *argument = NULL; + zval *argument_param = NULL, *n = NULL, n_sub, numberArguments, dump, varDump, k, v, *_1, _5$$8, _6$$8, _8$$9, _9$$5; + zval argument; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&argument); + ZVAL_UNDEF(&n_sub); + ZVAL_UNDEF(&numberArguments); + ZVAL_UNDEF(&dump); + ZVAL_UNDEF(&varDump); + ZVAL_UNDEF(&k); + ZVAL_UNDEF(&v); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &argument_param, &n); - argument = argument_param; + ZEPHIR_OBS_COPY_OR_DUP(&argument, argument_param); if (!n) { + n = &n_sub; ZEPHIR_INIT_VAR(n); ZVAL_LONG(n, 0); } - ZEPHIR_INIT_VAR(numberArguments); - ZVAL_LONG(numberArguments, zephir_fast_count_int(argument TSRMLS_CC)); + ZEPHIR_INIT_VAR(&numberArguments); + ZVAL_LONG(&numberArguments, zephir_fast_count_int(&argument TSRMLS_CC)); _0 = ZEPHIR_GE_LONG(n, 3); if (!(_0)) { - _0 = ZEPHIR_IS_LONG(numberArguments, 0); + _0 = ZEPHIR_IS_LONG(&numberArguments, 0); } if (_0) { RETURN_MM_NULL(); } - if (ZEPHIR_GE_LONG(numberArguments, 10)) { - RETURN_CCTOR(numberArguments); + if (ZEPHIR_GE_LONG(&numberArguments, 10)) { + RETURN_CCTOR(&numberArguments); } - ZEPHIR_INIT_VAR(dump); - array_init(dump); - zephir_is_iterable(argument, &_2, &_1, 0, 0, "phalcon/debug.zep", 189); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(k, _2, _1); - ZEPHIR_GET_HVALUE(v, _3); - if (ZEPHIR_IS_STRING(v, "")) { - ZEPHIR_INIT_NVAR(varDump); - ZVAL_STRING(varDump, "(empty string)", 1); - } else if (zephir_is_scalar(v)) { - ZEPHIR_CALL_METHOD(&varDump, this_ptr, "_escapestring", &_4, 0, v); + ZEPHIR_INIT_VAR(&dump); + array_init(&dump); + zephir_is_iterable(&argument, 0, "phalcon/debug.zep", 189); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&argument), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&k); + if (_3 != NULL) { + ZVAL_STR_COPY(&k, _3); + } else { + ZVAL_LONG(&k, _2); + } + ZEPHIR_INIT_NVAR(&v); + ZVAL_COPY(&v, _1); + if (ZEPHIR_IS_STRING(&v, "")) { + ZEPHIR_INIT_NVAR(&varDump); + ZVAL_STRING(&varDump, "(empty string)"); + } else if (zephir_is_scalar(&v)) { + ZEPHIR_CALL_METHOD(&varDump, this_ptr, "_escapestring", &_4, 0, &v); zephir_check_call_status(); - } else if (Z_TYPE_P(v) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_6$$8); - ZVAL_LONG(_6$$8, (zephir_get_numberval(n) + 1)); - ZEPHIR_CALL_METHOD(&_5$$8, this_ptr, "_getarraydump", &_7, 178, v, _6$$8); + } else if (Z_TYPE_P(&v) == IS_ARRAY) { + ZVAL_LONG(&_6$$8, (zephir_get_numberval(n) + 1)); + ZEPHIR_CALL_METHOD(&_5$$8, this_ptr, "_getarraydump", &_7, 158, &v, &_6$$8); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(varDump); - ZEPHIR_CONCAT_SVS(varDump, "Array(", _5$$8, ")"); - } else if (Z_TYPE_P(v) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_8$$9); - zephir_get_class(_8$$9, v, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(varDump); - ZEPHIR_CONCAT_SVS(varDump, "Object(", _8$$9, ")"); - } else if (Z_TYPE_P(v) == IS_NULL) { - ZEPHIR_INIT_NVAR(varDump); - ZVAL_STRING(varDump, "null", 1); + ZEPHIR_INIT_NVAR(&varDump); + ZEPHIR_CONCAT_SVS(&varDump, "Array(", &_5$$8, ")"); + } else if (Z_TYPE_P(&v) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_8$$9); + zephir_get_class(&_8$$9, &v, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&varDump); + ZEPHIR_CONCAT_SVS(&varDump, "Object(", &_8$$9, ")"); + } else if (Z_TYPE_P(&v) == IS_NULL) { + ZEPHIR_INIT_NVAR(&varDump); + ZVAL_STRING(&varDump, "null"); } else { - ZEPHIR_CPY_WRT(varDump, v); + ZEPHIR_CPY_WRT(&varDump, &v); } ZEPHIR_INIT_LNVAR(_9$$5); - ZEPHIR_CONCAT_SVSV(_9$$5, "[", k, "] => ", varDump); - zephir_array_append(&dump, _9$$5, PH_SEPARATE, "phalcon/debug.zep", 186); - } - zephir_fast_join_str(return_value, SL(", "), dump TSRMLS_CC); + ZEPHIR_CONCAT_SVSV(&_9$$5, "[", &k, "] => ", &varDump); + zephir_array_append(&dump, &_9$$5, PH_SEPARATE, "phalcon/debug.zep", 186); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&v); + ZEPHIR_INIT_NVAR(&k); + zephir_fast_join_str(return_value, SL(", "), &dump TSRMLS_CC); RETURN_MM(); } @@ -413,7 +477,14 @@ PHP_METHOD(Phalcon_Debug, _getArrayDump) { PHP_METHOD(Phalcon_Debug, _getVarDump) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *variable, *className = NULL, *dumpedObject = NULL, *_0$$9 = NULL, *_1$$11 = NULL; + zval *variable, variable_sub, className, dumpedObject, _0$$9, _1$$11; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&variable_sub); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&dumpedObject); + ZVAL_UNDEF(&_0$$9); + ZVAL_UNDEF(&_1$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &variable); @@ -421,11 +492,11 @@ PHP_METHOD(Phalcon_Debug, _getVarDump) { if (zephir_is_scalar(variable)) { - if (Z_TYPE_P(variable) == IS_BOOL) { + if (((Z_TYPE_P(variable) == IS_TRUE || Z_TYPE_P(variable) == IS_FALSE) == 1)) { if (zephir_is_true(variable)) { - RETURN_MM_STRING("true", 1); + RETURN_MM_STRING("true"); } else { - RETURN_MM_STRING("false", 1); + RETURN_MM_STRING("false"); } } if (Z_TYPE_P(variable) == IS_STRING) { @@ -437,28 +508,28 @@ PHP_METHOD(Phalcon_Debug, _getVarDump) { RETURN_MM(); } if (Z_TYPE_P(variable) == IS_OBJECT) { - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, variable, 0 TSRMLS_CC); - if ((zephir_method_exists_ex(variable, SS("dump") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, variable, 0 TSRMLS_CC); + if ((zephir_method_exists_ex(variable, SL("dump") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(&dumpedObject, variable, "dump", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0$$9, this_ptr, "_getarraydump", NULL, 0, dumpedObject); + ZEPHIR_CALL_METHOD(&_0$$9, this_ptr, "_getarraydump", NULL, 0, &dumpedObject); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "Object(", className, ": ", _0$$9, ")"); + ZEPHIR_CONCAT_SVSVS(return_value, "Object(", &className, ": ", &_0$$9, ")"); RETURN_MM(); } else { - ZEPHIR_CONCAT_SVS(return_value, "Object(", className, ")"); + ZEPHIR_CONCAT_SVS(return_value, "Object(", &className, ")"); RETURN_MM(); } } if (Z_TYPE_P(variable) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&_1$$11, this_ptr, "_getarraydump", NULL, 178, variable); + ZEPHIR_CALL_METHOD(&_1$$11, this_ptr, "_getarraydump", NULL, 158, variable); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, "Array(", _1$$11, ")"); + ZEPHIR_CONCAT_SVS(return_value, "Array(", &_1$$11, ")"); RETURN_MM(); } if (Z_TYPE_P(variable) == IS_NULL) { - RETURN_MM_STRING("null", 1); + RETURN_MM_STRING("null"); } zephir_gettype(return_value, variable TSRMLS_CC); RETURN_MM(); @@ -473,18 +544,23 @@ PHP_METHOD(Phalcon_Debug, _getVarDump) { */ PHP_METHOD(Phalcon_Debug, getMajorVersion) { - zval *parts = NULL, *_0 = NULL, *_2; + zval parts, _0, _2; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&parts); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_CE_STATIC(&_0, phalcon_version_ce, "get", &_1, 179); + ZEPHIR_CALL_CE_STATIC(&_0, phalcon_version_ce, "get", &_1, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(parts); - zephir_fast_explode_str(parts, SL(" "), _0, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&_2, parts, 0, PH_NOISY | PH_READONLY, "phalcon/debug.zep", 281 TSRMLS_CC); - RETURN_CTOR(_2); + ZEPHIR_INIT_VAR(&parts); + zephir_fast_explode_str(&parts, SL(" "), &_0, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&_2, &parts, 0, PH_NOISY | PH_READONLY, "phalcon/debug.zep", 281 TSRMLS_CC); + RETURN_CTOR(&_2); } @@ -493,29 +569,36 @@ PHP_METHOD(Phalcon_Debug, getMajorVersion) { */ PHP_METHOD(Phalcon_Debug, getVersion) { - zval *link = NULL, *_0 = NULL, *_2, *_3, *_4 = NULL; + zval __$false, link, _0, _2, _3, _4; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL, *_5 = NULL, *_6 = NULL; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&link); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(link); - zephir_create_array(link, 4, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_CALL_CE_STATIC(&_0, phalcon_version_ce, "getpart", &_1, 180, _2); + ZEPHIR_INIT_VAR(&link); + zephir_create_array(&link, 4, 0 TSRMLS_CC); + ZVAL_LONG(&_2, 0); + ZEPHIR_CALL_CE_STATIC(&_0, phalcon_version_ce, "getpart", &_1, 0, &_2); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SVS(_3, "https://docs.phalconphp.com/en/", _0, ".0.0/"); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SVS(&_3, "https://docs.phalconphp.com/en/", &_0, ".0.0/"); zephir_array_update_string(&link, SL("action"), &_3, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_CE_STATIC(&_4, phalcon_version_ce, "get", &_5, 179); + ZEPHIR_CALL_CE_STATIC(&_4, phalcon_version_ce, "get", &_5, 0); zephir_check_call_status(); zephir_array_update_string(&link, SL("text"), &_4, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&link, SL("local"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); - add_assoc_stringl_ex(link, SS("target"), SL("_new"), 1); - ZEPHIR_CALL_CE_STATIC(&_4, phalcon_tag_ce, "linkto", &_6, 181, link); + zephir_array_update_string(&link, SL("local"), &__$false, PH_COPY | PH_SEPARATE); + add_assoc_stringl_ex(&link, SL("target"), SL("_new")); + ZEPHIR_CALL_CE_STATIC(&_4, phalcon_tag_ce, "linkto", &_6, 0, &link); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, "
Phalcon Framework ", _4, "
"); + ZEPHIR_CONCAT_SVS(return_value, "
Phalcon Framework ", &_4, "
"); RETURN_MM(); } @@ -525,20 +608,26 @@ PHP_METHOD(Phalcon_Debug, getVersion) { */ PHP_METHOD(Phalcon_Debug, getCssSources) { - zval *uri = NULL, *sources = NULL, *_0, *_1; + zval uri, sources, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uri); + ZVAL_UNDEF(&sources); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - uri = zephir_fetch_nproperty_this(this_ptr, SL("_uri"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(sources); - ZEPHIR_CONCAT_SVS(sources, ""); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_SVS(_0, ""); - zephir_concat_self(&sources, _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVS(_1, ""); - zephir_concat_self(&sources, _1 TSRMLS_CC); - RETURN_CCTOR(sources); + zephir_read_property(&uri, this_ptr, SL("_uri"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&sources); + ZEPHIR_CONCAT_SVS(&sources, ""); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_SVS(&_0, ""); + zephir_concat_self(&sources, &_0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVS(&_1, ""); + zephir_concat_self(&sources, &_1 TSRMLS_CC); + RETURN_CCTOR(&sources); } @@ -547,26 +636,34 @@ PHP_METHOD(Phalcon_Debug, getCssSources) { */ PHP_METHOD(Phalcon_Debug, getJsSources) { - zval *uri = NULL, *sources = NULL, *_0, *_1, *_2, *_3; + zval uri, sources, _0, _1, _2, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uri); + ZVAL_UNDEF(&sources); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - uri = zephir_fetch_nproperty_this(this_ptr, SL("_uri"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(sources); - ZEPHIR_CONCAT_SVS(sources, ""); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_SVS(_0, ""); - zephir_concat_self(&sources, _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVS(_1, ""); - zephir_concat_self(&sources, _1 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVS(_2, ""); - zephir_concat_self(&sources, _2 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SVS(_3, ""); - zephir_concat_self(&sources, _3 TSRMLS_CC); - RETURN_CCTOR(sources); + zephir_read_property(&uri, this_ptr, SL("_uri"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&sources); + ZEPHIR_CONCAT_SVS(&sources, ""); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_SVS(&_0, ""); + zephir_concat_self(&sources, &_0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVS(&_1, ""); + zephir_concat_self(&sources, &_1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVS(&_2, ""); + zephir_concat_self(&sources, &_2 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SVS(&_3, ""); + zephir_concat_self(&sources, &_3 TSRMLS_CC); + RETURN_CCTOR(&sources); } @@ -576,217 +673,285 @@ PHP_METHOD(Phalcon_Debug, getJsSources) { PHP_METHOD(Phalcon_Debug, showTraceItem) { zend_bool _37$$24; - HashTable *_18$$14; - HashPosition _17$$14; - zval *_1, *_26$$16 = NULL; - zephir_fcall_cache_entry *_21 = NULL, *_44 = NULL; - zval *trace = NULL; - zval *n_param = NULL, *trace_param = NULL, *className = NULL, *prepareInternalClass = NULL, *preparedFunctionName = NULL, *html = NULL, *classReflection = NULL, *prepareUriClass = NULL, *functionName = NULL, *functionReflection = NULL, *traceArgs = NULL, *arguments = NULL, *argument = NULL, *filez = NULL, *line = NULL, *showFiles = NULL, *lines = NULL, *numberLines = NULL, *showFileFragment = NULL, *firstLine = NULL, *lastLine = NULL, *linePosition = NULL, *currentLine = NULL, *classNameWithLink = NULL, *functionNameWithLink = NULL, _0, *_16, *_2$$3, *_3$$3, _4$$3, *_11$$3, *_12$$3, _5$$4, _6$$4, *_7$$5 = NULL, *_8$$6, _9$$6, _10$$6, *_13$$10 = NULL, _14$$11, _15$$11, **_19$$14, *_23$$14, *_24$$14, *_20$$15 = NULL, *_22$$15 = NULL, *_25$$16, *_27$$16, *_28$$18, *_29$$23, *_30$$26 = NULL, *_31$$26 = NULL, *_32$$26 = NULL, _33$$26 = zval_used_for_init, *_34$$27 = NULL, _35$$27 = zval_used_for_init, _36$$27 = zval_used_for_init, *_38$$29 = NULL, _39$$29 = zval_used_for_init, _40$$29 = zval_used_for_init, _41$$29 = zval_used_for_init, _42$$29 = zval_used_for_init, *_43$$29 = NULL; + zval _1, _25$$16; + zephir_fcall_cache_entry *_20 = NULL, *_44 = NULL; + zval trace; + zval *n_param = NULL, *trace_param = NULL, className, prepareInternalClass, preparedFunctionName, html, classReflection, prepareUriClass, functionName, functionReflection, traceArgs, arguments, argument, filez, line, showFiles, lines, numberLines, showFileFragment, firstLine, lastLine, linePosition, currentLine, classNameWithLink, functionNameWithLink, _0, _17, _2$$3, _3$$3, _4$$3, _5$$3, _12$$3, _13$$3, _6$$4, _7$$4, _8$$5, _9$$6, _10$$6, _11$$6, _14$$10, _15$$11, _16$$11, *_18$$14, _22$$14, _23$$14, _19$$15, _21$$15, _24$$16, _26$$16, _27$$18, _28$$23, _29$$26, _30$$26, _31$$26, _32$$26, _33$$26, _34$$27, _35$$27, _36$$27, _38$$29, _39$$29, _40$$29, _41$$29, _42$$29, _43$$29; zend_long n, ZEPHIR_LAST_CALL_STATUS, i = 0, beforeLine$$18, afterLine$$18; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&prepareInternalClass); + ZVAL_UNDEF(&preparedFunctionName); + ZVAL_UNDEF(&html); + ZVAL_UNDEF(&classReflection); + ZVAL_UNDEF(&prepareUriClass); + ZVAL_UNDEF(&functionName); + ZVAL_UNDEF(&functionReflection); + ZVAL_UNDEF(&traceArgs); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&argument); + ZVAL_UNDEF(&filez); + ZVAL_UNDEF(&line); + ZVAL_UNDEF(&showFiles); + ZVAL_UNDEF(&lines); + ZVAL_UNDEF(&numberLines); + ZVAL_UNDEF(&showFileFragment); + ZVAL_UNDEF(&firstLine); + ZVAL_UNDEF(&lastLine); + ZVAL_UNDEF(&linePosition); + ZVAL_UNDEF(¤tLine); + ZVAL_UNDEF(&classNameWithLink); + ZVAL_UNDEF(&functionNameWithLink); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_17); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_13$$3); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_10$$6); + ZVAL_UNDEF(&_11$$6); + ZVAL_UNDEF(&_14$$10); + ZVAL_UNDEF(&_15$$11); + ZVAL_UNDEF(&_16$$11); + ZVAL_UNDEF(&_22$$14); + ZVAL_UNDEF(&_23$$14); + ZVAL_UNDEF(&_19$$15); + ZVAL_UNDEF(&_21$$15); + ZVAL_UNDEF(&_24$$16); + ZVAL_UNDEF(&_26$$16); + ZVAL_UNDEF(&_27$$18); + ZVAL_UNDEF(&_28$$23); + ZVAL_UNDEF(&_29$$26); + ZVAL_UNDEF(&_30$$26); + ZVAL_UNDEF(&_31$$26); + ZVAL_UNDEF(&_32$$26); + ZVAL_UNDEF(&_33$$26); + ZVAL_UNDEF(&_34$$27); + ZVAL_UNDEF(&_35$$27); + ZVAL_UNDEF(&_36$$27); + ZVAL_UNDEF(&_38$$29); + ZVAL_UNDEF(&_39$$29); + ZVAL_UNDEF(&_40$$29); + ZVAL_UNDEF(&_41$$29); + ZVAL_UNDEF(&_42$$29); + ZVAL_UNDEF(&_43$$29); + ZVAL_UNDEF(&trace); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_25$$16); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &n_param, &trace_param); n = zephir_get_intval(n_param); - trace = trace_param; + ZEPHIR_OBS_COPY_OR_DUP(&trace, trace_param); ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, n); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVS(_1, "#", &_0, ""); - ZEPHIR_CPY_WRT(html, _1); - ZEPHIR_OBS_VAR(className); - if (zephir_array_isset_string_fetch(&className, trace, SS("class"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_INIT_VAR(_3$$3); - ZEPHIR_SINIT_VAR(_4$$3); - ZVAL_STRING(&_4$$3, "/^Phalcon/", 0); - zephir_preg_match(_3$$3, &_4$$3, className, _2$$3, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(_3$$3)) { - ZEPHIR_SINIT_VAR(_5$$4); - ZVAL_STRING(&_5$$4, "\\", 0); - ZEPHIR_SINIT_VAR(_6$$4); - ZVAL_STRING(&_6$$4, "/", 0); - ZEPHIR_INIT_VAR(prepareUriClass); - zephir_fast_str_replace(&prepareUriClass, &_5$$4, &_6$$4, className TSRMLS_CC); - ZEPHIR_INIT_VAR(classNameWithLink); - ZEPHIR_CONCAT_SVSVS(classNameWithLink, "", className, ""); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVS(&_1, "#", &_0, ""); + ZEPHIR_CPY_WRT(&html, &_1); + ZEPHIR_OBS_VAR(&className); + if (zephir_array_isset_string_fetch(&className, &trace, SL("class"), 0)) { + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_INIT_VAR(&_3$$3); + ZVAL_STRING(&_3$$3, "/^Phalcon/"); + ZEPHIR_INIT_VAR(&_4$$3); + ZEPHIR_INIT_VAR(&_5$$3); + ZVAL_STRING(&_5$$3, "/^Phalcon/"); + zephir_preg_match(&_4$$3, &_5$$3, &className, &_2$$3, 0, 0 , 0 TSRMLS_CC); + if (zephir_is_true(&_4$$3)) { + ZEPHIR_INIT_VAR(&_6$$4); + ZVAL_STRING(&_6$$4, "\\"); + ZEPHIR_INIT_VAR(&_7$$4); + ZVAL_STRING(&_7$$4, "/"); + ZEPHIR_INIT_VAR(&prepareUriClass); + zephir_fast_str_replace(&prepareUriClass, &_6$$4, &_7$$4, &className TSRMLS_CC); + ZEPHIR_INIT_VAR(&classNameWithLink); + ZEPHIR_CONCAT_SVSVS(&classNameWithLink, "", &className, ""); } else { - ZEPHIR_INIT_VAR(classReflection); - object_init_ex(classReflection, zephir_get_internal_ce(SS("reflectionclass") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, classReflection, "__construct", NULL, 98, className); + ZEPHIR_INIT_VAR(&classReflection); + object_init_ex(&classReflection, zephir_get_internal_ce(SL("reflectionclass"))); + ZEPHIR_CALL_METHOD(NULL, &classReflection, "__construct", NULL, 87, &className); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_7$$5, classReflection, "isinternal", NULL, 182); + ZEPHIR_CALL_METHOD(&_8$$5, &classReflection, "isinternal", NULL, 159); zephir_check_call_status(); - if (zephir_is_true(_7$$5)) { - ZEPHIR_INIT_VAR(_8$$6); - zephir_fast_strtolower(_8$$6, className); - ZEPHIR_SINIT_VAR(_9$$6); - ZVAL_STRING(&_9$$6, "_", 0); - ZEPHIR_SINIT_VAR(_10$$6); - ZVAL_STRING(&_10$$6, "-", 0); - ZEPHIR_INIT_VAR(prepareInternalClass); - zephir_fast_str_replace(&prepareInternalClass, &_9$$6, &_10$$6, _8$$6 TSRMLS_CC); - ZEPHIR_INIT_NVAR(classNameWithLink); - ZEPHIR_CONCAT_SVSVS(classNameWithLink, "", className, ""); + if (zephir_is_true(&_8$$5)) { + ZEPHIR_INIT_VAR(&_9$$6); + zephir_fast_strtolower(&_9$$6, &className); + ZEPHIR_INIT_VAR(&_10$$6); + ZVAL_STRING(&_10$$6, "_"); + ZEPHIR_INIT_VAR(&_11$$6); + ZVAL_STRING(&_11$$6, "-"); + ZEPHIR_INIT_VAR(&prepareInternalClass); + zephir_fast_str_replace(&prepareInternalClass, &_10$$6, &_11$$6, &_9$$6 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&classNameWithLink); + ZEPHIR_CONCAT_SVSVS(&classNameWithLink, "", &className, ""); } else { - ZEPHIR_CPY_WRT(classNameWithLink, className); + ZEPHIR_CPY_WRT(&classNameWithLink, &className); } } - ZEPHIR_INIT_VAR(_11$$3); - ZEPHIR_CONCAT_SVS(_11$$3, "", classNameWithLink, ""); - zephir_concat_self(&html, _11$$3 TSRMLS_CC); - zephir_array_fetch_string(&_12$$3, trace, SL("type"), PH_NOISY | PH_READONLY, "phalcon/debug.zep", 388 TSRMLS_CC); - zephir_concat_self(&html, _12$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_12$$3); + ZEPHIR_CONCAT_SVS(&_12$$3, "", &classNameWithLink, ""); + zephir_concat_self(&html, &_12$$3 TSRMLS_CC); + zephir_array_fetch_string(&_13$$3, &trace, SL("type"), PH_NOISY | PH_READONLY, "phalcon/debug.zep", 388 TSRMLS_CC); + zephir_concat_self(&html, &_13$$3 TSRMLS_CC); } - ZEPHIR_OBS_VAR(functionName); - zephir_array_fetch_string(&functionName, trace, SL("function"), PH_NOISY, "phalcon/debug.zep", 394 TSRMLS_CC); - if (zephir_array_isset_string(trace, SS("class"))) { - ZEPHIR_CPY_WRT(functionNameWithLink, functionName); + ZEPHIR_OBS_VAR(&functionName); + zephir_array_fetch_string(&functionName, &trace, SL("function"), PH_NOISY, "phalcon/debug.zep", 394 TSRMLS_CC); + if (zephir_array_isset_string(&trace, SL("class"))) { + ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName); } else { - if ((zephir_function_exists(functionName TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_VAR(functionReflection); - object_init_ex(functionReflection, zephir_get_internal_ce(SS("reflectionfunction") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, functionReflection, "__construct", NULL, 87, functionName); + if ((zephir_function_exists(&functionName TSRMLS_CC) == SUCCESS)) { + ZEPHIR_INIT_VAR(&functionReflection); + object_init_ex(&functionReflection, zephir_get_internal_ce(SL("reflectionfunction"))); + ZEPHIR_CALL_METHOD(NULL, &functionReflection, "__construct", NULL, 78, &functionName); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_13$$10, functionReflection, "isinternal", NULL, 183); + ZEPHIR_CALL_METHOD(&_14$$10, &functionReflection, "isinternal", NULL, 160); zephir_check_call_status(); - if (zephir_is_true(_13$$10)) { - ZEPHIR_SINIT_VAR(_14$$11); - ZVAL_STRING(&_14$$11, "_", 0); - ZEPHIR_SINIT_VAR(_15$$11); - ZVAL_STRING(&_15$$11, "-", 0); - ZEPHIR_INIT_VAR(preparedFunctionName); - zephir_fast_str_replace(&preparedFunctionName, &_14$$11, &_15$$11, functionName TSRMLS_CC); - ZEPHIR_INIT_NVAR(functionNameWithLink); - ZEPHIR_CONCAT_SVSVS(functionNameWithLink, "", functionName, ""); + if (zephir_is_true(&_14$$10)) { + ZEPHIR_INIT_VAR(&_15$$11); + ZVAL_STRING(&_15$$11, "_"); + ZEPHIR_INIT_VAR(&_16$$11); + ZVAL_STRING(&_16$$11, "-"); + ZEPHIR_INIT_VAR(&preparedFunctionName); + zephir_fast_str_replace(&preparedFunctionName, &_15$$11, &_16$$11, &functionName TSRMLS_CC); + ZEPHIR_INIT_NVAR(&functionNameWithLink); + ZEPHIR_CONCAT_SVSVS(&functionNameWithLink, "", &functionName, ""); } else { - ZEPHIR_CPY_WRT(functionNameWithLink, functionName); + ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName); } } else { - ZEPHIR_CPY_WRT(functionNameWithLink, functionName); + ZEPHIR_CPY_WRT(&functionNameWithLink, &functionName); } } - ZEPHIR_INIT_VAR(_16); - ZEPHIR_CONCAT_SVS(_16, "", functionNameWithLink, ""); - zephir_concat_self(&html, _16 TSRMLS_CC); - ZEPHIR_OBS_VAR(traceArgs); - if (zephir_array_isset_string_fetch(&traceArgs, trace, SS("args"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(arguments); - array_init(arguments); - zephir_is_iterable(traceArgs, &_18$$14, &_17$$14, 0, 0, "phalcon/debug.zep", 443); - for ( - ; zend_hash_get_current_data_ex(_18$$14, (void**) &_19$$14, &_17$$14) == SUCCESS - ; zend_hash_move_forward_ex(_18$$14, &_17$$14) - ) { - ZEPHIR_GET_HVALUE(argument, _19$$14); - ZEPHIR_CALL_METHOD(&_20$$15, this_ptr, "_getvardump", &_21, 0, argument); + ZEPHIR_INIT_VAR(&_17); + ZEPHIR_CONCAT_SVS(&_17, "", &functionNameWithLink, ""); + zephir_concat_self(&html, &_17 TSRMLS_CC); + ZEPHIR_OBS_VAR(&traceArgs); + if (zephir_array_isset_string_fetch(&traceArgs, &trace, SL("args"), 0)) { + ZEPHIR_INIT_VAR(&arguments); + array_init(&arguments); + zephir_is_iterable(&traceArgs, 0, "phalcon/debug.zep", 443); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&traceArgs), _18$$14) + { + ZEPHIR_INIT_NVAR(&argument); + ZVAL_COPY(&argument, _18$$14); + ZEPHIR_CALL_METHOD(&_19$$15, this_ptr, "_getvardump", &_20, 0, &argument); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_22$$15); - ZEPHIR_CONCAT_SVS(_22$$15, "", _20$$15, ""); - zephir_array_append(&arguments, _22$$15, PH_SEPARATE, "phalcon/debug.zep", 437); - } - ZEPHIR_INIT_VAR(_23$$14); - zephir_fast_join_str(_23$$14, SL(", "), arguments TSRMLS_CC); - ZEPHIR_INIT_VAR(_24$$14); - ZEPHIR_CONCAT_SVS(_24$$14, "(", _23$$14, ")"); - zephir_concat_self(&html, _24$$14 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_21$$15); + ZEPHIR_CONCAT_SVS(&_21$$15, "", &_19$$15, ""); + zephir_array_append(&arguments, &_21$$15, PH_SEPARATE, "phalcon/debug.zep", 437); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&argument); + ZEPHIR_INIT_VAR(&_22$$14); + zephir_fast_join_str(&_22$$14, SL(", "), &arguments TSRMLS_CC); + ZEPHIR_INIT_VAR(&_23$$14); + ZEPHIR_CONCAT_SVS(&_23$$14, "(", &_22$$14, ")"); + zephir_concat_self(&html, &_23$$14 TSRMLS_CC); } - ZEPHIR_OBS_VAR(filez); - if (zephir_array_isset_string_fetch(&filez, trace, SS("file"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_VAR(_25$$16); - zephir_array_fetch_string(&_25$$16, trace, SL("line"), PH_NOISY, "phalcon/debug.zep", 451 TSRMLS_CC); - zephir_get_strval(_26$$16, _25$$16); - ZEPHIR_CPY_WRT(line, _26$$16); - ZEPHIR_INIT_VAR(_27$$16); - ZEPHIR_CONCAT_SVSVS(_27$$16, "
", filez, " (", line, ")
"); - zephir_concat_self(&html, _27$$16 TSRMLS_CC); - ZEPHIR_OBS_VAR(showFiles); - zephir_read_property_this(&showFiles, this_ptr, SL("_showFiles"), PH_NOISY_CC); - if (zephir_is_true(showFiles)) { - ZEPHIR_CALL_FUNCTION(&lines, "file", NULL, 184, filez); + ZEPHIR_OBS_VAR(&filez); + if (zephir_array_isset_string_fetch(&filez, &trace, SL("file"), 0)) { + ZEPHIR_OBS_VAR(&_24$$16); + zephir_array_fetch_string(&_24$$16, &trace, SL("line"), PH_NOISY, "phalcon/debug.zep", 451 TSRMLS_CC); + zephir_get_strval(&_25$$16, &_24$$16); + ZEPHIR_CPY_WRT(&line, &_25$$16); + ZEPHIR_INIT_VAR(&_26$$16); + ZEPHIR_CONCAT_SVSVS(&_26$$16, "
", &filez, " (", &line, ")
"); + zephir_concat_self(&html, &_26$$16 TSRMLS_CC); + ZEPHIR_OBS_VAR(&showFiles); + zephir_read_property(&showFiles, this_ptr, SL("_showFiles"), PH_NOISY_CC); + if (zephir_is_true(&showFiles)) { + ZEPHIR_CALL_FUNCTION(&lines, "file", NULL, 161, &filez); zephir_check_call_status(); - ZEPHIR_INIT_VAR(numberLines); - ZVAL_LONG(numberLines, zephir_fast_count_int(lines TSRMLS_CC)); - ZEPHIR_OBS_VAR(showFileFragment); - zephir_read_property_this(&showFileFragment, this_ptr, SL("_showFileFragment"), PH_NOISY_CC); - if (zephir_is_true(showFileFragment)) { - beforeLine$$18 = (zephir_get_numberval(line) - 7); + ZEPHIR_INIT_VAR(&numberLines); + ZVAL_LONG(&numberLines, zephir_fast_count_int(&lines TSRMLS_CC)); + ZEPHIR_OBS_VAR(&showFileFragment); + zephir_read_property(&showFileFragment, this_ptr, SL("_showFileFragment"), PH_NOISY_CC); + if (zephir_is_true(&showFileFragment)) { + beforeLine$$18 = (zephir_get_numberval(&line) - 7); if (beforeLine$$18 < 1) { - ZEPHIR_INIT_VAR(firstLine); - ZVAL_LONG(firstLine, 1); + ZEPHIR_INIT_VAR(&firstLine); + ZVAL_LONG(&firstLine, 1); } else { - ZEPHIR_INIT_NVAR(firstLine); - ZVAL_LONG(firstLine, beforeLine$$18); + ZEPHIR_INIT_NVAR(&firstLine); + ZVAL_LONG(&firstLine, beforeLine$$18); } - afterLine$$18 = (zephir_get_numberval(line) + 5); - if (ZEPHIR_LT_LONG(numberLines, afterLine$$18)) { - ZEPHIR_CPY_WRT(lastLine, numberLines); + afterLine$$18 = (zephir_get_numberval(&line) + 5); + if (ZEPHIR_LT_LONG(&numberLines, afterLine$$18)) { + ZEPHIR_CPY_WRT(&lastLine, &numberLines); } else { - ZEPHIR_INIT_NVAR(lastLine); - ZVAL_LONG(lastLine, afterLine$$18); + ZEPHIR_INIT_NVAR(&lastLine); + ZVAL_LONG(&lastLine, afterLine$$18); } - ZEPHIR_INIT_VAR(_28$$18); - ZEPHIR_CONCAT_SVSVSVS(_28$$18, "
");
-				zephir_concat_self(&html, _28$$18 TSRMLS_CC);
+				ZEPHIR_INIT_VAR(&_27$$18);
+				ZEPHIR_CONCAT_SVSVSVS(&_27$$18, "
");
+				zephir_concat_self(&html, &_27$$18 TSRMLS_CC);
 			} else {
-				ZEPHIR_INIT_NVAR(firstLine);
-				ZVAL_LONG(firstLine, 1);
-				ZEPHIR_CPY_WRT(lastLine, numberLines);
-				ZEPHIR_INIT_VAR(_29$$23);
-				ZEPHIR_CONCAT_SVSVS(_29$$23, "
");
-				zephir_concat_self(&html, _29$$23 TSRMLS_CC);
+				ZEPHIR_INIT_NVAR(&firstLine);
+				ZVAL_LONG(&firstLine, 1);
+				ZEPHIR_CPY_WRT(&lastLine, &numberLines);
+				ZEPHIR_INIT_VAR(&_28$$23);
+				ZEPHIR_CONCAT_SVSVS(&_28$$23, "
");
+				zephir_concat_self(&html, &_28$$23 TSRMLS_CC);
 			}
-			i = zephir_get_numberval(firstLine);
+			i = zephir_get_numberval(&firstLine);
 			while (1) {
-				if (!(ZEPHIR_GE_LONG(lastLine, i))) {
+				if (!(ZEPHIR_GE_LONG(&lastLine, i))) {
 					break;
 				}
-				ZEPHIR_INIT_NVAR(linePosition);
-				ZVAL_LONG(linePosition, (i - 1));
-				ZEPHIR_OBS_NVAR(currentLine);
-				zephir_array_fetch(¤tLine, lines, linePosition, PH_NOISY, "phalcon/debug.zep", 523 TSRMLS_CC);
-				if (zephir_is_true(showFileFragment)) {
-					if (ZEPHIR_IS_LONG(firstLine, i)) {
-						ZEPHIR_INIT_NVAR(_30$$26);
-						ZEPHIR_INIT_NVAR(_31$$26);
-						ZEPHIR_INIT_NVAR(_32$$26);
-						zephir_fast_trim(_32$$26, currentLine, NULL , ZEPHIR_TRIM_RIGHT TSRMLS_CC);
-						ZEPHIR_SINIT_NVAR(_33$$26);
-						ZVAL_STRING(&_33$$26, "#\\*\\/#", 0);
-						zephir_preg_match(_31$$26, &_33$$26, _32$$26, _30$$26, 0, 0 , 0  TSRMLS_CC);
-						if (zephir_is_true(_31$$26)) {
-							ZEPHIR_INIT_NVAR(_34$$27);
-							ZEPHIR_SINIT_NVAR(_35$$27);
-							ZVAL_STRING(&_35$$27, "* /", 0);
-							ZEPHIR_SINIT_NVAR(_36$$27);
-							ZVAL_STRING(&_36$$27, " ", 0);
-							zephir_fast_str_replace(&_34$$27, &_35$$27, &_36$$27, currentLine TSRMLS_CC);
-							ZEPHIR_CPY_WRT(currentLine, _34$$27);
+				ZEPHIR_INIT_NVAR(&linePosition);
+				ZVAL_LONG(&linePosition, (i - 1));
+				ZEPHIR_OBS_NVAR(¤tLine);
+				zephir_array_fetch(¤tLine, &lines, &linePosition, PH_NOISY, "phalcon/debug.zep", 523 TSRMLS_CC);
+				if (zephir_is_true(&showFileFragment)) {
+					if (ZEPHIR_IS_LONG(&firstLine, i)) {
+						ZEPHIR_INIT_NVAR(&_29$$26);
+						ZEPHIR_INIT_NVAR(&_30$$26);
+						zephir_fast_trim(&_30$$26, ¤tLine, NULL , ZEPHIR_TRIM_RIGHT TSRMLS_CC);
+						ZEPHIR_INIT_NVAR(&_31$$26);
+						ZVAL_STRING(&_31$$26, "#\\*\\/#");
+						ZEPHIR_INIT_NVAR(&_32$$26);
+						ZEPHIR_INIT_NVAR(&_33$$26);
+						ZVAL_STRING(&_33$$26, "#\\*\\/#");
+						zephir_preg_match(&_32$$26, &_33$$26, &_30$$26, &_29$$26, 0, 0 , 0  TSRMLS_CC);
+						if (zephir_is_true(&_32$$26)) {
+							ZEPHIR_INIT_NVAR(&_34$$27);
+							ZEPHIR_INIT_NVAR(&_35$$27);
+							ZVAL_STRING(&_35$$27, "* /");
+							ZEPHIR_INIT_NVAR(&_36$$27);
+							ZVAL_STRING(&_36$$27, " ");
+							zephir_fast_str_replace(&_34$$27, &_35$$27, &_36$$27, ¤tLine TSRMLS_CC);
+							ZEPHIR_CPY_WRT(¤tLine, &_34$$27);
 						}
 					}
 				}
-				_37$$24 = ZEPHIR_IS_STRING(currentLine, "\n");
+				_37$$24 = ZEPHIR_IS_STRING(¤tLine, "\n");
 				if (!(_37$$24)) {
-					_37$$24 = ZEPHIR_IS_STRING(currentLine, "\r\n");
+					_37$$24 = ZEPHIR_IS_STRING(¤tLine, "\r\n");
 				}
 				if (_37$$24) {
 					zephir_concat_self_str(&html, SL(" \n") TSRMLS_CC);
 				} else {
-					ZEPHIR_INIT_NVAR(_38$$29);
-					ZEPHIR_SINIT_NVAR(_39$$29);
-					ZVAL_STRING(&_39$$29, "\t", 0);
-					ZEPHIR_SINIT_NVAR(_40$$29);
-					ZVAL_STRING(&_40$$29, "  ", 0);
-					zephir_fast_str_replace(&_38$$29, &_39$$29, &_40$$29, currentLine TSRMLS_CC);
-					ZEPHIR_SINIT_NVAR(_41$$29);
+					ZEPHIR_INIT_NVAR(&_38$$29);
+					ZEPHIR_INIT_NVAR(&_39$$29);
+					ZVAL_STRING(&_39$$29, "\t");
+					ZEPHIR_INIT_NVAR(&_40$$29);
+					ZVAL_STRING(&_40$$29, "  ");
+					zephir_fast_str_replace(&_38$$29, &_39$$29, &_40$$29, ¤tLine TSRMLS_CC);
 					ZVAL_LONG(&_41$$29, 2);
-					ZEPHIR_SINIT_NVAR(_42$$29);
-					ZVAL_STRING(&_42$$29, "UTF-8", 0);
-					ZEPHIR_CALL_FUNCTION(&_43$$29, "htmlentities", &_44, 177, _38$$29, &_41$$29, &_42$$29);
+					ZEPHIR_INIT_NVAR(&_42$$29);
+					ZVAL_STRING(&_42$$29, "UTF-8");
+					ZEPHIR_CALL_FUNCTION(&_43$$29, "htmlentities", &_44, 157, &_38$$29, &_41$$29, &_42$$29);
 					zephir_check_call_status();
-					zephir_concat_self(&html, _43$$29 TSRMLS_CC);
+					zephir_concat_self(&html, &_43$$29 TSRMLS_CC);
 				}
 				i++;
 			}
@@ -794,7 +959,7 @@ PHP_METHOD(Phalcon_Debug, showTraceItem) {
 		}
 	}
 	zephir_concat_self_str(&html, SL("") TSRMLS_CC);
-	RETURN_CCTOR(html);
+	RETURN_CCTOR(&html);
 
 }
 
@@ -804,25 +969,35 @@ PHP_METHOD(Phalcon_Debug, showTraceItem) {
 PHP_METHOD(Phalcon_Debug, onUncaughtLowSeverity) {
 
 	zend_long ZEPHIR_LAST_CALL_STATUS;
-	zval *severity, *message, *file, *line, *context, *_0 = NULL, _1, *_2$$3, *_3$$3;
+	zval *severity, severity_sub, *message, message_sub, *file, file_sub, *line, line_sub, *context, context_sub, _0, _1, _2$$3, _3$$3;
+	zval *this_ptr = getThis();
+
+	ZVAL_UNDEF(&severity_sub);
+	ZVAL_UNDEF(&message_sub);
+	ZVAL_UNDEF(&file_sub);
+	ZVAL_UNDEF(&line_sub);
+	ZVAL_UNDEF(&context_sub);
+	ZVAL_UNDEF(&_0);
+	ZVAL_UNDEF(&_1);
+	ZVAL_UNDEF(&_2$$3);
+	ZVAL_UNDEF(&_3$$3);
 
 	ZEPHIR_MM_GROW();
 	zephir_fetch_params(1, 5, 0, &severity, &message, &file, &line, &context);
 
 
 
-	ZEPHIR_CALL_FUNCTION(&_0, "error_reporting", NULL, 185);
+	ZEPHIR_CALL_FUNCTION(&_0, "error_reporting", NULL, 162);
 	zephir_check_call_status();
 	ZEPHIR_SINIT_VAR(_1);
-	zephir_bitwise_and_function(&_1, _0, severity TSRMLS_CC);
+	zephir_bitwise_and_function(&_1, &_0, severity TSRMLS_CC);
 	if (zephir_is_true(&_1)) {
-		ZEPHIR_INIT_VAR(_2$$3);
-		object_init_ex(_2$$3, zephir_get_internal_ce(SS("errorexception") TSRMLS_CC));
-		ZEPHIR_INIT_VAR(_3$$3);
-		ZVAL_LONG(_3$$3, 0);
-		ZEPHIR_CALL_METHOD(NULL, _2$$3, "__construct", NULL, 186, message, _3$$3, severity, file, line);
+		ZEPHIR_INIT_VAR(&_2$$3);
+		object_init_ex(&_2$$3, zephir_get_internal_ce(SL("errorexception")));
+		ZVAL_LONG(&_3$$3, 0);
+		ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 163, message, &_3$$3, severity, file, line);
 		zephir_check_call_status();
-		zephir_throw_exception_debug(_2$$3, "phalcon/debug.zep", 566 TSRMLS_CC);
+		zephir_throw_exception_debug(&_2$$3, "phalcon/debug.zep", 566 TSRMLS_CC);
 		ZEPHIR_MM_RESTORE();
 		return;
 	}
@@ -835,180 +1010,255 @@ PHP_METHOD(Phalcon_Debug, onUncaughtLowSeverity) {
  */
 PHP_METHOD(Phalcon_Debug, onUncaughtException) {
 
-	HashTable *_12$$5, *_17$$5, *_24$$5, *_31$$5, *_37$$13;
-	HashPosition _11$$5, _16$$5, _23$$5, _30$$5, _36$$13;
+	zend_string *_13$$5, *_18$$5, *_25$$5, *_32$$5, *_38$$13;
+	zend_ulong _12$$5, _17$$5, _24$$5, _31$$5, _37$$13;
 	zephir_fcall_cache_entry *_15 = NULL, *_21 = NULL, *_27 = NULL;
 	zend_long ZEPHIR_LAST_CALL_STATUS;
-	zval *exception, *_REQUEST, *_SERVER, *obLevel = NULL, *className = NULL, *escapedMessage = NULL, *html = NULL, *showBackTrace = NULL, *dataVars = NULL, *n = NULL, *traceItem = NULL, *keyRequest = NULL, *value = NULL, *keyServer = NULL, *keyFile = NULL, *keyVar = NULL, *dataVar = NULL, *_0, *_2 = NULL, *_3 = NULL, *_4, *_5 = NULL, *_6, *_7 = NULL, *_8 = NULL, *_9, *_42 = NULL, *_43, *_1$$4 = NULL, *_10$$5 = NULL, **_13$$5, **_18$$5, **_25$$5, *_29$$5 = NULL, **_32$$5, *_34$$5 = NULL, *_35$$5, *_14$$7 = NULL, *_19$$9 = NULL, *_20$$10 = NULL, *_22$$10 = NULL, *_26$$11 = NULL, *_28$$11 = NULL, *_33$$12 = NULL, **_38$$13, *_39$$14 = NULL, *_40$$14, *_41$$14 = NULL;
+	zval *exception, exception_sub, __$true, *_REQUEST, *_SERVER, __$false, obLevel, className, escapedMessage, html, showBackTrace, dataVars, n, traceItem, keyRequest, value, keyServer, keyFile, keyVar, dataVar, _0, _2, _3, _4, _5, _6, _7, _8, _9, _42, _43, _1$$4, _10$$5, *_11$$5, *_16$$5, *_23$$5, _29$$5, *_30$$5, _34$$5, _35$$5, _14$$7, _19$$9, _20$$10, _22$$10, _26$$11, _28$$11, _33$$12, *_36$$13, _39$$14, _40$$14, _41$$14;
+	zval *this_ptr = getThis();
+
+	ZVAL_UNDEF(&exception_sub);
+	ZVAL_BOOL(&__$true, 1);
+	ZVAL_BOOL(&__$false, 0);
+	ZVAL_UNDEF(&obLevel);
+	ZVAL_UNDEF(&className);
+	ZVAL_UNDEF(&escapedMessage);
+	ZVAL_UNDEF(&html);
+	ZVAL_UNDEF(&showBackTrace);
+	ZVAL_UNDEF(&dataVars);
+	ZVAL_UNDEF(&n);
+	ZVAL_UNDEF(&traceItem);
+	ZVAL_UNDEF(&keyRequest);
+	ZVAL_UNDEF(&value);
+	ZVAL_UNDEF(&keyServer);
+	ZVAL_UNDEF(&keyFile);
+	ZVAL_UNDEF(&keyVar);
+	ZVAL_UNDEF(&dataVar);
+	ZVAL_UNDEF(&_0);
+	ZVAL_UNDEF(&_2);
+	ZVAL_UNDEF(&_3);
+	ZVAL_UNDEF(&_4);
+	ZVAL_UNDEF(&_5);
+	ZVAL_UNDEF(&_6);
+	ZVAL_UNDEF(&_7);
+	ZVAL_UNDEF(&_8);
+	ZVAL_UNDEF(&_9);
+	ZVAL_UNDEF(&_42);
+	ZVAL_UNDEF(&_43);
+	ZVAL_UNDEF(&_1$$4);
+	ZVAL_UNDEF(&_10$$5);
+	ZVAL_UNDEF(&_29$$5);
+	ZVAL_UNDEF(&_34$$5);
+	ZVAL_UNDEF(&_35$$5);
+	ZVAL_UNDEF(&_14$$7);
+	ZVAL_UNDEF(&_19$$9);
+	ZVAL_UNDEF(&_20$$10);
+	ZVAL_UNDEF(&_22$$10);
+	ZVAL_UNDEF(&_26$$11);
+	ZVAL_UNDEF(&_28$$11);
+	ZVAL_UNDEF(&_33$$12);
+	ZVAL_UNDEF(&_39$$14);
+	ZVAL_UNDEF(&_40$$14);
+	ZVAL_UNDEF(&_41$$14);
 
 	ZEPHIR_MM_GROW();
-	zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC);
-	zephir_get_global(&_REQUEST, SS("_REQUEST") TSRMLS_CC);
+	zephir_get_global(&_SERVER, SL("_SERVER"));
+	zephir_get_global(&_REQUEST, SL("_REQUEST"));
 	zephir_fetch_params(1, 1, 0, &exception);
 
 
 
-	ZEPHIR_CALL_FUNCTION(&obLevel, "ob_get_level", NULL, 187);
+	ZEPHIR_CALL_FUNCTION(&obLevel, "ob_get_level", NULL, 164);
 	zephir_check_call_status();
-	if (ZEPHIR_GT_LONG(obLevel, 0)) {
-		ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 142);
+	if (ZEPHIR_GT_LONG(&obLevel, 0)) {
+		ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 123);
 		zephir_check_call_status();
 	}
-	_0 = zephir_fetch_static_property_ce(phalcon_debug_ce, SL("_isActive") TSRMLS_CC);
-	if (zephir_is_true(_0)) {
+	zephir_read_static_property_ce(&_0, phalcon_debug_ce, SL("_isActive"), PH_NOISY_CC | PH_READONLY);
+	if (zephir_is_true(&_0)) {
 		ZEPHIR_CALL_METHOD(&_1$$4, exception, "getmessage", NULL, 0);
 		zephir_check_call_status();
-		zend_print_zval(_1$$4, 0);
+		zend_print_zval(&_1$$4, 0);
 		RETURN_MM_NULL();
 	}
-	zephir_update_static_property_ce(phalcon_debug_ce, SL("_isActive"), &ZEPHIR_GLOBAL(global_true) TSRMLS_CC);
-	ZEPHIR_INIT_VAR(className);
-	zephir_get_class(className, exception, 0 TSRMLS_CC);
+	zend_update_static_property(phalcon_debug_ce, ZEND_STRL("_isActive"), &__$true);
+	ZEPHIR_INIT_VAR(&className);
+	zephir_get_class(&className, exception, 0 TSRMLS_CC);
 	ZEPHIR_CALL_METHOD(&_2, exception, "getmessage", NULL, 0);
 	zephir_check_call_status();
-	ZEPHIR_CALL_METHOD(&escapedMessage, this_ptr, "_escapestring", NULL, 0, _2);
+	ZEPHIR_CALL_METHOD(&escapedMessage, this_ptr, "_escapestring", NULL, 0, &_2);
 	zephir_check_call_status();
-	ZEPHIR_INIT_VAR(html);
-	ZEPHIR_CONCAT_SVSVS(html, "", className, ": ", escapedMessage, "");
+	ZEPHIR_INIT_VAR(&html);
+	ZEPHIR_CONCAT_SVSVS(&html, "", &className, ": ", &escapedMessage, "");
 	ZEPHIR_CALL_METHOD(&_3, this_ptr, "getcsssources", NULL, 0);
 	zephir_check_call_status();
-	ZEPHIR_INIT_VAR(_4);
-	ZEPHIR_CONCAT_VS(_4, _3, "");
-	zephir_concat_self(&html, _4 TSRMLS_CC);
+	ZEPHIR_INIT_VAR(&_4);
+	ZEPHIR_CONCAT_VS(&_4, &_3, "");
+	zephir_concat_self(&html, &_4 TSRMLS_CC);
 	ZEPHIR_CALL_METHOD(&_5, this_ptr, "getversion", NULL, 0);
 	zephir_check_call_status();
-	zephir_concat_self(&html, _5 TSRMLS_CC);
+	zephir_concat_self(&html, &_5 TSRMLS_CC);
 	zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - ZEPHIR_INIT_VAR(_6); - ZEPHIR_CONCAT_SVSVS(_6, "

", className, ": ", escapedMessage, "

"); - zephir_concat_self(&html, _6 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6); + ZEPHIR_CONCAT_SVSVS(&_6, "

", &className, ": ", &escapedMessage, "

"); + zephir_concat_self(&html, &_6 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_7, exception, "getfile", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_8, exception, "getline", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_9); - ZEPHIR_CONCAT_SVSVS(_9, "", _7, " (", _8, ")"); - zephir_concat_self(&html, _9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_9); + ZEPHIR_CONCAT_SVSVS(&_9, "", &_7, " (", &_8, ")"); + zephir_concat_self(&html, &_9 TSRMLS_CC); zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - ZEPHIR_OBS_VAR(showBackTrace); - zephir_read_property_this(&showBackTrace, this_ptr, SL("_showBackTrace"), PH_NOISY_CC); - if (zephir_is_true(showBackTrace)) { - ZEPHIR_OBS_VAR(dataVars); - zephir_read_property_this(&dataVars, this_ptr, SL("_data"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&showBackTrace); + zephir_read_property(&showBackTrace, this_ptr, SL("_showBackTrace"), PH_NOISY_CC); + if (zephir_is_true(&showBackTrace)) { + ZEPHIR_OBS_VAR(&dataVars); + zephir_read_property(&dataVars, this_ptr, SL("_data"), PH_NOISY_CC); zephir_concat_self_str(&html, SL("
    ") TSRMLS_CC); zephir_concat_self_str(&html, SL("
  • Backtrace
  • ") TSRMLS_CC); zephir_concat_self_str(&html, SL("
  • Request
  • ") TSRMLS_CC); zephir_concat_self_str(&html, SL("
  • Server
  • ") TSRMLS_CC); zephir_concat_self_str(&html, SL("
  • Included Files
  • ") TSRMLS_CC); zephir_concat_self_str(&html, SL("
  • Memory
  • ") TSRMLS_CC); - if (Z_TYPE_P(dataVars) == IS_ARRAY) { + if (Z_TYPE_P(&dataVars) == IS_ARRAY) { zephir_concat_self_str(&html, SL("
  • Variables
  • ") TSRMLS_CC); } zephir_concat_self_str(&html, SL("
") TSRMLS_CC); zephir_concat_self_str(&html, SL("
") TSRMLS_CC); ZEPHIR_CALL_METHOD(&_10$$5, exception, "gettrace", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_10$$5, &_12$$5, &_11$$5, 0, 0, "phalcon/debug.zep", 660); - for ( - ; zend_hash_get_current_data_ex(_12$$5, (void**) &_13$$5, &_11$$5) == SUCCESS - ; zend_hash_move_forward_ex(_12$$5, &_11$$5) - ) { - ZEPHIR_GET_HMKEY(n, _12$$5, _11$$5); - ZEPHIR_GET_HVALUE(traceItem, _13$$5); - ZEPHIR_CALL_METHOD(&_14$$7, this_ptr, "showtraceitem", &_15, 188, n, traceItem); + zephir_is_iterable(&_10$$5, 0, "phalcon/debug.zep", 660); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_10$$5), _12$$5, _13$$5, _11$$5) + { + ZEPHIR_INIT_NVAR(&n); + if (_13$$5 != NULL) { + ZVAL_STR_COPY(&n, _13$$5); + } else { + ZVAL_LONG(&n, _12$$5); + } + ZEPHIR_INIT_NVAR(&traceItem); + ZVAL_COPY(&traceItem, _11$$5); + ZEPHIR_CALL_METHOD(&_14$$7, this_ptr, "showtraceitem", &_15, 165, &n, &traceItem); zephir_check_call_status(); - zephir_concat_self(&html, _14$$7 TSRMLS_CC); - } + zephir_concat_self(&html, &_14$$7 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&traceItem); + ZEPHIR_INIT_NVAR(&n); zephir_concat_self_str(&html, SL("
") TSRMLS_CC); zephir_concat_self_str(&html, SL("
") TSRMLS_CC); zephir_concat_self_str(&html, SL("") TSRMLS_CC); - zephir_is_iterable(_REQUEST, &_17$$5, &_16$$5, 0, 0, "phalcon/debug.zep", 674); - for ( - ; zend_hash_get_current_data_ex(_17$$5, (void**) &_18$$5, &_16$$5) == SUCCESS - ; zend_hash_move_forward_ex(_17$$5, &_16$$5) - ) { - ZEPHIR_GET_HMKEY(keyRequest, _17$$5, _16$$5); - ZEPHIR_GET_HVALUE(value, _18$$5); - if (Z_TYPE_P(value) != IS_ARRAY) { + zephir_is_iterable(_REQUEST, 0, "phalcon/debug.zep", 674); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(_REQUEST), _17$$5, _18$$5, _16$$5) + { + ZEPHIR_INIT_NVAR(&keyRequest); + if (_18$$5 != NULL) { + ZVAL_STR_COPY(&keyRequest, _18$$5); + } else { + ZVAL_LONG(&keyRequest, _17$$5); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _16$$5); + if (Z_TYPE_P(&value) != IS_ARRAY) { ZEPHIR_INIT_LNVAR(_19$$9); - ZEPHIR_CONCAT_SVSVS(_19$$9, ""); - zephir_concat_self(&html, _19$$9 TSRMLS_CC); + ZEPHIR_CONCAT_SVSVS(&_19$$9, ""); + zephir_concat_self(&html, &_19$$9 TSRMLS_CC); } else { - ZEPHIR_CALL_FUNCTION(&_20$$10, "print_r", &_21, 189, value, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(&_20$$10, "print_r", &_21, 166, &value, &__$true); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_22$$10); - ZEPHIR_CONCAT_SVSVS(_22$$10, ""); - zephir_concat_self(&html, _22$$10 TSRMLS_CC); + ZEPHIR_CONCAT_SVSVS(&_22$$10, ""); + zephir_concat_self(&html, &_22$$10 TSRMLS_CC); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&keyRequest); zephir_concat_self_str(&html, SL("
KeyValue
", keyRequest, "", value, "
", &keyRequest, "", &value, "
", keyRequest, "", _20$$10, "
", &keyRequest, "", &_20$$10, "
") TSRMLS_CC); zephir_concat_self_str(&html, SL("
") TSRMLS_CC); zephir_concat_self_str(&html, SL("") TSRMLS_CC); - zephir_is_iterable(_SERVER, &_24$$5, &_23$$5, 0, 0, "phalcon/debug.zep", 684); - for ( - ; zend_hash_get_current_data_ex(_24$$5, (void**) &_25$$5, &_23$$5) == SUCCESS - ; zend_hash_move_forward_ex(_24$$5, &_23$$5) - ) { - ZEPHIR_GET_HMKEY(keyServer, _24$$5, _23$$5); - ZEPHIR_GET_HVALUE(value, _25$$5); - ZEPHIR_CALL_METHOD(&_26$$11, this_ptr, "_getvardump", &_27, 0, value); + zephir_is_iterable(_SERVER, 0, "phalcon/debug.zep", 684); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(_SERVER), _24$$5, _25$$5, _23$$5) + { + ZEPHIR_INIT_NVAR(&keyServer); + if (_25$$5 != NULL) { + ZVAL_STR_COPY(&keyServer, _25$$5); + } else { + ZVAL_LONG(&keyServer, _24$$5); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _23$$5); + ZEPHIR_CALL_METHOD(&_26$$11, this_ptr, "_getvardump", &_27, 0, &value); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_28$$11); - ZEPHIR_CONCAT_SVSVS(_28$$11, ""); - zephir_concat_self(&html, _28$$11 TSRMLS_CC); - } + ZEPHIR_CONCAT_SVSVS(&_28$$11, ""); + zephir_concat_self(&html, &_28$$11 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&keyServer); zephir_concat_self_str(&html, SL("
KeyValue
", keyServer, "", _26$$11, "
", &keyServer, "", &_26$$11, "
") TSRMLS_CC); zephir_concat_self_str(&html, SL("
") TSRMLS_CC); zephir_concat_self_str(&html, SL("") TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_29$$5, "get_included_files", NULL, 190); + ZEPHIR_CALL_FUNCTION(&_29$$5, "get_included_files", NULL, 167); zephir_check_call_status(); - zephir_is_iterable(_29$$5, &_31$$5, &_30$$5, 0, 0, "phalcon/debug.zep", 694); - for ( - ; zend_hash_get_current_data_ex(_31$$5, (void**) &_32$$5, &_30$$5) == SUCCESS - ; zend_hash_move_forward_ex(_31$$5, &_30$$5) - ) { - ZEPHIR_GET_HMKEY(keyFile, _31$$5, _30$$5); - ZEPHIR_GET_HVALUE(value, _32$$5); + zephir_is_iterable(&_29$$5, 0, "phalcon/debug.zep", 694); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_29$$5), _31$$5, _32$$5, _30$$5) + { + ZEPHIR_INIT_NVAR(&keyFile); + if (_32$$5 != NULL) { + ZVAL_STR_COPY(&keyFile, _32$$5); + } else { + ZVAL_LONG(&keyFile, _31$$5); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _30$$5); ZEPHIR_INIT_LNVAR(_33$$12); - ZEPHIR_CONCAT_SVSVS(_33$$12, ""); - zephir_concat_self(&html, _33$$12 TSRMLS_CC); - } + ZEPHIR_CONCAT_SVSVS(&_33$$12, ""); + zephir_concat_self(&html, &_33$$12 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&keyFile); zephir_concat_self_str(&html, SL("
#Path
", keyFile, "", value, "
", &keyFile, "", &value, "
") TSRMLS_CC); zephir_concat_self_str(&html, SL("
") TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_34$$5, "memory_get_usage", NULL, 191, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(&_34$$5, "memory_get_usage", NULL, 168, &__$true); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_35$$5); - ZEPHIR_CONCAT_SVS(_35$$5, ""); - zephir_concat_self(&html, _35$$5 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_35$$5); + ZEPHIR_CONCAT_SVS(&_35$$5, ""); + zephir_concat_self(&html, &_35$$5 TSRMLS_CC); zephir_concat_self_str(&html, SL("
Memory
Usage", _34$$5, "
Memory
Usage", &_34$$5, "
") TSRMLS_CC); - if (Z_TYPE_P(dataVars) == IS_ARRAY) { + if (Z_TYPE_P(&dataVars) == IS_ARRAY) { zephir_concat_self_str(&html, SL("
") TSRMLS_CC); zephir_concat_self_str(&html, SL("") TSRMLS_CC); - zephir_is_iterable(dataVars, &_37$$13, &_36$$13, 0, 0, "phalcon/debug.zep", 712); - for ( - ; zend_hash_get_current_data_ex(_37$$13, (void**) &_38$$13, &_36$$13) == SUCCESS - ; zend_hash_move_forward_ex(_37$$13, &_36$$13) - ) { - ZEPHIR_GET_HMKEY(keyVar, _37$$13, _36$$13); - ZEPHIR_GET_HVALUE(dataVar, _38$$13); - zephir_array_fetch_long(&_40$$14, dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/debug.zep", 710 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_39$$14, this_ptr, "_getvardump", &_27, 0, _40$$14); + zephir_is_iterable(&dataVars, 0, "phalcon/debug.zep", 712); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&dataVars), _37$$13, _38$$13, _36$$13) + { + ZEPHIR_INIT_NVAR(&keyVar); + if (_38$$13 != NULL) { + ZVAL_STR_COPY(&keyVar, _38$$13); + } else { + ZVAL_LONG(&keyVar, _37$$13); + } + ZEPHIR_INIT_NVAR(&dataVar); + ZVAL_COPY(&dataVar, _36$$13); + zephir_array_fetch_long(&_40$$14, &dataVar, 0, PH_NOISY | PH_READONLY, "phalcon/debug.zep", 710 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_39$$14, this_ptr, "_getvardump", &_27, 0, &_40$$14); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_41$$14); - ZEPHIR_CONCAT_SVSVS(_41$$14, ""); - zephir_concat_self(&html, _41$$14 TSRMLS_CC); - } + ZEPHIR_CONCAT_SVSVS(&_41$$14, ""); + zephir_concat_self(&html, &_41$$14 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&dataVar); + ZEPHIR_INIT_NVAR(&keyVar); zephir_concat_self_str(&html, SL("
KeyValue
", keyVar, "", _39$$14, "
", &keyVar, "", &_39$$14, "
") TSRMLS_CC); } zephir_concat_self_str(&html, SL("
") TSRMLS_CC); } ZEPHIR_CALL_METHOD(&_42, this_ptr, "getjssources", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_43); - ZEPHIR_CONCAT_VS(_43, _42, "
"); - zephir_concat_self(&html, _43 TSRMLS_CC); - zend_print_zval(html, 0); - zephir_update_static_property_ce(phalcon_debug_ce, SL("_isActive"), &ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + ZEPHIR_INIT_VAR(&_43); + ZEPHIR_CONCAT_VS(&_43, &_42, "
"); + zephir_concat_self(&html, &_43 TSRMLS_CC); + zend_print_zval(&html, 0); + zend_update_static_property(phalcon_debug_ce, ZEND_STRL("_isActive"), &__$false); RETURN_MM_BOOL(1); } diff --git a/ext/phalcon/debug.zep.h b/ext/phalcon/debug.zep.h index e5727baa35c..502fbd25b36 100644 --- a/ext/phalcon/debug.zep.h +++ b/ext/phalcon/debug.zep.h @@ -24,47 +24,164 @@ PHP_METHOD(Phalcon_Debug, showTraceItem); PHP_METHOD(Phalcon_Debug, onUncaughtLowSeverity); PHP_METHOD(Phalcon_Debug, onUncaughtException); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_seturi, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_seturi, 0, 1, Phalcon\\Debug, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_seturi, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) +#else ZEND_ARG_INFO(0, uri) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_setshowbacktrace, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_setshowbacktrace, 0, 1, Phalcon\\Debug, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_setshowbacktrace, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, showBackTrace, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, showBackTrace) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_setshowfiles, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_setshowfiles, 0, 1, Phalcon\\Debug, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_setshowfiles, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, showFiles, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, showFiles) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_setshowfilefragment, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_setshowfilefragment, 0, 1, Phalcon\\Debug, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_setshowfilefragment, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, showFileFragment, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, showFileFragment) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_listen, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_listen, 0, 0, Phalcon\\Debug, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_listen, 0, 0, IS_OBJECT, "Phalcon\\Debug", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, exceptions, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, exceptions) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lowSeverity, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, lowSeverity) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_debugvar, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_listenexceptions, 0, 0, Phalcon\\Debug, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_listenexceptions, 0, 0, IS_OBJECT, "Phalcon\\Debug", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_listenlowseverity, 0, 0, Phalcon\\Debug, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_listenlowseverity, 0, 0, IS_OBJECT, "Phalcon\\Debug", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_debugvar, 0, 1, Phalcon\\Debug, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_debugvar, 0, 1, IS_OBJECT, "Phalcon\\Debug", 0) +#endif ZEND_ARG_INFO(0, varz) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 1) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug__escapestring, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_debug_clearvars, 0, 0, Phalcon\\Debug, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_clearvars, 0, 0, IS_OBJECT, "Phalcon\\Debug", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug__escapestring, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug__escapestring, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug__getarraydump, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug__getarraydump, 0, 1, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug__getarraydump, 0, 1, IS_STRING, NULL, 1) +#endif ZEND_ARG_ARRAY_INFO(0, argument, 0) ZEND_ARG_INFO(0, n) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug__getvardump, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug__getvardump, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug__getvardump, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, variable) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getmajorversion, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getmajorversion, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getversion, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getversion, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getcsssources, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getcsssources, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getjssources, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_getjssources, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_showtraceitem, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, n, IS_LONG, 0) +#else ZEND_ARG_INFO(0, n) +#endif ZEND_ARG_ARRAY_INFO(0, trace, 0) ZEND_END_ARG_INFO() @@ -76,7 +193,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_onuncaughtlowseverity, 0, 0, 5) ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_onuncaughtexception, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_onuncaughtexception, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_onuncaughtexception, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, exception, Exception, 0) ZEND_END_ARG_INFO() @@ -86,18 +207,18 @@ ZEPHIR_INIT_FUNCS(phalcon_debug_method_entry) { PHP_ME(Phalcon_Debug, setShowFiles, arginfo_phalcon_debug_setshowfiles, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug, setShowFileFragment, arginfo_phalcon_debug_setshowfilefragment, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug, listen, arginfo_phalcon_debug_listen, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, listenExceptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, listenLowSeverity, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Debug, listenExceptions, arginfo_phalcon_debug_listenexceptions, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Debug, listenLowSeverity, arginfo_phalcon_debug_listenlowseverity, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug, halt, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug, debugVar, arginfo_phalcon_debug_debugvar, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, clearVars, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Debug, clearVars, arginfo_phalcon_debug_clearvars, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug, _escapeString, arginfo_phalcon_debug__escapestring, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Debug, _getArrayDump, arginfo_phalcon_debug__getarraydump, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Debug, _getVarDump, arginfo_phalcon_debug__getvardump, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Debug, getMajorVersion, NULL, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, getVersion, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, getCssSources, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug, getJsSources, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Debug, getMajorVersion, arginfo_phalcon_debug_getmajorversion, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Debug, getVersion, arginfo_phalcon_debug_getversion, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Debug, getCssSources, arginfo_phalcon_debug_getcsssources, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Debug, getJsSources, arginfo_phalcon_debug_getjssources, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug, showTraceItem, arginfo_phalcon_debug_showtraceitem, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Debug, onUncaughtLowSeverity, arginfo_phalcon_debug_onuncaughtlowseverity, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug, onUncaughtException, arginfo_phalcon_debug_onuncaughtexception, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/debug/dump.zep.c b/ext/phalcon/debug/dump.zep.c index 2cd74a76884..6d7724ec0b2 100644 --- a/ext/phalcon/debug/dump.zep.c +++ b/ext/phalcon/debug/dump.zep.c @@ -60,7 +60,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Debug_Dump) { PHP_METHOD(Phalcon_Debug_Dump, getDetailed) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_detailed"); @@ -68,13 +69,16 @@ PHP_METHOD(Phalcon_Debug_Dump, getDetailed) { PHP_METHOD(Phalcon_Debug_Dump, setDetailed) { - zval *detailed; + zval *detailed, detailed_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&detailed_sub); zephir_fetch_params(0, 1, 0, &detailed); - zephir_update_property_this(getThis(), SL("_detailed"), detailed TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_detailed"), detailed); RETURN_THISW(); } @@ -88,17 +92,22 @@ PHP_METHOD(Phalcon_Debug_Dump, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool detailed; - zval *styles_param = NULL, *detailed_param = NULL; - zval *styles = NULL; + zval *styles_param = NULL, *detailed_param = NULL, __$true, __$false; + zval styles; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&styles); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &styles_param, &detailed_param); if (!styles_param) { - ZEPHIR_INIT_VAR(styles); - array_init(styles); + ZEPHIR_INIT_VAR(&styles); + array_init(&styles); } else { - zephir_get_arrval(styles, styles_param); + zephir_get_arrval(&styles, styles_param); } if (!detailed_param) { detailed = 0; @@ -107,12 +116,12 @@ PHP_METHOD(Phalcon_Debug_Dump, __construct) { } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstyles", NULL, 0, styles); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstyles", NULL, 0, &styles); zephir_check_call_status(); if (detailed) { - zephir_update_property_this(getThis(), SL("_detailed"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_detailed"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_detailed"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_detailed"), &__$false); } ZEPHIR_MM_RESTORE(); @@ -126,21 +135,25 @@ PHP_METHOD(Phalcon_Debug_Dump, __construct) { */ PHP_METHOD(Phalcon_Debug_Dump, all) { - zval *_1 = NULL; - zval *_0; + zval _1; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_0, this_ptr); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "variables", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_INIT_NVAR(_1); - zephir_get_args(_1 TSRMLS_CC); - ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, _0, _1); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, this_ptr); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "variables"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_INIT_NVAR(&_1); + zephir_get_args(&_1); + ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -151,29 +164,34 @@ PHP_METHOD(Phalcon_Debug_Dump, all) { */ PHP_METHOD(Phalcon_Debug_Dump, getStyle) { - zval *type_param = NULL, *style = NULL, *_0; - zval *type = NULL; + zval *type_param = NULL, style, _0; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&style); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &type_param); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_styles"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&style, _0, type, 1 TSRMLS_CC)) { - RETURN_CTOR(style); + zephir_read_property(&_0, this_ptr, SL("_styles"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&style, &_0, &type, 1 TSRMLS_CC)) { + RETURN_CTOR(&style); } else { - RETURN_MM_STRING("color:gray", 1); + RETURN_MM_STRING("color:gray"); } } @@ -183,44 +201,49 @@ PHP_METHOD(Phalcon_Debug_Dump, getStyle) { */ PHP_METHOD(Phalcon_Debug_Dump, setStyles) { - zval *styles_param = NULL, *defaultStyles = NULL, *_0; - zval *styles = NULL; + zval *styles_param = NULL, defaultStyles, _0; + zval styles; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&styles); + ZVAL_UNDEF(&defaultStyles); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &styles_param); if (!styles_param) { - ZEPHIR_INIT_VAR(styles); - array_init(styles); + ZEPHIR_INIT_VAR(&styles); + array_init(&styles); } else { - zephir_get_arrval(styles, styles_param); + zephir_get_arrval(&styles, styles_param); } if (1 == 0) { - ZEPHIR_INIT_NVAR(styles); - array_init(styles); + ZEPHIR_INIT_NVAR(&styles); + array_init(&styles); } if (1 != 1) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_debug_exception_ce, "The styles must be an array", "phalcon/debug/dump.zep", 101); return; } - ZEPHIR_INIT_VAR(defaultStyles); - zephir_create_array(defaultStyles, 11, 0 TSRMLS_CC); - add_assoc_stringl_ex(defaultStyles, SS("pre"), SL("background-color:#f3f3f3; font-size:11px; padding:10px; border:1px solid #ccc; text-align:left; color:#333"), 1); - add_assoc_stringl_ex(defaultStyles, SS("arr"), SL("color:red"), 1); - add_assoc_stringl_ex(defaultStyles, SS("bool"), SL("color:green"), 1); - add_assoc_stringl_ex(defaultStyles, SS("float"), SL("color:fuchsia"), 1); - add_assoc_stringl_ex(defaultStyles, SS("int"), SL("color:blue"), 1); - add_assoc_stringl_ex(defaultStyles, SS("null"), SL("color:black"), 1); - add_assoc_stringl_ex(defaultStyles, SS("num"), SL("color:navy"), 1); - add_assoc_stringl_ex(defaultStyles, SS("obj"), SL("color:purple"), 1); - add_assoc_stringl_ex(defaultStyles, SS("other"), SL("color:maroon"), 1); - add_assoc_stringl_ex(defaultStyles, SS("res"), SL("color:lime"), 1); - add_assoc_stringl_ex(defaultStyles, SS("str"), SL("color:teal"), 1); - ZEPHIR_INIT_VAR(_0); - zephir_fast_array_merge(_0, &(defaultStyles), &(styles) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_styles"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&defaultStyles); + zephir_create_array(&defaultStyles, 11, 0 TSRMLS_CC); + add_assoc_stringl_ex(&defaultStyles, SL("pre"), SL("background-color:#f3f3f3; font-size:11px; padding:10px; border:1px solid #ccc; text-align:left; color:#333")); + add_assoc_stringl_ex(&defaultStyles, SL("arr"), SL("color:red")); + add_assoc_stringl_ex(&defaultStyles, SL("bool"), SL("color:green")); + add_assoc_stringl_ex(&defaultStyles, SL("float"), SL("color:fuchsia")); + add_assoc_stringl_ex(&defaultStyles, SL("int"), SL("color:blue")); + add_assoc_stringl_ex(&defaultStyles, SL("null"), SL("color:black")); + add_assoc_stringl_ex(&defaultStyles, SL("num"), SL("color:navy")); + add_assoc_stringl_ex(&defaultStyles, SL("obj"), SL("color:purple")); + add_assoc_stringl_ex(&defaultStyles, SL("other"), SL("color:maroon")); + add_assoc_stringl_ex(&defaultStyles, SL("res"), SL("color:lime")); + add_assoc_stringl_ex(&defaultStyles, SL("str"), SL("color:teal")); + ZEPHIR_INIT_VAR(&_0); + zephir_fast_array_merge(&_0, &defaultStyles, &styles TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_styles"), &_0); RETURN_MM_MEMBER(getThis(), "_styles"); } @@ -231,21 +254,25 @@ PHP_METHOD(Phalcon_Debug_Dump, setStyles) { PHP_METHOD(Phalcon_Debug_Dump, one) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name = NULL; - zval *variable, *name_param = NULL; + zval name; + zval *variable, variable_sub, *name_param = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&variable_sub); + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &variable, &name_param); if (!name_param) { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_STRING(&name, ""); } else { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "variable", NULL, 0, variable, name); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "variable", NULL, 0, variable, &name); zephir_check_call_status(); RETURN_MM(); @@ -256,24 +283,137 @@ PHP_METHOD(Phalcon_Debug_Dump, one) { */ PHP_METHOD(Phalcon_Debug_Dump, output) { - zend_class_entry *_59$$14; - zend_bool _15$$5, _16$$5, _17$$5, _34$$8; - HashTable *_6$$4, *_40$$11, *_53$$13, *_83$$16; - HashPosition _5$$4, _39$$11, _52$$13, _82$$16; - zval *_130, *_1$$4, *_11$$5 = NULL, *_24$$8, *_75$$8, *_29$$9, *_44$$12 = NULL, *_66$$14 = NULL, *_88$$18 = NULL, *_94$$19 = NULL, *_102$$20, *_107$$21, *_111$$22, *_115$$23, *_121$$24, *_126$$25; - zephir_fcall_cache_entry *_10 = NULL, *_21 = NULL, *_56 = NULL, *_57 = NULL, *_60 = NULL, *_62 = NULL, *_71 = NULL; + zend_class_entry *_54$$14; + zend_bool _14$$5, _15$$5, _16$$5, _32$$8; + zend_string *_6$$4, *_39$$11; + zend_ulong _5$$4, _38$$11; + zval _117, _1$$4, _10$$5, _24$$8, _70$$8, _28$$9, _42$$12, _60$$14, _80$$18, _86$$19, _95$$20, _99$$21, _102$$22, _105$$23, _110$$24, _114$$25; + zephir_fcall_cache_entry *_9 = NULL, *_20 = NULL, *_51 = NULL, *_52 = NULL, *_55 = NULL, *_57 = NULL, *_66 = NULL; zend_long tab, ZEPHIR_LAST_CALL_STATUS; - zval *name = NULL, *_0$$3; - zval *variable, *name_param = NULL, *tab_param = NULL, *key = NULL, *value = NULL, *output = NULL, *space = NULL, *type = NULL, *attr = NULL, *_106 = NULL, *_131 = NULL, *_132, _133, *_2$$4 = NULL, *_3$$4, _4$$4 = zval_used_for_init, **_7$$4, *_23$$4 = NULL, _8$$5 = zval_used_for_init, *_9$$5 = NULL, *_12$$5 = NULL, *_13$$5 = NULL, *_14$$5 = NULL, *_18$$7 = NULL, *_19$$7 = NULL, *_20$$7 = NULL, *_22$$7 = NULL, *_25$$8 = NULL, *_26$$8 = NULL, _27$$8 = zval_used_for_init, *_28$$8 = NULL, *_33$$8, *_74$$8 = NULL, *_76$$8 = NULL, *_77$$8, *_78$$8, *_101$$8 = NULL, *_30$$9 = NULL, *_31$$9, _32$$9, _35$$10, *_36$$10 = NULL, *_37$$10, *_38$$11 = NULL, **_41$$11, _42$$12 = zval_used_for_init, *_43$$12 = NULL, *_45$$12 = NULL, *_46$$12 = NULL, *_47$$12 = NULL, *_48$$12 = NULL, *_49$$12 = NULL, *_50$$12 = NULL, *reflect$$13 = NULL, *props$$13 = NULL, *property$$13 = NULL, *_51$$13, **_54$$13, *_55$$14 = NULL, *_58$$14 = NULL, *_61$$14 = NULL, _63$$14 = zval_used_for_init, _64$$14 = zval_used_for_init, *_65$$14 = NULL, *_67$$14 = NULL, *_68$$14 = NULL, *_69$$14 = NULL, *_70$$14 = NULL, *_72$$14 = NULL, *_73$$14 = NULL, _79$$15, *_80$$15 = NULL, *_81$$15, **_84$$16, _98$$16, *_99$$16 = NULL, *_100$$16, *_85$$17 = NULL, _86$$18 = zval_used_for_init, *_87$$18 = NULL, *_89$$18 = NULL, *_90$$18 = NULL, *_91$$18 = NULL, _92$$19 = zval_used_for_init, *_93$$19 = NULL, *_95$$19 = NULL, *_96$$19 = NULL, *_97$$19 = NULL, *_103$$20 = NULL, *_104$$20, _105$$20, *_108$$21 = NULL, *_109$$21, _110$$21, *_112$$22 = NULL, *_113$$22, _114$$22, *_116$$23 = NULL, *_117$$23, _118$$23 = zval_used_for_init, _119$$23, *_120$$23 = NULL, *_122$$24 = NULL, *_123$$24, *_124$$24 = NULL, _125$$24, *_127$$25 = NULL, *_128$$25, _129$$25; + zval name, _0$$3; + zval *variable, variable_sub, *name_param = NULL, *tab_param = NULL, key, value, output, space, type, attr, _98, _118, _119, _2$$4, _3$$4, *_4$$4, _22$$4, _23$$4, _7$$5, _8$$5, _11$$5, _12$$5, _13$$5, _17$$7, _18$$7, _19$$7, _21$$7, _25$$8, _26$$8, _27$$8, _31$$8, _68$$8, _69$$8, _71$$8, _72$$8, _93$$8, _94$$8, _29$$9, _30$$9, _33$$10, _34$$10, _35$$10, _36$$11, *_37$$11, _40$$12, _41$$12, _43$$12, _44$$12, _45$$12, _46$$12, _47$$12, reflect$$13, props$$13, property$$13, _48$$13, *_49$$13, _50$$14, _53$$14, _56$$14, _58$$14, _59$$14, _61$$14, _62$$14, _63$$14, _64$$14, _65$$14, _67$$14, _73$$15, _74$$15, _75$$15, *_76$$16, _90$$16, _91$$16, _92$$16, _77$$17, _78$$18, _79$$18, _81$$18, _82$$18, _83$$18, _84$$19, _85$$19, _87$$19, _88$$19, _89$$19, _96$$20, _97$$20, _100$$21, _101$$21, _103$$22, _104$$22, _106$$23, _107$$23, _108$$23, _109$$23, _111$$24, _112$$24, _113$$24, _115$$25, _116$$25; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&variable_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&output); + ZVAL_UNDEF(&space); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&attr); + ZVAL_UNDEF(&_98); + ZVAL_UNDEF(&_118); + ZVAL_UNDEF(&_119); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_22$$4); + ZVAL_UNDEF(&_23$$4); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_12$$5); + ZVAL_UNDEF(&_13$$5); + ZVAL_UNDEF(&_17$$7); + ZVAL_UNDEF(&_18$$7); + ZVAL_UNDEF(&_19$$7); + ZVAL_UNDEF(&_21$$7); + ZVAL_UNDEF(&_25$$8); + ZVAL_UNDEF(&_26$$8); + ZVAL_UNDEF(&_27$$8); + ZVAL_UNDEF(&_31$$8); + ZVAL_UNDEF(&_68$$8); + ZVAL_UNDEF(&_69$$8); + ZVAL_UNDEF(&_71$$8); + ZVAL_UNDEF(&_72$$8); + ZVAL_UNDEF(&_93$$8); + ZVAL_UNDEF(&_94$$8); + ZVAL_UNDEF(&_29$$9); + ZVAL_UNDEF(&_30$$9); + ZVAL_UNDEF(&_33$$10); + ZVAL_UNDEF(&_34$$10); + ZVAL_UNDEF(&_35$$10); + ZVAL_UNDEF(&_36$$11); + ZVAL_UNDEF(&_40$$12); + ZVAL_UNDEF(&_41$$12); + ZVAL_UNDEF(&_43$$12); + ZVAL_UNDEF(&_44$$12); + ZVAL_UNDEF(&_45$$12); + ZVAL_UNDEF(&_46$$12); + ZVAL_UNDEF(&_47$$12); + ZVAL_UNDEF(&reflect$$13); + ZVAL_UNDEF(&props$$13); + ZVAL_UNDEF(&property$$13); + ZVAL_UNDEF(&_48$$13); + ZVAL_UNDEF(&_50$$14); + ZVAL_UNDEF(&_53$$14); + ZVAL_UNDEF(&_56$$14); + ZVAL_UNDEF(&_58$$14); + ZVAL_UNDEF(&_59$$14); + ZVAL_UNDEF(&_61$$14); + ZVAL_UNDEF(&_62$$14); + ZVAL_UNDEF(&_63$$14); + ZVAL_UNDEF(&_64$$14); + ZVAL_UNDEF(&_65$$14); + ZVAL_UNDEF(&_67$$14); + ZVAL_UNDEF(&_73$$15); + ZVAL_UNDEF(&_74$$15); + ZVAL_UNDEF(&_75$$15); + ZVAL_UNDEF(&_90$$16); + ZVAL_UNDEF(&_91$$16); + ZVAL_UNDEF(&_92$$16); + ZVAL_UNDEF(&_77$$17); + ZVAL_UNDEF(&_78$$18); + ZVAL_UNDEF(&_79$$18); + ZVAL_UNDEF(&_81$$18); + ZVAL_UNDEF(&_82$$18); + ZVAL_UNDEF(&_83$$18); + ZVAL_UNDEF(&_84$$19); + ZVAL_UNDEF(&_85$$19); + ZVAL_UNDEF(&_87$$19); + ZVAL_UNDEF(&_88$$19); + ZVAL_UNDEF(&_89$$19); + ZVAL_UNDEF(&_96$$20); + ZVAL_UNDEF(&_97$$20); + ZVAL_UNDEF(&_100$$21); + ZVAL_UNDEF(&_101$$21); + ZVAL_UNDEF(&_103$$22); + ZVAL_UNDEF(&_104$$22); + ZVAL_UNDEF(&_106$$23); + ZVAL_UNDEF(&_107$$23); + ZVAL_UNDEF(&_108$$23); + ZVAL_UNDEF(&_109$$23); + ZVAL_UNDEF(&_111$$24); + ZVAL_UNDEF(&_112$$24); + ZVAL_UNDEF(&_113$$24); + ZVAL_UNDEF(&_115$$25); + ZVAL_UNDEF(&_116$$25); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_117); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_24$$8); + ZVAL_UNDEF(&_70$$8); + ZVAL_UNDEF(&_28$$9); + ZVAL_UNDEF(&_42$$12); + ZVAL_UNDEF(&_60$$14); + ZVAL_UNDEF(&_80$$18); + ZVAL_UNDEF(&_86$$19); + ZVAL_UNDEF(&_95$$20); + ZVAL_UNDEF(&_99$$21); + ZVAL_UNDEF(&_102$$22); + ZVAL_UNDEF(&_105$$23); + ZVAL_UNDEF(&_110$$24); + ZVAL_UNDEF(&_114$$25); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &variable, &name_param, &tab_param); if (!name_param) { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_STRING(&name, ""); } else { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } if (!tab_param) { tab = 1; @@ -282,489 +422,465 @@ PHP_METHOD(Phalcon_Debug_Dump, output) { } - ZEPHIR_INIT_VAR(space); - ZVAL_STRING(space, " ", 1); - ZEPHIR_INIT_VAR(output); - ZVAL_STRING(output, "", 1); - if (!(!name) && Z_STRLEN_P(name)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_VS(_0$$3, name, " "); - ZEPHIR_CPY_WRT(output, _0$$3); + ZEPHIR_INIT_VAR(&space); + ZVAL_STRING(&space, " "); + ZEPHIR_INIT_VAR(&output); + ZVAL_STRING(&output, ""); + if (!(Z_TYPE_P(&name) == IS_UNDEF) && Z_STRLEN_P(&name)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_VS(&_0$$3, &name, " "); + ZEPHIR_CPY_WRT(&output, &_0$$3); } if (Z_TYPE_P(variable) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_1$$4); - zephir_create_array(_1$$4, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_STRING(_3$$4, "arr", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getstyle", NULL, 0, _3$$4); - zephir_check_temp_parameter(_3$$4); + ZEPHIR_INIT_VAR(&_1$$4); + zephir_create_array(&_1$$4, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$4); + ZVAL_STRING(&_3$$4, "arr"); + ZEPHIR_CALL_METHOD(&_2$$4, this_ptr, "getstyle", NULL, 0, &_3$$4); zephir_check_call_status(); zephir_array_update_string(&_1$$4, SL(":style"), &_2$$4, PH_COPY | PH_SEPARATE); - add_assoc_long_ex(_1$$4, SS(":count"), zephir_fast_count_int(variable TSRMLS_CC)); - ZEPHIR_SINIT_VAR(_4$$4); - ZVAL_STRING(&_4$$4, "Array (:count) (\n", 0); - ZEPHIR_CALL_FUNCTION(&_2$$4, "strtr", NULL, 27, &_4$$4, _1$$4); + add_assoc_long_ex(&_1$$4, SL(":count"), zephir_fast_count_int(variable TSRMLS_CC)); + ZEPHIR_INIT_NVAR(&_3$$4); + ZVAL_STRING(&_3$$4, "Array (:count) (\n"); + ZEPHIR_CALL_FUNCTION(&_2$$4, "strtr", NULL, 22, &_3$$4, &_1$$4); zephir_check_call_status(); - zephir_concat_self(&output, _2$$4 TSRMLS_CC); - zephir_is_iterable(variable, &_6$$4, &_5$$4, 0, 0, "phalcon/debug/dump.zep", 161); - for ( - ; zend_hash_get_current_data_ex(_6$$4, (void**) &_7$$4, &_5$$4) == SUCCESS - ; zend_hash_move_forward_ex(_6$$4, &_5$$4) - ) { - ZEPHIR_GET_HMKEY(key, _6$$4, _5$$4); - ZEPHIR_GET_HVALUE(value, _7$$4); - ZEPHIR_SINIT_NVAR(_8$$5); - ZVAL_LONG(&_8$$5, tab); - ZEPHIR_CALL_FUNCTION(&_9$$5, "str_repeat", &_10, 153, space, &_8$$5); + zephir_concat_self(&output, &_2$$4 TSRMLS_CC); + zephir_is_iterable(variable, 0, "phalcon/debug/dump.zep", 161); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(variable), _5$$4, _6$$4, _4$$4) + { + ZEPHIR_INIT_NVAR(&key); + if (_6$$4 != NULL) { + ZVAL_STR_COPY(&key, _6$$4); + } else { + ZVAL_LONG(&key, _5$$4); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _4$$4); + ZVAL_LONG(&_7$$5, tab); + ZEPHIR_CALL_FUNCTION(&_8$$5, "str_repeat", &_9, 133, &space, &_7$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_11$$5); - zephir_create_array(_11$$5, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_13$$5); - ZVAL_STRING(_13$$5, "arr", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "getstyle", NULL, 0, _13$$5); - zephir_check_temp_parameter(_13$$5); + ZEPHIR_INIT_NVAR(&_10$$5); + zephir_create_array(&_10$$5, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_12$$5); + ZVAL_STRING(&_12$$5, "arr"); + ZEPHIR_CALL_METHOD(&_11$$5, this_ptr, "getstyle", NULL, 0, &_12$$5); zephir_check_call_status(); - zephir_array_update_string(&_11$$5, SL(":style"), &_12$$5, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_11$$5, SL(":key"), &key, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_NVAR(_8$$5); - ZVAL_STRING(&_8$$5, "[:key] => ", 0); - ZEPHIR_CALL_FUNCTION(&_12$$5, "strtr", NULL, 27, &_8$$5, _11$$5); + zephir_array_update_string(&_10$$5, SL(":style"), &_11$$5, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_10$$5, SL(":key"), &key, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_12$$5); + ZVAL_STRING(&_12$$5, "[:key] => "); + ZEPHIR_CALL_FUNCTION(&_11$$5, "strtr", NULL, 22, &_12$$5, &_10$$5); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_14$$5); - ZEPHIR_CONCAT_VV(_14$$5, _9$$5, _12$$5); - zephir_concat_self(&output, _14$$5 TSRMLS_CC); - _15$$5 = tab == 1; + ZEPHIR_INIT_LNVAR(_13$$5); + ZEPHIR_CONCAT_VV(&_13$$5, &_8$$5, &_11$$5); + zephir_concat_self(&output, &_13$$5 TSRMLS_CC); + _14$$5 = tab == 1; + if (_14$$5) { + _14$$5 = !ZEPHIR_IS_STRING(&name, ""); + } + _15$$5 = _14$$5; if (_15$$5) { - _15$$5 = !ZEPHIR_IS_STRING(name, ""); + _15$$5 = !(Z_TYPE_P(&key) == IS_LONG); } _16$$5 = _15$$5; if (_16$$5) { - _16$$5 = !(Z_TYPE_P(key) == IS_LONG); + _16$$5 = ZEPHIR_IS_EQUAL(&name, &key); } - _17$$5 = _16$$5; - if (_17$$5) { - _17$$5 = ZEPHIR_IS_EQUAL(name, key); - } - if (_17$$5) { + if (_16$$5) { continue; } else { - ZEPHIR_INIT_NVAR(_19$$7); - ZVAL_STRING(_19$$7, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_20$$7); - ZVAL_LONG(_20$$7, (tab + 1)); - ZEPHIR_CALL_METHOD(&_18$$7, this_ptr, "output", &_21, 192, value, _19$$7, _20$$7); - zephir_check_temp_parameter(_19$$7); + ZEPHIR_INIT_NVAR(&_18$$7); + ZVAL_STRING(&_18$$7, ""); + ZVAL_LONG(&_19$$7, (tab + 1)); + ZEPHIR_CALL_METHOD(&_17$$7, this_ptr, "output", &_20, 169, &value, &_18$$7, &_19$$7); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_22$$7); - ZEPHIR_CONCAT_VS(_22$$7, _18$$7, "\n"); - zephir_concat_self(&output, _22$$7 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_21$$7); + ZEPHIR_CONCAT_VS(&_21$$7, &_17$$7, "\n"); + zephir_concat_self(&output, &_21$$7 TSRMLS_CC); } - } - ZEPHIR_SINIT_NVAR(_4$$4); - ZVAL_LONG(&_4$$4, (tab - 1)); - ZEPHIR_CALL_FUNCTION(&_23$$4, "str_repeat", &_10, 153, space, &_4$$4); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + ZVAL_LONG(&_22$$4, (tab - 1)); + ZEPHIR_CALL_FUNCTION(&_23$$4, "str_repeat", &_9, 133, &space, &_22$$4); zephir_check_call_status(); - ZEPHIR_CONCAT_VVS(return_value, output, _23$$4, ")"); + ZEPHIR_CONCAT_VVS(return_value, &output, &_23$$4, ")"); RETURN_MM(); } if (Z_TYPE_P(variable) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_24$$8); - zephir_create_array(_24$$8, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_26$$8); - ZVAL_STRING(_26$$8, "obj", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_25$$8, this_ptr, "getstyle", NULL, 0, _26$$8); - zephir_check_temp_parameter(_26$$8); + ZEPHIR_INIT_VAR(&_24$$8); + zephir_create_array(&_24$$8, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_26$$8); + ZVAL_STRING(&_26$$8, "obj"); + ZEPHIR_CALL_METHOD(&_25$$8, this_ptr, "getstyle", NULL, 0, &_26$$8); zephir_check_call_status(); zephir_array_update_string(&_24$$8, SL(":style"), &_25$$8, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_26$$8); - zephir_get_class(_26$$8, variable, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_26$$8); + zephir_get_class(&_26$$8, variable, 0 TSRMLS_CC); zephir_array_update_string(&_24$$8, SL(":class"), &_26$$8, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_VAR(_27$$8); - ZVAL_STRING(&_27$$8, "Object :class", 0); - ZEPHIR_CALL_FUNCTION(&_25$$8, "strtr", NULL, 27, &_27$$8, _24$$8); + ZEPHIR_INIT_NVAR(&_26$$8); + ZVAL_STRING(&_26$$8, "Object :class"); + ZEPHIR_CALL_FUNCTION(&_25$$8, "strtr", NULL, 22, &_26$$8, &_24$$8); zephir_check_call_status(); - zephir_concat_self(&output, _25$$8 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_28$$8, "get_parent_class", NULL, 193, variable); + zephir_concat_self(&output, &_25$$8 TSRMLS_CC); + ZEPHIR_CALL_FUNCTION(&_27$$8, "get_parent_class", NULL, 170, variable); zephir_check_call_status(); - if (zephir_is_true(_28$$8)) { - ZEPHIR_INIT_VAR(_29$$9); - zephir_create_array(_29$$9, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_31$$9); - ZVAL_STRING(_31$$9, "obj", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_30$$9, this_ptr, "getstyle", NULL, 0, _31$$9); - zephir_check_temp_parameter(_31$$9); + if (zephir_is_true(&_27$$8)) { + ZEPHIR_INIT_VAR(&_28$$9); + zephir_create_array(&_28$$9, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_30$$9); + ZVAL_STRING(&_30$$9, "obj"); + ZEPHIR_CALL_METHOD(&_29$$9, this_ptr, "getstyle", NULL, 0, &_30$$9); zephir_check_call_status(); - zephir_array_update_string(&_29$$9, SL(":style"), &_30$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_30$$9, "get_parent_class", NULL, 193, variable); + zephir_array_update_string(&_28$$9, SL(":style"), &_29$$9, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_FUNCTION(&_29$$9, "get_parent_class", NULL, 170, variable); zephir_check_call_status(); - zephir_array_update_string(&_29$$9, SL(":parent"), &_30$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_VAR(_32$$9); - ZVAL_STRING(&_32$$9, " extends :parent", 0); - ZEPHIR_CALL_FUNCTION(&_30$$9, "strtr", NULL, 27, &_32$$9, _29$$9); + zephir_array_update_string(&_28$$9, SL(":parent"), &_29$$9, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_30$$9); + ZVAL_STRING(&_30$$9, " extends :parent"); + ZEPHIR_CALL_FUNCTION(&_29$$9, "strtr", NULL, 22, &_30$$9, &_28$$9); zephir_check_call_status(); - zephir_concat_self(&output, _30$$9 TSRMLS_CC); + zephir_concat_self(&output, &_29$$9 TSRMLS_CC); } zephir_concat_self_str(&output, SL(" (\n") TSRMLS_CC); - _33$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_detailed"), PH_NOISY_CC); - _34$$8 = !zephir_is_true(_33$$8); - if (!(_34$$8)) { - _34$$8 = zephir_instance_of_ev(variable, zend_standard_class_def TSRMLS_CC); + zephir_read_property(&_31$$8, this_ptr, SL("_detailed"), PH_NOISY_CC | PH_READONLY); + _32$$8 = !zephir_is_true(&_31$$8); + if (!(_32$$8)) { + _32$$8 = zephir_instance_of_ev(variable, zend_standard_class_def TSRMLS_CC); } if (zephir_instance_of_ev(variable, phalcon_di_ce TSRMLS_CC)) { - ZEPHIR_SINIT_VAR(_35$$10); - ZVAL_LONG(&_35$$10, tab); - ZEPHIR_CALL_FUNCTION(&_36$$10, "str_repeat", &_10, 153, space, &_35$$10); + ZVAL_LONG(&_33$$10, tab); + ZEPHIR_CALL_FUNCTION(&_34$$10, "str_repeat", &_9, 133, &space, &_33$$10); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_37$$10); - ZEPHIR_CONCAT_VS(_37$$10, _36$$10, "[skipped]\n"); - zephir_concat_self(&output, _37$$10 TSRMLS_CC); - } else if (_34$$8) { - ZEPHIR_CALL_FUNCTION(&_38$$11, "get_object_vars", NULL, 22, variable); + ZEPHIR_INIT_VAR(&_35$$10); + ZEPHIR_CONCAT_VS(&_35$$10, &_34$$10, "[skipped]\n"); + zephir_concat_self(&output, &_35$$10 TSRMLS_CC); + } else if (_32$$8) { + ZEPHIR_CALL_FUNCTION(&_36$$11, "get_object_vars", NULL, 17, variable); zephir_check_call_status(); - zephir_is_iterable(_38$$11, &_40$$11, &_39$$11, 0, 0, "phalcon/debug/dump.zep", 194); - for ( - ; zend_hash_get_current_data_ex(_40$$11, (void**) &_41$$11, &_39$$11) == SUCCESS - ; zend_hash_move_forward_ex(_40$$11, &_39$$11) - ) { - ZEPHIR_GET_HMKEY(key, _40$$11, _39$$11); - ZEPHIR_GET_HVALUE(value, _41$$11); - ZEPHIR_SINIT_NVAR(_42$$12); - ZVAL_LONG(&_42$$12, tab); - ZEPHIR_CALL_FUNCTION(&_43$$12, "str_repeat", &_10, 153, space, &_42$$12); + zephir_is_iterable(&_36$$11, 0, "phalcon/debug/dump.zep", 194); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_36$$11), _38$$11, _39$$11, _37$$11) + { + ZEPHIR_INIT_NVAR(&key); + if (_39$$11 != NULL) { + ZVAL_STR_COPY(&key, _39$$11); + } else { + ZVAL_LONG(&key, _38$$11); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _37$$11); + ZVAL_LONG(&_40$$12, tab); + ZEPHIR_CALL_FUNCTION(&_41$$12, "str_repeat", &_9, 133, &space, &_40$$12); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_44$$12); - zephir_create_array(_44$$12, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_46$$12); - ZVAL_STRING(_46$$12, "obj", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_45$$12, this_ptr, "getstyle", NULL, 0, _46$$12); - zephir_check_temp_parameter(_46$$12); + ZEPHIR_INIT_NVAR(&_42$$12); + zephir_create_array(&_42$$12, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_44$$12); + ZVAL_STRING(&_44$$12, "obj"); + ZEPHIR_CALL_METHOD(&_43$$12, this_ptr, "getstyle", NULL, 0, &_44$$12); zephir_check_call_status(); - zephir_array_update_string(&_44$$12, SL(":style"), &_45$$12, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_44$$12, SL(":key"), &key, PH_COPY | PH_SEPARATE); - add_assoc_stringl_ex(_44$$12, SS(":type"), SL("public"), 1); - ZEPHIR_SINIT_NVAR(_42$$12); - ZVAL_STRING(&_42$$12, "->:key (:type) = ", 0); - ZEPHIR_CALL_FUNCTION(&_45$$12, "strtr", NULL, 27, &_42$$12, _44$$12); + zephir_array_update_string(&_42$$12, SL(":style"), &_43$$12, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_42$$12, SL(":key"), &key, PH_COPY | PH_SEPARATE); + add_assoc_stringl_ex(&_42$$12, SL(":type"), SL("public")); + ZEPHIR_INIT_NVAR(&_44$$12); + ZVAL_STRING(&_44$$12, "->:key (:type) = "); + ZEPHIR_CALL_FUNCTION(&_43$$12, "strtr", NULL, 22, &_44$$12, &_42$$12); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_47$$12); - ZEPHIR_CONCAT_VV(_47$$12, _43$$12, _45$$12); - zephir_concat_self(&output, _47$$12 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_46$$12); - ZVAL_STRING(_46$$12, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_49$$12); - ZVAL_LONG(_49$$12, (tab + 1)); - ZEPHIR_CALL_METHOD(&_48$$12, this_ptr, "output", &_21, 192, value, _46$$12, _49$$12); - zephir_check_temp_parameter(_46$$12); + ZEPHIR_INIT_LNVAR(_45$$12); + ZEPHIR_CONCAT_VV(&_45$$12, &_41$$12, &_43$$12); + zephir_concat_self(&output, &_45$$12 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_44$$12); + ZVAL_STRING(&_44$$12, ""); + ZVAL_LONG(&_40$$12, (tab + 1)); + ZEPHIR_CALL_METHOD(&_46$$12, this_ptr, "output", &_20, 169, &value, &_44$$12, &_40$$12); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_50$$12); - ZEPHIR_CONCAT_VS(_50$$12, _48$$12, "\n"); - zephir_concat_self(&output, _50$$12 TSRMLS_CC); - } + ZEPHIR_INIT_LNVAR(_47$$12); + ZEPHIR_CONCAT_VS(&_47$$12, &_46$$12, "\n"); + zephir_concat_self(&output, &_47$$12 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } else { - ZEPHIR_INIT_VAR(reflect$$13); - object_init_ex(reflect$$13, zephir_get_internal_ce(SS("reflectionclass") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, reflect$$13, "__construct", NULL, 98, variable); + ZEPHIR_INIT_VAR(&reflect$$13); + object_init_ex(&reflect$$13, zephir_get_internal_ce(SL("reflectionclass"))); + ZEPHIR_CALL_METHOD(NULL, &reflect$$13, "__construct", NULL, 87, variable); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_51$$13); - ZVAL_LONG(_51$$13, ((256 | 512) | 1024)); - ZEPHIR_CALL_METHOD(&props$$13, reflect$$13, "getproperties", NULL, 102, _51$$13); + ZVAL_LONG(&_48$$13, ((256 | 512) | 1024)); + ZEPHIR_CALL_METHOD(&props$$13, &reflect$$13, "getproperties", NULL, 91, &_48$$13); zephir_check_call_status(); - zephir_is_iterable(props$$13, &_53$$13, &_52$$13, 0, 0, "phalcon/debug/dump.zep", 214); - for ( - ; zend_hash_get_current_data_ex(_53$$13, (void**) &_54$$13, &_52$$13) == SUCCESS - ; zend_hash_move_forward_ex(_53$$13, &_52$$13) - ) { - ZEPHIR_GET_HVALUE(property$$13, _54$$13); - ZEPHIR_INIT_NVAR(_55$$14); - ZVAL_BOOL(_55$$14, 1); - ZEPHIR_CALL_METHOD(NULL, property$$13, "setaccessible", &_56, 0, _55$$14); + zephir_is_iterable(&props$$13, 0, "phalcon/debug/dump.zep", 214); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&props$$13), _49$$13) + { + ZEPHIR_INIT_NVAR(&property$$13); + ZVAL_COPY(&property$$13, _49$$13); + ZVAL_BOOL(&_50$$14, 1); + ZEPHIR_CALL_METHOD(NULL, &property$$13, "setaccessible", &_51, 0, &_50$$14); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&key, property$$13, "getname", &_57, 0); + ZEPHIR_CALL_METHOD(&key, &property$$13, "getname", &_52, 0); zephir_check_call_status(); - _59$$14 = zend_fetch_class(SL("Reflection"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_61$$14, property$$13, "getmodifiers", &_62, 0); + _54$$14 = zephir_fetch_class_str_ex(SL("Reflection"), ZEND_FETCH_CLASS_AUTO); + ZEPHIR_CALL_METHOD(&_56$$14, &property$$13, "getmodifiers", &_57, 0); zephir_check_call_status(); - ZEPHIR_CALL_CE_STATIC(&_58$$14, _59$$14, "getmodifiernames", &_60, 0, _61$$14); + ZEPHIR_CALL_CE_STATIC(&_53$$14, _54$$14, "getmodifiernames", &_55, 0, &_56$$14); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_63$$14); - ZVAL_STRING(&_63$$14, " ", 0); - ZEPHIR_INIT_NVAR(type); - zephir_fast_join(type, &_63$$14, _58$$14 TSRMLS_CC); - ZEPHIR_SINIT_NVAR(_64$$14); - ZVAL_LONG(&_64$$14, tab); - ZEPHIR_CALL_FUNCTION(&_65$$14, "str_repeat", &_10, 153, space, &_64$$14); + ZEPHIR_INIT_NVAR(&_58$$14); + ZVAL_STRING(&_58$$14, " "); + ZEPHIR_INIT_NVAR(&type); + zephir_fast_join(&type, &_58$$14, &_53$$14 TSRMLS_CC); + ZVAL_LONG(&_50$$14, tab); + ZEPHIR_CALL_FUNCTION(&_59$$14, "str_repeat", &_9, 133, &space, &_50$$14); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_66$$14); - zephir_create_array(_66$$14, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_55$$14); - ZVAL_STRING(_55$$14, "obj", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_67$$14, this_ptr, "getstyle", NULL, 0, _55$$14); - zephir_check_temp_parameter(_55$$14); + ZEPHIR_INIT_NVAR(&_60$$14); + zephir_create_array(&_60$$14, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_62$$14); + ZVAL_STRING(&_62$$14, "obj"); + ZEPHIR_CALL_METHOD(&_61$$14, this_ptr, "getstyle", NULL, 0, &_62$$14); zephir_check_call_status(); - zephir_array_update_string(&_66$$14, SL(":style"), &_67$$14, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_66$$14, SL(":key"), &key, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_66$$14, SL(":type"), &type, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_NVAR(_64$$14); - ZVAL_STRING(&_64$$14, "->:key (:type) = ", 0); - ZEPHIR_CALL_FUNCTION(&_67$$14, "strtr", NULL, 27, &_64$$14, _66$$14); + zephir_array_update_string(&_60$$14, SL(":style"), &_61$$14, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_60$$14, SL(":key"), &key, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_60$$14, SL(":type"), &type, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_62$$14); + ZVAL_STRING(&_62$$14, "->:key (:type) = "); + ZEPHIR_CALL_FUNCTION(&_61$$14, "strtr", NULL, 22, &_62$$14, &_60$$14); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_68$$14); - ZEPHIR_CONCAT_VV(_68$$14, _65$$14, _67$$14); - zephir_concat_self(&output, _68$$14 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_70$$14, property$$13, "getvalue", &_71, 0, variable); + ZEPHIR_INIT_LNVAR(_63$$14); + ZEPHIR_CONCAT_VV(&_63$$14, &_59$$14, &_61$$14); + zephir_concat_self(&output, &_63$$14 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_65$$14, &property$$13, "getvalue", &_66, 0, variable); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_55$$14); - ZVAL_STRING(_55$$14, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_72$$14); - ZVAL_LONG(_72$$14, (tab + 1)); - ZEPHIR_CALL_METHOD(&_69$$14, this_ptr, "output", &_21, 192, _70$$14, _55$$14, _72$$14); - zephir_check_temp_parameter(_55$$14); + ZEPHIR_INIT_NVAR(&_62$$14); + ZVAL_STRING(&_62$$14, ""); + ZVAL_LONG(&_50$$14, (tab + 1)); + ZEPHIR_CALL_METHOD(&_64$$14, this_ptr, "output", &_20, 169, &_65$$14, &_62$$14, &_50$$14); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_73$$14); - ZEPHIR_CONCAT_VS(_73$$14, _69$$14, "\n"); - zephir_concat_self(&output, _73$$14 TSRMLS_CC); - } + ZEPHIR_INIT_LNVAR(_67$$14); + ZEPHIR_CONCAT_VS(&_67$$14, &_64$$14, "\n"); + zephir_concat_self(&output, &_67$$14 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&property$$13); } - ZEPHIR_CALL_FUNCTION(&attr, "get_class_methods", NULL, 194, variable); + ZEPHIR_CALL_FUNCTION(&attr, "get_class_methods", NULL, 171, variable); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_27$$8); - ZVAL_LONG(&_27$$8, tab); - ZEPHIR_CALL_FUNCTION(&_74$$8, "str_repeat", &_10, 153, space, &_27$$8); + ZVAL_LONG(&_68$$8, tab); + ZEPHIR_CALL_FUNCTION(&_69$$8, "str_repeat", &_9, 133, &space, &_68$$8); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_75$$8); - zephir_create_array(_75$$8, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_26$$8); - ZVAL_STRING(_26$$8, "obj", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_76$$8, this_ptr, "getstyle", NULL, 0, _26$$8); - zephir_check_temp_parameter(_26$$8); + ZEPHIR_INIT_VAR(&_70$$8); + zephir_create_array(&_70$$8, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_26$$8); + ZVAL_STRING(&_26$$8, "obj"); + ZEPHIR_CALL_METHOD(&_71$$8, this_ptr, "getstyle", NULL, 0, &_26$$8); zephir_check_call_status(); - zephir_array_update_string(&_75$$8, SL(":style"), &_76$$8, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_26$$8); - zephir_get_class(_26$$8, variable, 0 TSRMLS_CC); - zephir_array_update_string(&_75$$8, SL(":class"), &_26$$8, PH_COPY | PH_SEPARATE); - add_assoc_long_ex(_75$$8, SS(":count"), zephir_fast_count_int(attr TSRMLS_CC)); - ZEPHIR_SINIT_NVAR(_27$$8); - ZVAL_STRING(&_27$$8, ":class methods: (:count) (\n", 0); - ZEPHIR_CALL_FUNCTION(&_76$$8, "strtr", NULL, 27, &_27$$8, _75$$8); + zephir_array_update_string(&_70$$8, SL(":style"), &_71$$8, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_26$$8); + zephir_get_class(&_26$$8, variable, 0 TSRMLS_CC); + zephir_array_update_string(&_70$$8, SL(":class"), &_26$$8, PH_COPY | PH_SEPARATE); + add_assoc_long_ex(&_70$$8, SL(":count"), zephir_fast_count_int(&attr TSRMLS_CC)); + ZEPHIR_INIT_NVAR(&_26$$8); + ZVAL_STRING(&_26$$8, ":class methods: (:count) (\n"); + ZEPHIR_CALL_FUNCTION(&_71$$8, "strtr", NULL, 22, &_26$$8, &_70$$8); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_77$$8); - ZEPHIR_CONCAT_VV(_77$$8, _74$$8, _76$$8); - zephir_concat_self(&output, _77$$8 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_26$$8); - zephir_get_class(_26$$8, variable, 0 TSRMLS_CC); - _78$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_methods"), PH_NOISY_CC); - if (zephir_fast_in_array(_26$$8, _78$$8 TSRMLS_CC)) { - ZEPHIR_SINIT_VAR(_79$$15); - ZVAL_LONG(&_79$$15, tab); - ZEPHIR_CALL_FUNCTION(&_80$$15, "str_repeat", &_10, 153, space, &_79$$15); + ZEPHIR_INIT_VAR(&_72$$8); + ZEPHIR_CONCAT_VV(&_72$$8, &_69$$8, &_71$$8); + zephir_concat_self(&output, &_72$$8 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_26$$8); + zephir_get_class(&_26$$8, variable, 0 TSRMLS_CC); + zephir_read_property(&_68$$8, this_ptr, SL("_methods"), PH_NOISY_CC | PH_READONLY); + if (zephir_fast_in_array(&_26$$8, &_68$$8 TSRMLS_CC)) { + ZVAL_LONG(&_73$$15, tab); + ZEPHIR_CALL_FUNCTION(&_74$$15, "str_repeat", &_9, 133, &space, &_73$$15); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_81$$15); - ZEPHIR_CONCAT_VS(_81$$15, _80$$15, "[already listed]\n"); - zephir_concat_self(&output, _81$$15 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_75$$15); + ZEPHIR_CONCAT_VS(&_75$$15, &_74$$15, "[already listed]\n"); + zephir_concat_self(&output, &_75$$15 TSRMLS_CC); } else { - zephir_is_iterable(attr, &_83$$16, &_82$$16, 0, 0, "phalcon/debug/dump.zep", 231); - for ( - ; zend_hash_get_current_data_ex(_83$$16, (void**) &_84$$16, &_82$$16) == SUCCESS - ; zend_hash_move_forward_ex(_83$$16, &_82$$16) - ) { - ZEPHIR_GET_HVALUE(value, _84$$16); - ZEPHIR_INIT_NVAR(_85$$17); - zephir_get_class(_85$$17, variable, 0 TSRMLS_CC); - zephir_update_property_array_append(this_ptr, SL("_methods"), _85$$17 TSRMLS_CC); - if (ZEPHIR_IS_STRING(value, "__construct")) { - ZEPHIR_SINIT_NVAR(_86$$18); - ZVAL_LONG(&_86$$18, (tab + 1)); - ZEPHIR_CALL_FUNCTION(&_87$$18, "str_repeat", &_10, 153, space, &_86$$18); + zephir_is_iterable(&attr, 0, "phalcon/debug/dump.zep", 231); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attr), _76$$16) + { + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _76$$16); + ZEPHIR_INIT_NVAR(&_77$$17); + zephir_get_class(&_77$$17, variable, 0 TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_methods"), &_77$$17 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&value, "__construct")) { + ZVAL_LONG(&_78$$18, (tab + 1)); + ZEPHIR_CALL_FUNCTION(&_79$$18, "str_repeat", &_9, 133, &space, &_78$$18); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_88$$18); - zephir_create_array(_88$$18, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_90$$18); - ZVAL_STRING(_90$$18, "obj", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_89$$18, this_ptr, "getstyle", NULL, 0, _90$$18); - zephir_check_temp_parameter(_90$$18); + ZEPHIR_INIT_NVAR(&_80$$18); + zephir_create_array(&_80$$18, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_82$$18); + ZVAL_STRING(&_82$$18, "obj"); + ZEPHIR_CALL_METHOD(&_81$$18, this_ptr, "getstyle", NULL, 0, &_82$$18); zephir_check_call_status(); - zephir_array_update_string(&_88$$18, SL(":style"), &_89$$18, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_88$$18, SL(":method"), &value, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_NVAR(_86$$18); - ZVAL_STRING(&_86$$18, "->:method(); [constructor]\n", 0); - ZEPHIR_CALL_FUNCTION(&_89$$18, "strtr", NULL, 27, &_86$$18, _88$$18); + zephir_array_update_string(&_80$$18, SL(":style"), &_81$$18, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_80$$18, SL(":method"), &value, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_82$$18); + ZVAL_STRING(&_82$$18, "->:method(); [constructor]\n"); + ZEPHIR_CALL_FUNCTION(&_81$$18, "strtr", NULL, 22, &_82$$18, &_80$$18); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_91$$18); - ZEPHIR_CONCAT_VV(_91$$18, _87$$18, _89$$18); - zephir_concat_self(&output, _91$$18 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_83$$18); + ZEPHIR_CONCAT_VV(&_83$$18, &_79$$18, &_81$$18); + zephir_concat_self(&output, &_83$$18 TSRMLS_CC); } else { - ZEPHIR_SINIT_NVAR(_92$$19); - ZVAL_LONG(&_92$$19, (tab + 1)); - ZEPHIR_CALL_FUNCTION(&_93$$19, "str_repeat", &_10, 153, space, &_92$$19); + ZVAL_LONG(&_84$$19, (tab + 1)); + ZEPHIR_CALL_FUNCTION(&_85$$19, "str_repeat", &_9, 133, &space, &_84$$19); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_94$$19); - zephir_create_array(_94$$19, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_96$$19); - ZVAL_STRING(_96$$19, "obj", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_95$$19, this_ptr, "getstyle", NULL, 0, _96$$19); - zephir_check_temp_parameter(_96$$19); + ZEPHIR_INIT_NVAR(&_86$$19); + zephir_create_array(&_86$$19, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_88$$19); + ZVAL_STRING(&_88$$19, "obj"); + ZEPHIR_CALL_METHOD(&_87$$19, this_ptr, "getstyle", NULL, 0, &_88$$19); zephir_check_call_status(); - zephir_array_update_string(&_94$$19, SL(":style"), &_95$$19, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_94$$19, SL(":method"), &value, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_NVAR(_92$$19); - ZVAL_STRING(&_92$$19, "->:method();\n", 0); - ZEPHIR_CALL_FUNCTION(&_95$$19, "strtr", NULL, 27, &_92$$19, _94$$19); + zephir_array_update_string(&_86$$19, SL(":style"), &_87$$19, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_86$$19, SL(":method"), &value, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_88$$19); + ZVAL_STRING(&_88$$19, "->:method();\n"); + ZEPHIR_CALL_FUNCTION(&_87$$19, "strtr", NULL, 22, &_88$$19, &_86$$19); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_97$$19); - ZEPHIR_CONCAT_VV(_97$$19, _93$$19, _95$$19); - zephir_concat_self(&output, _97$$19 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_89$$19); + ZEPHIR_CONCAT_VV(&_89$$19, &_85$$19, &_87$$19); + zephir_concat_self(&output, &_89$$19 TSRMLS_CC); } - } - ZEPHIR_SINIT_VAR(_98$$16); - ZVAL_LONG(&_98$$16, tab); - ZEPHIR_CALL_FUNCTION(&_99$$16, "str_repeat", &_10, 153, space, &_98$$16); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZVAL_LONG(&_90$$16, tab); + ZEPHIR_CALL_FUNCTION(&_91$$16, "str_repeat", &_9, 133, &space, &_90$$16); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_100$$16); - ZEPHIR_CONCAT_VS(_100$$16, _99$$16, ")\n"); - zephir_concat_self(&output, _100$$16 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_92$$16); + ZEPHIR_CONCAT_VS(&_92$$16, &_91$$16, ")\n"); + zephir_concat_self(&output, &_92$$16 TSRMLS_CC); } - ZEPHIR_SINIT_NVAR(_27$$8); - ZVAL_LONG(&_27$$8, (tab - 1)); - ZEPHIR_CALL_FUNCTION(&_101$$8, "str_repeat", &_10, 153, space, &_27$$8); + ZVAL_LONG(&_93$$8, (tab - 1)); + ZEPHIR_CALL_FUNCTION(&_94$$8, "str_repeat", &_9, 133, &space, &_93$$8); zephir_check_call_status(); - ZEPHIR_CONCAT_VVS(return_value, output, _101$$8, ")"); + ZEPHIR_CONCAT_VVS(return_value, &output, &_94$$8, ")"); RETURN_MM(); } if (Z_TYPE_P(variable) == IS_LONG) { - ZEPHIR_INIT_VAR(_102$$20); - zephir_create_array(_102$$20, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_104$$20); - ZVAL_STRING(_104$$20, "int", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_103$$20, this_ptr, "getstyle", NULL, 0, _104$$20); - zephir_check_temp_parameter(_104$$20); + ZEPHIR_INIT_VAR(&_95$$20); + zephir_create_array(&_95$$20, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_97$$20); + ZVAL_STRING(&_97$$20, "int"); + ZEPHIR_CALL_METHOD(&_96$$20, this_ptr, "getstyle", NULL, 0, &_97$$20); zephir_check_call_status(); - zephir_array_update_string(&_102$$20, SL(":style"), &_103$$20, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_102$$20, SL(":var"), &variable, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_VAR(_105$$20); - ZVAL_STRING(&_105$$20, "Integer (:var)", 0); - ZEPHIR_CALL_FUNCTION(&_103$$20, "strtr", NULL, 27, &_105$$20, _102$$20); + zephir_array_update_string(&_95$$20, SL(":style"), &_96$$20, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_95$$20, SL(":var"), variable, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_97$$20); + ZVAL_STRING(&_97$$20, "Integer (:var)"); + ZEPHIR_CALL_FUNCTION(&_96$$20, "strtr", NULL, 22, &_97$$20, &_95$$20); zephir_check_call_status(); - ZEPHIR_CONCAT_VV(return_value, output, _103$$20); + ZEPHIR_CONCAT_VV(return_value, &output, &_96$$20); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_106, "is_float", NULL, 195, variable); + ZEPHIR_CALL_FUNCTION(&_98, "is_float", NULL, 172, variable); zephir_check_call_status(); - if (zephir_is_true(_106)) { - ZEPHIR_INIT_VAR(_107$$21); - zephir_create_array(_107$$21, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_109$$21); - ZVAL_STRING(_109$$21, "float", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_108$$21, this_ptr, "getstyle", NULL, 0, _109$$21); - zephir_check_temp_parameter(_109$$21); + if (zephir_is_true(&_98)) { + ZEPHIR_INIT_VAR(&_99$$21); + zephir_create_array(&_99$$21, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_101$$21); + ZVAL_STRING(&_101$$21, "float"); + ZEPHIR_CALL_METHOD(&_100$$21, this_ptr, "getstyle", NULL, 0, &_101$$21); zephir_check_call_status(); - zephir_array_update_string(&_107$$21, SL(":style"), &_108$$21, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_107$$21, SL(":var"), &variable, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_VAR(_110$$21); - ZVAL_STRING(&_110$$21, "Float (:var)", 0); - ZEPHIR_CALL_FUNCTION(&_108$$21, "strtr", NULL, 27, &_110$$21, _107$$21); + zephir_array_update_string(&_99$$21, SL(":style"), &_100$$21, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_99$$21, SL(":var"), variable, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_101$$21); + ZVAL_STRING(&_101$$21, "Float (:var)"); + ZEPHIR_CALL_FUNCTION(&_100$$21, "strtr", NULL, 22, &_101$$21, &_99$$21); zephir_check_call_status(); - ZEPHIR_CONCAT_VV(return_value, output, _108$$21); + ZEPHIR_CONCAT_VV(return_value, &output, &_100$$21); RETURN_MM(); } if (zephir_is_numeric(variable)) { - ZEPHIR_INIT_VAR(_111$$22); - zephir_create_array(_111$$22, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_113$$22); - ZVAL_STRING(_113$$22, "num", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_112$$22, this_ptr, "getstyle", NULL, 0, _113$$22); - zephir_check_temp_parameter(_113$$22); + ZEPHIR_INIT_VAR(&_102$$22); + zephir_create_array(&_102$$22, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_104$$22); + ZVAL_STRING(&_104$$22, "num"); + ZEPHIR_CALL_METHOD(&_103$$22, this_ptr, "getstyle", NULL, 0, &_104$$22); zephir_check_call_status(); - zephir_array_update_string(&_111$$22, SL(":style"), &_112$$22, PH_COPY | PH_SEPARATE); - add_assoc_long_ex(_111$$22, SS(":length"), zephir_fast_strlen_ev(variable)); - zephir_array_update_string(&_111$$22, SL(":var"), &variable, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_VAR(_114$$22); - ZVAL_STRING(&_114$$22, "Numeric string (:length) \":var\"", 0); - ZEPHIR_CALL_FUNCTION(&_112$$22, "strtr", NULL, 27, &_114$$22, _111$$22); + zephir_array_update_string(&_102$$22, SL(":style"), &_103$$22, PH_COPY | PH_SEPARATE); + add_assoc_long_ex(&_102$$22, SL(":length"), zephir_fast_strlen_ev(variable)); + zephir_array_update_string(&_102$$22, SL(":var"), variable, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_104$$22); + ZVAL_STRING(&_104$$22, "Numeric string (:length) \":var\""); + ZEPHIR_CALL_FUNCTION(&_103$$22, "strtr", NULL, 22, &_104$$22, &_102$$22); zephir_check_call_status(); - ZEPHIR_CONCAT_VV(return_value, output, _112$$22); + ZEPHIR_CONCAT_VV(return_value, &output, &_103$$22); RETURN_MM(); } if (Z_TYPE_P(variable) == IS_STRING) { - ZEPHIR_INIT_VAR(_115$$23); - zephir_create_array(_115$$23, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_117$$23); - ZVAL_STRING(_117$$23, "str", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_116$$23, this_ptr, "getstyle", NULL, 0, _117$$23); - zephir_check_temp_parameter(_117$$23); + ZEPHIR_INIT_VAR(&_105$$23); + zephir_create_array(&_105$$23, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_107$$23); + ZVAL_STRING(&_107$$23, "str"); + ZEPHIR_CALL_METHOD(&_106$$23, this_ptr, "getstyle", NULL, 0, &_107$$23); zephir_check_call_status(); - zephir_array_update_string(&_115$$23, SL(":style"), &_116$$23, PH_COPY | PH_SEPARATE); - add_assoc_long_ex(_115$$23, SS(":length"), zephir_fast_strlen_ev(variable)); - ZEPHIR_SINIT_VAR(_118$$23); - ZVAL_LONG(&_118$$23, 4); - ZEPHIR_SINIT_VAR(_119$$23); - ZVAL_STRING(&_119$$23, "utf-8", 0); - ZEPHIR_CALL_FUNCTION(&_116$$23, "htmlentities", NULL, 177, variable, &_118$$23, &_119$$23); + zephir_array_update_string(&_105$$23, SL(":style"), &_106$$23, PH_COPY | PH_SEPARATE); + add_assoc_long_ex(&_105$$23, SL(":length"), zephir_fast_strlen_ev(variable)); + ZVAL_LONG(&_108$$23, 4); + ZEPHIR_INIT_NVAR(&_107$$23); + ZVAL_STRING(&_107$$23, "utf-8"); + ZEPHIR_CALL_FUNCTION(&_106$$23, "htmlentities", NULL, 157, variable, &_108$$23, &_107$$23); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_120$$23, "nl2br", NULL, 196, _116$$23); + ZEPHIR_CALL_FUNCTION(&_109$$23, "nl2br", NULL, 173, &_106$$23); zephir_check_call_status(); - zephir_array_update_string(&_115$$23, SL(":var"), &_120$$23, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_NVAR(_118$$23); - ZVAL_STRING(&_118$$23, "String (:length) \":var\"", 0); - ZEPHIR_CALL_FUNCTION(&_120$$23, "strtr", NULL, 27, &_118$$23, _115$$23); + zephir_array_update_string(&_105$$23, SL(":var"), &_109$$23, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_107$$23); + ZVAL_STRING(&_107$$23, "String (:length) \":var\""); + ZEPHIR_CALL_FUNCTION(&_109$$23, "strtr", NULL, 22, &_107$$23, &_105$$23); zephir_check_call_status(); - ZEPHIR_CONCAT_VV(return_value, output, _120$$23); + ZEPHIR_CONCAT_VV(return_value, &output, &_109$$23); RETURN_MM(); } - if (Z_TYPE_P(variable) == IS_BOOL) { - ZEPHIR_INIT_VAR(_121$$24); - zephir_create_array(_121$$24, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_123$$24); - ZVAL_STRING(_123$$24, "bool", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_122$$24, this_ptr, "getstyle", NULL, 0, _123$$24); - zephir_check_temp_parameter(_123$$24); + if ((Z_TYPE_P(variable) == IS_TRUE || Z_TYPE_P(variable) == IS_FALSE)) { + ZEPHIR_INIT_VAR(&_110$$24); + zephir_create_array(&_110$$24, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_112$$24); + ZVAL_STRING(&_112$$24, "bool"); + ZEPHIR_CALL_METHOD(&_111$$24, this_ptr, "getstyle", NULL, 0, &_112$$24); zephir_check_call_status(); - zephir_array_update_string(&_121$$24, SL(":style"), &_122$$24, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_124$$24); + zephir_array_update_string(&_110$$24, SL(":style"), &_111$$24, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_113$$24); if (zephir_is_true(variable)) { - ZEPHIR_INIT_NVAR(_124$$24); - ZVAL_STRING(_124$$24, "TRUE", 1); + ZEPHIR_INIT_NVAR(&_113$$24); + ZVAL_STRING(&_113$$24, "TRUE"); } else { - ZEPHIR_INIT_NVAR(_124$$24); - ZVAL_STRING(_124$$24, "FALSE", 1); + ZEPHIR_INIT_NVAR(&_113$$24); + ZVAL_STRING(&_113$$24, "FALSE"); } - zephir_array_update_string(&_121$$24, SL(":var"), &_124$$24, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_VAR(_125$$24); - ZVAL_STRING(&_125$$24, "Boolean (:var)", 0); - ZEPHIR_CALL_FUNCTION(&_122$$24, "strtr", NULL, 27, &_125$$24, _121$$24); + zephir_array_update_string(&_110$$24, SL(":var"), &_113$$24, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_112$$24); + ZVAL_STRING(&_112$$24, "Boolean (:var)"); + ZEPHIR_CALL_FUNCTION(&_111$$24, "strtr", NULL, 22, &_112$$24, &_110$$24); zephir_check_call_status(); - ZEPHIR_CONCAT_VV(return_value, output, _122$$24); + ZEPHIR_CONCAT_VV(return_value, &output, &_111$$24); RETURN_MM(); } if (Z_TYPE_P(variable) == IS_NULL) { - ZEPHIR_INIT_VAR(_126$$25); - zephir_create_array(_126$$25, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_128$$25); - ZVAL_STRING(_128$$25, "null", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_127$$25, this_ptr, "getstyle", NULL, 0, _128$$25); - zephir_check_temp_parameter(_128$$25); + ZEPHIR_INIT_VAR(&_114$$25); + zephir_create_array(&_114$$25, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_116$$25); + ZVAL_STRING(&_116$$25, "null"); + ZEPHIR_CALL_METHOD(&_115$$25, this_ptr, "getstyle", NULL, 0, &_116$$25); zephir_check_call_status(); - zephir_array_update_string(&_126$$25, SL(":style"), &_127$$25, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_VAR(_129$$25); - ZVAL_STRING(&_129$$25, "NULL", 0); - ZEPHIR_CALL_FUNCTION(&_127$$25, "strtr", NULL, 27, &_129$$25, _126$$25); + zephir_array_update_string(&_114$$25, SL(":style"), &_115$$25, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_116$$25); + ZVAL_STRING(&_116$$25, "NULL"); + ZEPHIR_CALL_FUNCTION(&_115$$25, "strtr", NULL, 22, &_116$$25, &_114$$25); zephir_check_call_status(); - ZEPHIR_CONCAT_VV(return_value, output, _127$$25); + ZEPHIR_CONCAT_VV(return_value, &output, &_115$$25); RETURN_MM(); } - ZEPHIR_INIT_VAR(_130); - zephir_create_array(_130, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_132); - ZVAL_STRING(_132, "other", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_131, this_ptr, "getstyle", NULL, 0, _132); - zephir_check_temp_parameter(_132); + ZEPHIR_INIT_VAR(&_117); + zephir_create_array(&_117, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_119); + ZVAL_STRING(&_119, "other"); + ZEPHIR_CALL_METHOD(&_118, this_ptr, "getstyle", NULL, 0, &_119); zephir_check_call_status(); - zephir_array_update_string(&_130, SL(":style"), &_131, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_130, SL(":var"), &variable, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_VAR(_133); - ZVAL_STRING(&_133, "(:var)", 0); - ZEPHIR_CALL_FUNCTION(&_131, "strtr", NULL, 27, &_133, _130); + zephir_array_update_string(&_117, SL(":style"), &_118, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_117, SL(":var"), variable, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_119); + ZVAL_STRING(&_119, "(:var)"); + ZEPHIR_CALL_FUNCTION(&_118, "strtr", NULL, 22, &_119, &_117); zephir_check_call_status(); - ZEPHIR_CONCAT_VV(return_value, output, _131); + ZEPHIR_CONCAT_VV(return_value, &output, &_118); RETURN_MM(); } @@ -778,36 +894,42 @@ PHP_METHOD(Phalcon_Debug_Dump, output) { */ PHP_METHOD(Phalcon_Debug_Dump, variable) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name = NULL; - zval *variable, *name_param = NULL, *_1 = NULL, *_2, _3; + zval name; + zval *variable, variable_sub, *name_param = NULL, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&variable_sub); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &variable, &name_param); if (!name_param) { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_STRING(&name, ""); } else { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "pre", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "getstyle", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "pre"); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getstyle", NULL, 0, &_2); zephir_check_call_status(); zephir_array_update_string(&_0, SL(":style"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "output", NULL, 0, variable, name); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "output", NULL, 0, variable, &name); zephir_check_call_status(); zephir_array_update_string(&_0, SL(":output"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_VAR(_3); - ZVAL_STRING(&_3, "
:output
", 0); - ZEPHIR_RETURN_CALL_FUNCTION("strtr", NULL, 27, &_3, _0); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_STRING(&_2, "
:output
"); + ZEPHIR_RETURN_CALL_FUNCTION("strtr", NULL, 22, &_2, &_0); zephir_check_call_status(); RETURN_MM(); @@ -830,32 +952,46 @@ PHP_METHOD(Phalcon_Debug_Dump, variable) { */ PHP_METHOD(Phalcon_Debug_Dump, variables) { - HashTable *_2; - HashPosition _1; - zval *key = NULL, *value = NULL, *output = NULL, *_0, **_3, *_4$$3 = NULL, *_5$$3 = NULL; + zend_string *_3; + zend_ulong _2; + zval key, value, output, _0, *_1, _4$$3, _5$$3; zephir_fcall_cache_entry *_6 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&output); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(output); - ZVAL_STRING(output, "", 1); - ZEPHIR_INIT_VAR(_0); - zephir_get_args(_0 TSRMLS_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/debug/dump.zep", 303); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(key, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); + ZEPHIR_INIT_VAR(&output); + ZVAL_STRING(&output, ""); + ZEPHIR_INIT_VAR(&_0); + zephir_get_args(&_0); + zephir_is_iterable(&_0, 0, "phalcon/debug/dump.zep", 303); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); ZEPHIR_INIT_LNVAR(_5$$3); - ZEPHIR_CONCAT_SV(_5$$3, "var ", key); - ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "one", &_6, 0, value, _5$$3); + ZEPHIR_CONCAT_SV(&_5$$3, "var ", &key); + ZEPHIR_CALL_METHOD(&_4$$3, this_ptr, "one", &_6, 0, &value, &_5$$3); zephir_check_call_status(); - zephir_concat_self(&output, _4$$3 TSRMLS_CC); - } - RETURN_CCTOR(output); + zephir_concat_self(&output, &_4$$3 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + RETURN_CCTOR(&output); } @@ -879,47 +1015,41 @@ PHP_METHOD(Phalcon_Debug_Dump, variables) { */ PHP_METHOD(Phalcon_Debug_Dump, toJson) { - zval *variable, _0; + zval *variable, variable_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&variable_sub); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &variable); - ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, ((128 | 64) | 256)); - zephir_json_encode(return_value, &(return_value), variable, zephir_get_intval(&_0) TSRMLS_CC); + zephir_json_encode(return_value, variable, zephir_get_intval(&_0) ); return; } -zend_object_value zephir_init_properties_Phalcon_Debug_Dump(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Debug_Dump(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_methods"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_methods"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_methods"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_methods"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/debug/dump.zep.h b/ext/phalcon/debug/dump.zep.h index ccdc7371ee2..a21554c557a 100644 --- a/ext/phalcon/debug/dump.zep.h +++ b/ext/phalcon/debug/dump.zep.h @@ -14,42 +14,104 @@ PHP_METHOD(Phalcon_Debug_Dump, output); PHP_METHOD(Phalcon_Debug_Dump, variable); PHP_METHOD(Phalcon_Debug_Dump, variables); PHP_METHOD(Phalcon_Debug_Dump, toJson); -zend_object_value zephir_init_properties_Phalcon_Debug_Dump(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Debug_Dump(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_dump_setdetailed, 0, 0, 1) ZEND_ARG_INFO(0, detailed) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_dump___construct, 0, 0, 0) - ZEND_ARG_ARRAY_INFO(0, styles, 1) + ZEND_ARG_ARRAY_INFO(0, styles, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, detailed, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, detailed) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_dump_getstyle, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_all, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_all, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_getstyle, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_getstyle, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_dump_setstyles, 0, 0, 0) - ZEND_ARG_ARRAY_INFO(0, styles, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_setstyles, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_setstyles, 0, 0, IS_ARRAY, NULL, 0) +#endif + ZEND_ARG_ARRAY_INFO(0, styles, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_dump_one, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_one, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_one, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, variable) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_dump_output, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_output, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_output, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, variable) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tab, IS_LONG, 0) +#else ZEND_ARG_INFO(0, tab) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_dump_variable, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_variable, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_variable, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, variable) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_variables, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_variables, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_debug_dump_tojson, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_tojson, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_debug_dump_tojson, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, variable) ZEND_END_ARG_INFO() @@ -57,13 +119,13 @@ ZEPHIR_INIT_FUNCS(phalcon_debug_dump_method_entry) { PHP_ME(Phalcon_Debug_Dump, getDetailed, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug_Dump, setDetailed, arginfo_phalcon_debug_dump_setdetailed, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug_Dump, __construct, arginfo_phalcon_debug_dump___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Debug_Dump, all, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Debug_Dump, all, arginfo_phalcon_debug_dump_all, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug_Dump, getStyle, arginfo_phalcon_debug_dump_getstyle, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Debug_Dump, setStyles, arginfo_phalcon_debug_dump_setstyles, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug_Dump, one, arginfo_phalcon_debug_dump_one, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug_Dump, output, arginfo_phalcon_debug_dump_output, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Debug_Dump, variable, arginfo_phalcon_debug_dump_variable, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Debug_Dump, variables, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Debug_Dump, variables, arginfo_phalcon_debug_dump_variables, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Debug_Dump, toJson, arginfo_phalcon_debug_dump_tojson, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/di.zep.c b/ext/phalcon/di.zep.c index 43ac56bd9d8..2c574bd31a2 100644 --- a/ext/phalcon/di.zep.c +++ b/ext/phalcon/di.zep.c @@ -101,14 +101,17 @@ ZEPHIR_INIT_CLASS(Phalcon_Di) { */ PHP_METHOD(Phalcon_Di, __construct) { - zval *di = NULL; + zval di; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&di); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(di); - zephir_read_static_property_ce(&di, phalcon_di_ce, SL("_default") TSRMLS_CC); - if (!(zephir_is_true(di))) { - zephir_update_static_property_ce(phalcon_di_ce, SL("_default"), &this_ptr TSRMLS_CC); + ZEPHIR_OBS_VAR(&di); + zephir_read_static_property_ce(&di, phalcon_di_ce, SL("_default"), PH_NOISY_CC); + if (!(zephir_is_true(&di))) { + zend_update_static_property(phalcon_di_ce, ZEND_STRL("_default"), this_ptr); } ZEPHIR_MM_RESTORE(); @@ -119,13 +122,16 @@ PHP_METHOD(Phalcon_Di, __construct) { */ PHP_METHOD(Phalcon_Di, setInternalEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); } @@ -134,7 +140,8 @@ PHP_METHOD(Phalcon_Di, setInternalEventsManager) { */ PHP_METHOD(Phalcon_Di, getInternalEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -147,21 +154,27 @@ PHP_METHOD(Phalcon_Di, set) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool shared; - zval *name_param = NULL, *definition, *shared_param = NULL, *service = NULL, *_0; - zval *name = NULL; + zval *name_param = NULL, *definition, definition_sub, *shared_param = NULL, service, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&definition_sub); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &name_param, &definition, &shared_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!shared_param) { shared = 0; @@ -170,18 +183,17 @@ PHP_METHOD(Phalcon_Di, set) { } - ZEPHIR_INIT_VAR(service); - object_init_ex(service, phalcon_di_service_ce); - ZEPHIR_INIT_VAR(_0); + ZEPHIR_INIT_VAR(&service); + object_init_ex(&service, phalcon_di_service_ce); if (shared) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_CALL_METHOD(NULL, service, "__construct", NULL, 70, name, definition, _0); + ZEPHIR_CALL_METHOD(NULL, &service, "__construct", NULL, 63, &name, definition, &_0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_services"), name, service TSRMLS_CC); - RETURN_CCTOR(service); + zephir_update_property_array(this_ptr, SL("_services"), &name, &service TSRMLS_CC); + RETURN_CCTOR(&service); } @@ -191,27 +203,31 @@ PHP_METHOD(Phalcon_Di, set) { PHP_METHOD(Phalcon_Di, setShared) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *definition, *_0; - zval *name = NULL; + zval *name_param = NULL, *definition, definition_sub, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&definition_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &definition); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_INIT_VAR(_0); - ZVAL_BOOL(_0, 1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, name, definition, _0); + ZVAL_BOOL(&_0, 1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &name, definition, &_0); zephir_check_call_status(); RETURN_MM(); @@ -223,28 +239,33 @@ PHP_METHOD(Phalcon_Di, setShared) { */ PHP_METHOD(Phalcon_Di, remove) { - zval *name_param = NULL, *_0, *_1; - zval *name = NULL; + zval *name_param = NULL, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_services"), PH_NOISY_CC); - zephir_array_unset(&_0, name, PH_SEPARATE); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_sharedInstances"), PH_NOISY_CC); - zephir_array_unset(&_1, name, PH_SEPARATE); + zephir_read_property(&_0, this_ptr, SL("_services"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_0, &name, PH_SEPARATE); + zephir_read_property(&_1, this_ptr, SL("_sharedInstances"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_1, &name, PH_SEPARATE); ZEPHIR_MM_RESTORE(); } @@ -258,21 +279,28 @@ PHP_METHOD(Phalcon_Di, attempt) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool shared; - zval *name_param = NULL, *definition, *shared_param = NULL, *service = NULL, *_0, *_1$$3; - zval *name = NULL; + zval *name_param = NULL, *definition, definition_sub, *shared_param = NULL, service, _0, _1$$3; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&definition_sub); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &name_param, &definition, &shared_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!shared_param) { shared = 0; @@ -281,20 +309,19 @@ PHP_METHOD(Phalcon_Di, attempt) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_services"), PH_NOISY_CC); - if (!(zephir_array_isset(_0, name))) { - ZEPHIR_INIT_VAR(service); - object_init_ex(service, phalcon_di_service_ce); - ZEPHIR_INIT_VAR(_1$$3); + zephir_read_property(&_0, this_ptr, SL("_services"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_0, &name))) { + ZEPHIR_INIT_VAR(&service); + object_init_ex(&service, phalcon_di_service_ce); if (shared) { - ZVAL_BOOL(_1$$3, 1); + ZVAL_BOOL(&_1$$3, 1); } else { - ZVAL_BOOL(_1$$3, 0); + ZVAL_BOOL(&_1$$3, 0); } - ZEPHIR_CALL_METHOD(NULL, service, "__construct", NULL, 70, name, definition, _1$$3); + ZEPHIR_CALL_METHOD(NULL, &service, "__construct", NULL, 63, &name, definition, &_1$$3); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_services"), name, service TSRMLS_CC); - RETURN_CCTOR(service); + zephir_update_property_array(this_ptr, SL("_services"), &name, &service TSRMLS_CC); + RETURN_CCTOR(&service); } RETURN_MM_BOOL(0); @@ -305,25 +332,29 @@ PHP_METHOD(Phalcon_Di, attempt) { */ PHP_METHOD(Phalcon_Di, setRaw) { - zval *name_param = NULL, *rawDefinition; - zval *name = NULL; + zval *name_param = NULL, *rawDefinition, rawDefinition_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&rawDefinition_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &rawDefinition); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - zephir_update_property_array(this_ptr, SL("_services"), name, rawDefinition TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_services"), &name, rawDefinition TSRMLS_CC); RETVAL_ZVAL(rawDefinition, 1, 0); RETURN_MM(); @@ -335,38 +366,45 @@ PHP_METHOD(Phalcon_Di, setRaw) { PHP_METHOD(Phalcon_Di, getRaw) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *service = NULL, *_0, *_1; - zval *name = NULL, *_2; + zval *name_param = NULL, service, _0, _1; + zval name, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(service); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_services"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&service, _0, name, 0 TSRMLS_CC)) { - ZEPHIR_RETURN_CALL_METHOD(service, "getdefinition", NULL, 0); + ZEPHIR_OBS_VAR(&service); + zephir_read_property(&_0, this_ptr, SL("_services"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&service, &_0, &name, 0 TSRMLS_CC)) { + ZEPHIR_RETURN_CALL_METHOD(&service, "getdefinition", NULL, 0); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(_1); - object_init_ex(_1, phalcon_di_exception_ce); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVS(_2, "Service '", name, "' wasn't found in the dependency injection container"); - ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 9, _2); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, phalcon_di_exception_ce); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVS(&_2, "Service '", &name, "' wasn't found in the dependency injection container"); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 4, &_2); zephir_check_call_status(); - zephir_throw_exception_debug(_1, "phalcon/di.zep", 191 TSRMLS_CC); + zephir_throw_exception_debug(&_1, "phalcon/di.zep", 191 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -378,36 +416,43 @@ PHP_METHOD(Phalcon_Di, getRaw) { PHP_METHOD(Phalcon_Di, getService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *service = NULL, *_0, *_1; - zval *name = NULL, *_2; + zval *name_param = NULL, service, _0, _1; + zval name, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(service); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_services"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&service, _0, name, 0 TSRMLS_CC)) { - RETURN_CCTOR(service); + ZEPHIR_OBS_VAR(&service); + zephir_read_property(&_0, this_ptr, SL("_services"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&service, &_0, &name, 0 TSRMLS_CC)) { + RETURN_CCTOR(&service); } - ZEPHIR_INIT_VAR(_1); - object_init_ex(_1, phalcon_di_exception_ce); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVS(_2, "Service '", name, "' wasn't found in the dependency injection container"); - ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 9, _2); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, phalcon_di_exception_ce); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVS(&_2, "Service '", &name, "' wasn't found in the dependency injection container"); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 4, &_2); zephir_check_call_status(); - zephir_throw_exception_debug(_1, "phalcon/di.zep", 205 TSRMLS_CC); + zephir_throw_exception_debug(&_1, "phalcon/di.zep", 205 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -419,59 +464,75 @@ PHP_METHOD(Phalcon_Di, getService) { PHP_METHOD(Phalcon_Di, get) { zend_bool _6$$6; - zval *_1$$3, *_7$$12; + zval _1$$3, _7$$12; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *parameters = NULL, *service = NULL, *eventsManager = NULL, *instance = NULL, *_0, *_2$$3, *_3$$4, *_4$$7, *_8$$12; - zval *name = NULL, *_5$$7; + zval *name_param = NULL, *parameters = NULL, parameters_sub, __$null, service, eventsManager, instance, _0, _2$$3, _3$$4, _4$$7, _8$$12; + zval name, _5$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&instance); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_8$$12); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_7$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, ¶meters); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(instance); - ZVAL_NULL(instance); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$3); - zephir_create_array(_1$$3, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&instance); + ZVAL_NULL(&instance); + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$3); + zephir_create_array(&_1$$3, 2, 0 TSRMLS_CC); zephir_array_update_string(&_1$$3, SL("name"), &name, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_1$$3, SL("parameters"), ¶meters, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "di:beforeServiceResolve", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&instance, eventsManager, "fire", NULL, 0, _2$$3, this_ptr, _1$$3); - zephir_check_temp_parameter(_2$$3); + zephir_array_update_string(&_1$$3, SL("parameters"), parameters, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "di:beforeServiceResolve"); + ZEPHIR_CALL_METHOD(&instance, &eventsManager, "fire", NULL, 0, &_2$$3, this_ptr, &_1$$3); zephir_check_call_status(); } - if (Z_TYPE_P(instance) != IS_OBJECT) { - ZEPHIR_OBS_VAR(service); - _3$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_services"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&service, _3$$4, name, 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&instance, service, "resolve", NULL, 0, parameters, this_ptr); + if (Z_TYPE_P(&instance) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&service); + zephir_read_property(&_3$$4, this_ptr, SL("_services"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&service, &_3$$4, &name, 0 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(&instance, &service, "resolve", NULL, 0, parameters, this_ptr); zephir_check_call_status(); } else { - if (!(zephir_class_exists(name, 1 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_4$$7); - object_init_ex(_4$$7, phalcon_di_exception_ce); - ZEPHIR_INIT_VAR(_5$$7); - ZEPHIR_CONCAT_SVS(_5$$7, "Service '", name, "' wasn't found in the dependency injection container"); - ZEPHIR_CALL_METHOD(NULL, _4$$7, "__construct", NULL, 9, _5$$7); + if (!(zephir_class_exists(&name, 1 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_4$$7); + object_init_ex(&_4$$7, phalcon_di_exception_ce); + ZEPHIR_INIT_VAR(&_5$$7); + ZEPHIR_CONCAT_SVS(&_5$$7, "Service '", &name, "' wasn't found in the dependency injection container"); + ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", NULL, 4, &_5$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$7, "phalcon/di.zep", 236 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$7, "phalcon/di.zep", 236 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -480,35 +541,34 @@ PHP_METHOD(Phalcon_Di, get) { _6$$6 = ((zephir_fast_count_int(parameters TSRMLS_CC)) ? 1 : 0); } if (_6$$6) { - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(instance, name, parameters TSRMLS_CC); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &name, parameters TSRMLS_CC); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(instance, name TSRMLS_CC); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&instance, &name TSRMLS_CC); zephir_check_call_status(); } } } - if (Z_TYPE_P(instance) == IS_OBJECT) { - if (zephir_instance_of_ev(instance, phalcon_di_injectionawareinterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, instance, "setdi", NULL, 0, this_ptr); + if (Z_TYPE_P(&instance) == IS_OBJECT) { + if (zephir_instance_of_ev(&instance, phalcon_di_injectionawareinterface_ce TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &instance, "setdi", NULL, 0, this_ptr); zephir_check_call_status(); } } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_7$$12); - zephir_create_array(_7$$12, 3, 0 TSRMLS_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_7$$12); + zephir_create_array(&_7$$12, 3, 0 TSRMLS_CC); zephir_array_update_string(&_7$$12, SL("name"), &name, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_7$$12, SL("parameters"), ¶meters, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_7$$12, SL("parameters"), parameters, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_7$$12, SL("instance"), &instance, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_8$$12); - ZVAL_STRING(_8$$12, "di:afterServiceResolve", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _8$$12, this_ptr, _7$$12); - zephir_check_temp_parameter(_8$$12); + ZEPHIR_INIT_VAR(&_8$$12); + ZVAL_STRING(&_8$$12, "di:afterServiceResolve"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_8$$12, this_ptr, &_7$$12); zephir_check_call_status(); } - RETURN_CCTOR(instance); + RETURN_CCTOR(&instance); } @@ -523,46 +583,56 @@ PHP_METHOD(Phalcon_Di, get) { PHP_METHOD(Phalcon_Di, getShared) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *parameters = NULL, *instance = NULL, *_0; - zval *name = NULL; + zval *name_param = NULL, *parameters = NULL, parameters_sub, __$true, __$false, __$null, instance, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(¶meters_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&instance); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, ¶meters); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_OBS_VAR(instance); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_sharedInstances"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&instance, _0, name, 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&instance); + zephir_read_property(&_0, this_ptr, SL("_sharedInstances"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&instance, &_0, &name, 0 TSRMLS_CC)) { if (0) { - zephir_update_property_this(getThis(), SL("_freshInstance"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_freshInstance"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_freshInstance"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_freshInstance"), &__$false); } } else { - ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", NULL, 0, name, parameters); + ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", NULL, 0, &name, parameters); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_sharedInstances"), name, instance TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_sharedInstances"), &name, &instance TSRMLS_CC); if (1) { - zephir_update_property_this(getThis(), SL("_freshInstance"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_freshInstance"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_freshInstance"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_freshInstance"), &__$false); } } - RETURN_CCTOR(instance); + RETURN_CCTOR(&instance); } @@ -571,26 +641,30 @@ PHP_METHOD(Phalcon_Di, getShared) { */ PHP_METHOD(Phalcon_Di, has) { - zval *name_param = NULL, *_0; - zval *name = NULL; + zval *name_param = NULL, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_services"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, name)); + zephir_read_property(&_0, this_ptr, SL("_services"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &name)); } @@ -599,7 +673,8 @@ PHP_METHOD(Phalcon_Di, has) { */ PHP_METHOD(Phalcon_Di, wasFreshInstance) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_freshInstance"); @@ -610,7 +685,8 @@ PHP_METHOD(Phalcon_Di, wasFreshInstance) { */ PHP_METHOD(Phalcon_Di, getServices) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_services"); @@ -622,7 +698,10 @@ PHP_METHOD(Phalcon_Di, getServices) { PHP_METHOD(Phalcon_Di, offsetExists) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name; + zval *name, name_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name); @@ -645,7 +724,11 @@ PHP_METHOD(Phalcon_Di, offsetExists) { PHP_METHOD(Phalcon_Di, offsetSet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, *definition; + zval *name, name_sub, *definition, definition_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name_sub); + ZVAL_UNDEF(&definition_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name, &definition); @@ -668,7 +751,10 @@ PHP_METHOD(Phalcon_Di, offsetSet) { PHP_METHOD(Phalcon_Di, offsetGet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name; + zval *name, name_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name); @@ -686,7 +772,10 @@ PHP_METHOD(Phalcon_Di, offsetGet) { */ PHP_METHOD(Phalcon_Di, offsetUnset) { - zval *name; + zval *name, name_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name_sub); zephir_fetch_params(0, 1, 0, &name); @@ -702,68 +791,83 @@ PHP_METHOD(Phalcon_Di, offsetUnset) { PHP_METHOD(Phalcon_Di, __call) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *arguments = NULL, *instance = NULL, *possibleService = NULL, *services = NULL, *definition = NULL, *_5, _0$$3, *_1$$3, _2$$8, *_3$$8, *_4$$8 = NULL; - zval *method = NULL, *_6; + zval *method_param = NULL, *arguments = NULL, arguments_sub, __$null, instance, possibleService, services, definition, _5, _0$$3, _1$$3, _2$$8, _3$$8, _4$$8; + zval method, _6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&arguments_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&instance); + ZVAL_UNDEF(&possibleService); + ZVAL_UNDEF(&services); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$8); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_4$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &method_param, &arguments); if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); } else { - ZEPHIR_INIT_VAR(method); - ZVAL_EMPTY_STRING(method); + ZEPHIR_INIT_VAR(&method); + ZVAL_EMPTY_STRING(&method); } if (!arguments) { - arguments = ZEPHIR_GLOBAL(global_null); + arguments = &arguments_sub; + arguments = &__$null; } - if (zephir_start_with_str(method, SL("get"))) { - ZEPHIR_OBS_VAR(services); - zephir_read_property_this(&services, this_ptr, SL("_services"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_0$$3); + if (zephir_start_with_str(&method, SL("get"))) { + ZEPHIR_OBS_VAR(&services); + zephir_read_property(&services, this_ptr, SL("_services"), PH_NOISY_CC); ZVAL_LONG(&_0$$3, 3); - ZEPHIR_INIT_VAR(_1$$3); - zephir_substr(_1$$3, method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_FUNCTION(&possibleService, "lcfirst", NULL, 71, _1$$3); + ZEPHIR_INIT_VAR(&_1$$3); + zephir_substr(&_1$$3, &method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_CALL_FUNCTION(&possibleService, "lcfirst", NULL, 64, &_1$$3); zephir_check_call_status(); - if (zephir_array_isset(services, possibleService)) { + if (zephir_array_isset(&services, &possibleService)) { if (zephir_fast_count_int(arguments TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", NULL, 0, possibleService, arguments); + ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", NULL, 0, &possibleService, arguments); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", NULL, 0, possibleService); + ZEPHIR_CALL_METHOD(&instance, this_ptr, "get", NULL, 0, &possibleService); zephir_check_call_status(); } - RETURN_CCTOR(instance); + RETURN_CCTOR(&instance); } } - if (zephir_start_with_str(method, SL("set"))) { - ZEPHIR_OBS_VAR(definition); + if (zephir_start_with_str(&method, SL("set"))) { + ZEPHIR_OBS_VAR(&definition); if (zephir_array_isset_long_fetch(&definition, arguments, 0, 0 TSRMLS_CC)) { - ZEPHIR_SINIT_VAR(_2$$8); ZVAL_LONG(&_2$$8, 3); - ZEPHIR_INIT_VAR(_3$$8); - zephir_substr(_3$$8, method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_FUNCTION(&_4$$8, "lcfirst", NULL, 71, _3$$8); + ZEPHIR_INIT_VAR(&_3$$8); + zephir_substr(&_3$$8, &method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_CALL_FUNCTION(&_4$$8, "lcfirst", NULL, 64, &_3$$8); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, _4$$8, definition); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, &_4$$8, &definition); zephir_check_call_status(); RETURN_MM_NULL(); } } - ZEPHIR_INIT_VAR(_5); - object_init_ex(_5, phalcon_di_exception_ce); - ZEPHIR_INIT_VAR(_6); - ZEPHIR_CONCAT_SVS(_6, "Call to undefined method or service '", method, "'"); - ZEPHIR_CALL_METHOD(NULL, _5, "__construct", NULL, 9, _6); + ZEPHIR_INIT_VAR(&_5); + object_init_ex(&_5, phalcon_di_exception_ce); + ZEPHIR_INIT_VAR(&_6); + ZEPHIR_CONCAT_SVS(&_6, "Call to undefined method or service '", &method, "'"); + ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 4, &_6); zephir_check_call_status(); - zephir_throw_exception_debug(_5, "phalcon/di.zep", 406 TSRMLS_CC); + zephir_throw_exception_debug(&_5, "phalcon/di.zep", 406 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -790,7 +894,10 @@ PHP_METHOD(Phalcon_Di, __call) { PHP_METHOD(Phalcon_Di, register) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *provider; + zval *provider, provider_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&provider_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &provider); @@ -808,13 +915,16 @@ PHP_METHOD(Phalcon_Di, register) { */ PHP_METHOD(Phalcon_Di, setDefault) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_static_property_ce(phalcon_di_ce, SL("_default"), &dependencyInjector TSRMLS_CC); + zend_update_static_property(phalcon_di_ce, ZEND_STRL("_default"), dependencyInjector); } @@ -823,11 +933,14 @@ PHP_METHOD(Phalcon_Di, setDefault) { */ PHP_METHOD(Phalcon_Di, getDefault) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_static_property_ce(phalcon_di_ce, SL("_default") TSRMLS_CC); - RETURN_CTORW(_0); + zephir_read_static_property_ce(&_0, phalcon_di_ce, SL("_default"), PH_NOISY_CC | PH_READONLY); + RETURN_CTORW(&_0); } @@ -836,9 +949,13 @@ PHP_METHOD(Phalcon_Di, getDefault) { */ PHP_METHOD(Phalcon_Di, reset) { - + zval __$null; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); - zephir_update_static_property_ce(phalcon_di_ce, SL("_default"), &ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + + zend_update_static_property(phalcon_di_ce, ZEND_STRL("_default"), &__$null); } @@ -878,36 +995,41 @@ PHP_METHOD(Phalcon_Di, reset) { PHP_METHOD(Phalcon_Di, loadFromYaml) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *callbacks = NULL; - zval *filePath_param = NULL, *callbacks_param = NULL, *services = NULL; - zval *filePath = NULL; + zval callbacks; + zval *filePath_param = NULL, *callbacks_param = NULL, services; + zval filePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filePath); + ZVAL_UNDEF(&services); + ZVAL_UNDEF(&callbacks); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &filePath_param, &callbacks_param); if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) { - zephir_get_strval(filePath, filePath_param); + zephir_get_strval(&filePath, filePath_param); } else { - ZEPHIR_INIT_VAR(filePath); - ZVAL_EMPTY_STRING(filePath); + ZEPHIR_INIT_VAR(&filePath); + ZVAL_EMPTY_STRING(&filePath); } if (!callbacks_param) { - ZEPHIR_INIT_VAR(callbacks); - array_init(callbacks); + ZEPHIR_INIT_VAR(&callbacks); + array_init(&callbacks); } else { - callbacks = callbacks_param; + ZEPHIR_OBS_COPY_OR_DUP(&callbacks, callbacks_param); } - ZEPHIR_INIT_VAR(services); - object_init_ex(services, phalcon_config_adapter_yaml_ce); - ZEPHIR_CALL_METHOD(NULL, services, "__construct", NULL, 72, filePath, callbacks); + ZEPHIR_INIT_VAR(&services); + object_init_ex(&services, phalcon_config_adapter_yaml_ce); + ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 65, &filePath, &callbacks); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, services); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, &services); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -948,29 +1070,33 @@ PHP_METHOD(Phalcon_Di, loadFromYaml) { PHP_METHOD(Phalcon_Di, loadFromPhp) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *filePath_param = NULL, *services = NULL; - zval *filePath = NULL; + zval *filePath_param = NULL, services; + zval filePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filePath); + ZVAL_UNDEF(&services); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &filePath_param); if (UNEXPECTED(Z_TYPE_P(filePath_param) != IS_STRING && Z_TYPE_P(filePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(filePath_param) == IS_STRING)) { - zephir_get_strval(filePath, filePath_param); + zephir_get_strval(&filePath, filePath_param); } else { - ZEPHIR_INIT_VAR(filePath); - ZVAL_EMPTY_STRING(filePath); + ZEPHIR_INIT_VAR(&filePath); + ZVAL_EMPTY_STRING(&filePath); } - ZEPHIR_INIT_VAR(services); - object_init_ex(services, phalcon_config_adapter_php_ce); - ZEPHIR_CALL_METHOD(NULL, services, "__construct", NULL, 73, filePath); + ZEPHIR_INIT_VAR(&services); + object_init_ex(&services, phalcon_config_adapter_php_ce); + ZEPHIR_CALL_METHOD(NULL, &services, "__construct", NULL, 66, &filePath); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, services); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfromconfig", NULL, 0, &services); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -982,11 +1108,19 @@ PHP_METHOD(Phalcon_Di, loadFromPhp) { PHP_METHOD(Phalcon_Di, loadFromConfig) { zend_bool _3$$3; - HashTable *_1; - HashPosition _0; + zend_string *_2; + zend_ulong _1; zephir_fcall_cache_entry *_6 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *services = NULL, *name = NULL, *service = NULL, **_2, *_4$$3 = NULL, *_5$$3 = NULL; + zval *config, config_sub, services, name, service, *_0, _4$$3, _5$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&services); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); @@ -995,24 +1129,29 @@ PHP_METHOD(Phalcon_Di, loadFromConfig) { ZEPHIR_CALL_METHOD(&services, config, "toarray", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(services, &_1, &_0, 0, 0, "phalcon/di.zep", 551); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(name, _1, _0); - ZEPHIR_GET_HVALUE(service, _2); - _3$$3 = zephir_array_isset_string(service, SS("shared")); + zephir_is_iterable(&services, 0, "phalcon/di.zep", 551); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&services), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&name); + if (_2 != NULL) { + ZVAL_STR_COPY(&name, _2); + } else { + ZVAL_LONG(&name, _1); + } + ZEPHIR_INIT_NVAR(&service); + ZVAL_COPY(&service, _0); + _3$$3 = zephir_array_isset_string(&service, SL("shared")); if (_3$$3) { - ZEPHIR_OBS_NVAR(_4$$3); - zephir_array_fetch_string(&_4$$3, service, SL("shared"), PH_NOISY, "phalcon/di.zep", 549 TSRMLS_CC); - _3$$3 = zephir_is_true(_4$$3); + ZEPHIR_OBS_NVAR(&_4$$3); + zephir_array_fetch_string(&_4$$3, &service, SL("shared"), PH_NOISY, "phalcon/di.zep", 549 TSRMLS_CC); + _3$$3 = zephir_is_true(&_4$$3); } - ZEPHIR_INIT_NVAR(_5$$3); - ZVAL_BOOL(_5$$3, _3$$3); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", &_6, 0, name, service, _5$$3); + ZVAL_BOOL(&_5$$3, _3$$3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", &_6, 0, &name, &service, &_5$$3); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&service); + ZEPHIR_INIT_NVAR(&name); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/di.zep.h b/ext/phalcon/di.zep.h index 25612dcd90d..8777f9f3681 100644 --- a/ext/phalcon/di.zep.h +++ b/ext/phalcon/di.zep.h @@ -35,59 +35,156 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_setinternaleventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_getinternaleventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_getinternaleventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_set, 0, 2, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_set, 0, 2, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, definition) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, shared, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, shared) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_setshared, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_setshared, 0, 2, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_setshared, 0, 2, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, definition) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_remove, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_attempt, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, definition) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, shared, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, shared) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_setraw, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_setraw, 0, 2, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_setraw, 0, 2, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_OBJ_INFO(0, rawDefinition, Phalcon\\Di\\ServiceInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_getraw, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_getservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_getservice, 0, 1, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_getservice, 0, 1, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_getshared, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_wasfreshinstance, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_wasfreshinstance, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_getservices, 0, 0, Phalcon\\Di\\Service, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_getservices, 0, 0, IS_OBJECT, "Phalcon\\Di\\Service", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_offsetexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_offsetexists, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetset, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_offsetset, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_offsetset, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, definition) ZEND_END_ARG_INFO() @@ -96,12 +193,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetget, 0, 0, 1) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_offsetunset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_offsetunset, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_offsetunset, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di___call, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() @@ -113,13 +218,28 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_setdefault, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_getdefault, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_getdefault, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_loadfromyaml, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filePath) +#endif ZEND_ARG_ARRAY_INFO(0, callbacks, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_loadfromphp, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filePath) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_loadfromconfig, 0, 0, 1) @@ -129,7 +249,7 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_di_method_entry) { PHP_ME(Phalcon_Di, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Di, setInternalEventsManager, arginfo_phalcon_di_setinternaleventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Di, getInternalEventsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Di, getInternalEventsManager, arginfo_phalcon_di_getinternaleventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, set, arginfo_phalcon_di_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, setShared, arginfo_phalcon_di_setshared, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, remove, arginfo_phalcon_di_remove, ZEND_ACC_PUBLIC) @@ -140,8 +260,8 @@ ZEPHIR_INIT_FUNCS(phalcon_di_method_entry) { PHP_ME(Phalcon_Di, get, arginfo_phalcon_di_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, getShared, arginfo_phalcon_di_getshared, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, has, arginfo_phalcon_di_has, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Di, wasFreshInstance, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Di, getServices, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Di, wasFreshInstance, arginfo_phalcon_di_wasfreshinstance, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Di, getServices, arginfo_phalcon_di_getservices, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, offsetExists, arginfo_phalcon_di_offsetexists, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, offsetSet, arginfo_phalcon_di_offsetset, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, offsetGet, arginfo_phalcon_di_offsetget, ZEND_ACC_PUBLIC) @@ -149,7 +269,7 @@ ZEPHIR_INIT_FUNCS(phalcon_di_method_entry) { PHP_ME(Phalcon_Di, __call, arginfo_phalcon_di___call, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, register, arginfo_phalcon_di_register, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, setDefault, arginfo_phalcon_di_setdefault, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Di, getDefault, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Di, getDefault, arginfo_phalcon_di_getdefault, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Di, reset, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Di, loadFromYaml, arginfo_phalcon_di_loadfromyaml, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di, loadFromPhp, arginfo_phalcon_di_loadfromphp, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/di/factorydefault.zep.c b/ext/phalcon/di/factorydefault.zep.c index bdd4e525b70..453c44c0c16 100644 --- a/ext/phalcon/di/factorydefault.zep.c +++ b/ext/phalcon/di/factorydefault.zep.c @@ -38,289 +38,234 @@ ZEPHIR_INIT_CLASS(Phalcon_Di_FactoryDefault) { */ PHP_METHOD(Phalcon_Di_FactoryDefault, __construct) { - zval *_2 = NULL, *_3 = NULL, *_4 = NULL, *_5 = NULL; - zval *_1; + zval _2, _3, _4, _5; + zval _1; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_PARENT(NULL, phalcon_di_factorydefault_ce, getThis(), "__construct", &_0, 81); + ZEPHIR_CALL_PARENT(NULL, phalcon_di_factorydefault_ce, getThis(), "__construct", &_0, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 21, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_VAR(_3); - ZVAL_STRING(_3, "router", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_4); - ZVAL_STRING(_4, "Phalcon\\Mvc\\Router", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 21, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "router"); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Mvc\\Router"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("router"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "dispatcher", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Mvc\\Dispatcher", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "dispatcher"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Mvc\\Dispatcher"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("dispatcher"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "url", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Mvc\\Url", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "url"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Mvc\\Url"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("url"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "modelsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\Manager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "modelsManager"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Mvc\\Model\\Manager"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsManager"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\MetaData\\Memory", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "modelsMetadata"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Mvc\\Model\\MetaData\\Memory"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsMetadata"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "response", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Http\\Response", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "response"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Http\\Response"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("response"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "cookies", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Http\\Response\\Cookies", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "cookies"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Http\\Response\\Cookies"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("cookies"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "request", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Http\\Request", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "request"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Http\\Request"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("request"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "filter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Filter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "filter"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Filter"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("filter"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "escaper", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Escaper", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "escaper"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Escaper"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("escaper"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "security", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Security", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "security"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Security"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("security"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "crypt", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Crypt", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "crypt"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Crypt"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("crypt"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "annotations", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Annotations\\Adapter\\Memory", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "annotations"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Annotations\\Adapter\\Memory"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("annotations"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "flash", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Flash\\Direct", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "flash"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Flash\\Direct"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("flash"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "flashSession", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Flash\\Session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "flashSession"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Flash\\Session"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("flashSession"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "tag", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Tag", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "tag"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Tag"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("tag"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Session\\Adapter\\Files", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "session"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Session\\Adapter\\Files"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("session"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "sessionBag", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Session\\Bag", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "sessionBag"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Session\\Bag"); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4); zephir_check_call_status(); zephir_array_update_string(&_1, SL("sessionBag"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "eventsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Events\\Manager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "eventsManager"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Events\\Manager"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("eventsManager"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "transactionManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\Transaction\\Manager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "transactionManager"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Mvc\\Model\\Transaction\\Manager"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("transactionManager"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "assets", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Assets\\Manager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "assets"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Assets\\Manager"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("assets"), &_2, PH_COPY | PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_services"), _1 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_services"), &_1); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/di/factorydefault/cli.zep.c b/ext/phalcon/di/factorydefault/cli.zep.c index 1f4d3a76292..df76dc11ea6 100644 --- a/ext/phalcon/di/factorydefault/cli.zep.c +++ b/ext/phalcon/di/factorydefault/cli.zep.c @@ -39,148 +39,125 @@ ZEPHIR_INIT_CLASS(Phalcon_Di_FactoryDefault_Cli) { */ PHP_METHOD(Phalcon_Di_FactoryDefault_Cli, __construct) { - zval *_2 = NULL, *_3 = NULL, *_4 = NULL, *_5 = NULL; - zval *_1; + zval _2, _3, _4, _5; + zval _1; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_PARENT(NULL, phalcon_di_factorydefault_cli_ce, getThis(), "__construct", &_0, 197); + ZEPHIR_CALL_PARENT(NULL, phalcon_di_factorydefault_cli_ce, getThis(), "__construct", &_0, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 10, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_VAR(_3); - ZVAL_STRING(_3, "router", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_4); - ZVAL_STRING(_4, "Phalcon\\Cli\\Router", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 10, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "router"); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Cli\\Router"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("router"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "dispatcher", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Cli\\Dispatcher", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "dispatcher"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Cli\\Dispatcher"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("dispatcher"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "modelsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\Manager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "modelsManager"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Mvc\\Model\\Manager"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsManager"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\MetaData\\Memory", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "modelsMetadata"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Mvc\\Model\\MetaData\\Memory"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("modelsMetadata"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "filter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Filter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "filter"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Filter"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("filter"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "escaper", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Escaper", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "escaper"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Escaper"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("escaper"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "annotations", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Annotations\\Adapter\\Memory", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "annotations"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Annotations\\Adapter\\Memory"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("annotations"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "security", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Security", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "security"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Security"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("security"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "eventsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Events\\Manager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "eventsManager"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Events\\Manager"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("eventsManager"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_di_service_ce); - ZEPHIR_INIT_NVAR(_3); - ZVAL_STRING(_3, "transactionManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "Phalcon\\Mvc\\Model\\Transaction\\Manager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_5); - ZVAL_BOOL(_5, 1); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 70, _3, _4, _5); - zephir_check_temp_parameter(_3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_di_service_ce); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "transactionManager"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Mvc\\Model\\Transaction\\Manager"); + ZVAL_BOOL(&_5, 1); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 63, &_3, &_4, &_5); zephir_check_call_status(); zephir_array_update_string(&_1, SL("transactionManager"), &_2, PH_COPY | PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_services"), _1 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_services"), &_1); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/di/injectable.zep.c b/ext/phalcon/di/injectable.zep.c index ca1bd0f34ba..2af9f769ff5 100644 --- a/ext/phalcon/di/injectable.zep.c +++ b/ext/phalcon/di/injectable.zep.c @@ -82,13 +82,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Di_Injectable) { */ PHP_METHOD(Phalcon_Di_Injectable, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -97,19 +100,22 @@ PHP_METHOD(Phalcon_Di_Injectable, setDI) { */ PHP_METHOD(Phalcon_Di_Injectable, getDI) { - zval *dependencyInjector = NULL; + zval dependencyInjector; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); } - RETURN_CCTOR(dependencyInjector); + RETURN_CCTOR(&dependencyInjector); } @@ -118,13 +124,16 @@ PHP_METHOD(Phalcon_Di_Injectable, getDI) { */ PHP_METHOD(Phalcon_Di_Injectable, setEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); } @@ -133,7 +142,8 @@ PHP_METHOD(Phalcon_Di_Injectable, setEventsManager) { */ PHP_METHOD(Phalcon_Di_Injectable, getEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -144,67 +154,78 @@ PHP_METHOD(Phalcon_Di_Injectable, getEventsManager) { */ PHP_METHOD(Phalcon_Di_Injectable, __get) { - zval *_4$$7; + zval _4$$7; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL; - zval *propertyName_param = NULL, *dependencyInjector = NULL, *service = NULL, *persistent = NULL, *_0, *_2 = NULL, *_3$$7 = NULL, *_5$$7 = NULL; - zval *propertyName = NULL, *_6; + zval *propertyName_param = NULL, dependencyInjector, service, persistent, _0, _2, _3$$7, _5$$7; + zval propertyName, _6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&propertyName); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&persistent); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_4$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &propertyName_param); if (UNEXPECTED(Z_TYPE_P(propertyName_param) != IS_STRING && Z_TYPE_P(propertyName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'propertyName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'propertyName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(propertyName_param) == IS_STRING)) { - zephir_get_strval(propertyName, propertyName_param); + zephir_get_strval(&propertyName, propertyName_param); } else { - ZEPHIR_INIT_VAR(propertyName); - ZVAL_EMPTY_STRING(propertyName); + ZEPHIR_INIT_VAR(&propertyName); + ZVAL_EMPTY_STRING(&propertyName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_1, 1); + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_1, 0); zephir_check_call_status(); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "A dependency injection object is required to access the application services", "phalcon/di/injectable.zep", 127); return; } } - ZEPHIR_CALL_METHOD(&_2, dependencyInjector, "has", NULL, 0, propertyName); + ZEPHIR_CALL_METHOD(&_2, &dependencyInjector, "has", NULL, 0, &propertyName); zephir_check_call_status(); - if (zephir_is_true(_2)) { - ZEPHIR_CALL_METHOD(&service, dependencyInjector, "getshared", NULL, 0, propertyName); + if (zephir_is_true(&_2)) { + ZEPHIR_CALL_METHOD(&service, &dependencyInjector, "getshared", NULL, 0, &propertyName); zephir_check_call_status(); - zephir_update_property_zval_zval(getThis(), propertyName, service TSRMLS_CC); - RETURN_CCTOR(service); + zephir_update_property_zval_zval(this_ptr, &propertyName, &service TSRMLS_CC); + RETURN_CCTOR(&service); } - if (ZEPHIR_IS_STRING(propertyName, "di")) { - zephir_update_property_this(getThis(), SL("di"), dependencyInjector TSRMLS_CC); - RETURN_CCTOR(dependencyInjector); + if (ZEPHIR_IS_STRING(&propertyName, "di")) { + zephir_update_property_zval(this_ptr, SL("di"), &dependencyInjector); + RETURN_CCTOR(&dependencyInjector); } - if (ZEPHIR_IS_STRING(propertyName, "persistent")) { - ZEPHIR_INIT_VAR(_4$$7); - zephir_create_array(_4$$7, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_5$$7); - zephir_get_class(_5$$7, this_ptr, 0 TSRMLS_CC); - zephir_array_fast_append(_4$$7, _5$$7); - ZEPHIR_INIT_NVAR(_5$$7); - ZVAL_STRING(_5$$7, "sessionBag", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3$$7, dependencyInjector, "get", NULL, 0, _5$$7, _4$$7); - zephir_check_temp_parameter(_5$$7); + if (ZEPHIR_IS_STRING(&propertyName, "persistent")) { + ZEPHIR_INIT_VAR(&_4$$7); + zephir_create_array(&_4$$7, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$7); + zephir_get_class(&_5$$7, this_ptr, 0 TSRMLS_CC); + zephir_array_fast_append(&_4$$7, &_5$$7); + ZEPHIR_INIT_NVAR(&_5$$7); + ZVAL_STRING(&_5$$7, "sessionBag"); + ZEPHIR_CALL_METHOD(&_3$$7, &dependencyInjector, "get", NULL, 0, &_5$$7, &_4$$7); zephir_check_call_status(); - ZEPHIR_CPY_WRT(persistent, _3$$7); - zephir_update_property_this(getThis(), SL("persistent"), persistent TSRMLS_CC); - RETURN_CCTOR(persistent); + ZEPHIR_CPY_WRT(&persistent, &_3$$7); + zephir_update_property_zval(this_ptr, SL("persistent"), &persistent); + RETURN_CCTOR(&persistent); } - ZEPHIR_INIT_VAR(_6); - ZEPHIR_CONCAT_SV(_6, "Access to undefined property ", propertyName); - ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 2, _6); + ZEPHIR_INIT_VAR(&_6); + ZEPHIR_CONCAT_SV(&_6, "Access to undefined property ", &propertyName); + ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 1, &_6); zephir_check_call_status(); RETURN_MM_NULL(); diff --git a/ext/phalcon/di/injectable.zep.h b/ext/phalcon/di/injectable.zep.h index ac1e4e5dc68..e0e2ac072d3 100644 --- a/ext/phalcon/di/injectable.zep.h +++ b/ext/phalcon/di/injectable.zep.h @@ -13,19 +13,37 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_injectable_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_injectable_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_injectable_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_injectable_seteventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_injectable_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_injectable_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_injectable___get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, propertyName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, propertyName) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_di_injectable_method_entry) { PHP_ME(Phalcon_Di_Injectable, setDI, arginfo_phalcon_di_injectable_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Di_Injectable, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Di_Injectable, getDI, arginfo_phalcon_di_injectable_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Injectable, setEventsManager, arginfo_phalcon_di_injectable_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Di_Injectable, getEventsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Di_Injectable, getEventsManager, arginfo_phalcon_di_injectable_geteventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Injectable, __get, arginfo_phalcon_di_injectable___get, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/di/injectionawareinterface.zep.h b/ext/phalcon/di/injectionawareinterface.zep.h index d265b3289ff..5002a2051e7 100644 --- a/ext/phalcon/di/injectionawareinterface.zep.h +++ b/ext/phalcon/di/injectionawareinterface.zep.h @@ -7,8 +7,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_injectionawareinterface_setdi, 0, 0, 1 ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_injectionawareinterface_getdi, 0, 0, Phalcon\\DiInterface, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_injectionawareinterface_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 1) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_di_injectionawareinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Di_InjectionAwareInterface, setDI, arginfo_phalcon_di_injectionawareinterface_setdi) - PHP_ABSTRACT_ME(Phalcon_Di_InjectionAwareInterface, getDI, NULL) + PHP_ABSTRACT_ME(Phalcon_Di_InjectionAwareInterface, getDI, arginfo_phalcon_di_injectionawareinterface_getdi) PHP_FE_END }; diff --git a/ext/phalcon/di/service.zep.c b/ext/phalcon/di/service.zep.c index da22d235bc1..9499f30ae23 100644 --- a/ext/phalcon/di/service.zep.c +++ b/ext/phalcon/di/service.zep.c @@ -66,21 +66,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Di_Service) { PHP_METHOD(Phalcon_Di_Service, __construct) { zend_bool shared; - zval *name_param = NULL, *definition, *shared_param = NULL; - zval *name = NULL; + zval *name_param = NULL, *definition, definition_sub, *shared_param = NULL, __$true, __$false; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&definition_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &name_param, &definition, &shared_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!shared_param) { shared = 0; @@ -89,12 +95,12 @@ PHP_METHOD(Phalcon_Di_Service, __construct) { } - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_definition"), definition TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); + zephir_update_property_zval(this_ptr, SL("_definition"), definition); if (shared) { - zephir_update_property_this(getThis(), SL("_shared"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_shared"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_shared"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_shared"), &__$false); } ZEPHIR_MM_RESTORE(); @@ -105,7 +111,8 @@ PHP_METHOD(Phalcon_Di_Service, __construct) { */ PHP_METHOD(Phalcon_Di_Service, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -116,8 +123,12 @@ PHP_METHOD(Phalcon_Di_Service, getName) { */ PHP_METHOD(Phalcon_Di_Service, setShared) { - zval *shared_param = NULL; + zval *shared_param = NULL, __$true, __$false; zend_bool shared; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &shared_param); @@ -125,9 +136,9 @@ PHP_METHOD(Phalcon_Di_Service, setShared) { if (shared) { - zephir_update_property_this(getThis(), SL("_shared"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_shared"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_shared"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_shared"), &__$false); } } @@ -137,7 +148,8 @@ PHP_METHOD(Phalcon_Di_Service, setShared) { */ PHP_METHOD(Phalcon_Di_Service, isShared) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_shared"); @@ -150,13 +162,16 @@ PHP_METHOD(Phalcon_Di_Service, isShared) { */ PHP_METHOD(Phalcon_Di_Service, setSharedInstance) { - zval *sharedInstance; + zval *sharedInstance, sharedInstance_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sharedInstance_sub); zephir_fetch_params(0, 1, 0, &sharedInstance); - zephir_update_property_this(getThis(), SL("_sharedInstance"), sharedInstance TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sharedInstance"), sharedInstance); } @@ -167,13 +182,16 @@ PHP_METHOD(Phalcon_Di_Service, setSharedInstance) { */ PHP_METHOD(Phalcon_Di_Service, setDefinition) { - zval *definition; + zval *definition, definition_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&definition_sub); zephir_fetch_params(0, 1, 0, &definition); - zephir_update_property_this(getThis(), SL("_definition"), definition TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_definition"), definition); } @@ -184,7 +202,8 @@ PHP_METHOD(Phalcon_Di_Service, setDefinition) { */ PHP_METHOD(Phalcon_Di_Service, getDefinition) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_definition"); @@ -202,83 +221,101 @@ PHP_METHOD(Phalcon_Di_Service, resolve) { zend_class_entry *_1$$15; zend_bool found = 0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters = NULL, *dependencyInjector = NULL, *shared = NULL, *definition = NULL, *sharedInstance = NULL, *instance = NULL, *builder = NULL, *_0$$15 = NULL, *_2$$22, *_3$$22, *_4$$22; + zval *parameters = NULL, parameters_sub, *dependencyInjector = NULL, dependencyInjector_sub, __$true, __$false, __$null, shared, definition, sharedInstance, instance, builder, _0$$15, _2$$22, _3$$22, _4$$22; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&shared); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&sharedInstance); + ZVAL_UNDEF(&instance); + ZVAL_UNDEF(&builder); + ZVAL_UNDEF(&_0$$15); + ZVAL_UNDEF(&_2$$22); + ZVAL_UNDEF(&_3$$22); + ZVAL_UNDEF(&_4$$22); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, ¶meters, &dependencyInjector); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } if (!dependencyInjector) { - dependencyInjector = ZEPHIR_GLOBAL(global_null); + dependencyInjector = &dependencyInjector_sub; + dependencyInjector = &__$null; } - ZEPHIR_OBS_VAR(shared); - zephir_read_property_this(&shared, this_ptr, SL("_shared"), PH_NOISY_CC); - if (zephir_is_true(shared)) { - ZEPHIR_OBS_VAR(sharedInstance); - zephir_read_property_this(&sharedInstance, this_ptr, SL("_sharedInstance"), PH_NOISY_CC); - if (Z_TYPE_P(sharedInstance) != IS_NULL) { - RETURN_CCTOR(sharedInstance); + ZEPHIR_OBS_VAR(&shared); + zephir_read_property(&shared, this_ptr, SL("_shared"), PH_NOISY_CC); + if (zephir_is_true(&shared)) { + ZEPHIR_OBS_VAR(&sharedInstance); + zephir_read_property(&sharedInstance, this_ptr, SL("_sharedInstance"), PH_NOISY_CC); + if (Z_TYPE_P(&sharedInstance) != IS_NULL) { + RETURN_CCTOR(&sharedInstance); } } found = 1; - ZEPHIR_INIT_VAR(instance); - ZVAL_NULL(instance); - ZEPHIR_OBS_VAR(definition); - zephir_read_property_this(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); - if (Z_TYPE_P(definition) == IS_STRING) { - if (zephir_class_exists(definition, 1 TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&instance); + ZVAL_NULL(&instance); + ZEPHIR_OBS_VAR(&definition); + zephir_read_property(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); + if (Z_TYPE_P(&definition) == IS_STRING) { + if (zephir_class_exists(&definition, 1 TSRMLS_CC)) { if (Z_TYPE_P(parameters) == IS_ARRAY) { if (zephir_fast_count_int(parameters TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(instance, definition, parameters TSRMLS_CC); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &definition, parameters TSRMLS_CC); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(instance, definition TSRMLS_CC); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&instance, &definition TSRMLS_CC); zephir_check_call_status(); } } else { - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(instance, definition TSRMLS_CC); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&instance, &definition TSRMLS_CC); zephir_check_call_status(); } } else { found = 0; } } else { - if (Z_TYPE_P(definition) == IS_OBJECT) { - if (zephir_instance_of_ev(definition, zend_ce_closure TSRMLS_CC)) { + if (Z_TYPE_P(&definition) == IS_OBJECT) { + if (zephir_instance_of_ev(&definition, zend_ce_closure TSRMLS_CC)) { if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { - _1$$15 = zend_fetch_class(SL("Closure"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - ZEPHIR_CALL_CE_STATIC(&_0$$15, _1$$15, "bind", NULL, 0, definition, dependencyInjector); + _1$$15 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO); + ZEPHIR_CALL_CE_STATIC(&_0$$15, _1$$15, "bind", NULL, 0, &definition, dependencyInjector); zephir_check_call_status(); - ZEPHIR_CPY_WRT(definition, _0$$15); + ZEPHIR_CPY_WRT(&definition, &_0$$15); } if (Z_TYPE_P(parameters) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_CALL_USER_FUNC_ARRAY(instance, definition, parameters); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_CALL_USER_FUNC_ARRAY(&instance, &definition, parameters); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_CALL_USER_FUNC(instance, definition); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_CALL_USER_FUNC(&instance, &definition); zephir_check_call_status(); } } else { - ZEPHIR_CPY_WRT(instance, definition); + ZEPHIR_CPY_WRT(&instance, &definition); } } else { - if (Z_TYPE_P(definition) == IS_ARRAY) { - ZEPHIR_INIT_VAR(builder); - object_init_ex(builder, phalcon_di_service_builder_ce); - if (zephir_has_constructor(builder TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, builder, "__construct", NULL, 0); + if (Z_TYPE_P(&definition) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&builder); + object_init_ex(&builder, phalcon_di_service_builder_ce); + if (zephir_has_constructor(&builder TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &builder, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&instance, builder, "build", NULL, 198, dependencyInjector, definition, parameters); + ZEPHIR_CALL_METHOD(&instance, &builder, "build", NULL, 174, dependencyInjector, &definition, parameters); zephir_check_call_status(); } else { found = 0; @@ -286,26 +323,26 @@ PHP_METHOD(Phalcon_Di_Service, resolve) { } } if (found == 0) { - ZEPHIR_INIT_VAR(_2$$22); - object_init_ex(_2$$22, phalcon_di_exception_ce); - _3$$22 = zephir_fetch_nproperty_this(this_ptr, SL("_name"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_4$$22); - ZEPHIR_CONCAT_SVS(_4$$22, "Service '", _3$$22, "' cannot be resolved"); - ZEPHIR_CALL_METHOD(NULL, _2$$22, "__construct", NULL, 9, _4$$22); + ZEPHIR_INIT_VAR(&_2$$22); + object_init_ex(&_2$$22, phalcon_di_exception_ce); + zephir_read_property(&_3$$22, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_4$$22); + ZEPHIR_CONCAT_SVS(&_4$$22, "Service '", &_3$$22, "' cannot be resolved"); + ZEPHIR_CALL_METHOD(NULL, &_2$$22, "__construct", NULL, 4, &_4$$22); zephir_check_call_status(); - zephir_throw_exception_debug(_2$$22, "phalcon/di/service.zep", 208 TSRMLS_CC); + zephir_throw_exception_debug(&_2$$22, "phalcon/di/service.zep", 208 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_is_true(shared)) { - zephir_update_property_this(getThis(), SL("_sharedInstance"), instance TSRMLS_CC); + if (zephir_is_true(&shared)) { + zephir_update_property_zval(this_ptr, SL("_sharedInstance"), &instance); } if (1) { - zephir_update_property_this(getThis(), SL("_resolved"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_resolved"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_resolved"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_resolved"), &__$false); } - RETURN_CCTOR(instance); + RETURN_CCTOR(&instance); } @@ -314,33 +351,38 @@ PHP_METHOD(Phalcon_Di_Service, resolve) { */ PHP_METHOD(Phalcon_Di_Service, setParameter) { - zval *parameter = NULL; - zval *position_param = NULL, *parameter_param = NULL, *definition = NULL, *arguments = NULL; + zval parameter; + zval *position_param = NULL, *parameter_param = NULL, definition, arguments; zend_long position; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(¶meter); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &position_param, ¶meter_param); position = zephir_get_intval(position_param); - parameter = parameter_param; + ZEPHIR_OBS_COPY_OR_DUP(¶meter, parameter_param); - ZEPHIR_OBS_VAR(definition); - zephir_read_property_this(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); - if (Z_TYPE_P(definition) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&definition); + zephir_read_property(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); + if (Z_TYPE_P(&definition) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Definition must be an array to update its parameters", "phalcon/di/service.zep", 232); return; } - ZEPHIR_OBS_VAR(arguments); - if (zephir_array_isset_string_fetch(&arguments, definition, SS("arguments"), 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&arguments); + if (zephir_array_isset_string_fetch(&arguments, &definition, SL("arguments"), 0)) { zephir_array_update_long(&arguments, position, ¶meter, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } else { - ZEPHIR_INIT_NVAR(arguments); - zephir_create_array(arguments, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&arguments); + zephir_create_array(&arguments, 1, 0 TSRMLS_CC); zephir_array_update_long(&arguments, position, ¶meter, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); } zephir_array_update_string(&definition, SL("arguments"), &arguments, PH_COPY | PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_definition"), definition TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_definition"), &definition); RETURN_THIS(); } @@ -353,8 +395,13 @@ PHP_METHOD(Phalcon_Di_Service, setParameter) { */ PHP_METHOD(Phalcon_Di_Service, getParameter) { - zval *position_param = NULL, *definition = NULL, *arguments = NULL, *parameter = NULL; + zval *position_param = NULL, definition, arguments, parameter; zend_long position; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(¶meter); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &position_param); @@ -362,15 +409,15 @@ PHP_METHOD(Phalcon_Di_Service, getParameter) { position = zephir_get_intval(position_param); - ZEPHIR_OBS_VAR(definition); - zephir_read_property_this(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); - if (Z_TYPE_P(definition) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&definition); + zephir_read_property(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); + if (Z_TYPE_P(&definition) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Definition must be an array to obtain its parameters", "phalcon/di/service.zep", 269); return; } - if (zephir_array_isset_string_fetch(&arguments, definition, SS("arguments"), 1 TSRMLS_CC)) { - if (zephir_array_isset_long_fetch(¶meter, arguments, position, 1 TSRMLS_CC)) { - RETURN_CTOR(parameter); + if (zephir_array_isset_string_fetch(&arguments, &definition, SL("arguments"), 1)) { + if (zephir_array_isset_long_fetch(¶meter, &arguments, position, 1 TSRMLS_CC)) { + RETURN_CTOR(¶meter); } } RETURN_MM_NULL(); @@ -382,7 +429,8 @@ PHP_METHOD(Phalcon_Di_Service, getParameter) { */ PHP_METHOD(Phalcon_Di_Service, isResolved) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_resolved"); @@ -394,32 +442,38 @@ PHP_METHOD(Phalcon_Di_Service, isResolved) { PHP_METHOD(Phalcon_Di_Service, __set_state) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes_param = NULL, *name = NULL, *definition = NULL, *shared = NULL; - zval *attributes = NULL; + zval *attributes_param = NULL, name, definition, shared; + zval attributes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&shared); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attributes_param); - attributes = attributes_param; + ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param); - ZEPHIR_OBS_VAR(name); - if (!(zephir_array_isset_string_fetch(&name, attributes, SS("_name"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&name); + if (!(zephir_array_isset_string_fetch(&name, &attributes, SL("_name"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The attribute '_name' is required", "phalcon/di/service.zep", 300); return; } - ZEPHIR_OBS_VAR(definition); - if (!(zephir_array_isset_string_fetch(&definition, attributes, SS("_definition"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&definition); + if (!(zephir_array_isset_string_fetch(&definition, &attributes, SL("_definition"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The attribute '_definition' is required", "phalcon/di/service.zep", 304); return; } - ZEPHIR_OBS_VAR(shared); - if (!(zephir_array_isset_string_fetch(&shared, attributes, SS("_shared"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&shared); + if (!(zephir_array_isset_string_fetch(&shared, &attributes, SL("_shared"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The attribute '_shared' is required", "phalcon/di/service.zep", 308); return; } object_init_ex(return_value, phalcon_di_service_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 70, name, definition, shared); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 63, &name, &definition, &shared); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/di/service.zep.h b/ext/phalcon/di/service.zep.h index d25ec441a1c..ca4de644e68 100644 --- a/ext/phalcon/di/service.zep.h +++ b/ext/phalcon/di/service.zep.h @@ -17,13 +17,39 @@ PHP_METHOD(Phalcon_Di_Service, isResolved); PHP_METHOD(Phalcon_Di_Service, __set_state); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service___construct, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, definition) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, shared, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, shared) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service_getname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service_setshared, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, shared, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, shared) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service_isshared, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service_isshared, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service_setsharedinstance, 0, 0, 1) @@ -39,31 +65,54 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service_resolve, 0, 0, 0) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service_setparameter, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_service_setparameter, 0, 2, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service_setparameter, 0, 2, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0) +#else ZEND_ARG_INFO(0, position) +#endif ZEND_ARG_ARRAY_INFO(0, parameter, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service_getparameter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0) +#else ZEND_ARG_INFO(0, position) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service_isresolved, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service_isresolved, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_service___set_state, 0, 1, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service___set_state, 0, 1, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_di_service_method_entry) { PHP_ME(Phalcon_Di_Service, __construct, arginfo_phalcon_di_service___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Di_Service, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Di_Service, getName, arginfo_phalcon_di_service_getname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, setShared, arginfo_phalcon_di_service_setshared, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Di_Service, isShared, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Di_Service, isShared, arginfo_phalcon_di_service_isshared, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, setSharedInstance, arginfo_phalcon_di_service_setsharedinstance, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, setDefinition, arginfo_phalcon_di_service_setdefinition, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, getDefinition, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, resolve, arginfo_phalcon_di_service_resolve, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, setParameter, arginfo_phalcon_di_service_setparameter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, getParameter, arginfo_phalcon_di_service_getparameter, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Di_Service, isResolved, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Di_Service, isResolved, arginfo_phalcon_di_service_isresolved, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Di_Service, __set_state, arginfo_phalcon_di_service___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/ext/phalcon/di/service/builder.zep.c b/ext/phalcon/di/service/builder.zep.c index f6fba27f708..c5f4aa42929 100644 --- a/ext/phalcon/di/service/builder.zep.c +++ b/ext/phalcon/di/service/builder.zep.c @@ -45,45 +45,68 @@ ZEPHIR_INIT_CLASS(Phalcon_Di_Service_Builder) { */ PHP_METHOD(Phalcon_Di_Service_Builder, _buildParameter) { - zval *_2$$3, *_5$$5, *_8$$8, *_11$$10, *_14$$13; - zval *argument = NULL; + zval _2$$3, _5$$5, _8$$8, _11$$10, _14$$13; + zval argument; zend_long position, ZEPHIR_LAST_CALL_STATUS; - zval *dependencyInjector, *position_param = NULL, *argument_param = NULL, *type = NULL, *name = NULL, *value = NULL, *instanceArguments = NULL, *_0$$3, _1$$3, *_3$$5, _4$$5, *_6$$8, _7$$8, *_9$$10, _10$$10, *_12$$13, _13$$13; + zval *dependencyInjector, dependencyInjector_sub, *position_param = NULL, *argument_param = NULL, type, name, value, instanceArguments, _0$$3, _1$$3, _3$$5, _4$$5, _6$$8, _7$$8, _9$$10, _10$$10, _12$$13, _13$$13; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&instanceArguments); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_10$$10); + ZVAL_UNDEF(&_12$$13); + ZVAL_UNDEF(&_13$$13); + ZVAL_UNDEF(&argument); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_11$$10); + ZVAL_UNDEF(&_14$$13); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &dependencyInjector, &position_param, &argument_param); position = zephir_get_intval(position_param); - argument = argument_param; + ZEPHIR_OBS_COPY_OR_DUP(&argument, argument_param); - ZEPHIR_OBS_VAR(type); - if (!(zephir_array_isset_string_fetch(&type, argument, SS("type"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_di_exception_ce); + ZEPHIR_OBS_VAR(&type); + if (!(zephir_array_isset_string_fetch(&type, &argument, SL("type"), 0))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_di_exception_ce); ZEPHIR_SINIT_VAR(_1$$3); ZVAL_LONG(&_1$$3, position); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SVS(_2$$3, "Argument at position ", &_1$$3, " must have a type"); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 9, _2$$3); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SVS(&_2$$3, "Argument at position ", &_1$$3, " must have a type"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/di/service/builder.zep", 49 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/di/service/builder.zep", 49 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } do { - if (ZEPHIR_IS_STRING(type, "service")) { - ZEPHIR_OBS_VAR(name); - if (!(zephir_array_isset_string_fetch(&name, argument, SS("name"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_3$$5); - object_init_ex(_3$$5, phalcon_di_exception_ce); + if (ZEPHIR_IS_STRING(&type, "service")) { + ZEPHIR_OBS_VAR(&name); + if (!(zephir_array_isset_string_fetch(&name, &argument, SL("name"), 0))) { + ZEPHIR_INIT_VAR(&_3$$5); + object_init_ex(&_3$$5, phalcon_di_exception_ce); ZEPHIR_SINIT_VAR(_4$$5); ZVAL_LONG(&_4$$5, position); - ZEPHIR_INIT_VAR(_5$$5); - ZEPHIR_CONCAT_SV(_5$$5, "Service 'name' is required in parameter on position ", &_4$$5); - ZEPHIR_CALL_METHOD(NULL, _3$$5, "__construct", NULL, 9, _5$$5); + ZEPHIR_INIT_VAR(&_5$$5); + ZEPHIR_CONCAT_SV(&_5$$5, "Service 'name' is required in parameter on position ", &_4$$5); + ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 4, &_5$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$5, "phalcon/di/service/builder.zep", 59 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$5, "phalcon/di/service/builder.zep", 59 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -91,39 +114,39 @@ PHP_METHOD(Phalcon_Di_Service_Builder, _buildParameter) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The dependency injector container is not valid", "phalcon/di/service/builder.zep", 62); return; } - ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "get", NULL, 0, name); + ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "get", NULL, 0, &name); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(type, "parameter")) { - ZEPHIR_OBS_VAR(value); - if (!(zephir_array_isset_string_fetch(&value, argument, SS("value"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_6$$8); - object_init_ex(_6$$8, phalcon_di_exception_ce); + if (ZEPHIR_IS_STRING(&type, "parameter")) { + ZEPHIR_OBS_VAR(&value); + if (!(zephir_array_isset_string_fetch(&value, &argument, SL("value"), 0))) { + ZEPHIR_INIT_VAR(&_6$$8); + object_init_ex(&_6$$8, phalcon_di_exception_ce); ZEPHIR_SINIT_VAR(_7$$8); ZVAL_LONG(&_7$$8, position); - ZEPHIR_INIT_VAR(_8$$8); - ZEPHIR_CONCAT_SV(_8$$8, "Service 'value' is required in parameter on position ", &_7$$8); - ZEPHIR_CALL_METHOD(NULL, _6$$8, "__construct", NULL, 9, _8$$8); + ZEPHIR_INIT_VAR(&_8$$8); + ZEPHIR_CONCAT_SV(&_8$$8, "Service 'value' is required in parameter on position ", &_7$$8); + ZEPHIR_CALL_METHOD(NULL, &_6$$8, "__construct", NULL, 4, &_8$$8); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$8, "phalcon/di/service/builder.zep", 71 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$8, "phalcon/di/service/builder.zep", 71 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - RETURN_CCTOR(value); + RETURN_CCTOR(&value); } - if (ZEPHIR_IS_STRING(type, "instance")) { - ZEPHIR_OBS_NVAR(name); - if (!(zephir_array_isset_string_fetch(&name, argument, SS("className"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_9$$10); - object_init_ex(_9$$10, phalcon_di_exception_ce); + if (ZEPHIR_IS_STRING(&type, "instance")) { + ZEPHIR_OBS_NVAR(&name); + if (!(zephir_array_isset_string_fetch(&name, &argument, SL("className"), 0))) { + ZEPHIR_INIT_VAR(&_9$$10); + object_init_ex(&_9$$10, phalcon_di_exception_ce); ZEPHIR_SINIT_VAR(_10$$10); ZVAL_LONG(&_10$$10, position); - ZEPHIR_INIT_VAR(_11$$10); - ZEPHIR_CONCAT_SV(_11$$10, "Service 'className' is required in parameter on position ", &_10$$10); - ZEPHIR_CALL_METHOD(NULL, _9$$10, "__construct", NULL, 9, _11$$10); + ZEPHIR_INIT_VAR(&_11$$10); + ZEPHIR_CONCAT_SV(&_11$$10, "Service 'className' is required in parameter on position ", &_10$$10); + ZEPHIR_CALL_METHOD(NULL, &_9$$10, "__construct", NULL, 4, &_11$$10); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$10, "phalcon/di/service/builder.zep", 81 TSRMLS_CC); + zephir_throw_exception_debug(&_9$$10, "phalcon/di/service/builder.zep", 81 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -131,25 +154,25 @@ PHP_METHOD(Phalcon_Di_Service_Builder, _buildParameter) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The dependency injector container is not valid", "phalcon/di/service/builder.zep", 85); return; } - ZEPHIR_OBS_VAR(instanceArguments); - if (zephir_array_isset_string_fetch(&instanceArguments, argument, SS("arguments"), 0 TSRMLS_CC)) { - ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "get", NULL, 0, name, instanceArguments); + ZEPHIR_OBS_VAR(&instanceArguments); + if (zephir_array_isset_string_fetch(&instanceArguments, &argument, SL("arguments"), 0)) { + ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "get", NULL, 0, &name, &instanceArguments); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "get", NULL, 0, name); + ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "get", NULL, 0, &name); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(_12$$13); - object_init_ex(_12$$13, phalcon_di_exception_ce); + ZEPHIR_INIT_VAR(&_12$$13); + object_init_ex(&_12$$13, phalcon_di_exception_ce); ZEPHIR_SINIT_VAR(_13$$13); ZVAL_LONG(&_13$$13, position); - ZEPHIR_INIT_VAR(_14$$13); - ZEPHIR_CONCAT_SV(_14$$13, "Unknown service type in parameter on position ", &_13$$13); - ZEPHIR_CALL_METHOD(NULL, _12$$13, "__construct", NULL, 9, _14$$13); + ZEPHIR_INIT_VAR(&_14$$13); + ZEPHIR_CONCAT_SV(&_14$$13, "Unknown service type in parameter on position ", &_13$$13); + ZEPHIR_CALL_METHOD(NULL, &_12$$13, "__construct", NULL, 4, &_14$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_12$$13, "phalcon/di/service/builder.zep", 104 TSRMLS_CC); + zephir_throw_exception_debug(&_12$$13, "phalcon/di/service/builder.zep", 104 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); @@ -163,33 +186,47 @@ PHP_METHOD(Phalcon_Di_Service_Builder, _buildParameter) { */ PHP_METHOD(Phalcon_Di_Service_Builder, _buildParameters) { - HashTable *_1; - HashPosition _0; + zend_string *_2; + zend_ulong _1; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *arguments = NULL; - zval *dependencyInjector, *arguments_param = NULL, *position = NULL, *argument = NULL, *buildArguments = NULL, **_2, *_3$$3 = NULL; + zval arguments; + zval *dependencyInjector, dependencyInjector_sub, *arguments_param = NULL, position, argument, buildArguments, *_0, _3$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&argument); + ZVAL_UNDEF(&buildArguments); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&arguments); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &dependencyInjector, &arguments_param); - arguments = arguments_param; + ZEPHIR_OBS_COPY_OR_DUP(&arguments, arguments_param); - ZEPHIR_INIT_VAR(buildArguments); - array_init(buildArguments); - zephir_is_iterable(arguments, &_1, &_0, 0, 0, "phalcon/di/service/builder.zep", 119); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(position, _1, _0); - ZEPHIR_GET_HVALUE(argument, _2); - ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "_buildparameter", &_4, 199, dependencyInjector, position, argument); + ZEPHIR_INIT_VAR(&buildArguments); + array_init(&buildArguments); + zephir_is_iterable(&arguments, 0, "phalcon/di/service/builder.zep", 119); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&arguments), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&position); + if (_2 != NULL) { + ZVAL_STR_COPY(&position, _2); + } else { + ZVAL_LONG(&position, _1); + } + ZEPHIR_INIT_NVAR(&argument); + ZVAL_COPY(&argument, _0); + ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "_buildparameter", &_4, 175, dependencyInjector, &position, &argument); zephir_check_call_status(); - zephir_array_append(&buildArguments, _3$$3, PH_SEPARATE, "phalcon/di/service/builder.zep", 117); - } - RETURN_CCTOR(buildArguments); + zephir_array_append(&buildArguments, &_3$$3, PH_SEPARATE, "phalcon/di/service/builder.zep", 117); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&argument); + ZEPHIR_INIT_NVAR(&position); + RETURN_CCTOR(&buildArguments); } @@ -203,180 +240,228 @@ PHP_METHOD(Phalcon_Di_Service_Builder, _buildParameters) { */ PHP_METHOD(Phalcon_Di_Service_Builder, build) { - HashTable *_2$$10, *_15$$19; - HashPosition _1$$10, _14$$19; + zend_string *_3$$10, *_16$$19; + zend_ulong _2$$10, _15$$19; zephir_fcall_cache_entry *_6 = NULL, *_24 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *definition = NULL; - zval *dependencyInjector, *definition_param = NULL, *parameters = NULL, *className = NULL, *arguments = NULL, *paramCalls = NULL, *methodPosition = NULL, *method = NULL, *methodName = NULL, *methodCall = NULL, *instance = NULL, *propertyPosition = NULL, *property = NULL, *propertyName = NULL, *propertyValue = NULL, *_0$$8 = NULL, **_3$$10, *_4$$14 = NULL, *_5$$14 = NULL, *_7$$15 = NULL, *_8$$15 = NULL, *_9$$17 = NULL, *_10$$17 = NULL, *_11$$18 = NULL, *_12$$18 = NULL, *_13$$13 = NULL, **_16$$19, *_17$$23 = NULL, *_18$$23 = NULL, *_19$$24 = NULL, *_20$$24 = NULL, *_21$$25 = NULL, *_22$$25 = NULL, *_23$$22 = NULL; + zval definition; + zval *dependencyInjector, dependencyInjector_sub, *definition_param = NULL, *parameters = NULL, parameters_sub, __$null, className, arguments, paramCalls, methodPosition, method, methodName, methodCall, instance, propertyPosition, property, propertyName, propertyValue, _0$$8, *_1$$10, _4$$14, _5$$14, _7$$15, _8$$15, _9$$17, _10$$17, _11$$18, _12$$18, _13$$13, *_14$$19, _17$$23, _18$$23, _19$$24, _20$$24, _21$$25, _22$$25, _23$$22; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(¶mCalls); + ZVAL_UNDEF(&methodPosition); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&methodName); + ZVAL_UNDEF(&methodCall); + ZVAL_UNDEF(&instance); + ZVAL_UNDEF(&propertyPosition); + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&propertyName); + ZVAL_UNDEF(&propertyValue); + ZVAL_UNDEF(&_0$$8); + ZVAL_UNDEF(&_4$$14); + ZVAL_UNDEF(&_5$$14); + ZVAL_UNDEF(&_7$$15); + ZVAL_UNDEF(&_8$$15); + ZVAL_UNDEF(&_9$$17); + ZVAL_UNDEF(&_10$$17); + ZVAL_UNDEF(&_11$$18); + ZVAL_UNDEF(&_12$$18); + ZVAL_UNDEF(&_13$$13); + ZVAL_UNDEF(&_17$$23); + ZVAL_UNDEF(&_18$$23); + ZVAL_UNDEF(&_19$$24); + ZVAL_UNDEF(&_20$$24); + ZVAL_UNDEF(&_21$$25); + ZVAL_UNDEF(&_22$$25); + ZVAL_UNDEF(&_23$$22); + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &dependencyInjector, &definition_param, ¶meters); - definition = definition_param; + ZEPHIR_OBS_COPY_OR_DUP(&definition, definition_param); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_OBS_VAR(className); - if (!(zephir_array_isset_string_fetch(&className, definition, SS("className"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&className); + if (!(zephir_array_isset_string_fetch(&className, &definition, SL("className"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Invalid service definition. Missing 'className' parameter", "phalcon/di/service/builder.zep", 140); return; } if (Z_TYPE_P(parameters) == IS_ARRAY) { if (zephir_fast_count_int(parameters TSRMLS_CC)) { - ZEPHIR_INIT_VAR(instance); - ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(instance, className, parameters TSRMLS_CC); + ZEPHIR_INIT_VAR(&instance); + ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &className, parameters TSRMLS_CC); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(instance, className TSRMLS_CC); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&instance, &className TSRMLS_CC); zephir_check_call_status(); } } else { - ZEPHIR_OBS_VAR(arguments); - if (zephir_array_isset_string_fetch(&arguments, definition, SS("arguments"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_0$$8, this_ptr, "_buildparameters", NULL, 200, dependencyInjector, arguments); + ZEPHIR_OBS_VAR(&arguments); + if (zephir_array_isset_string_fetch(&arguments, &definition, SL("arguments"), 0)) { + ZEPHIR_CALL_METHOD(&_0$$8, this_ptr, "_buildparameters", NULL, 176, dependencyInjector, &arguments); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(instance, className, _0$$8 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_LAST_CALL_STATUS = zephir_create_instance_params(&instance, &className, &_0$$8 TSRMLS_CC); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(instance); - ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(instance, className TSRMLS_CC); + ZEPHIR_INIT_NVAR(&instance); + ZEPHIR_LAST_CALL_STATUS = zephir_create_instance(&instance, &className TSRMLS_CC); zephir_check_call_status(); } } - ZEPHIR_OBS_VAR(paramCalls); - if (zephir_array_isset_string_fetch(¶mCalls, definition, SS("calls"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(instance) != IS_OBJECT) { + ZEPHIR_OBS_VAR(¶mCalls); + if (zephir_array_isset_string_fetch(¶mCalls, &definition, SL("calls"), 0)) { + if (Z_TYPE_P(&instance) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The definition has setter injection parameters but the constructor didn't return an instance", "phalcon/di/service/builder.zep", 179); return; } - if (Z_TYPE_P(paramCalls) != IS_ARRAY) { + if (Z_TYPE_P(¶mCalls) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Setter injection parameters must be an array", "phalcon/di/service/builder.zep", 183); return; } - zephir_is_iterable(paramCalls, &_2$$10, &_1$$10, 0, 0, "phalcon/di/service/builder.zep", 235); - for ( - ; zend_hash_get_current_data_ex(_2$$10, (void**) &_3$$10, &_1$$10) == SUCCESS - ; zend_hash_move_forward_ex(_2$$10, &_1$$10) - ) { - ZEPHIR_GET_HMKEY(methodPosition, _2$$10, _1$$10); - ZEPHIR_GET_HVALUE(method, _3$$10); - if (Z_TYPE_P(method) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(_4$$14); - object_init_ex(_4$$14, phalcon_di_exception_ce); + zephir_is_iterable(¶mCalls, 0, "phalcon/di/service/builder.zep", 235); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶mCalls), _2$$10, _3$$10, _1$$10) + { + ZEPHIR_INIT_NVAR(&methodPosition); + if (_3$$10 != NULL) { + ZVAL_STR_COPY(&methodPosition, _3$$10); + } else { + ZVAL_LONG(&methodPosition, _2$$10); + } + ZEPHIR_INIT_NVAR(&method); + ZVAL_COPY(&method, _1$$10); + if (Z_TYPE_P(&method) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_4$$14); + object_init_ex(&_4$$14, phalcon_di_exception_ce); ZEPHIR_INIT_LNVAR(_5$$14); - ZEPHIR_CONCAT_SV(_5$$14, "Method call must be an array on position ", methodPosition); - ZEPHIR_CALL_METHOD(NULL, _4$$14, "__construct", &_6, 9, _5$$14); + ZEPHIR_CONCAT_SV(&_5$$14, "Method call must be an array on position ", &methodPosition); + ZEPHIR_CALL_METHOD(NULL, &_4$$14, "__construct", &_6, 4, &_5$$14); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$14, "phalcon/di/service/builder.zep", 195 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$14, "phalcon/di/service/builder.zep", 195 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_NVAR(methodName); - if (!(zephir_array_isset_string_fetch(&methodName, method, SS("method"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_7$$15); - object_init_ex(_7$$15, phalcon_di_exception_ce); + ZEPHIR_OBS_NVAR(&methodName); + if (!(zephir_array_isset_string_fetch(&methodName, &method, SL("method"), 0))) { + ZEPHIR_INIT_NVAR(&_7$$15); + object_init_ex(&_7$$15, phalcon_di_exception_ce); ZEPHIR_INIT_LNVAR(_8$$15); - ZEPHIR_CONCAT_SV(_8$$15, "The method name is required on position ", methodPosition); - ZEPHIR_CALL_METHOD(NULL, _7$$15, "__construct", &_6, 9, _8$$15); + ZEPHIR_CONCAT_SV(&_8$$15, "The method name is required on position ", &methodPosition); + ZEPHIR_CALL_METHOD(NULL, &_7$$15, "__construct", &_6, 4, &_8$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$15, "phalcon/di/service/builder.zep", 202 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$15, "phalcon/di/service/builder.zep", 202 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_NVAR(methodCall); - zephir_create_array(methodCall, 2, 0 TSRMLS_CC); - zephir_array_fast_append(methodCall, instance); - zephir_array_fast_append(methodCall, methodName); - ZEPHIR_OBS_NVAR(arguments); - if (zephir_array_isset_string_fetch(&arguments, method, SS("arguments"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(arguments) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(_9$$17); - object_init_ex(_9$$17, phalcon_di_exception_ce); + ZEPHIR_INIT_NVAR(&methodCall); + zephir_create_array(&methodCall, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&methodCall, &instance); + zephir_array_fast_append(&methodCall, &methodName); + ZEPHIR_OBS_NVAR(&arguments); + if (zephir_array_isset_string_fetch(&arguments, &method, SL("arguments"), 0)) { + if (Z_TYPE_P(&arguments) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_9$$17); + object_init_ex(&_9$$17, phalcon_di_exception_ce); ZEPHIR_INIT_LNVAR(_10$$17); - ZEPHIR_CONCAT_SV(_10$$17, "Call arguments must be an array ", methodPosition); - ZEPHIR_CALL_METHOD(NULL, _9$$17, "__construct", &_6, 9, _10$$17); + ZEPHIR_CONCAT_SV(&_10$$17, "Call arguments must be an array ", &methodPosition); + ZEPHIR_CALL_METHOD(NULL, &_9$$17, "__construct", &_6, 4, &_10$$17); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$17, "phalcon/di/service/builder.zep", 213 TSRMLS_CC); + zephir_throw_exception_debug(&_9$$17, "phalcon/di/service/builder.zep", 213 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_fast_count_int(arguments TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_11$$18); - ZEPHIR_CALL_METHOD(&_12$$18, this_ptr, "_buildparameters", NULL, 200, dependencyInjector, arguments); + if (zephir_fast_count_int(&arguments TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_11$$18); + ZEPHIR_CALL_METHOD(&_12$$18, this_ptr, "_buildparameters", NULL, 176, dependencyInjector, &arguments); zephir_check_call_status(); - ZEPHIR_CALL_USER_FUNC_ARRAY(_11$$18, methodCall, _12$$18); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_11$$18, &methodCall, &_12$$18); zephir_check_call_status(); continue; } } - ZEPHIR_INIT_NVAR(_13$$13); - ZEPHIR_CALL_USER_FUNC(_13$$13, methodCall); + ZEPHIR_INIT_NVAR(&_13$$13); + ZEPHIR_CALL_USER_FUNC(&_13$$13, &methodCall); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&method); + ZEPHIR_INIT_NVAR(&methodPosition); } - ZEPHIR_OBS_NVAR(paramCalls); - if (zephir_array_isset_string_fetch(¶mCalls, definition, SS("properties"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(instance) != IS_OBJECT) { + ZEPHIR_OBS_NVAR(¶mCalls); + if (zephir_array_isset_string_fetch(¶mCalls, &definition, SL("properties"), 0)) { + if (Z_TYPE_P(&instance) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "The definition has properties injection parameters but the constructor didn't return an instance", "phalcon/di/service/builder.zep", 245); return; } - if (Z_TYPE_P(paramCalls) != IS_ARRAY) { + if (Z_TYPE_P(¶mCalls) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_di_exception_ce, "Setter injection parameters must be an array", "phalcon/di/service/builder.zep", 249); return; } - zephir_is_iterable(paramCalls, &_15$$19, &_14$$19, 0, 0, "phalcon/di/service/builder.zep", 283); - for ( - ; zend_hash_get_current_data_ex(_15$$19, (void**) &_16$$19, &_14$$19) == SUCCESS - ; zend_hash_move_forward_ex(_15$$19, &_14$$19) - ) { - ZEPHIR_GET_HMKEY(propertyPosition, _15$$19, _14$$19); - ZEPHIR_GET_HVALUE(property, _16$$19); - if (Z_TYPE_P(property) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(_17$$23); - object_init_ex(_17$$23, phalcon_di_exception_ce); + zephir_is_iterable(¶mCalls, 0, "phalcon/di/service/builder.zep", 283); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶mCalls), _15$$19, _16$$19, _14$$19) + { + ZEPHIR_INIT_NVAR(&propertyPosition); + if (_16$$19 != NULL) { + ZVAL_STR_COPY(&propertyPosition, _16$$19); + } else { + ZVAL_LONG(&propertyPosition, _15$$19); + } + ZEPHIR_INIT_NVAR(&property); + ZVAL_COPY(&property, _14$$19); + if (Z_TYPE_P(&property) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_17$$23); + object_init_ex(&_17$$23, phalcon_di_exception_ce); ZEPHIR_INIT_LNVAR(_18$$23); - ZEPHIR_CONCAT_SV(_18$$23, "Property must be an array on position ", propertyPosition); - ZEPHIR_CALL_METHOD(NULL, _17$$23, "__construct", &_6, 9, _18$$23); + ZEPHIR_CONCAT_SV(&_18$$23, "Property must be an array on position ", &propertyPosition); + ZEPHIR_CALL_METHOD(NULL, &_17$$23, "__construct", &_6, 4, &_18$$23); zephir_check_call_status(); - zephir_throw_exception_debug(_17$$23, "phalcon/di/service/builder.zep", 261 TSRMLS_CC); + zephir_throw_exception_debug(&_17$$23, "phalcon/di/service/builder.zep", 261 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_NVAR(propertyName); - if (!(zephir_array_isset_string_fetch(&propertyName, property, SS("name"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_19$$24); - object_init_ex(_19$$24, phalcon_di_exception_ce); + ZEPHIR_OBS_NVAR(&propertyName); + if (!(zephir_array_isset_string_fetch(&propertyName, &property, SL("name"), 0))) { + ZEPHIR_INIT_NVAR(&_19$$24); + object_init_ex(&_19$$24, phalcon_di_exception_ce); ZEPHIR_INIT_LNVAR(_20$$24); - ZEPHIR_CONCAT_SV(_20$$24, "The property name is required on position ", propertyPosition); - ZEPHIR_CALL_METHOD(NULL, _19$$24, "__construct", &_6, 9, _20$$24); + ZEPHIR_CONCAT_SV(&_20$$24, "The property name is required on position ", &propertyPosition); + ZEPHIR_CALL_METHOD(NULL, &_19$$24, "__construct", &_6, 4, &_20$$24); zephir_check_call_status(); - zephir_throw_exception_debug(_19$$24, "phalcon/di/service/builder.zep", 268 TSRMLS_CC); + zephir_throw_exception_debug(&_19$$24, "phalcon/di/service/builder.zep", 268 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_NVAR(propertyValue); - if (!(zephir_array_isset_string_fetch(&propertyValue, property, SS("value"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_21$$25); - object_init_ex(_21$$25, phalcon_di_exception_ce); + ZEPHIR_OBS_NVAR(&propertyValue); + if (!(zephir_array_isset_string_fetch(&propertyValue, &property, SL("value"), 0))) { + ZEPHIR_INIT_NVAR(&_21$$25); + object_init_ex(&_21$$25, phalcon_di_exception_ce); ZEPHIR_INIT_LNVAR(_22$$25); - ZEPHIR_CONCAT_SV(_22$$25, "The property value is required on position ", propertyPosition); - ZEPHIR_CALL_METHOD(NULL, _21$$25, "__construct", &_6, 9, _22$$25); + ZEPHIR_CONCAT_SV(&_22$$25, "The property value is required on position ", &propertyPosition); + ZEPHIR_CALL_METHOD(NULL, &_21$$25, "__construct", &_6, 4, &_22$$25); zephir_check_call_status(); - zephir_throw_exception_debug(_21$$25, "phalcon/di/service/builder.zep", 275 TSRMLS_CC); + zephir_throw_exception_debug(&_21$$25, "phalcon/di/service/builder.zep", 275 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_23$$22, this_ptr, "_buildparameter", &_24, 199, dependencyInjector, propertyPosition, propertyValue); + ZEPHIR_CALL_METHOD(&_23$$22, this_ptr, "_buildparameter", &_24, 175, dependencyInjector, &propertyPosition, &propertyValue); zephir_check_call_status(); - zephir_update_property_zval_zval(instance, propertyName, _23$$22 TSRMLS_CC); - } + zephir_update_property_zval_zval(&instance, &propertyName, &_23$$22 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&property); + ZEPHIR_INIT_NVAR(&propertyPosition); } - RETURN_CCTOR(instance); + RETURN_CCTOR(&instance); } diff --git a/ext/phalcon/di/service/builder.zep.h b/ext/phalcon/di/service/builder.zep.h index ba3ef93ed10..a73766d6c13 100644 --- a/ext/phalcon/di/service/builder.zep.h +++ b/ext/phalcon/di/service/builder.zep.h @@ -9,11 +9,19 @@ PHP_METHOD(Phalcon_Di_Service_Builder, build); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service_builder__buildparameter, 0, 0, 3) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0) +#else ZEND_ARG_INFO(0, position) +#endif ZEND_ARG_ARRAY_INFO(0, argument, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_service_builder__buildparameters, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service_builder__buildparameters, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_service_builder__buildparameters, 0, 2, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/di/serviceinterface.zep.h b/ext/phalcon/di/serviceinterface.zep.h index 888f8b60ebc..5ffcf50c505 100644 --- a/ext/phalcon/di/serviceinterface.zep.h +++ b/ext/phalcon/di/serviceinterface.zep.h @@ -4,7 +4,18 @@ extern zend_class_entry *phalcon_di_serviceinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Di_ServiceInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_serviceinterface_setshared, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, shared, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, shared) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_serviceinterface_isshared, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_serviceinterface_isshared, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_serviceinterface_setdefinition, 0, 0, 1) @@ -16,19 +27,31 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_serviceinterface_resolve, 0, 0, 0) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_serviceinterface_setparameter, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_serviceinterface_setparameter, 0, 2, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_serviceinterface_setparameter, 0, 2, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0) +#else ZEND_ARG_INFO(0, position) +#endif ZEND_ARG_ARRAY_INFO(0, parameter, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_di_serviceinterface___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_di_serviceinterface___set_state, 0, 1, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_di_serviceinterface___set_state, 0, 1, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_di_serviceinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Di_ServiceInterface, getName, NULL) PHP_ABSTRACT_ME(Phalcon_Di_ServiceInterface, setShared, arginfo_phalcon_di_serviceinterface_setshared) - PHP_ABSTRACT_ME(Phalcon_Di_ServiceInterface, isShared, NULL) + PHP_ABSTRACT_ME(Phalcon_Di_ServiceInterface, isShared, arginfo_phalcon_di_serviceinterface_isshared) PHP_ABSTRACT_ME(Phalcon_Di_ServiceInterface, setDefinition, arginfo_phalcon_di_serviceinterface_setdefinition) PHP_ABSTRACT_ME(Phalcon_Di_ServiceInterface, getDefinition, NULL) PHP_ABSTRACT_ME(Phalcon_Di_ServiceInterface, resolve, arginfo_phalcon_di_serviceinterface_resolve) diff --git a/ext/phalcon/diinterface.zep.h b/ext/phalcon/diinterface.zep.h index c8772418bfd..841fffc03ad 100644 --- a/ext/phalcon/diinterface.zep.h +++ b/ext/phalcon/diinterface.zep.h @@ -3,58 +3,140 @@ extern zend_class_entry *phalcon_diinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_DiInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_diinterface_set, 0, 2, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_diinterface_set, 0, 2, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, definition) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, shared, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, shared) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_setshared, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_diinterface_setshared, 0, 2, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_diinterface_setshared, 0, 2, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, definition) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_remove, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_attempt, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, definition) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, shared, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, shared) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_getshared, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_setraw, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_diinterface_setraw, 0, 2, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_diinterface_setraw, 0, 2, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_OBJ_INFO(0, rawDefinition, Phalcon\\Di\\ServiceInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_getraw, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_getservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_diinterface_getservice, 0, 1, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_diinterface_getservice, 0, 1, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_diinterface_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_diinterface_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_diinterface_wasfreshinstance, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_diinterface_wasfreshinstance, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_diinterface_setdefault, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_diinterface_getdefault, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_diinterface_getdefault, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_diinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_DiInterface, set, arginfo_phalcon_diinterface_set) PHP_ABSTRACT_ME(Phalcon_DiInterface, setShared, arginfo_phalcon_diinterface_setshared) @@ -66,10 +148,10 @@ ZEPHIR_INIT_FUNCS(phalcon_diinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_DiInterface, getRaw, arginfo_phalcon_diinterface_getraw) PHP_ABSTRACT_ME(Phalcon_DiInterface, getService, arginfo_phalcon_diinterface_getservice) PHP_ABSTRACT_ME(Phalcon_DiInterface, has, arginfo_phalcon_diinterface_has) - PHP_ABSTRACT_ME(Phalcon_DiInterface, wasFreshInstance, NULL) + PHP_ABSTRACT_ME(Phalcon_DiInterface, wasFreshInstance, arginfo_phalcon_diinterface_wasfreshinstance) PHP_ABSTRACT_ME(Phalcon_DiInterface, getServices, NULL) ZEND_FENTRY(setDefault, NULL, arginfo_phalcon_diinterface_setdefault, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - ZEND_FENTRY(getDefault, NULL, NULL, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) + ZEND_FENTRY(getDefault, NULL, arginfo_phalcon_diinterface_getdefault, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) ZEND_FENTRY(reset, NULL, NULL, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/dispatcher.zep.c b/ext/phalcon/dispatcher.zep.c index bd425827ace..6f9ed1eb0c6 100644 --- a/ext/phalcon/dispatcher.zep.c +++ b/ext/phalcon/dispatcher.zep.c @@ -80,17 +80,17 @@ ZEPHIR_INIT_CLASS(Phalcon_Dispatcher) { zend_declare_property_bool(phalcon_dispatcher_ce, SL("_isControllerInitialize"), 0, ZEND_ACC_PROTECTED TSRMLS_CC); phalcon_dispatcher_ce->create_object = zephir_init_properties_Phalcon_Dispatcher; - zend_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_NO_DI"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_NO_DI"), 0); - zend_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_CYCLIC_ROUTING"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_CYCLIC_ROUTING"), 1); - zend_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_HANDLER_NOT_FOUND"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_HANDLER_NOT_FOUND"), 2); - zend_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_INVALID_HANDLER"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_INVALID_HANDLER"), 3); - zend_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_INVALID_PARAMS"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_INVALID_PARAMS"), 4); - zend_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_ACTION_NOT_FOUND"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_dispatcher_ce, SL("EXCEPTION_ACTION_NOT_FOUND"), 5); zend_class_implements(phalcon_dispatcher_ce TSRMLS_CC, 1, phalcon_dispatcherinterface_ce); zend_class_implements(phalcon_dispatcher_ce TSRMLS_CC, 1, phalcon_di_injectionawareinterface_ce); @@ -104,13 +104,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Dispatcher) { */ PHP_METHOD(Phalcon_Dispatcher, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -119,7 +122,8 @@ PHP_METHOD(Phalcon_Dispatcher, setDI) { */ PHP_METHOD(Phalcon_Dispatcher, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -130,13 +134,16 @@ PHP_METHOD(Phalcon_Dispatcher, getDI) { */ PHP_METHOD(Phalcon_Dispatcher, setEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); } @@ -145,7 +152,8 @@ PHP_METHOD(Phalcon_Dispatcher, setEventsManager) { */ PHP_METHOD(Phalcon_Dispatcher, getEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -157,15 +165,18 @@ PHP_METHOD(Phalcon_Dispatcher, getEventsManager) { PHP_METHOD(Phalcon_Dispatcher, setActionSuffix) { zval *actionSuffix_param = NULL; - zval *actionSuffix = NULL; + zval actionSuffix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&actionSuffix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &actionSuffix_param); - zephir_get_strval(actionSuffix, actionSuffix_param); + zephir_get_strval(&actionSuffix, actionSuffix_param); - zephir_update_property_this(getThis(), SL("_actionSuffix"), actionSuffix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_actionSuffix"), &actionSuffix); ZEPHIR_MM_RESTORE(); } @@ -175,7 +186,8 @@ PHP_METHOD(Phalcon_Dispatcher, setActionSuffix) { */ PHP_METHOD(Phalcon_Dispatcher, getActionSuffix) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_actionSuffix"); @@ -187,15 +199,18 @@ PHP_METHOD(Phalcon_Dispatcher, getActionSuffix) { PHP_METHOD(Phalcon_Dispatcher, setModuleName) { zval *moduleName_param = NULL; - zval *moduleName = NULL; + zval moduleName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&moduleName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &moduleName_param); - zephir_get_strval(moduleName, moduleName_param); + zephir_get_strval(&moduleName, moduleName_param); - zephir_update_property_this(getThis(), SL("_moduleName"), moduleName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_moduleName"), &moduleName); ZEPHIR_MM_RESTORE(); } @@ -205,7 +220,8 @@ PHP_METHOD(Phalcon_Dispatcher, setModuleName) { */ PHP_METHOD(Phalcon_Dispatcher, getModuleName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_moduleName"); @@ -217,15 +233,18 @@ PHP_METHOD(Phalcon_Dispatcher, getModuleName) { PHP_METHOD(Phalcon_Dispatcher, setNamespaceName) { zval *namespaceName_param = NULL; - zval *namespaceName = NULL; + zval namespaceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespaceName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &namespaceName_param); - zephir_get_strval(namespaceName, namespaceName_param); + zephir_get_strval(&namespaceName, namespaceName_param); - zephir_update_property_this(getThis(), SL("_namespaceName"), namespaceName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_namespaceName"), &namespaceName); ZEPHIR_MM_RESTORE(); } @@ -235,7 +254,8 @@ PHP_METHOD(Phalcon_Dispatcher, setNamespaceName) { */ PHP_METHOD(Phalcon_Dispatcher, getNamespaceName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_namespaceName"); @@ -247,15 +267,18 @@ PHP_METHOD(Phalcon_Dispatcher, getNamespaceName) { PHP_METHOD(Phalcon_Dispatcher, setDefaultNamespace) { zval *namespaceName_param = NULL; - zval *namespaceName = NULL; + zval namespaceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespaceName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &namespaceName_param); - zephir_get_strval(namespaceName, namespaceName_param); + zephir_get_strval(&namespaceName, namespaceName_param); - zephir_update_property_this(getThis(), SL("_defaultNamespace"), namespaceName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultNamespace"), &namespaceName); ZEPHIR_MM_RESTORE(); } @@ -265,7 +288,8 @@ PHP_METHOD(Phalcon_Dispatcher, setDefaultNamespace) { */ PHP_METHOD(Phalcon_Dispatcher, getDefaultNamespace) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_defaultNamespace"); @@ -277,15 +301,18 @@ PHP_METHOD(Phalcon_Dispatcher, getDefaultNamespace) { PHP_METHOD(Phalcon_Dispatcher, setDefaultAction) { zval *actionName_param = NULL; - zval *actionName = NULL; + zval actionName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&actionName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &actionName_param); - zephir_get_strval(actionName, actionName_param); + zephir_get_strval(&actionName, actionName_param); - zephir_update_property_this(getThis(), SL("_defaultAction"), actionName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultAction"), &actionName); ZEPHIR_MM_RESTORE(); } @@ -296,15 +323,18 @@ PHP_METHOD(Phalcon_Dispatcher, setDefaultAction) { PHP_METHOD(Phalcon_Dispatcher, setActionName) { zval *actionName_param = NULL; - zval *actionName = NULL; + zval actionName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&actionName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &actionName_param); - zephir_get_strval(actionName, actionName_param); + zephir_get_strval(&actionName, actionName_param); - zephir_update_property_this(getThis(), SL("_actionName"), actionName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_actionName"), &actionName); ZEPHIR_MM_RESTORE(); } @@ -314,7 +344,8 @@ PHP_METHOD(Phalcon_Dispatcher, setActionName) { */ PHP_METHOD(Phalcon_Dispatcher, getActionName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_actionName"); @@ -327,7 +358,10 @@ PHP_METHOD(Phalcon_Dispatcher, getActionName) { */ PHP_METHOD(Phalcon_Dispatcher, setParams) { - zval *params; + zval *params, params_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶ms_sub); zephir_fetch_params(0, 1, 0, ¶ms); @@ -337,7 +371,7 @@ PHP_METHOD(Phalcon_Dispatcher, setParams) { ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_exception_ce, "Parameters must be an Array", "phalcon/dispatcher.zep", 233); return; } - zephir_update_property_this(getThis(), SL("_params"), params TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_params"), params); } @@ -346,7 +380,8 @@ PHP_METHOD(Phalcon_Dispatcher, setParams) { */ PHP_METHOD(Phalcon_Dispatcher, getParams) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_params"); @@ -360,7 +395,11 @@ PHP_METHOD(Phalcon_Dispatcher, getParams) { */ PHP_METHOD(Phalcon_Dispatcher, setParam) { - zval *param, *value; + zval *param, param_sub, *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶m_sub); + ZVAL_UNDEF(&value_sub); zephir_fetch_params(0, 2, 0, ¶m, &value); @@ -381,47 +420,60 @@ PHP_METHOD(Phalcon_Dispatcher, setParam) { PHP_METHOD(Phalcon_Dispatcher, getParam) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *param, *filters = NULL, *defaultValue = NULL, *params = NULL, *filter = NULL, *paramValue = NULL, *dependencyInjector = NULL, *_2 = NULL, *_3, *_0$$5, *_1$$5; + zval *param, param_sub, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, __$null, params, filter, paramValue, dependencyInjector, _2, _3, _0$$5, _1$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶m_sub); + ZVAL_UNDEF(&filters_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(¶mValue); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, ¶m, &filters, &defaultValue); if (!filters) { - filters = ZEPHIR_GLOBAL(global_null); + filters = &filters_sub; + filters = &__$null; } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } - ZEPHIR_OBS_VAR(params); - zephir_read_property_this(¶ms, this_ptr, SL("_params"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(paramValue); - if (!(zephir_array_isset_fetch(¶mValue, params, param, 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(¶ms); + zephir_read_property(¶ms, this_ptr, SL("_params"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(¶mValue); + if (!(zephir_array_isset_fetch(¶mValue, ¶ms, param, 0 TSRMLS_CC))) { RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); } if (Z_TYPE_P(filters) == IS_NULL) { - RETURN_CCTOR(paramValue); + RETURN_CCTOR(¶mValue); } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$5); - ZVAL_STRING(_0$$5, "A dependency injection object is required to access the 'filter' service", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_LONG(_1$$5, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_throwdispatchexception", NULL, 0, _0$$5, _1$$5); - zephir_check_temp_parameter(_0$$5); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_0$$5); + ZVAL_STRING(&_0$$5, "A dependency injection object is required to access the 'filter' service"); + ZVAL_LONG(&_1$$5, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_throwdispatchexception", NULL, 0, &_0$$5, &_1$$5); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_3); - ZVAL_STRING(_3, "filter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, dependencyInjector, "getshared", NULL, 0, _3); - zephir_check_temp_parameter(_3); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "filter"); + ZEPHIR_CALL_METHOD(&_2, &dependencyInjector, "getshared", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(filter, _2); - ZEPHIR_RETURN_CALL_METHOD(filter, "sanitize", NULL, 0, paramValue, filters); + ZEPHIR_CPY_WRT(&filter, &_2); + ZEPHIR_RETURN_CALL_METHOD(&filter, "sanitize", NULL, 0, ¶mValue, filters); zephir_check_call_status(); RETURN_MM(); @@ -435,14 +487,18 @@ PHP_METHOD(Phalcon_Dispatcher, getParam) { */ PHP_METHOD(Phalcon_Dispatcher, hasParam) { - zval *param, *_0; + zval *param, param_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶m_sub); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, ¶m); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - RETURN_BOOL(zephir_array_isset(_0, param)); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_array_isset(&_0, param)); } @@ -451,12 +507,16 @@ PHP_METHOD(Phalcon_Dispatcher, hasParam) { */ PHP_METHOD(Phalcon_Dispatcher, getActiveMethod) { - zval *_0, *_1; + zval _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_actionName"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_actionSuffix"), PH_NOISY_CC); - ZEPHIR_CONCAT_VV(return_value, _0, _1); + zephir_read_property(&_0, this_ptr, SL("_actionName"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_actionSuffix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CONCAT_VV(return_value, &_0, &_1); return; } @@ -466,7 +526,8 @@ PHP_METHOD(Phalcon_Dispatcher, getActiveMethod) { */ PHP_METHOD(Phalcon_Dispatcher, isFinished) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_finished"); @@ -479,13 +540,16 @@ PHP_METHOD(Phalcon_Dispatcher, isFinished) { */ PHP_METHOD(Phalcon_Dispatcher, setReturnedValue) { - zval *value; + zval *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); zephir_fetch_params(0, 1, 0, &value); - zephir_update_property_this(getThis(), SL("_returnedValue"), value TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_returnedValue"), value); } @@ -496,7 +560,8 @@ PHP_METHOD(Phalcon_Dispatcher, setReturnedValue) { */ PHP_METHOD(Phalcon_Dispatcher, getReturnedValue) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_returnedValue"); @@ -520,38 +585,48 @@ PHP_METHOD(Phalcon_Dispatcher, getReturnedValue) { PHP_METHOD(Phalcon_Dispatcher, setModelBinding) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *value_param = NULL, *cache = NULL, *dependencyInjector = NULL, *_0$$3 = NULL, *_1$$4; + zval *value_param = NULL, *cache = NULL, cache_sub, __$true, __$false, __$null, dependencyInjector, _0$$3, _1$$4; zend_bool value; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cache_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &value_param, &cache); value = zephir_get_boolval(value_param); if (!cache) { - ZEPHIR_CPY_WRT(cache, ZEPHIR_GLOBAL(global_null)); + cache = &cache_sub; + ZEPHIR_CPY_WRT(cache, &__$null); } else { ZEPHIR_SEPARATE_PARAM(cache); } if (Z_TYPE_P(cache) == IS_STRING) { - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0$$3, dependencyInjector, "get", NULL, 0, cache); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&_0$$3, &dependencyInjector, "get", NULL, 0, cache); zephir_check_call_status(); - ZEPHIR_CPY_WRT(cache, _0$$3); + ZEPHIR_CPY_WRT(cache, &_0$$3); } if (value) { - zephir_update_property_this(getThis(), SL("_modelBinding"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelBinding"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_modelBinding"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelBinding"), &__$false); } if (value) { - ZEPHIR_INIT_VAR(_1$$4); - object_init_ex(_1$$4, phalcon_mvc_model_binder_ce); - ZEPHIR_CALL_METHOD(NULL, _1$$4, "__construct", NULL, 74, cache); + ZEPHIR_INIT_VAR(&_1$$4); + object_init_ex(&_1$$4, phalcon_mvc_model_binder_ce); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 67, cache); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_modelBinder"), _1$$4 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelBinder"), &_1$$4); } RETURN_THIS(); @@ -572,35 +647,45 @@ PHP_METHOD(Phalcon_Dispatcher, setModelBinding) { PHP_METHOD(Phalcon_Dispatcher, setModelBinder) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *modelBinder, *cache = NULL, *dependencyInjector = NULL, *_0$$3 = NULL; + zval *modelBinder, modelBinder_sub, *cache = NULL, cache_sub, __$true, __$false, __$null, dependencyInjector, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelBinder_sub); + ZVAL_UNDEF(&cache_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &modelBinder, &cache); if (!cache) { - ZEPHIR_CPY_WRT(cache, ZEPHIR_GLOBAL(global_null)); + cache = &cache_sub; + ZEPHIR_CPY_WRT(cache, &__$null); } else { ZEPHIR_SEPARATE_PARAM(cache); } if (Z_TYPE_P(cache) == IS_STRING) { - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0$$3, dependencyInjector, "get", NULL, 0, cache); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&_0$$3, &dependencyInjector, "get", NULL, 0, cache); zephir_check_call_status(); - ZEPHIR_CPY_WRT(cache, _0$$3); + ZEPHIR_CPY_WRT(cache, &_0$$3); } if (Z_TYPE_P(cache) != IS_NULL) { ZEPHIR_CALL_METHOD(NULL, modelBinder, "setcache", NULL, 0, cache); zephir_check_call_status(); } if (1) { - zephir_update_property_this(getThis(), SL("_modelBinding"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelBinding"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_modelBinding"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelBinding"), &__$false); } - zephir_update_property_this(getThis(), SL("_modelBinder"), modelBinder TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelBinder"), modelBinder); RETURN_THIS(); } @@ -610,7 +695,8 @@ PHP_METHOD(Phalcon_Dispatcher, setModelBinder) { */ PHP_METHOD(Phalcon_Dispatcher, getModelBinder) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_modelBinder"); @@ -628,47 +714,143 @@ PHP_METHOD(Phalcon_Dispatcher, getModelBinder) { */ PHP_METHOD(Phalcon_Dispatcher, dispatch) { - zval *_44$$10 = NULL; - zval *value = NULL, *handler = NULL, *dependencyInjector = NULL, *namespaceName = NULL, *handlerName = NULL, *actionName = NULL, *params = NULL, *eventsManager = NULL, *actionSuffix = NULL, *handlerClass = NULL, *status = NULL, *actionMethod = NULL, *modelBinder = NULL, *bindCacheKey = NULL, *wasFresh = NULL, *e = NULL, *_0, *_1$$3, *_2$$3, *_3$$5 = NULL, *_4$$5, *_6$$5, *_7$$4, *_8$$7, *_9$$11 = NULL, *_10$$11 = NULL, *_13$$13 = NULL, *_14$$13 = NULL, *_17$$13, *_18$$12 = NULL, *_19$$15 = NULL, *_22$$15, *_24$$10 = NULL, *_91$$10, *_102$$10 = NULL, *_26$$18 = NULL, *_27$$18 = NULL, *_30$$18, *_33$$20 = NULL, *_34$$20 = NULL, *_37$$20, *_38$$22 = NULL, *_39$$22 = NULL, *_42$$22, *_45$$25 = NULL, *_46$$25 = NULL, *_48$$25, *_49$$24 = NULL, *_50$$24 = NULL, *_53$$24, *_54$$30 = NULL, *_55$$30 = NULL, *_58$$30, *_60$$29 = NULL, *_61$$32 = NULL, *_64$$32, *_66$$35 = NULL, *_68$$35, *_70$$34 = NULL, *_71$$37 = NULL, *_74$$37, *_76$$40 = NULL, *_77$$42 = NULL, *_80$$42, *_81$$45 = NULL, *_82$$45 = NULL, *_85$$45, *_86$$44 = NULL, *_87$$47 = NULL, *_90$$47, *_92$$49 = NULL, *_93$$50 = NULL, *_94$$50 = NULL, *_96$$50, *_97$$53 = NULL, *_98$$53, *_99$$56 = NULL, *_101$$56, *_103$$58 = NULL, *_106$$58, *_107$$61 = NULL, *_108$$61 = NULL, *_111$$61, *_112$$60 = NULL, *_113$$63 = NULL, *_116$$63, *_117$$66 = NULL, *_119$$66, *_120$$65 = NULL, *_121$$68 = NULL, *_124$$68, *_125$$71 = NULL, *_127$$70 = NULL, *_128$$72 = NULL, *_131$$72, *_132$$75, *_133$$74, *_134$$76 = NULL; - zend_bool hasService = 0, hasEventsManager = 0, _5$$5, _16$$13, _21$$15, _29$$18, _36$$20, _41$$22, _52$$24, _57$$30, _63$$32, _67$$35, _73$$37, _79$$42, _84$$45, _89$$47, _105$$58, _110$$61, _115$$63, _118$$66, _123$$68, _130$$72; - zephir_fcall_cache_entry *_11 = NULL, *_12 = NULL, *_15 = NULL, *_20 = NULL, *_23 = NULL, *_25 = NULL, *_28 = NULL, *_31 = NULL, *_32 = NULL, *_35 = NULL, *_40 = NULL, *_43 = NULL, *_47 = NULL, *_51 = NULL, *_56 = NULL, *_59 = NULL, *_62 = NULL, *_65 = NULL, *_69 = NULL, *_72 = NULL, *_75 = NULL, *_78 = NULL, *_83 = NULL, *_88 = NULL, *_95 = NULL, *_100 = NULL, *_104 = NULL, *_109 = NULL, *_114 = NULL, *_122 = NULL, *_126 = NULL, *_129 = NULL; + zval _41$$10; + zend_bool hasService = 0, hasEventsManager = 0, _5$$5, _16$$13, _21$$15, _29$$18, _35$$20, _39$$22, _49$$24, _53$$30, _59$$32, _63$$35, _69$$37, _75$$42, _80$$45, _85$$47, _101$$58, _106$$61, _111$$63, _114$$66, _119$$68, _126$$72; + zephir_fcall_cache_entry *_11 = NULL, *_12 = NULL, *_15 = NULL, *_20 = NULL, *_23 = NULL, *_25 = NULL, *_28 = NULL, *_30 = NULL, *_31 = NULL, *_34 = NULL, *_38 = NULL, *_40 = NULL, *_44 = NULL, *_48 = NULL, *_52 = NULL, *_55 = NULL, *_58 = NULL, *_61 = NULL, *_65 = NULL, *_68 = NULL, *_71 = NULL, *_74 = NULL, *_79 = NULL, *_84 = NULL, *_91 = NULL, *_96 = NULL, *_100 = NULL, *_105 = NULL, *_110 = NULL, *_118 = NULL, *_122 = NULL, *_125 = NULL; + zval __$true, __$false, value, handler, dependencyInjector, namespaceName, handlerName, actionName, params, eventsManager, actionSuffix, handlerClass, status, actionMethod, modelBinder, bindCacheKey, wasFresh, e, _0, _1$$3, _2$$3, _3$$5, _4$$5, _6$$5, _7$$4, _8$$7, _9$$11, _10$$11, _13$$13, _14$$13, _17$$13, _18$$12, _19$$15, _22$$15, _24$$10, _87$$10, _98$$10, _26$$18, _27$$18, _32$$20, _33$$20, _36$$22, _37$$22, _42$$25, _43$$25, _45$$25, _46$$24, _47$$24, _50$$30, _51$$30, _54$$30, _56$$29, _57$$32, _60$$32, _62$$35, _64$$35, _66$$34, _67$$37, _70$$37, _72$$40, _73$$42, _76$$42, _77$$45, _78$$45, _81$$45, _82$$44, _83$$47, _86$$47, _88$$49, _89$$50, _90$$50, _92$$50, _93$$53, _94$$53, _95$$56, _97$$56, _99$$58, _102$$58, _103$$61, _104$$61, _107$$61, _108$$60, _109$$63, _112$$63, _113$$66, _115$$66, _116$$65, _117$$68, _120$$68, _121$$71, _123$$70, _124$$72, _127$$72, _128$$75, _129$$74, _130$$76; zend_long ZEPHIR_LAST_CALL_STATUS, numberDispatches = 0; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&handlerName); + ZVAL_UNDEF(&actionName); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&actionSuffix); + ZVAL_UNDEF(&handlerClass); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&actionMethod); + ZVAL_UNDEF(&modelBinder); + ZVAL_UNDEF(&bindCacheKey); + ZVAL_UNDEF(&wasFresh); + ZVAL_UNDEF(&e); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_9$$11); + ZVAL_UNDEF(&_10$$11); + ZVAL_UNDEF(&_13$$13); + ZVAL_UNDEF(&_14$$13); + ZVAL_UNDEF(&_17$$13); + ZVAL_UNDEF(&_18$$12); + ZVAL_UNDEF(&_19$$15); + ZVAL_UNDEF(&_22$$15); + ZVAL_UNDEF(&_24$$10); + ZVAL_UNDEF(&_87$$10); + ZVAL_UNDEF(&_98$$10); + ZVAL_UNDEF(&_26$$18); + ZVAL_UNDEF(&_27$$18); + ZVAL_UNDEF(&_32$$20); + ZVAL_UNDEF(&_33$$20); + ZVAL_UNDEF(&_36$$22); + ZVAL_UNDEF(&_37$$22); + ZVAL_UNDEF(&_42$$25); + ZVAL_UNDEF(&_43$$25); + ZVAL_UNDEF(&_45$$25); + ZVAL_UNDEF(&_46$$24); + ZVAL_UNDEF(&_47$$24); + ZVAL_UNDEF(&_50$$30); + ZVAL_UNDEF(&_51$$30); + ZVAL_UNDEF(&_54$$30); + ZVAL_UNDEF(&_56$$29); + ZVAL_UNDEF(&_57$$32); + ZVAL_UNDEF(&_60$$32); + ZVAL_UNDEF(&_62$$35); + ZVAL_UNDEF(&_64$$35); + ZVAL_UNDEF(&_66$$34); + ZVAL_UNDEF(&_67$$37); + ZVAL_UNDEF(&_70$$37); + ZVAL_UNDEF(&_72$$40); + ZVAL_UNDEF(&_73$$42); + ZVAL_UNDEF(&_76$$42); + ZVAL_UNDEF(&_77$$45); + ZVAL_UNDEF(&_78$$45); + ZVAL_UNDEF(&_81$$45); + ZVAL_UNDEF(&_82$$44); + ZVAL_UNDEF(&_83$$47); + ZVAL_UNDEF(&_86$$47); + ZVAL_UNDEF(&_88$$49); + ZVAL_UNDEF(&_89$$50); + ZVAL_UNDEF(&_90$$50); + ZVAL_UNDEF(&_92$$50); + ZVAL_UNDEF(&_93$$53); + ZVAL_UNDEF(&_94$$53); + ZVAL_UNDEF(&_95$$56); + ZVAL_UNDEF(&_97$$56); + ZVAL_UNDEF(&_99$$58); + ZVAL_UNDEF(&_102$$58); + ZVAL_UNDEF(&_103$$61); + ZVAL_UNDEF(&_104$$61); + ZVAL_UNDEF(&_107$$61); + ZVAL_UNDEF(&_108$$60); + ZVAL_UNDEF(&_109$$63); + ZVAL_UNDEF(&_112$$63); + ZVAL_UNDEF(&_113$$66); + ZVAL_UNDEF(&_115$$66); + ZVAL_UNDEF(&_116$$65); + ZVAL_UNDEF(&_117$$68); + ZVAL_UNDEF(&_120$$68); + ZVAL_UNDEF(&_121$$71); + ZVAL_UNDEF(&_123$$70); + ZVAL_UNDEF(&_124$$72); + ZVAL_UNDEF(&_127$$72); + ZVAL_UNDEF(&_128$$75); + ZVAL_UNDEF(&_129$$74); + ZVAL_UNDEF(&_130$$76); + ZVAL_UNDEF(&_41$$10); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "A dependency injection container is required to access related dispatching services", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_LONG(_2$$3, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_throwdispatchexception", NULL, 0, _1$$3, _2$$3); - zephir_check_temp_parameter(_1$$3); + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "A dependency injection container is required to access related dispatching services"); + ZVAL_LONG(&_2$$3, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_throwdispatchexception", NULL, 0, &_1$$3, &_2$$3); zephir_check_call_status(); RETURN_MM_BOOL(0); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - hasEventsManager = Z_TYPE_P(eventsManager) == IS_OBJECT; + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + hasEventsManager = Z_TYPE_P(&eventsManager) == IS_OBJECT; if (1) { - zephir_update_property_this(getThis(), SL("_finished"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_finished"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_finished"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_finished"), &__$false); } if (hasEventsManager) { /* try_start_1: */ - ZEPHIR_INIT_VAR(_4$$5); - ZVAL_STRING(_4$$5, "dispatch:beforeDispatchLoop", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3$$5, eventsManager, "fire", NULL, 0, _4$$5, this_ptr); - zephir_check_temp_parameter(_4$$5); + ZEPHIR_INIT_VAR(&_4$$5); + ZVAL_STRING(&_4$$5, "dispatch:beforeDispatchLoop"); + ZEPHIR_CALL_METHOD(&_3$$5, &eventsManager, "fire", NULL, 0, &_4$$5, this_ptr); zephir_check_call_status_or_jump(try_end_1); - _5$$5 = ZEPHIR_IS_FALSE_IDENTICAL(_3$$5); + _5$$5 = ZEPHIR_IS_FALSE_IDENTICAL(&_3$$5); if (_5$$5) { - _6$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _5$$5 = !ZEPHIR_IS_FALSE_IDENTICAL(_6$$5); + zephir_read_property(&_6$$5, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _5$$5 = !ZEPHIR_IS_FALSE_IDENTICAL(&_6$$5); } if (_5$$5) { RETURN_MM_BOOL(0); @@ -677,57 +859,56 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { try_end_1: if (EG(exception)) { - ZEPHIR_INIT_VAR(_7$$4); - ZEPHIR_CPY_WRT(_7$$4, EG(exception)); - if (zephir_instance_of_ev(_7$$4, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_7$$4); + ZVAL_OBJ(&_7$$4, EG(exception)); + Z_ADDREF_P(&_7$$4); + if (zephir_instance_of_ev(&_7$$4, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _7$$4); - ZEPHIR_CALL_METHOD(&status, this_ptr, "_handleexception", NULL, 0, e); + ZEPHIR_CPY_WRT(&e, &_7$$4); + ZEPHIR_CALL_METHOD(&status, this_ptr, "_handleexception", NULL, 0, &e); zephir_check_call_status(); - _8$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - if (!ZEPHIR_IS_FALSE_IDENTICAL(_8$$7)) { - if (ZEPHIR_IS_FALSE_IDENTICAL(status)) { + zephir_read_property(&_8$$7, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&_8$$7)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&status)) { RETURN_MM_BOOL(0); } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 461 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 461 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } } - ZEPHIR_INIT_VAR(value); - ZVAL_NULL(value); - ZEPHIR_INIT_VAR(handler); - ZVAL_NULL(handler); + ZEPHIR_INIT_VAR(&value); + ZVAL_NULL(&value); + ZEPHIR_INIT_VAR(&handler); + ZVAL_NULL(&handler); numberDispatches = 0; - ZEPHIR_OBS_VAR(actionSuffix); - zephir_read_property_this(&actionSuffix, this_ptr, SL("_actionSuffix"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&actionSuffix); + zephir_read_property(&actionSuffix, this_ptr, SL("_actionSuffix"), PH_NOISY_CC); if (0) { - zephir_update_property_this(getThis(), SL("_finished"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_finished"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_finished"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_finished"), &__$false); } while (1) { - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - if (!(!(zephir_is_true(_0)))) { + zephir_read_property(&_0, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + if (!(!(zephir_is_true(&_0)))) { break; } numberDispatches++; if (numberDispatches == 256) { - ZEPHIR_INIT_NVAR(_9$$11); - ZVAL_STRING(_9$$11, "Dispatcher has detected a cyclic routing causing stability problems", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_10$$11); - ZVAL_LONG(_10$$11, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_throwdispatchexception", &_11, 0, _9$$11, _10$$11); - zephir_check_temp_parameter(_9$$11); + ZEPHIR_INIT_NVAR(&_9$$11); + ZVAL_STRING(&_9$$11, "Dispatcher has detected a cyclic routing causing stability problems"); + ZVAL_LONG(&_10$$11, 1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_throwdispatchexception", &_11, 0, &_9$$11, &_10$$11); zephir_check_call_status(); break; } if (1) { - zephir_update_property_this(getThis(), SL("_finished"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_finished"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_finished"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_finished"), &__$false); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "_resolveemptyproperties", &_12, 0); zephir_check_call_status(); @@ -735,15 +916,14 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { /* try_start_2: */ - ZEPHIR_INIT_NVAR(_14$$13); - ZVAL_STRING(_14$$13, "dispatch:beforeDispatch", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_13$$13, eventsManager, "fire", &_15, 0, _14$$13, this_ptr); - zephir_check_temp_parameter(_14$$13); + ZEPHIR_INIT_NVAR(&_14$$13); + ZVAL_STRING(&_14$$13, "dispatch:beforeDispatch"); + ZEPHIR_CALL_METHOD(&_13$$13, &eventsManager, "fire", &_15, 0, &_14$$13, this_ptr); zephir_check_call_status_or_jump(try_end_2); - _16$$13 = ZEPHIR_IS_FALSE_IDENTICAL(_13$$13); + _16$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_13$$13); if (!(_16$$13)) { - _17$$13 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _16$$13 = ZEPHIR_IS_FALSE_IDENTICAL(_17$$13); + zephir_read_property(&_17$$13, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _16$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_17$$13); } if (_16$$13) { continue; @@ -752,22 +932,23 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { try_end_2: if (EG(exception)) { - ZEPHIR_INIT_NVAR(_18$$12); - ZEPHIR_CPY_WRT(_18$$12, EG(exception)); - if (zephir_instance_of_ev(_18$$12, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_18$$12); + ZVAL_OBJ(&_18$$12, EG(exception)); + Z_ADDREF_P(&_18$$12); + if (zephir_instance_of_ev(&_18$$12, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _18$$12); - ZEPHIR_CALL_METHOD(&_19$$15, this_ptr, "_handleexception", &_20, 0, e); + ZEPHIR_CPY_WRT(&e, &_18$$12); + ZEPHIR_CALL_METHOD(&_19$$15, this_ptr, "_handleexception", &_20, 0, &e); zephir_check_call_status(); - _21$$15 = ZEPHIR_IS_FALSE_IDENTICAL(_19$$15); + _21$$15 = ZEPHIR_IS_FALSE_IDENTICAL(&_19$$15); if (!(_21$$15)) { - _22$$15 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _21$$15 = ZEPHIR_IS_FALSE_IDENTICAL(_22$$15); + zephir_read_property(&_22$$15, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _21$$15 = ZEPHIR_IS_FALSE_IDENTICAL(&_22$$15); } if (_21$$15) { continue; } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 497 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 497 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -775,111 +956,104 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { } ZEPHIR_CALL_METHOD(&handlerClass, this_ptr, "gethandlerclass", &_23, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_24$$10, dependencyInjector, "has", &_25, 0, handlerClass); + ZEPHIR_CALL_METHOD(&_24$$10, &dependencyInjector, "has", &_25, 0, &handlerClass); zephir_check_call_status(); - hasService = zephir_get_boolval(_24$$10); + hasService = zephir_get_boolval(&_24$$10); if (!(hasService)) { - hasService = zephir_class_exists(handlerClass, 1 TSRMLS_CC); + hasService = zephir_class_exists(&handlerClass, 1 TSRMLS_CC); } if (!(hasService)) { ZEPHIR_INIT_LNVAR(_26$$18); - ZEPHIR_CONCAT_VS(_26$$18, handlerClass, " handler class cannot be loaded"); - ZEPHIR_INIT_NVAR(_27$$18); - ZVAL_LONG(_27$$18, 2); - ZEPHIR_CALL_METHOD(&status, this_ptr, "_throwdispatchexception", &_28, 0, _26$$18, _27$$18); + ZEPHIR_CONCAT_VS(&_26$$18, &handlerClass, " handler class cannot be loaded"); + ZVAL_LONG(&_27$$18, 2); + ZEPHIR_CALL_METHOD(&status, this_ptr, "_throwdispatchexception", &_28, 0, &_26$$18, &_27$$18); zephir_check_call_status(); - _29$$18 = ZEPHIR_IS_FALSE_IDENTICAL(status); + _29$$18 = ZEPHIR_IS_FALSE_IDENTICAL(&status); if (_29$$18) { - _30$$18 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _29$$18 = ZEPHIR_IS_FALSE_IDENTICAL(_30$$18); + zephir_read_property(&_27$$18, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _29$$18 = ZEPHIR_IS_FALSE_IDENTICAL(&_27$$18); } if (_29$$18) { continue; } break; } - ZEPHIR_CALL_METHOD(&handler, dependencyInjector, "getshared", &_31, 0, handlerClass); + ZEPHIR_CALL_METHOD(&handler, &dependencyInjector, "getshared", &_30, 0, &handlerClass); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&wasFresh, dependencyInjector, "wasfreshinstance", &_32, 0); + ZEPHIR_CALL_METHOD(&wasFresh, &dependencyInjector, "wasfreshinstance", &_31, 0); zephir_check_call_status(); - if (Z_TYPE_P(handler) != IS_OBJECT) { - ZEPHIR_INIT_NVAR(_33$$20); - ZVAL_STRING(_33$$20, "Invalid handler returned from the services container", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_34$$20); - ZVAL_LONG(_34$$20, 3); - ZEPHIR_CALL_METHOD(&status, this_ptr, "_throwdispatchexception", &_35, 0, _33$$20, _34$$20); - zephir_check_temp_parameter(_33$$20); + if (Z_TYPE_P(&handler) != IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_32$$20); + ZVAL_STRING(&_32$$20, "Invalid handler returned from the services container"); + ZVAL_LONG(&_33$$20, 3); + ZEPHIR_CALL_METHOD(&status, this_ptr, "_throwdispatchexception", &_34, 0, &_32$$20, &_33$$20); zephir_check_call_status(); - _36$$20 = ZEPHIR_IS_FALSE_IDENTICAL(status); - if (_36$$20) { - _37$$20 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _36$$20 = ZEPHIR_IS_FALSE_IDENTICAL(_37$$20); + _35$$20 = ZEPHIR_IS_FALSE_IDENTICAL(&status); + if (_35$$20) { + zephir_read_property(&_33$$20, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _35$$20 = ZEPHIR_IS_FALSE_IDENTICAL(&_33$$20); } - if (_36$$20) { + if (_35$$20) { continue; } break; } - zephir_update_property_this(getThis(), SL("_activeHandler"), handler TSRMLS_CC); - ZEPHIR_OBS_NVAR(namespaceName); - zephir_read_property_this(&namespaceName, this_ptr, SL("_namespaceName"), PH_NOISY_CC); - ZEPHIR_OBS_NVAR(handlerName); - zephir_read_property_this(&handlerName, this_ptr, SL("_handlerName"), PH_NOISY_CC); - ZEPHIR_OBS_NVAR(actionName); - zephir_read_property_this(&actionName, this_ptr, SL("_actionName"), PH_NOISY_CC); - ZEPHIR_OBS_NVAR(params); - zephir_read_property_this(¶ms, this_ptr, SL("_params"), PH_NOISY_CC); - if (Z_TYPE_P(params) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(_38$$22); - ZVAL_STRING(_38$$22, "Action parameters must be an Array", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_39$$22); - ZVAL_LONG(_39$$22, 4); - ZEPHIR_CALL_METHOD(&status, this_ptr, "_throwdispatchexception", &_40, 0, _38$$22, _39$$22); - zephir_check_temp_parameter(_38$$22); + zephir_update_property_zval(this_ptr, SL("_activeHandler"), &handler); + ZEPHIR_OBS_NVAR(&namespaceName); + zephir_read_property(&namespaceName, this_ptr, SL("_namespaceName"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&handlerName); + zephir_read_property(&handlerName, this_ptr, SL("_handlerName"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&actionName); + zephir_read_property(&actionName, this_ptr, SL("_actionName"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(¶ms); + zephir_read_property(¶ms, this_ptr, SL("_params"), PH_NOISY_CC); + if (Z_TYPE_P(¶ms) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_36$$22); + ZVAL_STRING(&_36$$22, "Action parameters must be an Array"); + ZVAL_LONG(&_37$$22, 4); + ZEPHIR_CALL_METHOD(&status, this_ptr, "_throwdispatchexception", &_38, 0, &_36$$22, &_37$$22); zephir_check_call_status(); - _41$$22 = ZEPHIR_IS_FALSE_IDENTICAL(status); - if (_41$$22) { - _42$$22 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _41$$22 = ZEPHIR_IS_FALSE_IDENTICAL(_42$$22); + _39$$22 = ZEPHIR_IS_FALSE_IDENTICAL(&status); + if (_39$$22) { + zephir_read_property(&_37$$22, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _39$$22 = ZEPHIR_IS_FALSE_IDENTICAL(&_37$$22); } - if (_41$$22) { + if (_39$$22) { continue; } break; } - ZEPHIR_CALL_METHOD(&actionMethod, this_ptr, "getactivemethod", &_43, 0); + ZEPHIR_CALL_METHOD(&actionMethod, this_ptr, "getactivemethod", &_40, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_44$$10); - zephir_create_array(_44$$10, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_44$$10, handler); - zephir_array_fast_append(_44$$10, actionMethod); - if (!(zephir_is_callable(_44$$10 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_41$$10); + zephir_create_array(&_41$$10, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_41$$10, &handler); + zephir_array_fast_append(&_41$$10, &actionMethod); + if (!(zephir_is_callable(&_41$$10 TSRMLS_CC))) { if (hasEventsManager) { - ZEPHIR_INIT_NVAR(_46$$25); - ZVAL_STRING(_46$$25, "dispatch:beforeNotFoundAction", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_45$$25, eventsManager, "fire", &_47, 0, _46$$25, this_ptr); - zephir_check_temp_parameter(_46$$25); + ZEPHIR_INIT_NVAR(&_43$$25); + ZVAL_STRING(&_43$$25, "dispatch:beforeNotFoundAction"); + ZEPHIR_CALL_METHOD(&_42$$25, &eventsManager, "fire", &_44, 0, &_43$$25, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_45$$25)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_42$$25)) { continue; } - _48$$25 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_48$$25)) { + zephir_read_property(&_45$$25, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_45$$25)) { continue; } } - ZEPHIR_INIT_LNVAR(_49$$24); - ZEPHIR_CONCAT_SVSVS(_49$$24, "Action '", actionName, "' was not found on handler '", handlerName, "'"); - ZEPHIR_INIT_NVAR(_50$$24); - ZVAL_LONG(_50$$24, 5); - ZEPHIR_CALL_METHOD(&status, this_ptr, "_throwdispatchexception", &_51, 0, _49$$24, _50$$24); + ZEPHIR_INIT_LNVAR(_46$$24); + ZEPHIR_CONCAT_SVSVS(&_46$$24, "Action '", &actionName, "' was not found on handler '", &handlerName, "'"); + ZVAL_LONG(&_47$$24, 5); + ZEPHIR_CALL_METHOD(&status, this_ptr, "_throwdispatchexception", &_48, 0, &_46$$24, &_47$$24); zephir_check_call_status(); - _52$$24 = ZEPHIR_IS_FALSE_IDENTICAL(status); - if (_52$$24) { - _53$$24 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _52$$24 = ZEPHIR_IS_FALSE_IDENTICAL(_53$$24); + _49$$24 = ZEPHIR_IS_FALSE_IDENTICAL(&status); + if (_49$$24) { + zephir_read_property(&_47$$24, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _49$$24 = ZEPHIR_IS_FALSE_IDENTICAL(&_47$$24); } - if (_52$$24) { + if (_49$$24) { continue; } break; @@ -888,18 +1062,17 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { /* try_start_3: */ - ZEPHIR_INIT_NVAR(_55$$30); - ZVAL_STRING(_55$$30, "dispatch:beforeExecuteRoute", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_54$$30, eventsManager, "fire", &_56, 0, _55$$30, this_ptr); - zephir_check_temp_parameter(_55$$30); + ZEPHIR_INIT_NVAR(&_51$$30); + ZVAL_STRING(&_51$$30, "dispatch:beforeExecuteRoute"); + ZEPHIR_CALL_METHOD(&_50$$30, &eventsManager, "fire", &_52, 0, &_51$$30, this_ptr); zephir_check_call_status_or_jump(try_end_3); - _57$$30 = ZEPHIR_IS_FALSE_IDENTICAL(_54$$30); - if (!(_57$$30)) { - _58$$30 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _57$$30 = ZEPHIR_IS_FALSE_IDENTICAL(_58$$30); + _53$$30 = ZEPHIR_IS_FALSE_IDENTICAL(&_50$$30); + if (!(_53$$30)) { + zephir_read_property(&_54$$30, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _53$$30 = ZEPHIR_IS_FALSE_IDENTICAL(&_54$$30); } - if (_57$$30) { - ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "remove", &_59, 0, handlerClass); + if (_53$$30) { + ZEPHIR_CALL_METHOD(NULL, &dependencyInjector, "remove", &_55, 0, &handlerClass); zephir_check_call_status_or_jump(try_end_3); continue; } @@ -907,42 +1080,43 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { try_end_3: if (EG(exception)) { - ZEPHIR_INIT_NVAR(_60$$29); - ZEPHIR_CPY_WRT(_60$$29, EG(exception)); - if (zephir_instance_of_ev(_60$$29, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_56$$29); + ZVAL_OBJ(&_56$$29, EG(exception)); + Z_ADDREF_P(&_56$$29); + if (zephir_instance_of_ev(&_56$$29, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _60$$29); - ZEPHIR_CALL_METHOD(&_61$$32, this_ptr, "_handleexception", &_62, 0, e); + ZEPHIR_CPY_WRT(&e, &_56$$29); + ZEPHIR_CALL_METHOD(&_57$$32, this_ptr, "_handleexception", &_58, 0, &e); zephir_check_call_status(); - _63$$32 = ZEPHIR_IS_FALSE_IDENTICAL(_61$$32); - if (!(_63$$32)) { - _64$$32 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _63$$32 = ZEPHIR_IS_FALSE_IDENTICAL(_64$$32); + _59$$32 = ZEPHIR_IS_FALSE_IDENTICAL(&_57$$32); + if (!(_59$$32)) { + zephir_read_property(&_60$$32, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _59$$32 = ZEPHIR_IS_FALSE_IDENTICAL(&_60$$32); } - if (_63$$32) { - ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "remove", &_65, 0, handlerClass); + if (_59$$32) { + ZEPHIR_CALL_METHOD(NULL, &dependencyInjector, "remove", &_61, 0, &handlerClass); zephir_check_call_status(); continue; } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 591 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 591 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } - if ((zephir_method_exists_ex(handler, SS("beforeexecuteroute") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(&handler, SL("beforeexecuteroute") TSRMLS_CC) == SUCCESS)) { /* try_start_4: */ - ZEPHIR_CALL_METHOD(&_66$$35, handler, "beforeexecuteroute", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(&_62$$35, &handler, "beforeexecuteroute", NULL, 0, this_ptr); zephir_check_call_status_or_jump(try_end_4); - _67$$35 = ZEPHIR_IS_FALSE_IDENTICAL(_66$$35); - if (!(_67$$35)) { - _68$$35 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _67$$35 = ZEPHIR_IS_FALSE_IDENTICAL(_68$$35); + _63$$35 = ZEPHIR_IS_FALSE_IDENTICAL(&_62$$35); + if (!(_63$$35)) { + zephir_read_property(&_64$$35, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _63$$35 = ZEPHIR_IS_FALSE_IDENTICAL(&_64$$35); } - if (_67$$35) { - ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "remove", &_69, 0, handlerClass); + if (_63$$35) { + ZEPHIR_CALL_METHOD(NULL, &dependencyInjector, "remove", &_65, 0, &handlerClass); zephir_check_call_status_or_jump(try_end_4); continue; } @@ -950,185 +1124,187 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { try_end_4: if (EG(exception)) { - ZEPHIR_INIT_NVAR(_70$$34); - ZEPHIR_CPY_WRT(_70$$34, EG(exception)); - if (zephir_instance_of_ev(_70$$34, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_66$$34); + ZVAL_OBJ(&_66$$34, EG(exception)); + Z_ADDREF_P(&_66$$34); + if (zephir_instance_of_ev(&_66$$34, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _70$$34); - ZEPHIR_CALL_METHOD(&_71$$37, this_ptr, "_handleexception", &_72, 0, e); + ZEPHIR_CPY_WRT(&e, &_66$$34); + ZEPHIR_CALL_METHOD(&_67$$37, this_ptr, "_handleexception", &_68, 0, &e); zephir_check_call_status(); - _73$$37 = ZEPHIR_IS_FALSE_IDENTICAL(_71$$37); - if (!(_73$$37)) { - _74$$37 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _73$$37 = ZEPHIR_IS_FALSE_IDENTICAL(_74$$37); + _69$$37 = ZEPHIR_IS_FALSE_IDENTICAL(&_67$$37); + if (!(_69$$37)) { + zephir_read_property(&_70$$37, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _69$$37 = ZEPHIR_IS_FALSE_IDENTICAL(&_70$$37); } - if (_73$$37) { - ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "remove", &_75, 0, handlerClass); + if (_69$$37) { + ZEPHIR_CALL_METHOD(NULL, &dependencyInjector, "remove", &_71, 0, &handlerClass); zephir_check_call_status(); continue; } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 608 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 608 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } - if (ZEPHIR_IS_TRUE_IDENTICAL(wasFresh)) { - if ((zephir_method_exists_ex(handler, SS("initialize") TSRMLS_CC) == SUCCESS)) { + if (ZEPHIR_IS_TRUE_IDENTICAL(&wasFresh)) { + if ((zephir_method_exists_ex(&handler, SL("initialize") TSRMLS_CC) == SUCCESS)) { /* try_start_5: */ if (1) { - zephir_update_property_this(getThis(), SL("_isControllerInitialize"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isControllerInitialize"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_isControllerInitialize"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isControllerInitialize"), &__$false); } - ZEPHIR_CALL_METHOD(NULL, handler, "initialize", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &handler, "initialize", NULL, 0); zephir_check_call_status_or_jump(try_end_5); try_end_5: if (EG(exception)) { - ZEPHIR_INIT_NVAR(_76$$40); - ZEPHIR_CPY_WRT(_76$$40, EG(exception)); - if (zephir_instance_of_ev(_76$$40, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_72$$40); + ZVAL_OBJ(&_72$$40, EG(exception)); + Z_ADDREF_P(&_72$$40); + if (zephir_instance_of_ev(&_72$$40, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _76$$40); + ZEPHIR_CPY_WRT(&e, &_72$$40); if (0) { - zephir_update_property_this(getThis(), SL("_isControllerInitialize"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isControllerInitialize"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_isControllerInitialize"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isControllerInitialize"), &__$false); } - ZEPHIR_CALL_METHOD(&_77$$42, this_ptr, "_handleexception", &_78, 0, e); + ZEPHIR_CALL_METHOD(&_73$$42, this_ptr, "_handleexception", &_74, 0, &e); zephir_check_call_status(); - _79$$42 = ZEPHIR_IS_FALSE_IDENTICAL(_77$$42); - if (!(_79$$42)) { - _80$$42 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _79$$42 = ZEPHIR_IS_FALSE_IDENTICAL(_80$$42); + _75$$42 = ZEPHIR_IS_FALSE_IDENTICAL(&_73$$42); + if (!(_75$$42)) { + zephir_read_property(&_76$$42, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _75$$42 = ZEPHIR_IS_FALSE_IDENTICAL(&_76$$42); } - if (_79$$42) { + if (_75$$42) { continue; } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 641 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 641 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } if (0) { - zephir_update_property_this(getThis(), SL("_isControllerInitialize"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isControllerInitialize"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_isControllerInitialize"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isControllerInitialize"), &__$false); } - if (zephir_is_true(eventsManager)) { + if (zephir_is_true(&eventsManager)) { /* try_start_6: */ - ZEPHIR_INIT_NVAR(_82$$45); - ZVAL_STRING(_82$$45, "dispatch:afterInitialize", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_81$$45, eventsManager, "fire", &_83, 0, _82$$45, this_ptr); - zephir_check_temp_parameter(_82$$45); + ZEPHIR_INIT_NVAR(&_78$$45); + ZVAL_STRING(&_78$$45, "dispatch:afterInitialize"); + ZEPHIR_CALL_METHOD(&_77$$45, &eventsManager, "fire", &_79, 0, &_78$$45, this_ptr); zephir_check_call_status_or_jump(try_end_6); - _84$$45 = ZEPHIR_IS_FALSE_IDENTICAL(_81$$45); - if (!(_84$$45)) { - _85$$45 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _84$$45 = ZEPHIR_IS_FALSE_IDENTICAL(_85$$45); + _80$$45 = ZEPHIR_IS_FALSE_IDENTICAL(&_77$$45); + if (!(_80$$45)) { + zephir_read_property(&_81$$45, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _80$$45 = ZEPHIR_IS_FALSE_IDENTICAL(&_81$$45); } - if (_84$$45) { + if (_80$$45) { continue; } try_end_6: if (EG(exception)) { - ZEPHIR_INIT_NVAR(_86$$44); - ZEPHIR_CPY_WRT(_86$$44, EG(exception)); - if (zephir_instance_of_ev(_86$$44, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_82$$44); + ZVAL_OBJ(&_82$$44, EG(exception)); + Z_ADDREF_P(&_82$$44); + if (zephir_instance_of_ev(&_82$$44, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _86$$44); - ZEPHIR_CALL_METHOD(&_87$$47, this_ptr, "_handleexception", &_88, 0, e); + ZEPHIR_CPY_WRT(&e, &_82$$44); + ZEPHIR_CALL_METHOD(&_83$$47, this_ptr, "_handleexception", &_84, 0, &e); zephir_check_call_status(); - _89$$47 = ZEPHIR_IS_FALSE_IDENTICAL(_87$$47); - if (!(_89$$47)) { - _90$$47 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _89$$47 = ZEPHIR_IS_FALSE_IDENTICAL(_90$$47); + _85$$47 = ZEPHIR_IS_FALSE_IDENTICAL(&_83$$47); + if (!(_85$$47)) { + zephir_read_property(&_86$$47, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _85$$47 = ZEPHIR_IS_FALSE_IDENTICAL(&_86$$47); } - if (_89$$47) { + if (_85$$47) { continue; } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 658 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 658 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } } - _91$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_modelBinding"), PH_NOISY_CC); - if (zephir_is_true(_91$$10)) { - ZEPHIR_OBS_NVAR(modelBinder); - zephir_read_property_this(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(bindCacheKey); - ZEPHIR_CONCAT_SVSV(bindCacheKey, "_PHMB_", handlerClass, "_", actionMethod); - ZEPHIR_CALL_METHOD(&_92$$49, modelBinder, "bindtohandler", NULL, 0, handler, params, bindCacheKey, actionMethod); + zephir_read_property(&_87$$10, this_ptr, SL("_modelBinding"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_87$$10)) { + ZEPHIR_OBS_NVAR(&modelBinder); + zephir_read_property(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&bindCacheKey); + ZEPHIR_CONCAT_SVSV(&bindCacheKey, "_PHMB_", &handlerClass, "_", &actionMethod); + ZEPHIR_CALL_METHOD(&_88$$49, &modelBinder, "bindtohandler", NULL, 0, &handler, ¶ms, &bindCacheKey, &actionMethod); zephir_check_call_status(); - ZEPHIR_CPY_WRT(params, _92$$49); + ZEPHIR_CPY_WRT(¶ms, &_88$$49); } if (hasEventsManager) { - ZEPHIR_INIT_NVAR(_94$$50); - ZVAL_STRING(_94$$50, "dispatch:afterBinding", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_93$$50, eventsManager, "fire", &_95, 0, _94$$50, this_ptr); - zephir_check_temp_parameter(_94$$50); + ZEPHIR_INIT_NVAR(&_90$$50); + ZVAL_STRING(&_90$$50, "dispatch:afterBinding"); + ZEPHIR_CALL_METHOD(&_89$$50, &eventsManager, "fire", &_91, 0, &_90$$50, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_93$$50)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_89$$50)) { continue; } - _96$$50 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_96$$50)) { + zephir_read_property(&_92$$50, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_92$$50)) { continue; } } - if ((zephir_method_exists_ex(handler, SS("afterbinding") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(&_97$$53, handler, "afterbinding", NULL, 0, this_ptr); + if ((zephir_method_exists_ex(&handler, SL("afterbinding") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD(&_93$$53, &handler, "afterbinding", NULL, 0, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_97$$53)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_93$$53)) { continue; } - _98$$53 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_98$$53)) { + zephir_read_property(&_94$$53, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_94$$53)) { continue; } } - zephir_update_property_this(getThis(), SL("_lastHandler"), handler TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_lastHandler"), &handler); /* try_start_7: */ - ZEPHIR_CALL_METHOD(&_99$$56, this_ptr, "callactionmethod", &_100, 0, handler, actionMethod, params); + ZEPHIR_CALL_METHOD(&_95$$56, this_ptr, "callactionmethod", &_96, 0, &handler, &actionMethod, ¶ms); zephir_check_call_status_or_jump(try_end_7); - zephir_update_property_this(getThis(), SL("_returnedValue"), _99$$56 TSRMLS_CC); - _101$$56 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_101$$56)) { + zephir_update_property_zval(this_ptr, SL("_returnedValue"), &_95$$56); + zephir_read_property(&_97$$56, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_97$$56)) { continue; } try_end_7: if (EG(exception)) { - ZEPHIR_INIT_NVAR(_102$$10); - ZEPHIR_CPY_WRT(_102$$10, EG(exception)); - if (zephir_instance_of_ev(_102$$10, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_98$$10); + ZVAL_OBJ(&_98$$10, EG(exception)); + Z_ADDREF_P(&_98$$10); + if (zephir_instance_of_ev(&_98$$10, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _102$$10); - ZEPHIR_CALL_METHOD(&_103$$58, this_ptr, "_handleexception", &_104, 0, e); + ZEPHIR_CPY_WRT(&e, &_98$$10); + ZEPHIR_CALL_METHOD(&_99$$58, this_ptr, "_handleexception", &_100, 0, &e); zephir_check_call_status(); - _105$$58 = ZEPHIR_IS_FALSE_IDENTICAL(_103$$58); - if (!(_105$$58)) { - _106$$58 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _105$$58 = ZEPHIR_IS_FALSE_IDENTICAL(_106$$58); + _101$$58 = ZEPHIR_IS_FALSE_IDENTICAL(&_99$$58); + if (!(_101$$58)) { + zephir_read_property(&_102$$58, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _101$$58 = ZEPHIR_IS_FALSE_IDENTICAL(&_102$$58); } - if (_105$$58) { + if (_101$$58) { continue; } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 708 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 708 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -1137,78 +1313,79 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { /* try_start_8: */ - ZEPHIR_INIT_NVAR(_108$$61); - ZVAL_STRING(_108$$61, "dispatch:afterExecuteRoute", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_107$$61, eventsManager, "fire", &_109, 0, _108$$61, this_ptr, value); - zephir_check_temp_parameter(_108$$61); + ZEPHIR_INIT_NVAR(&_104$$61); + ZVAL_STRING(&_104$$61, "dispatch:afterExecuteRoute"); + ZEPHIR_CALL_METHOD(&_103$$61, &eventsManager, "fire", &_105, 0, &_104$$61, this_ptr, &value); zephir_check_call_status_or_jump(try_end_8); - _110$$61 = ZEPHIR_IS_FALSE_IDENTICAL(_107$$61); - if (!(_110$$61)) { - _111$$61 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _110$$61 = ZEPHIR_IS_FALSE_IDENTICAL(_111$$61); + _106$$61 = ZEPHIR_IS_FALSE_IDENTICAL(&_103$$61); + if (!(_106$$61)) { + zephir_read_property(&_107$$61, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _106$$61 = ZEPHIR_IS_FALSE_IDENTICAL(&_107$$61); } - if (_110$$61) { + if (_106$$61) { continue; } try_end_8: if (EG(exception)) { - ZEPHIR_INIT_NVAR(_112$$60); - ZEPHIR_CPY_WRT(_112$$60, EG(exception)); - if (zephir_instance_of_ev(_112$$60, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_108$$60); + ZVAL_OBJ(&_108$$60, EG(exception)); + Z_ADDREF_P(&_108$$60); + if (zephir_instance_of_ev(&_108$$60, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _112$$60); - ZEPHIR_CALL_METHOD(&_113$$63, this_ptr, "_handleexception", &_114, 0, e); + ZEPHIR_CPY_WRT(&e, &_108$$60); + ZEPHIR_CALL_METHOD(&_109$$63, this_ptr, "_handleexception", &_110, 0, &e); zephir_check_call_status(); - _115$$63 = ZEPHIR_IS_FALSE_IDENTICAL(_113$$63); - if (!(_115$$63)) { - _116$$63 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _115$$63 = ZEPHIR_IS_FALSE_IDENTICAL(_116$$63); + _111$$63 = ZEPHIR_IS_FALSE_IDENTICAL(&_109$$63); + if (!(_111$$63)) { + zephir_read_property(&_112$$63, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _111$$63 = ZEPHIR_IS_FALSE_IDENTICAL(&_112$$63); } - if (_115$$63) { + if (_111$$63) { continue; } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 722 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 722 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } - if ((zephir_method_exists_ex(handler, SS("afterexecuteroute") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(&handler, SL("afterexecuteroute") TSRMLS_CC) == SUCCESS)) { /* try_start_9: */ - ZEPHIR_CALL_METHOD(&_117$$66, handler, "afterexecuteroute", NULL, 0, this_ptr, value); + ZEPHIR_CALL_METHOD(&_113$$66, &handler, "afterexecuteroute", NULL, 0, this_ptr, &value); zephir_check_call_status_or_jump(try_end_9); - _118$$66 = ZEPHIR_IS_FALSE_IDENTICAL(_117$$66); - if (!(_118$$66)) { - _119$$66 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _118$$66 = ZEPHIR_IS_FALSE_IDENTICAL(_119$$66); + _114$$66 = ZEPHIR_IS_FALSE_IDENTICAL(&_113$$66); + if (!(_114$$66)) { + zephir_read_property(&_115$$66, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _114$$66 = ZEPHIR_IS_FALSE_IDENTICAL(&_115$$66); } - if (_118$$66) { + if (_114$$66) { continue; } try_end_9: if (EG(exception)) { - ZEPHIR_INIT_NVAR(_120$$65); - ZEPHIR_CPY_WRT(_120$$65, EG(exception)); - if (zephir_instance_of_ev(_120$$65, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_116$$65); + ZVAL_OBJ(&_116$$65, EG(exception)); + Z_ADDREF_P(&_116$$65); + if (zephir_instance_of_ev(&_116$$65, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _120$$65); - ZEPHIR_CALL_METHOD(&_121$$68, this_ptr, "_handleexception", &_122, 0, e); + ZEPHIR_CPY_WRT(&e, &_116$$65); + ZEPHIR_CALL_METHOD(&_117$$68, this_ptr, "_handleexception", &_118, 0, &e); zephir_check_call_status(); - _123$$68 = ZEPHIR_IS_FALSE_IDENTICAL(_121$$68); - if (!(_123$$68)) { - _124$$68 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _123$$68 = ZEPHIR_IS_FALSE_IDENTICAL(_124$$68); + _119$$68 = ZEPHIR_IS_FALSE_IDENTICAL(&_117$$68); + if (!(_119$$68)) { + zephir_read_property(&_120$$68, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _119$$68 = ZEPHIR_IS_FALSE_IDENTICAL(&_120$$68); } - if (_123$$68) { + if (_119$$68) { continue; } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 737 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 737 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -1218,31 +1395,31 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { /* try_start_10: */ - ZEPHIR_INIT_NVAR(_125$$71); - ZVAL_STRING(_125$$71, "dispatch:afterDispatch", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_126, 0, _125$$71, this_ptr, value); - zephir_check_temp_parameter(_125$$71); + ZEPHIR_INIT_NVAR(&_121$$71); + ZVAL_STRING(&_121$$71, "dispatch:afterDispatch"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_122, 0, &_121$$71, this_ptr, &value); zephir_check_call_status_or_jump(try_end_10); try_end_10: if (EG(exception)) { - ZEPHIR_INIT_NVAR(_127$$70); - ZEPHIR_CPY_WRT(_127$$70, EG(exception)); - if (zephir_instance_of_ev(_127$$70, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_123$$70); + ZVAL_OBJ(&_123$$70, EG(exception)); + Z_ADDREF_P(&_123$$70); + if (zephir_instance_of_ev(&_123$$70, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _127$$70); - ZEPHIR_CALL_METHOD(&_128$$72, this_ptr, "_handleexception", &_129, 0, e); + ZEPHIR_CPY_WRT(&e, &_123$$70); + ZEPHIR_CALL_METHOD(&_124$$72, this_ptr, "_handleexception", &_125, 0, &e); zephir_check_call_status(); - _130$$72 = ZEPHIR_IS_FALSE_IDENTICAL(_128$$72); - if (!(_130$$72)) { - _131$$72 = zephir_fetch_nproperty_this(this_ptr, SL("_finished"), PH_NOISY_CC); - _130$$72 = ZEPHIR_IS_FALSE_IDENTICAL(_131$$72); + _126$$72 = ZEPHIR_IS_FALSE_IDENTICAL(&_124$$72); + if (!(_126$$72)) { + zephir_read_property(&_127$$72, this_ptr, SL("_finished"), PH_NOISY_CC | PH_READONLY); + _126$$72 = ZEPHIR_IS_FALSE_IDENTICAL(&_127$$72); } - if (_130$$72) { + if (_126$$72) { continue; } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 751 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 751 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -1253,32 +1430,32 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { /* try_start_11: */ - ZEPHIR_INIT_VAR(_132$$75); - ZVAL_STRING(_132$$75, "dispatch:afterDispatchLoop", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _132$$75, this_ptr); - zephir_check_temp_parameter(_132$$75); + ZEPHIR_INIT_VAR(&_128$$75); + ZVAL_STRING(&_128$$75, "dispatch:afterDispatchLoop"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_128$$75, this_ptr); zephir_check_call_status_or_jump(try_end_11); try_end_11: if (EG(exception)) { - ZEPHIR_INIT_VAR(_133$$74); - ZEPHIR_CPY_WRT(_133$$74, EG(exception)); - if (zephir_instance_of_ev(_133$$74, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_129$$74); + ZVAL_OBJ(&_129$$74, EG(exception)); + Z_ADDREF_P(&_129$$74); + if (zephir_instance_of_ev(&_129$$74, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _133$$74); - ZEPHIR_CALL_METHOD(&_134$$76, this_ptr, "_handleexception", NULL, 0, e); + ZEPHIR_CPY_WRT(&e, &_129$$74); + ZEPHIR_CALL_METHOD(&_130$$76, this_ptr, "_handleexception", NULL, 0, &e); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_134$$76)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_130$$76)) { RETURN_MM_BOOL(0); } - zephir_throw_exception_debug(e, "phalcon/dispatcher.zep", 768 TSRMLS_CC); + zephir_throw_exception_debug(&e, "phalcon/dispatcher.zep", 768 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } - RETURN_CCTOR(handler); + RETURN_CCTOR(&handler); } @@ -1300,15 +1477,29 @@ PHP_METHOD(Phalcon_Dispatcher, dispatch) { */ PHP_METHOD(Phalcon_Dispatcher, forward) { - zval *forward, *namespaceName = NULL, *controllerName = NULL, *params = NULL, *actionName = NULL, *taskName = NULL, *_0, *_1, *_2, *_3; + zval *forward, forward_sub, __$true, __$false, namespaceName, controllerName, params, actionName, taskName, _0, _1, _2, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&forward_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&controllerName); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&actionName); + ZVAL_UNDEF(&taskName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &forward); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_isControllerInitialize"), PH_NOISY_CC); - if (ZEPHIR_IS_TRUE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_isControllerInitialize"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_exception_ce, "Forwarding inside a controller's initialize() method is forbidden", "phalcon/dispatcher.zep", 799); return; } @@ -1316,36 +1507,36 @@ PHP_METHOD(Phalcon_Dispatcher, forward) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_exception_ce, "Forward parameter must be an Array", "phalcon/dispatcher.zep", 807); return; } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_namespaceName"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_previousNamespaceName"), _1 TSRMLS_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_handlerName"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_previousHandlerName"), _2 TSRMLS_CC); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_actionName"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_previousActionName"), _3 TSRMLS_CC); - if (zephir_array_isset_string_fetch(&namespaceName, forward, SS("namespace"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_namespaceName"), namespaceName TSRMLS_CC); + zephir_read_property(&_1, this_ptr, SL("_namespaceName"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_previousNamespaceName"), &_1); + zephir_read_property(&_2, this_ptr, SL("_handlerName"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_previousHandlerName"), &_2); + zephir_read_property(&_3, this_ptr, SL("_actionName"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_previousActionName"), &_3); + if (zephir_array_isset_string_fetch(&namespaceName, forward, SL("namespace"), 1)) { + zephir_update_property_zval(this_ptr, SL("_namespaceName"), &namespaceName); } - ZEPHIR_OBS_VAR(taskName); - if (zephir_array_isset_string_fetch(&controllerName, forward, SS("controller"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_handlerName"), controllerName TSRMLS_CC); - } else if (zephir_array_isset_string_fetch(&taskName, forward, SS("task"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_handlerName"), taskName TSRMLS_CC); + ZEPHIR_OBS_VAR(&taskName); + if (zephir_array_isset_string_fetch(&controllerName, forward, SL("controller"), 1)) { + zephir_update_property_zval(this_ptr, SL("_handlerName"), &controllerName); + } else if (zephir_array_isset_string_fetch(&taskName, forward, SL("task"), 0)) { + zephir_update_property_zval(this_ptr, SL("_handlerName"), &taskName); } - if (zephir_array_isset_string_fetch(&actionName, forward, SS("action"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_actionName"), actionName TSRMLS_CC); + if (zephir_array_isset_string_fetch(&actionName, forward, SL("action"), 1)) { + zephir_update_property_zval(this_ptr, SL("_actionName"), &actionName); } - if (zephir_array_isset_string_fetch(¶ms, forward, SS("params"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_params"), params TSRMLS_CC); + if (zephir_array_isset_string_fetch(¶ms, forward, SL("params"), 1)) { + zephir_update_property_zval(this_ptr, SL("_params"), ¶ms); } if (0) { - zephir_update_property_this(getThis(), SL("_finished"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_finished"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_finished"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_finished"), &__$false); } if (1) { - zephir_update_property_this(getThis(), SL("_forwarded"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_forwarded"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_forwarded"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_forwarded"), &__$false); } ZEPHIR_MM_RESTORE(); @@ -1356,7 +1547,8 @@ PHP_METHOD(Phalcon_Dispatcher, forward) { */ PHP_METHOD(Phalcon_Dispatcher, wasForwarded) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_forwarded"); @@ -1367,64 +1559,77 @@ PHP_METHOD(Phalcon_Dispatcher, wasForwarded) { */ PHP_METHOD(Phalcon_Dispatcher, getHandlerClass) { - zval *handlerSuffix = NULL, *handlerName = NULL, *namespaceName = NULL, *camelizedClass = NULL, *handlerClass = NULL; + zval handlerSuffix, handlerName, namespaceName, camelizedClass, handlerClass; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handlerSuffix); + ZVAL_UNDEF(&handlerName); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&camelizedClass); + ZVAL_UNDEF(&handlerClass); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "_resolveemptyproperties", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(handlerSuffix); - zephir_read_property_this(&handlerSuffix, this_ptr, SL("_handlerSuffix"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(handlerName); - zephir_read_property_this(&handlerName, this_ptr, SL("_handlerName"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(namespaceName); - zephir_read_property_this(&namespaceName, this_ptr, SL("_namespaceName"), PH_NOISY_CC); - if (!(zephir_memnstr_str(handlerName, SL("\\"), "phalcon/dispatcher.zep", 864))) { - ZEPHIR_INIT_VAR(camelizedClass); - zephir_camelize(camelizedClass, handlerName, NULL ); + ZEPHIR_OBS_VAR(&handlerSuffix); + zephir_read_property(&handlerSuffix, this_ptr, SL("_handlerSuffix"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&handlerName); + zephir_read_property(&handlerName, this_ptr, SL("_handlerName"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&namespaceName); + zephir_read_property(&namespaceName, this_ptr, SL("_namespaceName"), PH_NOISY_CC); + if (!(zephir_memnstr_str(&handlerName, SL("\\"), "phalcon/dispatcher.zep", 864))) { + ZEPHIR_INIT_VAR(&camelizedClass); + zephir_camelize(&camelizedClass, &handlerName, NULL ); } else { - ZEPHIR_CPY_WRT(camelizedClass, handlerName); + ZEPHIR_CPY_WRT(&camelizedClass, &handlerName); } - if (zephir_is_true(namespaceName)) { - ZEPHIR_INIT_VAR(handlerClass); - if (zephir_end_with_str(namespaceName, SL("\\"))) { - ZEPHIR_CONCAT_VVV(handlerClass, namespaceName, camelizedClass, handlerSuffix); + if (zephir_is_true(&namespaceName)) { + ZEPHIR_INIT_VAR(&handlerClass); + if (zephir_end_with_str(&namespaceName, SL("\\"))) { + ZEPHIR_CONCAT_VVV(&handlerClass, &namespaceName, &camelizedClass, &handlerSuffix); } else { - ZEPHIR_CONCAT_VSVV(handlerClass, namespaceName, "\\", camelizedClass, handlerSuffix); + ZEPHIR_CONCAT_VSVV(&handlerClass, &namespaceName, "\\", &camelizedClass, &handlerSuffix); } } else { - ZEPHIR_INIT_NVAR(handlerClass); - ZEPHIR_CONCAT_VV(handlerClass, camelizedClass, handlerSuffix); + ZEPHIR_INIT_NVAR(&handlerClass); + ZEPHIR_CONCAT_VV(&handlerClass, &camelizedClass, &handlerSuffix); } - RETURN_CCTOR(handlerClass); + RETURN_CCTOR(&handlerClass); } PHP_METHOD(Phalcon_Dispatcher, callActionMethod) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *params = NULL, *_0; - zval *actionMethod = NULL; - zval *handler, *actionMethod_param = NULL, *params_param = NULL; + zval params, _0; + zval actionMethod; + zval *handler, handler_sub, *actionMethod_param = NULL, *params_param = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&actionMethod); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &handler, &actionMethod_param, ¶ms_param); - zephir_get_strval(actionMethod, actionMethod_param); + zephir_get_strval(&actionMethod, actionMethod_param); if (!params_param) { - ZEPHIR_INIT_VAR(params); - array_init(params); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); } else { - params = params_param; + ZEPHIR_OBS_COPY_OR_DUP(¶ms, params_param); } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_0, handler); - zephir_array_fast_append(_0, actionMethod); - ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, _0, params); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, handler); + zephir_array_fast_append(&_0, &actionMethod); + ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_0, ¶ms); zephir_check_call_status(); RETURN_MM(); @@ -1445,15 +1650,18 @@ PHP_METHOD(Phalcon_Dispatcher, callActionMethod) { */ PHP_METHOD(Phalcon_Dispatcher, getBoundModels) { - zval *modelBinder = NULL; + zval modelBinder; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelBinder); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(modelBinder); - zephir_read_property_this(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); - if (Z_TYPE_P(modelBinder) != IS_NULL) { - ZEPHIR_RETURN_CALL_METHOD(modelBinder, "getboundmodels", NULL, 0); + ZEPHIR_OBS_VAR(&modelBinder); + zephir_read_property(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); + if (Z_TYPE_P(&modelBinder) != IS_NULL) { + ZEPHIR_RETURN_CALL_METHOD(&modelBinder, "getboundmodels", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -1467,55 +1675,54 @@ PHP_METHOD(Phalcon_Dispatcher, getBoundModels) { */ PHP_METHOD(Phalcon_Dispatcher, _resolveEmptyProperties) { - zval *_0, *_2, *_4, *_1$$3, *_3$$4, *_5$$5; + zval _0, _2, _4, _1$$3, _3$$4, _5$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$5); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_namespaceName"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultNamespace"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_namespaceName"), _1$$3 TSRMLS_CC); + zephir_read_property(&_0, this_ptr, SL("_namespaceName"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { + zephir_read_property(&_1$$3, this_ptr, SL("_defaultNamespace"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_namespaceName"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_handlerName"), PH_NOISY_CC); - if (!(zephir_is_true(_2))) { - _3$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultHandler"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_handlerName"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_handlerName"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_2))) { + zephir_read_property(&_3$$4, this_ptr, SL("_defaultHandler"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_handlerName"), &_3$$4); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_actionName"), PH_NOISY_CC); - if (!(zephir_is_true(_4))) { - _5$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultAction"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_actionName"), _5$$5 TSRMLS_CC); + zephir_read_property(&_4, this_ptr, SL("_actionName"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_4))) { + zephir_read_property(&_5$$5, this_ptr, SL("_defaultAction"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_actionName"), &_5$$5); } } -zend_object_value zephir_init_properties_Phalcon_Dispatcher(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Dispatcher(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_params"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_params"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/dispatcher.zep.h b/ext/phalcon/dispatcher.zep.h index 3d0d01b713d..8cb619b34d7 100644 --- a/ext/phalcon/dispatcher.zep.h +++ b/ext/phalcon/dispatcher.zep.h @@ -37,44 +37,124 @@ PHP_METHOD(Phalcon_Dispatcher, getHandlerClass); PHP_METHOD(Phalcon_Dispatcher, callActionMethod); PHP_METHOD(Phalcon_Dispatcher, getBoundModels); PHP_METHOD(Phalcon_Dispatcher, _resolveEmptyProperties); -zend_object_value zephir_init_properties_Phalcon_Dispatcher(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Dispatcher(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_dispatcher_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_seteventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_dispatcher_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setactionsuffix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionSuffix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionSuffix) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getactionsuffix, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getactionsuffix, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setmodulename, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, moduleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, moduleName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getmodulename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getmodulename, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setnamespacename, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespaceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespaceName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getnamespacename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getnamespacename, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setdefaultnamespace, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespaceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespaceName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getdefaultnamespace, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getdefaultnamespace, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setactionname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getactionname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getactionname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setparams, 0, 0, 1) ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getparams, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getparams, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setparam, 0, 0, 2) ZEND_ARG_INFO(0, param) ZEND_ARG_INFO(0, value) @@ -86,68 +166,130 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_getparam, 0, 0, 1) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_hasparam, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_hasparam, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_hasparam, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, param) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getactivemethod, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getactivemethod, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_isfinished, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_isfinished, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setreturnedvalue, 0, 0, 1) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setmodelbinding, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_dispatcher_setmodelbinding, 0, 1, Phalcon\\Dispatcher, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_setmodelbinding, 0, 1, IS_OBJECT, "Phalcon\\Dispatcher", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_ARG_INFO(0, cache) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_setmodelbinder, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_dispatcher_setmodelbinder, 0, 1, Phalcon\\Dispatcher, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_setmodelbinder, 0, 1, IS_OBJECT, "Phalcon\\Dispatcher", 0) +#endif ZEND_ARG_OBJ_INFO(0, modelBinder, Phalcon\\Mvc\\Model\\BinderInterface, 0) ZEND_ARG_INFO(0, cache) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_dispatcher_getmodelbinder, 0, 0, Phalcon\\Mvc\\Model\\BinderInterface, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getmodelbinder, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\BinderInterface", 1) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_forward, 0, 0, 1) ZEND_ARG_INFO(0, forward) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_wasforwarded, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_wasforwarded, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_gethandlerclass, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_gethandlerclass, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcher_callactionmethod, 0, 0, 2) ZEND_ARG_INFO(0, handler) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionMethod, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionMethod) - ZEND_ARG_ARRAY_INFO(0, params, 1) +#endif + ZEND_ARG_ARRAY_INFO(0, params, 0) +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getboundmodels, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcher_getboundmodels, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_dispatcher_method_entry) { PHP_ME(Phalcon_Dispatcher, setDI, arginfo_phalcon_dispatcher_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getDI, arginfo_phalcon_dispatcher_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setEventsManager, arginfo_phalcon_dispatcher_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getEventsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getEventsManager, arginfo_phalcon_dispatcher_geteventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setActionSuffix, arginfo_phalcon_dispatcher_setactionsuffix, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getActionSuffix, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getActionSuffix, arginfo_phalcon_dispatcher_getactionsuffix, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setModuleName, arginfo_phalcon_dispatcher_setmodulename, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getModuleName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getModuleName, arginfo_phalcon_dispatcher_getmodulename, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setNamespaceName, arginfo_phalcon_dispatcher_setnamespacename, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getNamespaceName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getNamespaceName, arginfo_phalcon_dispatcher_getnamespacename, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setDefaultNamespace, arginfo_phalcon_dispatcher_setdefaultnamespace, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getDefaultNamespace, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getDefaultNamespace, arginfo_phalcon_dispatcher_getdefaultnamespace, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setDefaultAction, arginfo_phalcon_dispatcher_setdefaultaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setActionName, arginfo_phalcon_dispatcher_setactionname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getActionName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getActionName, arginfo_phalcon_dispatcher_getactionname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setParams, arginfo_phalcon_dispatcher_setparams, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getParams, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getParams, arginfo_phalcon_dispatcher_getparams, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setParam, arginfo_phalcon_dispatcher_setparam, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, getParam, arginfo_phalcon_dispatcher_getparam, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, hasParam, arginfo_phalcon_dispatcher_hasparam, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getActiveMethod, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, isFinished, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getActiveMethod, arginfo_phalcon_dispatcher_getactivemethod, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, isFinished, arginfo_phalcon_dispatcher_isfinished, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setReturnedValue, arginfo_phalcon_dispatcher_setreturnedvalue, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, getReturnedValue, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setModelBinding, arginfo_phalcon_dispatcher_setmodelbinding, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, setModelBinder, arginfo_phalcon_dispatcher_setmodelbinder, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getModelBinder, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getModelBinder, arginfo_phalcon_dispatcher_getmodelbinder, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, dispatch, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, forward, arginfo_phalcon_dispatcher_forward, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, wasForwarded, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getHandlerClass, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, wasForwarded, arginfo_phalcon_dispatcher_wasforwarded, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getHandlerClass, arginfo_phalcon_dispatcher_gethandlerclass, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, callActionMethod, arginfo_phalcon_dispatcher_callactionmethod, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Dispatcher, getBoundModels, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Dispatcher, getBoundModels, arginfo_phalcon_dispatcher_getboundmodels, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Dispatcher, _resolveEmptyProperties, NULL, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/dispatcherinterface.zep.h b/ext/phalcon/dispatcherinterface.zep.h index 6a3b4e10e26..60f2c97b3f7 100644 --- a/ext/phalcon/dispatcherinterface.zep.h +++ b/ext/phalcon/dispatcherinterface.zep.h @@ -4,33 +4,78 @@ extern zend_class_entry *phalcon_dispatcherinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_DispatcherInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_setactionsuffix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionSuffix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionSuffix) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_getactionsuffix, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_getactionsuffix, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_setdefaultnamespace, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultNamespace, IS_STRING, 0) +#else ZEND_ARG_INFO(0, defaultNamespace) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_setdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_setnamespacename, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespaceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespaceName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_setmodulename, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, moduleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, moduleName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_setactionname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_getactionname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_getactionname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_setparams, 0, 0, 1) ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_getparams, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_getparams, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_setparam, 0, 0, 2) ZEND_ARG_INFO(0, param) ZEND_ARG_INFO(0, value) @@ -41,29 +86,40 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_getparam, 0, 0, 1) ZEND_ARG_INFO(0, filters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_hasparam, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_hasparam, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_hasparam, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, param) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_isfinished, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_dispatcherinterface_isfinished, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_dispatcherinterface_forward, 0, 0, 1) ZEND_ARG_INFO(0, forward) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_dispatcherinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, setActionSuffix, arginfo_phalcon_dispatcherinterface_setactionsuffix) - PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, getActionSuffix, NULL) + PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, getActionSuffix, arginfo_phalcon_dispatcherinterface_getactionsuffix) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, setDefaultNamespace, arginfo_phalcon_dispatcherinterface_setdefaultnamespace) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, setDefaultAction, arginfo_phalcon_dispatcherinterface_setdefaultaction) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, setNamespaceName, arginfo_phalcon_dispatcherinterface_setnamespacename) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, setModuleName, arginfo_phalcon_dispatcherinterface_setmodulename) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, setActionName, arginfo_phalcon_dispatcherinterface_setactionname) - PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, getActionName, NULL) + PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, getActionName, arginfo_phalcon_dispatcherinterface_getactionname) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, setParams, arginfo_phalcon_dispatcherinterface_setparams) - PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, getParams, NULL) + PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, getParams, arginfo_phalcon_dispatcherinterface_getparams) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, setParam, arginfo_phalcon_dispatcherinterface_setparam) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, getParam, arginfo_phalcon_dispatcherinterface_getparam) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, hasParam, arginfo_phalcon_dispatcherinterface_hasparam) - PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, isFinished, NULL) + PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, isFinished, arginfo_phalcon_dispatcherinterface_isfinished) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, getReturnedValue, NULL) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, dispatch, NULL) PHP_ABSTRACT_ME(Phalcon_DispatcherInterface, forward, arginfo_phalcon_dispatcherinterface_forward) diff --git a/ext/phalcon/escaper.zep.c b/ext/phalcon/escaper.zep.c index 006338d281c..bd5bf44ad90 100644 --- a/ext/phalcon/escaper.zep.c +++ b/ext/phalcon/escaper.zep.c @@ -64,15 +64,18 @@ ZEPHIR_INIT_CLASS(Phalcon_Escaper) { PHP_METHOD(Phalcon_Escaper, setEncoding) { zval *encoding_param = NULL; - zval *encoding = NULL; + zval encoding; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&encoding); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &encoding_param); - zephir_get_strval(encoding, encoding_param); + zephir_get_strval(&encoding, encoding_param); - zephir_update_property_this(getThis(), SL("_encoding"), encoding TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_encoding"), &encoding); ZEPHIR_MM_RESTORE(); } @@ -82,7 +85,8 @@ PHP_METHOD(Phalcon_Escaper, setEncoding) { */ PHP_METHOD(Phalcon_Escaper, getEncoding) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_encoding"); @@ -97,8 +101,11 @@ PHP_METHOD(Phalcon_Escaper, getEncoding) { */ PHP_METHOD(Phalcon_Escaper, setHtmlQuoteType) { - zval *quoteType_param = NULL, *_0; + zval *quoteType_param = NULL, _0; zend_long quoteType; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, "eType_param); @@ -106,8 +113,8 @@ PHP_METHOD(Phalcon_Escaper, setHtmlQuoteType) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, quoteType); - zephir_update_property_this(getThis(), SL("_htmlQuoteType"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, quoteType); + zephir_update_property_zval(this_ptr, SL("_htmlQuoteType"), &_0); } @@ -120,8 +127,12 @@ PHP_METHOD(Phalcon_Escaper, setHtmlQuoteType) { */ PHP_METHOD(Phalcon_Escaper, setDoubleEncode) { - zval *doubleEncode_param = NULL; + zval *doubleEncode_param = NULL, __$true, __$false; zend_bool doubleEncode; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &doubleEncode_param); @@ -129,9 +140,9 @@ PHP_METHOD(Phalcon_Escaper, setDoubleEncode) { if (doubleEncode) { - zephir_update_property_this(getThis(), SL("_doubleEncode"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_doubleEncode"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_doubleEncode"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_doubleEncode"), &__$false); } } @@ -142,55 +153,61 @@ PHP_METHOD(Phalcon_Escaper, setDoubleEncode) { */ PHP_METHOD(Phalcon_Escaper, detectEncoding) { - HashTable *_3; - HashPosition _2; - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_6 = NULL; - zval *str_param = NULL, *charset = NULL, *_1 = NULL, **_4, *_5$$5 = NULL; - zval *str = NULL; + zephir_fcall_cache_entry *_4 = NULL; + zval *str_param = NULL, __$true, charset, _1, *_2, _3$$5; + zval str; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&str); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&charset); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &str_param); - zephir_get_strval(str, str_param); + zephir_get_strval(&str, str_param); - ZEPHIR_INIT_VAR(charset); - zephir_is_basic_charset(charset, str); - if (Z_TYPE_P(charset) == IS_STRING) { - RETURN_CCTOR(charset); + ZEPHIR_INIT_VAR(&charset); + zephir_is_basic_charset(&charset, &str); + if (Z_TYPE_P(&charset) == IS_STRING) { + RETURN_CCTOR(&charset); } - if (!((zephir_function_exists_ex(SS("mb_detect_encoding") TSRMLS_CC) == SUCCESS))) { + if (!((zephir_function_exists_ex(SL("mb_detect_encoding") TSRMLS_CC) == SUCCESS))) { RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 4, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "UTF-32", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "UTF-8", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "ISO-8859-1", 1); - zephir_array_fast_append(_0, _1); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "ASCII", 1); - zephir_array_fast_append(_0, _1); - zephir_is_iterable(_0, &_3, &_2, 0, 0, "phalcon/escaper.zep", 132); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HVALUE(charset, _4); - ZEPHIR_CALL_FUNCTION(&_5$$5, "mb_detect_encoding", &_6, 201, str, charset, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 4, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "UTF-32"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "UTF-8"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "ISO-8859-1"); + zephir_array_fast_append(&_0, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "ASCII"); + zephir_array_fast_append(&_0, &_1); + zephir_is_iterable(&_0, 0, "phalcon/escaper.zep", 132); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _2) + { + ZEPHIR_INIT_NVAR(&charset); + ZVAL_COPY(&charset, _2); + ZEPHIR_CALL_FUNCTION(&_3$$5, "mb_detect_encoding", &_4, 177, &str, &charset, &__$true); zephir_check_call_status(); - if (zephir_is_true(_5$$5)) { - RETURN_CCTOR(charset); + if (zephir_is_true(&_3$$5)) { + RETURN_CCTOR(&charset); } - } - ZEPHIR_RETURN_CALL_FUNCTION("mb_detect_encoding", &_6, 201, str); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&charset); + ZEPHIR_RETURN_CALL_FUNCTION("mb_detect_encoding", &_4, 177, &str); zephir_check_call_status(); RETURN_MM(); @@ -202,24 +219,29 @@ PHP_METHOD(Phalcon_Escaper, detectEncoding) { PHP_METHOD(Phalcon_Escaper, normalizeEncoding) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *str_param = NULL, *_0 = NULL, _1; - zval *str = NULL; + zval *str_param = NULL, _0, _1; + zval str; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&str); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &str_param); - zephir_get_strval(str, str_param); + zephir_get_strval(&str, str_param); - if (!((zephir_function_exists_ex(SS("mb_convert_encoding") TSRMLS_CC) == SUCCESS))) { + if (!((zephir_function_exists_ex(SL("mb_convert_encoding") TSRMLS_CC) == SUCCESS))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_escaper_exception_ce, "Extension 'mbstring' is required", "phalcon/escaper.zep", 144); return; } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "detectencoding", NULL, 202, str); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "detectencoding", NULL, 178, &str); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "UTF-32", 0); - ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_encoding", NULL, 203, str, &_1, _0); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "UTF-32"); + ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_encoding", NULL, 179, &str, &_1, &_0); zephir_check_call_status(); RETURN_MM(); @@ -231,19 +253,25 @@ PHP_METHOD(Phalcon_Escaper, normalizeEncoding) { PHP_METHOD(Phalcon_Escaper, escapeHtml) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *text_param = NULL, *_0, *_1, *_2; - zval *text = NULL; + zval *text_param = NULL, _0, _1, _2; + zval text; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &text_param); - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_htmlQuoteType"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_encoding"), PH_NOISY_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_doubleEncode"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 204, text, _0, _1, _2); + zephir_read_property(&_0, this_ptr, SL("_htmlQuoteType"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_encoding"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_2, this_ptr, SL("_doubleEncode"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 180, &text, &_0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); @@ -255,20 +283,25 @@ PHP_METHOD(Phalcon_Escaper, escapeHtml) { PHP_METHOD(Phalcon_Escaper, escapeHtmlAttr) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attribute_param = NULL, *_0, *_1, _2; - zval *attribute = NULL; + zval *attribute_param = NULL, _0, _1, _2; + zval attribute; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attribute_param); - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_encoding"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_doubleEncode"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_2); + zephir_read_property(&_0, this_ptr, SL("_encoding"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_doubleEncode"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_2, 3); - ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 204, attribute, &_2, _0, _1); + ZEPHIR_RETURN_CALL_FUNCTION("htmlspecialchars", NULL, 180, &attribute, &_2, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -280,18 +313,22 @@ PHP_METHOD(Phalcon_Escaper, escapeHtmlAttr) { PHP_METHOD(Phalcon_Escaper, escapeCss) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *css_param = NULL, *_0 = NULL; - zval *css = NULL; + zval *css_param = NULL, _0; + zval css; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&css); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &css_param); - zephir_get_strval(css, css_param); + zephir_get_strval(&css, css_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 205, css); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 181, &css); zephir_check_call_status(); - zephir_escape_css(return_value, _0); + zephir_escape_css(return_value, &_0); RETURN_MM(); } @@ -302,18 +339,22 @@ PHP_METHOD(Phalcon_Escaper, escapeCss) { PHP_METHOD(Phalcon_Escaper, escapeJs) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *js_param = NULL, *_0 = NULL; - zval *js = NULL; + zval *js_param = NULL, _0; + zval js; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&js); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &js_param); - zephir_get_strval(js, js_param); + zephir_get_strval(&js, js_param); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 205, js); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "normalizeencoding", NULL, 181, &js); zephir_check_call_status(); - zephir_escape_js(return_value, _0); + zephir_escape_js(return_value, &_0); RETURN_MM(); } @@ -325,15 +366,18 @@ PHP_METHOD(Phalcon_Escaper, escapeUrl) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *url_param = NULL; - zval *url = NULL; + zval url; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&url); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &url_param); - zephir_get_strval(url, url_param); + zephir_get_strval(&url, url_param); - ZEPHIR_RETURN_CALL_FUNCTION("rawurlencode", NULL, 206, url); + ZEPHIR_RETURN_CALL_FUNCTION("rawurlencode", NULL, 182, &url); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/escaper.zep.h b/ext/phalcon/escaper.zep.h index babcf7f3d36..128d42986cd 100644 --- a/ext/phalcon/escaper.zep.h +++ b/ext/phalcon/escaper.zep.h @@ -16,48 +16,123 @@ PHP_METHOD(Phalcon_Escaper, escapeJs); PHP_METHOD(Phalcon_Escaper, escapeUrl); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_setencoding, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0) +#else ZEND_ARG_INFO(0, encoding) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_getencoding, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_getencoding, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_sethtmlquotetype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quoteType, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quoteType) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_setdoubleencode, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, doubleEncode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, doubleEncode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_detectencoding, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_detectencoding, 0, 1, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_detectencoding, 0, 1, IS_STRING, NULL, 1) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +#else ZEND_ARG_INFO(0, str) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_normalizeencoding, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_normalizeencoding, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_normalizeencoding, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, str, IS_STRING, 0) +#else ZEND_ARG_INFO(0, str) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_escapehtml, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapehtml, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapehtml, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_escapehtmlattr, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapehtmlattr, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapehtmlattr, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_escapecss, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapecss, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapecss, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, css, IS_STRING, 0) +#else ZEND_ARG_INFO(0, css) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_escapejs, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapejs, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapejs, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, js, IS_STRING, 0) +#else ZEND_ARG_INFO(0, js) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaper_escapeurl, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapeurl, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaper_escapeurl, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, url, IS_STRING, 0) +#else ZEND_ARG_INFO(0, url) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_escaper_method_entry) { PHP_ME(Phalcon_Escaper, setEncoding, arginfo_phalcon_escaper_setencoding, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Escaper, getEncoding, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Escaper, getEncoding, arginfo_phalcon_escaper_getencoding, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Escaper, setHtmlQuoteType, arginfo_phalcon_escaper_sethtmlquotetype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Escaper, setDoubleEncode, arginfo_phalcon_escaper_setdoubleencode, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Escaper, detectEncoding, arginfo_phalcon_escaper_detectencoding, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) diff --git a/ext/phalcon/escaperinterface.zep.h b/ext/phalcon/escaperinterface.zep.h index 8ed1cd6eb83..38a2fe7bc0e 100644 --- a/ext/phalcon/escaperinterface.zep.h +++ b/ext/phalcon/escaperinterface.zep.h @@ -4,36 +4,91 @@ extern zend_class_entry *phalcon_escaperinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_EscaperInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_setencoding, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0) +#else ZEND_ARG_INFO(0, encoding) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_getencoding, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_getencoding, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_sethtmlquotetype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quoteType, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quoteType) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtml, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapehtml, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapehtml, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapehtmlattr, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapehtmlattr, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapehtmlattr, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapecss, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapecss, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapecss, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, css, IS_STRING, 0) +#else ZEND_ARG_INFO(0, css) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapejs, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapejs, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapejs, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, js, IS_STRING, 0) +#else ZEND_ARG_INFO(0, js) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_escaperinterface_escapeurl, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapeurl, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_escaperinterface_escapeurl, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, url, IS_STRING, 0) +#else ZEND_ARG_INFO(0, url) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_escaperinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_EscaperInterface, setEncoding, arginfo_phalcon_escaperinterface_setencoding) - PHP_ABSTRACT_ME(Phalcon_EscaperInterface, getEncoding, NULL) + PHP_ABSTRACT_ME(Phalcon_EscaperInterface, getEncoding, arginfo_phalcon_escaperinterface_getencoding) PHP_ABSTRACT_ME(Phalcon_EscaperInterface, setHtmlQuoteType, arginfo_phalcon_escaperinterface_sethtmlquotetype) PHP_ABSTRACT_ME(Phalcon_EscaperInterface, escapeHtml, arginfo_phalcon_escaperinterface_escapehtml) PHP_ABSTRACT_ME(Phalcon_EscaperInterface, escapeHtmlAttr, arginfo_phalcon_escaperinterface_escapehtmlattr) diff --git a/ext/phalcon/events/event.zep.c b/ext/phalcon/events/event.zep.c index 905727bb9fc..d344991c4d3 100644 --- a/ext/phalcon/events/event.zep.c +++ b/ext/phalcon/events/event.zep.c @@ -73,7 +73,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Events_Event) { */ PHP_METHOD(Phalcon_Events_Event, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -84,7 +85,8 @@ PHP_METHOD(Phalcon_Events_Event, getType) { */ PHP_METHOD(Phalcon_Events_Event, getSource) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_source"); @@ -95,7 +97,8 @@ PHP_METHOD(Phalcon_Events_Event, getSource) { */ PHP_METHOD(Phalcon_Events_Event, getData) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_data"); @@ -112,24 +115,33 @@ PHP_METHOD(Phalcon_Events_Event, getData) { PHP_METHOD(Phalcon_Events_Event, __construct) { zend_bool cancelable; - zval *type_param = NULL, *source, *data = NULL, *cancelable_param = NULL; - zval *type = NULL; + zval *type_param = NULL, *source, source_sub, *data = NULL, data_sub, *cancelable_param = NULL, __$true, __$false, __$null; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&source_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 2, &type_param, &source, &data, &cancelable_param); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } if (!cancelable_param) { cancelable = 1; @@ -138,16 +150,16 @@ PHP_METHOD(Phalcon_Events_Event, __construct) { } - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_source"), source TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), &type); + zephir_update_property_zval(this_ptr, SL("_source"), source); if (Z_TYPE_P(data) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_data"), data TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_data"), data); } if (cancelable != 1) { if (cancelable) { - zephir_update_property_this(getThis(), SL("_cancelable"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cancelable"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_cancelable"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cancelable"), &__$false); } } ZEPHIR_MM_RESTORE(); @@ -160,16 +172,21 @@ PHP_METHOD(Phalcon_Events_Event, __construct) { */ PHP_METHOD(Phalcon_Events_Event, setData) { - zval *data = NULL; + zval *data = NULL, data_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &data); if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } - zephir_update_property_this(getThis(), SL("_data"), data TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_data"), data); RETURN_THISW(); } @@ -180,24 +197,27 @@ PHP_METHOD(Phalcon_Events_Event, setData) { PHP_METHOD(Phalcon_Events_Event, setType) { zval *type_param = NULL; - zval *type = NULL; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &type_param); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), &type); RETURN_THIS(); } @@ -213,18 +233,23 @@ PHP_METHOD(Phalcon_Events_Event, setType) { */ PHP_METHOD(Phalcon_Events_Event, stop) { - zval *_0; + zval __$true, __$false, _0; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_cancelable"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_cancelable"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_events_exception_ce, "Trying to cancel a non-cancelable event", "phalcon/events/event.zep", 119); return; } if (1) { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$false); } RETURN_THISW(); @@ -235,7 +260,8 @@ PHP_METHOD(Phalcon_Events_Event, stop) { */ PHP_METHOD(Phalcon_Events_Event, isStopped) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_stopped"); @@ -252,7 +278,8 @@ PHP_METHOD(Phalcon_Events_Event, isStopped) { */ PHP_METHOD(Phalcon_Events_Event, isCancelable) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_cancelable"); diff --git a/ext/phalcon/events/event.zep.h b/ext/phalcon/events/event.zep.h index 5c3d14b06b9..c0848993a2e 100644 --- a/ext/phalcon/events/event.zep.h +++ b/ext/phalcon/events/event.zep.h @@ -13,30 +13,78 @@ PHP_METHOD(Phalcon_Events_Event, stop); PHP_METHOD(Phalcon_Events_Event, isStopped); PHP_METHOD(Phalcon_Events_Event, isCancelable); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_event_gettype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_event_gettype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_event___construct, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, data) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cancelable, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, cancelable) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_event_setdata, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_events_event_setdata, 0, 0, Phalcon\\Events\\EventInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_event_setdata, 0, 0, IS_OBJECT, "Phalcon\\Events\\EventInterface", 0) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_event_settype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_events_event_settype, 0, 1, Phalcon\\Events\\EventInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_event_settype, 0, 1, IS_OBJECT, "Phalcon\\Events\\EventInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_events_event_stop, 0, 0, Phalcon\\Events\\EventInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_event_stop, 0, 0, IS_OBJECT, "Phalcon\\Events\\EventInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_event_isstopped, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_event_isstopped, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_event_iscancelable, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_event_iscancelable, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_events_event_method_entry) { - PHP_ME(Phalcon_Events_Event, getType, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Events_Event, getType, arginfo_phalcon_events_event_gettype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Event, getSource, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Event, getData, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Event, __construct, arginfo_phalcon_events_event___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Events_Event, setData, arginfo_phalcon_events_event_setdata, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Event, setType, arginfo_phalcon_events_event_settype, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Events_Event, stop, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Events_Event, isStopped, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Events_Event, isCancelable, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Events_Event, stop, arginfo_phalcon_events_event_stop, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Events_Event, isStopped, arginfo_phalcon_events_event_isstopped, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Events_Event, isCancelable, arginfo_phalcon_events_event_iscancelable, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/events/eventinterface.zep.h b/ext/phalcon/events/eventinterface.zep.h index 14664866c5b..fdd6cba5b31 100644 --- a/ext/phalcon/events/eventinterface.zep.h +++ b/ext/phalcon/events/eventinterface.zep.h @@ -3,12 +3,45 @@ extern zend_class_entry *phalcon_events_eventinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Events_EventInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_eventinterface_setdata, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_events_eventinterface_setdata, 0, 0, Phalcon\\Events\\EventInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_eventinterface_setdata, 0, 0, IS_OBJECT, "Phalcon\\Events\\EventInterface", 0) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_eventinterface_settype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_events_eventinterface_settype, 0, 1, Phalcon\\Events\\EventInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_eventinterface_settype, 0, 1, IS_OBJECT, "Phalcon\\Events\\EventInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_events_eventinterface_stop, 0, 0, Phalcon\\Events\\EventInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_eventinterface_stop, 0, 0, IS_OBJECT, "Phalcon\\Events\\EventInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_eventinterface_isstopped, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_eventinterface_isstopped, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_eventinterface_iscancelable, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_eventinterface_iscancelable, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_events_eventinterface_method_entry) { @@ -16,8 +49,8 @@ ZEPHIR_INIT_FUNCS(phalcon_events_eventinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Events_EventInterface, setData, arginfo_phalcon_events_eventinterface_setdata) PHP_ABSTRACT_ME(Phalcon_Events_EventInterface, getType, NULL) PHP_ABSTRACT_ME(Phalcon_Events_EventInterface, setType, arginfo_phalcon_events_eventinterface_settype) - PHP_ABSTRACT_ME(Phalcon_Events_EventInterface, stop, NULL) - PHP_ABSTRACT_ME(Phalcon_Events_EventInterface, isStopped, NULL) - PHP_ABSTRACT_ME(Phalcon_Events_EventInterface, isCancelable, NULL) + PHP_ABSTRACT_ME(Phalcon_Events_EventInterface, stop, arginfo_phalcon_events_eventinterface_stop) + PHP_ABSTRACT_ME(Phalcon_Events_EventInterface, isStopped, arginfo_phalcon_events_eventinterface_isstopped) + PHP_ABSTRACT_ME(Phalcon_Events_EventInterface, isCancelable, arginfo_phalcon_events_eventinterface_iscancelable) PHP_FE_END }; diff --git a/ext/phalcon/events/eventsawareinterface.zep.h b/ext/phalcon/events/eventsawareinterface.zep.h index 7c4d0ef921f..02cdb675fb2 100644 --- a/ext/phalcon/events/eventsawareinterface.zep.h +++ b/ext/phalcon/events/eventsawareinterface.zep.h @@ -7,8 +7,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_eventsawareinterface_seteventsmana ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_events_eventsawareinterface_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_eventsawareinterface_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_events_eventsawareinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Events_EventsAwareInterface, setEventsManager, arginfo_phalcon_events_eventsawareinterface_seteventsmanager) - PHP_ABSTRACT_ME(Phalcon_Events_EventsAwareInterface, getEventsManager, NULL) + PHP_ABSTRACT_ME(Phalcon_Events_EventsAwareInterface, getEventsManager, arginfo_phalcon_events_eventsawareinterface_geteventsmanager) PHP_FE_END }; diff --git a/ext/phalcon/events/manager.zep.c b/ext/phalcon/events/manager.zep.c index 16523208767..9603c55c44a 100644 --- a/ext/phalcon/events/manager.zep.c +++ b/ext/phalcon/events/manager.zep.c @@ -60,27 +60,36 @@ ZEPHIR_INIT_CLASS(Phalcon_Events_Manager) { PHP_METHOD(Phalcon_Events_Manager, attach) { zend_long priority, ZEPHIR_LAST_CALL_STATUS; - zval *eventType_param = NULL, *handler, *priority_param = NULL, *priorityQueue = NULL, *_0, *_1$$4, *_2$$5, *_3$$7; - zval *eventType = NULL; + zval *eventType_param = NULL, *handler, handler_sub, *priority_param = NULL, priorityQueue, _0, _1$$4, _2$$5, _3$$7; + zval eventType; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventType); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&priorityQueue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &eventType_param, &handler, &priority_param); if (UNEXPECTED(Z_TYPE_P(eventType_param) != IS_STRING && Z_TYPE_P(eventType_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventType_param) == IS_STRING)) { - zephir_get_strval(eventType, eventType_param); + zephir_get_strval(&eventType, eventType_param); } else { - ZEPHIR_INIT_VAR(eventType); - ZVAL_EMPTY_STRING(eventType); + ZEPHIR_INIT_VAR(&eventType); + ZVAL_EMPTY_STRING(&eventType); } if (!priority_param) { priority = 100; } else { if (UNEXPECTED(Z_TYPE_P(priority_param) != IS_LONG)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'priority' must be a int") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'priority' must be of the type int") TSRMLS_CC); RETURN_MM_NULL(); } priority = Z_LVAL_P(priority_param); @@ -91,34 +100,32 @@ PHP_METHOD(Phalcon_Events_Manager, attach) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object", "phalcon/events/manager.zep", 56); return; } - ZEPHIR_OBS_VAR(priorityQueue); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_events"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&priorityQueue, _0, eventType, 0 TSRMLS_CC))) { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_enablePriorities"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(priorityQueue); - if (zephir_is_true(_1$$4)) { - object_init_ex(priorityQueue, spl_ce_SplPriorityQueue); - if (zephir_has_constructor(priorityQueue TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, priorityQueue, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&priorityQueue); + zephir_read_property(&_0, this_ptr, SL("_events"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&priorityQueue, &_0, &eventType, 0 TSRMLS_CC))) { + zephir_read_property(&_1$$4, this_ptr, SL("_enablePriorities"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&priorityQueue); + if (zephir_is_true(&_1$$4)) { + object_init_ex(&priorityQueue, spl_ce_SplPriorityQueue); + if (zephir_has_constructor(&priorityQueue TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_2$$5); - ZVAL_LONG(_2$$5, 1); - ZEPHIR_CALL_METHOD(NULL, priorityQueue, "setextractflags", NULL, 207, _2$$5); + ZVAL_LONG(&_2$$5, 1); + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 183, &_2$$5); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_events"), eventType, priorityQueue TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_events"), &eventType, &priorityQueue TSRMLS_CC); } else { - array_init(priorityQueue); + array_init(&priorityQueue); } } - if (Z_TYPE_P(priorityQueue) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_3$$7); - ZVAL_LONG(_3$$7, priority); - ZEPHIR_CALL_METHOD(NULL, priorityQueue, "insert", NULL, 208, handler, _3$$7); + if (Z_TYPE_P(&priorityQueue) == IS_OBJECT) { + ZVAL_LONG(&_3$$7, priority); + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "insert", NULL, 184, handler, &_3$$7); zephir_check_call_status(); } else { zephir_array_append(&priorityQueue, handler, PH_SEPARATE, "phalcon/events/manager.zep", 82); - zephir_update_property_array(this_ptr, SL("_events"), eventType, priorityQueue TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_events"), &eventType, &priorityQueue TSRMLS_CC); } ZEPHIR_MM_RESTORE(); @@ -134,21 +141,36 @@ PHP_METHOD(Phalcon_Events_Manager, detach) { zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL, *_8 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventType_param = NULL, *handler, *priorityQueue = NULL, *newPriorityQueue = NULL, *key = NULL, *data = NULL, *_0, *_1$$5 = NULL, *_2$$5 = NULL, *_5$$6, *_6$$7, *_7$$7; - zval *eventType = NULL; + zval *eventType_param = NULL, *handler, handler_sub, __$true, priorityQueue, newPriorityQueue, key, data, _0, _1$$5, _2$$5, _5$$6, _6$$7, _7$$7; + zval eventType; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventType); + ZVAL_UNDEF(&handler_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&priorityQueue); + ZVAL_UNDEF(&newPriorityQueue); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &eventType_param, &handler); if (UNEXPECTED(Z_TYPE_P(eventType_param) != IS_STRING && Z_TYPE_P(eventType_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventType_param) == IS_STRING)) { - zephir_get_strval(eventType, eventType_param); + zephir_get_strval(&eventType, eventType_param); } else { - ZEPHIR_INIT_VAR(eventType); - ZVAL_EMPTY_STRING(eventType); + ZEPHIR_INIT_VAR(&eventType); + ZVAL_EMPTY_STRING(&eventType); } @@ -156,52 +178,50 @@ PHP_METHOD(Phalcon_Events_Manager, detach) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "Event handler must be an Object", "phalcon/events/manager.zep", 99); return; } - ZEPHIR_OBS_VAR(priorityQueue); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_events"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&priorityQueue, _0, eventType, 0 TSRMLS_CC)) { - if (Z_TYPE_P(priorityQueue) == IS_OBJECT) { - ZEPHIR_INIT_VAR(newPriorityQueue); - object_init_ex(newPriorityQueue, spl_ce_SplPriorityQueue); - if (zephir_has_constructor(newPriorityQueue TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, newPriorityQueue, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&priorityQueue); + zephir_read_property(&_0, this_ptr, SL("_events"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&priorityQueue, &_0, &eventType, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&priorityQueue) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&newPriorityQueue); + object_init_ex(&newPriorityQueue, spl_ce_SplPriorityQueue); + if (zephir_has_constructor(&newPriorityQueue TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_LONG(_1$$5, 1); - ZEPHIR_CALL_METHOD(NULL, newPriorityQueue, "setextractflags", NULL, 207, _1$$5); + ZVAL_LONG(&_1$$5, 1); + ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "setextractflags", NULL, 183, &_1$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_1$$5); - ZVAL_LONG(_1$$5, 3); - ZEPHIR_CALL_METHOD(NULL, priorityQueue, "setextractflags", NULL, 0, _1$$5); + ZVAL_LONG(&_1$$5, 3); + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "setextractflags", NULL, 0, &_1$$5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, priorityQueue, "top", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "top", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_2$$5, priorityQueue, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_2$$5, &priorityQueue, "valid", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_2$$5))) { + if (!(zephir_is_true(&_2$$5))) { break; } - ZEPHIR_CALL_METHOD(&data, priorityQueue, "current", &_3, 0); + ZEPHIR_CALL_METHOD(&data, &priorityQueue, "current", &_3, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, priorityQueue, "next", &_4, 0); + ZEPHIR_CALL_METHOD(NULL, &priorityQueue, "next", &_4, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_5$$6, data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/events/manager.zep", 116 TSRMLS_CC); - if (!ZEPHIR_IS_IDENTICAL(_5$$6, handler)) { - zephir_array_fetch_string(&_6$$7, data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/events/manager.zep", 117 TSRMLS_CC); - zephir_array_fetch_string(&_7$$7, data, SL("priority"), PH_NOISY | PH_READONLY, "phalcon/events/manager.zep", 117 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, newPriorityQueue, "insert", &_8, 208, _6$$7, _7$$7); + zephir_array_fetch_string(&_5$$6, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/events/manager.zep", 116 TSRMLS_CC); + if (!ZEPHIR_IS_IDENTICAL(&_5$$6, handler)) { + zephir_array_fetch_string(&_6$$7, &data, SL("data"), PH_NOISY | PH_READONLY, "phalcon/events/manager.zep", 117 TSRMLS_CC); + zephir_array_fetch_string(&_7$$7, &data, SL("priority"), PH_NOISY | PH_READONLY, "phalcon/events/manager.zep", 117 TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &newPriorityQueue, "insert", &_8, 184, &_6$$7, &_7$$7); zephir_check_call_status(); } } - zephir_update_property_array(this_ptr, SL("_events"), eventType, newPriorityQueue TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_events"), &eventType, &newPriorityQueue TSRMLS_CC); } else { - ZEPHIR_CALL_FUNCTION(&key, "array_search", NULL, 209, handler, priorityQueue, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(&key, "array_search", NULL, 185, handler, &priorityQueue, &__$true); zephir_check_call_status(); - if (!ZEPHIR_IS_FALSE_IDENTICAL(key)) { - zephir_array_unset(&priorityQueue, key, PH_SEPARATE); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&key)) { + zephir_array_unset(&priorityQueue, &key, PH_SEPARATE); } - zephir_update_property_array(this_ptr, SL("_events"), eventType, priorityQueue TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_events"), &eventType, &priorityQueue TSRMLS_CC); } } ZEPHIR_MM_RESTORE(); @@ -213,8 +233,12 @@ PHP_METHOD(Phalcon_Events_Manager, detach) { */ PHP_METHOD(Phalcon_Events_Manager, enablePriorities) { - zval *enablePriorities_param = NULL; + zval *enablePriorities_param = NULL, __$true, __$false; zend_bool enablePriorities; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &enablePriorities_param); @@ -222,9 +246,9 @@ PHP_METHOD(Phalcon_Events_Manager, enablePriorities) { if (enablePriorities) { - zephir_update_property_this(getThis(), SL("_enablePriorities"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_enablePriorities"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_enablePriorities"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_enablePriorities"), &__$false); } } @@ -234,7 +258,8 @@ PHP_METHOD(Phalcon_Events_Manager, enablePriorities) { */ PHP_METHOD(Phalcon_Events_Manager, arePrioritiesEnabled) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_enablePriorities"); @@ -246,8 +271,12 @@ PHP_METHOD(Phalcon_Events_Manager, arePrioritiesEnabled) { */ PHP_METHOD(Phalcon_Events_Manager, collectResponses) { - zval *collect_param = NULL; + zval *collect_param = NULL, __$true, __$false; zend_bool collect; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &collect_param); @@ -255,9 +284,9 @@ PHP_METHOD(Phalcon_Events_Manager, collectResponses) { if (collect) { - zephir_update_property_this(getThis(), SL("_collect"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_collect"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_collect"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_collect"), &__$false); } } @@ -268,7 +297,8 @@ PHP_METHOD(Phalcon_Events_Manager, collectResponses) { */ PHP_METHOD(Phalcon_Events_Manager, isCollecting) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_collect"); @@ -281,7 +311,8 @@ PHP_METHOD(Phalcon_Events_Manager, isCollecting) { */ PHP_METHOD(Phalcon_Events_Manager, getResponses) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_responses"); @@ -292,36 +323,42 @@ PHP_METHOD(Phalcon_Events_Manager, getResponses) { */ PHP_METHOD(Phalcon_Events_Manager, detachAll) { - zval *type_param = NULL, *_0$$4, *_1$$5; - zval *type = NULL; + zval *type_param = NULL, __$null, _0$$4, _1$$5; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &type_param); if (!type_param) { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_STRING(&type, ""); } else { if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } } - if (ZEPHIR_IS_STRING_IDENTICAL(type, "")) { - zephir_update_property_this(getThis(), SL("_events"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + if (ZEPHIR_IS_STRING_IDENTICAL(&type, "")) { + zephir_update_property_zval(this_ptr, SL("_events"), &__$null); } else { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_events"), PH_NOISY_CC); - if (zephir_array_isset(_0$$4, type)) { - _1$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_events"), PH_NOISY_CC); - zephir_array_unset(&_1$$5, type, PH_SEPARATE); + zephir_read_property(&_0$$4, this_ptr, SL("_events"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_0$$4, &type)) { + zephir_read_property(&_1$$5, this_ptr, SL("_events"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_1$$5, &type, PH_SEPARATE); } } ZEPHIR_MM_RESTORE(); @@ -337,12 +374,32 @@ PHP_METHOD(Phalcon_Events_Manager, detachAll) { */ PHP_METHOD(Phalcon_Events_Manager, fireQueue) { - HashTable *_12$$21; - HashPosition _11$$21; zend_bool collect = 0, cancelable = 0; zephir_fcall_cache_entry *_7 = NULL, *_8 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *queue, *event, *status = NULL, *arguments = NULL, *eventName = NULL, *data = NULL, *iterator = NULL, *source = NULL, *handler = NULL, *_4 = NULL, *_5, *_0$$5, *_1$$5, _2$$5, *_3$$5 = NULL, *_6$$8 = NULL, *_9$$14 = NULL, *_10$$19 = NULL, **_13$$21, *_14$$27 = NULL, *_15$$32 = NULL; + zval *queue, queue_sub, *event, event_sub, status, arguments, eventName, data, iterator, source, handler, _4, _5, _0$$5, _1$$5, _2$$5, _3$$5, _6$$8, _9$$14, _10$$19, *_11$$21, _12$$27, _13$$32; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&queue_sub); + ZVAL_UNDEF(&event_sub); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&iterator); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_9$$14); + ZVAL_UNDEF(&_10$$19); + ZVAL_UNDEF(&_12$$27); + ZVAL_UNDEF(&_13$$32); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &queue, &event); @@ -352,17 +409,17 @@ PHP_METHOD(Phalcon_Events_Manager, fireQueue) { if (Z_TYPE_P(queue) != IS_ARRAY) { if (Z_TYPE_P(queue) == IS_OBJECT) { if (!(zephir_instance_of_ev(queue, spl_ce_SplPriorityQueue TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$5); - object_init_ex(_0$$5, phalcon_events_exception_ce); - ZEPHIR_INIT_VAR(_1$$5); - zephir_get_class(_1$$5, queue, 0 TSRMLS_CC); - ZEPHIR_SINIT_VAR(_2$$5); - ZVAL_STRING(&_2$$5, "Unexpected value type: expected object of type SplPriorityQueue, %s given", 0); - ZEPHIR_CALL_FUNCTION(&_3$$5, "sprintf", NULL, 164, &_2$$5, _1$$5); + ZEPHIR_INIT_VAR(&_0$$5); + object_init_ex(&_0$$5, phalcon_events_exception_ce); + ZEPHIR_INIT_VAR(&_1$$5); + zephir_get_class(&_1$$5, queue, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$5); + ZVAL_STRING(&_2$$5, "Unexpected value type: expected object of type SplPriorityQueue, %s given"); + ZEPHIR_CALL_FUNCTION(&_3$$5, "sprintf", NULL, 145, &_2$$5, &_1$$5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _0$$5, "__construct", NULL, 9, _3$$5); + ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 4, &_3$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$5, "phalcon/events/manager.zep", 210 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$5, "phalcon/events/manager.zep", 210 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -371,13 +428,13 @@ PHP_METHOD(Phalcon_Events_Manager, fireQueue) { return; } } - ZEPHIR_INIT_VAR(status); - ZVAL_NULL(status); - ZEPHIR_INIT_VAR(arguments); - ZVAL_NULL(arguments); + ZEPHIR_INIT_VAR(&status); + ZVAL_NULL(&status); + ZEPHIR_INIT_VAR(&arguments); + ZVAL_NULL(&arguments); ZEPHIR_CALL_METHOD(&eventName, event, "gettype", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(eventName) != IS_STRING) { + if (Z_TYPE_P(&eventName) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_events_exception_ce, "The event type not valid", "phalcon/events/manager.zep", 222); return; } @@ -387,60 +444,60 @@ PHP_METHOD(Phalcon_Events_Manager, fireQueue) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_4, event, "iscancelable", NULL, 0); zephir_check_call_status(); - cancelable = zephir_get_boolval(_4); - ZEPHIR_OBS_VAR(_5); - zephir_read_property_this(&_5, this_ptr, SL("_collect"), PH_NOISY_CC); - collect = zephir_get_boolval(_5); + cancelable = zephir_get_boolval(&_4); + ZEPHIR_OBS_VAR(&_5); + zephir_read_property(&_5, this_ptr, SL("_collect"), PH_NOISY_CC); + collect = zephir_get_boolval(&_5); if (Z_TYPE_P(queue) == IS_OBJECT) { - ZEPHIR_INIT_VAR(iterator); - if (zephir_clone(iterator, queue TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&iterator); + if (zephir_clone(&iterator, queue TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_CALL_METHOD(NULL, iterator, "top", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &iterator, "top", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_6$$8, iterator, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_6$$8, &iterator, "valid", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_6$$8))) { + if (!(zephir_is_true(&_6$$8))) { break; } - ZEPHIR_CALL_METHOD(&handler, iterator, "current", &_7, 0); + ZEPHIR_CALL_METHOD(&handler, &iterator, "current", &_7, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, iterator, "next", &_8, 0); + ZEPHIR_CALL_METHOD(NULL, &iterator, "next", &_8, 0); zephir_check_call_status(); - if (Z_TYPE_P(handler) == IS_OBJECT) { - if (zephir_instance_of_ev(handler, zend_ce_closure TSRMLS_CC)) { - if (Z_TYPE_P(arguments) == IS_NULL) { - ZEPHIR_INIT_NVAR(arguments); - zephir_create_array(arguments, 3, 0 TSRMLS_CC); - zephir_array_fast_append(arguments, event); - zephir_array_fast_append(arguments, source); - zephir_array_fast_append(arguments, data); + if (Z_TYPE_P(&handler) == IS_OBJECT) { + if (zephir_instance_of_ev(&handler, zend_ce_closure TSRMLS_CC)) { + if (Z_TYPE_P(&arguments) == IS_NULL) { + ZEPHIR_INIT_NVAR(&arguments); + zephir_create_array(&arguments, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&arguments, event); + zephir_array_fast_append(&arguments, &source); + zephir_array_fast_append(&arguments, &data); } - ZEPHIR_INIT_NVAR(status); - ZEPHIR_CALL_USER_FUNC_ARRAY(status, handler, arguments); + ZEPHIR_INIT_NVAR(&status); + ZEPHIR_CALL_USER_FUNC_ARRAY(&status, &handler, &arguments); zephir_check_call_status(); if (collect) { - zephir_update_property_array_append(this_ptr, SL("_responses"), status TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_responses"), &status TSRMLS_CC); } if (cancelable) { ZEPHIR_CALL_METHOD(&_9$$14, event, "isstopped", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_9$$14)) { + if (zephir_is_true(&_9$$14)) { break; } } } else { - if ((zephir_method_exists(handler, eventName TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(&status, handler, eventName, NULL, 0, event, source, data); + if ((zephir_method_exists(&handler, &eventName TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD_ZVAL(&status, &handler, &eventName, NULL, 0, event, &source, &data); zephir_check_call_status(); if (collect) { - zephir_update_property_array_append(this_ptr, SL("_responses"), status TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_responses"), &status TSRMLS_CC); } if (cancelable) { ZEPHIR_CALL_METHOD(&_10$$19, event, "isstopped", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_10$$19)) { + if (zephir_is_true(&_10$$19)) { break; } } @@ -449,54 +506,54 @@ PHP_METHOD(Phalcon_Events_Manager, fireQueue) { } } } else { - zephir_is_iterable(queue, &_12$$21, &_11$$21, 0, 0, "phalcon/events/manager.zep", 358); - for ( - ; zend_hash_get_current_data_ex(_12$$21, (void**) &_13$$21, &_11$$21) == SUCCESS - ; zend_hash_move_forward_ex(_12$$21, &_11$$21) - ) { - ZEPHIR_GET_HVALUE(handler, _13$$21); - if (Z_TYPE_P(handler) == IS_OBJECT) { - if (zephir_instance_of_ev(handler, zend_ce_closure TSRMLS_CC)) { - if (Z_TYPE_P(arguments) == IS_NULL) { - ZEPHIR_INIT_NVAR(arguments); - zephir_create_array(arguments, 3, 0 TSRMLS_CC); - zephir_array_fast_append(arguments, event); - zephir_array_fast_append(arguments, source); - zephir_array_fast_append(arguments, data); + zephir_is_iterable(queue, 0, "phalcon/events/manager.zep", 358); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(queue), _11$$21) + { + ZEPHIR_INIT_NVAR(&handler); + ZVAL_COPY(&handler, _11$$21); + if (Z_TYPE_P(&handler) == IS_OBJECT) { + if (zephir_instance_of_ev(&handler, zend_ce_closure TSRMLS_CC)) { + if (Z_TYPE_P(&arguments) == IS_NULL) { + ZEPHIR_INIT_NVAR(&arguments); + zephir_create_array(&arguments, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&arguments, event); + zephir_array_fast_append(&arguments, &source); + zephir_array_fast_append(&arguments, &data); } - ZEPHIR_INIT_NVAR(status); - ZEPHIR_CALL_USER_FUNC_ARRAY(status, handler, arguments); + ZEPHIR_INIT_NVAR(&status); + ZEPHIR_CALL_USER_FUNC_ARRAY(&status, &handler, &arguments); zephir_check_call_status(); if (collect) { - zephir_update_property_array_append(this_ptr, SL("_responses"), status TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_responses"), &status TSRMLS_CC); } if (cancelable) { - ZEPHIR_CALL_METHOD(&_14$$27, event, "isstopped", NULL, 0); + ZEPHIR_CALL_METHOD(&_12$$27, event, "isstopped", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_14$$27)) { + if (zephir_is_true(&_12$$27)) { break; } } } else { - if ((zephir_method_exists(handler, eventName TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(&status, handler, eventName, NULL, 0, event, source, data); + if ((zephir_method_exists(&handler, &eventName TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD_ZVAL(&status, &handler, &eventName, NULL, 0, event, &source, &data); zephir_check_call_status(); if (collect) { - zephir_update_property_array_append(this_ptr, SL("_responses"), status TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_responses"), &status TSRMLS_CC); } if (cancelable) { - ZEPHIR_CALL_METHOD(&_15$$32, event, "isstopped", NULL, 0); + ZEPHIR_CALL_METHOD(&_13$$32, event, "isstopped", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_15$$32)) { + if (zephir_is_true(&_13$$32)) { break; } } } } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&handler); } - RETURN_CCTOR(status); + RETURN_CCTOR(&status); } @@ -517,24 +574,43 @@ PHP_METHOD(Phalcon_Events_Manager, fire) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool cancelable, _3$$6, _5$$8; - zval *eventType_param = NULL, *source, *data = NULL, *cancelable_param = NULL, *events = NULL, *eventParts = NULL, *type = NULL, *eventName = NULL, *event = NULL, *status = NULL, *fireEvents = NULL, *_2, *_0$$4, *_4$$7, *_6$$10; - zval *eventType = NULL, *_1$$4; + zval *eventType_param = NULL, *source, source_sub, *data = NULL, data_sub, *cancelable_param = NULL, __$null, events, eventParts, type, eventName, event, status, fireEvents, _2, _0$$4, _4$$7, _6$$10; + zval eventType, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventType); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&source_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&events); + ZVAL_UNDEF(&eventParts); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&event); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&fireEvents); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_6$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 2, &eventType_param, &source, &data, &cancelable_param); if (UNEXPECTED(Z_TYPE_P(eventType_param) != IS_STRING && Z_TYPE_P(eventType_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventType' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventType_param) == IS_STRING)) { - zephir_get_strval(eventType, eventType_param); + zephir_get_strval(&eventType, eventType_param); } else { - ZEPHIR_INIT_VAR(eventType); - ZVAL_EMPTY_STRING(eventType); + ZEPHIR_INIT_VAR(&eventType); + ZVAL_EMPTY_STRING(&eventType); } if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } if (!cancelable_param) { cancelable = 1; @@ -543,81 +619,79 @@ PHP_METHOD(Phalcon_Events_Manager, fire) { } - ZEPHIR_OBS_VAR(events); - zephir_read_property_this(&events, this_ptr, SL("_events"), PH_NOISY_CC); - if (Z_TYPE_P(events) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&events); + zephir_read_property(&events, this_ptr, SL("_events"), PH_NOISY_CC); + if (Z_TYPE_P(&events) != IS_ARRAY) { RETURN_MM_NULL(); } - if (!(zephir_memnstr_str(eventType, SL(":"), "phalcon/events/manager.zep", 386))) { - ZEPHIR_INIT_VAR(_0$$4); - object_init_ex(_0$$4, phalcon_events_exception_ce); - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_SV(_1$$4, "Invalid event type ", eventType); - ZEPHIR_CALL_METHOD(NULL, _0$$4, "__construct", NULL, 9, _1$$4); + if (!(zephir_memnstr_str(&eventType, SL(":"), "phalcon/events/manager.zep", 386))) { + ZEPHIR_INIT_VAR(&_0$$4); + object_init_ex(&_0$$4, phalcon_events_exception_ce); + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_SV(&_1$$4, "Invalid event type ", &eventType); + ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 4, &_1$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$4, "phalcon/events/manager.zep", 387 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$4, "phalcon/events/manager.zep", 387 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(eventParts); - zephir_fast_explode_str(eventParts, SL(":"), eventType, LONG_MAX TSRMLS_CC); - ZEPHIR_OBS_VAR(type); - zephir_array_fetch_long(&type, eventParts, 0, PH_NOISY, "phalcon/events/manager.zep", 391 TSRMLS_CC); - ZEPHIR_OBS_VAR(eventName); - zephir_array_fetch_long(&eventName, eventParts, 1, PH_NOISY, "phalcon/events/manager.zep", 392 TSRMLS_CC); - ZEPHIR_INIT_VAR(status); - ZVAL_NULL(status); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_collect"), PH_NOISY_CC); - if (zephir_is_true(_2)) { - zephir_update_property_this(getThis(), SL("_responses"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); - } - ZEPHIR_INIT_VAR(event); - ZVAL_NULL(event); - ZEPHIR_OBS_VAR(fireEvents); - if (zephir_array_isset_fetch(&fireEvents, events, type, 0 TSRMLS_CC)) { - _3$$6 = Z_TYPE_P(fireEvents) == IS_OBJECT; + ZEPHIR_INIT_VAR(&eventParts); + zephir_fast_explode_str(&eventParts, SL(":"), &eventType, LONG_MAX TSRMLS_CC); + ZEPHIR_OBS_VAR(&type); + zephir_array_fetch_long(&type, &eventParts, 0, PH_NOISY, "phalcon/events/manager.zep", 391 TSRMLS_CC); + ZEPHIR_OBS_VAR(&eventName); + zephir_array_fetch_long(&eventName, &eventParts, 1, PH_NOISY, "phalcon/events/manager.zep", 392 TSRMLS_CC); + ZEPHIR_INIT_VAR(&status); + ZVAL_NULL(&status); + zephir_read_property(&_2, this_ptr, SL("_collect"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_2)) { + zephir_update_property_zval(this_ptr, SL("_responses"), &__$null); + } + ZEPHIR_INIT_VAR(&event); + ZVAL_NULL(&event); + ZEPHIR_OBS_VAR(&fireEvents); + if (zephir_array_isset_fetch(&fireEvents, &events, &type, 0 TSRMLS_CC)) { + _3$$6 = Z_TYPE_P(&fireEvents) == IS_OBJECT; if (!(_3$$6)) { - _3$$6 = Z_TYPE_P(fireEvents) == IS_ARRAY; + _3$$6 = Z_TYPE_P(&fireEvents) == IS_ARRAY; } if (_3$$6) { - ZEPHIR_INIT_NVAR(event); - object_init_ex(event, phalcon_events_event_ce); - ZEPHIR_INIT_VAR(_4$$7); + ZEPHIR_INIT_NVAR(&event); + object_init_ex(&event, phalcon_events_event_ce); if (cancelable) { - ZVAL_BOOL(_4$$7, 1); + ZVAL_BOOL(&_4$$7, 1); } else { - ZVAL_BOOL(_4$$7, 0); + ZVAL_BOOL(&_4$$7, 0); } - ZEPHIR_CALL_METHOD(NULL, event, "__construct", NULL, 210, eventName, source, data, _4$$7); + ZEPHIR_CALL_METHOD(NULL, &event, "__construct", NULL, 186, &eventName, source, data, &_4$$7); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 211, fireEvents, event); + ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 187, &fireEvents, &event); zephir_check_call_status(); } } - ZEPHIR_OBS_NVAR(fireEvents); - if (zephir_array_isset_fetch(&fireEvents, events, eventType, 0 TSRMLS_CC)) { - _5$$8 = Z_TYPE_P(fireEvents) == IS_OBJECT; + ZEPHIR_OBS_NVAR(&fireEvents); + if (zephir_array_isset_fetch(&fireEvents, &events, &eventType, 0 TSRMLS_CC)) { + _5$$8 = Z_TYPE_P(&fireEvents) == IS_OBJECT; if (!(_5$$8)) { - _5$$8 = Z_TYPE_P(fireEvents) == IS_ARRAY; + _5$$8 = Z_TYPE_P(&fireEvents) == IS_ARRAY; } if (_5$$8) { - if (Z_TYPE_P(event) == IS_NULL) { - ZEPHIR_INIT_NVAR(event); - object_init_ex(event, phalcon_events_event_ce); - ZEPHIR_INIT_VAR(_6$$10); + if (Z_TYPE_P(&event) == IS_NULL) { + ZEPHIR_INIT_NVAR(&event); + object_init_ex(&event, phalcon_events_event_ce); if (cancelable) { - ZVAL_BOOL(_6$$10, 1); + ZVAL_BOOL(&_6$$10, 1); } else { - ZVAL_BOOL(_6$$10, 0); + ZVAL_BOOL(&_6$$10, 0); } - ZEPHIR_CALL_METHOD(NULL, event, "__construct", NULL, 210, eventName, source, data, _6$$10); + ZEPHIR_CALL_METHOD(NULL, &event, "__construct", NULL, 186, &eventName, source, data, &_6$$10); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 211, fireEvents, event); + ZEPHIR_CALL_METHOD(&status, this_ptr, "firequeue", NULL, 187, &fireEvents, &event); zephir_check_call_status(); } } - RETURN_CCTOR(status); + RETURN_CCTOR(&status); } @@ -626,26 +700,30 @@ PHP_METHOD(Phalcon_Events_Manager, fire) { */ PHP_METHOD(Phalcon_Events_Manager, hasListeners) { - zval *type_param = NULL, *_0; - zval *type = NULL; + zval *type_param = NULL, _0; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &type_param); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_events"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, type)); + zephir_read_property(&_0, this_ptr, SL("_events"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &type)); } @@ -657,28 +735,33 @@ PHP_METHOD(Phalcon_Events_Manager, hasListeners) { */ PHP_METHOD(Phalcon_Events_Manager, getListeners) { - zval *type_param = NULL, *events = NULL, *fireEvents = NULL; - zval *type = NULL; + zval *type_param = NULL, events, fireEvents; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&events); + ZVAL_UNDEF(&fireEvents); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &type_param); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - events = zephir_fetch_nproperty_this(this_ptr, SL("_events"), PH_NOISY_CC); - if (Z_TYPE_P(events) == IS_ARRAY) { - if (zephir_array_isset_fetch(&fireEvents, events, type, 1 TSRMLS_CC)) { - RETURN_CTOR(fireEvents); + zephir_read_property(&events, this_ptr, SL("_events"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&events) == IS_ARRAY) { + if (zephir_array_isset_fetch(&fireEvents, &events, &type, 1 TSRMLS_CC)) { + RETURN_CTOR(&fireEvents); } } array_init(return_value); diff --git a/ext/phalcon/events/manager.zep.h b/ext/phalcon/events/manager.zep.h index ee816a187b6..af5961bbe54 100644 --- a/ext/phalcon/events/manager.zep.h +++ b/ext/phalcon/events/manager.zep.h @@ -17,26 +17,64 @@ PHP_METHOD(Phalcon_Events_Manager, hasListeners); PHP_METHOD(Phalcon_Events_Manager, getListeners); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_attach, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventType, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventType) +#endif ZEND_ARG_INFO(0, handler) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 0) +#else ZEND_ARG_INFO(0, priority) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_detach, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventType, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventType) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_enablepriorities, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, enablePriorities, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, enablePriorities) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_manager_areprioritiesenabled, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_manager_areprioritiesenabled, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_collectresponses, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, collect, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, collect) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_manager_iscollecting, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_manager_iscollecting, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_detachall, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 1) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_firequeue, 0, 0, 2) @@ -45,27 +83,47 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_firequeue, 0, 0, 2) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_fire, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventType, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventType) +#endif ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, data) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cancelable, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, cancelable) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_haslisteners, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_manager_haslisteners, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_events_manager_haslisteners, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_manager_getlisteners, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_events_manager_method_entry) { PHP_ME(Phalcon_Events_Manager, attach, arginfo_phalcon_events_manager_attach, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Manager, detach, arginfo_phalcon_events_manager_detach, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Manager, enablePriorities, arginfo_phalcon_events_manager_enablepriorities, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Events_Manager, arePrioritiesEnabled, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Events_Manager, arePrioritiesEnabled, arginfo_phalcon_events_manager_areprioritiesenabled, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Manager, collectResponses, arginfo_phalcon_events_manager_collectresponses, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Events_Manager, isCollecting, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Events_Manager, isCollecting, arginfo_phalcon_events_manager_iscollecting, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Manager, getResponses, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Manager, detachAll, arginfo_phalcon_events_manager_detachall, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Events_Manager, fireQueue, arginfo_phalcon_events_manager_firequeue, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) diff --git a/ext/phalcon/events/managerinterface.zep.h b/ext/phalcon/events/managerinterface.zep.h index cb5b40f2b55..18c0bddbf1d 100644 --- a/ext/phalcon/events/managerinterface.zep.h +++ b/ext/phalcon/events/managerinterface.zep.h @@ -4,27 +4,47 @@ extern zend_class_entry *phalcon_events_managerinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Events_ManagerInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_attach, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventType, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventType) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_detach, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventType, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventType) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_detachall, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 1) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_fire, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventType, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventType) +#endif ZEND_ARG_INFO(0, source) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_events_managerinterface_getlisteners, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_events_managerinterface_method_entry) { diff --git a/ext/phalcon/factory.zep.c b/ext/phalcon/factory.zep.c index bea1f0ce423..c3ba7832afc 100644 --- a/ext/phalcon/factory.zep.c +++ b/ext/phalcon/factory.zep.c @@ -35,13 +35,21 @@ PHP_METHOD(Phalcon_Factory, loadClass) { zend_class_entry *_3$$5; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *namespace_param = NULL, *config = NULL, *adapter = NULL, *className = NULL, *_1$$3 = NULL, *_2$$5 = NULL; - zval *namespace = NULL; + zval *namespace_param = NULL, *config = NULL, config_sub, adapter, className, _1$$3, _2$$5; + zval namespace; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespace); + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &namespace_param, &config); - zephir_get_strval(namespace, namespace_param); + zephir_get_strval(&namespace, namespace_param); ZEPHIR_SEPARATE_PARAM(config); @@ -52,19 +60,19 @@ PHP_METHOD(Phalcon_Factory, loadClass) { if (_0) { ZEPHIR_CALL_METHOD(&_1$$3, config, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(config, _1$$3); + ZEPHIR_CPY_WRT(config, &_1$$3); } if (Z_TYPE_P(config) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "Config must be array or Phalcon\\Config object", "phalcon/factory.zep", 37); return; } - ZEPHIR_OBS_VAR(adapter); - if (zephir_array_isset_string_fetch(&adapter, config, SS("adapter"), 0 TSRMLS_CC)) { - zephir_array_unset_string(&config, SS("adapter"), PH_SEPARATE); - ZEPHIR_INIT_VAR(className); - ZEPHIR_CONCAT_VSV(className, namespace, "\\", adapter); - zephir_fetch_safe_class(_2$$5, className); - _3$$5 = zend_fetch_class(Z_STRVAL_P(_2$$5), Z_STRLEN_P(_2$$5), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + ZEPHIR_OBS_VAR(&adapter); + if (zephir_array_isset_string_fetch(&adapter, config, SL("adapter"), 0)) { + zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE); + ZEPHIR_INIT_VAR(&className); + ZEPHIR_CONCAT_VSV(&className, &namespace, "\\", &adapter); + zephir_fetch_safe_class(&_2$$5, &className); + _3$$5 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_2$$5), Z_STRLEN_P(&_2$$5), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _3$$5); if (zephir_has_constructor(return_value TSRMLS_CC)) { ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, config); diff --git a/ext/phalcon/factory.zep.h b/ext/phalcon/factory.zep.h index 0378df69e0e..5efd6c18ec6 100644 --- a/ext/phalcon/factory.zep.h +++ b/ext/phalcon/factory.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Factory); PHP_METHOD(Phalcon_Factory, loadClass); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_factory_loadclass, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespace) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/filter.zep.c b/ext/phalcon/filter.zep.c index 49c8e75cfee..61d75d98a8a 100644 --- a/ext/phalcon/filter.zep.c +++ b/ext/phalcon/filter.zep.c @@ -46,33 +46,33 @@ ZEPHIR_INIT_CLASS(Phalcon_Filter) { zend_declare_property_null(phalcon_filter_ce, SL("_filters"), ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_EMAIL"), "email" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_EMAIL"), "email"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_ABSINT"), "absint" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_ABSINT"), "absint"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_INT"), "int" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_INT"), "int"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_INT_CAST"), "int!" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_INT_CAST"), "int!"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_STRING"), "string" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_STRING"), "string"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_FLOAT"), "float" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_FLOAT"), "float"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_FLOAT_CAST"), "float!" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_FLOAT_CAST"), "float!"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_ALPHANUM"), "alphanum" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_ALPHANUM"), "alphanum"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_TRIM"), "trim" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_TRIM"), "trim"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_STRIPTAGS"), "striptags" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_STRIPTAGS"), "striptags"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_LOWER"), "lower" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_LOWER"), "lower"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_UPPER"), "upper" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_UPPER"), "upper"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_URL"), "url" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_URL"), "url"); - zend_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_SPECIAL_CHARS"), "special_chars" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_filter_ce, SL("FILTER_SPECIAL_CHARS"), "special_chars"); zend_class_implements(phalcon_filter_ce TSRMLS_CC, 1, phalcon_filterinterface_ce); return SUCCESS; @@ -85,21 +85,25 @@ ZEPHIR_INIT_CLASS(Phalcon_Filter) { PHP_METHOD(Phalcon_Filter, add) { zend_bool _0; - zval *name_param = NULL, *handler; - zval *name = NULL; + zval *name_param = NULL, *handler, handler_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&handler_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &handler); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } @@ -111,7 +115,7 @@ PHP_METHOD(Phalcon_Filter, add) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_filter_exception_ce, "Filter must be an object or callable", "phalcon/filter.zep", 79); return; } - zephir_update_property_array(this_ptr, SL("_filters"), name, handler TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_filters"), &name, handler TSRMLS_CC); RETURN_THIS(); } @@ -121,12 +125,24 @@ PHP_METHOD(Phalcon_Filter, add) { */ PHP_METHOD(Phalcon_Filter, sanitize) { - HashTable *_1$$4, *_5$$6, *_12$$9; - HashPosition _0$$4, _4$$6, _11$$9; - zephir_fcall_cache_entry *_8 = NULL; + zend_string *_4$$6, *_11$$9; + zend_ulong _3$$6, _10$$9; + zephir_fcall_cache_entry *_6 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zend_bool noRecursive, _10, _3$$5; - zval *value = NULL, *filters, *noRecursive_param = NULL, *filter = NULL, *arrayValue = NULL, *itemKey = NULL, *itemValue = NULL, *sanitizedValue = NULL, **_2$$4, **_6$$6, *_7$$7 = NULL, *_9$$8 = NULL, **_13$$9, *_14$$10 = NULL; + zend_bool noRecursive, _8, _1$$5; + zval *value = NULL, value_sub, *filters, filters_sub, *noRecursive_param = NULL, filter, arrayValue, itemKey, itemValue, sanitizedValue, *_0$$4, *_2$$6, _5$$7, _7$$8, *_9$$9, _12$$10; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&filters_sub); + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&arrayValue); + ZVAL_UNDEF(&itemKey); + ZVAL_UNDEF(&itemValue); + ZVAL_UNDEF(&sanitizedValue); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_12$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &value, &filters, &noRecursive_param); @@ -141,62 +157,74 @@ PHP_METHOD(Phalcon_Filter, sanitize) { if (Z_TYPE_P(filters) == IS_ARRAY) { if (Z_TYPE_P(value) != IS_NULL) { - zephir_is_iterable(filters, &_1$$4, &_0$$4, 0, 0, "phalcon/filter.zep", 112); - for ( - ; zend_hash_get_current_data_ex(_1$$4, (void**) &_2$$4, &_0$$4) == SUCCESS - ; zend_hash_move_forward_ex(_1$$4, &_0$$4) - ) { - ZEPHIR_GET_HVALUE(filter, _2$$4); - _3$$5 = Z_TYPE_P(value) == IS_ARRAY; - if (_3$$5) { - _3$$5 = !noRecursive; + zephir_is_iterable(filters, 0, "phalcon/filter.zep", 112); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(filters), _0$$4) + { + ZEPHIR_INIT_NVAR(&filter); + ZVAL_COPY(&filter, _0$$4); + _1$$5 = Z_TYPE_P(value) == IS_ARRAY; + if (_1$$5) { + _1$$5 = !noRecursive; } - if (_3$$5) { - ZEPHIR_INIT_NVAR(arrayValue); - array_init(arrayValue); - zephir_is_iterable(value, &_5$$6, &_4$$6, 0, 0, "phalcon/filter.zep", 107); - for ( - ; zend_hash_get_current_data_ex(_5$$6, (void**) &_6$$6, &_4$$6) == SUCCESS - ; zend_hash_move_forward_ex(_5$$6, &_4$$6) - ) { - ZEPHIR_GET_HMKEY(itemKey, _5$$6, _4$$6); - ZEPHIR_GET_HVALUE(itemValue, _6$$6); - ZEPHIR_CALL_METHOD(&_7$$7, this_ptr, "_sanitize", &_8, 0, itemValue, filter); + if (_1$$5) { + ZEPHIR_INIT_NVAR(&arrayValue); + array_init(&arrayValue); + zephir_is_iterable(value, 0, "phalcon/filter.zep", 107); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(value), _3$$6, _4$$6, _2$$6) + { + ZEPHIR_INIT_NVAR(&itemKey); + if (_4$$6 != NULL) { + ZVAL_STR_COPY(&itemKey, _4$$6); + } else { + ZVAL_LONG(&itemKey, _3$$6); + } + ZEPHIR_INIT_NVAR(&itemValue); + ZVAL_COPY(&itemValue, _2$$6); + ZEPHIR_CALL_METHOD(&_5$$7, this_ptr, "_sanitize", &_6, 0, &itemValue, &filter); zephir_check_call_status(); - zephir_array_update_zval(&arrayValue, itemKey, &_7$$7, PH_COPY | PH_SEPARATE); - } - ZEPHIR_CPY_WRT(value, arrayValue); + zephir_array_update_zval(&arrayValue, &itemKey, &_5$$7, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&itemValue); + ZEPHIR_INIT_NVAR(&itemKey); + ZEPHIR_CPY_WRT(value, &arrayValue); } else { - ZEPHIR_CALL_METHOD(&_9$$8, this_ptr, "_sanitize", &_8, 0, value, filter); + ZEPHIR_CALL_METHOD(&_7$$8, this_ptr, "_sanitize", &_6, 0, value, &filter); zephir_check_call_status(); - ZEPHIR_CPY_WRT(value, _9$$8); + ZEPHIR_CPY_WRT(value, &_7$$8); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&filter); } RETVAL_ZVAL(value, 1, 0); RETURN_MM(); } - _10 = Z_TYPE_P(value) == IS_ARRAY; - if (_10) { - _10 = !noRecursive; + _8 = Z_TYPE_P(value) == IS_ARRAY; + if (_8) { + _8 = !noRecursive; } - if (_10) { - ZEPHIR_INIT_VAR(sanitizedValue); - array_init(sanitizedValue); - zephir_is_iterable(value, &_12$$9, &_11$$9, 0, 0, "phalcon/filter.zep", 124); - for ( - ; zend_hash_get_current_data_ex(_12$$9, (void**) &_13$$9, &_11$$9) == SUCCESS - ; zend_hash_move_forward_ex(_12$$9, &_11$$9) - ) { - ZEPHIR_GET_HMKEY(itemKey, _12$$9, _11$$9); - ZEPHIR_GET_HVALUE(itemValue, _13$$9); - ZEPHIR_CALL_METHOD(&_14$$10, this_ptr, "_sanitize", &_8, 0, itemValue, filters); + if (_8) { + ZEPHIR_INIT_VAR(&sanitizedValue); + array_init(&sanitizedValue); + zephir_is_iterable(value, 0, "phalcon/filter.zep", 124); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(value), _10$$9, _11$$9, _9$$9) + { + ZEPHIR_INIT_NVAR(&itemKey); + if (_11$$9 != NULL) { + ZVAL_STR_COPY(&itemKey, _11$$9); + } else { + ZVAL_LONG(&itemKey, _10$$9); + } + ZEPHIR_INIT_NVAR(&itemValue); + ZVAL_COPY(&itemValue, _9$$9); + ZEPHIR_CALL_METHOD(&_12$$10, this_ptr, "_sanitize", &_6, 0, &itemValue, filters); zephir_check_call_status(); - zephir_array_update_zval(&sanitizedValue, itemKey, &_14$$10, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(sanitizedValue); + zephir_array_update_zval(&sanitizedValue, &itemKey, &_12$$10, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&itemValue); + ZEPHIR_INIT_NVAR(&itemKey); + RETURN_CCTOR(&sanitizedValue); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_sanitize", &_8, 0, value, filters); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_sanitize", &_6, 0, value, filters); zephir_check_call_status(); RETURN_MM(); @@ -207,156 +235,168 @@ PHP_METHOD(Phalcon_Filter, sanitize) { */ PHP_METHOD(Phalcon_Filter, _sanitize) { - zval *_3$$4, *_9$$10; + zval _3$$4, _9$$10; zend_bool _1$$3, _2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *filter = NULL, *_16$$21; - zval *value, *filter_param = NULL, *filterObject = NULL, *_0, _4$$5, *_5$$5 = NULL, _6$$6, _7$$8, _8$$9, _10$$10, *_11$$12, *_12$$12, _13$$19, _14$$20, *_15$$21; + zval filter, _16$$21; + zval *value, value_sub, *filter_param = NULL, filterObject, _0, _4$$5, _5$$5, _6$$6, _7$$8, _8$$9, _10$$10, _11$$12, _12$$12, _13$$19, _14$$20, _15$$21; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&filterObject); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_10$$10); + ZVAL_UNDEF(&_11$$12); + ZVAL_UNDEF(&_12$$12); + ZVAL_UNDEF(&_13$$19); + ZVAL_UNDEF(&_14$$20); + ZVAL_UNDEF(&_15$$21); + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&_16$$21); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_9$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &value, &filter_param); if (UNEXPECTED(Z_TYPE_P(filter_param) != IS_STRING && Z_TYPE_P(filter_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filter' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'filter' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(filter_param) == IS_STRING)) { - zephir_get_strval(filter, filter_param); + zephir_get_strval(&filter, filter_param); } else { - ZEPHIR_INIT_VAR(filter); - ZVAL_EMPTY_STRING(filter); + ZEPHIR_INIT_VAR(&filter); + ZVAL_EMPTY_STRING(&filter); } - ZEPHIR_OBS_VAR(filterObject); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_filters"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&filterObject, _0, filter, 0 TSRMLS_CC)) { - _1$$3 = Z_TYPE_P(filterObject) == IS_OBJECT; + ZEPHIR_OBS_VAR(&filterObject); + zephir_read_property(&_0, this_ptr, SL("_filters"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&filterObject, &_0, &filter, 0 TSRMLS_CC)) { + _1$$3 = Z_TYPE_P(&filterObject) == IS_OBJECT; if (_1$$3) { - _1$$3 = zephir_instance_of_ev(filterObject, zend_ce_closure TSRMLS_CC); + _1$$3 = zephir_instance_of_ev(&filterObject, zend_ce_closure TSRMLS_CC); } _2$$3 = _1$$3; if (!(_2$$3)) { - _2$$3 = zephir_is_callable(filterObject TSRMLS_CC); + _2$$3 = zephir_is_callable(&filterObject TSRMLS_CC); } if (_2$$3) { - ZEPHIR_INIT_VAR(_3$$4); - zephir_create_array(_3$$4, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_3$$4, value); - ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, filterObject, _3$$4); + ZEPHIR_INIT_VAR(&_3$$4); + zephir_create_array(&_3$$4, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_3$$4, value); + ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &filterObject, &_3$$4); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(filterObject, "filter", NULL, 0, value); + ZEPHIR_RETURN_CALL_METHOD(&filterObject, "filter", NULL, 0, value); zephir_check_call_status(); RETURN_MM(); } do { - if (ZEPHIR_IS_STRING(filter, "email")) { - ZEPHIR_SINIT_VAR(_4$$5); - ZVAL_STRING(&_4$$5, "FILTER_SANITIZE_EMAIL", 0); - ZEPHIR_CALL_FUNCTION(&_5$$5, "constant", NULL, 38, &_4$$5); + if (ZEPHIR_IS_STRING(&filter, "email")) { + ZEPHIR_INIT_VAR(&_4$$5); + ZVAL_STRING(&_4$$5, "FILTER_SANITIZE_EMAIL"); + ZEPHIR_CALL_FUNCTION(&_5$$5, "constant", NULL, 32, &_4$$5); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 212, value, _5$$5); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 188, value, &_5$$5); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "int")) { - ZEPHIR_SINIT_VAR(_6$$6); + if (ZEPHIR_IS_STRING(&filter, "int")) { ZVAL_LONG(&_6$$6, 519); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 212, value, &_6$$6); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 188, value, &_6$$6); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "int!")) { + if (ZEPHIR_IS_STRING(&filter, "int!")) { RETURN_MM_LONG(zephir_get_intval(value)); } - if (ZEPHIR_IS_STRING(filter, "absint")) { - ZEPHIR_SINIT_VAR(_7$$8); + if (ZEPHIR_IS_STRING(&filter, "absint")) { ZVAL_LONG(&_7$$8, zephir_get_intval(value)); - ZEPHIR_RETURN_CALL_FUNCTION("abs", NULL, 213, &_7$$8); + ZEPHIR_RETURN_CALL_FUNCTION("abs", NULL, 189, &_7$$8); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "string")) { - ZEPHIR_SINIT_VAR(_8$$9); + if (ZEPHIR_IS_STRING(&filter, "string")) { ZVAL_LONG(&_8$$9, 513); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 212, value, &_8$$9); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 188, value, &_8$$9); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "float")) { - ZEPHIR_INIT_VAR(_9$$10); - zephir_create_array(_9$$10, 1, 0 TSRMLS_CC); - add_assoc_long_ex(_9$$10, SS("flags"), 4096); - ZEPHIR_SINIT_VAR(_10$$10); + if (ZEPHIR_IS_STRING(&filter, "float")) { + ZEPHIR_INIT_VAR(&_9$$10); + zephir_create_array(&_9$$10, 1, 0 TSRMLS_CC); + add_assoc_long_ex(&_9$$10, SL("flags"), 4096); ZVAL_LONG(&_10$$10, 520); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 212, value, &_10$$10, _9$$10); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 188, value, &_10$$10, &_9$$10); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "float!")) { + if (ZEPHIR_IS_STRING(&filter, "float!")) { RETURN_MM_DOUBLE(zephir_get_doubleval(value)); } - if (ZEPHIR_IS_STRING(filter, "alphanum")) { - ZEPHIR_INIT_VAR(_11$$12); - ZVAL_STRING(_11$$12, "/[^A-Za-z0-9]/", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_12$$12); - ZVAL_STRING(_12$$12, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 42, _11$$12, _12$$12, value); - zephir_check_temp_parameter(_11$$12); - zephir_check_temp_parameter(_12$$12); + if (ZEPHIR_IS_STRING(&filter, "alphanum")) { + ZEPHIR_INIT_VAR(&_11$$12); + ZVAL_STRING(&_11$$12, "/[^A-Za-z0-9]/"); + ZEPHIR_INIT_VAR(&_12$$12); + ZVAL_STRING(&_12$$12, ""); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 35, &_11$$12, &_12$$12, value); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "trim")) { + if (ZEPHIR_IS_STRING(&filter, "trim")) { zephir_fast_trim(return_value, value, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "striptags")) { - ZEPHIR_RETURN_CALL_FUNCTION("strip_tags", NULL, 214, value); + if (ZEPHIR_IS_STRING(&filter, "striptags")) { + ZEPHIR_RETURN_CALL_FUNCTION("strip_tags", NULL, 190, value); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "lower")) { - if ((zephir_function_exists_ex(SS("mb_strtolower") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("mb_strtolower", NULL, 215, value); + if (ZEPHIR_IS_STRING(&filter, "lower")) { + if ((zephir_function_exists_ex(SL("mb_strtolower") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_FUNCTION("mb_strtolower", NULL, 191, value); zephir_check_call_status(); RETURN_MM(); } zephir_fast_strtolower(return_value, value); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "upper")) { - if ((zephir_function_exists_ex(SS("mb_strtoupper") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("mb_strtoupper", NULL, 216, value); + if (ZEPHIR_IS_STRING(&filter, "upper")) { + if ((zephir_function_exists_ex(SL("mb_strtoupper") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_FUNCTION("mb_strtoupper", NULL, 192, value); zephir_check_call_status(); RETURN_MM(); } zephir_fast_strtoupper(return_value, value); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "url")) { - ZEPHIR_SINIT_VAR(_13$$19); + if (ZEPHIR_IS_STRING(&filter, "url")) { ZVAL_LONG(&_13$$19, 518); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 212, value, &_13$$19); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 188, value, &_13$$19); zephir_check_call_status(); RETURN_MM(); } - if (ZEPHIR_IS_STRING(filter, "special_chars")) { - ZEPHIR_SINIT_VAR(_14$$20); + if (ZEPHIR_IS_STRING(&filter, "special_chars")) { ZVAL_LONG(&_14$$20, 515); - ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 212, value, &_14$$20); + ZEPHIR_RETURN_CALL_FUNCTION("filter_var", NULL, 188, value, &_14$$20); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(_15$$21); - object_init_ex(_15$$21, phalcon_filter_exception_ce); - ZEPHIR_INIT_VAR(_16$$21); - ZEPHIR_CONCAT_SVS(_16$$21, "Sanitize filter '", filter, "' is not supported"); - ZEPHIR_CALL_METHOD(NULL, _15$$21, "__construct", NULL, 9, _16$$21); + ZEPHIR_INIT_VAR(&_15$$21); + object_init_ex(&_15$$21, phalcon_filter_exception_ce); + ZEPHIR_INIT_VAR(&_16$$21); + ZEPHIR_CONCAT_SVS(&_16$$21, "Sanitize filter '", &filter, "' is not supported"); + ZEPHIR_CALL_METHOD(NULL, &_15$$21, "__construct", NULL, 4, &_16$$21); zephir_check_call_status(); - zephir_throw_exception_debug(_15$$21, "phalcon/filter.zep", 226 TSRMLS_CC); + zephir_throw_exception_debug(&_15$$21, "phalcon/filter.zep", 226 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); @@ -370,7 +410,8 @@ PHP_METHOD(Phalcon_Filter, _sanitize) { */ PHP_METHOD(Phalcon_Filter, getFilters) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_filters"); diff --git a/ext/phalcon/filter.zep.h b/ext/phalcon/filter.zep.h index 4abfc72c67b..8df6d7cdad2 100644 --- a/ext/phalcon/filter.zep.h +++ b/ext/phalcon/filter.zep.h @@ -8,26 +8,49 @@ PHP_METHOD(Phalcon_Filter, sanitize); PHP_METHOD(Phalcon_Filter, _sanitize); PHP_METHOD(Phalcon_Filter, getFilters); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_filter_add, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_filter_add, 0, 2, Phalcon\\FilterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filter_add, 0, 2, IS_OBJECT, "Phalcon\\FilterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_filter_sanitize, 0, 0, 2) ZEND_ARG_INFO(0, value) ZEND_ARG_INFO(0, filters) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, noRecursive, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, noRecursive) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_filter__sanitize, 0, 0, 2) ZEND_ARG_INFO(0, value) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filter) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filter_getfilters, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filter_getfilters, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_filter_method_entry) { PHP_ME(Phalcon_Filter, add, arginfo_phalcon_filter_add, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Filter, sanitize, arginfo_phalcon_filter_sanitize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Filter, _sanitize, arginfo_phalcon_filter__sanitize, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Filter, getFilters, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Filter, getFilters, arginfo_phalcon_filter_getfilters, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/filterinterface.zep.h b/ext/phalcon/filterinterface.zep.h index f67cc84d7cb..25a3761b865 100644 --- a/ext/phalcon/filterinterface.zep.h +++ b/ext/phalcon/filterinterface.zep.h @@ -3,8 +3,16 @@ extern zend_class_entry *phalcon_filterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_FilterInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_filterinterface_add, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_filterinterface_add, 0, 2, Phalcon\\FilterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filterinterface_add, 0, 2, IS_OBJECT, "Phalcon\\FilterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() @@ -13,9 +21,16 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_filterinterface_sanitize, 0, 0, 2) ZEND_ARG_INFO(0, filters) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filterinterface_getfilters, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_filterinterface_getfilters, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_filterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_FilterInterface, add, arginfo_phalcon_filterinterface_add) PHP_ABSTRACT_ME(Phalcon_FilterInterface, sanitize, arginfo_phalcon_filterinterface_sanitize) - PHP_ABSTRACT_ME(Phalcon_FilterInterface, getFilters, NULL) + PHP_ABSTRACT_ME(Phalcon_FilterInterface, getFilters, arginfo_phalcon_filterinterface_getfilters) PHP_FE_END }; diff --git a/ext/phalcon/flash.zep.c b/ext/phalcon/flash.zep.c index 290be77c5ea..b5a101d68bb 100644 --- a/ext/phalcon/flash.zep.c +++ b/ext/phalcon/flash.zep.c @@ -62,13 +62,18 @@ ZEPHIR_INIT_CLASS(Phalcon_Flash) { */ PHP_METHOD(Phalcon_Flash, __construct) { - zval *cssClasses = NULL; + zval *cssClasses = NULL, cssClasses_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cssClasses_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &cssClasses); if (!cssClasses) { - ZEPHIR_CPY_WRT(cssClasses, ZEPHIR_GLOBAL(global_null)); + cssClasses = &cssClasses_sub; + ZEPHIR_CPY_WRT(cssClasses, &__$null); } else { ZEPHIR_SEPARATE_PARAM(cssClasses); } @@ -77,12 +82,12 @@ PHP_METHOD(Phalcon_Flash, __construct) { if (Z_TYPE_P(cssClasses) != IS_ARRAY) { ZEPHIR_INIT_NVAR(cssClasses); zephir_create_array(cssClasses, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(cssClasses, SS("error"), SL("errorMessage"), 1); - add_assoc_stringl_ex(cssClasses, SS("notice"), SL("noticeMessage"), 1); - add_assoc_stringl_ex(cssClasses, SS("success"), SL("successMessage"), 1); - add_assoc_stringl_ex(cssClasses, SS("warning"), SL("warningMessage"), 1); + add_assoc_stringl_ex(cssClasses, SL("error"), SL("errorMessage")); + add_assoc_stringl_ex(cssClasses, SL("notice"), SL("noticeMessage")); + add_assoc_stringl_ex(cssClasses, SL("success"), SL("successMessage")); + add_assoc_stringl_ex(cssClasses, SL("warning"), SL("warningMessage")); } - zephir_update_property_this(getThis(), SL("_cssClasses"), cssClasses TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cssClasses"), cssClasses); ZEPHIR_MM_RESTORE(); } @@ -92,7 +97,8 @@ PHP_METHOD(Phalcon_Flash, __construct) { */ PHP_METHOD(Phalcon_Flash, getAutoescape) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_autoescape"); @@ -103,8 +109,12 @@ PHP_METHOD(Phalcon_Flash, getAutoescape) { */ PHP_METHOD(Phalcon_Flash, setAutoescape) { - zval *autoescape_param = NULL; + zval *autoescape_param = NULL, __$true, __$false; zend_bool autoescape; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &autoescape_param); @@ -112,9 +122,9 @@ PHP_METHOD(Phalcon_Flash, setAutoescape) { if (autoescape) { - zephir_update_property_this(getThis(), SL("_autoescape"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_autoescape"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_autoescape"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_autoescape"), &__$false); } RETURN_THISW(); @@ -125,26 +135,31 @@ PHP_METHOD(Phalcon_Flash, setAutoescape) { */ PHP_METHOD(Phalcon_Flash, getEscaperService) { - zval *escaper = NULL, *dependencyInjector = NULL, *_0$$3 = NULL, *_1$$3; + zval escaper, dependencyInjector, _0$$3, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&escaper); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(escaper); - zephir_read_property_this(&escaper, this_ptr, SL("_escaperService"), PH_NOISY_CC); - if (Z_TYPE_P(escaper) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&escaper); + zephir_read_property(&escaper, this_ptr, SL("_escaperService"), PH_NOISY_CC); + if (Z_TYPE_P(&escaper) != IS_OBJECT) { ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "getdi", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(dependencyInjector, _0$$3); - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "escaper", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0$$3, dependencyInjector, "getshared", NULL, 0, _1$$3); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "escaper"); + ZEPHIR_CALL_METHOD(&_0$$3, &dependencyInjector, "getshared", NULL, 0, &_1$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(escaper, _0$$3); - zephir_update_property_this(getThis(), SL("_escaperService"), escaper TSRMLS_CC); + ZEPHIR_CPY_WRT(&escaper, &_0$$3); + zephir_update_property_zval(this_ptr, SL("_escaperService"), &escaper); } - RETURN_CCTOR(escaper); + RETURN_CCTOR(&escaper); } @@ -153,13 +168,16 @@ PHP_METHOD(Phalcon_Flash, getEscaperService) { */ PHP_METHOD(Phalcon_Flash, setEscaperService) { - zval *escaperService; + zval *escaperService, escaperService_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&escaperService_sub); zephir_fetch_params(0, 1, 0, &escaperService); - zephir_update_property_this(getThis(), SL("_escaperService"), escaperService TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_escaperService"), escaperService); RETURN_THISW(); } @@ -169,13 +187,16 @@ PHP_METHOD(Phalcon_Flash, setEscaperService) { */ PHP_METHOD(Phalcon_Flash, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); RETURN_THISW(); } @@ -185,19 +206,22 @@ PHP_METHOD(Phalcon_Flash, setDI) { */ PHP_METHOD(Phalcon_Flash, getDI) { - zval *di = NULL; + zval di; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&di); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(di); - zephir_read_property_this(&di, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(di) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&di, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_OBS_VAR(&di); + zephir_read_property(&di, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&di) != IS_OBJECT) { + ZEPHIR_CALL_CE_STATIC(&di, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); } - RETURN_CCTOR(di); + RETURN_CCTOR(&di); } @@ -206,8 +230,12 @@ PHP_METHOD(Phalcon_Flash, getDI) { */ PHP_METHOD(Phalcon_Flash, setImplicitFlush) { - zval *implicitFlush_param = NULL; + zval *implicitFlush_param = NULL, __$true, __$false; zend_bool implicitFlush; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &implicitFlush_param); @@ -215,9 +243,9 @@ PHP_METHOD(Phalcon_Flash, setImplicitFlush) { if (implicitFlush) { - zephir_update_property_this(getThis(), SL("_implicitFlush"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_implicitFlush"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_implicitFlush"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_implicitFlush"), &__$false); } RETURN_THISW(); @@ -228,8 +256,12 @@ PHP_METHOD(Phalcon_Flash, setImplicitFlush) { */ PHP_METHOD(Phalcon_Flash, setAutomaticHtml) { - zval *automaticHtml_param = NULL; + zval *automaticHtml_param = NULL, __$true, __$false; zend_bool automaticHtml; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &automaticHtml_param); @@ -237,9 +269,9 @@ PHP_METHOD(Phalcon_Flash, setAutomaticHtml) { if (automaticHtml) { - zephir_update_property_this(getThis(), SL("_automaticHtml"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_automaticHtml"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_automaticHtml"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_automaticHtml"), &__$false); } RETURN_THISW(); @@ -251,15 +283,19 @@ PHP_METHOD(Phalcon_Flash, setAutomaticHtml) { PHP_METHOD(Phalcon_Flash, setCssClasses) { zval *cssClasses_param = NULL; - zval *cssClasses = NULL; + zval cssClasses; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &cssClasses_param); + ZVAL_UNDEF(&cssClasses); - cssClasses = cssClasses_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &cssClasses_param); + ZEPHIR_OBS_COPY_OR_DUP(&cssClasses, cssClasses_param); - zephir_update_property_this(getThis(), SL("_cssClasses"), cssClasses TSRMLS_CC); - RETURN_THISW(); + + zephir_update_property_zval(this_ptr, SL("_cssClasses"), &cssClasses); + RETURN_THIS(); } @@ -273,17 +309,20 @@ PHP_METHOD(Phalcon_Flash, setCssClasses) { PHP_METHOD(Phalcon_Flash, error) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message, *_0; + zval *message, message_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &message); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "error", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, _0, message); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "error"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, message); zephir_check_call_status(); RETURN_MM(); @@ -299,17 +338,20 @@ PHP_METHOD(Phalcon_Flash, error) { PHP_METHOD(Phalcon_Flash, notice) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message, *_0; + zval *message, message_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &message); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "notice", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, _0, message); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "notice"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, message); zephir_check_call_status(); RETURN_MM(); @@ -325,17 +367,20 @@ PHP_METHOD(Phalcon_Flash, notice) { PHP_METHOD(Phalcon_Flash, success) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message, *_0; + zval *message, message_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &message); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "success", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, _0, message); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "success"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, message); zephir_check_call_status(); RETURN_MM(); @@ -351,17 +396,20 @@ PHP_METHOD(Phalcon_Flash, success) { PHP_METHOD(Phalcon_Flash, warning) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message, *_0; + zval *message, message_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &message); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "warning", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, _0, message); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "warning"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "message", NULL, 0, &_0, message); zephir_check_call_status(); RETURN_MM(); @@ -379,104 +427,117 @@ PHP_METHOD(Phalcon_Flash, warning) { */ PHP_METHOD(Phalcon_Flash, outputMessage) { - HashTable *_3$$9; - HashPosition _2$$9; zend_bool automaticHtml = 0, implicitFlush = 0, autoEscape = 0; - zephir_fcall_cache_entry *_5 = NULL; + zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *message, *content = NULL, *cssClasses = NULL, *classes = NULL, *typeClasses = NULL, *eol = NULL, *msg = NULL, *htmlMessage = NULL, *escaper = NULL, *preparedMsg = NULL, *_0 = NULL, *_1$$5, **_4$$9; - zval *type = NULL; + zval *type_param = NULL, *message, message_sub, content, cssClasses, classes, typeClasses, eol, msg, htmlMessage, escaper, preparedMsg, _0, _1$$5, *_2$$9; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&cssClasses); + ZVAL_UNDEF(&classes); + ZVAL_UNDEF(&typeClasses); + ZVAL_UNDEF(&eol); + ZVAL_UNDEF(&msg); + ZVAL_UNDEF(&htmlMessage); + ZVAL_UNDEF(&escaper); + ZVAL_UNDEF(&preparedMsg); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &message); - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_automaticHtml"), PH_NOISY_CC); - automaticHtml = zephir_get_boolval(_0); - ZEPHIR_OBS_NVAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_autoescape"), PH_NOISY_CC); - autoEscape = zephir_get_boolval(_0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_automaticHtml"), PH_NOISY_CC); + automaticHtml = zephir_get_boolval(&_0); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_autoescape"), PH_NOISY_CC); + autoEscape = zephir_get_boolval(&_0); if (automaticHtml == 1) { - ZEPHIR_OBS_VAR(classes); - zephir_read_property_this(&classes, this_ptr, SL("_cssClasses"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(typeClasses); - if (zephir_array_isset_fetch(&typeClasses, classes, type, 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(cssClasses); - if (Z_TYPE_P(typeClasses) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_1$$5); - zephir_fast_join_str(_1$$5, SL(" "), typeClasses TSRMLS_CC); - ZEPHIR_CONCAT_SVS(cssClasses, " class=\"", _1$$5, "\""); + ZEPHIR_OBS_VAR(&classes); + zephir_read_property(&classes, this_ptr, SL("_cssClasses"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&typeClasses); + if (zephir_array_isset_fetch(&typeClasses, &classes, &type, 0 TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&cssClasses); + if (Z_TYPE_P(&typeClasses) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_1$$5); + zephir_fast_join_str(&_1$$5, SL(" "), &typeClasses TSRMLS_CC); + ZEPHIR_CONCAT_SVS(&cssClasses, " class=\"", &_1$$5, "\""); } else { - ZEPHIR_CONCAT_SVS(cssClasses, " class=\"", typeClasses, "\""); + ZEPHIR_CONCAT_SVS(&cssClasses, " class=\"", &typeClasses, "\""); } } else { - ZEPHIR_INIT_NVAR(cssClasses); - ZVAL_STRING(cssClasses, "", 1); + ZEPHIR_INIT_NVAR(&cssClasses); + ZVAL_STRING(&cssClasses, ""); } - ZEPHIR_INIT_VAR(eol); - ZEPHIR_GET_CONSTANT(eol, "PHP_EOL"); + ZEPHIR_INIT_VAR(&eol); + ZEPHIR_GET_CONSTANT(&eol, "PHP_EOL"); } if (autoEscape == 1) { ZEPHIR_CALL_METHOD(&escaper, this_ptr, "getescaperservice", NULL, 0); zephir_check_call_status(); } - ZEPHIR_OBS_NVAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_implicitFlush"), PH_NOISY_CC); - implicitFlush = zephir_get_boolval(_0); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_implicitFlush"), PH_NOISY_CC); + implicitFlush = zephir_get_boolval(&_0); if (Z_TYPE_P(message) == IS_ARRAY) { if (implicitFlush == 0) { - ZEPHIR_INIT_VAR(content); - ZVAL_STRING(content, "", 1); + ZEPHIR_INIT_VAR(&content); + ZVAL_STRING(&content, ""); } - zephir_is_iterable(message, &_3$$9, &_2$$9, 0, 0, "phalcon/flash.zep", 288); - for ( - ; zend_hash_get_current_data_ex(_3$$9, (void**) &_4$$9, &_2$$9) == SUCCESS - ; zend_hash_move_forward_ex(_3$$9, &_2$$9) - ) { - ZEPHIR_GET_HVALUE(msg, _4$$9); + zephir_is_iterable(message, 0, "phalcon/flash.zep", 288); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(message), _2$$9) + { + ZEPHIR_INIT_NVAR(&msg); + ZVAL_COPY(&msg, _2$$9); if (autoEscape == 1) { - ZEPHIR_CALL_METHOD(&preparedMsg, escaper, "escapehtml", &_5, 0, msg); + ZEPHIR_CALL_METHOD(&preparedMsg, &escaper, "escapehtml", &_3, 0, &msg); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedMsg, msg); + ZEPHIR_CPY_WRT(&preparedMsg, &msg); } if (automaticHtml == 1) { - ZEPHIR_INIT_NVAR(htmlMessage); - ZEPHIR_CONCAT_SVSVSV(htmlMessage, "", preparedMsg, "", eol); + ZEPHIR_INIT_NVAR(&htmlMessage); + ZEPHIR_CONCAT_SVSVSV(&htmlMessage, "", &preparedMsg, "", &eol); } else { - ZEPHIR_CPY_WRT(htmlMessage, preparedMsg); + ZEPHIR_CPY_WRT(&htmlMessage, &preparedMsg); } if (implicitFlush == 1) { - zend_print_zval(htmlMessage, 0); + zend_print_zval(&htmlMessage, 0); } else { - zephir_concat_self(&content, htmlMessage TSRMLS_CC); - zephir_update_property_array_append(this_ptr, SL("_messages"), htmlMessage TSRMLS_CC); + zephir_concat_self(&content, &htmlMessage TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_messages"), &htmlMessage TSRMLS_CC); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&msg); if (implicitFlush == 0) { - RETURN_CCTOR(content); + RETURN_CCTOR(&content); } } else { if (autoEscape == 1) { - ZEPHIR_CALL_METHOD(&preparedMsg, escaper, "escapehtml", NULL, 0, message); + ZEPHIR_CALL_METHOD(&preparedMsg, &escaper, "escapehtml", NULL, 0, message); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedMsg, message); + ZEPHIR_CPY_WRT(&preparedMsg, message); } if (automaticHtml == 1) { - ZEPHIR_INIT_NVAR(htmlMessage); - ZEPHIR_CONCAT_SVSVSV(htmlMessage, "", preparedMsg, "", eol); + ZEPHIR_INIT_NVAR(&htmlMessage); + ZEPHIR_CONCAT_SVSVSV(&htmlMessage, "", &preparedMsg, "", &eol); } else { - ZEPHIR_CPY_WRT(htmlMessage, preparedMsg); + ZEPHIR_CPY_WRT(&htmlMessage, &preparedMsg); } if (implicitFlush == 1) { - zend_print_zval(htmlMessage, 0); + zend_print_zval(&htmlMessage, 0); } else { - zephir_update_property_array_append(this_ptr, SL("_messages"), htmlMessage TSRMLS_CC); - RETURN_CCTOR(htmlMessage); + zephir_update_property_array_append(this_ptr, SL("_messages"), &htmlMessage TSRMLS_CC); + RETURN_CCTOR(&htmlMessage); } } ZEPHIR_MM_RESTORE(); @@ -488,13 +549,16 @@ PHP_METHOD(Phalcon_Flash, outputMessage) { */ PHP_METHOD(Phalcon_Flash, clear) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_messages"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_messages"), &_0); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/flash.zep.h b/ext/phalcon/flash.zep.h index 65983a8261a..678c4812794 100644 --- a/ext/phalcon/flash.zep.h +++ b/ext/phalcon/flash.zep.h @@ -24,59 +24,136 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash___construct, 0, 0, 0) ZEND_ARG_INFO(0, cssClasses) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_setautoescape, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getautoescape, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getautoescape, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setautoescape, 0, 1, Phalcon\\Flash, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setautoescape, 0, 1, IS_OBJECT, "Phalcon\\Flash", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, autoescape, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, autoescape) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_getescaperservice, 0, 0, Phalcon\\EscaperInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getescaperservice, 0, 0, IS_OBJECT, "Phalcon\\EscaperInterface", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_setescaperservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setescaperservice, 0, 1, Phalcon\\Flash, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setescaperservice, 0, 1, IS_OBJECT, "Phalcon\\Flash", 0) +#endif ZEND_ARG_OBJ_INFO(0, escaperService, Phalcon\\EscaperInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_setdi, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setdi, 0, 1, Phalcon\\Flash, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setdi, 0, 1, IS_OBJECT, "Phalcon\\Flash", 0) +#endif ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_setimplicitflush, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setimplicitflush, 0, 1, Phalcon\\FlashInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setimplicitflush, 0, 1, IS_OBJECT, "Phalcon\\FlashInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, implicitFlush, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, implicitFlush) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_setautomatichtml, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setautomatichtml, 0, 1, Phalcon\\FlashInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setautomatichtml, 0, 1, IS_OBJECT, "Phalcon\\FlashInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, automaticHtml, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, automaticHtml) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_setcssclasses, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_flash_setcssclasses, 0, 1, Phalcon\\FlashInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_setcssclasses, 0, 1, IS_OBJECT, "Phalcon\\FlashInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, cssClasses, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_error, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_error, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_error, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, message) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_notice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_notice, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_notice, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, message) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_success, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_success, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_success, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, message) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_warning, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_warning, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_warning, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, message) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_outputmessage, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_INFO(0, message) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_flash_method_entry) { PHP_ME(Phalcon_Flash, __construct, arginfo_phalcon_flash___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Flash, getAutoescape, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Flash, getAutoescape, arginfo_phalcon_flash_getautoescape, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Flash, setAutoescape, arginfo_phalcon_flash_setautoescape, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, getEscaperService, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Flash, getEscaperService, arginfo_phalcon_flash_getescaperservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Flash, setEscaperService, arginfo_phalcon_flash_setescaperservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Flash, setDI, arginfo_phalcon_flash_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Flash, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Flash, getDI, arginfo_phalcon_flash_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Flash, setImplicitFlush, arginfo_phalcon_flash_setimplicitflush, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Flash, setAutomaticHtml, arginfo_phalcon_flash_setautomatichtml, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Flash, setCssClasses, arginfo_phalcon_flash_setcssclasses, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/flash/direct.zep.c b/ext/phalcon/flash/direct.zep.c index 7292dd11b50..7ab6a7c9469 100644 --- a/ext/phalcon/flash/direct.zep.c +++ b/ext/phalcon/flash/direct.zep.c @@ -37,16 +37,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Flash_Direct) { PHP_METHOD(Phalcon_Flash_Direct, message) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *message; - zval *type = NULL; + zval *type_param = NULL, *message, message_sub; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&message_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &message); - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputmessage", NULL, 0, type, message); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "outputmessage", NULL, 0, &type, message); zephir_check_call_status(); RETURN_MM(); @@ -57,12 +61,14 @@ PHP_METHOD(Phalcon_Flash_Direct, message) { */ PHP_METHOD(Phalcon_Flash_Direct, output) { - HashTable *_1$$3; - HashPosition _0$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zephir_fcall_cache_entry *_3 = NULL; - zval *remove_param = NULL, *message = NULL, *messages = NULL, **_2$$3; + zephir_fcall_cache_entry *_1 = NULL; + zval *remove_param = NULL, message, messages, *_0$$3; zend_bool remove; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&messages); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &remove_param); @@ -74,20 +80,20 @@ PHP_METHOD(Phalcon_Flash_Direct, output) { } - ZEPHIR_OBS_VAR(messages); - zephir_read_property_this(&messages, this_ptr, SL("_messages"), PH_NOISY_CC); - if (Z_TYPE_P(messages) == IS_ARRAY) { - zephir_is_iterable(messages, &_1$$3, &_0$$3, 0, 0, "phalcon/flash/direct.zep", 52); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(message, _2$$3); - zend_print_zval(message, 0); - } + ZEPHIR_OBS_VAR(&messages); + zephir_read_property(&messages, this_ptr, SL("_messages"), PH_NOISY_CC); + if (Z_TYPE_P(&messages) == IS_ARRAY) { + zephir_is_iterable(&messages, 0, "phalcon/flash/direct.zep", 52); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&messages), _0$$3) + { + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _0$$3); + zend_print_zval(&message, 0); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); } if (remove) { - ZEPHIR_CALL_PARENT(NULL, phalcon_flash_direct_ce, getThis(), "clear", &_3, 217); + ZEPHIR_CALL_PARENT(NULL, phalcon_flash_direct_ce, getThis(), "clear", &_1, 0); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/flash/direct.zep.h b/ext/phalcon/flash/direct.zep.h index 97109158f0b..7dea27806f4 100644 --- a/ext/phalcon/flash/direct.zep.h +++ b/ext/phalcon/flash/direct.zep.h @@ -6,13 +6,25 @@ ZEPHIR_INIT_CLASS(Phalcon_Flash_Direct); PHP_METHOD(Phalcon_Flash_Direct, message); PHP_METHOD(Phalcon_Flash_Direct, output); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_direct_message, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_direct_message, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_direct_message, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_INFO(0, message) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_direct_output, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, remove, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, remove) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_flash_direct_method_entry) { diff --git a/ext/phalcon/flash/session.zep.c b/ext/phalcon/flash/session.zep.c index a3f3d598f5a..a381f5821d7 100644 --- a/ext/phalcon/flash/session.zep.c +++ b/ext/phalcon/flash/session.zep.c @@ -39,56 +39,65 @@ ZEPHIR_INIT_CLASS(Phalcon_Flash_Session) { PHP_METHOD(Phalcon_Flash_Session, _getSessionMessages) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *remove_param = NULL, *type = NULL, *dependencyInjector = NULL, *session = NULL, *messages = NULL, *returnMessages = NULL, *_0 = NULL, *_1 = NULL, *_2$$5, *_3$$6; + zval *remove_param = NULL, *type = NULL, type_sub, __$null, dependencyInjector, session, messages, returnMessages, _0, _1, _2$$5, _3$$6; zend_bool remove; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&messages); + ZVAL_UNDEF(&returnMessages); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &remove_param, &type); remove = zephir_get_boolval(remove_param); if (!type) { - type = ZEPHIR_GLOBAL(global_null); + type = &type_sub; + type = &__$null; } ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdi", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0, dependencyInjector, "getshared", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "session"); + ZEPHIR_CALL_METHOD(&_0, &dependencyInjector, "getshared", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CPY_WRT(session, _0); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "_flashMessages", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&messages, session, "get", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_CPY_WRT(&session, &_0); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "_flashMessages"); + ZEPHIR_CALL_METHOD(&messages, &session, "get", NULL, 0, &_1); zephir_check_call_status(); if (Z_TYPE_P(type) == IS_STRING) { - ZEPHIR_OBS_VAR(returnMessages); - if (zephir_array_isset_fetch(&returnMessages, messages, type, 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&returnMessages); + if (zephir_array_isset_fetch(&returnMessages, &messages, type, 0 TSRMLS_CC)) { if (remove == 1) { zephir_array_unset(&messages, type, PH_SEPARATE); - ZEPHIR_INIT_VAR(_2$$5); - ZVAL_STRING(_2$$5, "_flashMessages", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, session, "set", NULL, 0, _2$$5, messages); - zephir_check_temp_parameter(_2$$5); + ZEPHIR_INIT_VAR(&_2$$5); + ZVAL_STRING(&_2$$5, "_flashMessages"); + ZEPHIR_CALL_METHOD(NULL, &session, "set", NULL, 0, &_2$$5, &messages); zephir_check_call_status(); } - RETURN_CCTOR(returnMessages); + RETURN_CCTOR(&returnMessages); } array_init(return_value); RETURN_MM(); } if (remove == 1) { - ZEPHIR_INIT_VAR(_3$$6); - ZVAL_STRING(_3$$6, "_flashMessages", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, session, "remove", NULL, 0, _3$$6); - zephir_check_temp_parameter(_3$$6); + ZEPHIR_INIT_VAR(&_3$$6); + ZVAL_STRING(&_3$$6, "_flashMessages"); + ZEPHIR_CALL_METHOD(NULL, &session, "remove", NULL, 0, &_3$$6); zephir_check_call_status(); } - RETURN_CCTOR(messages); + RETURN_CCTOR(&messages); } @@ -98,30 +107,35 @@ PHP_METHOD(Phalcon_Flash_Session, _getSessionMessages) { PHP_METHOD(Phalcon_Flash_Session, _setSessionMessages) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *messages_param = NULL, *dependencyInjector = NULL, *session = NULL, *_0 = NULL, *_1 = NULL; - zval *messages = NULL; + zval *messages_param = NULL, dependencyInjector, session, _0, _1; + zval messages; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&messages); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &messages_param); - messages = messages_param; + ZEPHIR_OBS_COPY_OR_DUP(&messages, messages_param); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdi", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0, dependencyInjector, "getshared", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "session"); + ZEPHIR_CALL_METHOD(&_0, &dependencyInjector, "getshared", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CPY_WRT(session, _0); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "_flashMessages", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, session, "set", NULL, 0, _1, messages); - zephir_check_temp_parameter(_1); + ZEPHIR_CPY_WRT(&session, &_0); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "_flashMessages"); + ZEPHIR_CALL_METHOD(NULL, &session, "set", NULL, 0, &_1, &messages); zephir_check_call_status(); - RETURN_CTOR(messages); + RETURN_CTOR(&messages); } @@ -131,31 +145,37 @@ PHP_METHOD(Phalcon_Flash_Session, _setSessionMessages) { PHP_METHOD(Phalcon_Flash_Session, message) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *message_param = NULL, *messages = NULL, *_0, *_1$$4; - zval *type = NULL, *message = NULL; + zval *type_param = NULL, *message_param = NULL, messages, _0, _1$$4; + zval type, message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&messages); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &message_param); - zephir_get_strval(type, type_param); - zephir_get_strval(message, message_param); + zephir_get_strval(&type, type_param); + zephir_get_strval(&message, message_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_BOOL(_0, 0); - ZEPHIR_CALL_METHOD(&messages, this_ptr, "_getsessionmessages", NULL, 0, _0); + ZVAL_BOOL(&_0, 0); + ZEPHIR_CALL_METHOD(&messages, this_ptr, "_getsessionmessages", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(messages) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(messages); - array_init(messages); + if (Z_TYPE_P(&messages) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&messages); + array_init(&messages); } - if (!(zephir_array_isset(messages, type))) { - ZEPHIR_INIT_VAR(_1$$4); - array_init(_1$$4); - zephir_array_update_zval(&messages, type, &_1$$4, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset(&messages, &type))) { + ZEPHIR_INIT_VAR(&_1$$4); + array_init(&_1$$4); + zephir_array_update_zval(&messages, &type, &_1$$4, PH_COPY | PH_SEPARATE); } - zephir_array_update_multi(&messages, &message TSRMLS_CC, SL("za"), 2, type); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_setsessionmessages", NULL, 0, messages); + zephir_array_update_multi(&messages, &message TSRMLS_CC, SL("za"), 2, &type); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_setsessionmessages", NULL, 0, &messages); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -167,23 +187,29 @@ PHP_METHOD(Phalcon_Flash_Session, message) { PHP_METHOD(Phalcon_Flash_Session, has) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type = NULL, *messages = NULL, *_0; + zval *type = NULL, type_sub, __$null, messages, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&messages); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &type); if (!type) { - type = ZEPHIR_GLOBAL(global_null); + type = &type_sub; + type = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_BOOL(_0, 0); - ZEPHIR_CALL_METHOD(&messages, this_ptr, "_getsessionmessages", NULL, 0, _0); + ZVAL_BOOL(&_0, 0); + ZEPHIR_CALL_METHOD(&messages, this_ptr, "_getsessionmessages", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(messages) == IS_ARRAY) { + if (Z_TYPE_P(&messages) == IS_ARRAY) { if (Z_TYPE_P(type) == IS_STRING) { - RETURN_MM_BOOL(zephir_array_isset(messages, type)); + RETURN_MM_BOOL(zephir_array_isset(&messages, type)); } RETURN_MM_BOOL(1); } @@ -198,13 +224,19 @@ PHP_METHOD(Phalcon_Flash_Session, getMessages) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool remove; - zval *type = NULL, *remove_param = NULL, *_0; + zval *type = NULL, type_sub, *remove_param = NULL, __$null, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &type, &remove_param); if (!type) { - type = ZEPHIR_GLOBAL(global_null); + type = &type_sub; + type = &__$null; } if (!remove_param) { remove = 1; @@ -213,13 +245,12 @@ PHP_METHOD(Phalcon_Flash_Session, getMessages) { } - ZEPHIR_INIT_VAR(_0); if (remove) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getsessionmessages", NULL, 0, _0, type); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getsessionmessages", NULL, 0, &_0, type); zephir_check_call_status(); RETURN_MM(); @@ -230,12 +261,18 @@ PHP_METHOD(Phalcon_Flash_Session, getMessages) { */ PHP_METHOD(Phalcon_Flash_Session, output) { - HashTable *_2$$3; - HashPosition _1$$3; + zend_string *_3$$3; + zend_ulong _2$$3; zephir_fcall_cache_entry *_4 = NULL, *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *remove_param = NULL, *type = NULL, *message = NULL, *messages = NULL, *_0, **_3$$3; + zval *remove_param = NULL, type, message, messages, _0, *_1$$3; zend_bool remove; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&messages); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &remove_param); @@ -247,27 +284,32 @@ PHP_METHOD(Phalcon_Flash_Session, output) { } - ZEPHIR_INIT_VAR(_0); if (remove) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_CALL_METHOD(&messages, this_ptr, "_getsessionmessages", NULL, 0, _0); + ZEPHIR_CALL_METHOD(&messages, this_ptr, "_getsessionmessages", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(messages) == IS_ARRAY) { - zephir_is_iterable(messages, &_2$$3, &_1$$3, 0, 0, "phalcon/flash/session.zep", 136); - for ( - ; zend_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS - ; zend_hash_move_forward_ex(_2$$3, &_1$$3) - ) { - ZEPHIR_GET_HMKEY(type, _2$$3, _1$$3); - ZEPHIR_GET_HVALUE(message, _3$$3); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "outputmessage", &_4, 0, type, message); + if (Z_TYPE_P(&messages) == IS_ARRAY) { + zephir_is_iterable(&messages, 0, "phalcon/flash/session.zep", 136); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&messages), _2$$3, _3$$3, _1$$3) + { + ZEPHIR_INIT_NVAR(&type); + if (_3$$3 != NULL) { + ZVAL_STR_COPY(&type, _3$$3); + } else { + ZVAL_LONG(&type, _2$$3); + } + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _1$$3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "outputmessage", &_4, 0, &type, &message); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); + ZEPHIR_INIT_NVAR(&type); } - ZEPHIR_CALL_PARENT(NULL, phalcon_flash_session_ce, getThis(), "clear", &_5, 217); + ZEPHIR_CALL_PARENT(NULL, phalcon_flash_session_ce, getThis(), "clear", &_5, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -278,17 +320,19 @@ PHP_METHOD(Phalcon_Flash_Session, output) { */ PHP_METHOD(Phalcon_Flash_Session, clear) { - zval *_0; + zval _0; zephir_fcall_cache_entry *_1 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_BOOL(_0, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_getsessionmessages", NULL, 0, _0); + ZVAL_BOOL(&_0, 1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_getsessionmessages", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_PARENT(NULL, phalcon_flash_session_ce, getThis(), "clear", &_1, 217); + ZEPHIR_CALL_PARENT(NULL, phalcon_flash_session_ce, getThis(), "clear", &_1, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/flash/session.zep.h b/ext/phalcon/flash/session.zep.h index 004b6310470..afb575b9aaf 100644 --- a/ext/phalcon/flash/session.zep.h +++ b/ext/phalcon/flash/session.zep.h @@ -11,31 +11,67 @@ PHP_METHOD(Phalcon_Flash_Session, getMessages); PHP_METHOD(Phalcon_Flash_Session, output); PHP_METHOD(Phalcon_Flash_Session, clear); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_session__getsessionmessages, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_session__getsessionmessages, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_session__getsessionmessages, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, remove, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, remove) +#endif ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_session__setsessionmessages, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_session__setsessionmessages, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_session__setsessionmessages, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, messages, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_session_message, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_session_has, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_session_has, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_session_has, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_session_getmessages, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_session_getmessages, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_flash_session_getmessages, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, type) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, remove, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, remove) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flash_session_output, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, remove, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, remove) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_flash_session_method_entry) { diff --git a/ext/phalcon/flashinterface.zep.h b/ext/phalcon/flashinterface.zep.h index d4d433b8af6..e71eab021b6 100644 --- a/ext/phalcon/flashinterface.zep.h +++ b/ext/phalcon/flashinterface.zep.h @@ -20,8 +20,16 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flashinterface_warning, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_flashinterface_message, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_flashinterface_method_entry) { diff --git a/ext/phalcon/forms/element.zep.c b/ext/phalcon/forms/element.zep.c index 5f14ee7a5c1..e3bc07c2a75 100644 --- a/ext/phalcon/forms/element.zep.c +++ b/ext/phalcon/forms/element.zep.c @@ -66,34 +66,42 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element) { PHP_METHOD(Phalcon_Forms_Element, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *attributes = NULL, *_0, *_1; - zval *name = NULL; + zval *name_param = NULL, *attributes = NULL, attributes_sub, __$null, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &attributes); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_INIT_VAR(_0); - zephir_fast_trim(_0, name, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); - zephir_get_strval(name, _0); - if (ZEPHIR_IS_EMPTY(name)) { + ZEPHIR_INIT_VAR(&_0); + zephir_fast_trim(&_0, &name, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); + zephir_get_strval(&name, &_0); + if (ZEPHIR_IS_EMPTY(&name)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(spl_ce_InvalidArgumentException, "Form element name is required", "phalcon/forms/element.zep", 66); return; } - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); if (Z_TYPE_P(attributes) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_attributes"), attributes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_attributes"), attributes); } - ZEPHIR_INIT_VAR(_1); - object_init_ex(_1, phalcon_validation_message_group_ce); - ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 3); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, phalcon_validation_message_group_ce); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 2); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_messages"), _1 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_messages"), &_1); ZEPHIR_MM_RESTORE(); } @@ -103,13 +111,16 @@ PHP_METHOD(Phalcon_Forms_Element, __construct) { */ PHP_METHOD(Phalcon_Forms_Element, setForm) { - zval *form; + zval *form, form_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&form_sub); zephir_fetch_params(0, 1, 0, &form); - zephir_update_property_this(getThis(), SL("_form"), form TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_form"), form); RETURN_THISW(); } @@ -119,7 +130,8 @@ PHP_METHOD(Phalcon_Forms_Element, setForm) { */ PHP_METHOD(Phalcon_Forms_Element, getForm) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_form"); @@ -131,24 +143,27 @@ PHP_METHOD(Phalcon_Forms_Element, getForm) { PHP_METHOD(Phalcon_Forms_Element, setName) { zval *name_param = NULL; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); RETURN_THIS(); } @@ -158,7 +173,8 @@ PHP_METHOD(Phalcon_Forms_Element, setName) { */ PHP_METHOD(Phalcon_Forms_Element, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -173,7 +189,10 @@ PHP_METHOD(Phalcon_Forms_Element, getName) { PHP_METHOD(Phalcon_Forms_Element, setFilters) { zend_bool _0; - zval *filters; + zval *filters, filters_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filters_sub); zephir_fetch_params(0, 1, 0, &filters); @@ -187,7 +206,7 @@ PHP_METHOD(Phalcon_Forms_Element, setFilters) { ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_forms_exception_ce, "Wrong filter type added", "phalcon/forms/element.zep", 119); return; } - zephir_update_property_this(getThis(), SL("_filters"), filters TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filters"), filters); RETURN_THISW(); } @@ -197,31 +216,37 @@ PHP_METHOD(Phalcon_Forms_Element, setFilters) { */ PHP_METHOD(Phalcon_Forms_Element, addFilter) { - zval *_0$$5, *_1$$6; - zval *filter_param = NULL, *filters = NULL; - zval *filter = NULL; + zval _0$$5, _1$$6; + zval *filter_param = NULL, filters; + zval filter; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&filters); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &filter_param); - zephir_get_strval(filter, filter_param); + zephir_get_strval(&filter, filter_param); - filters = zephir_fetch_nproperty_this(this_ptr, SL("_filters"), PH_NOISY_CC); - if (Z_TYPE_P(filters) == IS_ARRAY) { - zephir_update_property_array_append(this_ptr, SL("_filters"), filter TSRMLS_CC); + zephir_read_property(&filters, this_ptr, SL("_filters"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&filters) == IS_ARRAY) { + zephir_update_property_array_append(this_ptr, SL("_filters"), &filter TSRMLS_CC); } else { - if (Z_TYPE_P(filters) == IS_STRING) { - ZEPHIR_INIT_VAR(_0$$5); - zephir_create_array(_0$$5, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_0$$5, filters); - zephir_array_fast_append(_0$$5, filter); - zephir_update_property_this(getThis(), SL("_filters"), _0$$5 TSRMLS_CC); + if (Z_TYPE_P(&filters) == IS_STRING) { + ZEPHIR_INIT_VAR(&_0$$5); + zephir_create_array(&_0$$5, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_0$$5, &filters); + zephir_array_fast_append(&_0$$5, &filter); + zephir_update_property_zval(this_ptr, SL("_filters"), &_0$$5); } else { - ZEPHIR_INIT_VAR(_1$$6); - zephir_create_array(_1$$6, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_1$$6, filter); - zephir_update_property_this(getThis(), SL("_filters"), _1$$6 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$6); + zephir_create_array(&_1$$6, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_1$$6, &filter); + zephir_update_property_zval(this_ptr, SL("_filters"), &_1$$6); } } RETURN_THIS(); @@ -235,7 +260,8 @@ PHP_METHOD(Phalcon_Forms_Element, addFilter) { */ PHP_METHOD(Phalcon_Forms_Element, getFilters) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_filters"); @@ -250,13 +276,18 @@ PHP_METHOD(Phalcon_Forms_Element, getFilters) { PHP_METHOD(Phalcon_Forms_Element, addValidators) { zend_bool merge; - zval *validators_param = NULL, *merge_param = NULL, *currentValidators = NULL, *mergedValidators = NULL; - zval *validators = NULL; + zval *validators_param = NULL, *merge_param = NULL, currentValidators, mergedValidators; + zval validators; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&validators); + ZVAL_UNDEF(¤tValidators); + ZVAL_UNDEF(&mergedValidators); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &validators_param, &merge_param); - validators = validators_param; + ZEPHIR_OBS_COPY_OR_DUP(&validators, validators_param); if (!merge_param) { merge = 1; } else { @@ -265,16 +296,16 @@ PHP_METHOD(Phalcon_Forms_Element, addValidators) { if (merge) { - ZEPHIR_OBS_VAR(currentValidators); - zephir_read_property_this(¤tValidators, this_ptr, SL("_validators"), PH_NOISY_CC); - if (Z_TYPE_P(currentValidators) == IS_ARRAY) { - ZEPHIR_INIT_VAR(mergedValidators); - zephir_fast_array_merge(mergedValidators, &(currentValidators), &(validators) TSRMLS_CC); + ZEPHIR_OBS_VAR(¤tValidators); + zephir_read_property(¤tValidators, this_ptr, SL("_validators"), PH_NOISY_CC); + if (Z_TYPE_P(¤tValidators) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&mergedValidators); + zephir_fast_array_merge(&mergedValidators, ¤tValidators, &validators TSRMLS_CC); } } else { - ZEPHIR_CPY_WRT(mergedValidators, validators); + ZEPHIR_CPY_WRT(&mergedValidators, &validators); } - zephir_update_property_this(getThis(), SL("_validators"), mergedValidators TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_validators"), &mergedValidators); RETURN_THIS(); } @@ -284,7 +315,10 @@ PHP_METHOD(Phalcon_Forms_Element, addValidators) { */ PHP_METHOD(Phalcon_Forms_Element, addValidator) { - zval *validator; + zval *validator, validator_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&validator_sub); zephir_fetch_params(0, 1, 0, &validator); @@ -300,7 +334,8 @@ PHP_METHOD(Phalcon_Forms_Element, addValidator) { */ PHP_METHOD(Phalcon_Forms_Element, getValidators) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_validators"); @@ -314,17 +349,28 @@ PHP_METHOD(Phalcon_Forms_Element, prepareAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool useChecked; - zval *attributes_param = NULL, *useChecked_param = NULL, *value = NULL, *name = NULL, *widgetAttributes = NULL, *mergedAttributes = NULL, *defaultAttributes = NULL, *currentValue = NULL, *_0$$10, *_1$$12; - zval *attributes = NULL; + zval *attributes_param = NULL, *useChecked_param = NULL, value, name, widgetAttributes, mergedAttributes, defaultAttributes, currentValue, _0$$10, _1$$12; + zval attributes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&widgetAttributes); + ZVAL_UNDEF(&mergedAttributes); + ZVAL_UNDEF(&defaultAttributes); + ZVAL_UNDEF(¤tValue); + ZVAL_UNDEF(&_0$$10); + ZVAL_UNDEF(&_1$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &attributes_param, &useChecked_param); if (!attributes_param) { - ZEPHIR_INIT_VAR(attributes); - array_init(attributes); + ZEPHIR_INIT_VAR(&attributes); + array_init(&attributes); } else { - zephir_get_arrval(attributes, attributes_param); + zephir_get_arrval(&attributes, attributes_param); } if (!useChecked_param) { useChecked = 0; @@ -333,37 +379,37 @@ PHP_METHOD(Phalcon_Forms_Element, prepareAttributes) { } - ZEPHIR_OBS_VAR(name); - zephir_read_property_this(&name, this_ptr, SL("_name"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&name); + zephir_read_property(&name, this_ptr, SL("_name"), PH_NOISY_CC); if (1 != 1) { - ZEPHIR_INIT_VAR(widgetAttributes); - array_init(widgetAttributes); + ZEPHIR_INIT_VAR(&widgetAttributes); + array_init(&widgetAttributes); } else { - ZEPHIR_CPY_WRT(widgetAttributes, attributes); + ZEPHIR_CPY_WRT(&widgetAttributes, &attributes); } zephir_array_update_long(&widgetAttributes, 0, &name, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - ZEPHIR_OBS_VAR(defaultAttributes); - zephir_read_property_this(&defaultAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); - if (Z_TYPE_P(defaultAttributes) == IS_ARRAY) { - ZEPHIR_INIT_VAR(mergedAttributes); - zephir_fast_array_merge(mergedAttributes, &(defaultAttributes), &(widgetAttributes) TSRMLS_CC); + ZEPHIR_OBS_VAR(&defaultAttributes); + zephir_read_property(&defaultAttributes, this_ptr, SL("_attributes"), PH_NOISY_CC); + if (Z_TYPE_P(&defaultAttributes) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&mergedAttributes); + zephir_fast_array_merge(&mergedAttributes, &defaultAttributes, &widgetAttributes TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(mergedAttributes, widgetAttributes); + ZEPHIR_CPY_WRT(&mergedAttributes, &widgetAttributes); } ZEPHIR_CALL_METHOD(&value, this_ptr, "getvalue", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(value) != IS_NULL) { + if (Z_TYPE_P(&value) != IS_NULL) { if (useChecked) { - if (zephir_array_isset_string_fetch(¤tValue, mergedAttributes, SS("value"), 1 TSRMLS_CC)) { - if (ZEPHIR_IS_EQUAL(currentValue, value)) { - ZEPHIR_INIT_VAR(_0$$10); - ZVAL_STRING(_0$$10, "checked", 1); + if (zephir_array_isset_string_fetch(¤tValue, &mergedAttributes, SL("value"), 1)) { + if (ZEPHIR_IS_EQUAL(¤tValue, &value)) { + ZEPHIR_INIT_VAR(&_0$$10); + ZVAL_STRING(&_0$$10, "checked"); zephir_array_update_string(&mergedAttributes, SL("checked"), &_0$$10, PH_COPY | PH_SEPARATE); } } else { - if (zephir_is_true(value)) { - ZEPHIR_INIT_VAR(_1$$12); - ZVAL_STRING(_1$$12, "checked", 1); + if (zephir_is_true(&value)) { + ZEPHIR_INIT_VAR(&_1$$12); + ZVAL_STRING(&_1$$12, "checked"); zephir_array_update_string(&mergedAttributes, SL("checked"), &_1$$12, PH_COPY | PH_SEPARATE); } zephir_array_update_string(&mergedAttributes, SL("value"), &value, PH_COPY | PH_SEPARATE); @@ -372,7 +418,7 @@ PHP_METHOD(Phalcon_Forms_Element, prepareAttributes) { zephir_array_update_string(&mergedAttributes, SL("value"), &value, PH_COPY | PH_SEPARATE); } } - RETURN_CCTOR(mergedAttributes); + RETURN_CCTOR(&mergedAttributes); } @@ -385,16 +431,20 @@ PHP_METHOD(Phalcon_Forms_Element, prepareAttributes) { */ PHP_METHOD(Phalcon_Forms_Element, setAttribute) { - zval *attribute_param = NULL, *value; - zval *attribute = NULL; + zval *attribute_param = NULL, *value, value_sub; + zval attribute; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &attribute_param, &value); - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); - zephir_update_property_array(this_ptr, SL("_attributes"), attribute, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_attributes"), &attribute, value TSRMLS_CC); RETURN_THIS(); } @@ -408,21 +458,29 @@ PHP_METHOD(Phalcon_Forms_Element, setAttribute) { */ PHP_METHOD(Phalcon_Forms_Element, getAttribute) { - zval *attribute_param = NULL, *defaultValue = NULL, *attributes = NULL, *value = NULL; - zval *attribute = NULL; + zval *attribute_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, attributes, value; + zval attribute; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &attribute_param, &defaultValue); - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } - attributes = zephir_fetch_nproperty_this(this_ptr, SL("_attributes"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&value, attributes, attribute, 1 TSRMLS_CC)) { - RETURN_CTOR(value); + zephir_read_property(&attributes, this_ptr, SL("_attributes"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&value, &attributes, &attribute, 1 TSRMLS_CC)) { + RETURN_CTOR(&value); } RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); @@ -435,15 +493,19 @@ PHP_METHOD(Phalcon_Forms_Element, getAttribute) { PHP_METHOD(Phalcon_Forms_Element, setAttributes) { zval *attributes_param = NULL; - zval *attributes = NULL; + zval attributes; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &attributes_param); + ZVAL_UNDEF(&attributes); - attributes = attributes_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &attributes_param); + ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param); - zephir_update_property_this(getThis(), SL("_attributes"), attributes TSRMLS_CC); - RETURN_THISW(); + + zephir_update_property_zval(this_ptr, SL("_attributes"), &attributes); + RETURN_THIS(); } @@ -452,15 +514,18 @@ PHP_METHOD(Phalcon_Forms_Element, setAttributes) { */ PHP_METHOD(Phalcon_Forms_Element, getAttributes) { - zval *attributes = NULL; + zval attributes; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&attributes); - attributes = zephir_fetch_nproperty_this(this_ptr, SL("_attributes"), PH_NOISY_CC); - if (Z_TYPE_P(attributes) != IS_ARRAY) { + + zephir_read_property(&attributes, this_ptr, SL("_attributes"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&attributes) != IS_ARRAY) { array_init(return_value); return; } - RETURN_CTORW(attributes); + RETURN_CTORW(&attributes); } @@ -473,16 +538,20 @@ PHP_METHOD(Phalcon_Forms_Element, getAttributes) { */ PHP_METHOD(Phalcon_Forms_Element, setUserOption) { - zval *option_param = NULL, *value; - zval *option = NULL; + zval *option_param = NULL, *value, value_sub; + zval option; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &option_param, &value); - zephir_get_strval(option, option_param); + zephir_get_strval(&option, option_param); - zephir_update_property_array(this_ptr, SL("_options"), option, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_options"), &option, value TSRMLS_CC); RETURN_THIS(); } @@ -496,21 +565,29 @@ PHP_METHOD(Phalcon_Forms_Element, setUserOption) { */ PHP_METHOD(Phalcon_Forms_Element, getUserOption) { - zval *option_param = NULL, *defaultValue = NULL, *value = NULL, *_0; - zval *option = NULL; + zval *option_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, _0; + zval option; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &option_param, &defaultValue); - zephir_get_strval(option, option_param); + zephir_get_strval(&option, option_param); if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&value, _0, option, 1 TSRMLS_CC)) { - RETURN_CTOR(value); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&value, &_0, &option, 1 TSRMLS_CC)) { + RETURN_CTOR(&value); } RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); @@ -523,15 +600,18 @@ PHP_METHOD(Phalcon_Forms_Element, getUserOption) { PHP_METHOD(Phalcon_Forms_Element, setUserOptions) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &options_param); - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &options); RETURN_THIS(); } @@ -541,7 +621,8 @@ PHP_METHOD(Phalcon_Forms_Element, setUserOptions) { */ PHP_METHOD(Phalcon_Forms_Element, getUserOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -553,15 +634,18 @@ PHP_METHOD(Phalcon_Forms_Element, getUserOptions) { PHP_METHOD(Phalcon_Forms_Element, setLabel) { zval *label_param = NULL; - zval *label = NULL; + zval label; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&label); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &label_param); - zephir_get_strval(label, label_param); + zephir_get_strval(&label, label_param); - zephir_update_property_this(getThis(), SL("_label"), label TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_label"), &label); RETURN_THIS(); } @@ -571,7 +655,8 @@ PHP_METHOD(Phalcon_Forms_Element, setLabel) { */ PHP_METHOD(Phalcon_Forms_Element, getLabel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_label"); @@ -587,13 +672,25 @@ PHP_METHOD(Phalcon_Forms_Element, label) { zend_bool _2; zephir_fcall_cache_entry *_0 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes = NULL, *internalAttributes = NULL, *label = NULL, *name = NULL, *code = NULL, *_1, *_3$$7, *_4$$8; + zval *attributes = NULL, attributes_sub, __$null, internalAttributes, label, name, code, _1, _3$$7, _4$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&internalAttributes); + ZVAL_UNDEF(&label); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - ZEPHIR_CPY_WRT(attributes, ZEPHIR_GLOBAL(global_null)); + attributes = &attributes_sub; + ZEPHIR_CPY_WRT(attributes, &__$null); } else { ZEPHIR_SEPARATE_PARAM(attributes); } @@ -601,41 +698,40 @@ PHP_METHOD(Phalcon_Forms_Element, label) { ZEPHIR_CALL_METHOD(&internalAttributes, this_ptr, "getattributes", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(name); - if (!(zephir_array_isset_string_fetch(&name, internalAttributes, SS("id"), 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(name); - zephir_read_property_this(&name, this_ptr, SL("_name"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&name); + if (!(zephir_array_isset_string_fetch(&name, &internalAttributes, SL("id"), 0))) { + ZEPHIR_OBS_NVAR(&name); + zephir_read_property(&name, this_ptr, SL("_name"), PH_NOISY_CC); } if (Z_TYPE_P(attributes) == IS_ARRAY) { - if (!(zephir_array_isset_string(attributes, SS("for")))) { - zephir_array_update_string(&attributes, SL("for"), &name, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(attributes, SL("for")))) { + zephir_array_update_string(attributes, SL("for"), &name, PH_COPY | PH_SEPARATE); } } else { ZEPHIR_INIT_NVAR(attributes); zephir_create_array(attributes, 1, 0 TSRMLS_CC); - zephir_array_update_string(&attributes, SL("for"), &name, PH_COPY | PH_SEPARATE); + zephir_array_update_string(attributes, SL("for"), &name, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "", label, ""); - zephir_concat_self(&code, _3$$7 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$7); + ZEPHIR_CONCAT_SVS(&_3$$7, ">", &label, ""); + zephir_concat_self(&code, &_3$$7 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_4$$8); - ZEPHIR_CONCAT_SVS(_4$$8, ">", name, ""); - zephir_concat_self(&code, _4$$8 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$8); + ZEPHIR_CONCAT_SVS(&_4$$8, ">", &name, ""); + zephir_concat_self(&code, &_4$$8 TSRMLS_CC); } - RETURN_CCTOR(code); + RETURN_CCTOR(&code); } @@ -648,13 +744,16 @@ PHP_METHOD(Phalcon_Forms_Element, label) { */ PHP_METHOD(Phalcon_Forms_Element, setDefault) { - zval *value; + zval *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); zephir_fetch_params(0, 1, 0, &value); - zephir_update_property_this(getThis(), SL("_value"), value TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_value"), value); RETURN_THISW(); } @@ -664,7 +763,8 @@ PHP_METHOD(Phalcon_Forms_Element, setDefault) { */ PHP_METHOD(Phalcon_Forms_Element, getDefault) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_value"); @@ -676,37 +776,43 @@ PHP_METHOD(Phalcon_Forms_Element, getDefault) { PHP_METHOD(Phalcon_Forms_Element, getValue) { zend_bool _0$$3; - zval *name = NULL, *form = NULL, *value = NULL, *_1$$3 = NULL; + zval name, form, value, _1$$3; zephir_fcall_cache_entry *_2 = NULL, *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&form); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(name); - zephir_read_property_this(&name, this_ptr, SL("_name"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(value); - ZVAL_NULL(value); - ZEPHIR_OBS_VAR(form); - zephir_read_property_this(&form, this_ptr, SL("_form"), PH_NOISY_CC); - if (Z_TYPE_P(form) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&value, form, "getvalue", NULL, 0, name); + ZEPHIR_OBS_VAR(&name); + zephir_read_property(&name, this_ptr, SL("_name"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&value); + ZVAL_NULL(&value); + ZEPHIR_OBS_VAR(&form); + zephir_read_property(&form, this_ptr, SL("_form"), PH_NOISY_CC); + if (Z_TYPE_P(&form) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&value, &form, "getvalue", NULL, 0, &name); zephir_check_call_status(); - _0$$3 = Z_TYPE_P(value) == IS_NULL; + _0$$3 = Z_TYPE_P(&value) == IS_NULL; if (_0$$3) { - ZEPHIR_CALL_CE_STATIC(&_1$$3, phalcon_tag_ce, "hasvalue", &_2, 5, name); + ZEPHIR_CALL_CE_STATIC(&_1$$3, phalcon_tag_ce, "hasvalue", &_2, 0, &name); zephir_check_call_status(); - _0$$3 = zephir_is_true(_1$$3); + _0$$3 = zephir_is_true(&_1$$3); } if (_0$$3) { - ZEPHIR_CALL_CE_STATIC(&value, phalcon_tag_ce, "getvalue", &_3, 6, name); + ZEPHIR_CALL_CE_STATIC(&value, phalcon_tag_ce, "getvalue", &_3, 0, &name); zephir_check_call_status(); } } - if (Z_TYPE_P(value) == IS_NULL) { - ZEPHIR_OBS_NVAR(value); - zephir_read_property_this(&value, this_ptr, SL("_value"), PH_NOISY_CC); + if (Z_TYPE_P(&value) == IS_NULL) { + ZEPHIR_OBS_NVAR(&value); + zephir_read_property(&value, this_ptr, SL("_value"), PH_NOISY_CC); } - RETURN_CCTOR(value); + RETURN_CCTOR(&value); } @@ -716,7 +822,8 @@ PHP_METHOD(Phalcon_Forms_Element, getValue) { */ PHP_METHOD(Phalcon_Forms_Element, getMessages) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_messages"); @@ -727,11 +834,14 @@ PHP_METHOD(Phalcon_Forms_Element, getMessages) { */ PHP_METHOD(Phalcon_Forms_Element, hasMessages) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_messages"), PH_NOISY_CC); - RETURN_BOOL(zephir_fast_count_int(_0 TSRMLS_CC) > 0); + + zephir_read_property(&_0, this_ptr, SL("_messages"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_fast_count_int(&_0 TSRMLS_CC) > 0); } @@ -740,13 +850,16 @@ PHP_METHOD(Phalcon_Forms_Element, hasMessages) { */ PHP_METHOD(Phalcon_Forms_Element, setMessages) { - zval *group; + zval *group, group_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&group_sub); zephir_fetch_params(0, 1, 0, &group); - zephir_update_property_this(getThis(), SL("_messages"), group TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_messages"), group); RETURN_THISW(); } @@ -757,15 +870,19 @@ PHP_METHOD(Phalcon_Forms_Element, setMessages) { PHP_METHOD(Phalcon_Forms_Element, appendMessage) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message, *_0; + zval *message, message_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &message); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_messages"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "appendmessage", NULL, 0, message); + zephir_read_property(&_0, this_ptr, SL("_messages"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "appendmessage", NULL, 0, message); zephir_check_call_status(); RETURN_THIS(); @@ -776,16 +893,19 @@ PHP_METHOD(Phalcon_Forms_Element, appendMessage) { */ PHP_METHOD(Phalcon_Forms_Element, clear) { - zval *_1, *_2; + zval _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_name"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZVAL_NULL(_2); - ZEPHIR_CALL_CE_STATIC(NULL, phalcon_tag_ce, "setdefault", &_0, 7, _1, _2); + zephir_read_property(&_1, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY); + ZVAL_NULL(&_2); + ZEPHIR_CALL_CE_STATIC(NULL, phalcon_tag_ce, "setdefault", &_0, 0, &_1, &_2); zephir_check_call_status(); RETURN_THIS(); @@ -797,6 +917,8 @@ PHP_METHOD(Phalcon_Forms_Element, clear) { PHP_METHOD(Phalcon_Forms_Element, __toString) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -806,34 +928,25 @@ PHP_METHOD(Phalcon_Forms_Element, __toString) { } -zend_object_value zephir_init_properties_Phalcon_Forms_Element(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Forms_Element(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_validators"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_validators"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_validators"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_validators"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/forms/element.zep.h b/ext/phalcon/forms/element.zep.h index e5fe5ed7e0e..35e7da1ba99 100644 --- a/ext/phalcon/forms/element.zep.h +++ b/ext/phalcon/forms/element.zep.h @@ -35,123 +35,297 @@ PHP_METHOD(Phalcon_Forms_Element, setMessages); PHP_METHOD(Phalcon_Forms_Element, appendMessage); PHP_METHOD(Phalcon_Forms_Element, clear); PHP_METHOD(Phalcon_Forms_Element, __toString); -zend_object_value zephir_init_properties_Phalcon_Forms_Element(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Forms_Element(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setform, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setform, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setform, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, form, Phalcon\\Forms\\Form, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_getform, 0, 0, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getform, 0, 0, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setname, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setname, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setfilters, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setfilters, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setfilters, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_INFO(0, filters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_addfilter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_addfilter, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_addfilter, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_addvalidators, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_addvalidators, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_addvalidators, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, validators, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_addvalidator, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_addvalidator, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_addvalidator, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, validator, Phalcon\\Validation\\ValidatorInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_prepareattributes, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_getvalidators, 0, 0, Phalcon\\Validation\\ValidatorInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getvalidators, 0, 0, IS_OBJECT, "Phalcon\\Validation\\ValidatorInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_prepareattributes, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_prepareattributes, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useChecked, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useChecked) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setattribute, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setattribute, 0, 2, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setattribute, 0, 2, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_getattribute, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setattributes, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setattributes, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setuseroption, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getattributes, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getattributes, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setuseroption, 0, 2, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setuseroption, 0, 2, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +#else ZEND_ARG_INFO(0, option) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_getuseroption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +#else ZEND_ARG_INFO(0, option) +#endif ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setuseroptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setuseroptions, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setuseroptions, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setlabel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getuseroptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getuseroptions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setlabel, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setlabel, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, label, IS_STRING, 0) +#else ZEND_ARG_INFO(0, label) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_label, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getlabel, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getlabel, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_label, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_label, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setdefault, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setdefault, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setdefault, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_setmessages, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_getmessages, 0, 0, Phalcon\\Validation\\Message\\Group, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Validation\\Message\\Group", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_hasmessages, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_hasmessages, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_setmessages, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_setmessages, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, group, Phalcon\\Validation\\Message\\Group, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_appendmessage, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_appendmessage, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_appendmessage, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, message, Phalcon\\Validation\\MessageInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_clear, 0, 0, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_clear, 0, 0, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element___tostring, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element___tostring, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_forms_element_method_entry) { PHP_ME(Phalcon_Forms_Element, __construct, arginfo_phalcon_forms_element___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Forms_Element, setForm, arginfo_phalcon_forms_element_setform, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, getForm, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, getForm, arginfo_phalcon_forms_element_getform, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, setName, arginfo_phalcon_forms_element_setname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, getName, arginfo_phalcon_forms_element_getname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, setFilters, arginfo_phalcon_forms_element_setfilters, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, addFilter, arginfo_phalcon_forms_element_addfilter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, getFilters, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, addValidators, arginfo_phalcon_forms_element_addvalidators, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, addValidator, arginfo_phalcon_forms_element_addvalidator, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, getValidators, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, getValidators, arginfo_phalcon_forms_element_getvalidators, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, prepareAttributes, arginfo_phalcon_forms_element_prepareattributes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, setAttribute, arginfo_phalcon_forms_element_setattribute, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, getAttribute, arginfo_phalcon_forms_element_getattribute, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, setAttributes, arginfo_phalcon_forms_element_setattributes, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, getAttributes, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, getAttributes, arginfo_phalcon_forms_element_getattributes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, setUserOption, arginfo_phalcon_forms_element_setuseroption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, getUserOption, arginfo_phalcon_forms_element_getuseroption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, setUserOptions, arginfo_phalcon_forms_element_setuseroptions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, getUserOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, getUserOptions, arginfo_phalcon_forms_element_getuseroptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, setLabel, arginfo_phalcon_forms_element_setlabel, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, getLabel, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, getLabel, arginfo_phalcon_forms_element_getlabel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, label, arginfo_phalcon_forms_element_label, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, setDefault, arginfo_phalcon_forms_element_setdefault, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, getDefault, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, getValue, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, getMessages, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, hasMessages, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, getMessages, arginfo_phalcon_forms_element_getmessages, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, hasMessages, arginfo_phalcon_forms_element_hasmessages, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, setMessages, arginfo_phalcon_forms_element_setmessages, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Element, appendMessage, arginfo_phalcon_forms_element_appendmessage, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, clear, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Element, __toString, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, clear, arginfo_phalcon_forms_element_clear, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Element, __toString, arginfo_phalcon_forms_element___tostring, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/forms/element/check.zep.c b/ext/phalcon/forms/element/check.zep.c index 859f752f927..fd47381b9c6 100644 --- a/ext/phalcon/forms/element/check.zep.c +++ b/ext/phalcon/forms/element/check.zep.c @@ -38,21 +38,27 @@ PHP_METHOD(Phalcon_Forms_Element_Check, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL, *_2; + zval *attributes = NULL, attributes_sub, __$null, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_INIT_VAR(_2); - ZVAL_BOOL(_2, 1); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes, _2); + ZVAL_BOOL(&_2, 1); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes, &_2); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "checkfield", &_0, 218, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "checkfield", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/check.zep.h b/ext/phalcon/forms/element/check.zep.h index 02625cfdb00..4b1afdc5b4d 100644 --- a/ext/phalcon/forms/element/check.zep.h +++ b/ext/phalcon/forms/element/check.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Check); PHP_METHOD(Phalcon_Forms_Element_Check, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_check_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_check_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_check_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/date.zep.c b/ext/phalcon/forms/element/date.zep.c index 1605faf348b..b0c29327823 100644 --- a/ext/phalcon/forms/element/date.zep.c +++ b/ext/phalcon/forms/element/date.zep.c @@ -38,19 +38,25 @@ PHP_METHOD(Phalcon_Forms_Element_Date, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL; + zval *attributes = NULL, attributes_sub, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "datefield", &_0, 219, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "datefield", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/date.zep.h b/ext/phalcon/forms/element/date.zep.h index 71c2a6c3b85..97d2a19439c 100644 --- a/ext/phalcon/forms/element/date.zep.h +++ b/ext/phalcon/forms/element/date.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Date); PHP_METHOD(Phalcon_Forms_Element_Date, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_date_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_date_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_date_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/email.zep.c b/ext/phalcon/forms/element/email.zep.c index a0434ac83ca..401689eeb6f 100644 --- a/ext/phalcon/forms/element/email.zep.c +++ b/ext/phalcon/forms/element/email.zep.c @@ -38,19 +38,25 @@ PHP_METHOD(Phalcon_Forms_Element_Email, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL; + zval *attributes = NULL, attributes_sub, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "emailfield", &_0, 220, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "emailfield", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/email.zep.h b/ext/phalcon/forms/element/email.zep.h index a98688655be..46737f4daa3 100644 --- a/ext/phalcon/forms/element/email.zep.h +++ b/ext/phalcon/forms/element/email.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Email); PHP_METHOD(Phalcon_Forms_Element_Email, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_email_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_email_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_email_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/file.zep.c b/ext/phalcon/forms/element/file.zep.c index a388a948894..7750dc23a83 100644 --- a/ext/phalcon/forms/element/file.zep.c +++ b/ext/phalcon/forms/element/file.zep.c @@ -38,19 +38,25 @@ PHP_METHOD(Phalcon_Forms_Element_File, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL; + zval *attributes = NULL, attributes_sub, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "filefield", &_0, 221, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "filefield", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/file.zep.h b/ext/phalcon/forms/element/file.zep.h index f8cb40aefcf..93c03bc5a74 100644 --- a/ext/phalcon/forms/element/file.zep.h +++ b/ext/phalcon/forms/element/file.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_File); PHP_METHOD(Phalcon_Forms_Element_File, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_file_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_file_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_file_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/hidden.zep.c b/ext/phalcon/forms/element/hidden.zep.c index ebb3450ad19..ac56c9db2d3 100644 --- a/ext/phalcon/forms/element/hidden.zep.c +++ b/ext/phalcon/forms/element/hidden.zep.c @@ -38,19 +38,25 @@ PHP_METHOD(Phalcon_Forms_Element_Hidden, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL; + zval *attributes = NULL, attributes_sub, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "hiddenfield", &_0, 222, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "hiddenfield", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/hidden.zep.h b/ext/phalcon/forms/element/hidden.zep.h index 6f7008110d3..8fb4f552618 100644 --- a/ext/phalcon/forms/element/hidden.zep.h +++ b/ext/phalcon/forms/element/hidden.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Hidden); PHP_METHOD(Phalcon_Forms_Element_Hidden, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_hidden_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_hidden_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_hidden_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/numeric.zep.c b/ext/phalcon/forms/element/numeric.zep.c index 761574e606c..6d6a328a34e 100644 --- a/ext/phalcon/forms/element/numeric.zep.c +++ b/ext/phalcon/forms/element/numeric.zep.c @@ -38,19 +38,25 @@ PHP_METHOD(Phalcon_Forms_Element_Numeric, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL; + zval *attributes = NULL, attributes_sub, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "numericfield", &_0, 223, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "numericfield", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/numeric.zep.h b/ext/phalcon/forms/element/numeric.zep.h index 92e2f0f268d..3cd01f62334 100644 --- a/ext/phalcon/forms/element/numeric.zep.h +++ b/ext/phalcon/forms/element/numeric.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Numeric); PHP_METHOD(Phalcon_Forms_Element_Numeric, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_numeric_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_numeric_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_numeric_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/password.zep.c b/ext/phalcon/forms/element/password.zep.c index e8c0ad233f0..93f235b78fa 100644 --- a/ext/phalcon/forms/element/password.zep.c +++ b/ext/phalcon/forms/element/password.zep.c @@ -38,19 +38,25 @@ PHP_METHOD(Phalcon_Forms_Element_Password, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL; + zval *attributes = NULL, attributes_sub, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "passwordfield", &_0, 224, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "passwordfield", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/password.zep.h b/ext/phalcon/forms/element/password.zep.h index 9c38057b598..c471857e054 100644 --- a/ext/phalcon/forms/element/password.zep.h +++ b/ext/phalcon/forms/element/password.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Password); PHP_METHOD(Phalcon_Forms_Element_Password, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_password_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_password_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_password_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/radio.zep.c b/ext/phalcon/forms/element/radio.zep.c index 54a275c94a1..dad93b4d4d1 100644 --- a/ext/phalcon/forms/element/radio.zep.c +++ b/ext/phalcon/forms/element/radio.zep.c @@ -38,21 +38,27 @@ PHP_METHOD(Phalcon_Forms_Element_Radio, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL, *_2; + zval *attributes = NULL, attributes_sub, __$null, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_INIT_VAR(_2); - ZVAL_BOOL(_2, 1); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes, _2); + ZVAL_BOOL(&_2, 1); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes, &_2); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "radiofield", &_0, 225, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "radiofield", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/radio.zep.h b/ext/phalcon/forms/element/radio.zep.h index 0526b895fdb..f0f175d1bb6 100644 --- a/ext/phalcon/forms/element/radio.zep.h +++ b/ext/phalcon/forms/element/radio.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Radio); PHP_METHOD(Phalcon_Forms_Element_Radio, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_radio_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_radio_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_radio_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/select.zep.c b/ext/phalcon/forms/element/select.zep.c index f280af32501..8db818122cb 100644 --- a/ext/phalcon/forms/element/select.zep.c +++ b/ext/phalcon/forms/element/select.zep.c @@ -44,23 +44,31 @@ PHP_METHOD(Phalcon_Forms_Element_Select, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *name_param = NULL, *options = NULL, *attributes = NULL; - zval *name = NULL; + zval *name_param = NULL, *options = NULL, options_sub, *attributes = NULL, attributes_sub, __$null; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&options_sub); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &name_param, &options, &attributes); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - zephir_update_property_this(getThis(), SL("_optionsValues"), options TSRMLS_CC); - ZEPHIR_CALL_PARENT(NULL, phalcon_forms_element_select_ce, getThis(), "__construct", &_0, 226, name, attributes); + zephir_update_property_zval(this_ptr, SL("_optionsValues"), options); + ZEPHIR_CALL_PARENT(NULL, phalcon_forms_element_select_ce, getThis(), "__construct", &_0, 0, &name, attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -74,13 +82,16 @@ PHP_METHOD(Phalcon_Forms_Element_Select, __construct) { */ PHP_METHOD(Phalcon_Forms_Element_Select, setOptions) { - zval *options; + zval *options, options_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); zephir_fetch_params(0, 1, 0, &options); - zephir_update_property_this(getThis(), SL("_optionsValues"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_optionsValues"), options); RETURN_THISW(); } @@ -92,7 +103,8 @@ PHP_METHOD(Phalcon_Forms_Element_Select, setOptions) { */ PHP_METHOD(Phalcon_Forms_Element_Select, getOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_optionsValues"); @@ -106,9 +118,14 @@ PHP_METHOD(Phalcon_Forms_Element_Select, getOptions) { */ PHP_METHOD(Phalcon_Forms_Element_Select, addOption) { - HashTable *_1$$3; - HashPosition _0$$3; - zval *option, *key = NULL, *value = NULL, **_2$$3; + zend_string *_2$$3; + zend_ulong _1$$3; + zval *option, option_sub, key, value, *_0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &option); @@ -116,15 +133,21 @@ PHP_METHOD(Phalcon_Forms_Element_Select, addOption) { if (Z_TYPE_P(option) == IS_ARRAY) { - zephir_is_iterable(option, &_1$$3, &_0$$3, 0, 0, "phalcon/forms/element/select.zep", 84); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(value, _2$$3); - zephir_update_property_array(this_ptr, SL("_optionsValues"), key, value TSRMLS_CC); - } + zephir_is_iterable(option, 0, "phalcon/forms/element/select.zep", 84); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(option), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&key, _2$$3); + } else { + ZVAL_LONG(&key, _1$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0$$3); + zephir_update_property_array(this_ptr, SL("_optionsValues"), &key, &value TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } else { zephir_update_property_array_append(this_ptr, SL("_optionsValues"), option TSRMLS_CC); } @@ -141,20 +164,27 @@ PHP_METHOD(Phalcon_Forms_Element_Select, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL, *_2; + zval *attributes = NULL, attributes_sub, __$null, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_optionsValues"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", &_0, 227, _1, _2); + zephir_read_property(&_2, this_ptr, SL("_optionsValues"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", &_0, 0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/select.zep.h b/ext/phalcon/forms/element/select.zep.h index d8ba7a78f8c..85c368b00d5 100644 --- a/ext/phalcon/forms/element/select.zep.h +++ b/ext/phalcon/forms/element/select.zep.h @@ -10,20 +10,36 @@ PHP_METHOD(Phalcon_Forms_Element_Select, addOption); PHP_METHOD(Phalcon_Forms_Element_Select, render); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_select___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, options) ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_select_setoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_select_setoptions, 0, 1, Phalcon\\Forms\\Element, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_select_setoptions, 0, 1, IS_OBJECT, "Phalcon\\Forms\\Element", 0) +#endif ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_select_addoption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_element_select_addoption, 0, 1, Phalcon\\Forms\\Element, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_select_addoption, 0, 1, IS_OBJECT, "Phalcon\\Forms\\Element", 0) +#endif ZEND_ARG_INFO(0, option) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_select_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_select_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_select_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/submit.zep.c b/ext/phalcon/forms/element/submit.zep.c index 79f678ce010..d7a57383c5d 100644 --- a/ext/phalcon/forms/element/submit.zep.c +++ b/ext/phalcon/forms/element/submit.zep.c @@ -38,19 +38,25 @@ PHP_METHOD(Phalcon_Forms_Element_Submit, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL; + zval *attributes = NULL, attributes_sub, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "submitbutton", &_0, 228, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "submitbutton", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/submit.zep.h b/ext/phalcon/forms/element/submit.zep.h index 694055f8298..7e57c99e0ff 100644 --- a/ext/phalcon/forms/element/submit.zep.h +++ b/ext/phalcon/forms/element/submit.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Submit); PHP_METHOD(Phalcon_Forms_Element_Submit, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_submit_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_submit_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_submit_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/text.zep.c b/ext/phalcon/forms/element/text.zep.c index 16fa3fc5838..3fb2cfab437 100644 --- a/ext/phalcon/forms/element/text.zep.c +++ b/ext/phalcon/forms/element/text.zep.c @@ -38,19 +38,25 @@ PHP_METHOD(Phalcon_Forms_Element_Text, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL; + zval *attributes = NULL, attributes_sub, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "textfield", &_0, 229, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "textfield", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/text.zep.h b/ext/phalcon/forms/element/text.zep.h index 8cee8efbe91..2fb6197f5fb 100644 --- a/ext/phalcon/forms/element/text.zep.h +++ b/ext/phalcon/forms/element/text.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_Text); PHP_METHOD(Phalcon_Forms_Element_Text, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_text_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_text_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_text_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/element/textarea.zep.c b/ext/phalcon/forms/element/textarea.zep.c index 78d999df7e0..5945d93e2dc 100644 --- a/ext/phalcon/forms/element/textarea.zep.c +++ b/ext/phalcon/forms/element/textarea.zep.c @@ -38,19 +38,25 @@ PHP_METHOD(Phalcon_Forms_Element_TextArea, render) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *attributes = NULL, *_1 = NULL; + zval *attributes = NULL, attributes_sub, __$null, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &attributes); if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } ZEPHIR_CALL_METHOD(&_1, this_ptr, "prepareattributes", NULL, 0, attributes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "textarea", &_0, 230, _1); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_ce, "textarea", &_0, 0, &_1); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/forms/element/textarea.zep.h b/ext/phalcon/forms/element/textarea.zep.h index 111869b5550..e51446bc291 100644 --- a/ext/phalcon/forms/element/textarea.zep.h +++ b/ext/phalcon/forms/element/textarea.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Element_TextArea); PHP_METHOD(Phalcon_Forms_Element_TextArea, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_element_textarea_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_textarea_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_element_textarea_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/forms/elementinterface.zep.h b/ext/phalcon/forms/elementinterface.zep.h index 1cc5f1e4d02..74b9975f794 100644 --- a/ext/phalcon/forms/elementinterface.zep.h +++ b/ext/phalcon/forms/elementinterface.zep.h @@ -3,115 +3,278 @@ extern zend_class_entry *phalcon_forms_elementinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Forms_ElementInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setform, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setform, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setform, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, form, Phalcon\\Forms\\Form, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_getform, 0, 0, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getform, 0, 0, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setname, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setname, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setfilters, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setfilters, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setfilters, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_INFO(0, filters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_addfilter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_addfilter, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_addfilter, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filter, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filter) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_addvalidators, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_addvalidators, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_addvalidators, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, validators, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_addvalidator, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_addvalidator, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_addvalidator, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, validator, Phalcon\\Validation\\ValidatorInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_prepareattributes, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_getvalidators, 0, 0, Phalcon\\Validation\\ValidatorInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getvalidators, 0, 0, IS_OBJECT, "Phalcon\\Validation\\ValidatorInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_prepareattributes, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_prepareattributes, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useChecked, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useChecked) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setattribute, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setattribute, 0, 2, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setattribute, 0, 2, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_getattribute, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setattributes, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setattributes, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setuseroption, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getattributes, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getattributes, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setuseroption, 0, 2, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setuseroption, 0, 2, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +#else ZEND_ARG_INFO(0, option) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_getuseroption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +#else ZEND_ARG_INFO(0, option) +#endif ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setuseroptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setuseroptions, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setuseroptions, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setlabel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getuseroptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getuseroptions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setlabel, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setlabel, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, label, IS_STRING, 0) +#else ZEND_ARG_INFO(0, label) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getlabel, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_getlabel, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_label, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_label, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setdefault, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setdefault, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setdefault, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_setmessages, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_hasmessages, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_hasmessages, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_setmessages, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_setmessages, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, group, Phalcon\\Validation\\Message\\Group, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_appendmessage, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_appendmessage, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_appendmessage, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, message, Phalcon\\Validation\\MessageInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_elementinterface_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_elementinterface_clear, 0, 0, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_clear, 0, 0, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_elementinterface_render, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_forms_elementinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setForm, arginfo_phalcon_forms_elementinterface_setform) - PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getForm, NULL) + PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getForm, arginfo_phalcon_forms_elementinterface_getform) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setName, arginfo_phalcon_forms_elementinterface_setname) - PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getName, NULL) + PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getName, arginfo_phalcon_forms_elementinterface_getname) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setFilters, arginfo_phalcon_forms_elementinterface_setfilters) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, addFilter, arginfo_phalcon_forms_elementinterface_addfilter) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getFilters, NULL) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, addValidators, arginfo_phalcon_forms_elementinterface_addvalidators) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, addValidator, arginfo_phalcon_forms_elementinterface_addvalidator) - PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getValidators, NULL) + PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getValidators, arginfo_phalcon_forms_elementinterface_getvalidators) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, prepareAttributes, arginfo_phalcon_forms_elementinterface_prepareattributes) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setAttribute, arginfo_phalcon_forms_elementinterface_setattribute) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getAttribute, arginfo_phalcon_forms_elementinterface_getattribute) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setAttributes, arginfo_phalcon_forms_elementinterface_setattributes) - PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getAttributes, NULL) + PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getAttributes, arginfo_phalcon_forms_elementinterface_getattributes) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setUserOption, arginfo_phalcon_forms_elementinterface_setuseroption) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getUserOption, arginfo_phalcon_forms_elementinterface_getuseroption) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setUserOptions, arginfo_phalcon_forms_elementinterface_setuseroptions) - PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getUserOptions, NULL) + PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getUserOptions, arginfo_phalcon_forms_elementinterface_getuseroptions) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setLabel, arginfo_phalcon_forms_elementinterface_setlabel) - PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getLabel, NULL) - PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, label, NULL) + PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getLabel, arginfo_phalcon_forms_elementinterface_getlabel) + PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, label, arginfo_phalcon_forms_elementinterface_label) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setDefault, arginfo_phalcon_forms_elementinterface_setdefault) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getDefault, NULL) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getValue, NULL) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, getMessages, NULL) - PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, hasMessages, NULL) + PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, hasMessages, arginfo_phalcon_forms_elementinterface_hasmessages) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, setMessages, arginfo_phalcon_forms_elementinterface_setmessages) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, appendMessage, arginfo_phalcon_forms_elementinterface_appendmessage) - PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, clear, NULL) + PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, clear, arginfo_phalcon_forms_elementinterface_clear) PHP_ABSTRACT_ME(Phalcon_Forms_ElementInterface, render, arginfo_phalcon_forms_elementinterface_render) PHP_FE_END }; diff --git a/ext/phalcon/forms/form.zep.c b/ext/phalcon/forms/form.zep.c index 291e53d017e..cd39da4c364 100644 --- a/ext/phalcon/forms/form.zep.c +++ b/ext/phalcon/forms/form.zep.c @@ -62,20 +62,24 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Form) { PHP_METHOD(Phalcon_Forms_Form, setValidation) { - zval *validation; + zval *validation, validation_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&validation_sub); zephir_fetch_params(0, 1, 0, &validation); - zephir_update_property_this(getThis(), SL("_validation"), validation TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_validation"), validation); RETURN_THISW(); } PHP_METHOD(Phalcon_Forms_Form, getValidation) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_validation"); @@ -90,16 +94,23 @@ PHP_METHOD(Phalcon_Forms_Form, getValidation) { PHP_METHOD(Phalcon_Forms_Form, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *entity = NULL, *userOptions = NULL; + zval *entity = NULL, entity_sub, *userOptions = NULL, userOptions_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&entity_sub); + ZVAL_UNDEF(&userOptions_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &entity, &userOptions); if (!entity) { - entity = ZEPHIR_GLOBAL(global_null); + entity = &entity_sub; + entity = &__$null; } if (!userOptions) { - userOptions = ZEPHIR_GLOBAL(global_null); + userOptions = &userOptions_sub; + userOptions = &__$null; } @@ -108,12 +119,12 @@ PHP_METHOD(Phalcon_Forms_Form, __construct) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_forms_exception_ce, "The base entity is not valid", "phalcon/forms/form.zep", 66); return; } - zephir_update_property_this(getThis(), SL("_entity"), entity TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_entity"), entity); } if (Z_TYPE_P(userOptions) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_options"), userOptions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), userOptions); } - if ((zephir_method_exists_ex(this_ptr, SS("initialize") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(this_ptr, SL("initialize") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0, entity, userOptions); zephir_check_call_status(); } @@ -127,24 +138,27 @@ PHP_METHOD(Phalcon_Forms_Form, __construct) { PHP_METHOD(Phalcon_Forms_Form, setAction) { zval *action_param = NULL; - zval *action = NULL; + zval action; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&action); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &action_param); if (UNEXPECTED(Z_TYPE_P(action_param) != IS_STRING && Z_TYPE_P(action_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'action' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'action' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(action_param) == IS_STRING)) { - zephir_get_strval(action, action_param); + zephir_get_strval(&action, action_param); } else { - ZEPHIR_INIT_VAR(action); - ZVAL_EMPTY_STRING(action); + ZEPHIR_INIT_VAR(&action); + ZVAL_EMPTY_STRING(&action); } - zephir_update_property_this(getThis(), SL("_action"), action TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_action"), &action); RETURN_THIS(); } @@ -154,7 +168,8 @@ PHP_METHOD(Phalcon_Forms_Form, setAction) { */ PHP_METHOD(Phalcon_Forms_Form, getAction) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_action"); @@ -168,7 +183,11 @@ PHP_METHOD(Phalcon_Forms_Form, getAction) { */ PHP_METHOD(Phalcon_Forms_Form, setUserOption) { - zval *option, *value; + zval *option, option_sub, *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option_sub); + ZVAL_UNDEF(&value_sub); zephir_fetch_params(0, 2, 0, &option, &value); @@ -187,18 +206,26 @@ PHP_METHOD(Phalcon_Forms_Form, setUserOption) { */ PHP_METHOD(Phalcon_Forms_Form, getUserOption) { - zval *option, *defaultValue = NULL, *value = NULL, *_0; + zval *option, option_sub, *defaultValue = NULL, defaultValue_sub, __$null, value, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 1, &option, &defaultValue); if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&value, _0, option, 1 TSRMLS_CC)) { - RETURN_CTORW(value); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&value, &_0, option, 1 TSRMLS_CC)) { + RETURN_CTORW(&value); } RETVAL_ZVAL(defaultValue, 1, 0); return; @@ -211,15 +238,19 @@ PHP_METHOD(Phalcon_Forms_Form, getUserOption) { PHP_METHOD(Phalcon_Forms_Form, setUserOptions) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); - zephir_fetch_params(0, 1, 0, &options_param); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &options_param); - options = options_param; + ZEPHIR_OBS_COPY_OR_DUP(&options, options_param); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); - RETURN_THISW(); + zephir_update_property_zval(this_ptr, SL("_options"), &options); + RETURN_THIS(); } @@ -228,7 +259,8 @@ PHP_METHOD(Phalcon_Forms_Form, setUserOptions) { */ PHP_METHOD(Phalcon_Forms_Form, getUserOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -241,13 +273,16 @@ PHP_METHOD(Phalcon_Forms_Form, getUserOptions) { */ PHP_METHOD(Phalcon_Forms_Form, setEntity) { - zval *entity; + zval *entity, entity_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&entity_sub); zephir_fetch_params(0, 1, 0, &entity); - zephir_update_property_this(getThis(), SL("_entity"), entity TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_entity"), entity); RETURN_THISW(); } @@ -259,7 +294,8 @@ PHP_METHOD(Phalcon_Forms_Form, setEntity) { */ PHP_METHOD(Phalcon_Forms_Form, getEntity) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_entity"); @@ -270,7 +306,8 @@ PHP_METHOD(Phalcon_Forms_Form, getEntity) { */ PHP_METHOD(Phalcon_Forms_Form, getElements) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_elements"); @@ -285,77 +322,102 @@ PHP_METHOD(Phalcon_Forms_Form, getElements) { */ PHP_METHOD(Phalcon_Forms_Form, bind) { - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *entity, *whitelist = NULL, *filter = NULL, *key = NULL, *value = NULL, *element = NULL, *filters = NULL, *dependencyInjector = NULL, *filteredValue = NULL, *method = NULL, *_0, **_3, *_4$$4, *_8$$4 = NULL, *_6$$9 = NULL, *_7$$9 = NULL; - zval *data = NULL; + zval *data_param = NULL, *entity, entity_sub, *whitelist = NULL, whitelist_sub, __$null, filter, key, value, element, filters, dependencyInjector, filteredValue, method, _0, *_1, _4$$4, _8$$4, _6$$9, _7$$9; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&entity_sub); + ZVAL_UNDEF(&whitelist_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&filters); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&filteredValue); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_8$$4); + ZVAL_UNDEF(&_6$$9); + ZVAL_UNDEF(&_7$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &data_param, &entity, &whitelist); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); ZEPHIR_SEPARATE_PARAM(entity); if (!whitelist) { - whitelist = ZEPHIR_GLOBAL(global_null); + whitelist = &whitelist_sub; + whitelist = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - if (ZEPHIR_IS_EMPTY(_0)) { + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_EMPTY(&_0)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_forms_exception_ce, "There are no elements in the form", "phalcon/forms/form.zep", 189); return; } - ZEPHIR_INIT_VAR(filter); - ZVAL_NULL(filter); - zephir_is_iterable(data, &_2, &_1, 0, 0, "phalcon/forms/form.zep", 246); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(key, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); - ZEPHIR_OBS_NVAR(element); - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&element, _4$$4, key, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&filter); + ZVAL_NULL(&filter); + zephir_is_iterable(&data, 0, "phalcon/forms/form.zep", 246); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + ZEPHIR_OBS_NVAR(&element); + zephir_read_property(&_4$$4, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&element, &_4$$4, &key, 0 TSRMLS_CC))) { continue; } if (Z_TYPE_P(whitelist) == IS_ARRAY) { - if (!(zephir_fast_in_array(key, whitelist TSRMLS_CC))) { + if (!(zephir_fast_in_array(&key, whitelist TSRMLS_CC))) { continue; } } - ZEPHIR_CALL_METHOD(&filters, element, "getfilters", NULL, 0); + ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(filters)) { - if (Z_TYPE_P(filter) != IS_OBJECT) { + if (zephir_is_true(&filters)) { + if (Z_TYPE_P(&filter) != IS_OBJECT) { ZEPHIR_CALL_METHOD(&dependencyInjector, this_ptr, "getdi", &_5, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_7$$9); - ZVAL_STRING(_7$$9, "filter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_6$$9, dependencyInjector, "getshared", NULL, 0, _7$$9); - zephir_check_temp_parameter(_7$$9); + ZEPHIR_INIT_NVAR(&_7$$9); + ZVAL_STRING(&_7$$9, "filter"); + ZEPHIR_CALL_METHOD(&_6$$9, &dependencyInjector, "getshared", NULL, 0, &_7$$9); zephir_check_call_status(); - ZEPHIR_CPY_WRT(filter, _6$$9); + ZEPHIR_CPY_WRT(&filter, &_6$$9); } - ZEPHIR_CALL_METHOD(&filteredValue, filter, "sanitize", NULL, 0, value, filters); + ZEPHIR_CALL_METHOD(&filteredValue, &filter, "sanitize", NULL, 0, &value, &filters); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(filteredValue, value); + ZEPHIR_CPY_WRT(&filteredValue, &value); } - ZEPHIR_INIT_NVAR(_8$$4); - zephir_camelize(_8$$4, key, NULL ); - ZEPHIR_INIT_NVAR(method); - ZEPHIR_CONCAT_SV(method, "set", _8$$4); - if ((zephir_method_exists(entity, method TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(NULL, entity, method, NULL, 0, filteredValue); + ZEPHIR_INIT_NVAR(&_8$$4); + zephir_camelize(&_8$$4, &key, NULL ); + ZEPHIR_INIT_NVAR(&method); + ZEPHIR_CONCAT_SV(&method, "set", &_8$$4); + if ((zephir_method_exists(entity, &method TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD_ZVAL(NULL, entity, &method, NULL, 0, &filteredValue); zephir_check_call_status(); continue; } - zephir_update_property_zval_zval(entity, key, filteredValue TSRMLS_CC); - } - zephir_update_property_this(getThis(), SL("_data"), data TSRMLS_CC); + zephir_update_property_zval_zval(entity, &key, &filteredValue TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + zephir_update_property_zval(this_ptr, SL("_data"), &data); RETURN_THIS(); } @@ -368,131 +430,150 @@ PHP_METHOD(Phalcon_Forms_Form, bind) { */ PHP_METHOD(Phalcon_Forms_Form, isValid) { - zend_object_iterator *_16$$15; - HashTable *_7, *_11$$11; - HashPosition _6, _10$$11; - zend_bool validationStatus = 0, _4, _9$$11; - zephir_fcall_cache_entry *_13 = NULL, *_14 = NULL, *_19 = NULL; + zend_object_iterator *_12$$15; + zend_bool validationStatus = 0, _4, _7$$11; + zephir_fcall_cache_entry *_9 = NULL, *_10 = NULL, *_15 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data = NULL, *entity = NULL, *messages = NULL, *element = NULL, *validators = NULL, *name = NULL, *filters = NULL, *validator = NULL, *validation = NULL, *elementMessage = NULL, *_0, *_5, **_8, *_15 = NULL, *_1$$6, *_2$$7, *_3$$8 = NULL, **_12$$11, *_17$$16 = NULL, *_18$$16 = NULL; + zval *data = NULL, data_sub, *entity = NULL, entity_sub, __$null, messages, element, validators, name, filters, validator, validation, elementMessage, _0, _5, *_6, _11, _1$$6, _2$$7, _3$$8, *_8$$11, _13$$16, _14$$16; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&entity_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&messages); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&validators); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&filters); + ZVAL_UNDEF(&validator); + ZVAL_UNDEF(&validation); + ZVAL_UNDEF(&elementMessage); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_1$$6); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_13$$16); + ZVAL_UNDEF(&_14$$16); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &data, &entity); if (!data) { - ZEPHIR_CPY_WRT(data, ZEPHIR_GLOBAL(global_null)); + data = &data_sub; + ZEPHIR_CPY_WRT(data, &__$null); } else { ZEPHIR_SEPARATE_PARAM(data); } if (!entity) { - entity = ZEPHIR_GLOBAL(global_null); + entity = &entity_sub; + entity = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - if (ZEPHIR_IS_EMPTY(_0)) { + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_EMPTY(&_0)) { RETURN_MM_BOOL(1); } if (Z_TYPE_P(data) != IS_ARRAY) { ZEPHIR_OBS_NVAR(data); - zephir_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC); + zephir_read_property(data, this_ptr, SL("_data"), PH_NOISY_CC); } if (Z_TYPE_P(entity) == IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "bind", NULL, 0, data, entity); zephir_check_call_status(); } else { - ZEPHIR_OBS_VAR(_1$$6); - zephir_read_property_this(&_1$$6, this_ptr, SL("_entity"), PH_NOISY_CC); - if (Z_TYPE_P(_1$$6) == IS_OBJECT) { - _2$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_entity"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "bind", NULL, 0, data, _2$$7); + ZEPHIR_OBS_VAR(&_1$$6); + zephir_read_property(&_1$$6, this_ptr, SL("_entity"), PH_NOISY_CC); + if (Z_TYPE_P(&_1$$6) == IS_OBJECT) { + zephir_read_property(&_2$$7, this_ptr, SL("_entity"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "bind", NULL, 0, data, &_2$$7); zephir_check_call_status(); } } - if ((zephir_method_exists_ex(this_ptr, SS("beforevalidation") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(this_ptr, SL("beforevalidation") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "beforevalidation", NULL, 0, data, entity); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_3$$8)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_3$$8)) { RETURN_MM_BOOL(0); } } validationStatus = 1; ZEPHIR_CALL_METHOD(&validation, this_ptr, "getvalidation", NULL, 0); zephir_check_call_status(); - _4 = Z_TYPE_P(validation) != IS_OBJECT; + _4 = Z_TYPE_P(&validation) != IS_OBJECT; if (!(_4)) { - _4 = !((zephir_instance_of_ev(validation, phalcon_validationinterface_ce TSRMLS_CC))); + _4 = !((zephir_instance_of_ev(&validation, phalcon_validationinterface_ce TSRMLS_CC))); } if (_4) { - ZEPHIR_INIT_NVAR(validation); - object_init_ex(validation, phalcon_validation_ce); - ZEPHIR_CALL_METHOD(NULL, validation, "__construct", NULL, 231); + ZEPHIR_INIT_NVAR(&validation); + object_init_ex(&validation, phalcon_validation_ce); + ZEPHIR_CALL_METHOD(NULL, &validation, "__construct", NULL, 193); zephir_check_call_status(); } - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - zephir_is_iterable(_5, &_7, &_6, 0, 0, "phalcon/forms/form.zep", 338); - for ( - ; zend_hash_get_current_data_ex(_7, (void**) &_8, &_6) == SUCCESS - ; zend_hash_move_forward_ex(_7, &_6) - ) { - ZEPHIR_GET_HVALUE(element, _8); - ZEPHIR_CALL_METHOD(&validators, element, "getvalidators", NULL, 0); + zephir_read_property(&_5, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_5, 0, "phalcon/forms/form.zep", 338); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_5), _6) + { + ZEPHIR_INIT_NVAR(&element); + ZVAL_COPY(&element, _6); + ZEPHIR_CALL_METHOD(&validators, &element, "getvalidators", NULL, 0); zephir_check_call_status(); - _9$$11 = Z_TYPE_P(validators) != IS_ARRAY; - if (!(_9$$11)) { - _9$$11 = zephir_fast_count_int(validators TSRMLS_CC) == 0; + _7$$11 = Z_TYPE_P(&validators) != IS_ARRAY; + if (!(_7$$11)) { + _7$$11 = zephir_fast_count_int(&validators TSRMLS_CC) == 0; } - if (_9$$11) { + if (_7$$11) { continue; } - ZEPHIR_CALL_METHOD(&name, element, "getname", NULL, 0); + ZEPHIR_CALL_METHOD(&name, &element, "getname", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(validators, &_11$$11, &_10$$11, 0, 0, "phalcon/forms/form.zep", 325); - for ( - ; zend_hash_get_current_data_ex(_11$$11, (void**) &_12$$11, &_10$$11) == SUCCESS - ; zend_hash_move_forward_ex(_11$$11, &_10$$11) - ) { - ZEPHIR_GET_HVALUE(validator, _12$$11); - ZEPHIR_CALL_METHOD(NULL, validation, "add", &_13, 232, name, validator); + zephir_is_iterable(&validators, 0, "phalcon/forms/form.zep", 325); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&validators), _8$$11) + { + ZEPHIR_INIT_NVAR(&validator); + ZVAL_COPY(&validator, _8$$11); + ZEPHIR_CALL_METHOD(NULL, &validation, "add", &_9, 194, &name, &validator); zephir_check_call_status(); - } - ZEPHIR_CALL_METHOD(&filters, element, "getfilters", NULL, 0); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&validator); + ZEPHIR_CALL_METHOD(&filters, &element, "getfilters", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(filters) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, validation, "setfilters", &_14, 233, name, filters); + if (Z_TYPE_P(&filters) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(NULL, &validation, "setfilters", &_10, 195, &name, &filters); zephir_check_call_status(); } - } - ZEPHIR_CALL_METHOD(&messages, validation, "validate", NULL, 234, data, entity); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&element); + ZEPHIR_CALL_METHOD(&messages, &validation, "validate", NULL, 196, data, entity); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_15, messages, "count", NULL, 0); + ZEPHIR_CALL_METHOD(&_11, &messages, "count", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_15)) { - _16$$15 = zephir_get_iterator(messages TSRMLS_CC); - _16$$15->funcs->rewind(_16$$15 TSRMLS_CC); - for (;_16$$15->funcs->valid(_16$$15 TSRMLS_CC) == SUCCESS && !EG(exception); _16$$15->funcs->move_forward(_16$$15 TSRMLS_CC)) { + if (zephir_is_true(&_11)) { + _12$$15 = zephir_get_iterator(&messages TSRMLS_CC); + _12$$15->funcs->rewind(_12$$15 TSRMLS_CC); + for (;_12$$15->funcs->valid(_12$$15 TSRMLS_CC) == SUCCESS && !EG(exception); _12$$15->funcs->move_forward(_12$$15 TSRMLS_CC)) { { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _16$$15->funcs->get_current_data(_16$$15, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(elementMessage, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&elementMessage, _12$$15); } - ZEPHIR_CALL_METHOD(&_18$$16, elementMessage, "getfield", NULL, 0); + ZEPHIR_CALL_METHOD(&_14$$16, &elementMessage, "getfield", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_17$$16, this_ptr, "get", &_19, 0, _18$$16); + ZEPHIR_CALL_METHOD(&_13$$16, this_ptr, "get", &_15, 0, &_14$$16); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _17$$16, "appendmessage", NULL, 0, elementMessage); + ZEPHIR_CALL_METHOD(NULL, &_13$$16, "appendmessage", NULL, 0, &elementMessage); zephir_check_call_status(); } - _16$$15->funcs->dtor(_16$$15 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, messages, "rewind", NULL, 0); + zend_iterator_dtor(_12$$15); + ZEPHIR_CALL_METHOD(NULL, &messages, "rewind", NULL, 0); zephir_check_call_status(); validationStatus = 0; } if (!(validationStatus)) { - zephir_update_property_this(getThis(), SL("_messages"), messages TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_messages"), &messages); } - if ((zephir_method_exists_ex(this_ptr, SS("aftervalidation") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "aftervalidation", NULL, 0, messages); + if ((zephir_method_exists_ex(this_ptr, SL("aftervalidation") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "aftervalidation", NULL, 0, &messages); zephir_check_call_status(); } RETURN_MM_BOOL(validationStatus); @@ -524,11 +605,21 @@ PHP_METHOD(Phalcon_Forms_Form, isValid) { */ PHP_METHOD(Phalcon_Forms_Form, getMessages) { - zval *_5$$5 = NULL; + zval _5$$5; zephir_fcall_cache_entry *_2 = NULL, *_6 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *byItemName_param = NULL, *messages = NULL, *messagesByItem = NULL, *elementMessage = NULL, *fieldName = NULL, *_1$$4 = NULL, *_3$$6 = NULL, *_4$$5 = NULL; + zval *byItemName_param = NULL, messages, messagesByItem, elementMessage, fieldName, _1$$4, _3$$6, _4$$5; zend_bool byItemName, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&messages); + ZVAL_UNDEF(&messagesByItem); + ZVAL_UNDEF(&elementMessage); + ZVAL_UNDEF(&fieldName); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &byItemName_param); @@ -540,50 +631,50 @@ PHP_METHOD(Phalcon_Forms_Form, getMessages) { } - ZEPHIR_OBS_VAR(messages); - zephir_read_property_this(&messages, this_ptr, SL("_messages"), PH_NOISY_CC); - _0 = Z_TYPE_P(messages) == IS_OBJECT; + ZEPHIR_OBS_VAR(&messages); + zephir_read_property(&messages, this_ptr, SL("_messages"), PH_NOISY_CC); + _0 = Z_TYPE_P(&messages) == IS_OBJECT; if (_0) { - _0 = zephir_instance_of_ev(messages, phalcon_validation_message_group_ce TSRMLS_CC); + _0 = zephir_instance_of_ev(&messages, phalcon_validation_message_group_ce TSRMLS_CC); } if (_0) { if (UNEXPECTED(byItemName)) { - ZEPHIR_INIT_VAR(messagesByItem); - array_init(messagesByItem); - ZEPHIR_CALL_METHOD(NULL, messages, "rewind", NULL, 0); + ZEPHIR_INIT_VAR(&messagesByItem); + array_init(&messagesByItem); + ZEPHIR_CALL_METHOD(NULL, &messages, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_1$$4, messages, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_1$$4, &messages, "valid", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_1$$4))) { + if (!(zephir_is_true(&_1$$4))) { break; } - ZEPHIR_CALL_METHOD(&elementMessage, messages, "current", &_2, 0); + ZEPHIR_CALL_METHOD(&elementMessage, &messages, "current", &_2, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&fieldName, elementMessage, "getfield", NULL, 0); + ZEPHIR_CALL_METHOD(&fieldName, &elementMessage, "getfield", NULL, 0); zephir_check_call_status(); - if (!(zephir_array_isset(messagesByItem, fieldName))) { - ZEPHIR_INIT_NVAR(_3$$6); - array_init(_3$$6); - zephir_array_update_zval(&messagesByItem, fieldName, &_3$$6, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset(&messagesByItem, &fieldName))) { + ZEPHIR_INIT_NVAR(&_3$$6); + array_init(&_3$$6); + zephir_array_update_zval(&messagesByItem, &fieldName, &_3$$6, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_NVAR(_4$$5); - object_init_ex(_4$$5, phalcon_validation_message_group_ce); - ZEPHIR_INIT_NVAR(_5$$5); - zephir_create_array(_5$$5, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_5$$5, elementMessage); - ZEPHIR_CALL_METHOD(NULL, _4$$5, "__construct", &_6, 3, _5$$5); + ZEPHIR_INIT_NVAR(&_4$$5); + object_init_ex(&_4$$5, phalcon_validation_message_group_ce); + ZEPHIR_INIT_NVAR(&_5$$5); + zephir_create_array(&_5$$5, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_5$$5, &elementMessage); + ZEPHIR_CALL_METHOD(NULL, &_4$$5, "__construct", &_6, 2, &_5$$5); zephir_check_call_status(); - zephir_array_update_multi(&messagesByItem, &_4$$5 TSRMLS_CC, SL("za"), 2, fieldName); - ZEPHIR_CALL_METHOD(NULL, messages, "next", &_7, 0); + zephir_array_update_multi(&messagesByItem, &_4$$5 TSRMLS_CC, SL("za"), 2, &fieldName); + ZEPHIR_CALL_METHOD(NULL, &messages, "next", &_7, 0); zephir_check_call_status(); } - RETURN_CCTOR(messagesByItem); + RETURN_CCTOR(&messagesByItem); } - RETURN_CCTOR(messages); + RETURN_CCTOR(&messages); } object_init_ex(return_value, phalcon_validation_message_group_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", &_6, 3); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", &_6, 2); zephir_check_call_status(); RETURN_MM(); @@ -595,35 +686,40 @@ PHP_METHOD(Phalcon_Forms_Form, getMessages) { PHP_METHOD(Phalcon_Forms_Form, getMessagesFor) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *_0 = NULL, *_1$$3 = NULL; - zval *name = NULL; + zval *name_param = NULL, _0, _1$$3; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, name); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "has", NULL, 0, &name); zephir_check_call_status(); - if (zephir_is_true(_0)) { - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "get", NULL, 0, name); + if (zephir_is_true(&_0)) { + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "get", NULL, 0, &name); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(_1$$3, "getmessages", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&_1$$3, "getmessages", NULL, 0); zephir_check_call_status(); RETURN_MM(); } object_init_ex(return_value, phalcon_validation_message_group_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 3); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 2); zephir_check_call_status(); RETURN_MM(); @@ -635,29 +731,34 @@ PHP_METHOD(Phalcon_Forms_Form, getMessagesFor) { PHP_METHOD(Phalcon_Forms_Form, hasMessagesFor) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *_0 = NULL, *_1 = NULL; - zval *name = NULL; + zval *name_param = NULL, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmessagesfor", NULL, 0, name); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmessagesfor", NULL, 0, &name); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, _0, "count", NULL, 0); + ZEPHIR_CALL_METHOD(&_1, &_0, "count", NULL, 0); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_GT_LONG(_1, 0)); + RETURN_MM_BOOL(ZEPHIR_GT_LONG(&_1, 0)); } @@ -666,21 +767,31 @@ PHP_METHOD(Phalcon_Forms_Form, hasMessagesFor) { */ PHP_METHOD(Phalcon_Forms_Form, add) { - HashTable *_4$$4; - HashPosition _3$$4; + zend_string *_5$$4; + zend_ulong _4$$4; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool type, _0; - zval *position = NULL; - zval *element, *position_param = NULL, *type_param = NULL, *name = NULL, *key = NULL, *value = NULL, *elements = NULL, *_1, *_2$$4, **_5$$4; + zval position; + zval *element, element_sub, *position_param = NULL, *type_param = NULL, name, key, value, elements, _1, _2$$4, *_3$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&element_sub); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&elements); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&position); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &element, &position_param, &type_param); if (!position_param) { - ZEPHIR_INIT_VAR(position); - ZVAL_EMPTY_STRING(position); + ZEPHIR_INIT_VAR(&position); + ZVAL_STRING(&position, ""); } else { - zephir_get_strval(position, position_param); + zephir_get_strval(&position, position_param); } if (!type_param) { type = 0; @@ -693,37 +804,43 @@ PHP_METHOD(Phalcon_Forms_Form, add) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, element, "setform", NULL, 0, this_ptr); zephir_check_call_status(); - _0 = ZEPHIR_IS_STRING(position, ""); + _0 = ZEPHIR_IS_STRING(&position, ""); if (!(_0)) { - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - _0 = ZEPHIR_IS_EMPTY(_1); + zephir_read_property(&_1, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + _0 = ZEPHIR_IS_EMPTY(&_1); } if (_0) { - zephir_update_property_array(this_ptr, SL("_elements"), name, element TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_elements"), &name, element TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(elements); - array_init(elements); - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - zephir_is_iterable(_2$$4, &_4$$4, &_3$$4, 0, 0, "phalcon/forms/form.zep", 490); - for ( - ; zend_hash_get_current_data_ex(_4$$4, (void**) &_5$$4, &_3$$4) == SUCCESS - ; zend_hash_move_forward_ex(_4$$4, &_3$$4) - ) { - ZEPHIR_GET_HMKEY(key, _4$$4, _3$$4); - ZEPHIR_GET_HVALUE(value, _5$$4); - if (ZEPHIR_IS_EQUAL(key, position)) { + ZEPHIR_INIT_VAR(&elements); + array_init(&elements); + zephir_read_property(&_2$$4, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_2$$4, 0, "phalcon/forms/form.zep", 490); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_2$$4), _4$$4, _5$$4, _3$$4) + { + ZEPHIR_INIT_NVAR(&key); + if (_5$$4 != NULL) { + ZVAL_STR_COPY(&key, _5$$4); + } else { + ZVAL_LONG(&key, _4$$4); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _3$$4); + if (ZEPHIR_IS_EQUAL(&key, &position)) { if (type) { - zephir_array_update_zval(&elements, name, &element, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&elements, key, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE); } else { - zephir_array_update_zval(&elements, key, &value, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&elements, name, &element, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&elements, &name, element, PH_COPY | PH_SEPARATE); } } else { - zephir_array_update_zval(&elements, key, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&elements, &key, &value, PH_COPY | PH_SEPARATE); } - } - zephir_update_property_this(getThis(), SL("_elements"), elements TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + zephir_update_property_zval(this_ptr, SL("_elements"), &elements); } RETURN_THIS(); @@ -738,41 +855,51 @@ PHP_METHOD(Phalcon_Forms_Form, add) { PHP_METHOD(Phalcon_Forms_Form, render) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *attributes = NULL, *element = NULL, *_0, *_1$$3; - zval *name = NULL, *_2$$3; + zval *name_param = NULL, *attributes = NULL, attributes_sub, __$null, element, _0, _1$$3; + zval name, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&attributes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &attributes); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!attributes) { - attributes = ZEPHIR_GLOBAL(global_null); + attributes = &attributes_sub; + attributes = &__$null; } - ZEPHIR_OBS_VAR(element); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&element, _0, name, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_forms_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SVS(_2$$3, "Element with ID=", name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _2$$3); + ZEPHIR_OBS_VAR(&element); + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&element, &_0, &name, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_forms_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/forms/form.zep", 506 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/forms/form.zep", 506 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_RETURN_CALL_METHOD(element, "render", NULL, 0, attributes); + ZEPHIR_RETURN_CALL_METHOD(&element, "render", NULL, 0, attributes); zephir_check_call_status(); RETURN_MM(); @@ -784,36 +911,43 @@ PHP_METHOD(Phalcon_Forms_Form, render) { PHP_METHOD(Phalcon_Forms_Form, get) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *element = NULL, *_0, *_1; - zval *name = NULL, *_2; + zval *name_param = NULL, element, _0, _1; + zval name, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(element); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&element, _0, name, 0 TSRMLS_CC)) { - RETURN_CCTOR(element); + ZEPHIR_OBS_VAR(&element); + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&element, &_0, &name, 0 TSRMLS_CC)) { + RETURN_CCTOR(&element); } - ZEPHIR_INIT_VAR(_1); - object_init_ex(_1, phalcon_forms_exception_ce); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVS(_2, "Element with ID=", name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 9, _2); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, phalcon_forms_exception_ce); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVS(&_2, "Element with ID=", &name, " is not part of the form"); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 4, &_2); zephir_check_call_status(); - zephir_throw_exception_debug(_1, "phalcon/forms/form.zep", 523 TSRMLS_CC); + zephir_throw_exception_debug(&_1, "phalcon/forms/form.zep", 523 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -825,45 +959,53 @@ PHP_METHOD(Phalcon_Forms_Form, get) { PHP_METHOD(Phalcon_Forms_Form, label) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes = NULL; - zval *name_param = NULL, *attributes_param = NULL, *element = NULL, *_0, *_1; - zval *name = NULL, *_2; + zval attributes; + zval *name_param = NULL, *attributes_param = NULL, element, _0, _1; + zval name, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&attributes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &attributes_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!attributes_param) { - ZEPHIR_INIT_VAR(attributes); - array_init(attributes); + ZEPHIR_INIT_VAR(&attributes); + array_init(&attributes); } else { - zephir_get_arrval(attributes, attributes_param); + zephir_get_arrval(&attributes, attributes_param); } - ZEPHIR_OBS_VAR(element); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&element, _0, name, 0 TSRMLS_CC)) { - ZEPHIR_RETURN_CALL_METHOD(element, "label", NULL, 0, attributes); + ZEPHIR_OBS_VAR(&element); + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&element, &_0, &name, 0 TSRMLS_CC)) { + ZEPHIR_RETURN_CALL_METHOD(&element, "label", NULL, 0, &attributes); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(_1); - object_init_ex(_1, phalcon_forms_exception_ce); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVS(_2, "Element with ID=", name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 9, _2); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, phalcon_forms_exception_ce); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVS(&_2, "Element with ID=", &name, " is not part of the form"); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 4, &_2); zephir_check_call_status(); - zephir_throw_exception_debug(_1, "phalcon/forms/form.zep", 537 TSRMLS_CC); + zephir_throw_exception_debug(&_1, "phalcon/forms/form.zep", 537 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -875,43 +1017,51 @@ PHP_METHOD(Phalcon_Forms_Form, label) { PHP_METHOD(Phalcon_Forms_Form, getLabel) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *element = NULL, *label = NULL, *_0, *_1$$3; - zval *name = NULL, *_2$$3; + zval *name_param = NULL, element, label, _0, _1$$3; + zval name, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&label); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(element); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&element, _0, name, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_forms_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SVS(_2$$3, "Element with ID=", name, " is not part of the form"); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _2$$3); + ZEPHIR_OBS_VAR(&element); + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&element, &_0, &name, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_forms_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SVS(&_2$$3, "Element with ID=", &name, " is not part of the form"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/forms/form.zep", 548 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/forms/form.zep", 548 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&label, element, "getlabel", NULL, 0); + ZEPHIR_CALL_METHOD(&label, &element, "getlabel", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(label))) { - RETURN_CTOR(name); + if (!(zephir_is_true(&label))) { + RETURN_CTOR(&name); } - RETURN_CCTOR(label); + RETURN_CCTOR(&label); } @@ -921,79 +1071,91 @@ PHP_METHOD(Phalcon_Forms_Form, getLabel) { PHP_METHOD(Phalcon_Forms_Form, getValue) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *entity = NULL, *method = NULL, *value = NULL, *data = NULL, *internal = NULL, *forbidden = NULL, *_1, *_0$$4; - zval *name = NULL; + zval *name_param = NULL, __$true, entity, method, value, data, internal, forbidden, _1, _0$$4; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&entity); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&internal); + ZVAL_UNDEF(&forbidden); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(entity); - zephir_read_property_this(&entity, this_ptr, SL("_entity"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(data); - zephir_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC); - if ((zephir_method_exists_ex(this_ptr, SS("getcustomvalue") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getcustomvalue", NULL, 0, name, entity, data); + ZEPHIR_OBS_VAR(&entity); + zephir_read_property(&entity, this_ptr, SL("_entity"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&data); + zephir_read_property(&data, this_ptr, SL("_data"), PH_NOISY_CC); + if ((zephir_method_exists_ex(this_ptr, SL("getcustomvalue") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getcustomvalue", NULL, 0, &name, &entity, &data); zephir_check_call_status(); RETURN_MM(); } - if (Z_TYPE_P(entity) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$4); - zephir_camelize(_0$$4, name, NULL ); - ZEPHIR_INIT_VAR(method); - ZEPHIR_CONCAT_SV(method, "get", _0$$4); - if ((zephir_method_exists(entity, method TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_METHOD_ZVAL(entity, method, NULL, 0); + if (Z_TYPE_P(&entity) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_0$$4); + zephir_camelize(&_0$$4, &name, NULL ); + ZEPHIR_INIT_VAR(&method); + ZEPHIR_CONCAT_SV(&method, "get", &_0$$4); + if ((zephir_method_exists(&entity, &method TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_METHOD_ZVAL(&entity, &method, NULL, 0); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_OBS_VAR(value); - if (zephir_fetch_property_zval(&value, entity, name, PH_SILENT_CC)) { - RETURN_CCTOR(value); + ZEPHIR_OBS_VAR(&value); + if (zephir_fetch_property_zval(&value, &entity, &name, PH_SILENT_CC)) { + RETURN_CCTOR(&value); } } - if (Z_TYPE_P(data) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(value); - if (zephir_array_isset_fetch(&value, data, name, 0 TSRMLS_CC)) { - RETURN_CCTOR(value); + if (Z_TYPE_P(&data) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&value); + if (zephir_array_isset_fetch(&value, &data, &name, 0 TSRMLS_CC)) { + RETURN_CCTOR(&value); } } - ZEPHIR_INIT_VAR(forbidden); - zephir_create_array(forbidden, 12, 0 TSRMLS_CC); - zephir_array_update_string(&forbidden, SL("validation"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("action"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("useroption"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("useroptions"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("entity"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("elements"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("messages"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("messagesfor"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("label"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("value"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("di"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&forbidden, SL("eventsmanager"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(internal); - zephir_fast_strtolower(internal, name); - if (zephir_array_isset(forbidden, internal)) { + ZEPHIR_INIT_VAR(&forbidden); + zephir_create_array(&forbidden, 12, 0 TSRMLS_CC); + zephir_array_update_string(&forbidden, SL("validation"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("action"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("useroption"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("useroptions"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("entity"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("elements"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("messages"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("messagesfor"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("label"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("value"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("di"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&forbidden, SL("eventsmanager"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&internal); + zephir_fast_strtolower(&internal, &name); + if (zephir_array_isset(&forbidden, &internal)) { RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(_1); - zephir_camelize(_1, name, NULL ); - ZEPHIR_INIT_NVAR(method); - ZEPHIR_CONCAT_SV(method, "get", _1); - if ((zephir_method_exists(this_ptr, method TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, method, NULL, 0); + ZEPHIR_INIT_VAR(&_1); + zephir_camelize(&_1, &name, NULL ); + ZEPHIR_INIT_NVAR(&method); + ZEPHIR_CONCAT_SV(&method, "get", &_1); + if ((zephir_method_exists(this_ptr, &method TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, &method, NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -1006,26 +1168,30 @@ PHP_METHOD(Phalcon_Forms_Form, getValue) { */ PHP_METHOD(Phalcon_Forms_Form, has) { - zval *name_param = NULL, *_0; - zval *name = NULL; + zval *name_param = NULL, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, name)); + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &name)); } @@ -1034,31 +1200,37 @@ PHP_METHOD(Phalcon_Forms_Form, has) { */ PHP_METHOD(Phalcon_Forms_Form, remove) { - zval *name_param = NULL, *_0, *_1$$3; - zval *name = NULL; + zval *name_param = NULL, __$null, _0, _1$$3; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - if (zephir_array_isset(_0, name)) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - zephir_array_unset(&_1$$3, name, PH_SEPARATE); + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_0, &name)) { + zephir_read_property(&_1$$3, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + zephir_array_unset(&_1$$3, &name, PH_SEPARATE); RETURN_MM_BOOL(1); } - zephir_update_property_this(getThis(), SL("_elementsIndexed"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_elementsIndexed"), &__$null); RETURN_MM_BOOL(0); } @@ -1070,64 +1242,72 @@ PHP_METHOD(Phalcon_Forms_Form, remove) { */ PHP_METHOD(Phalcon_Forms_Form, clear) { - HashTable *_1$$5, *_4$$10; - HashPosition _0$$5, _3$$10; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *fields = NULL, *elements = NULL, *element = NULL, *data = NULL, *field = NULL, **_2$$5, **_5$$10, *_6$$13 = NULL; + zval *fields = NULL, fields_sub, __$null, elements, element, data, field, *_0$$5, *_1$$10, _2$$13; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&fields_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&elements); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&_2$$13); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &fields); if (!fields) { - fields = ZEPHIR_GLOBAL(global_null); + fields = &fields_sub; + fields = &__$null; } - ZEPHIR_OBS_VAR(data); - zephir_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&data); + zephir_read_property(&data, this_ptr, SL("_data"), PH_NOISY_CC); if (Z_TYPE_P(fields) == IS_NULL) { - ZEPHIR_INIT_NVAR(data); - array_init(data); + ZEPHIR_INIT_NVAR(&data); + array_init(&data); } else { if (Z_TYPE_P(fields) == IS_ARRAY) { - zephir_is_iterable(fields, &_1$$5, &_0$$5, 0, 0, "phalcon/forms/form.zep", 693); - for ( - ; zend_hash_get_current_data_ex(_1$$5, (void**) &_2$$5, &_0$$5) == SUCCESS - ; zend_hash_move_forward_ex(_1$$5, &_0$$5) - ) { - ZEPHIR_GET_HVALUE(field, _2$$5); - if (zephir_array_isset(data, field)) { - zephir_array_unset(&data, field, PH_SEPARATE); + zephir_is_iterable(fields, 0, "phalcon/forms/form.zep", 693); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(fields), _0$$5) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _0$$5); + if (zephir_array_isset(&data, &field)) { + zephir_array_unset(&data, &field, PH_SEPARATE); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); } else { - if (zephir_array_isset(data, field)) { - zephir_array_unset(&data, field, PH_SEPARATE); + if (zephir_array_isset(&data, &field)) { + zephir_array_unset(&data, &field, PH_SEPARATE); } } } - zephir_update_property_this(getThis(), SL("_data"), data TSRMLS_CC); - ZEPHIR_OBS_VAR(elements); - zephir_read_property_this(&elements, this_ptr, SL("_elements"), PH_NOISY_CC); - if (Z_TYPE_P(elements) == IS_ARRAY) { - zephir_is_iterable(elements, &_4$$10, &_3$$10, 0, 0, "phalcon/forms/form.zep", 713); - for ( - ; zend_hash_get_current_data_ex(_4$$10, (void**) &_5$$10, &_3$$10) == SUCCESS - ; zend_hash_move_forward_ex(_4$$10, &_3$$10) - ) { - ZEPHIR_GET_HVALUE(element, _5$$10); + zephir_update_property_zval(this_ptr, SL("_data"), &data); + ZEPHIR_OBS_VAR(&elements); + zephir_read_property(&elements, this_ptr, SL("_elements"), PH_NOISY_CC); + if (Z_TYPE_P(&elements) == IS_ARRAY) { + zephir_is_iterable(&elements, 0, "phalcon/forms/form.zep", 713); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&elements), _1$$10) + { + ZEPHIR_INIT_NVAR(&element); + ZVAL_COPY(&element, _1$$10); if (Z_TYPE_P(fields) != IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, element, "clear", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &element, "clear", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&_6$$13, element, "getname", NULL, 0); + ZEPHIR_CALL_METHOD(&_2$$13, &element, "getname", NULL, 0); zephir_check_call_status(); - if (zephir_fast_in_array(_6$$13, fields TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, element, "clear", NULL, 0); + if (zephir_fast_in_array(&_2$$13, fields TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &element, "clear", NULL, 0); zephir_check_call_status(); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&element); } RETURN_THIS(); @@ -1138,11 +1318,14 @@ PHP_METHOD(Phalcon_Forms_Form, clear) { */ PHP_METHOD(Phalcon_Forms_Form, count) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC)); + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + RETURN_LONG(zephir_fast_count_int(&_0 TSRMLS_CC)); } @@ -1151,25 +1334,32 @@ PHP_METHOD(Phalcon_Forms_Form, count) { */ PHP_METHOD(Phalcon_Forms_Form, rewind) { - zval *_0, *_1, *_2$$3, *_3$$3 = NULL, *_4$$4; + zval _0, _1, _2$$3, _3$$3, _4$$4; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_position"), _0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_elements"), PH_NOISY_CC); - if (Z_TYPE_P(_1) == IS_ARRAY) { - _2$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_3$$3, "array_values", NULL, 235, _2$$3); + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_position"), &_0); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_elements"), PH_NOISY_CC); + if (Z_TYPE_P(&_1) == IS_ARRAY) { + zephir_read_property(&_2$$3, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_3$$3, "array_values", NULL, 197, &_2$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_elementsIndexed"), _3$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_elementsIndexed"), &_3$$3); } else { - ZEPHIR_INIT_VAR(_4$$4); - array_init(_4$$4); - zephir_update_property_this(getThis(), SL("_elementsIndexed"), _4$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$4); + array_init(&_4$$4); + zephir_update_property_zval(this_ptr, SL("_elementsIndexed"), &_4$$4); } ZEPHIR_MM_RESTORE(); @@ -1180,13 +1370,18 @@ PHP_METHOD(Phalcon_Forms_Form, rewind) { */ PHP_METHOD(Phalcon_Forms_Form, current) { - zval *element = NULL, *_0, *_1; + zval element, _0, _1; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&element); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elementsIndexed"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_position"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&element, _0, _1, 1 TSRMLS_CC)) { - RETURN_CTORW(element); + + zephir_read_property(&_0, this_ptr, SL("_elementsIndexed"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_position"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&element, &_0, &_1, 1 TSRMLS_CC)) { + RETURN_CTORW(&element); } RETURN_BOOL(0); @@ -1197,7 +1392,8 @@ PHP_METHOD(Phalcon_Forms_Form, current) { */ PHP_METHOD(Phalcon_Forms_Form, key) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_position"); @@ -1208,7 +1404,8 @@ PHP_METHOD(Phalcon_Forms_Form, key) { */ PHP_METHOD(Phalcon_Forms_Form, next) { - + zval *this_ptr = getThis(); + RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_position") TSRMLS_CC)); @@ -1219,49 +1416,46 @@ PHP_METHOD(Phalcon_Forms_Form, next) { */ PHP_METHOD(Phalcon_Forms_Form, valid) { - zval *_0, *_1; + zval _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elementsIndexed"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_position"), PH_NOISY_CC); - RETURN_BOOL(zephir_array_isset(_0, _1)); + zephir_read_property(&_0, this_ptr, SL("_elementsIndexed"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_position"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_array_isset(&_0, &_1)); } -zend_object_value zephir_init_properties_Phalcon_Forms_Form(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Forms_Form(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_2, *_1$$3, *_3$$4; + zval _0, _2, _1$$3, _3$$4; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_elements"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_elements"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_elements"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("_options"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("_options"), &_3$$4); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/forms/form.zep.h b/ext/phalcon/forms/form.zep.h index 8107eed03e6..b6bd99b0eae 100644 --- a/ext/phalcon/forms/form.zep.h +++ b/ext/phalcon/forms/form.zep.h @@ -35,7 +35,7 @@ PHP_METHOD(Phalcon_Forms_Form, current); PHP_METHOD(Phalcon_Forms_Form, key); PHP_METHOD(Phalcon_Forms_Form, next); PHP_METHOD(Phalcon_Forms_Form, valid); -zend_object_value zephir_init_properties_Phalcon_Forms_Form(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Forms_Form(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_setvalidation, 0, 0, 1) ZEND_ARG_INFO(0, validation) @@ -46,11 +46,30 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form___construct, 0, 0, 0) ZEND_ARG_INFO(0, userOptions) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_setaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_setaction, 0, 1, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_setaction, 0, 1, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, action, IS_STRING, 0) +#else ZEND_ARG_INFO(0, action) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_setuseroption, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_getaction, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_getaction, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_setuseroption, 0, 2, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_setuseroption, 0, 2, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif ZEND_ARG_INFO(0, option) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() @@ -60,90 +79,229 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_getuseroption, 0, 0, 1) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_setuseroptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_setuseroptions, 0, 1, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_setuseroptions, 0, 1, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_setentity, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_getuseroptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_getuseroptions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_setentity, 0, 1, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_setentity, 0, 1, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif ZEND_ARG_INFO(0, entity) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_bind, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_getelements, 0, 0, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_getelements, 0, 0, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_bind, 0, 2, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_bind, 0, 2, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_ARG_INFO(0, entity) ZEND_ARG_INFO(0, whitelist) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_isvalid, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_isvalid, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_isvalid, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_ARG_INFO(0, entity) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_getmessages, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, byItemName, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, byItemName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_getmessagesfor, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_getmessagesfor, 0, 1, Phalcon\\Validation\\Message\\Group, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_getmessagesfor, 0, 1, IS_OBJECT, "Phalcon\\Validation\\Message\\Group", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_hasmessagesfor, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_hasmessagesfor, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_hasmessagesfor, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_add, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_add, 0, 1, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_add, 0, 1, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif ZEND_ARG_OBJ_INFO(0, element, Phalcon\\Forms\\ElementInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, position, IS_STRING, 1) +#else ZEND_ARG_INFO(0, position) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_render, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_render, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_render, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_get, 0, 1, Phalcon\\Forms\\ElementInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_get, 0, 1, IS_OBJECT, "Phalcon\\Forms\\ElementInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_label, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_label, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_label, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_getlabel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_getlabel, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_getlabel, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_getvalue, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_remove, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_remove, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_remove, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_form_clear, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_form_clear, 0, 0, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_clear, 0, 0, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif ZEND_ARG_INFO(0, fields) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_count, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_key, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_key, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_valid, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_form_valid, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_forms_form_method_entry) { PHP_ME(Phalcon_Forms_Form, setValidation, arginfo_phalcon_forms_form_setvalidation, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, getValidation, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, __construct, arginfo_phalcon_forms_form___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Forms_Form, setAction, arginfo_phalcon_forms_form_setaction, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Form, getAction, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Form, getAction, arginfo_phalcon_forms_form_getaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, setUserOption, arginfo_phalcon_forms_form_setuseroption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, getUserOption, arginfo_phalcon_forms_form_getuseroption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, setUserOptions, arginfo_phalcon_forms_form_setuseroptions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Form, getUserOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Form, getUserOptions, arginfo_phalcon_forms_form_getuseroptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, setEntity, arginfo_phalcon_forms_form_setentity, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, getEntity, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Form, getElements, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Form, getElements, arginfo_phalcon_forms_form_getelements, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, bind, arginfo_phalcon_forms_form_bind, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, isValid, arginfo_phalcon_forms_form_isvalid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, getMessages, arginfo_phalcon_forms_form_getmessages, ZEND_ACC_PUBLIC) @@ -158,11 +316,11 @@ ZEPHIR_INIT_FUNCS(phalcon_forms_form_method_entry) { PHP_ME(Phalcon_Forms_Form, has, arginfo_phalcon_forms_form_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, remove, arginfo_phalcon_forms_form_remove, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, clear, arginfo_phalcon_forms_form_clear, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Form, count, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Form, count, arginfo_phalcon_forms_form_count, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, rewind, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, current, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Form, key, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Form, key, arginfo_phalcon_forms_form_key, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Forms_Form, next, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Forms_Form, valid, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Forms_Form, valid, arginfo_phalcon_forms_form_valid, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/forms/manager.zep.c b/ext/phalcon/forms/manager.zep.c index 11233b901fe..7b3e399800e 100644 --- a/ext/phalcon/forms/manager.zep.c +++ b/ext/phalcon/forms/manager.zep.c @@ -43,24 +43,31 @@ ZEPHIR_INIT_CLASS(Phalcon_Forms_Manager) { PHP_METHOD(Phalcon_Forms_Manager, create) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *entity = NULL, *form = NULL; - zval *name = NULL; + zval *name_param = NULL, *entity = NULL, entity_sub, __$null, form; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&entity_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&form); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &entity); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); if (!entity) { - entity = ZEPHIR_GLOBAL(global_null); + entity = &entity_sub; + entity = &__$null; } - ZEPHIR_INIT_VAR(form); - object_init_ex(form, phalcon_forms_form_ce); - ZEPHIR_CALL_METHOD(NULL, form, "__construct", NULL, 236, entity); + ZEPHIR_INIT_VAR(&form); + object_init_ex(&form, phalcon_forms_form_ce); + ZEPHIR_CALL_METHOD(NULL, &form, "__construct", NULL, 198, entity); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_forms"), name, form TSRMLS_CC); - RETURN_CCTOR(form); + zephir_update_property_array(this_ptr, SL("_forms"), &name, &form TSRMLS_CC); + RETURN_CCTOR(&form); } @@ -70,29 +77,36 @@ PHP_METHOD(Phalcon_Forms_Manager, create) { PHP_METHOD(Phalcon_Forms_Manager, get) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *form = NULL, *_0, *_1$$3; - zval *name = NULL, *_2$$3; + zval *name_param = NULL, form, _0, _1$$3; + zval name, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&form); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - ZEPHIR_OBS_VAR(form); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_forms"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&form, _0, name, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_forms_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SVS(_2$$3, "There is no form with name='", name, "'"); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _2$$3); + ZEPHIR_OBS_VAR(&form); + zephir_read_property(&_0, this_ptr, SL("_forms"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&form, &_0, &name, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_forms_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SVS(&_2$$3, "There is no form with name='", &name, "'"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/forms/manager.zep", 52 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/forms/manager.zep", 52 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - RETURN_CCTOR(form); + RETURN_CCTOR(&form); } @@ -101,17 +115,21 @@ PHP_METHOD(Phalcon_Forms_Manager, get) { */ PHP_METHOD(Phalcon_Forms_Manager, has) { - zval *name_param = NULL, *_0; - zval *name = NULL; + zval *name_param = NULL, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_forms"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, name)); + zephir_read_property(&_0, this_ptr, SL("_forms"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &name)); } @@ -120,16 +138,20 @@ PHP_METHOD(Phalcon_Forms_Manager, has) { */ PHP_METHOD(Phalcon_Forms_Manager, set) { - zval *name_param = NULL, *form; - zval *name = NULL; + zval *name_param = NULL, *form, form_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&form_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &form); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - zephir_update_property_array(this_ptr, SL("_forms"), name, form TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_forms"), &name, form TSRMLS_CC); RETURN_THIS(); } diff --git a/ext/phalcon/forms/manager.zep.h b/ext/phalcon/forms/manager.zep.h index 594c92605f6..0a8908e49f1 100644 --- a/ext/phalcon/forms/manager.zep.h +++ b/ext/phalcon/forms/manager.zep.h @@ -8,21 +8,53 @@ PHP_METHOD(Phalcon_Forms_Manager, get); PHP_METHOD(Phalcon_Forms_Manager, has); PHP_METHOD(Phalcon_Forms_Manager, set); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_manager_create, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_manager_create, 0, 1, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_manager_create, 0, 1, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, entity) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_manager_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_manager_get, 0, 1, Phalcon\\Forms\\Form, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_manager_get, 0, 1, IS_OBJECT, "Phalcon\\Forms\\Form", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_manager_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_manager_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_manager_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_forms_manager_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_forms_manager_set, 0, 2, Phalcon\\Forms\\FormManager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_forms_manager_set, 0, 2, IS_OBJECT, "Phalcon\\Forms\\FormManager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_OBJ_INFO(0, form, Phalcon\\Forms\\Form, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/http/cookie.zep.c b/ext/phalcon/http/cookie.zep.c index c36b2e173df..58e098ad89a 100644 --- a/ext/phalcon/http/cookie.zep.c +++ b/ext/phalcon/http/cookie.zep.c @@ -75,24 +75,35 @@ PHP_METHOD(Phalcon_Http_Cookie, __construct) { zend_bool secure, httpOnly; zend_long expire, ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *value = NULL, *expire_param = NULL, *path_param = NULL, *secure_param = NULL, *domain_param = NULL, *httpOnly_param = NULL, *_0; - zval *name = NULL, *path = NULL, *domain = NULL; + zval *name_param = NULL, *value = NULL, value_sub, *expire_param = NULL, *path_param = NULL, *secure_param = NULL, *domain_param = NULL, *httpOnly_param = NULL, __$true, __$false, __$null, _0; + zval name, path, domain; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&value_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 6, &name_param, &value, &expire_param, &path_param, &secure_param, &domain_param, &httpOnly_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!value) { - value = ZEPHIR_GLOBAL(global_null); + value = &value_sub; + value = &__$null; } if (!expire_param) { expire = 0; @@ -100,10 +111,10 @@ PHP_METHOD(Phalcon_Http_Cookie, __construct) { expire = zephir_get_intval(expire_param); } if (!path_param) { - ZEPHIR_INIT_VAR(path); - ZVAL_STRING(path, "/", 1); + ZEPHIR_INIT_VAR(&path); + ZVAL_STRING(&path, "/"); } else { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } if (!secure_param) { secure = 0; @@ -111,10 +122,10 @@ PHP_METHOD(Phalcon_Http_Cookie, __construct) { secure = zephir_get_boolval(secure_param); } if (!domain_param) { - ZEPHIR_INIT_VAR(domain); - ZVAL_EMPTY_STRING(domain); + ZEPHIR_INIT_VAR(&domain); + ZVAL_STRING(&domain, ""); } else { - zephir_get_strval(domain, domain_param); + zephir_get_strval(&domain, domain_param); } if (!httpOnly_param) { httpOnly = 0; @@ -123,32 +134,32 @@ PHP_METHOD(Phalcon_Http_Cookie, __construct) { } - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); if (Z_TYPE_P(value) != IS_NULL) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "setvalue", NULL, 0, value); zephir_check_call_status(); } ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, expire); - zephir_update_property_this(getThis(), SL("_expire"), _0 TSRMLS_CC); - if (!ZEPHIR_IS_STRING_IDENTICAL(path, "")) { - zephir_update_property_this(getThis(), SL("_path"), path TSRMLS_CC); + ZVAL_LONG(&_0, expire); + zephir_update_property_zval(this_ptr, SL("_expire"), &_0); + if (!ZEPHIR_IS_STRING_IDENTICAL(&path, "")) { + zephir_update_property_zval(this_ptr, SL("_path"), &path); } if (secure != 0) { if (secure) { - zephir_update_property_this(getThis(), SL("_secure"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_secure"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_secure"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_secure"), &__$false); } } - if (!ZEPHIR_IS_STRING_IDENTICAL(domain, "")) { - zephir_update_property_this(getThis(), SL("_domain"), domain TSRMLS_CC); + if (!ZEPHIR_IS_STRING_IDENTICAL(&domain, "")) { + zephir_update_property_zval(this_ptr, SL("_domain"), &domain); } if (httpOnly != 0) { if (httpOnly) { - zephir_update_property_this(getThis(), SL("_httpOnly"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_httpOnly"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_httpOnly"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_httpOnly"), &__$false); } } ZEPHIR_MM_RESTORE(); @@ -170,24 +181,27 @@ PHP_METHOD(Phalcon_Http_Cookie, setSignKey) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *signKey_param = NULL; - zval *signKey = NULL; + zval signKey; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&signKey); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &signKey_param); if (!signKey_param) { - ZEPHIR_INIT_VAR(signKey); - ZVAL_EMPTY_STRING(signKey); + ZEPHIR_INIT_VAR(&signKey); + ZVAL_STRING(&signKey, ""); } else { - zephir_get_strval(signKey, signKey_param); + zephir_get_strval(&signKey, signKey_param); } - if (!ZEPHIR_IS_STRING_IDENTICAL(signKey, "")) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "assertsignkeyislongenough", NULL, 0, signKey); + if (!ZEPHIR_IS_STRING_IDENTICAL(&signKey, "")) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "assertsignkeyislongenough", NULL, 0, &signKey); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("signKey"), signKey TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("signKey"), &signKey); RETURN_THIS(); } @@ -197,13 +211,16 @@ PHP_METHOD(Phalcon_Http_Cookie, setSignKey) { */ PHP_METHOD(Phalcon_Http_Cookie, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -212,7 +229,8 @@ PHP_METHOD(Phalcon_Http_Cookie, setDI) { */ PHP_METHOD(Phalcon_Http_Cookie, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -226,17 +244,22 @@ PHP_METHOD(Phalcon_Http_Cookie, getDI) { */ PHP_METHOD(Phalcon_Http_Cookie, setValue) { - zval *value; + zval *value, value_sub, __$true, __$false; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &value); - zephir_update_property_this(getThis(), SL("_value"), value TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_value"), value); if (1) { - zephir_update_property_this(getThis(), SL("_readed"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_readed"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_readed"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_readed"), &__$false); } RETURN_THISW(); @@ -248,88 +271,108 @@ PHP_METHOD(Phalcon_Http_Cookie, setValue) { PHP_METHOD(Phalcon_Http_Cookie, getValue) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *filters = NULL, *defaultValue = NULL, *_COOKIE, *dependencyInjector = NULL, *value = NULL, *crypt = NULL, *decryptedValue = NULL, *filter = NULL, *signKey = NULL, *name = NULL, *_0, *_1, *_2$$5, *_3$$6, *_4$$6 = NULL, *_5$$6, *_6$$14, *_7$$13; + zval *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *_COOKIE, __$null, dependencyInjector, value, crypt, decryptedValue, filter, signKey, name, _0, _1, _2$$5, _3$$6, _4$$6, _5$$6, _6$$14, _7$$13; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filters_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&crypt); + ZVAL_UNDEF(&decryptedValue); + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&signKey); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$14); + ZVAL_UNDEF(&_7$$13); ZEPHIR_MM_GROW(); - zephir_get_global(&_COOKIE, SS("_COOKIE") TSRMLS_CC); + zephir_get_global(&_COOKIE, SL("_COOKIE")); zephir_fetch_params(1, 0, 2, &filters, &defaultValue); if (!filters) { - filters = ZEPHIR_GLOBAL(global_null); + filters = &filters_sub; + filters = &__$null; } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(dependencyInjector); - ZVAL_NULL(dependencyInjector); - ZEPHIR_OBS_VAR(name); - zephir_read_property_this(&name, this_ptr, SL("_name"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_readed"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1)) { - ZEPHIR_OBS_VAR(value); - if (zephir_array_isset_fetch(&value, _COOKIE, name, 0 TSRMLS_CC)) { - _2$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_useEncryption"), PH_NOISY_CC); - if (zephir_is_true(_2$$5)) { - _3$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _3$$6); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&dependencyInjector); + ZVAL_NULL(&dependencyInjector); + ZEPHIR_OBS_VAR(&name); + zephir_read_property(&name, this_ptr, SL("_name"), PH_NOISY_CC); + zephir_read_property(&_1, this_ptr, SL("_readed"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1)) { + ZEPHIR_OBS_VAR(&value); + if (zephir_array_isset_fetch(&value, _COOKIE, &name, 0 TSRMLS_CC)) { + zephir_read_property(&_2$$5, this_ptr, SL("_useEncryption"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_2$$5)) { + zephir_read_property(&_3$$6, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_3$$6); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection object is required to access the 'filter' and 'crypt' service", "phalcon/http/cookie.zep", 180); return; } - ZEPHIR_INIT_VAR(_5$$6); - ZVAL_STRING(_5$$6, "crypt", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_4$$6, dependencyInjector, "getshared", NULL, 0, _5$$6); - zephir_check_temp_parameter(_5$$6); + ZEPHIR_INIT_VAR(&_5$$6); + ZVAL_STRING(&_5$$6, "crypt"); + ZEPHIR_CALL_METHOD(&_4$$6, &dependencyInjector, "getshared", NULL, 0, &_5$$6); zephir_check_call_status(); - ZEPHIR_CPY_WRT(crypt, _4$$6); - if (Z_TYPE_P(crypt) != IS_OBJECT) { + ZEPHIR_CPY_WRT(&crypt, &_4$$6); + if (Z_TYPE_P(&crypt) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency which implements CryptInterface is required to use encryption", "phalcon/http/cookie.zep", 187); return; } - _3$$6 = zephir_fetch_nproperty_this(this_ptr, SL("signKey"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(signKey, _3$$6); - if (Z_TYPE_P(signKey) == IS_STRING) { - ZEPHIR_CALL_METHOD(&decryptedValue, crypt, "decryptbase64", NULL, 0, value, signKey); + zephir_read_property(&_3$$6, this_ptr, SL("signKey"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&signKey, &_3$$6); + if (Z_TYPE_P(&signKey) == IS_STRING) { + ZEPHIR_CALL_METHOD(&decryptedValue, &crypt, "decryptbase64", NULL, 0, &value, &signKey); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&decryptedValue, crypt, "decryptbase64", NULL, 0, value); + ZEPHIR_CALL_METHOD(&decryptedValue, &crypt, "decryptbase64", NULL, 0, &value); zephir_check_call_status(); } } else { - ZEPHIR_CPY_WRT(decryptedValue, value); + ZEPHIR_CPY_WRT(&decryptedValue, &value); } - zephir_update_property_this(getThis(), SL("_value"), decryptedValue TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_value"), &decryptedValue); if (Z_TYPE_P(filters) != IS_NULL) { - ZEPHIR_OBS_VAR(filter); - zephir_read_property_this(&filter, this_ptr, SL("_filter"), PH_NOISY_CC); - if (Z_TYPE_P(filter) != IS_OBJECT) { - if (Z_TYPE_P(dependencyInjector) == IS_NULL) { - _6$$14 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _6$$14); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&filter); + zephir_read_property(&filter, this_ptr, SL("_filter"), PH_NOISY_CC); + if (Z_TYPE_P(&filter) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) == IS_NULL) { + zephir_read_property(&_6$$14, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_6$$14); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection object is required to access the 'filter' service", "phalcon/http/cookie.zep", 223); return; } } - ZEPHIR_INIT_VAR(_7$$13); - ZVAL_STRING(_7$$13, "filter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&filter, dependencyInjector, "getshared", NULL, 0, _7$$13); - zephir_check_temp_parameter(_7$$13); + ZEPHIR_INIT_VAR(&_7$$13); + ZVAL_STRING(&_7$$13, "filter"); + ZEPHIR_CALL_METHOD(&filter, &dependencyInjector, "getshared", NULL, 0, &_7$$13); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_filter"), filter TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_filter"), &filter); } - ZEPHIR_RETURN_CALL_METHOD(filter, "sanitize", NULL, 0, decryptedValue, filters); + ZEPHIR_RETURN_CALL_METHOD(&filter, "sanitize", NULL, 0, &decryptedValue, filters); zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(decryptedValue); + RETURN_CCTOR(&decryptedValue); } RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); @@ -345,100 +388,122 @@ PHP_METHOD(Phalcon_Http_Cookie, getValue) { */ PHP_METHOD(Phalcon_Http_Cookie, send) { - zval *_7$$15 = NULL, *_8$$16 = NULL; - zval *name = NULL, *value = NULL, *expire = NULL, *domain = NULL, *path = NULL, *secure = NULL, *httpOnly = NULL, *dependencyInjector = NULL, *definition = NULL, *session = NULL, *crypt = NULL, *encryptValue = NULL, *signKey = NULL, *_3, *_0$$9 = NULL, *_1$$9, *_2$$10, *_4$$12 = NULL, *_5$$12, *_6$$12; + zval _7$$15, _8$$16; + zval name, value, expire, domain, path, secure, httpOnly, dependencyInjector, definition, session, crypt, encryptValue, signKey, _3, _0$$9, _1$$9, _2$$10, _4$$12, _5$$12, _6$$12; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&expire); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&secure); + ZVAL_UNDEF(&httpOnly); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&crypt); + ZVAL_UNDEF(&encryptValue); + ZVAL_UNDEF(&signKey); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$9); + ZVAL_UNDEF(&_1$$9); + ZVAL_UNDEF(&_2$$10); + ZVAL_UNDEF(&_4$$12); + ZVAL_UNDEF(&_5$$12); + ZVAL_UNDEF(&_6$$12); + ZVAL_UNDEF(&_7$$15); + ZVAL_UNDEF(&_8$$16); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(name); - zephir_read_property_this(&name, this_ptr, SL("_name"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(value); - zephir_read_property_this(&value, this_ptr, SL("_value"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(expire); - zephir_read_property_this(&expire, this_ptr, SL("_expire"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(domain); - zephir_read_property_this(&domain, this_ptr, SL("_domain"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(path); - zephir_read_property_this(&path, this_ptr, SL("_path"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(secure); - zephir_read_property_this(&secure, this_ptr, SL("_secure"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(httpOnly); - zephir_read_property_this(&httpOnly, this_ptr, SL("_httpOnly"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&name); + zephir_read_property(&name, this_ptr, SL("_name"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&value); + zephir_read_property(&value, this_ptr, SL("_value"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&expire); + zephir_read_property(&expire, this_ptr, SL("_expire"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&domain); + zephir_read_property(&domain, this_ptr, SL("_domain"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&path); + zephir_read_property(&path, this_ptr, SL("_path"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&secure); + zephir_read_property(&secure, this_ptr, SL("_secure"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&httpOnly); + zephir_read_property(&httpOnly, this_ptr, SL("_httpOnly"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection object is required to access the 'session' service", "phalcon/http/cookie.zep", 266); return; } - ZEPHIR_INIT_VAR(definition); - array_init(definition); - if (!ZEPHIR_IS_LONG(expire, 0)) { + ZEPHIR_INIT_VAR(&definition); + array_init(&definition); + if (!ZEPHIR_IS_LONG(&expire, 0)) { zephir_array_update_string(&definition, SL("expire"), &expire, PH_COPY | PH_SEPARATE); } - if (!(ZEPHIR_IS_EMPTY(path))) { + if (!(ZEPHIR_IS_EMPTY(&path))) { zephir_array_update_string(&definition, SL("path"), &path, PH_COPY | PH_SEPARATE); } - if (!(ZEPHIR_IS_EMPTY(domain))) { + if (!(ZEPHIR_IS_EMPTY(&domain))) { zephir_array_update_string(&definition, SL("domain"), &domain, PH_COPY | PH_SEPARATE); } - if (!(ZEPHIR_IS_EMPTY(secure))) { + if (!(ZEPHIR_IS_EMPTY(&secure))) { zephir_array_update_string(&definition, SL("secure"), &secure, PH_COPY | PH_SEPARATE); } - if (!(ZEPHIR_IS_EMPTY(httpOnly))) { + if (!(ZEPHIR_IS_EMPTY(&httpOnly))) { zephir_array_update_string(&definition, SL("httpOnly"), &httpOnly, PH_COPY | PH_SEPARATE); } - if (zephir_fast_count_int(definition TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_1$$9); - ZVAL_STRING(_1$$9, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0$$9, dependencyInjector, "getshared", NULL, 0, _1$$9); - zephir_check_temp_parameter(_1$$9); + if (zephir_fast_count_int(&definition TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_1$$9); + ZVAL_STRING(&_1$$9, "session"); + ZEPHIR_CALL_METHOD(&_0$$9, &dependencyInjector, "getshared", NULL, 0, &_1$$9); zephir_check_call_status(); - ZEPHIR_CPY_WRT(session, _0$$9); - ZEPHIR_CALL_METHOD(&_0$$9, session, "isstarted", NULL, 0); + ZEPHIR_CPY_WRT(&session, &_0$$9); + ZEPHIR_CALL_METHOD(&_0$$9, &session, "isstarted", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_0$$9)) { - ZEPHIR_INIT_VAR(_2$$10); - ZEPHIR_CONCAT_SV(_2$$10, "_PHCOOKIE_", name); - ZEPHIR_CALL_METHOD(NULL, session, "set", NULL, 0, _2$$10, definition); + if (zephir_is_true(&_0$$9)) { + ZEPHIR_INIT_VAR(&_2$$10); + ZEPHIR_CONCAT_SV(&_2$$10, "_PHCOOKIE_", &name); + ZEPHIR_CALL_METHOD(NULL, &session, "set", NULL, 0, &_2$$10, &definition); zephir_check_call_status(); } } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_useEncryption"), PH_NOISY_CC); - if (zephir_is_true(_3)) { - if (!(ZEPHIR_IS_EMPTY(value))) { - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_3, this_ptr, SL("_useEncryption"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_3)) { + if (!(ZEPHIR_IS_EMPTY(&value))) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection object is required to access the 'filter' service", "phalcon/http/cookie.zep", 308); return; } - ZEPHIR_INIT_VAR(_5$$12); - ZVAL_STRING(_5$$12, "crypt", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_4$$12, dependencyInjector, "getshared", NULL, 0, _5$$12); - zephir_check_temp_parameter(_5$$12); + ZEPHIR_INIT_VAR(&_5$$12); + ZVAL_STRING(&_5$$12, "crypt"); + ZEPHIR_CALL_METHOD(&_4$$12, &dependencyInjector, "getshared", NULL, 0, &_5$$12); zephir_check_call_status(); - ZEPHIR_CPY_WRT(crypt, _4$$12); - if (Z_TYPE_P(crypt) != IS_OBJECT) { + ZEPHIR_CPY_WRT(&crypt, &_4$$12); + if (Z_TYPE_P(&crypt) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency which implements CryptInterface is required to use encryption", "phalcon/http/cookie.zep", 315); return; } - _6$$12 = zephir_fetch_nproperty_this(this_ptr, SL("signKey"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(signKey, _6$$12); - if (Z_TYPE_P(signKey) == IS_STRING) { - zephir_get_strval(_7$$15, value); - ZEPHIR_CALL_METHOD(&encryptValue, crypt, "encryptbase64", NULL, 0, _7$$15, signKey); + zephir_read_property(&_6$$12, this_ptr, SL("signKey"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&signKey, &_6$$12); + if (Z_TYPE_P(&signKey) == IS_STRING) { + zephir_get_strval(&_7$$15, &value); + ZEPHIR_CALL_METHOD(&encryptValue, &crypt, "encryptbase64", NULL, 0, &_7$$15, &signKey); zephir_check_call_status(); } else { - zephir_get_strval(_8$$16, value); - ZEPHIR_CALL_METHOD(&encryptValue, crypt, "encryptbase64", NULL, 0, _8$$16); + zephir_get_strval(&_8$$16, &value); + ZEPHIR_CALL_METHOD(&encryptValue, &crypt, "encryptbase64", NULL, 0, &_8$$16); zephir_check_call_status(); } } else { - ZEPHIR_CPY_WRT(encryptValue, value); + ZEPHIR_CPY_WRT(&encryptValue, &value); } } else { - ZEPHIR_CPY_WRT(encryptValue, value); + ZEPHIR_CPY_WRT(&encryptValue, &value); } - ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 237, name, encryptValue, expire, path, domain, secure, httpOnly); + ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 199, &name, &encryptValue, &expire, &path, &domain, &secure, &httpOnly); zephir_check_call_status(); RETURN_THIS(); @@ -451,52 +516,68 @@ PHP_METHOD(Phalcon_Http_Cookie, send) { */ PHP_METHOD(Phalcon_Http_Cookie, restore) { - zval *dependencyInjector = NULL, *expire = NULL, *domain = NULL, *path = NULL, *secure = NULL, *httpOnly = NULL, *session = NULL, *definition = NULL, *_0, *_1$$4, *_2$$4 = NULL, *_3$$5, *_4$$5; + zval __$true, __$false, dependencyInjector, expire, domain, path, secure, httpOnly, session, definition, _0, _1$$4, _2$$4, _3$$5, _4$$5; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&expire); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&secure); + ZVAL_UNDEF(&httpOnly); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_STRING(_1$$4, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&session, dependencyInjector, "getshared", NULL, 0, _1$$4); - zephir_check_temp_parameter(_1$$4); + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_STRING(&_1$$4, "session"); + ZEPHIR_CALL_METHOD(&session, &dependencyInjector, "getshared", NULL, 0, &_1$$4); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2$$4, session, "isstarted", NULL, 0); + ZEPHIR_CALL_METHOD(&_2$$4, &session, "isstarted", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_2$$4)) { - _3$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_name"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_4$$5); - ZEPHIR_CONCAT_SV(_4$$5, "_PHCOOKIE_", _3$$5); - ZEPHIR_CALL_METHOD(&definition, session, "get", NULL, 0, _4$$5); + if (zephir_is_true(&_2$$4)) { + zephir_read_property(&_3$$5, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_4$$5); + ZEPHIR_CONCAT_SV(&_4$$5, "_PHCOOKIE_", &_3$$5); + ZEPHIR_CALL_METHOD(&definition, &session, "get", NULL, 0, &_4$$5); zephir_check_call_status(); - if (Z_TYPE_P(definition) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&expire, definition, SS("expire"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_expire"), expire TSRMLS_CC); + if (Z_TYPE_P(&definition) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&expire, &definition, SL("expire"), 1)) { + zephir_update_property_zval(this_ptr, SL("_expire"), &expire); } - if (zephir_array_isset_string_fetch(&domain, definition, SS("domain"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_domain"), domain TSRMLS_CC); + if (zephir_array_isset_string_fetch(&domain, &definition, SL("domain"), 1)) { + zephir_update_property_zval(this_ptr, SL("_domain"), &domain); } - if (zephir_array_isset_string_fetch(&path, definition, SS("path"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_path"), path TSRMLS_CC); + if (zephir_array_isset_string_fetch(&path, &definition, SL("path"), 1)) { + zephir_update_property_zval(this_ptr, SL("_path"), &path); } - if (zephir_array_isset_string_fetch(&secure, definition, SS("secure"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_secure"), secure TSRMLS_CC); + if (zephir_array_isset_string_fetch(&secure, &definition, SL("secure"), 1)) { + zephir_update_property_zval(this_ptr, SL("_secure"), &secure); } - if (zephir_array_isset_string_fetch(&httpOnly, definition, SS("httpOnly"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_httpOnly"), httpOnly TSRMLS_CC); + if (zephir_array_isset_string_fetch(&httpOnly, &definition, SL("httpOnly"), 1)) { + zephir_update_property_zval(this_ptr, SL("_httpOnly"), &httpOnly); } } } } if (1) { - zephir_update_property_this(getThis(), SL("_restored"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_restored"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_restored"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_restored"), &__$false); } } RETURN_THIS(); @@ -508,45 +589,58 @@ PHP_METHOD(Phalcon_Http_Cookie, restore) { */ PHP_METHOD(Phalcon_Http_Cookie, delete) { - zval *name = NULL, *domain = NULL, *path = NULL, *secure = NULL, *httpOnly = NULL, *dependencyInjector = NULL, *session = NULL, *_0, *_4, _5, *_1$$3 = NULL, *_2$$3, *_3$$4; + zval __$null, name, domain, path, secure, httpOnly, dependencyInjector, session, _0, _4, _1$$3, _2$$3, _3$$4; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&secure); + ZVAL_UNDEF(&httpOnly); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(name); - zephir_read_property_this(&name, this_ptr, SL("_name"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(domain); - zephir_read_property_this(&domain, this_ptr, SL("_domain"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(path); - zephir_read_property_this(&path, this_ptr, SL("_path"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(secure); - zephir_read_property_this(&secure, this_ptr, SL("_secure"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(httpOnly); - zephir_read_property_this(&httpOnly, this_ptr, SL("_httpOnly"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$3, dependencyInjector, "getshared", NULL, 0, _2$$3); - zephir_check_temp_parameter(_2$$3); + ZEPHIR_OBS_VAR(&name); + zephir_read_property(&name, this_ptr, SL("_name"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&domain); + zephir_read_property(&domain, this_ptr, SL("_domain"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&path); + zephir_read_property(&path, this_ptr, SL("_path"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&secure); + zephir_read_property(&secure, this_ptr, SL("_secure"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&httpOnly); + zephir_read_property(&httpOnly, this_ptr, SL("_httpOnly"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "session"); + ZEPHIR_CALL_METHOD(&_1$$3, &dependencyInjector, "getshared", NULL, 0, &_2$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(session, _1$$3); - ZEPHIR_CALL_METHOD(&_1$$3, session, "isstarted", NULL, 0); + ZEPHIR_CPY_WRT(&session, &_1$$3); + ZEPHIR_CALL_METHOD(&_1$$3, &session, "isstarted", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_1$$3)) { - ZEPHIR_INIT_VAR(_3$$4); - ZEPHIR_CONCAT_SV(_3$$4, "_PHCOOKIE_", name); - ZEPHIR_CALL_METHOD(NULL, session, "remove", NULL, 0, _3$$4); + if (zephir_is_true(&_1$$3)) { + ZEPHIR_INIT_VAR(&_3$$4); + ZEPHIR_CONCAT_SV(&_3$$4, "_PHCOOKIE_", &name); + ZEPHIR_CALL_METHOD(NULL, &session, "remove", NULL, 0, &_3$$4); zephir_check_call_status(); } } - zephir_update_property_this(getThis(), SL("_value"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); - ZEPHIR_INIT_VAR(_4); - zephir_time(_4); - ZEPHIR_SINIT_VAR(_5); - ZVAL_LONG(&_5, (zephir_get_numberval(_4) - 691200)); - ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 237, name, ZEPHIR_GLOBAL(global_null), &_5, path, domain, secure, httpOnly); + zephir_update_property_zval(this_ptr, SL("_value"), &__$null); + ZEPHIR_INIT_VAR(&_4); + zephir_time(&_4); + ZVAL_LONG(&_0, (zephir_get_numberval(&_4) - 691200)); + ZEPHIR_CALL_FUNCTION(NULL, "setcookie", NULL, 199, &name, &__$null, &_0, &path, &domain, &secure, &httpOnly); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -557,8 +651,12 @@ PHP_METHOD(Phalcon_Http_Cookie, delete) { */ PHP_METHOD(Phalcon_Http_Cookie, useEncryption) { - zval *useEncryption_param = NULL; + zval *useEncryption_param = NULL, __$true, __$false; zend_bool useEncryption; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &useEncryption_param); @@ -566,9 +664,9 @@ PHP_METHOD(Phalcon_Http_Cookie, useEncryption) { if (useEncryption) { - zephir_update_property_this(getThis(), SL("_useEncryption"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_useEncryption"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_useEncryption"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_useEncryption"), &__$false); } RETURN_THISW(); @@ -579,7 +677,8 @@ PHP_METHOD(Phalcon_Http_Cookie, useEncryption) { */ PHP_METHOD(Phalcon_Http_Cookie, isUsingEncryption) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_useEncryption"); @@ -590,8 +689,12 @@ PHP_METHOD(Phalcon_Http_Cookie, isUsingEncryption) { */ PHP_METHOD(Phalcon_Http_Cookie, setExpiration) { - zval *expire_param = NULL, *_0, *_1; + zval *expire_param = NULL, _0, _1; zend_long expire, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &expire_param); @@ -599,14 +702,14 @@ PHP_METHOD(Phalcon_Http_Cookie, setExpiration) { expire = zephir_get_intval(expire_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } ZEPHIR_INIT_ZVAL_NREF(_1); - ZVAL_LONG(_1, expire); - zephir_update_property_this(getThis(), SL("_expire"), _1 TSRMLS_CC); + ZVAL_LONG(&_1, expire); + zephir_update_property_zval(this_ptr, SL("_expire"), &_1); RETURN_THIS(); } @@ -616,13 +719,16 @@ PHP_METHOD(Phalcon_Http_Cookie, setExpiration) { */ PHP_METHOD(Phalcon_Http_Cookie, getExpiration) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } @@ -636,30 +742,34 @@ PHP_METHOD(Phalcon_Http_Cookie, getExpiration) { PHP_METHOD(Phalcon_Http_Cookie, setPath) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, *_0; - zval *path = NULL; + zval *path_param = NULL, _0; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &path_param); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_path"), path TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_path"), &path); RETURN_THIS(); } @@ -669,7 +779,8 @@ PHP_METHOD(Phalcon_Http_Cookie, setPath) { */ PHP_METHOD(Phalcon_Http_Cookie, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -680,13 +791,16 @@ PHP_METHOD(Phalcon_Http_Cookie, getName) { */ PHP_METHOD(Phalcon_Http_Cookie, getPath) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } @@ -700,30 +814,34 @@ PHP_METHOD(Phalcon_Http_Cookie, getPath) { PHP_METHOD(Phalcon_Http_Cookie, setDomain) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *domain_param = NULL, *_0; - zval *domain = NULL; + zval *domain_param = NULL, _0; + zval domain; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &domain_param); if (UNEXPECTED(Z_TYPE_P(domain_param) != IS_STRING && Z_TYPE_P(domain_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'domain' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'domain' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(domain_param) == IS_STRING)) { - zephir_get_strval(domain, domain_param); + zephir_get_strval(&domain, domain_param); } else { - ZEPHIR_INIT_VAR(domain); - ZVAL_EMPTY_STRING(domain); + ZEPHIR_INIT_VAR(&domain); + ZVAL_EMPTY_STRING(&domain); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_domain"), domain TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_domain"), &domain); RETURN_THIS(); } @@ -733,13 +851,16 @@ PHP_METHOD(Phalcon_Http_Cookie, setDomain) { */ PHP_METHOD(Phalcon_Http_Cookie, getDomain) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } @@ -753,8 +874,13 @@ PHP_METHOD(Phalcon_Http_Cookie, getDomain) { PHP_METHOD(Phalcon_Http_Cookie, setSecure) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *secure_param = NULL, *_0; + zval *secure_param = NULL, __$true, __$false, _0; zend_bool secure; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &secure_param); @@ -762,15 +888,15 @@ PHP_METHOD(Phalcon_Http_Cookie, setSecure) { secure = zephir_get_boolval(secure_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } if (secure) { - zephir_update_property_this(getThis(), SL("_secure"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_secure"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_secure"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_secure"), &__$false); } RETURN_THIS(); @@ -781,13 +907,16 @@ PHP_METHOD(Phalcon_Http_Cookie, setSecure) { */ PHP_METHOD(Phalcon_Http_Cookie, getSecure) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } @@ -801,8 +930,13 @@ PHP_METHOD(Phalcon_Http_Cookie, getSecure) { PHP_METHOD(Phalcon_Http_Cookie, setHttpOnly) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *httpOnly_param = NULL, *_0; + zval *httpOnly_param = NULL, __$true, __$false, _0; zend_bool httpOnly; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &httpOnly_param); @@ -810,15 +944,15 @@ PHP_METHOD(Phalcon_Http_Cookie, setHttpOnly) { httpOnly = zephir_get_boolval(httpOnly_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } if (httpOnly) { - zephir_update_property_this(getThis(), SL("_httpOnly"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_httpOnly"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_httpOnly"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_httpOnly"), &__$false); } RETURN_THIS(); @@ -829,13 +963,16 @@ PHP_METHOD(Phalcon_Http_Cookie, setHttpOnly) { */ PHP_METHOD(Phalcon_Http_Cookie, getHttpOnly) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_restored"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_restored"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "restore", NULL, 0); zephir_check_call_status(); } @@ -848,16 +985,20 @@ PHP_METHOD(Phalcon_Http_Cookie, getHttpOnly) { */ PHP_METHOD(Phalcon_Http_Cookie, __toString) { - zval *_1 = NULL; - zval *_0 = NULL; + zval _1; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getvalue", NULL, 0); zephir_check_call_status(); - zephir_get_strval(_1, _0); - RETURN_CTOR(_1); + zephir_get_strval(&_1, &_0); + RETURN_CTOR(&_1); } @@ -869,36 +1010,43 @@ PHP_METHOD(Phalcon_Http_Cookie, __toString) { PHP_METHOD(Phalcon_Http_Cookie, assertSignKeyIsLongEnough) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *signKey_param = NULL, *length = NULL, *_0$$3, _1$$3, *_2$$3 = NULL; - zval *signKey = NULL; + zval *signKey_param = NULL, length, _0$$3, _1$$3, _2$$3; + zval signKey; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&signKey); + ZVAL_UNDEF(&length); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &signKey_param); if (UNEXPECTED(Z_TYPE_P(signKey_param) != IS_STRING && Z_TYPE_P(signKey_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'signKey' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'signKey' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(signKey_param) == IS_STRING)) { - zephir_get_strval(signKey, signKey_param); + zephir_get_strval(&signKey, signKey_param); } else { - ZEPHIR_INIT_VAR(signKey); - ZVAL_EMPTY_STRING(signKey); + ZEPHIR_INIT_VAR(&signKey); + ZVAL_EMPTY_STRING(&signKey); } - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 238, signKey); + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 200, &signKey); zephir_check_call_status(); - if (ZEPHIR_LT_LONG(length, 32)) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_http_cookie_exception_ce); - ZEPHIR_SINIT_VAR(_1$$3); - ZVAL_STRING(&_1$$3, "The cookie's key should be at least 32 characters long. Current length is %d.", 0); - ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 164, &_1$$3, length); + if (ZEPHIR_LT_LONG(&length, 32)) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_http_cookie_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "The cookie's key should be at least 32 characters long. Current length is %d."); + ZEPHIR_CALL_FUNCTION(&_2$$3, "sprintf", NULL, 145, &_1$$3, &length); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 9, _2$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/http/cookie.zep", 583 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/http/cookie.zep", 583 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } diff --git a/ext/phalcon/http/cookie.zep.h b/ext/phalcon/http/cookie.zep.h index 572d85079a3..9388aa7d139 100644 --- a/ext/phalcon/http/cookie.zep.h +++ b/ext/phalcon/http/cookie.zep.h @@ -29,24 +29,67 @@ PHP_METHOD(Phalcon_Http_Cookie, __toString); PHP_METHOD(Phalcon_Http_Cookie, assertSignKeyIsLongEnough); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, value) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expire, IS_LONG, 0) +#else ZEND_ARG_INFO(0, expire) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, secure, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, secure) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 1) +#else ZEND_ARG_INFO(0, domain) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, httpOnly, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, httpOnly) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_setsignkey, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setsignkey, 0, 0, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_setsignkey, 0, 0, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, signKey, IS_STRING, 1) +#else ZEND_ARG_INFO(0, signKey) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_setvalue, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setvalue, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_setvalue, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() @@ -55,58 +98,180 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_getvalue, 0, 0, 0) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_useencryption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_send, 0, 0, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_send, 0, 0, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_restore, 0, 0, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_restore, 0, 0, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_useencryption, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_useencryption, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useEncryption, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useEncryption) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_setexpiration, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_isusingencryption, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_isusingencryption, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setexpiration, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_setexpiration, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expire, IS_LONG, 0) +#else ZEND_ARG_INFO(0, expire) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_setpath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getexpiration, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getexpiration, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setpath, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_setpath, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getpath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getpath, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_setdomain, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setdomain, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_setdomain, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) +#else ZEND_ARG_INFO(0, domain) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_setsecure, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getdomain, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getdomain, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_setsecure, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_setsecure, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, secure, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, secure) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_sethttponly, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getsecure, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_getsecure, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookie_sethttponly, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_sethttponly, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, httpOnly, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, httpOnly) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_gethttponly, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie_gethttponly, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie___tostring, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookie___tostring, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookie_assertsignkeyislongenough, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, signKey, IS_STRING, 0) +#else ZEND_ARG_INFO(0, signKey) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_cookie_method_entry) { PHP_ME(Phalcon_Http_Cookie, __construct, arginfo_phalcon_http_cookie___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Http_Cookie, setSignKey, arginfo_phalcon_http_cookie_setsignkey, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, setDI, arginfo_phalcon_http_cookie_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getDI, arginfo_phalcon_http_cookie_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, setValue, arginfo_phalcon_http_cookie_setvalue, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, getValue, arginfo_phalcon_http_cookie_getvalue, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, send, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, restore, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, send, arginfo_phalcon_http_cookie_send, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, restore, arginfo_phalcon_http_cookie_restore, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, delete, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, useEncryption, arginfo_phalcon_http_cookie_useencryption, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, isUsingEncryption, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, isUsingEncryption, arginfo_phalcon_http_cookie_isusingencryption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, setExpiration, arginfo_phalcon_http_cookie_setexpiration, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getExpiration, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getExpiration, arginfo_phalcon_http_cookie_getexpiration, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, setPath, arginfo_phalcon_http_cookie_setpath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getPath, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getName, arginfo_phalcon_http_cookie_getname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getPath, arginfo_phalcon_http_cookie_getpath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, setDomain, arginfo_phalcon_http_cookie_setdomain, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getDomain, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getDomain, arginfo_phalcon_http_cookie_getdomain, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, setSecure, arginfo_phalcon_http_cookie_setsecure, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getSecure, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getSecure, arginfo_phalcon_http_cookie_getsecure, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, setHttpOnly, arginfo_phalcon_http_cookie_sethttponly, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, getHttpOnly, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Cookie, __toString, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, getHttpOnly, arginfo_phalcon_http_cookie_gethttponly, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Cookie, __toString, arginfo_phalcon_http_cookie___tostring, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Cookie, assertSignKeyIsLongEnough, arginfo_phalcon_http_cookie_assertsignkeyislongenough, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/http/cookieinterface.zep.h b/ext/phalcon/http/cookieinterface.zep.h index e3470a38473..71ac14ff7c0 100644 --- a/ext/phalcon/http/cookieinterface.zep.h +++ b/ext/phalcon/http/cookieinterface.zep.h @@ -3,7 +3,11 @@ extern zend_class_entry *phalcon_http_cookieinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Http_CookieInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookieinterface_setvalue, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookieinterface_setvalue, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_setvalue, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() @@ -12,47 +16,151 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookieinterface_getvalue, 0, 0, 0) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookieinterface_useencryption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookieinterface_send, 0, 0, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_send, 0, 0, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookieinterface_useencryption, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_useencryption, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useEncryption, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useEncryption) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_isusingencryption, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_isusingencryption, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookieinterface_setexpiration, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookieinterface_setexpiration, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_setexpiration, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expire, IS_LONG, 0) +#else ZEND_ARG_INFO(0, expire) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookieinterface_setpath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getexpiration, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getexpiration, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookieinterface_setpath, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_setpath, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookieinterface_setdomain, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getpath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getpath, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookieinterface_setdomain, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_setdomain, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 0) +#else ZEND_ARG_INFO(0, domain) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getdomain, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getdomain, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookieinterface_setsecure, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookieinterface_setsecure, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_setsecure, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, secure, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, secure) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_cookieinterface_sethttponly, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getsecure, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_getsecure, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_cookieinterface_sethttponly, 0, 1, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_sethttponly, 0, 1, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, httpOnly, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, httpOnly) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_gethttponly, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_cookieinterface_gethttponly, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_cookieinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, setValue, arginfo_phalcon_http_cookieinterface_setvalue) PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getValue, arginfo_phalcon_http_cookieinterface_getvalue) - PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, send, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, send, arginfo_phalcon_http_cookieinterface_send) PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, delete, NULL) PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, useEncryption, arginfo_phalcon_http_cookieinterface_useencryption) - PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, isUsingEncryption, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, isUsingEncryption, arginfo_phalcon_http_cookieinterface_isusingencryption) PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, setExpiration, arginfo_phalcon_http_cookieinterface_setexpiration) - PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getExpiration, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getExpiration, arginfo_phalcon_http_cookieinterface_getexpiration) PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, setPath, arginfo_phalcon_http_cookieinterface_setpath) - PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getName, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getPath, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getName, arginfo_phalcon_http_cookieinterface_getname) + PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getPath, arginfo_phalcon_http_cookieinterface_getpath) PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, setDomain, arginfo_phalcon_http_cookieinterface_setdomain) - PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getDomain, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getDomain, arginfo_phalcon_http_cookieinterface_getdomain) PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, setSecure, arginfo_phalcon_http_cookieinterface_setsecure) - PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getSecure, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getSecure, arginfo_phalcon_http_cookieinterface_getsecure) PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, setHttpOnly, arginfo_phalcon_http_cookieinterface_sethttponly) - PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getHttpOnly, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_CookieInterface, getHttpOnly, arginfo_phalcon_http_cookieinterface_gethttponly) PHP_FE_END }; diff --git a/ext/phalcon/http/request.zep.c b/ext/phalcon/http/request.zep.c index e96f6f46994..db5c155f711 100644 --- a/ext/phalcon/http/request.zep.c +++ b/ext/phalcon/http/request.zep.c @@ -70,7 +70,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Http_Request) { PHP_METHOD(Phalcon_Http_Request, getHttpMethodParameterOverride) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_httpMethodParameterOverride"); @@ -78,13 +79,16 @@ PHP_METHOD(Phalcon_Http_Request, getHttpMethodParameterOverride) { PHP_METHOD(Phalcon_Http_Request, setHttpMethodParameterOverride) { - zval *httpMethodParameterOverride; + zval *httpMethodParameterOverride, httpMethodParameterOverride_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&httpMethodParameterOverride_sub); zephir_fetch_params(0, 1, 0, &httpMethodParameterOverride); - zephir_update_property_this(getThis(), SL("_httpMethodParameterOverride"), httpMethodParameterOverride TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_httpMethodParameterOverride"), httpMethodParameterOverride); RETURN_THISW(); } @@ -94,13 +98,16 @@ PHP_METHOD(Phalcon_Http_Request, setHttpMethodParameterOverride) { */ PHP_METHOD(Phalcon_Http_Request, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -109,7 +116,8 @@ PHP_METHOD(Phalcon_Http_Request, setDI) { */ PHP_METHOD(Phalcon_Http_Request, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -131,33 +139,43 @@ PHP_METHOD(Phalcon_Http_Request, get) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool notAllowEmpty, noRecursive; - zval *name_param = NULL, *filters = NULL, *defaultValue = NULL, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, *_REQUEST, *_0, *_1; - zval *name = NULL; + zval *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, *_REQUEST, __$null, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&filters_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - zephir_get_global(&_REQUEST, SS("_REQUEST") TSRMLS_CC); + zephir_get_global(&_REQUEST, SL("_REQUEST")); zephir_fetch_params(1, 0, 5, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param); if (!name_param) { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_STRING(&name, ""); } else { if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } } if (!filters) { - filters = ZEPHIR_GLOBAL(global_null); + filters = &filters_sub; + filters = &__$null; } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } if (!notAllowEmpty_param) { notAllowEmpty = 0; @@ -171,19 +189,17 @@ PHP_METHOD(Phalcon_Http_Request, get) { } - ZEPHIR_INIT_VAR(_0); if (notAllowEmpty) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_INIT_VAR(_1); if (noRecursive) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 239, _REQUEST, name, filters, defaultValue, _0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 201, _REQUEST, &name, filters, defaultValue, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -205,33 +221,43 @@ PHP_METHOD(Phalcon_Http_Request, getPost) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool notAllowEmpty, noRecursive; - zval *name_param = NULL, *filters = NULL, *defaultValue = NULL, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, *_POST, *_0, *_1; - zval *name = NULL; + zval *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, *_POST, __$null, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&filters_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - zephir_get_global(&_POST, SS("_POST") TSRMLS_CC); + zephir_get_global(&_POST, SL("_POST")); zephir_fetch_params(1, 0, 5, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param); if (!name_param) { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_STRING(&name, ""); } else { if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } } if (!filters) { - filters = ZEPHIR_GLOBAL(global_null); + filters = &filters_sub; + filters = &__$null; } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } if (!notAllowEmpty_param) { notAllowEmpty = 0; @@ -245,19 +271,17 @@ PHP_METHOD(Phalcon_Http_Request, getPost) { } - ZEPHIR_INIT_VAR(_0); if (notAllowEmpty) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_INIT_VAR(_1); if (noRecursive) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 239, _POST, name, filters, defaultValue, _0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 201, _POST, &name, filters, defaultValue, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -278,32 +302,48 @@ PHP_METHOD(Phalcon_Http_Request, getPut) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool notAllowEmpty, noRecursive, _0$$3; - zval *name_param = NULL, *filters = NULL, *defaultValue = NULL, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, *put = NULL, *contentType = NULL, *_5, *_6, _1$$3, *_2$$3 = NULL, *_3$$4, *_4$$6 = NULL; - zval *name = NULL; + zval *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, put, contentType, _5, _6, _1$$3, _2$$3, _3$$4, _4$$6; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&filters_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&put); + ZVAL_UNDEF(&contentType); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 5, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param); if (!name_param) { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_STRING(&name, ""); } else { if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } } if (!filters) { - filters = ZEPHIR_GLOBAL(global_null); + filters = &filters_sub; + filters = &__$null; } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } if (!notAllowEmpty_param) { notAllowEmpty = 0; @@ -317,53 +357,50 @@ PHP_METHOD(Phalcon_Http_Request, getPut) { } - ZEPHIR_OBS_VAR(put); - zephir_read_property_this(&put, this_ptr, SL("_putCache"), PH_NOISY_CC); - if (Z_TYPE_P(put) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&put); + zephir_read_property(&put, this_ptr, SL("_putCache"), PH_NOISY_CC); + if (Z_TYPE_P(&put) != IS_ARRAY) { ZEPHIR_CALL_METHOD(&contentType, this_ptr, "getcontenttype", NULL, 0); zephir_check_call_status(); - _0$$3 = Z_TYPE_P(contentType) == IS_STRING; + _0$$3 = Z_TYPE_P(&contentType) == IS_STRING; if (_0$$3) { - ZEPHIR_SINIT_VAR(_1$$3); - ZVAL_STRING(&_1$$3, "json", 0); - ZEPHIR_CALL_FUNCTION(&_2$$3, "stripos", NULL, 240, contentType, &_1$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "json"); + ZEPHIR_CALL_FUNCTION(&_2$$3, "stripos", NULL, 202, &contentType, &_1$$3); zephir_check_call_status(); - _0$$3 = !ZEPHIR_IS_FALSE(_2$$3); + _0$$3 = !ZEPHIR_IS_FALSE(&_2$$3); } if (_0$$3) { - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_BOOL(_3$$4, 1); - ZEPHIR_CALL_METHOD(&put, this_ptr, "getjsonrawbody", NULL, 0, _3$$4); + ZVAL_BOOL(&_3$$4, 1); + ZEPHIR_CALL_METHOD(&put, this_ptr, "getjsonrawbody", NULL, 0, &_3$$4); zephir_check_call_status(); - if (Z_TYPE_P(put) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(put); - array_init(put); + if (Z_TYPE_P(&put) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&put); + array_init(&put); } } else { - ZEPHIR_INIT_NVAR(put); - array_init(put); + ZEPHIR_INIT_NVAR(&put); + array_init(&put); ZEPHIR_CALL_METHOD(&_4$$6, this_ptr, "getrawbody", NULL, 0); zephir_check_call_status(); - ZEPHIR_MAKE_REF(put); - ZEPHIR_CALL_FUNCTION(NULL, "parse_str", NULL, 241, _4$$6, put); - ZEPHIR_UNREF(put); + ZEPHIR_MAKE_REF(&put); + ZEPHIR_CALL_FUNCTION(NULL, "parse_str", NULL, 203, &_4$$6, &put); + ZEPHIR_UNREF(&put); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_putCache"), put TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_putCache"), &put); } - ZEPHIR_INIT_VAR(_5); if (notAllowEmpty) { - ZVAL_BOOL(_5, 1); + ZVAL_BOOL(&_5, 1); } else { - ZVAL_BOOL(_5, 0); + ZVAL_BOOL(&_5, 0); } - ZEPHIR_INIT_VAR(_6); if (noRecursive) { - ZVAL_BOOL(_6, 1); + ZVAL_BOOL(&_6, 1); } else { - ZVAL_BOOL(_6, 0); + ZVAL_BOOL(&_6, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 239, put, name, filters, defaultValue, _5, _6); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 201, &put, &name, filters, defaultValue, &_5, &_6); zephir_check_call_status(); RETURN_MM(); @@ -388,33 +425,43 @@ PHP_METHOD(Phalcon_Http_Request, getQuery) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool notAllowEmpty, noRecursive; - zval *name_param = NULL, *filters = NULL, *defaultValue = NULL, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, *_GET, *_0, *_1; - zval *name = NULL; + zval *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, *_GET, __$null, _0, _1; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&filters_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - zephir_get_global(&_GET, SS("_GET") TSRMLS_CC); + zephir_get_global(&_GET, SL("_GET")); zephir_fetch_params(1, 0, 5, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param); if (!name_param) { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_STRING(&name, ""); } else { if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } } if (!filters) { - filters = ZEPHIR_GLOBAL(global_null); + filters = &filters_sub; + filters = &__$null; } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } if (!notAllowEmpty_param) { notAllowEmpty = 0; @@ -428,19 +475,17 @@ PHP_METHOD(Phalcon_Http_Request, getQuery) { } - ZEPHIR_INIT_VAR(_0); if (notAllowEmpty) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_INIT_VAR(_1); if (noRecursive) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 239, _GET, name, filters, defaultValue, _0, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "gethelper", NULL, 201, _GET, &name, filters, defaultValue, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -454,34 +499,51 @@ PHP_METHOD(Phalcon_Http_Request, getHelper) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool notAllowEmpty, noRecursive, _5; - zval *name = NULL; - zval *source_param = NULL, *name_param = NULL, *filters = NULL, *defaultValue = NULL, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, *value = NULL, *filter = NULL, *dependencyInjector = NULL, *_0$$6, *_1$$6 = NULL, *_2$$6, *_3$$5 = NULL, *_4$$5; - zval *source = NULL; + zval name; + zval *source_param = NULL, *name_param = NULL, *filters = NULL, filters_sub, *defaultValue = NULL, defaultValue_sub, *notAllowEmpty_param = NULL, *noRecursive_param = NULL, __$null, value, filter, dependencyInjector, _0$$6, _1$$6, _2$$6, _3$$5, _4$$5; + zval source; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&filters_sub); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0$$6); + ZVAL_UNDEF(&_1$$6); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 5, &source_param, &name_param, &filters, &defaultValue, ¬AllowEmpty_param, &noRecursive_param); - zephir_get_arrval(source, source_param); + zephir_get_arrval(&source, source_param); if (!name_param) { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_STRING(&name, ""); } else { if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } } if (!filters) { - filters = ZEPHIR_GLOBAL(global_null); + filters = &filters_sub; + filters = &__$null; } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } if (!notAllowEmpty_param) { notAllowEmpty = 0; @@ -495,43 +557,41 @@ PHP_METHOD(Phalcon_Http_Request, getHelper) { } - if (ZEPHIR_IS_STRING_IDENTICAL(name, "")) { - RETURN_CTOR(source); + if (ZEPHIR_IS_STRING_IDENTICAL(&name, "")) { + RETURN_CTOR(&source); } - ZEPHIR_OBS_VAR(value); - if (!(zephir_array_isset_fetch(&value, source, name, 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&value); + if (!(zephir_array_isset_fetch(&value, &source, &name, 0 TSRMLS_CC))) { RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); } if (Z_TYPE_P(filters) != IS_NULL) { - ZEPHIR_OBS_VAR(filter); - zephir_read_property_this(&filter, this_ptr, SL("_filter"), PH_NOISY_CC); - if (Z_TYPE_P(filter) != IS_OBJECT) { - _0$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0$$6); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&filter); + zephir_read_property(&filter, this_ptr, SL("_filter"), PH_NOISY_CC); + if (Z_TYPE_P(&filter) != IS_OBJECT) { + zephir_read_property(&_0$$6, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0$$6); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_request_exception_ce, "A dependency injection object is required to access the 'filter' service", "phalcon/http/request.zep", 192); return; } - ZEPHIR_INIT_VAR(_2$$6); - ZVAL_STRING(_2$$6, "filter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$6, dependencyInjector, "getshared", NULL, 0, _2$$6); - zephir_check_temp_parameter(_2$$6); + ZEPHIR_INIT_VAR(&_2$$6); + ZVAL_STRING(&_2$$6, "filter"); + ZEPHIR_CALL_METHOD(&_1$$6, &dependencyInjector, "getshared", NULL, 0, &_2$$6); zephir_check_call_status(); - ZEPHIR_CPY_WRT(filter, _1$$6); - zephir_update_property_this(getThis(), SL("_filter"), filter TSRMLS_CC); + ZEPHIR_CPY_WRT(&filter, &_1$$6); + zephir_update_property_zval(this_ptr, SL("_filter"), &filter); } - ZEPHIR_INIT_VAR(_4$$5); if (noRecursive) { - ZVAL_BOOL(_4$$5, 1); + ZVAL_BOOL(&_4$$5, 1); } else { - ZVAL_BOOL(_4$$5, 0); + ZVAL_BOOL(&_4$$5, 0); } - ZEPHIR_CALL_METHOD(&_3$$5, filter, "sanitize", NULL, 0, value, filters, _4$$5); + ZEPHIR_CALL_METHOD(&_3$$5, &filter, "sanitize", NULL, 0, &value, filters, &_4$$5); zephir_check_call_status(); - ZEPHIR_CPY_WRT(value, _3$$5); + ZEPHIR_CPY_WRT(&value, &_3$$5); } - _5 = ZEPHIR_IS_EMPTY(value); + _5 = ZEPHIR_IS_EMPTY(&value); if (_5) { _5 = notAllowEmpty == 1; } @@ -539,7 +599,7 @@ PHP_METHOD(Phalcon_Http_Request, getHelper) { RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); } - RETURN_CCTOR(value); + RETURN_CCTOR(&value); } @@ -548,27 +608,31 @@ PHP_METHOD(Phalcon_Http_Request, getHelper) { */ PHP_METHOD(Phalcon_Http_Request, getServer) { - zval *name_param = NULL, *_SERVER, *serverValue = NULL; - zval *name = NULL; + zval *name_param = NULL, *_SERVER, serverValue; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&serverValue); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - if (zephir_array_isset_fetch(&serverValue, _SERVER, name, 1 TSRMLS_CC)) { - RETURN_CTOR(serverValue); + if (zephir_array_isset_fetch(&serverValue, _SERVER, &name, 1 TSRMLS_CC)) { + RETURN_CTOR(&serverValue); } RETURN_MM_NULL(); @@ -580,25 +644,28 @@ PHP_METHOD(Phalcon_Http_Request, getServer) { PHP_METHOD(Phalcon_Http_Request, has) { zval *name_param = NULL, *_REQUEST; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); - zephir_get_global(&_REQUEST, SS("_REQUEST") TSRMLS_CC); + zephir_get_global(&_REQUEST, SL("_REQUEST")); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - RETURN_MM_BOOL(zephir_array_isset(_REQUEST, name)); + RETURN_MM_BOOL(zephir_array_isset(_REQUEST, &name)); } @@ -608,25 +675,28 @@ PHP_METHOD(Phalcon_Http_Request, has) { PHP_METHOD(Phalcon_Http_Request, hasPost) { zval *name_param = NULL, *_POST; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); - zephir_get_global(&_POST, SS("_POST") TSRMLS_CC); + zephir_get_global(&_POST, SL("_POST")); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - RETURN_MM_BOOL(zephir_array_isset(_POST, name)); + RETURN_MM_BOOL(zephir_array_isset(_POST, &name)); } @@ -636,27 +706,31 @@ PHP_METHOD(Phalcon_Http_Request, hasPost) { PHP_METHOD(Phalcon_Http_Request, hasPut) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *put = NULL; - zval *name = NULL; + zval *name_param = NULL, put; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&put); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } ZEPHIR_CALL_METHOD(&put, this_ptr, "getput", NULL, 0); zephir_check_call_status(); - RETURN_MM_BOOL(zephir_array_isset(put, name)); + RETURN_MM_BOOL(zephir_array_isset(&put, &name)); } @@ -666,25 +740,28 @@ PHP_METHOD(Phalcon_Http_Request, hasPut) { PHP_METHOD(Phalcon_Http_Request, hasQuery) { zval *name_param = NULL, *_GET; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); - zephir_get_global(&_GET, SS("_GET") TSRMLS_CC); + zephir_get_global(&_GET, SL("_GET")); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - RETURN_MM_BOOL(zephir_array_isset(_GET, name)); + RETURN_MM_BOOL(zephir_array_isset(_GET, &name)); } @@ -694,25 +771,28 @@ PHP_METHOD(Phalcon_Http_Request, hasQuery) { PHP_METHOD(Phalcon_Http_Request, hasServer) { zval *name_param = NULL, *_SERVER; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - RETURN_MM_BOOL(zephir_array_isset(_SERVER, name)); + RETURN_MM_BOOL(zephir_array_isset(_SERVER, &name)); } @@ -722,39 +802,47 @@ PHP_METHOD(Phalcon_Http_Request, hasServer) { PHP_METHOD(Phalcon_Http_Request, hasHeader) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *header_param = NULL, *_SERVER, *name = NULL, _0, _1, *_2 = NULL, *_3; - zval *header = NULL; + zval *header_param = NULL, *_SERVER, name, _0, _1, _2, _3; + zval header; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&header); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); zephir_fetch_params(1, 1, 0, &header_param); if (UNEXPECTED(Z_TYPE_P(header_param) != IS_STRING && Z_TYPE_P(header_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'header' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'header' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(header_param) == IS_STRING)) { - zephir_get_strval(header, header_param); + zephir_get_strval(&header, header_param); } else { - ZEPHIR_INIT_VAR(header); - ZVAL_EMPTY_STRING(header); + ZEPHIR_INIT_VAR(&header); + ZVAL_EMPTY_STRING(&header); } - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "-", 0); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "_", 0); - ZEPHIR_CALL_FUNCTION(&_2, "strtr", NULL, 27, header, &_0, &_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "-"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "_"); + ZEPHIR_CALL_FUNCTION(&_2, "strtr", NULL, 22, &header, &_0, &_1); zephir_check_call_status(); - ZEPHIR_INIT_VAR(name); - zephir_fast_strtoupper(name, _2); - if (zephir_array_isset(_SERVER, name)) { + ZEPHIR_INIT_VAR(&name); + zephir_fast_strtoupper(&name, &_2); + if (zephir_array_isset(_SERVER, &name)) { RETURN_MM_BOOL(1); } - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SV(_3, "HTTP_", name); - if (zephir_array_isset(_SERVER, _3)) { + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SV(&_3, "HTTP_", &name); + if (zephir_array_isset(_SERVER, &_3)) { RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); @@ -767,44 +855,53 @@ PHP_METHOD(Phalcon_Http_Request, hasHeader) { PHP_METHOD(Phalcon_Http_Request, getHeader) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *header_param = NULL, *_SERVER, *value = NULL, *name = NULL, _0, _1, *_2 = NULL, *_3; - zval *header = NULL; + zval *header_param = NULL, *_SERVER, value, name, _0, _1, _2, _3; + zval header; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&header); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); zephir_fetch_params(1, 1, 0, &header_param); if (UNEXPECTED(Z_TYPE_P(header_param) != IS_STRING && Z_TYPE_P(header_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'header' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'header' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(header_param) == IS_STRING)) { - zephir_get_strval(header, header_param); + zephir_get_strval(&header, header_param); } else { - ZEPHIR_INIT_VAR(header); - ZVAL_EMPTY_STRING(header); + ZEPHIR_INIT_VAR(&header); + ZVAL_EMPTY_STRING(&header); } - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "-", 0); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "_", 0); - ZEPHIR_CALL_FUNCTION(&_2, "strtr", NULL, 27, header, &_0, &_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "-"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "_"); + ZEPHIR_CALL_FUNCTION(&_2, "strtr", NULL, 22, &header, &_0, &_1); zephir_check_call_status(); - ZEPHIR_INIT_VAR(name); - zephir_fast_strtoupper(name, _2); - ZEPHIR_OBS_VAR(value); - if (zephir_array_isset_fetch(&value, _SERVER, name, 0 TSRMLS_CC)) { - RETURN_CCTOR(value); + ZEPHIR_INIT_VAR(&name); + zephir_fast_strtoupper(&name, &_2); + ZEPHIR_OBS_VAR(&value); + if (zephir_array_isset_fetch(&value, _SERVER, &name, 0 TSRMLS_CC)) { + RETURN_CCTOR(&value); } - ZEPHIR_OBS_NVAR(value); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SV(_3, "HTTP_", name); - if (zephir_array_isset_fetch(&value, _SERVER, _3, 0 TSRMLS_CC)) { - RETURN_CCTOR(value); + ZEPHIR_OBS_NVAR(&value); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SV(&_3, "HTTP_", &name); + if (zephir_array_isset_fetch(&value, _SERVER, &_3, 0 TSRMLS_CC)) { + RETURN_CCTOR(&value); } - RETURN_MM_STRING("", 1); + RETURN_MM_STRING(""); } @@ -813,28 +910,32 @@ PHP_METHOD(Phalcon_Http_Request, getHeader) { */ PHP_METHOD(Phalcon_Http_Request, getScheme) { - zval *https = NULL, *scheme = NULL, *_0; + zval https, scheme, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&https); + ZVAL_UNDEF(&scheme); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "HTTPS", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&https, this_ptr, "getserver", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "HTTPS"); + ZEPHIR_CALL_METHOD(&https, this_ptr, "getserver", NULL, 0, &_0); zephir_check_call_status(); - if (zephir_is_true(https)) { - ZEPHIR_INIT_VAR(scheme); - if (ZEPHIR_IS_STRING(https, "off")) { - ZVAL_STRING(scheme, "http", 1); + if (zephir_is_true(&https)) { + ZEPHIR_INIT_VAR(&scheme); + if (ZEPHIR_IS_STRING(&https, "off")) { + ZVAL_STRING(&scheme, "http"); } else { - ZVAL_STRING(scheme, "https", 1); + ZVAL_STRING(&scheme, "https"); } } else { - ZEPHIR_INIT_NVAR(scheme); - ZVAL_STRING(scheme, "http", 1); + ZEPHIR_INIT_NVAR(&scheme); + ZVAL_STRING(&scheme, "http"); } - RETURN_CCTOR(scheme); + RETURN_CCTOR(&scheme); } @@ -844,17 +945,19 @@ PHP_METHOD(Phalcon_Http_Request, getScheme) { PHP_METHOD(Phalcon_Http_Request, isAjax) { zend_bool _0; - zval *_SERVER, *_1; + zval *_SERVER, _1; + zval *this_ptr = getThis(); - ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + ZVAL_UNDEF(&_1); + + zephir_get_global(&_SERVER, SL("_SERVER")); - _0 = zephir_array_isset_string(_SERVER, SS("HTTP_X_REQUESTED_WITH")); + _0 = zephir_array_isset_string(_SERVER, SL("HTTP_X_REQUESTED_WITH")); if (_0) { zephir_array_fetch_string(&_1, _SERVER, SL("HTTP_X_REQUESTED_WITH"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 330 TSRMLS_CC); - _0 = ZEPHIR_IS_STRING_IDENTICAL(_1, "XMLHttpRequest"); + _0 = ZEPHIR_IS_STRING_IDENTICAL(&_1, "XMLHttpRequest"); } - RETURN_MM_BOOL(_0); + RETURN_BOOL(_0); } @@ -864,18 +967,21 @@ PHP_METHOD(Phalcon_Http_Request, isAjax) { PHP_METHOD(Phalcon_Http_Request, isSoap) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *_SERVER, *contentType = NULL; + zval *_SERVER, contentType; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&contentType); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); - if (zephir_array_isset_string(_SERVER, SS("HTTP_SOAPACTION"))) { + if (zephir_array_isset_string(_SERVER, SL("HTTP_SOAPACTION"))) { RETURN_MM_BOOL(1); } else { ZEPHIR_CALL_METHOD(&contentType, this_ptr, "getcontenttype", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(contentType))) { - RETURN_MM_BOOL(zephir_memnstr_str(contentType, SL("application/soap+xml"), "phalcon/http/request.zep", 345)); + if (!(ZEPHIR_IS_EMPTY(&contentType))) { + RETURN_MM_BOOL(zephir_memnstr_str(&contentType, SL("application/soap+xml"), "phalcon/http/request.zep", 345)); } } RETURN_MM_BOOL(0); @@ -888,6 +994,8 @@ PHP_METHOD(Phalcon_Http_Request, isSoap) { PHP_METHOD(Phalcon_Http_Request, isSoapRequested) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -902,14 +1010,17 @@ PHP_METHOD(Phalcon_Http_Request, isSoapRequested) { */ PHP_METHOD(Phalcon_Http_Request, isSecure) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getscheme", NULL, 0); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "https")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "https")); } @@ -919,6 +1030,8 @@ PHP_METHOD(Phalcon_Http_Request, isSecure) { PHP_METHOD(Phalcon_Http_Request, isSecureRequest) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -933,21 +1046,26 @@ PHP_METHOD(Phalcon_Http_Request, isSecureRequest) { */ PHP_METHOD(Phalcon_Http_Request, getRawBody) { - zval *rawBody = NULL, *contents = NULL, _0$$3; + zval rawBody, contents, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&rawBody); + ZVAL_UNDEF(&contents); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(rawBody); - zephir_read_property_this(&rawBody, this_ptr, SL("_rawBody"), PH_NOISY_CC); - if (ZEPHIR_IS_EMPTY(rawBody)) { - ZEPHIR_SINIT_VAR(_0$$3); - ZVAL_STRING(&_0$$3, "php://input", 0); - ZEPHIR_INIT_VAR(contents); - zephir_file_get_contents(contents, &_0$$3 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_rawBody"), contents TSRMLS_CC); - RETURN_CCTOR(contents); + ZEPHIR_OBS_VAR(&rawBody); + zephir_read_property(&rawBody, this_ptr, SL("_rawBody"), PH_NOISY_CC); + if (ZEPHIR_IS_EMPTY(&rawBody)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "php://input"); + ZEPHIR_INIT_VAR(&contents); + zephir_file_get_contents(&contents, &_0$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rawBody"), &contents); + RETURN_CCTOR(&contents); } - RETURN_CCTOR(rawBody); + RETURN_CCTOR(&rawBody); } @@ -957,8 +1075,14 @@ PHP_METHOD(Phalcon_Http_Request, getRawBody) { PHP_METHOD(Phalcon_Http_Request, getJsonRawBody) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *associative_param = NULL, *rawBody = NULL, *data = NULL, _0, *_1 = NULL; + zval *associative_param = NULL, rawBody, data, _0, _1; zend_bool associative; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&rawBody); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &associative_param); @@ -972,19 +1096,18 @@ PHP_METHOD(Phalcon_Http_Request, getJsonRawBody) { ZEPHIR_CALL_METHOD(&rawBody, this_ptr, "getrawbody", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(rawBody)) { + if (ZEPHIR_IS_EMPTY(&rawBody)) { RETURN_MM_BOOL(0); } - ZEPHIR_SINIT_VAR(_0); ZVAL_BOOL(&_0, (associative ? 1 : 0)); - ZEPHIR_INIT_VAR(data); - zephir_json_decode(data, &(data), rawBody, zephir_get_intval(&_0) TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_1, "json_last_error", NULL, 242); + ZEPHIR_INIT_VAR(&data); + zephir_json_decode(&data, &rawBody, zephir_get_intval(&_0) ); + ZEPHIR_CALL_FUNCTION(&_1, "json_last_error", NULL, 204); zephir_check_call_status(); - if (!ZEPHIR_IS_LONG_IDENTICAL(_1, 0)) { + if (!ZEPHIR_IS_LONG_IDENTICAL(&_1, 0)) { RETURN_MM_BOOL(0); } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -994,18 +1117,22 @@ PHP_METHOD(Phalcon_Http_Request, getJsonRawBody) { PHP_METHOD(Phalcon_Http_Request, getServerAddress) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *_SERVER, *serverAddr = NULL, _0; + zval *_SERVER, serverAddr, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&serverAddr); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); - ZEPHIR_OBS_VAR(serverAddr); - if (zephir_array_isset_string_fetch(&serverAddr, _SERVER, SS("SERVER_ADDR"), 0 TSRMLS_CC)) { - RETURN_CCTOR(serverAddr); + ZEPHIR_OBS_VAR(&serverAddr); + if (zephir_array_isset_string_fetch(&serverAddr, _SERVER, SL("SERVER_ADDR"), 0)) { + RETURN_CCTOR(&serverAddr); } - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "localhost", 0); - ZEPHIR_RETURN_CALL_FUNCTION("gethostbyname", NULL, 243, &_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "localhost"); + ZEPHIR_RETURN_CALL_FUNCTION("gethostbyname", NULL, 205, &_0); zephir_check_call_status(); RETURN_MM(); @@ -1016,15 +1143,17 @@ PHP_METHOD(Phalcon_Http_Request, getServerAddress) { */ PHP_METHOD(Phalcon_Http_Request, getServerName) { - zval *_SERVER, *serverName = NULL; + zval *_SERVER, serverName; + zval *this_ptr = getThis(); - ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + ZVAL_UNDEF(&serverName); - if (zephir_array_isset_string_fetch(&serverName, _SERVER, SS("SERVER_NAME"), 1 TSRMLS_CC)) { - RETURN_CTOR(serverName); + zephir_get_global(&_SERVER, SL("_SERVER")); + + if (zephir_array_isset_string_fetch(&serverName, _SERVER, SL("SERVER_NAME"), 1)) { + RETURN_CTORW(&serverName); } - RETURN_MM_STRING("localhost", 1); + RETURN_STRING("localhost"); } @@ -1064,78 +1193,89 @@ PHP_METHOD(Phalcon_Http_Request, getServerName) { */ PHP_METHOD(Phalcon_Http_Request, getHttpHost) { - zval *_14 = NULL; + zval _14; zend_bool _3; - zval *host = NULL, *strict = NULL, *_0, *_1$$3, *_2$$4, *_4$$5, *_8$$5, *_9$$5, *_10$$5 = NULL, _11$$5, *_5$$6, *_6$$6, *_7$$6 = NULL, *_12$$7, *_13$$7; + zval host, strict, _0, _1$$3, _2$$4, _4$$5, _8$$5, _9$$5, _10$$5, _11$$5, _5$$6, _6$$6, _7$$6, _12$$7, _13$$7; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&host); + ZVAL_UNDEF(&strict); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_12$$7); + ZVAL_UNDEF(&_13$$7); + ZVAL_UNDEF(&_14); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(strict); - zephir_read_property_this(&strict, this_ptr, SL("_strictHostCheck"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "HTTP_HOST", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_OBS_VAR(&strict); + zephir_read_property(&strict, this_ptr, SL("_strictHostCheck"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "HTTP_HOST"); + ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, &_0); zephir_check_call_status(); - if (!(zephir_is_true(host))) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "SERVER_NAME", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, _1$$3); - zephir_check_temp_parameter(_1$$3); + if (!(zephir_is_true(&host))) { + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "SERVER_NAME"); + ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, &_1$$3); zephir_check_call_status(); - if (!(zephir_is_true(host))) { - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_STRING(_2$$4, "SERVER_ADDR", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, _2$$4); - zephir_check_temp_parameter(_2$$4); + if (!(zephir_is_true(&host))) { + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, "SERVER_ADDR"); + ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, &_2$$4); zephir_check_call_status(); } } - _3 = zephir_is_true(host); + _3 = zephir_is_true(&host); if (_3) { - _3 = zephir_is_true(strict); + _3 = zephir_is_true(&strict); } if (_3) { - ZEPHIR_INIT_VAR(_4$$5); - zephir_fast_trim(_4$$5, host, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); - ZEPHIR_INIT_NVAR(host); - zephir_fast_strtolower(host, _4$$5); - if (zephir_memnstr_str(host, SL(":"), "phalcon/http/request.zep", 507)) { - ZEPHIR_INIT_VAR(_5$$6); - ZVAL_STRING(_5$$6, "/:[[:digit:]]+$/", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_6$$6); - ZVAL_STRING(_6$$6, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_7$$6, "preg_replace", NULL, 42, _5$$6, _6$$6, host); - zephir_check_temp_parameter(_5$$6); - zephir_check_temp_parameter(_6$$6); + ZEPHIR_INIT_VAR(&_4$$5); + zephir_fast_trim(&_4$$5, &host, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); + ZEPHIR_INIT_NVAR(&host); + zephir_fast_strtolower(&host, &_4$$5); + if (zephir_memnstr_str(&host, SL(":"), "phalcon/http/request.zep", 507)) { + ZEPHIR_INIT_VAR(&_5$$6); + ZVAL_STRING(&_5$$6, "/:[[:digit:]]+$/"); + ZEPHIR_INIT_VAR(&_6$$6); + ZVAL_STRING(&_6$$6, ""); + ZEPHIR_CALL_FUNCTION(&_7$$6, "preg_replace", NULL, 35, &_5$$6, &_6$$6, &host); zephir_check_call_status(); - ZEPHIR_CPY_WRT(host, _7$$6); + ZEPHIR_CPY_WRT(&host, &_7$$6); } - ZEPHIR_INIT_VAR(_8$$5); - ZVAL_STRING(_8$$5, "/[a-z0-9-]+\\.?/", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_9$$5); - ZVAL_STRING(_9$$5, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_10$$5, "preg_replace", NULL, 42, _8$$5, _9$$5, host); - zephir_check_temp_parameter(_8$$5); - zephir_check_temp_parameter(_9$$5); + ZEPHIR_INIT_VAR(&_8$$5); + ZVAL_STRING(&_8$$5, "/[a-z0-9-]+\\.?/"); + ZEPHIR_INIT_VAR(&_9$$5); + ZVAL_STRING(&_9$$5, ""); + ZEPHIR_CALL_FUNCTION(&_10$$5, "preg_replace", NULL, 35, &_8$$5, &_9$$5, &host); zephir_check_call_status(); ZEPHIR_SINIT_VAR(_11$$5); - ZVAL_STRING(&_11$$5, "", 0); - if (!ZEPHIR_IS_IDENTICAL(&_11$$5, _10$$5)) { - ZEPHIR_INIT_VAR(_12$$7); - object_init_ex(_12$$7, spl_ce_UnexpectedValueException); - ZEPHIR_INIT_VAR(_13$$7); - ZEPHIR_CONCAT_SV(_13$$7, "Invalid host ", host); - ZEPHIR_CALL_METHOD(NULL, _12$$7, "__construct", NULL, 244, _13$$7); + ZVAL_STRING(&_11$$5, ""); + if (!ZEPHIR_IS_IDENTICAL(&_11$$5, &_10$$5)) { + ZEPHIR_INIT_VAR(&_12$$7); + object_init_ex(&_12$$7, spl_ce_UnexpectedValueException); + ZEPHIR_INIT_VAR(&_13$$7); + ZEPHIR_CONCAT_SV(&_13$$7, "Invalid host ", &host); + ZEPHIR_CALL_METHOD(NULL, &_12$$7, "__construct", NULL, 206, &_13$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_12$$7, "phalcon/http/request.zep", 516 TSRMLS_CC); + zephir_throw_exception_debug(&_12$$7, "phalcon/http/request.zep", 516 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - zephir_get_strval(_14, host); - RETURN_CTOR(_14); + zephir_get_strval(&_14, &host); + RETURN_CTOR(&_14); } @@ -1144,8 +1284,12 @@ PHP_METHOD(Phalcon_Http_Request, getHttpHost) { */ PHP_METHOD(Phalcon_Http_Request, setStrictHostCheck) { - zval *flag_param = NULL; + zval *flag_param = NULL, __$true, __$false; zend_bool flag; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 0, 1, &flag_param); @@ -1157,9 +1301,9 @@ PHP_METHOD(Phalcon_Http_Request, setStrictHostCheck) { if (flag) { - zephir_update_property_this(getThis(), SL("_strictHostCheck"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_strictHostCheck"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_strictHostCheck"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_strictHostCheck"), &__$false); } RETURN_THISW(); @@ -1170,7 +1314,8 @@ PHP_METHOD(Phalcon_Http_Request, setStrictHostCheck) { */ PHP_METHOD(Phalcon_Http_Request, isStrictHostCheck) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_strictHostCheck"); @@ -1181,48 +1326,57 @@ PHP_METHOD(Phalcon_Http_Request, isStrictHostCheck) { */ PHP_METHOD(Phalcon_Http_Request, getPort) { - zval *host = NULL, *pos = NULL, *_0 = NULL, *_7 = NULL, _1$$4, _2$$5, *_3$$5, *_4$$3, *_5$$3 = NULL, _6$$3; + zval host, pos, _0, _7, _1$$4, _2$$5, _3$$5, _4$$3, _5$$3, _6$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&host); + ZVAL_UNDEF(&pos); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "HTTP_HOST", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "HTTP_HOST"); + ZEPHIR_CALL_METHOD(&host, this_ptr, "getserver", NULL, 0, &_0); zephir_check_call_status(); - if (zephir_is_true(host)) { - if (zephir_memnstr_str(host, SL(":"), "phalcon/http/request.zep", 553)) { - ZEPHIR_SINIT_VAR(_1$$4); - ZVAL_STRING(&_1$$4, ":", 0); - ZEPHIR_CALL_FUNCTION(&pos, "strrpos", NULL, 155, host, &_1$$4); + if (zephir_is_true(&host)) { + if (zephir_memnstr_str(&host, SL(":"), "phalcon/http/request.zep", 553)) { + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_STRING(&_1$$4, ":"); + ZEPHIR_CALL_FUNCTION(&pos, "strrpos", NULL, 135, &host, &_1$$4); zephir_check_call_status(); - if (!ZEPHIR_IS_FALSE_IDENTICAL(pos)) { - ZEPHIR_SINIT_VAR(_2$$5); - ZVAL_LONG(&_2$$5, (zephir_get_numberval(pos) + 1)); - ZEPHIR_INIT_VAR(_3$$5); - zephir_substr(_3$$5, host, zephir_get_intval(&_2$$5), 0, ZEPHIR_SUBSTR_NO_LENGTH); - RETURN_MM_LONG(zephir_get_intval(_3$$5)); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&pos)) { + ZVAL_LONG(&_2$$5, (zephir_get_numberval(&pos) + 1)); + ZEPHIR_INIT_VAR(&_3$$5); + zephir_substr(&_3$$5, &host, zephir_get_intval(&_2$$5), 0, ZEPHIR_SUBSTR_NO_LENGTH); + RETURN_MM_LONG(zephir_get_intval(&_3$$5)); } } - ZEPHIR_INIT_VAR(_4$$3); + ZEPHIR_INIT_VAR(&_4$$3); ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "getscheme", NULL, 0); zephir_check_call_status(); ZEPHIR_SINIT_VAR(_6$$3); - ZVAL_STRING(&_6$$3, "https", 0); - if (ZEPHIR_IS_IDENTICAL(&_6$$3, _5$$3)) { - ZVAL_LONG(_4$$3, 443); + ZVAL_STRING(&_6$$3, "https"); + if (ZEPHIR_IS_IDENTICAL(&_6$$3, &_5$$3)) { + ZVAL_LONG(&_4$$3, 443); } else { - ZVAL_LONG(_4$$3, 80); + ZVAL_LONG(&_4$$3, 80); } - RETURN_CCTOR(_4$$3); + RETURN_CCTOR(&_4$$3); } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "SERVER_PORT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_7, this_ptr, "getserver", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "SERVER_PORT"); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "getserver", NULL, 0, &_0); zephir_check_call_status(); - RETURN_MM_LONG(zephir_get_intval(_7)); + RETURN_MM_LONG(zephir_get_intval(&_7)); } @@ -1231,15 +1385,17 @@ PHP_METHOD(Phalcon_Http_Request, getPort) { */ PHP_METHOD(Phalcon_Http_Request, getURI) { - zval *_SERVER, *requestURI = NULL; + zval *_SERVER, requestURI; + zval *this_ptr = getThis(); - ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + ZVAL_UNDEF(&requestURI); + + zephir_get_global(&_SERVER, SL("_SERVER")); - if (zephir_array_isset_string_fetch(&requestURI, _SERVER, SS("REQUEST_URI"), 1 TSRMLS_CC)) { - RETURN_CTOR(requestURI); + if (zephir_array_isset_string_fetch(&requestURI, _SERVER, SL("REQUEST_URI"), 1)) { + RETURN_CTORW(&requestURI); } - RETURN_MM_STRING("", 1); + RETURN_STRING(""); } @@ -1249,11 +1405,16 @@ PHP_METHOD(Phalcon_Http_Request, getURI) { */ PHP_METHOD(Phalcon_Http_Request, getClientAddress) { - zval *trustForwardedHeader_param = NULL, *_SERVER, *address = NULL, *_0$$7, *_1$$7; + zval *trustForwardedHeader_param = NULL, *_SERVER, address, _0$$7, _1$$7; zend_bool trustForwardedHeader; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&address); + ZVAL_UNDEF(&_0$$7); + ZVAL_UNDEF(&_1$$7); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); zephir_fetch_params(1, 0, 1, &trustForwardedHeader_param); if (!trustForwardedHeader_param) { @@ -1263,28 +1424,28 @@ PHP_METHOD(Phalcon_Http_Request, getClientAddress) { } - ZEPHIR_INIT_VAR(address); - ZVAL_NULL(address); + ZEPHIR_INIT_VAR(&address); + ZVAL_NULL(&address); if (trustForwardedHeader) { - ZEPHIR_OBS_NVAR(address); - zephir_array_isset_string_fetch(&address, _SERVER, SS("HTTP_X_FORWARDED_FOR"), 0 TSRMLS_CC); - if (Z_TYPE_P(address) == IS_NULL) { - ZEPHIR_OBS_NVAR(address); - zephir_array_isset_string_fetch(&address, _SERVER, SS("HTTP_CLIENT_IP"), 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&address); + zephir_array_isset_string_fetch(&address, _SERVER, SL("HTTP_X_FORWARDED_FOR"), 0); + if (Z_TYPE_P(&address) == IS_NULL) { + ZEPHIR_OBS_NVAR(&address); + zephir_array_isset_string_fetch(&address, _SERVER, SL("HTTP_CLIENT_IP"), 0); } } - if (Z_TYPE_P(address) == IS_NULL) { - ZEPHIR_OBS_NVAR(address); - zephir_array_isset_string_fetch(&address, _SERVER, SS("REMOTE_ADDR"), 0 TSRMLS_CC); + if (Z_TYPE_P(&address) == IS_NULL) { + ZEPHIR_OBS_NVAR(&address); + zephir_array_isset_string_fetch(&address, _SERVER, SL("REMOTE_ADDR"), 0); } - if (Z_TYPE_P(address) == IS_STRING) { - if (zephir_memnstr_str(address, SL(","), "phalcon/http/request.zep", 604)) { - ZEPHIR_INIT_VAR(_0$$7); - zephir_fast_explode_str(_0$$7, SL(","), address, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&_1$$7, _0$$7, 0, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 608 TSRMLS_CC); - RETURN_CTOR(_1$$7); + if (Z_TYPE_P(&address) == IS_STRING) { + if (zephir_memnstr_str(&address, SL(","), "phalcon/http/request.zep", 604)) { + ZEPHIR_INIT_VAR(&_0$$7); + zephir_fast_explode_str(&_0$$7, SL(","), &address, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&_1$$7, &_0$$7, 0, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 608 TSRMLS_CC); + RETURN_CTOR(&_1$$7); } - RETURN_CCTOR(address); + RETURN_CCTOR(&address); } RETURN_MM_BOOL(0); @@ -1303,49 +1464,58 @@ PHP_METHOD(Phalcon_Http_Request, getClientAddress) { */ PHP_METHOD(Phalcon_Http_Request, getMethod) { - zval *returnMethod = NULL; + zval returnMethod; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *_SERVER, *_REQUEST, *overridedMethod = NULL, *spoofedMethod = NULL, *requestMethod = NULL, _0, *_3 = NULL, *_1$$5, *_2$$5; + zval *_SERVER, *_REQUEST, overridedMethod, spoofedMethod, requestMethod, _0, _3, _1$$5, _2$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&overridedMethod); + ZVAL_UNDEF(&spoofedMethod); + ZVAL_UNDEF(&requestMethod); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&returnMethod); ZEPHIR_MM_GROW(); - zephir_get_global(&_REQUEST, SS("_REQUEST") TSRMLS_CC); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); - - ZEPHIR_INIT_VAR(returnMethod); - ZVAL_EMPTY_STRING(returnMethod); - ZEPHIR_OBS_VAR(requestMethod); - if (EXPECTED(zephir_array_isset_string_fetch(&requestMethod, _SERVER, SS("REQUEST_METHOD"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(returnMethod); - zephir_fast_strtoupper(returnMethod, requestMethod); + zephir_get_global(&_REQUEST, SL("_REQUEST")); + zephir_get_global(&_SERVER, SL("_SERVER")); + + ZEPHIR_INIT_VAR(&returnMethod); + ZVAL_STRING(&returnMethod, ""); + ZEPHIR_OBS_VAR(&requestMethod); + if (EXPECTED(zephir_array_isset_string_fetch(&requestMethod, _SERVER, SL("REQUEST_METHOD"), 0))) { + ZEPHIR_INIT_NVAR(&returnMethod); + zephir_fast_strtoupper(&returnMethod, &requestMethod); } else { - RETURN_MM_STRING("GET", 1); + RETURN_MM_STRING("GET"); } ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "POST", 0); - if (ZEPHIR_IS_IDENTICAL(&_0, returnMethod)) { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_STRING(_1$$5, "X-HTTP-METHOD-OVERRIDE", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&overridedMethod, this_ptr, "getheader", NULL, 245, _1$$5); - zephir_check_temp_parameter(_1$$5); + ZVAL_STRING(&_0, "POST"); + if (ZEPHIR_IS_IDENTICAL(&_0, &returnMethod)) { + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_STRING(&_1$$5, "X-HTTP-METHOD-OVERRIDE"); + ZEPHIR_CALL_METHOD(&overridedMethod, this_ptr, "getheader", NULL, 207, &_1$$5); zephir_check_call_status(); - _2$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_httpMethodParameterOverride"), PH_NOISY_CC); - if (!(ZEPHIR_IS_EMPTY(overridedMethod))) { - ZEPHIR_INIT_NVAR(returnMethod); - zephir_fast_strtoupper(returnMethod, overridedMethod); - } else if (zephir_is_true(_2$$5)) { - ZEPHIR_OBS_VAR(spoofedMethod); - if (zephir_array_isset_string_fetch(&spoofedMethod, _REQUEST, SS("_method"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(returnMethod); - zephir_fast_strtoupper(returnMethod, spoofedMethod); + zephir_read_property(&_2$$5, this_ptr, SL("_httpMethodParameterOverride"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_IS_EMPTY(&overridedMethod))) { + ZEPHIR_INIT_NVAR(&returnMethod); + zephir_fast_strtoupper(&returnMethod, &overridedMethod); + } else if (zephir_is_true(&_2$$5)) { + ZEPHIR_OBS_VAR(&spoofedMethod); + if (zephir_array_isset_string_fetch(&spoofedMethod, _REQUEST, SL("_method"), 0)) { + ZEPHIR_INIT_NVAR(&returnMethod); + zephir_fast_strtoupper(&returnMethod, &spoofedMethod); } } } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "isvalidhttpmethod", NULL, 0, returnMethod); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "isvalidhttpmethod", NULL, 0, &returnMethod); zephir_check_call_status(); - if (!(zephir_is_true(_3))) { - RETURN_MM_STRING("GET", 1); + if (!(zephir_is_true(&_3))) { + RETURN_MM_STRING("GET"); } - RETURN_CTOR(returnMethod); + RETURN_CTOR(&returnMethod); } @@ -1354,15 +1524,17 @@ PHP_METHOD(Phalcon_Http_Request, getMethod) { */ PHP_METHOD(Phalcon_Http_Request, getUserAgent) { - zval *_SERVER, *userAgent = NULL; + zval *_SERVER, userAgent; + zval *this_ptr = getThis(); - ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + ZVAL_UNDEF(&userAgent); - if (zephir_array_isset_string_fetch(&userAgent, _SERVER, SS("HTTP_USER_AGENT"), 1 TSRMLS_CC)) { - RETURN_CTOR(userAgent); + zephir_get_global(&_SERVER, SL("_SERVER")); + + if (zephir_array_isset_string_fetch(&userAgent, _SERVER, SL("HTTP_USER_AGENT"), 1)) { + RETURN_CTORW(&userAgent); } - RETURN_MM_STRING("", 1); + RETURN_STRING(""); } @@ -1371,19 +1543,23 @@ PHP_METHOD(Phalcon_Http_Request, getUserAgent) { */ PHP_METHOD(Phalcon_Http_Request, isValidHttpMethod) { - zval *method_param = NULL, *_0; - zval *method = NULL; + zval *method_param = NULL, _0; + zval method; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &method_param); - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtoupper(_0, method); + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtoupper(&_0, &method); do { - if (ZEPHIR_IS_STRING(_0, "GET") || ZEPHIR_IS_STRING(_0, "POST") || ZEPHIR_IS_STRING(_0, "PUT") || ZEPHIR_IS_STRING(_0, "DELETE") || ZEPHIR_IS_STRING(_0, "HEAD") || ZEPHIR_IS_STRING(_0, "OPTIONS") || ZEPHIR_IS_STRING(_0, "PATCH") || ZEPHIR_IS_STRING(_0, "PURGE") || ZEPHIR_IS_STRING(_0, "TRACE") || ZEPHIR_IS_STRING(_0, "CONNECT")) { + if (ZEPHIR_IS_STRING(&_0, "GET") || ZEPHIR_IS_STRING(&_0, "POST") || ZEPHIR_IS_STRING(&_0, "PUT") || ZEPHIR_IS_STRING(&_0, "DELETE") || ZEPHIR_IS_STRING(&_0, "HEAD") || ZEPHIR_IS_STRING(&_0, "OPTIONS") || ZEPHIR_IS_STRING(&_0, "PATCH") || ZEPHIR_IS_STRING(&_0, "PURGE") || ZEPHIR_IS_STRING(&_0, "TRACE") || ZEPHIR_IS_STRING(&_0, "CONNECT")) { RETURN_MM_BOOL(1); } } while(0); @@ -1398,12 +1574,20 @@ PHP_METHOD(Phalcon_Http_Request, isValidHttpMethod) { */ PHP_METHOD(Phalcon_Http_Request, isMethod) { - HashTable *_5$$5; - HashPosition _4$$5; - zephir_fcall_cache_entry *_9 = NULL; + zephir_fcall_cache_entry *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool strict, _0$$3; - zval *methods, *strict_param = NULL, *httpMethod = NULL, *method = NULL, *_1$$3 = NULL, *_2$$4, *_3$$4, **_6$$5, *_7$$6 = NULL, *_8$$6 = NULL; + zval *methods, methods_sub, *strict_param = NULL, httpMethod, method, _1$$3, _2$$4, _3$$4, *_4$$5, _5$$6, _6$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&methods_sub); + ZVAL_UNDEF(&httpMethod); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &methods, &strict_param); @@ -1415,47 +1599,46 @@ PHP_METHOD(Phalcon_Http_Request, isMethod) { } - ZEPHIR_CALL_METHOD(&httpMethod, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&httpMethod, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); if (Z_TYPE_P(methods) == IS_STRING) { _0$$3 = strict; if (_0$$3) { ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "isvalidhttpmethod", NULL, 0, methods); zephir_check_call_status(); - _0$$3 = !zephir_is_true(_1$$3); + _0$$3 = !zephir_is_true(&_1$$3); } if (_0$$3) { - ZEPHIR_INIT_VAR(_2$$4); - object_init_ex(_2$$4, phalcon_http_request_exception_ce); - ZEPHIR_INIT_VAR(_3$$4); - ZEPHIR_CONCAT_SV(_3$$4, "Invalid HTTP method: ", methods); - ZEPHIR_CALL_METHOD(NULL, _2$$4, "__construct", NULL, 9, _3$$4); + ZEPHIR_INIT_VAR(&_2$$4); + object_init_ex(&_2$$4, phalcon_http_request_exception_ce); + ZEPHIR_INIT_VAR(&_3$$4); + ZEPHIR_CONCAT_SV(&_3$$4, "Invalid HTTP method: ", methods); + ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", NULL, 4, &_3$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_2$$4, "phalcon/http/request.zep", 703 TSRMLS_CC); + zephir_throw_exception_debug(&_2$$4, "phalcon/http/request.zep", 703 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(methods, httpMethod)); + RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(methods, &httpMethod)); } if (Z_TYPE_P(methods) == IS_ARRAY) { - zephir_is_iterable(methods, &_5$$5, &_4$$5, 0, 0, "phalcon/http/request.zep", 715); - for ( - ; zend_hash_get_current_data_ex(_5$$5, (void**) &_6$$5, &_4$$5) == SUCCESS - ; zend_hash_move_forward_ex(_5$$5, &_4$$5) - ) { - ZEPHIR_GET_HVALUE(method, _6$$5); - ZEPHIR_INIT_NVAR(_8$$6); + zephir_is_iterable(methods, 0, "phalcon/http/request.zep", 715); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(methods), _4$$5) + { + ZEPHIR_INIT_NVAR(&method); + ZVAL_COPY(&method, _4$$5); if (strict) { - ZVAL_BOOL(_8$$6, 1); + ZVAL_BOOL(&_6$$6, 1); } else { - ZVAL_BOOL(_8$$6, 0); + ZVAL_BOOL(&_6$$6, 0); } - ZEPHIR_CALL_METHOD(&_7$$6, this_ptr, "ismethod", &_9, 247, method, _8$$6); + ZEPHIR_CALL_METHOD(&_5$$6, this_ptr, "ismethod", &_7, 209, &method, &_6$$6); zephir_check_call_status(); - if (zephir_is_true(_7$$6)) { + if (zephir_is_true(&_5$$6)) { RETURN_MM_BOOL(1); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&method); RETURN_MM_BOOL(0); } if (strict) { @@ -1471,14 +1654,17 @@ PHP_METHOD(Phalcon_Http_Request, isMethod) { */ PHP_METHOD(Phalcon_Http_Request, isPost) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "POST")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "POST")); } @@ -1487,14 +1673,17 @@ PHP_METHOD(Phalcon_Http_Request, isPost) { */ PHP_METHOD(Phalcon_Http_Request, isGet) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "GET")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "GET")); } @@ -1503,14 +1692,17 @@ PHP_METHOD(Phalcon_Http_Request, isGet) { */ PHP_METHOD(Phalcon_Http_Request, isPut) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "PUT")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PUT")); } @@ -1519,14 +1711,17 @@ PHP_METHOD(Phalcon_Http_Request, isPut) { */ PHP_METHOD(Phalcon_Http_Request, isPatch) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "PATCH")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PATCH")); } @@ -1535,14 +1730,17 @@ PHP_METHOD(Phalcon_Http_Request, isPatch) { */ PHP_METHOD(Phalcon_Http_Request, isHead) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "HEAD")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "HEAD")); } @@ -1551,14 +1749,17 @@ PHP_METHOD(Phalcon_Http_Request, isHead) { */ PHP_METHOD(Phalcon_Http_Request, isDelete) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "DELETE")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "DELETE")); } @@ -1567,14 +1768,17 @@ PHP_METHOD(Phalcon_Http_Request, isDelete) { */ PHP_METHOD(Phalcon_Http_Request, isOptions) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "OPTIONS")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "OPTIONS")); } @@ -1583,14 +1787,17 @@ PHP_METHOD(Phalcon_Http_Request, isOptions) { */ PHP_METHOD(Phalcon_Http_Request, isPurge) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "PURGE")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "PURGE")); } @@ -1599,14 +1806,17 @@ PHP_METHOD(Phalcon_Http_Request, isPurge) { */ PHP_METHOD(Phalcon_Http_Request, isTrace) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "TRACE")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "TRACE")); } @@ -1615,14 +1825,17 @@ PHP_METHOD(Phalcon_Http_Request, isTrace) { */ PHP_METHOD(Phalcon_Http_Request, isConnect) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 246); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmethod", NULL, 208); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(_0, "CONNECT")); + RETURN_MM_BOOL(ZEPHIR_IS_STRING_IDENTICAL(&_0, "CONNECT")); } @@ -1631,15 +1844,20 @@ PHP_METHOD(Phalcon_Http_Request, isConnect) { */ PHP_METHOD(Phalcon_Http_Request, hasFiles) { - HashTable *_1; - HashPosition _0; - zephir_fcall_cache_entry *_6 = NULL; + zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, numberFiles; - zval *onlySuccessful_param = NULL, *_FILES, *files = NULL, *file = NULL, *error = NULL, **_2, *_4$$8 = NULL, *_5$$8 = NULL; - zend_bool onlySuccessful, _3$$6; + zval *onlySuccessful_param = NULL, *_FILES, files, file, error, *_0, _2$$8, _3$$8; + zend_bool onlySuccessful, _1$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&files); + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&error); + ZVAL_UNDEF(&_2$$8); + ZVAL_UNDEF(&_3$$8); ZEPHIR_MM_GROW(); - zephir_get_global(&_FILES, SS("_FILES") TSRMLS_CC); + zephir_get_global(&_FILES, SL("_FILES")); zephir_fetch_params(1, 0, 1, &onlySuccessful_param); if (!onlySuccessful_param) { @@ -1650,40 +1868,39 @@ PHP_METHOD(Phalcon_Http_Request, hasFiles) { numberFiles = 0; - ZEPHIR_CPY_WRT(files, _FILES); - if (Z_TYPE_P(files) != IS_ARRAY) { + ZEPHIR_CPY_WRT(&files, _FILES); + if (Z_TYPE_P(&files) != IS_ARRAY) { RETURN_MM_LONG(0); } - zephir_is_iterable(files, &_1, &_0, 0, 0, "phalcon/http/request.zep", 834); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(file, _2); - ZEPHIR_OBS_NVAR(error); - if (zephir_array_isset_string_fetch(&error, file, SS("error"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(error) != IS_ARRAY) { - _3$$6 = !zephir_is_true(error); - if (!(_3$$6)) { - _3$$6 = !onlySuccessful; + zephir_is_iterable(&files, 0, "phalcon/http/request.zep", 834); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&files), _0) + { + ZEPHIR_INIT_NVAR(&file); + ZVAL_COPY(&file, _0); + ZEPHIR_OBS_NVAR(&error); + if (zephir_array_isset_string_fetch(&error, &file, SL("error"), 0)) { + if (Z_TYPE_P(&error) != IS_ARRAY) { + _1$$6 = !zephir_is_true(&error); + if (!(_1$$6)) { + _1$$6 = !onlySuccessful; } - if (_3$$6) { + if (_1$$6) { numberFiles++; } } - if (Z_TYPE_P(error) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_5$$8); + if (Z_TYPE_P(&error) == IS_ARRAY) { if (onlySuccessful) { - ZVAL_BOOL(_5$$8, 1); + ZVAL_BOOL(&_3$$8, 1); } else { - ZVAL_BOOL(_5$$8, 0); + ZVAL_BOOL(&_3$$8, 0); } - ZEPHIR_CALL_METHOD(&_4$$8, this_ptr, "hasfilehelper", &_6, 248, error, _5$$8); + ZEPHIR_CALL_METHOD(&_2$$8, this_ptr, "hasfilehelper", &_4, 210, &error, &_3$$8); zephir_check_call_status(); - numberFiles += zephir_get_numberval(_4$$8); + numberFiles += zephir_get_numberval(&_2$$8); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&file); RETURN_MM_LONG(numberFiles); } @@ -1693,12 +1910,16 @@ PHP_METHOD(Phalcon_Http_Request, hasFiles) { */ PHP_METHOD(Phalcon_Http_Request, hasFileHelper) { - HashTable *_1; - HashPosition _0; - zephir_fcall_cache_entry *_6 = NULL; + zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, numberFiles; - zend_bool onlySuccessful, _3$$5; - zval *data, *onlySuccessful_param = NULL, *value = NULL, **_2, *_4$$7 = NULL, *_5$$7 = NULL; + zend_bool onlySuccessful, _1$$5; + zval *data, data_sub, *onlySuccessful_param = NULL, value, *_0, _2$$7, _3$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_3$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &data, &onlySuccessful_param); @@ -1710,33 +1931,32 @@ PHP_METHOD(Phalcon_Http_Request, hasFileHelper) { if (Z_TYPE_P(data) != IS_ARRAY) { RETURN_MM_LONG(1); } - zephir_is_iterable(data, &_1, &_0, 0, 0, "phalcon/http/request.zep", 861); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(value, _2); - if (Z_TYPE_P(value) != IS_ARRAY) { - _3$$5 = !zephir_is_true(value); - if (!(_3$$5)) { - _3$$5 = !onlySuccessful; + zephir_is_iterable(data, 0, "phalcon/http/request.zep", 861); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(data), _0) + { + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + if (Z_TYPE_P(&value) != IS_ARRAY) { + _1$$5 = !zephir_is_true(&value); + if (!(_1$$5)) { + _1$$5 = !onlySuccessful; } - if (_3$$5) { + if (_1$$5) { numberFiles++; } } - if (Z_TYPE_P(value) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_5$$7); + if (Z_TYPE_P(&value) == IS_ARRAY) { if (onlySuccessful) { - ZVAL_BOOL(_5$$7, 1); + ZVAL_BOOL(&_3$$7, 1); } else { - ZVAL_BOOL(_5$$7, 0); + ZVAL_BOOL(&_3$$7, 0); } - ZEPHIR_CALL_METHOD(&_4$$7, this_ptr, "hasfilehelper", &_6, 248, value, _5$$7); + ZEPHIR_CALL_METHOD(&_2$$7, this_ptr, "hasfilehelper", &_4, 210, &value, &_3$$7); zephir_check_call_status(); - numberFiles += zephir_get_numberval(_4$$7); + numberFiles += zephir_get_numberval(&_2$$7); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); RETURN_MM_LONG(numberFiles); } @@ -1746,16 +1966,37 @@ PHP_METHOD(Phalcon_Http_Request, hasFileHelper) { */ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) { - HashTable *_1$$3, *_11$$5; - HashPosition _0$$3, _10$$5; - zval *files; - zephir_fcall_cache_entry *_9 = NULL, *_18 = NULL; + zend_string *_2$$3; + zend_ulong _1$$3; + zval files; + zephir_fcall_cache_entry *_9 = NULL, *_16 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *onlySuccessful_param = NULL, *_FILES, *superFiles = NULL, *prefix = NULL, *input = NULL, *smoothInput = NULL, *file = NULL, *dataFile = NULL, **_2$$3, *_3$$4 = NULL, *_4$$5, *_5$$5, *_6$$5, *_7$$5, *_8$$5, **_12$$5, *_14$$6, *_15$$7 = NULL, *_16$$7 = NULL, *_17$$7, *_20$$8, *_21$$9 = NULL; - zend_bool onlySuccessful, _13$$6, _19$$8; + zval *onlySuccessful_param = NULL, *_FILES, superFiles, prefix, input, smoothInput, file, dataFile, *_0$$3, _3$$4, _4$$5, _5$$5, _6$$5, _7$$5, _8$$5, *_10$$5, _12$$6, _13$$7, _14$$7, _15$$7, _18$$8, _19$$9; + zend_bool onlySuccessful, _11$$6, _17$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&superFiles); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&input); + ZVAL_UNDEF(&smoothInput); + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&dataFile); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_12$$6); + ZVAL_UNDEF(&_13$$7); + ZVAL_UNDEF(&_14$$7); + ZVAL_UNDEF(&_15$$7); + ZVAL_UNDEF(&_18$$8); + ZVAL_UNDEF(&_19$$9); + ZVAL_UNDEF(&files); ZEPHIR_MM_GROW(); - zephir_get_global(&_FILES, SS("_FILES") TSRMLS_CC); + zephir_get_global(&_FILES, SL("_FILES")); zephir_fetch_params(1, 0, 1, &onlySuccessful_param); if (!onlySuccessful_param) { @@ -1765,81 +2006,87 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) { } - ZEPHIR_INIT_VAR(files); - array_init(files); - ZEPHIR_CPY_WRT(superFiles, _FILES); - if (zephir_fast_count_int(superFiles TSRMLS_CC) > 0) { - zephir_is_iterable(superFiles, &_1$$3, &_0$$3, 0, 0, "phalcon/http/request.zep", 906); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(prefix, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(input, _2$$3); - ZEPHIR_OBS_NVAR(_3$$4); - zephir_array_fetch_string(&_3$$4, input, SL("name"), PH_NOISY, "phalcon/http/request.zep", 877 TSRMLS_CC); - if (Z_TYPE_P(_3$$4) == IS_ARRAY) { - zephir_array_fetch_string(&_4$$5, input, SL("name"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 879 TSRMLS_CC); - zephir_array_fetch_string(&_5$$5, input, SL("type"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 880 TSRMLS_CC); - zephir_array_fetch_string(&_6$$5, input, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 881 TSRMLS_CC); - zephir_array_fetch_string(&_7$$5, input, SL("size"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 882 TSRMLS_CC); - zephir_array_fetch_string(&_8$$5, input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 883 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_9, 249, _4$$5, _5$$5, _6$$5, _7$$5, _8$$5, prefix); + ZEPHIR_INIT_VAR(&files); + array_init(&files); + ZEPHIR_CPY_WRT(&superFiles, _FILES); + if (zephir_fast_count_int(&superFiles TSRMLS_CC) > 0) { + zephir_is_iterable(&superFiles, 0, "phalcon/http/request.zep", 906); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&superFiles), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&prefix); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&prefix, _2$$3); + } else { + ZVAL_LONG(&prefix, _1$$3); + } + ZEPHIR_INIT_NVAR(&input); + ZVAL_COPY(&input, _0$$3); + ZEPHIR_OBS_NVAR(&_3$$4); + zephir_array_fetch_string(&_3$$4, &input, SL("name"), PH_NOISY, "phalcon/http/request.zep", 877 TSRMLS_CC); + if (Z_TYPE_P(&_3$$4) == IS_ARRAY) { + zephir_array_fetch_string(&_4$$5, &input, SL("name"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 879 TSRMLS_CC); + zephir_array_fetch_string(&_5$$5, &input, SL("type"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 880 TSRMLS_CC); + zephir_array_fetch_string(&_6$$5, &input, SL("tmp_name"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 881 TSRMLS_CC); + zephir_array_fetch_string(&_7$$5, &input, SL("size"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 882 TSRMLS_CC); + zephir_array_fetch_string(&_8$$5, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 883 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&smoothInput, this_ptr, "smoothfiles", &_9, 211, &_4$$5, &_5$$5, &_6$$5, &_7$$5, &_8$$5, &prefix); zephir_check_call_status(); - zephir_is_iterable(smoothInput, &_11$$5, &_10$$5, 0, 0, "phalcon/http/request.zep", 900); - for ( - ; zend_hash_get_current_data_ex(_11$$5, (void**) &_12$$5, &_10$$5) == SUCCESS - ; zend_hash_move_forward_ex(_11$$5, &_10$$5) - ) { - ZEPHIR_GET_HVALUE(file, _12$$5); - _13$$6 = onlySuccessful == 0; - if (!(_13$$6)) { - zephir_array_fetch_string(&_14$$6, file, SL("error"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 888 TSRMLS_CC); - _13$$6 = ZEPHIR_IS_LONG(_14$$6, 0); + zephir_is_iterable(&smoothInput, 0, "phalcon/http/request.zep", 900); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&smoothInput), _10$$5) + { + ZEPHIR_INIT_NVAR(&file); + ZVAL_COPY(&file, _10$$5); + _11$$6 = onlySuccessful == 0; + if (!(_11$$6)) { + zephir_array_fetch_string(&_12$$6, &file, SL("error"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 888 TSRMLS_CC); + _11$$6 = ZEPHIR_IS_LONG(&_12$$6, 0); } - if (_13$$6) { - ZEPHIR_INIT_NVAR(dataFile); - zephir_create_array(dataFile, 5, 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(_15$$7); - zephir_array_fetch_string(&_15$$7, file, SL("name"), PH_NOISY, "phalcon/http/request.zep", 890 TSRMLS_CC); - zephir_array_update_string(&dataFile, SL("name"), &_15$$7, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_15$$7); - zephir_array_fetch_string(&_15$$7, file, SL("type"), PH_NOISY, "phalcon/http/request.zep", 891 TSRMLS_CC); - zephir_array_update_string(&dataFile, SL("type"), &_15$$7, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_15$$7); - zephir_array_fetch_string(&_15$$7, file, SL("tmp_name"), PH_NOISY, "phalcon/http/request.zep", 892 TSRMLS_CC); - zephir_array_update_string(&dataFile, SL("tmp_name"), &_15$$7, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_15$$7); - zephir_array_fetch_string(&_15$$7, file, SL("size"), PH_NOISY, "phalcon/http/request.zep", 893 TSRMLS_CC); - zephir_array_update_string(&dataFile, SL("size"), &_15$$7, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_15$$7); - zephir_array_fetch_string(&_15$$7, file, SL("error"), PH_NOISY, "phalcon/http/request.zep", 895 TSRMLS_CC); - zephir_array_update_string(&dataFile, SL("error"), &_15$$7, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_16$$7); - object_init_ex(_16$$7, phalcon_http_request_file_ce); - zephir_array_fetch_string(&_17$$7, file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 897 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, _16$$7, "__construct", &_18, 250, dataFile, _17$$7); + if (_11$$6) { + ZEPHIR_INIT_NVAR(&dataFile); + zephir_create_array(&dataFile, 5, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_13$$7); + zephir_array_fetch_string(&_13$$7, &file, SL("name"), PH_NOISY, "phalcon/http/request.zep", 890 TSRMLS_CC); + zephir_array_update_string(&dataFile, SL("name"), &_13$$7, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_13$$7); + zephir_array_fetch_string(&_13$$7, &file, SL("type"), PH_NOISY, "phalcon/http/request.zep", 891 TSRMLS_CC); + zephir_array_update_string(&dataFile, SL("type"), &_13$$7, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_13$$7); + zephir_array_fetch_string(&_13$$7, &file, SL("tmp_name"), PH_NOISY, "phalcon/http/request.zep", 892 TSRMLS_CC); + zephir_array_update_string(&dataFile, SL("tmp_name"), &_13$$7, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_13$$7); + zephir_array_fetch_string(&_13$$7, &file, SL("size"), PH_NOISY, "phalcon/http/request.zep", 893 TSRMLS_CC); + zephir_array_update_string(&dataFile, SL("size"), &_13$$7, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_13$$7); + zephir_array_fetch_string(&_13$$7, &file, SL("error"), PH_NOISY, "phalcon/http/request.zep", 895 TSRMLS_CC); + zephir_array_update_string(&dataFile, SL("error"), &_13$$7, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_14$$7); + object_init_ex(&_14$$7, phalcon_http_request_file_ce); + zephir_array_fetch_string(&_15$$7, &file, SL("key"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 897 TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &_14$$7, "__construct", &_16, 212, &dataFile, &_15$$7); zephir_check_call_status(); - zephir_array_append(&files, _16$$7, PH_SEPARATE, "phalcon/http/request.zep", 897); + zephir_array_append(&files, &_14$$7, PH_SEPARATE, "phalcon/http/request.zep", 897); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&file); } else { - _19$$8 = onlySuccessful == 0; - if (!(_19$$8)) { - zephir_array_fetch_string(&_20$$8, input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 901 TSRMLS_CC); - _19$$8 = ZEPHIR_IS_LONG(_20$$8, 0); + _17$$8 = onlySuccessful == 0; + if (!(_17$$8)) { + zephir_array_fetch_string(&_18$$8, &input, SL("error"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 901 TSRMLS_CC); + _17$$8 = ZEPHIR_IS_LONG(&_18$$8, 0); } - if (_19$$8) { - ZEPHIR_INIT_NVAR(_21$$9); - object_init_ex(_21$$9, phalcon_http_request_file_ce); - ZEPHIR_CALL_METHOD(NULL, _21$$9, "__construct", &_18, 250, input, prefix); + if (_17$$8) { + ZEPHIR_INIT_NVAR(&_19$$9); + object_init_ex(&_19$$9, phalcon_http_request_file_ce); + ZEPHIR_CALL_METHOD(NULL, &_19$$9, "__construct", &_16, 212, &input, &prefix); zephir_check_call_status(); - zephir_array_append(&files, _21$$9, PH_SEPARATE, "phalcon/http/request.zep", 902); + zephir_array_append(&files, &_19$$9, PH_SEPARATE, "phalcon/http/request.zep", 902); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&input); + ZEPHIR_INIT_NVAR(&prefix); } - RETURN_CTOR(files); + RETURN_CTOR(&files); } @@ -1848,74 +2095,101 @@ PHP_METHOD(Phalcon_Http_Request, getUploadedFiles) { */ PHP_METHOD(Phalcon_Http_Request, smoothFiles) { - HashTable *_1, *_12$$5; - HashPosition _0, _11$$5; + zend_string *_2; + zend_ulong _1; zephir_fcall_cache_entry *_10 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prefix = NULL; - zval *names_param = NULL, *types_param = NULL, *tmp_names_param = NULL, *sizes_param = NULL, *errors_param = NULL, *prefix_param = NULL, *idx = NULL, *name = NULL, *file = NULL, *files = NULL, *parentFiles = NULL, *p = NULL, **_2, *_4$$4 = NULL, *_5$$5, *_6$$5, *_7$$5, *_8$$5, *_9$$5, **_13$$5; - zval *names = NULL, *types = NULL, *tmp_names = NULL, *sizes = NULL, *errors = NULL, *_3$$4 = NULL; + zval prefix; + zval *names_param = NULL, *types_param = NULL, *tmp_names_param = NULL, *sizes_param = NULL, *errors_param = NULL, *prefix_param = NULL, idx, name, file, files, parentFiles, p, *_0, _4$$4, _5$$5, _6$$5, _7$$5, _8$$5, _9$$5, *_11$$5; + zval names, types, tmp_names, sizes, errors, _3$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&names); + ZVAL_UNDEF(&types); + ZVAL_UNDEF(&tmp_names); + ZVAL_UNDEF(&sizes); + ZVAL_UNDEF(&errors); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&idx); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&files); + ZVAL_UNDEF(&parentFiles); + ZVAL_UNDEF(&p); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&prefix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 6, 0, &names_param, &types_param, &tmp_names_param, &sizes_param, &errors_param, &prefix_param); - names = names_param; - types = types_param; - tmp_names = tmp_names_param; - sizes = sizes_param; - errors = errors_param; - zephir_get_strval(prefix, prefix_param); - - - ZEPHIR_INIT_VAR(files); - array_init(files); - zephir_is_iterable(names, &_1, &_0, 0, 0, "phalcon/http/request.zep", 951); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(idx, _1, _0); - ZEPHIR_GET_HVALUE(name, _2); - ZEPHIR_INIT_NVAR(p); - ZEPHIR_CONCAT_VSV(p, prefix, ".", idx); - if (Z_TYPE_P(name) == IS_STRING) { - ZEPHIR_INIT_NVAR(_3$$4); - zephir_create_array(_3$$4, 6, 0 TSRMLS_CC); + ZEPHIR_OBS_COPY_OR_DUP(&names, names_param); + ZEPHIR_OBS_COPY_OR_DUP(&types, types_param); + ZEPHIR_OBS_COPY_OR_DUP(&tmp_names, tmp_names_param); + ZEPHIR_OBS_COPY_OR_DUP(&sizes, sizes_param); + ZEPHIR_OBS_COPY_OR_DUP(&errors, errors_param); + zephir_get_strval(&prefix, prefix_param); + + + ZEPHIR_INIT_VAR(&files); + array_init(&files); + zephir_is_iterable(&names, 0, "phalcon/http/request.zep", 951); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&names), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&idx); + if (_2 != NULL) { + ZVAL_STR_COPY(&idx, _2); + } else { + ZVAL_LONG(&idx, _1); + } + ZEPHIR_INIT_NVAR(&name); + ZVAL_COPY(&name, _0); + ZEPHIR_INIT_NVAR(&p); + ZEPHIR_CONCAT_VSV(&p, &prefix, ".", &idx); + if (Z_TYPE_P(&name) == IS_STRING) { + ZEPHIR_INIT_NVAR(&_3$$4); + zephir_create_array(&_3$$4, 6, 0 TSRMLS_CC); zephir_array_update_string(&_3$$4, SL("name"), &name, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_4$$4); - zephir_array_fetch(&_4$$4, types, idx, PH_NOISY, "phalcon/http/request.zep", 927 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_4$$4); + zephir_array_fetch(&_4$$4, &types, &idx, PH_NOISY, "phalcon/http/request.zep", 927 TSRMLS_CC); zephir_array_update_string(&_3$$4, SL("type"), &_4$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_4$$4); - zephir_array_fetch(&_4$$4, tmp_names, idx, PH_NOISY, "phalcon/http/request.zep", 928 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_4$$4); + zephir_array_fetch(&_4$$4, &tmp_names, &idx, PH_NOISY, "phalcon/http/request.zep", 928 TSRMLS_CC); zephir_array_update_string(&_3$$4, SL("tmp_name"), &_4$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_4$$4); - zephir_array_fetch(&_4$$4, sizes, idx, PH_NOISY, "phalcon/http/request.zep", 929 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_4$$4); + zephir_array_fetch(&_4$$4, &sizes, &idx, PH_NOISY, "phalcon/http/request.zep", 929 TSRMLS_CC); zephir_array_update_string(&_3$$4, SL("size"), &_4$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_4$$4); - zephir_array_fetch(&_4$$4, errors, idx, PH_NOISY, "phalcon/http/request.zep", 930 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_4$$4); + zephir_array_fetch(&_4$$4, &errors, &idx, PH_NOISY, "phalcon/http/request.zep", 930 TSRMLS_CC); zephir_array_update_string(&_3$$4, SL("error"), &_4$$4, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_3$$4, SL("key"), &p, PH_COPY | PH_SEPARATE); - zephir_array_append(&files, _3$$4, PH_SEPARATE, "phalcon/http/request.zep", 932); + zephir_array_append(&files, &_3$$4, PH_SEPARATE, "phalcon/http/request.zep", 932); } - if (Z_TYPE_P(name) == IS_ARRAY) { - zephir_array_fetch(&_5$$5, names, idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 937 TSRMLS_CC); - zephir_array_fetch(&_6$$5, types, idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 938 TSRMLS_CC); - zephir_array_fetch(&_7$$5, tmp_names, idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 939 TSRMLS_CC); - zephir_array_fetch(&_8$$5, sizes, idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 940 TSRMLS_CC); - zephir_array_fetch(&_9$$5, errors, idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 941 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_10, 249, _5$$5, _6$$5, _7$$5, _8$$5, _9$$5, p); + if (Z_TYPE_P(&name) == IS_ARRAY) { + zephir_array_fetch(&_5$$5, &names, &idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 937 TSRMLS_CC); + zephir_array_fetch(&_6$$5, &types, &idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 938 TSRMLS_CC); + zephir_array_fetch(&_7$$5, &tmp_names, &idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 939 TSRMLS_CC); + zephir_array_fetch(&_8$$5, &sizes, &idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 940 TSRMLS_CC); + zephir_array_fetch(&_9$$5, &errors, &idx, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 941 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&parentFiles, this_ptr, "smoothfiles", &_10, 211, &_5$$5, &_6$$5, &_7$$5, &_8$$5, &_9$$5, &p); zephir_check_call_status(); - zephir_is_iterable(parentFiles, &_12$$5, &_11$$5, 0, 0, "phalcon/http/request.zep", 948); - for ( - ; zend_hash_get_current_data_ex(_12$$5, (void**) &_13$$5, &_11$$5) == SUCCESS - ; zend_hash_move_forward_ex(_12$$5, &_11$$5) - ) { - ZEPHIR_GET_HVALUE(file, _13$$5); - zephir_array_append(&files, file, PH_SEPARATE, "phalcon/http/request.zep", 946); - } + zephir_is_iterable(&parentFiles, 0, "phalcon/http/request.zep", 948); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&parentFiles), _11$$5) + { + ZEPHIR_INIT_NVAR(&file); + ZVAL_COPY(&file, _11$$5); + zephir_array_append(&files, &file, PH_SEPARATE, "phalcon/http/request.zep", 946); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&file); } - } - RETURN_CCTOR(files); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&name); + ZEPHIR_INIT_NVAR(&idx); + RETURN_CCTOR(&files); } @@ -1935,87 +2209,118 @@ PHP_METHOD(Phalcon_Http_Request, smoothFiles) { */ PHP_METHOD(Phalcon_Http_Request, getHeaders) { - HashTable *_1; - HashPosition _0; - zval *headers = NULL, *contentHeaders; + zend_string *_2; + zend_ulong _1; + zval headers, contentHeaders; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_9 = NULL; - zval *_SERVER, *name = NULL, *value = NULL, *authHeaders = NULL, **_2, *_3$$4 = NULL, *_4$$4 = NULL, _5$$4 = zval_used_for_init, *_6$$4 = NULL, _7$$4 = zval_used_for_init, _8$$4 = zval_used_for_init, *_10$$4 = NULL, _11$$4 = zval_used_for_init, _12$$4 = zval_used_for_init, *_13$$3 = NULL, *_14$$5 = NULL, *_15$$5 = NULL, _16$$5 = zval_used_for_init, _17$$5 = zval_used_for_init, *_18$$5 = NULL, _19$$5 = zval_used_for_init, _20$$5 = zval_used_for_init, *_21$$6; + zval __$true, *_SERVER, name, value, authHeaders, *_0, _3$$4, _4$$4, _5$$4, _6$$4, _7$$4, _8$$4, _10$$4, _11$$4, _12$$4, _13$$3, _14$$5, _15$$5, _16$$5, _17$$5, _18$$5, _19$$5, _20$$5, _21$$6; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&authHeaders); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$4); + ZVAL_UNDEF(&_10$$4); + ZVAL_UNDEF(&_11$$4); + ZVAL_UNDEF(&_12$$4); + ZVAL_UNDEF(&_13$$3); + ZVAL_UNDEF(&_14$$5); + ZVAL_UNDEF(&_15$$5); + ZVAL_UNDEF(&_16$$5); + ZVAL_UNDEF(&_17$$5); + ZVAL_UNDEF(&_18$$5); + ZVAL_UNDEF(&_19$$5); + ZVAL_UNDEF(&_20$$5); + ZVAL_UNDEF(&_21$$6); + ZVAL_UNDEF(&headers); + ZVAL_UNDEF(&contentHeaders); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); - - ZEPHIR_INIT_VAR(headers); - array_init(headers); - ZEPHIR_INIT_VAR(contentHeaders); - zephir_create_array(contentHeaders, 3, 0 TSRMLS_CC); - zephir_array_update_string(&contentHeaders, SL("CONTENT_TYPE"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&contentHeaders, SL("CONTENT_LENGTH"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&contentHeaders, SL("CONTENT_MD5"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_is_iterable(_SERVER, &_1, &_0, 0, 0, "phalcon/http/request.zep", 994); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(name, _1, _0); - ZEPHIR_GET_HVALUE(value, _2); - if (zephir_start_with_str(name, SL("HTTP_"))) { - ZEPHIR_INIT_NVAR(_3$$4); - ZEPHIR_INIT_NVAR(_4$$4); - ZEPHIR_SINIT_NVAR(_5$$4); + zephir_get_global(&_SERVER, SL("_SERVER")); + + ZEPHIR_INIT_VAR(&headers); + array_init(&headers); + ZEPHIR_INIT_VAR(&contentHeaders); + zephir_create_array(&contentHeaders, 3, 0 TSRMLS_CC); + zephir_array_update_string(&contentHeaders, SL("CONTENT_TYPE"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&contentHeaders, SL("CONTENT_LENGTH"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&contentHeaders, SL("CONTENT_MD5"), &__$true, PH_COPY | PH_SEPARATE); + zephir_is_iterable(_SERVER, 0, "phalcon/http/request.zep", 994); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(_SERVER), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&name); + if (_2 != NULL) { + ZVAL_STR_COPY(&name, _2); + } else { + ZVAL_LONG(&name, _1); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + if (zephir_start_with_str(&name, SL("HTTP_"))) { + ZEPHIR_INIT_NVAR(&_3$$4); + ZEPHIR_INIT_NVAR(&_4$$4); ZVAL_LONG(&_5$$4, 5); - ZEPHIR_INIT_NVAR(_6$$4); - zephir_substr(_6$$4, name, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_SINIT_NVAR(_7$$4); - ZVAL_STRING(&_7$$4, "_", 0); - ZEPHIR_SINIT_NVAR(_8$$4); - ZVAL_STRING(&_8$$4, " ", 0); - zephir_fast_str_replace(&_4$$4, &_7$$4, &_8$$4, _6$$4 TSRMLS_CC); - zephir_fast_strtolower(_3$$4, _4$$4); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_9, 251, _3$$4); + ZEPHIR_INIT_NVAR(&_6$$4); + zephir_substr(&_6$$4, &name, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_INIT_NVAR(&_7$$4); + ZVAL_STRING(&_7$$4, "_"); + ZEPHIR_INIT_NVAR(&_8$$4); + ZVAL_STRING(&_8$$4, " "); + zephir_fast_str_replace(&_4$$4, &_7$$4, &_8$$4, &_6$$4 TSRMLS_CC); + zephir_fast_strtolower(&_3$$4, &_4$$4); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_9, 213, &_3$$4); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_10$$4); - ZEPHIR_SINIT_NVAR(_11$$4); - ZVAL_STRING(&_11$$4, " ", 0); - ZEPHIR_SINIT_NVAR(_12$$4); - ZVAL_STRING(&_12$$4, "-", 0); - zephir_fast_str_replace(&_10$$4, &_11$$4, &_12$$4, name TSRMLS_CC); - ZEPHIR_CPY_WRT(name, _10$$4); - zephir_array_update_zval(&headers, name, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_10$$4); + ZEPHIR_INIT_NVAR(&_11$$4); + ZVAL_STRING(&_11$$4, " "); + ZEPHIR_INIT_NVAR(&_12$$4); + ZVAL_STRING(&_12$$4, "-"); + zephir_fast_str_replace(&_10$$4, &_11$$4, &_12$$4, &name TSRMLS_CC); + ZEPHIR_CPY_WRT(&name, &_10$$4); + zephir_array_update_zval(&headers, &name, &value, PH_COPY | PH_SEPARATE); continue; } - ZEPHIR_INIT_NVAR(_13$$3); - zephir_fast_strtoupper(_13$$3, name); - ZEPHIR_CPY_WRT(name, _13$$3); - if (zephir_array_isset(contentHeaders, name)) { - ZEPHIR_INIT_NVAR(_14$$5); - ZEPHIR_INIT_NVAR(_15$$5); - ZEPHIR_SINIT_NVAR(_16$$5); - ZVAL_STRING(&_16$$5, "_", 0); - ZEPHIR_SINIT_NVAR(_17$$5); - ZVAL_STRING(&_17$$5, " ", 0); - zephir_fast_str_replace(&_15$$5, &_16$$5, &_17$$5, name TSRMLS_CC); - zephir_fast_strtolower(_14$$5, _15$$5); - ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_9, 251, _14$$5); + ZEPHIR_INIT_NVAR(&_13$$3); + zephir_fast_strtoupper(&_13$$3, &name); + ZEPHIR_CPY_WRT(&name, &_13$$3); + if (zephir_array_isset(&contentHeaders, &name)) { + ZEPHIR_INIT_NVAR(&_14$$5); + ZEPHIR_INIT_NVAR(&_15$$5); + ZEPHIR_INIT_NVAR(&_16$$5); + ZVAL_STRING(&_16$$5, "_"); + ZEPHIR_INIT_NVAR(&_17$$5); + ZVAL_STRING(&_17$$5, " "); + zephir_fast_str_replace(&_15$$5, &_16$$5, &_17$$5, &name TSRMLS_CC); + zephir_fast_strtolower(&_14$$5, &_15$$5); + ZEPHIR_CALL_FUNCTION(&name, "ucwords", &_9, 213, &_14$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_18$$5); - ZEPHIR_SINIT_NVAR(_19$$5); - ZVAL_STRING(&_19$$5, " ", 0); - ZEPHIR_SINIT_NVAR(_20$$5); - ZVAL_STRING(&_20$$5, "-", 0); - zephir_fast_str_replace(&_18$$5, &_19$$5, &_20$$5, name TSRMLS_CC); - ZEPHIR_CPY_WRT(name, _18$$5); - zephir_array_update_zval(&headers, name, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_18$$5); + ZEPHIR_INIT_NVAR(&_19$$5); + ZVAL_STRING(&_19$$5, " "); + ZEPHIR_INIT_NVAR(&_20$$5); + ZVAL_STRING(&_20$$5, "-"); + zephir_fast_str_replace(&_18$$5, &_19$$5, &_20$$5, &name TSRMLS_CC); + ZEPHIR_CPY_WRT(&name, &_18$$5); + zephir_array_update_zval(&headers, &name, &value, PH_COPY | PH_SEPARATE); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&name); ZEPHIR_CALL_METHOD(&authHeaders, this_ptr, "resolveauthorizationheaders", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(authHeaders) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_21$$6); - zephir_fast_array_merge(_21$$6, &(headers), &(authHeaders) TSRMLS_CC); - ZEPHIR_CPY_WRT(headers, _21$$6); + if (Z_TYPE_P(&authHeaders) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_21$$6); + zephir_fast_array_merge(&_21$$6, &headers, &authHeaders TSRMLS_CC); + ZEPHIR_CPY_WRT(&headers, &_21$$6); } - RETURN_CTOR(headers); + RETURN_CTOR(&headers); } @@ -2024,59 +2329,92 @@ PHP_METHOD(Phalcon_Http_Request, getHeaders) { */ PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) { - zval *headers = NULL, *_6$$5, *_28$$19; + zval headers, _6$$5, _28$$19; zend_bool hasEventsManager = 0, _5, _9, _27, _15$$11; - zval *_SERVER, *resolved = NULL, *eventsManager = NULL, *dependencyInjector = NULL, *exploded = NULL, *digest = NULL, *authHeader = NULL, *_0 = NULL, *_1$$3 = NULL, *_2$$3, *_3$$4 = NULL, *_4$$4, *_7$$5, *_8$$6, *_10$$7, *_11$$7, _12$$11 = zval_used_for_init, *_13$$11 = NULL, *_14$$11 = NULL, *_16$$11 = NULL, _17$$12, *_18$$12, *_19$$12 = NULL, *_20$$13, *_21$$13, *_22$$17, *_23$$17, *_24$$17, *_25$$17 = NULL, *_26$$17, *_29$$19, *_30$$20; + zval *_SERVER, resolved, eventsManager, dependencyInjector, exploded, digest, authHeader, _0, _1$$3, _2$$3, _3$$4, _4$$4, _7$$5, _8$$6, _10$$7, _11$$7, _12$$11, _13$$11, _14$$11, _16$$11, _17$$12, _18$$12, _19$$12, _20$$13, _21$$13, _22$$17, _23$$17, _24$$17, _25$$17, _26$$17, _29$$19, _30$$20; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resolved); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&exploded); + ZVAL_UNDEF(&digest); + ZVAL_UNDEF(&authHeader); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_11$$7); + ZVAL_UNDEF(&_12$$11); + ZVAL_UNDEF(&_13$$11); + ZVAL_UNDEF(&_14$$11); + ZVAL_UNDEF(&_16$$11); + ZVAL_UNDEF(&_17$$12); + ZVAL_UNDEF(&_18$$12); + ZVAL_UNDEF(&_19$$12); + ZVAL_UNDEF(&_20$$13); + ZVAL_UNDEF(&_21$$13); + ZVAL_UNDEF(&_22$$17); + ZVAL_UNDEF(&_23$$17); + ZVAL_UNDEF(&_24$$17); + ZVAL_UNDEF(&_25$$17); + ZVAL_UNDEF(&_26$$17); + ZVAL_UNDEF(&_29$$19); + ZVAL_UNDEF(&_30$$20); + ZVAL_UNDEF(&headers); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_28$$19); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); - ZEPHIR_INIT_VAR(authHeader); - ZVAL_NULL(authHeader); - ZEPHIR_INIT_VAR(headers); - array_init(headers); + ZEPHIR_INIT_VAR(&authHeader); + ZVAL_NULL(&authHeader); + ZEPHIR_INIT_VAR(&headers); + array_init(&headers); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getdi", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "eventsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$3, dependencyInjector, "has", NULL, 0, _2$$3); - zephir_check_temp_parameter(_2$$3); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "eventsManager"); + ZEPHIR_CALL_METHOD(&_1$$3, &dependencyInjector, "has", NULL, 0, &_2$$3); zephir_check_call_status(); - hasEventsManager = zephir_get_boolval(_1$$3); + hasEventsManager = zephir_get_boolval(&_1$$3); if (hasEventsManager) { - ZEPHIR_INIT_VAR(_4$$4); - ZVAL_STRING(_4$$4, "eventsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3$$4, dependencyInjector, "getshared", NULL, 0, _4$$4); - zephir_check_temp_parameter(_4$$4); + ZEPHIR_INIT_VAR(&_4$$4); + ZVAL_STRING(&_4$$4, "eventsManager"); + ZEPHIR_CALL_METHOD(&_3$$4, &dependencyInjector, "getshared", NULL, 0, &_4$$4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(eventsManager, _3$$4); + ZEPHIR_CPY_WRT(&eventsManager, &_3$$4); } } _5 = hasEventsManager; if (_5) { - _5 = Z_TYPE_P(eventsManager) == IS_OBJECT; + _5 = Z_TYPE_P(&eventsManager) == IS_OBJECT; } if (_5) { - ZEPHIR_INIT_VAR(_6$$5); - zephir_create_array(_6$$5, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_6$$5, SL("server"), &_SERVER, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_7$$5); - ZVAL_STRING(_7$$5, "request:beforeAuthorizationResolve", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&resolved, eventsManager, "fire", NULL, 0, _7$$5, this_ptr, _6$$5); - zephir_check_temp_parameter(_7$$5); + ZEPHIR_INIT_VAR(&_6$$5); + zephir_create_array(&_6$$5, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_6$$5, SL("server"), _SERVER, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_7$$5); + ZVAL_STRING(&_7$$5, "request:beforeAuthorizationResolve"); + ZEPHIR_CALL_METHOD(&resolved, &eventsManager, "fire", NULL, 0, &_7$$5, this_ptr, &_6$$5); zephir_check_call_status(); - if (Z_TYPE_P(resolved) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_8$$6); - zephir_fast_array_merge(_8$$6, &(headers), &(resolved) TSRMLS_CC); - ZEPHIR_CPY_WRT(headers, _8$$6); + if (Z_TYPE_P(&resolved) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_8$$6); + zephir_fast_array_merge(&_8$$6, &headers, &resolved TSRMLS_CC); + ZEPHIR_CPY_WRT(&headers, &_8$$6); } } - _9 = zephir_array_isset_string(_SERVER, SS("PHP_AUTH_USER")); + _9 = zephir_array_isset_string(_SERVER, SL("PHP_AUTH_USER")); if (_9) { - _9 = zephir_array_isset_string(_SERVER, SS("PHP_AUTH_PW")); + _9 = zephir_array_isset_string(_SERVER, SL("PHP_AUTH_PW")); } if (_9) { zephir_array_fetch_string(&_10$$7, _SERVER, SL("PHP_AUTH_USER"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1035 TSRMLS_CC); @@ -2084,90 +2422,88 @@ PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) { zephir_array_fetch_string(&_11$$7, _SERVER, SL("PHP_AUTH_PW"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1036 TSRMLS_CC); zephir_array_update_string(&headers, SL("Php-Auth-Pw"), &_11$$7, PH_COPY | PH_SEPARATE); } else { - if (zephir_array_isset_string(_SERVER, SS("HTTP_AUTHORIZATION"))) { - ZEPHIR_OBS_NVAR(authHeader); + if (zephir_array_isset_string(_SERVER, SL("HTTP_AUTHORIZATION"))) { + ZEPHIR_OBS_NVAR(&authHeader); zephir_array_fetch_string(&authHeader, _SERVER, SL("HTTP_AUTHORIZATION"), PH_NOISY, "phalcon/http/request.zep", 1039 TSRMLS_CC); - } else if (zephir_array_isset_string(_SERVER, SS("REDIRECT_HTTP_AUTHORIZATION"))) { - ZEPHIR_OBS_NVAR(authHeader); + } else if (zephir_array_isset_string(_SERVER, SL("REDIRECT_HTTP_AUTHORIZATION"))) { + ZEPHIR_OBS_NVAR(&authHeader); zephir_array_fetch_string(&authHeader, _SERVER, SL("REDIRECT_HTTP_AUTHORIZATION"), PH_NOISY, "phalcon/http/request.zep", 1041 TSRMLS_CC); } - if (zephir_is_true(authHeader)) { - ZEPHIR_SINIT_VAR(_12$$11); - ZVAL_STRING(&_12$$11, "basic ", 0); - ZEPHIR_CALL_FUNCTION(&_13$$11, "stripos", NULL, 240, authHeader, &_12$$11); + if (zephir_is_true(&authHeader)) { + ZEPHIR_INIT_VAR(&_12$$11); + ZVAL_STRING(&_12$$11, "basic "); + ZEPHIR_CALL_FUNCTION(&_13$$11, "stripos", NULL, 202, &authHeader, &_12$$11); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_12$$11); - ZVAL_STRING(&_12$$11, "digest ", 0); - ZEPHIR_CALL_FUNCTION(&_14$$11, "stripos", NULL, 240, authHeader, &_12$$11); + ZEPHIR_INIT_NVAR(&_12$$11); + ZVAL_STRING(&_12$$11, "digest "); + ZEPHIR_CALL_FUNCTION(&_14$$11, "stripos", NULL, 202, &authHeader, &_12$$11); zephir_check_call_status(); - _15$$11 = ZEPHIR_IS_LONG_IDENTICAL(_14$$11, 0); + _15$$11 = ZEPHIR_IS_LONG_IDENTICAL(&_14$$11, 0); if (_15$$11) { - ZEPHIR_OBS_VAR(digest); - _15$$11 = !(zephir_array_isset_string_fetch(&digest, _SERVER, SS("PHP_AUTH_DIGEST"), 0 TSRMLS_CC)); + ZEPHIR_OBS_VAR(&digest); + _15$$11 = !(zephir_array_isset_string_fetch(&digest, _SERVER, SL("PHP_AUTH_DIGEST"), 0)); } - ZEPHIR_SINIT_NVAR(_12$$11); - ZVAL_STRING(&_12$$11, "bearer ", 0); - ZEPHIR_CALL_FUNCTION(&_16$$11, "stripos", NULL, 240, authHeader, &_12$$11); + ZEPHIR_INIT_NVAR(&_12$$11); + ZVAL_STRING(&_12$$11, "bearer "); + ZEPHIR_CALL_FUNCTION(&_16$$11, "stripos", NULL, 202, &authHeader, &_12$$11); zephir_check_call_status(); - if (ZEPHIR_IS_LONG_IDENTICAL(_13$$11, 0)) { - ZEPHIR_SINIT_VAR(_17$$12); + if (ZEPHIR_IS_LONG_IDENTICAL(&_13$$11, 0)) { ZVAL_LONG(&_17$$12, 6); - ZEPHIR_INIT_VAR(_18$$12); - zephir_substr(_18$$12, authHeader, 6 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_FUNCTION(&_19$$12, "base64_decode", NULL, 135, _18$$12); + ZEPHIR_INIT_VAR(&_18$$12); + zephir_substr(&_18$$12, &authHeader, 6 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_CALL_FUNCTION(&_19$$12, "base64_decode", NULL, 116, &_18$$12); zephir_check_call_status(); - ZEPHIR_INIT_VAR(exploded); - zephir_fast_explode_str(exploded, SL(":"), _19$$12, 2 TSRMLS_CC); - if (zephir_fast_count_int(exploded TSRMLS_CC) == 2) { - zephir_array_fetch_long(&_20$$13, exploded, 0, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1048 TSRMLS_CC); + ZEPHIR_INIT_VAR(&exploded); + zephir_fast_explode_str(&exploded, SL(":"), &_19$$12, 2 TSRMLS_CC); + if (zephir_fast_count_int(&exploded TSRMLS_CC) == 2) { + zephir_array_fetch_long(&_20$$13, &exploded, 0, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1048 TSRMLS_CC); zephir_array_update_string(&headers, SL("Php-Auth-User"), &_20$$13, PH_COPY | PH_SEPARATE); - zephir_array_fetch_long(&_21$$13, exploded, 1, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1049 TSRMLS_CC); + zephir_array_fetch_long(&_21$$13, &exploded, 1, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1049 TSRMLS_CC); zephir_array_update_string(&headers, SL("Php-Auth-Pw"), &_21$$13, PH_COPY | PH_SEPARATE); } } else if (_15$$11) { zephir_array_update_string(&headers, SL("Php-Auth-Digest"), &authHeader, PH_COPY | PH_SEPARATE); - } else if (ZEPHIR_IS_LONG_IDENTICAL(_16$$11, 0)) { + } else if (ZEPHIR_IS_LONG_IDENTICAL(&_16$$11, 0)) { zephir_array_update_string(&headers, SL("Authorization"), &authHeader, PH_COPY | PH_SEPARATE); } } } - if (!(zephir_array_isset_string(headers, SS("Authorization")))) { - ZEPHIR_OBS_NVAR(digest); - if (zephir_array_isset_string(headers, SS("Php-Auth-User"))) { - zephir_array_fetch_string(&_22$$17, headers, SL("Php-Auth-User"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1061 TSRMLS_CC); - zephir_array_fetch_string(&_23$$17, headers, SL("Php-Auth-Pw"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1061 TSRMLS_CC); - ZEPHIR_INIT_VAR(_24$$17); - ZEPHIR_CONCAT_VSV(_24$$17, _22$$17, ":", _23$$17); - ZEPHIR_CALL_FUNCTION(&_25$$17, "base64_encode", NULL, 134, _24$$17); + if (!(zephir_array_isset_string(&headers, SL("Authorization")))) { + ZEPHIR_OBS_NVAR(&digest); + if (zephir_array_isset_string(&headers, SL("Php-Auth-User"))) { + zephir_array_fetch_string(&_22$$17, &headers, SL("Php-Auth-User"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1061 TSRMLS_CC); + zephir_array_fetch_string(&_23$$17, &headers, SL("Php-Auth-Pw"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1061 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_24$$17); + ZEPHIR_CONCAT_VSV(&_24$$17, &_22$$17, ":", &_23$$17); + ZEPHIR_CALL_FUNCTION(&_25$$17, "base64_encode", NULL, 115, &_24$$17); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_26$$17); - ZEPHIR_CONCAT_SV(_26$$17, "Basic ", _25$$17); + ZEPHIR_INIT_VAR(&_26$$17); + ZEPHIR_CONCAT_SV(&_26$$17, "Basic ", &_25$$17); zephir_array_update_string(&headers, SL("Authorization"), &_26$$17, PH_COPY | PH_SEPARATE); - } else if (zephir_array_isset_string_fetch(&digest, headers, SS("Php-Auth-Digest"), 0 TSRMLS_CC)) { + } else if (zephir_array_isset_string_fetch(&digest, &headers, SL("Php-Auth-Digest"), 0)) { zephir_array_update_string(&headers, SL("Authorization"), &digest, PH_COPY | PH_SEPARATE); } } _27 = hasEventsManager; if (_27) { - _27 = Z_TYPE_P(eventsManager) == IS_OBJECT; + _27 = Z_TYPE_P(&eventsManager) == IS_OBJECT; } if (_27) { - ZEPHIR_INIT_VAR(_28$$19); - zephir_create_array(_28$$19, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_28$$19); + zephir_create_array(&_28$$19, 2, 0 TSRMLS_CC); zephir_array_update_string(&_28$$19, SL("headers"), &headers, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_28$$19, SL("server"), &_SERVER, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_29$$19); - ZVAL_STRING(_29$$19, "request:afterAuthorizationResolve", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&resolved, eventsManager, "fire", NULL, 0, _29$$19, this_ptr, _28$$19); - zephir_check_temp_parameter(_29$$19); + zephir_array_update_string(&_28$$19, SL("server"), _SERVER, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_29$$19); + ZVAL_STRING(&_29$$19, "request:afterAuthorizationResolve"); + ZEPHIR_CALL_METHOD(&resolved, &eventsManager, "fire", NULL, 0, &_29$$19, this_ptr, &_28$$19); zephir_check_call_status(); - if (Z_TYPE_P(resolved) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_30$$20); - zephir_fast_array_merge(_30$$20, &(headers), &(resolved) TSRMLS_CC); - ZEPHIR_CPY_WRT(headers, _30$$20); + if (Z_TYPE_P(&resolved) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_30$$20); + zephir_fast_array_merge(&_30$$20, &headers, &resolved TSRMLS_CC); + ZEPHIR_CPY_WRT(&headers, &_30$$20); } } - RETURN_CTOR(headers); + RETURN_CTOR(&headers); } @@ -2176,15 +2512,17 @@ PHP_METHOD(Phalcon_Http_Request, resolveAuthorizationHeaders) { */ PHP_METHOD(Phalcon_Http_Request, getHTTPReferer) { - zval *_SERVER, *httpReferer = NULL; + zval *_SERVER, httpReferer; + zval *this_ptr = getThis(); - ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + ZVAL_UNDEF(&httpReferer); + + zephir_get_global(&_SERVER, SL("_SERVER")); - if (zephir_array_isset_string_fetch(&httpReferer, _SERVER, SS("HTTP_REFERER"), 1 TSRMLS_CC)) { - RETURN_CTOR(httpReferer); + if (zephir_array_isset_string_fetch(&httpReferer, _SERVER, SL("HTTP_REFERER"), 1)) { + RETURN_CTORW(&httpReferer); } - RETURN_MM_STRING("", 1); + RETURN_STRING(""); } @@ -2193,59 +2531,65 @@ PHP_METHOD(Phalcon_Http_Request, getHTTPReferer) { */ PHP_METHOD(Phalcon_Http_Request, _getBestQuality) { - HashTable *_1; - HashPosition _0; double quality = 0, acceptQuality = 0; zend_long i = 0; - zval *name = NULL; - zval *qualityParts_param = NULL, *name_param = NULL, *selectedName = NULL, *accept = NULL, **_2, *_3$$4 = NULL, *_4$$5 = NULL; - zval *qualityParts = NULL; + zval name; + zval *qualityParts_param = NULL, *name_param = NULL, selectedName, accept, *_0, _1$$4, _2$$5; + zval qualityParts; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&qualityParts); + ZVAL_UNDEF(&selectedName); + ZVAL_UNDEF(&accept); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &qualityParts_param, &name_param); - zephir_get_arrval(qualityParts, qualityParts_param); + zephir_get_arrval(&qualityParts, qualityParts_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } i = 0; quality = 0.0; - ZEPHIR_INIT_VAR(selectedName); - ZVAL_STRING(selectedName, "", 1); - zephir_is_iterable(qualityParts, &_1, &_0, 0, 0, "phalcon/http/request.zep", 1121); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(accept, _2); + ZEPHIR_INIT_VAR(&selectedName); + ZVAL_STRING(&selectedName, ""); + zephir_is_iterable(&qualityParts, 0, "phalcon/http/request.zep", 1121); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&qualityParts), _0) + { + ZEPHIR_INIT_NVAR(&accept); + ZVAL_COPY(&accept, _0); if (i == 0) { - ZEPHIR_OBS_NVAR(_3$$4); - zephir_array_fetch_string(&_3$$4, accept, SL("quality"), PH_NOISY, "phalcon/http/request.zep", 1110 TSRMLS_CC); - quality = zephir_get_doubleval(_3$$4); - ZEPHIR_OBS_NVAR(selectedName); - zephir_array_fetch(&selectedName, accept, name, PH_NOISY, "phalcon/http/request.zep", 1111 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_1$$4); + zephir_array_fetch_string(&_1$$4, &accept, SL("quality"), PH_NOISY, "phalcon/http/request.zep", 1110 TSRMLS_CC); + quality = zephir_get_doubleval(&_1$$4); + ZEPHIR_OBS_NVAR(&selectedName); + zephir_array_fetch(&selectedName, &accept, &name, PH_NOISY, "phalcon/http/request.zep", 1111 TSRMLS_CC); } else { - ZEPHIR_OBS_NVAR(_4$$5); - zephir_array_fetch_string(&_4$$5, accept, SL("quality"), PH_NOISY, "phalcon/http/request.zep", 1113 TSRMLS_CC); - acceptQuality = zephir_get_doubleval(_4$$5); + ZEPHIR_OBS_NVAR(&_2$$5); + zephir_array_fetch_string(&_2$$5, &accept, SL("quality"), PH_NOISY, "phalcon/http/request.zep", 1113 TSRMLS_CC); + acceptQuality = zephir_get_doubleval(&_2$$5); if (acceptQuality > quality) { quality = acceptQuality; - ZEPHIR_OBS_NVAR(selectedName); - zephir_array_fetch(&selectedName, accept, name, PH_NOISY, "phalcon/http/request.zep", 1116 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&selectedName); + zephir_array_fetch(&selectedName, &accept, &name, PH_NOISY, "phalcon/http/request.zep", 1116 TSRMLS_CC); } } i++; - } - RETURN_CCTOR(selectedName); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&accept); + RETURN_CCTOR(&selectedName); } @@ -2254,18 +2598,21 @@ PHP_METHOD(Phalcon_Http_Request, _getBestQuality) { */ PHP_METHOD(Phalcon_Http_Request, getContentType) { - zval *_SERVER, *contentType = NULL; + zval *_SERVER, contentType; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&contentType); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); - ZEPHIR_OBS_VAR(contentType); - if (zephir_array_isset_string_fetch(&contentType, _SERVER, SS("CONTENT_TYPE"), 0 TSRMLS_CC)) { - RETURN_CCTOR(contentType); + ZEPHIR_OBS_VAR(&contentType); + if (zephir_array_isset_string_fetch(&contentType, _SERVER, SL("CONTENT_TYPE"), 0)) { + RETURN_CCTOR(&contentType); } else { - ZEPHIR_OBS_NVAR(contentType); - if (zephir_array_isset_string_fetch(&contentType, _SERVER, SS("HTTP_CONTENT_TYPE"), 0 TSRMLS_CC)) { - RETURN_CCTOR(contentType); + ZEPHIR_OBS_NVAR(&contentType); + if (zephir_array_isset_string_fetch(&contentType, _SERVER, SL("HTTP_CONTENT_TYPE"), 0)) { + RETURN_CCTOR(&contentType); } } RETURN_MM_NULL(); @@ -2277,18 +2624,20 @@ PHP_METHOD(Phalcon_Http_Request, getContentType) { */ PHP_METHOD(Phalcon_Http_Request, getAcceptableContent) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "HTTP_ACCEPT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "accept", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getqualityheader", NULL, 252, _0, _1); - zephir_check_temp_parameter(_0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "HTTP_ACCEPT"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "accept"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getqualityheader", NULL, 214, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -2299,17 +2648,20 @@ PHP_METHOD(Phalcon_Http_Request, getAcceptableContent) { */ PHP_METHOD(Phalcon_Http_Request, getBestAccept) { - zval *_0 = NULL, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getacceptablecontent", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "accept", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getbestquality", NULL, 253, _0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "accept"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getbestquality", NULL, 215, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -2320,18 +2672,20 @@ PHP_METHOD(Phalcon_Http_Request, getBestAccept) { */ PHP_METHOD(Phalcon_Http_Request, getClientCharsets) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "HTTP_ACCEPT_CHARSET", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "charset", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getqualityheader", NULL, 252, _0, _1); - zephir_check_temp_parameter(_0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "HTTP_ACCEPT_CHARSET"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "charset"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getqualityheader", NULL, 214, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -2342,17 +2696,20 @@ PHP_METHOD(Phalcon_Http_Request, getClientCharsets) { */ PHP_METHOD(Phalcon_Http_Request, getBestCharset) { - zval *_0 = NULL, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getclientcharsets", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "charset", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getbestquality", NULL, 253, _0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "charset"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getbestquality", NULL, 215, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -2363,18 +2720,20 @@ PHP_METHOD(Phalcon_Http_Request, getBestCharset) { */ PHP_METHOD(Phalcon_Http_Request, getLanguages) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "HTTP_ACCEPT_LANGUAGE", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "language", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getqualityheader", NULL, 252, _0, _1); - zephir_check_temp_parameter(_0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "HTTP_ACCEPT_LANGUAGE"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "language"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getqualityheader", NULL, 214, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -2385,17 +2744,20 @@ PHP_METHOD(Phalcon_Http_Request, getLanguages) { */ PHP_METHOD(Phalcon_Http_Request, getBestLanguage) { - zval *_0 = NULL, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getlanguages", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "language", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getbestquality", NULL, 253, _0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "language"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getbestquality", NULL, 215, &_0, &_1); zephir_check_call_status(); RETURN_MM(); @@ -2407,23 +2769,28 @@ PHP_METHOD(Phalcon_Http_Request, getBestLanguage) { PHP_METHOD(Phalcon_Http_Request, getBasicAuth) { zend_bool _0; - zval *_SERVER, *auth = NULL, *_1$$3, *_2$$3; + zval *_SERVER, auth, _1$$3, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&auth); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); + zephir_get_global(&_SERVER, SL("_SERVER")); - _0 = zephir_array_isset_string(_SERVER, SS("PHP_AUTH_USER")); + _0 = zephir_array_isset_string(_SERVER, SL("PHP_AUTH_USER")); if (_0) { - _0 = zephir_array_isset_string(_SERVER, SS("PHP_AUTH_PW")); + _0 = zephir_array_isset_string(_SERVER, SL("PHP_AUTH_PW")); } if (_0) { - ZEPHIR_INIT_VAR(auth); - array_init(auth); + ZEPHIR_INIT_VAR(&auth); + array_init(&auth); zephir_array_fetch_string(&_1$$3, _SERVER, SL("PHP_AUTH_USER"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1202 TSRMLS_CC); zephir_array_update_string(&auth, SL("username"), &_1$$3, PH_COPY | PH_SEPARATE); zephir_array_fetch_string(&_2$$3, _SERVER, SL("PHP_AUTH_PW"), PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1203 TSRMLS_CC); zephir_array_update_string(&auth, SL("password"), &_2$$3, PH_COPY | PH_SEPARATE); - RETURN_CCTOR(auth); + RETURN_CCTOR(&auth); } RETURN_MM_NULL(); @@ -2434,48 +2801,53 @@ PHP_METHOD(Phalcon_Http_Request, getBasicAuth) { */ PHP_METHOD(Phalcon_Http_Request, getDigestAuth) { - HashTable *_4$$5; - HashPosition _3$$5; - zval *auth = NULL; - zend_long ZEPHIR_LAST_CALL_STATUS; - zval *_SERVER, *digest = NULL, *matches = NULL, *match = NULL, *_0$$3, *_1$$3, *_2$$3 = NULL, **_5$$5, *_6$$6, *_7$$6 = NULL; + zval auth; + zval *_SERVER, digest, matches, match, _0$$3, _1$$3, _2$$3, *_3$$5, _4$$6, _5$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&digest); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&match); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&auth); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); - - ZEPHIR_INIT_VAR(auth); - array_init(auth); - ZEPHIR_OBS_VAR(digest); - if (zephir_array_isset_string_fetch(&digest, _SERVER, SS("PHP_AUTH_DIGEST"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(matches); - array_init(matches); - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_STRING(_0$$3, "#(\\w+)=(['\"]?)([^'\" ,]+)\\2#", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_LONG(_1$$3, 2); - ZEPHIR_MAKE_REF(matches); - ZEPHIR_CALL_FUNCTION(&_2$$3, "preg_match_all", NULL, 41, _0$$3, digest, matches, _1$$3); - zephir_check_temp_parameter(_0$$3); - ZEPHIR_UNREF(matches); - zephir_check_call_status(); - if (!(zephir_is_true(_2$$3))) { - RETURN_CTOR(auth); + zephir_get_global(&_SERVER, SL("_SERVER")); + + ZEPHIR_INIT_VAR(&auth); + array_init(&auth); + ZEPHIR_OBS_VAR(&digest); + if (zephir_array_isset_string_fetch(&digest, _SERVER, SL("PHP_AUTH_DIGEST"), 0)) { + ZEPHIR_INIT_VAR(&matches); + array_init(&matches); + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "#(\\w+)=(['\"]?)([^'\" ,]+)\\2#"); + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "#(\\w+)=(['\"]?)([^'\" ,]+)\\2#"); + zephir_preg_match(&_1$$3, &_2$$3, &digest, &matches, 1, 2 , 0 TSRMLS_CC); + if (!(zephir_is_true(&_1$$3))) { + RETURN_CTOR(&auth); } - if (Z_TYPE_P(matches) == IS_ARRAY) { - zephir_is_iterable(matches, &_4$$5, &_3$$5, 0, 0, "phalcon/http/request.zep", 1228); - for ( - ; zend_hash_get_current_data_ex(_4$$5, (void**) &_5$$5, &_3$$5) == SUCCESS - ; zend_hash_move_forward_ex(_4$$5, &_3$$5) - ) { - ZEPHIR_GET_HVALUE(match, _5$$5); - zephir_array_fetch_long(&_6$$6, match, 3, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1226 TSRMLS_CC); - ZEPHIR_OBS_NVAR(_7$$6); - zephir_array_fetch_long(&_7$$6, match, 1, PH_NOISY, "phalcon/http/request.zep", 1226 TSRMLS_CC); - zephir_array_update_zval(&auth, _7$$6, &_6$$6, PH_COPY | PH_SEPARATE); - } + if (Z_TYPE_P(&matches) == IS_ARRAY) { + zephir_is_iterable(&matches, 0, "phalcon/http/request.zep", 1228); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&matches), _3$$5) + { + ZEPHIR_INIT_NVAR(&match); + ZVAL_COPY(&match, _3$$5); + zephir_array_fetch_long(&_4$$6, &match, 3, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1226 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_5$$6); + zephir_array_fetch_long(&_5$$6, &match, 1, PH_NOISY, "phalcon/http/request.zep", 1226 TSRMLS_CC); + zephir_array_update_zval(&auth, &_5$$6, &_4$$6, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&match); } } - RETURN_CTOR(auth); + RETURN_CTOR(&auth); } @@ -2484,103 +2856,124 @@ PHP_METHOD(Phalcon_Http_Request, getDigestAuth) { */ PHP_METHOD(Phalcon_Http_Request, _getQualityHeader) { - HashTable *_6, *_14$$3; - HashPosition _5, _13$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *serverIndex_param = NULL, *name_param = NULL, *returnedParts = NULL, *part = NULL, *headerParts = NULL, *headerPart = NULL, *split = NULL, *_0 = NULL, _1, _2, _3, *_4 = NULL, **_7, *_8$$3 = NULL, _9$$3 = zval_used_for_init, _10$$3 = zval_used_for_init, _11$$3 = zval_used_for_init, *_12$$3 = NULL, **_15$$3, _16$$4 = zval_used_for_init, *_17$$4 = NULL, *_18$$5, *_19$$6 = NULL, *_20$$6 = NULL, *_21$$7, *_22$$7 = NULL, *_23$$8 = NULL; - zval *serverIndex = NULL, *name = NULL; + zval *serverIndex_param = NULL, *name_param = NULL, returnedParts, part, headerParts, headerPart, split, _0, _1, _2, _3, _4, *_5, _6$$3, _7$$3, _8$$3, _9$$3, _10$$3, *_11$$3, _12$$4, _13$$4, _14$$5, _15$$6, _16$$6, _17$$7, _18$$7, _19$$8; + zval serverIndex, name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&serverIndex); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&returnedParts); + ZVAL_UNDEF(&part); + ZVAL_UNDEF(&headerParts); + ZVAL_UNDEF(&headerPart); + ZVAL_UNDEF(&split); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_8$$3); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_10$$3); + ZVAL_UNDEF(&_12$$4); + ZVAL_UNDEF(&_13$$4); + ZVAL_UNDEF(&_14$$5); + ZVAL_UNDEF(&_15$$6); + ZVAL_UNDEF(&_16$$6); + ZVAL_UNDEF(&_17$$7); + ZVAL_UNDEF(&_18$$7); + ZVAL_UNDEF(&_19$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &serverIndex_param, &name_param); if (UNEXPECTED(Z_TYPE_P(serverIndex_param) != IS_STRING && Z_TYPE_P(serverIndex_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serverIndex' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serverIndex' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(serverIndex_param) == IS_STRING)) { - zephir_get_strval(serverIndex, serverIndex_param); + zephir_get_strval(&serverIndex, serverIndex_param); } else { - ZEPHIR_INIT_VAR(serverIndex); - ZVAL_EMPTY_STRING(serverIndex); + ZEPHIR_INIT_VAR(&serverIndex); + ZVAL_EMPTY_STRING(&serverIndex); } if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_INIT_VAR(returnedParts); - array_init(returnedParts); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "getserver", NULL, 0, serverIndex); + ZEPHIR_INIT_VAR(&returnedParts); + array_init(&returnedParts); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "getserver", NULL, 0, &serverIndex); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "/,\\s*/", 0); - ZEPHIR_SINIT_VAR(_2); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "/,\\s*/"); ZVAL_LONG(&_2, -1); - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, 1); - ZEPHIR_CALL_FUNCTION(&_4, "preg_split", NULL, 254, &_1, _0, &_2, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "preg_split", NULL, 216, &_1, &_0, &_2, &_3); zephir_check_call_status(); - zephir_is_iterable(_4, &_6, &_5, 0, 0, "phalcon/http/request.zep", 1262); - for ( - ; zend_hash_get_current_data_ex(_6, (void**) &_7, &_5) == SUCCESS - ; zend_hash_move_forward_ex(_6, &_5) - ) { - ZEPHIR_GET_HVALUE(part, _7); - ZEPHIR_INIT_NVAR(headerParts); - array_init(headerParts); - ZEPHIR_INIT_NVAR(_8$$3); - zephir_fast_trim(_8$$3, part, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); - ZEPHIR_SINIT_NVAR(_9$$3); - ZVAL_STRING(&_9$$3, "/\\s*;\\s*/", 0); - ZEPHIR_SINIT_NVAR(_10$$3); - ZVAL_LONG(&_10$$3, -1); - ZEPHIR_SINIT_NVAR(_11$$3); - ZVAL_LONG(&_11$$3, 1); - ZEPHIR_CALL_FUNCTION(&_12$$3, "preg_split", NULL, 254, &_9$$3, _8$$3, &_10$$3, &_11$$3); + zephir_is_iterable(&_4, 0, "phalcon/http/request.zep", 1262); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_4), _5) + { + ZEPHIR_INIT_NVAR(&part); + ZVAL_COPY(&part, _5); + ZEPHIR_INIT_NVAR(&headerParts); + array_init(&headerParts); + ZEPHIR_INIT_NVAR(&_6$$3); + zephir_fast_trim(&_6$$3, &part, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_7$$3); + ZVAL_STRING(&_7$$3, "/\\s*;\\s*/"); + ZVAL_LONG(&_8$$3, -1); + ZVAL_LONG(&_9$$3, 1); + ZEPHIR_CALL_FUNCTION(&_10$$3, "preg_split", NULL, 216, &_7$$3, &_6$$3, &_8$$3, &_9$$3); zephir_check_call_status(); - zephir_is_iterable(_12$$3, &_14$$3, &_13$$3, 0, 0, "phalcon/http/request.zep", 1259); - for ( - ; zend_hash_get_current_data_ex(_14$$3, (void**) &_15$$3, &_13$$3) == SUCCESS - ; zend_hash_move_forward_ex(_14$$3, &_13$$3) - ) { - ZEPHIR_GET_HVALUE(headerPart, _15$$3); - ZEPHIR_SINIT_NVAR(_16$$4); - ZVAL_STRING(&_16$$4, "=", 0); - ZEPHIR_INIT_NVAR(_17$$4); - zephir_fast_strpos(_17$$4, headerPart, &_16$$4, 0 ); - if (!ZEPHIR_IS_FALSE_IDENTICAL(_17$$4)) { - ZEPHIR_INIT_NVAR(split); - zephir_fast_explode_str(split, SL("="), headerPart, 2 TSRMLS_CC); - zephir_array_fetch_long(&_18$$5, split, 0, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1248 TSRMLS_CC); - if (ZEPHIR_IS_STRING_IDENTICAL(_18$$5, "q")) { - ZEPHIR_OBS_NVAR(_19$$6); - zephir_array_fetch_long(&_19$$6, split, 1, PH_NOISY, "phalcon/http/request.zep", 1249 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_20$$6); - ZVAL_DOUBLE(_20$$6, zephir_get_doubleval(_19$$6)); - zephir_array_update_string(&headerParts, SL("quality"), &_20$$6, PH_COPY | PH_SEPARATE); + zephir_is_iterable(&_10$$3, 0, "phalcon/http/request.zep", 1259); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_10$$3), _11$$3) + { + ZEPHIR_INIT_NVAR(&headerPart); + ZVAL_COPY(&headerPart, _11$$3); + ZEPHIR_INIT_NVAR(&_12$$4); + ZVAL_STRING(&_12$$4, "="); + ZEPHIR_INIT_NVAR(&_13$$4); + zephir_fast_strpos(&_13$$4, &headerPart, &_12$$4, 0 ); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&_13$$4)) { + ZEPHIR_INIT_NVAR(&split); + zephir_fast_explode_str(&split, SL("="), &headerPart, 2 TSRMLS_CC); + zephir_array_fetch_long(&_14$$5, &split, 0, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1248 TSRMLS_CC); + if (ZEPHIR_IS_STRING_IDENTICAL(&_14$$5, "q")) { + ZEPHIR_OBS_NVAR(&_15$$6); + zephir_array_fetch_long(&_15$$6, &split, 1, PH_NOISY, "phalcon/http/request.zep", 1249 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_16$$6); + ZVAL_DOUBLE(&_16$$6, zephir_get_doubleval(&_15$$6)); + zephir_array_update_string(&headerParts, SL("quality"), &_16$$6, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_long(&_21$$7, split, 1, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1251 TSRMLS_CC); - ZEPHIR_OBS_NVAR(_22$$7); - zephir_array_fetch_long(&_22$$7, split, 0, PH_NOISY, "phalcon/http/request.zep", 1251 TSRMLS_CC); - zephir_array_update_zval(&headerParts, _22$$7, &_21$$7, PH_COPY | PH_SEPARATE); + zephir_array_fetch_long(&_17$$7, &split, 1, PH_NOISY | PH_READONLY, "phalcon/http/request.zep", 1251 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_18$$7); + zephir_array_fetch_long(&_18$$7, &split, 0, PH_NOISY, "phalcon/http/request.zep", 1251 TSRMLS_CC); + zephir_array_update_zval(&headerParts, &_18$$7, &_17$$7, PH_COPY | PH_SEPARATE); } } else { - zephir_array_update_zval(&headerParts, name, &headerPart, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_23$$8); - ZVAL_DOUBLE(_23$$8, 1.0); - zephir_array_update_string(&headerParts, SL("quality"), &_23$$8, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&headerParts, &name, &headerPart, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_19$$8); + ZVAL_DOUBLE(&_19$$8, 1.0); + zephir_array_update_string(&headerParts, SL("quality"), &_19$$8, PH_COPY | PH_SEPARATE); } - } - zephir_array_append(&returnedParts, headerParts, PH_SEPARATE, "phalcon/http/request.zep", 1259); - } - RETURN_CCTOR(returnedParts); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&headerPart); + zephir_array_append(&returnedParts, &headerParts, PH_SEPARATE, "phalcon/http/request.zep", 1259); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&part); + RETURN_CCTOR(&returnedParts); } diff --git a/ext/phalcon/http/request.zep.h b/ext/phalcon/http/request.zep.h index b1569aa37fb..56e9644917a 100644 --- a/ext/phalcon/http/request.zep.h +++ b/ext/phalcon/http/request.zep.h @@ -77,137 +77,611 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_request_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_get, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, filters) ZEND_ARG_INFO(0, defaultValue) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, notAllowEmpty, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, notAllowEmpty) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, noRecursive, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, noRecursive) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_getpost, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, filters) ZEND_ARG_INFO(0, defaultValue) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, notAllowEmpty, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, notAllowEmpty) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, noRecursive, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, noRecursive) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_getput, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, filters) ZEND_ARG_INFO(0, defaultValue) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, notAllowEmpty, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, notAllowEmpty) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, noRecursive, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, noRecursive) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_getquery, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, filters) ZEND_ARG_INFO(0, defaultValue) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, notAllowEmpty, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, notAllowEmpty) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, noRecursive, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, noRecursive) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_gethelper, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, source, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, filters) ZEND_ARG_INFO(0, defaultValue) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, notAllowEmpty, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, notAllowEmpty) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, noRecursive, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, noRecursive) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_getserver, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getserver, 0, 1, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getserver, 0, 1, IS_STRING, NULL, 1) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_haspost, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_haspost, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_haspost, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_hasput, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasput, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasput, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_hasquery, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasquery, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasquery, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_hasserver, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasserver, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasserver, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_hasheader, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasheader, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasheader, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +#else ZEND_ARG_INFO(0, header) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_getheader, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getheader, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getheader, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +#else ZEND_ARG_INFO(0, header) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getscheme, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getscheme, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isajax, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isajax, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_issoap, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_issoap, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_issoaprequested, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_issoaprequested, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_issecure, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_issecure, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_issecurerequest, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_issecurerequest, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getrawbody, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getrawbody, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_getjsonrawbody, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, associative, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, associative) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getserveraddress, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getserveraddress, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getservername, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getservername, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_gethttphost, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_gethttphost, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_setstricthostcheck, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_request_setstricthostcheck, 0, 0, Phalcon\\Http\\Request, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_setstricthostcheck, 0, 0, IS_OBJECT, "Phalcon\\Http\\Request", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, flag, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, flag) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isstricthostcheck, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isstricthostcheck, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getport, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getport, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_geturi, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_geturi, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_getclientaddress, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, trustForwardedHeader, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, trustForwardedHeader) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_isvalidhttpmethod, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getmethod, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getmethod, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getuseragent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getuseragent, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isvalidhttpmethod, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isvalidhttpmethod, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_ismethod, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ismethod, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ismethod, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, methods) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, strict, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, strict) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ispost, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ispost, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isget, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isget, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isput, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isput, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_hasfiles, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ispatch, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ispatch, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ishead, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ishead, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isdelete, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isdelete, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isoptions, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isoptions, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ispurge, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_ispurge, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_istrace, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_istrace, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isconnect, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_isconnect, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasfiles, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasfiles, 0, 0, IS_LONG, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, onlySuccessful, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, onlySuccessful) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_hasfilehelper, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasfilehelper, 0, 2, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_hasfilehelper, 0, 2, IS_LONG, NULL, 0) +#endif ZEND_ARG_INFO(0, data) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, onlySuccessful, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, onlySuccessful) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_getuploadedfiles, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_request_getuploadedfiles, 0, 0, Phalcon\\Http\\Request\\FileInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getuploadedfiles, 0, 0, IS_OBJECT, "Phalcon\\Http\\Request\\FileInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, onlySuccessful, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, onlySuccessful) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_smoothfiles, 0, 0, 6) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_smoothfiles, 0, 6, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_smoothfiles, 0, 6, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, names, 0) ZEND_ARG_ARRAY_INFO(0, types, 0) ZEND_ARG_ARRAY_INFO(0, tmp_names, 0) ZEND_ARG_ARRAY_INFO(0, sizes, 0) ZEND_ARG_ARRAY_INFO(0, errors, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, prefix) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getheaders, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getheaders, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_resolveauthorizationheaders, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_resolveauthorizationheaders, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_gethttpreferer, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_gethttpreferer, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request__getbestquality, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request__getbestquality, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request__getbestquality, 0, 2, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, qualityParts, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getcontenttype, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getcontenttype, 0, 0, IS_STRING, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getacceptablecontent, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getacceptablecontent, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getbestaccept, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getbestaccept, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getclientcharsets, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getclientcharsets, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getbestcharset, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getbestcharset, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getlanguages, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getlanguages, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getbestlanguage, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getbestlanguage, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getbasicauth, 0, 0, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getbasicauth, 0, 0, IS_ARRAY, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getdigestauth, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_getdigestauth, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request__getqualityheader, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request__getqualityheader, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request__getqualityheader, 0, 2, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, serverIndex, IS_STRING, 0) +#else ZEND_ARG_INFO(0, serverIndex) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_request_method_entry) { PHP_ME(Phalcon_Http_Request, getHttpMethodParameterOverride, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, setHttpMethodParameterOverride, arginfo_phalcon_http_request_sethttpmethodparameteroverride, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, setDI, arginfo_phalcon_http_request_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getDI, arginfo_phalcon_http_request_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, get, arginfo_phalcon_http_request_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, getPost, arginfo_phalcon_http_request_getpost, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, getPut, arginfo_phalcon_http_request_getput, ZEND_ACC_PUBLIC) @@ -221,53 +695,53 @@ ZEPHIR_INIT_FUNCS(phalcon_http_request_method_entry) { PHP_ME(Phalcon_Http_Request, hasServer, arginfo_phalcon_http_request_hasserver, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Http_Request, hasHeader, arginfo_phalcon_http_request_hasheader, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Http_Request, getHeader, arginfo_phalcon_http_request_getheader, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Http_Request, getScheme, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isAjax, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isSoap, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isSoapRequested, NULL, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isSecure, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isSecureRequest, NULL, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getRawBody, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getScheme, arginfo_phalcon_http_request_getscheme, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isAjax, arginfo_phalcon_http_request_isajax, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isSoap, arginfo_phalcon_http_request_issoap, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isSoapRequested, arginfo_phalcon_http_request_issoaprequested, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isSecure, arginfo_phalcon_http_request_issecure, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isSecureRequest, arginfo_phalcon_http_request_issecurerequest, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getRawBody, arginfo_phalcon_http_request_getrawbody, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, getJsonRawBody, arginfo_phalcon_http_request_getjsonrawbody, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getServerAddress, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getServerName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getHttpHost, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getServerAddress, arginfo_phalcon_http_request_getserveraddress, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getServerName, arginfo_phalcon_http_request_getservername, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getHttpHost, arginfo_phalcon_http_request_gethttphost, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, setStrictHostCheck, arginfo_phalcon_http_request_setstricthostcheck, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isStrictHostCheck, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getPort, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getURI, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Http_Request, isStrictHostCheck, arginfo_phalcon_http_request_isstricthostcheck, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getPort, arginfo_phalcon_http_request_getport, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getURI, arginfo_phalcon_http_request_geturi, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Http_Request, getClientAddress, arginfo_phalcon_http_request_getclientaddress, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getMethod, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Http_Request, getUserAgent, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getMethod, arginfo_phalcon_http_request_getmethod, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Http_Request, getUserAgent, arginfo_phalcon_http_request_getuseragent, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, isValidHttpMethod, arginfo_phalcon_http_request_isvalidhttpmethod, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, isMethod, arginfo_phalcon_http_request_ismethod, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isPost, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isGet, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isPut, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isPatch, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isHead, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isDelete, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isPurge, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isTrace, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, isConnect, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isPost, arginfo_phalcon_http_request_ispost, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isGet, arginfo_phalcon_http_request_isget, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isPut, arginfo_phalcon_http_request_isput, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isPatch, arginfo_phalcon_http_request_ispatch, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isHead, arginfo_phalcon_http_request_ishead, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isDelete, arginfo_phalcon_http_request_isdelete, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isOptions, arginfo_phalcon_http_request_isoptions, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isPurge, arginfo_phalcon_http_request_ispurge, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isTrace, arginfo_phalcon_http_request_istrace, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, isConnect, arginfo_phalcon_http_request_isconnect, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, hasFiles, arginfo_phalcon_http_request_hasfiles, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, hasFileHelper, arginfo_phalcon_http_request_hasfilehelper, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Http_Request, getUploadedFiles, arginfo_phalcon_http_request_getuploadedfiles, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, smoothFiles, arginfo_phalcon_http_request_smoothfiles, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Http_Request, getHeaders, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, resolveAuthorizationHeaders, NULL, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Http_Request, getHTTPReferer, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getHeaders, arginfo_phalcon_http_request_getheaders, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, resolveAuthorizationHeaders, arginfo_phalcon_http_request_resolveauthorizationheaders, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Http_Request, getHTTPReferer, arginfo_phalcon_http_request_gethttpreferer, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, _getBestQuality, arginfo_phalcon_http_request__getbestquality, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Http_Request, getContentType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getAcceptableContent, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getBestAccept, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getClientCharsets, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getBestCharset, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getLanguages, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getBestLanguage, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getBasicAuth, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request, getDigestAuth, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getContentType, arginfo_phalcon_http_request_getcontenttype, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getAcceptableContent, arginfo_phalcon_http_request_getacceptablecontent, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getBestAccept, arginfo_phalcon_http_request_getbestaccept, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getClientCharsets, arginfo_phalcon_http_request_getclientcharsets, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getBestCharset, arginfo_phalcon_http_request_getbestcharset, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getLanguages, arginfo_phalcon_http_request_getlanguages, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getBestLanguage, arginfo_phalcon_http_request_getbestlanguage, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getBasicAuth, arginfo_phalcon_http_request_getbasicauth, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request, getDigestAuth, arginfo_phalcon_http_request_getdigestauth, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request, _getQualityHeader, arginfo_phalcon_http_request__getqualityheader, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_FE_END }; diff --git a/ext/phalcon/http/request/file.zep.c b/ext/phalcon/http/request/file.zep.c index d35ae3c6b75..459dfaf6e77 100644 --- a/ext/phalcon/http/request/file.zep.c +++ b/ext/phalcon/http/request/file.zep.c @@ -82,7 +82,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Http_Request_File) { */ PHP_METHOD(Phalcon_Http_Request_File, getError) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_error"); @@ -92,7 +93,8 @@ PHP_METHOD(Phalcon_Http_Request_File, getError) { */ PHP_METHOD(Phalcon_Http_Request_File, getKey) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_key"); @@ -102,7 +104,8 @@ PHP_METHOD(Phalcon_Http_Request_File, getKey) { */ PHP_METHOD(Phalcon_Http_Request_File, getExtension) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_extension"); @@ -114,47 +117,61 @@ PHP_METHOD(Phalcon_Http_Request_File, getExtension) { PHP_METHOD(Phalcon_Http_Request_File, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, *key = NULL, *name = NULL, *tempName = NULL, *size = NULL, *type = NULL, *error = NULL, _0$$3, *_1$$3 = NULL, _2$$4, *_3$$4 = NULL; - zval *file = NULL; + zval *file_param = NULL, *key = NULL, key_sub, __$null, name, tempName, size, type, error, _0$$3, _1$$3, _2$$4, _3$$4; + zval file; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&key_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&tempName); + ZVAL_UNDEF(&size); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&error); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &file_param, &key); - file = file_param; + ZEPHIR_OBS_COPY_OR_DUP(&file, file_param); if (!key) { - key = ZEPHIR_GLOBAL(global_null); + key = &key_sub; + key = &__$null; } - ZEPHIR_OBS_VAR(name); - if (zephir_array_isset_string_fetch(&name, file, SS("name"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); - ZEPHIR_SINIT_VAR(_0$$3); - ZVAL_STRING(&_0$$3, "PATHINFO_EXTENSION", 0); - ZEPHIR_CALL_FUNCTION(&_1$$3, "defined", NULL, 37, &_0$$3); + ZEPHIR_OBS_VAR(&name); + if (zephir_array_isset_string_fetch(&name, &file, SL("name"), 0)) { + zephir_update_property_zval(this_ptr, SL("_name"), &name); + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "PATHINFO_EXTENSION"); + ZEPHIR_CALL_FUNCTION(&_1$$3, "defined", NULL, 31, &_0$$3); zephir_check_call_status(); - if (zephir_is_true(_1$$3)) { - ZEPHIR_SINIT_VAR(_2$$4); + if (zephir_is_true(&_1$$3)) { ZVAL_LONG(&_2$$4, 4); - ZEPHIR_CALL_FUNCTION(&_3$$4, "pathinfo", NULL, 78, name, &_2$$4); + ZEPHIR_CALL_FUNCTION(&_3$$4, "pathinfo", NULL, 71, &name, &_2$$4); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_extension"), _3$$4 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_extension"), &_3$$4); } } - if (zephir_array_isset_string_fetch(&tempName, file, SS("tmp_name"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_tmp"), tempName TSRMLS_CC); + if (zephir_array_isset_string_fetch(&tempName, &file, SL("tmp_name"), 1)) { + zephir_update_property_zval(this_ptr, SL("_tmp"), &tempName); } - if (zephir_array_isset_string_fetch(&size, file, SS("size"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_size"), size TSRMLS_CC); + if (zephir_array_isset_string_fetch(&size, &file, SL("size"), 1)) { + zephir_update_property_zval(this_ptr, SL("_size"), &size); } - if (zephir_array_isset_string_fetch(&type, file, SS("type"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); + if (zephir_array_isset_string_fetch(&type, &file, SL("type"), 1)) { + zephir_update_property_zval(this_ptr, SL("_type"), &type); } - if (zephir_array_isset_string_fetch(&error, file, SS("error"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_error"), error TSRMLS_CC); + if (zephir_array_isset_string_fetch(&error, &file, SL("error"), 1)) { + zephir_update_property_zval(this_ptr, SL("_error"), &error); } if (zephir_is_true(key)) { - zephir_update_property_this(getThis(), SL("_key"), key TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_key"), key); } ZEPHIR_MM_RESTORE(); @@ -165,7 +182,8 @@ PHP_METHOD(Phalcon_Http_Request_File, __construct) { */ PHP_METHOD(Phalcon_Http_Request_File, getSize) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_size"); @@ -176,7 +194,8 @@ PHP_METHOD(Phalcon_Http_Request_File, getSize) { */ PHP_METHOD(Phalcon_Http_Request_File, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -187,7 +206,8 @@ PHP_METHOD(Phalcon_Http_Request_File, getName) { */ PHP_METHOD(Phalcon_Http_Request_File, getTempName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_tmp"); @@ -199,7 +219,8 @@ PHP_METHOD(Phalcon_Http_Request_File, getTempName) { */ PHP_METHOD(Phalcon_Http_Request_File, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -210,24 +231,28 @@ PHP_METHOD(Phalcon_Http_Request_File, getType) { */ PHP_METHOD(Phalcon_Http_Request_File, getRealType) { - zval *finfo = NULL, *mime = NULL, _0, *_1; + zval finfo, mime, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&finfo); + ZVAL_UNDEF(&mime); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, 16); - ZEPHIR_CALL_FUNCTION(&finfo, "finfo_open", NULL, 255, &_0); + ZEPHIR_CALL_FUNCTION(&finfo, "finfo_open", NULL, 217, &_0); zephir_check_call_status(); - if (Z_TYPE_P(finfo) != IS_RESOURCE) { - RETURN_MM_STRING("", 1); + if (Z_TYPE_P(&finfo) != IS_RESOURCE) { + RETURN_MM_STRING(""); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_tmp"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 256, finfo, _1); + zephir_read_property(&_0, this_ptr, SL("_tmp"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&mime, "finfo_file", NULL, 218, &finfo, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 257, finfo); + ZEPHIR_CALL_FUNCTION(NULL, "finfo_close", NULL, 219, &finfo); zephir_check_call_status(); - RETURN_CCTOR(mime); + RETURN_CCTOR(&mime); } @@ -237,18 +262,22 @@ PHP_METHOD(Phalcon_Http_Request_File, getRealType) { PHP_METHOD(Phalcon_Http_Request_File, isUploadedFile) { zend_bool _0; - zval *tmp = NULL, *_1 = NULL; + zval tmp, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tmp); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&tmp, this_ptr, "gettempname", NULL, 0); zephir_check_call_status(); - _0 = Z_TYPE_P(tmp) == IS_STRING; + _0 = Z_TYPE_P(&tmp) == IS_STRING; if (_0) { - ZEPHIR_CALL_FUNCTION(&_1, "is_uploaded_file", NULL, 258, tmp); + ZEPHIR_CALL_FUNCTION(&_1, "is_uploaded_file", NULL, 220, &tmp); zephir_check_call_status(); - _0 = zephir_is_true(_1); + _0 = zephir_is_true(&_1); } RETURN_MM_BOOL(_0); @@ -260,26 +289,30 @@ PHP_METHOD(Phalcon_Http_Request_File, isUploadedFile) { PHP_METHOD(Phalcon_Http_Request_File, moveTo) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *destination_param = NULL, *_0; - zval *destination = NULL; + zval *destination_param = NULL, _0; + zval destination; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&destination); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &destination_param); if (UNEXPECTED(Z_TYPE_P(destination_param) != IS_STRING && Z_TYPE_P(destination_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'destination' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'destination' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(destination_param) == IS_STRING)) { - zephir_get_strval(destination, destination_param); + zephir_get_strval(&destination, destination_param); } else { - ZEPHIR_INIT_VAR(destination); - ZVAL_EMPTY_STRING(destination); + ZEPHIR_INIT_VAR(&destination); + ZVAL_EMPTY_STRING(&destination); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_tmp"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_FUNCTION("move_uploaded_file", NULL, 259, _0, destination); + zephir_read_property(&_0, this_ptr, SL("_tmp"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_FUNCTION("move_uploaded_file", NULL, 221, &_0, &destination); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/http/request/file.zep.h b/ext/phalcon/http/request/file.zep.h index 2ee00a5e5e6..8607c32cb50 100644 --- a/ext/phalcon/http/request/file.zep.h +++ b/ext/phalcon/http/request/file.zep.h @@ -15,26 +15,97 @@ PHP_METHOD(Phalcon_Http_Request_File, getRealType); PHP_METHOD(Phalcon_Http_Request_File, isUploadedFile); PHP_METHOD(Phalcon_Http_Request_File, moveTo); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_geterror, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_geterror, 0, 0, IS_STRING, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getkey, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getkey, 0, 0, IS_STRING, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getextension, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getextension, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_file___construct, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, file, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_file_moveto, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getsize, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getsize, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_gettempname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_gettempname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_gettype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_gettype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getrealtype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_getrealtype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_isuploadedfile, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_isuploadedfile, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_moveto, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_file_moveto, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, destination, IS_STRING, 0) +#else ZEND_ARG_INFO(0, destination) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_request_file_method_entry) { - PHP_ME(Phalcon_Http_Request_File, getError, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request_File, getKey, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request_File, getExtension, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request_File, getError, arginfo_phalcon_http_request_file_geterror, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request_File, getKey, arginfo_phalcon_http_request_file_getkey, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request_File, getExtension, arginfo_phalcon_http_request_file_getextension, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request_File, __construct, arginfo_phalcon_http_request_file___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Http_Request_File, getSize, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request_File, getName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request_File, getTempName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request_File, getType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request_File, getRealType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Request_File, isUploadedFile, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request_File, getSize, arginfo_phalcon_http_request_file_getsize, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request_File, getName, arginfo_phalcon_http_request_file_getname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request_File, getTempName, arginfo_phalcon_http_request_file_gettempname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request_File, getType, arginfo_phalcon_http_request_file_gettype, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request_File, getRealType, arginfo_phalcon_http_request_file_getrealtype, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Request_File, isUploadedFile, arginfo_phalcon_http_request_file_isuploadedfile, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Request_File, moveTo, arginfo_phalcon_http_request_file_moveto, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/http/request/fileinterface.zep.h b/ext/phalcon/http/request/fileinterface.zep.h index f0e81f83eb9..e80a4cb9a96 100644 --- a/ext/phalcon/http/request/fileinterface.zep.h +++ b/ext/phalcon/http/request/fileinterface.zep.h @@ -3,16 +3,59 @@ extern zend_class_entry *phalcon_http_request_fileinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Http_Request_FileInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_request_fileinterface_moveto, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_getsize, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_getsize, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_gettempname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_gettempname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_gettype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_gettype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_getrealtype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_getrealtype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_moveto, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_request_fileinterface_moveto, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, destination, IS_STRING, 0) +#else ZEND_ARG_INFO(0, destination) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_request_fileinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getSize, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getName, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getTempName, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getType, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getRealType, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getSize, arginfo_phalcon_http_request_fileinterface_getsize) + PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getName, arginfo_phalcon_http_request_fileinterface_getname) + PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getTempName, arginfo_phalcon_http_request_fileinterface_gettempname) + PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getType, arginfo_phalcon_http_request_fileinterface_gettype) + PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, getRealType, arginfo_phalcon_http_request_fileinterface_getrealtype) PHP_ABSTRACT_ME(Phalcon_Http_Request_FileInterface, moveTo, arginfo_phalcon_http_request_fileinterface_moveto) PHP_FE_END }; diff --git a/ext/phalcon/http/requestinterface.zep.h b/ext/phalcon/http/requestinterface.zep.h index ab78f5cbf24..0a5803733e3 100644 --- a/ext/phalcon/http/requestinterface.zep.h +++ b/ext/phalcon/http/requestinterface.zep.h @@ -4,66 +4,350 @@ extern zend_class_entry *phalcon_http_requestinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Http_RequestInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_get, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, filters) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getpost, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, filters) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getquery, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 1) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, filters) ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getserver, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_haspost, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_haspost, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_haspost, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_hasput, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_hasput, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_hasput, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_hasquery, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_hasquery, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_hasquery, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_hasserver, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_hasserver, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_hasserver, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getheader, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getheader, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getheader, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +#else ZEND_ARG_INFO(0, header) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getscheme, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getscheme, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isajax, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isajax, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_issoaprequested, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_issoaprequested, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_issecurerequest, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_issecurerequest, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getrawbody, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getrawbody, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getserveraddress, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getserveraddress, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getservername, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getservername, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_gethttphost, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_gethttphost, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getport, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getport, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getclientaddress, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, trustForwardedHeader, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, trustForwardedHeader) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getmethod, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getmethod, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getuseragent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getuseragent, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_ismethod, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_ismethod, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_ismethod, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, methods) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, strict, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, strict) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_ispost, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_ispost, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isget, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isget, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isput, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isput, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_ishead, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_ishead, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isdelete, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isdelete, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isoptions, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isoptions, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_ispurge, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_ispurge, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_istrace, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_istrace, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isconnect, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_isconnect, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_hasfiles, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, onlySuccessful, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, onlySuccessful) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_requestinterface_getuploadedfiles, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_requestinterface_getuploadedfiles, 0, 0, Phalcon\\Http\\Request\\FileInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getuploadedfiles, 0, 0, IS_OBJECT, "Phalcon\\Http\\Request\\FileInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, onlySuccessful, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, onlySuccessful) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_gethttpreferer, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_gethttpreferer, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getacceptablecontent, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getacceptablecontent, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getbestaccept, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getbestaccept, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getclientcharsets, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getclientcharsets, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getbestcharset, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getbestcharset, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getlanguages, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getlanguages, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getbestlanguage, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getbestlanguage, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getdigestauth, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_requestinterface_getdigestauth, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_requestinterface_method_entry) { @@ -77,38 +361,38 @@ ZEPHIR_INIT_FUNCS(phalcon_http_requestinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasQuery, arginfo_phalcon_http_requestinterface_hasquery) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasServer, arginfo_phalcon_http_requestinterface_hasserver) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getHeader, arginfo_phalcon_http_requestinterface_getheader) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getScheme, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isAjax, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isSoapRequested, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isSecureRequest, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getRawBody, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getServerAddress, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getServerName, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getHttpHost, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getPort, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getScheme, arginfo_phalcon_http_requestinterface_getscheme) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isAjax, arginfo_phalcon_http_requestinterface_isajax) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isSoapRequested, arginfo_phalcon_http_requestinterface_issoaprequested) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isSecureRequest, arginfo_phalcon_http_requestinterface_issecurerequest) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getRawBody, arginfo_phalcon_http_requestinterface_getrawbody) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getServerAddress, arginfo_phalcon_http_requestinterface_getserveraddress) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getServerName, arginfo_phalcon_http_requestinterface_getservername) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getHttpHost, arginfo_phalcon_http_requestinterface_gethttphost) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getPort, arginfo_phalcon_http_requestinterface_getport) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getClientAddress, arginfo_phalcon_http_requestinterface_getclientaddress) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getMethod, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUserAgent, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getMethod, arginfo_phalcon_http_requestinterface_getmethod) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUserAgent, arginfo_phalcon_http_requestinterface_getuseragent) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isMethod, arginfo_phalcon_http_requestinterface_ismethod) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isPost, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isGet, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isPut, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isHead, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isDelete, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isOptions, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isPurge, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isTrace, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isConnect, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isPost, arginfo_phalcon_http_requestinterface_ispost) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isGet, arginfo_phalcon_http_requestinterface_isget) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isPut, arginfo_phalcon_http_requestinterface_isput) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isHead, arginfo_phalcon_http_requestinterface_ishead) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isDelete, arginfo_phalcon_http_requestinterface_isdelete) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isOptions, arginfo_phalcon_http_requestinterface_isoptions) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isPurge, arginfo_phalcon_http_requestinterface_ispurge) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isTrace, arginfo_phalcon_http_requestinterface_istrace) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, isConnect, arginfo_phalcon_http_requestinterface_isconnect) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, hasFiles, arginfo_phalcon_http_requestinterface_hasfiles) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getUploadedFiles, arginfo_phalcon_http_requestinterface_getuploadedfiles) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getHTTPReferer, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getAcceptableContent, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestAccept, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getClientCharsets, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestCharset, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getLanguages, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestLanguage, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getHTTPReferer, arginfo_phalcon_http_requestinterface_gethttpreferer) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getAcceptableContent, arginfo_phalcon_http_requestinterface_getacceptablecontent) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestAccept, arginfo_phalcon_http_requestinterface_getbestaccept) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getClientCharsets, arginfo_phalcon_http_requestinterface_getclientcharsets) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestCharset, arginfo_phalcon_http_requestinterface_getbestcharset) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getLanguages, arginfo_phalcon_http_requestinterface_getlanguages) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBestLanguage, arginfo_phalcon_http_requestinterface_getbestlanguage) PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getBasicAuth, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getDigestAuth, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_RequestInterface, getDigestAuth, arginfo_phalcon_http_requestinterface_getdigestauth) PHP_FE_END }; diff --git a/ext/phalcon/http/response.zep.c b/ext/phalcon/http/response.zep.c index 0c95b596a16..f2875176559 100644 --- a/ext/phalcon/http/response.zep.c +++ b/ext/phalcon/http/response.zep.c @@ -69,31 +69,41 @@ ZEPHIR_INIT_CLASS(Phalcon_Http_Response) { PHP_METHOD(Phalcon_Http_Response, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *content = NULL, *code = NULL, *status = NULL, *_0; + zval *content = NULL, content_sub, *code = NULL, code_sub, *status = NULL, status_sub, __$null, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&code_sub); + ZVAL_UNDEF(&status_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &content, &code, &status); if (!content) { - content = ZEPHIR_GLOBAL(global_null); + content = &content_sub; + content = &__$null; } if (!code) { - code = ZEPHIR_GLOBAL(global_null); + code = &code_sub; + code = &__$null; } if (!status) { - status = ZEPHIR_GLOBAL(global_null); + status = &status_sub; + status = &__$null; } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_http_response_headers_ce); - if (zephir_has_constructor(_0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_http_response_headers_ce); + if (zephir_has_constructor(&_0 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_headers"), _0 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_headers"), &_0); if (Z_TYPE_P(content) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_content"), content TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_content"), content); } if (Z_TYPE_P(code) != IS_NULL) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatuscode", NULL, 0, code, status); @@ -108,13 +118,16 @@ PHP_METHOD(Phalcon_Http_Response, __construct) { */ PHP_METHOD(Phalcon_Http_Response, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -123,24 +136,28 @@ PHP_METHOD(Phalcon_Http_Response, setDI) { */ PHP_METHOD(Phalcon_Http_Response, getDI) { - zval *dependencyInjector = NULL, *_0; + zval dependencyInjector, _0; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_1, 1); + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_1, 0); zephir_check_call_status(); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "A dependency injection object is required to access the 'url' service", "phalcon/http/response.zep", 100); return; } - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), &dependencyInjector); } - RETURN_CCTOR(dependencyInjector); + RETURN_CCTOR(&dependencyInjector); } @@ -154,141 +171,162 @@ PHP_METHOD(Phalcon_Http_Response, getDI) { PHP_METHOD(Phalcon_Http_Response, setStatusCode) { zend_bool _4$$4; - HashTable *_2$$3; - HashPosition _1$$3; + zend_string *_3$$3; + zend_ulong _2$$3; zephir_fcall_cache_entry *_7 = NULL, *_8 = NULL; - zval *message = NULL, *_10, *_12; - zval *code_param = NULL, *message_param = NULL, *headers = NULL, *currentHeadersRaw = NULL, *key = NULL, *statusCodes = NULL, *defaultMessage = NULL, _9, _11, *_13, *_0$$3 = NULL, **_3$$3, _5$$4 = zval_used_for_init, *_6$$4 = NULL; + zval message, _10, _12; + zval *code_param = NULL, *message_param = NULL, headers, currentHeadersRaw, key, statusCodes, defaultMessage, _9, _11, _13, _0$$3, *_1$$3, _5$$4, _6$$4; zend_long code, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&headers); + ZVAL_UNDEF(¤tHeadersRaw); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&statusCodes); + ZVAL_UNDEF(&defaultMessage); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &code_param, &message_param); code = zephir_get_intval(code_param); if (!message_param) { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_STRING(&message, ""); } else { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } ZEPHIR_CALL_METHOD(&headers, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(¤tHeadersRaw, headers, "toarray", NULL, 0); + ZEPHIR_CALL_METHOD(¤tHeadersRaw, &headers, "toarray", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(currentHeadersRaw) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_is_iterable(currentHeadersRaw, &_2$$3, &_1$$3, 0, 0, "phalcon/http/response.zep", 132); - for ( - ; zend_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS - ; zend_hash_move_forward_ex(_2$$3, &_1$$3) - ) { - ZEPHIR_GET_HMKEY(key, _2$$3, _1$$3); - ZEPHIR_GET_HVALUE(_0$$3, _3$$3); - _4$$4 = Z_TYPE_P(key) == IS_STRING; + if (Z_TYPE_P(¤tHeadersRaw) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_is_iterable(¤tHeadersRaw, 0, "phalcon/http/response.zep", 132); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¤tHeadersRaw), _2$$3, _3$$3, _1$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_3$$3 != NULL) { + ZVAL_STR_COPY(&key, _3$$3); + } else { + ZVAL_LONG(&key, _2$$3); + } + ZEPHIR_INIT_NVAR(&_0$$3); + ZVAL_COPY(&_0$$3, _1$$3); + _4$$4 = Z_TYPE_P(&key) == IS_STRING; if (_4$$4) { - ZEPHIR_SINIT_NVAR(_5$$4); - ZVAL_STRING(&_5$$4, "HTTP/", 0); - ZEPHIR_CALL_FUNCTION(&_6$$4, "strstr", &_7, 260, key, &_5$$4); + ZEPHIR_INIT_NVAR(&_5$$4); + ZVAL_STRING(&_5$$4, "HTTP/"); + ZEPHIR_CALL_FUNCTION(&_6$$4, "strstr", &_7, 222, &key, &_5$$4); zephir_check_call_status(); - _4$$4 = zephir_is_true(_6$$4); + _4$$4 = zephir_is_true(&_6$$4); } if (_4$$4) { - ZEPHIR_CALL_METHOD(NULL, headers, "remove", &_8, 0, key); + ZEPHIR_CALL_METHOD(NULL, &headers, "remove", &_8, 0, &key); zephir_check_call_status(); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_0$$3); + ZEPHIR_INIT_NVAR(&key); } - if (ZEPHIR_IS_STRING_IDENTICAL(message, "")) { - ZEPHIR_INIT_VAR(statusCodes); - zephir_create_array(statusCodes, 67, 0 TSRMLS_CC); - add_index_stringl(statusCodes, 100, SL("Continue"), 1); - add_index_stringl(statusCodes, 101, SL("Switching Protocols"), 1); - add_index_stringl(statusCodes, 102, SL("Processing"), 1); - add_index_stringl(statusCodes, 103, SL("Early Hints"), 1); - add_index_stringl(statusCodes, 200, SL("OK"), 1); - add_index_stringl(statusCodes, 201, SL("Created"), 1); - add_index_stringl(statusCodes, 202, SL("Accepted"), 1); - add_index_stringl(statusCodes, 203, SL("Non-Authoritative Information"), 1); - add_index_stringl(statusCodes, 204, SL("No Content"), 1); - add_index_stringl(statusCodes, 205, SL("Reset Content"), 1); - add_index_stringl(statusCodes, 206, SL("Partial Content"), 1); - add_index_stringl(statusCodes, 207, SL("Multi-status"), 1); - add_index_stringl(statusCodes, 208, SL("Already Reported"), 1); - add_index_stringl(statusCodes, 226, SL("IM Used"), 1); - add_index_stringl(statusCodes, 300, SL("Multiple Choices"), 1); - add_index_stringl(statusCodes, 301, SL("Moved Permanently"), 1); - add_index_stringl(statusCodes, 302, SL("Found"), 1); - add_index_stringl(statusCodes, 303, SL("See Other"), 1); - add_index_stringl(statusCodes, 304, SL("Not Modified"), 1); - add_index_stringl(statusCodes, 305, SL("Use Proxy"), 1); - add_index_stringl(statusCodes, 306, SL("Switch Proxy"), 1); - add_index_stringl(statusCodes, 307, SL("Temporary Redirect"), 1); - add_index_stringl(statusCodes, 308, SL("Permanent Redirect"), 1); - add_index_stringl(statusCodes, 400, SL("Bad Request"), 1); - add_index_stringl(statusCodes, 401, SL("Unauthorized"), 1); - add_index_stringl(statusCodes, 402, SL("Payment Required"), 1); - add_index_stringl(statusCodes, 403, SL("Forbidden"), 1); - add_index_stringl(statusCodes, 404, SL("Not Found"), 1); - add_index_stringl(statusCodes, 405, SL("Method Not Allowed"), 1); - add_index_stringl(statusCodes, 406, SL("Not Acceptable"), 1); - add_index_stringl(statusCodes, 407, SL("Proxy Authentication Required"), 1); - add_index_stringl(statusCodes, 408, SL("Request Time-out"), 1); - add_index_stringl(statusCodes, 409, SL("Conflict"), 1); - add_index_stringl(statusCodes, 410, SL("Gone"), 1); - add_index_stringl(statusCodes, 411, SL("Length Required"), 1); - add_index_stringl(statusCodes, 412, SL("Precondition Failed"), 1); - add_index_stringl(statusCodes, 413, SL("Request Entity Too Large"), 1); - add_index_stringl(statusCodes, 414, SL("Request-URI Too Large"), 1); - add_index_stringl(statusCodes, 415, SL("Unsupported Media Type"), 1); - add_index_stringl(statusCodes, 416, SL("Requested range not satisfiable"), 1); - add_index_stringl(statusCodes, 417, SL("Expectation Failed"), 1); - add_index_stringl(statusCodes, 418, SL("I'm a teapot"), 1); - add_index_stringl(statusCodes, 421, SL("Misdirected Request"), 1); - add_index_stringl(statusCodes, 422, SL("Unprocessable Entity"), 1); - add_index_stringl(statusCodes, 423, SL("Locked"), 1); - add_index_stringl(statusCodes, 424, SL("Failed Dependency"), 1); - add_index_stringl(statusCodes, 425, SL("Unordered Collection"), 1); - add_index_stringl(statusCodes, 426, SL("Upgrade Required"), 1); - add_index_stringl(statusCodes, 428, SL("Precondition Required"), 1); - add_index_stringl(statusCodes, 429, SL("Too Many Requests"), 1); - add_index_stringl(statusCodes, 431, SL("Request Header Fields Too Large"), 1); - add_index_stringl(statusCodes, 451, SL("Unavailable For Legal Reasons"), 1); - add_index_stringl(statusCodes, 499, SL("Client Closed Request"), 1); - add_index_stringl(statusCodes, 500, SL("Internal Server Error"), 1); - add_index_stringl(statusCodes, 501, SL("Not Implemented"), 1); - add_index_stringl(statusCodes, 502, SL("Bad Gateway"), 1); - add_index_stringl(statusCodes, 503, SL("Service Unavailable"), 1); - add_index_stringl(statusCodes, 504, SL("Gateway Time-out"), 1); - add_index_stringl(statusCodes, 505, SL("HTTP Version not supported"), 1); - add_index_stringl(statusCodes, 506, SL("Variant Also Negotiates"), 1); - add_index_stringl(statusCodes, 507, SL("Insufficient Storage"), 1); - add_index_stringl(statusCodes, 508, SL("Loop Detected"), 1); - add_index_stringl(statusCodes, 510, SL("Not Extended"), 1); - add_index_stringl(statusCodes, 511, SL("Network Authentication Required"), 1); - if (!(zephir_array_isset_long(statusCodes, code))) { + if (ZEPHIR_IS_STRING_IDENTICAL(&message, "")) { + ZEPHIR_INIT_VAR(&statusCodes); + zephir_create_array(&statusCodes, 64, 0 TSRMLS_CC); + add_index_stringl(&statusCodes, 100, SL("Continue")); + add_index_stringl(&statusCodes, 101, SL("Switching Protocols")); + add_index_stringl(&statusCodes, 102, SL("Processing")); + add_index_stringl(&statusCodes, 103, SL("Early Hints")); + add_index_stringl(&statusCodes, 200, SL("OK")); + add_index_stringl(&statusCodes, 201, SL("Created")); + add_index_stringl(&statusCodes, 202, SL("Accepted")); + add_index_stringl(&statusCodes, 203, SL("Non-Authoritative Information")); + add_index_stringl(&statusCodes, 204, SL("No Content")); + add_index_stringl(&statusCodes, 205, SL("Reset Content")); + add_index_stringl(&statusCodes, 206, SL("Partial Content")); + add_index_stringl(&statusCodes, 207, SL("Multi-status")); + add_index_stringl(&statusCodes, 208, SL("Already Reported")); + add_index_stringl(&statusCodes, 226, SL("IM Used")); + add_index_stringl(&statusCodes, 300, SL("Multiple Choices")); + add_index_stringl(&statusCodes, 301, SL("Moved Permanently")); + add_index_stringl(&statusCodes, 302, SL("Found")); + add_index_stringl(&statusCodes, 303, SL("See Other")); + add_index_stringl(&statusCodes, 304, SL("Not Modified")); + add_index_stringl(&statusCodes, 305, SL("Use Proxy")); + add_index_stringl(&statusCodes, 306, SL("Switch Proxy")); + add_index_stringl(&statusCodes, 307, SL("Temporary Redirect")); + add_index_stringl(&statusCodes, 308, SL("Permanent Redirect")); + add_index_stringl(&statusCodes, 400, SL("Bad Request")); + add_index_stringl(&statusCodes, 401, SL("Unauthorized")); + add_index_stringl(&statusCodes, 402, SL("Payment Required")); + add_index_stringl(&statusCodes, 403, SL("Forbidden")); + add_index_stringl(&statusCodes, 404, SL("Not Found")); + add_index_stringl(&statusCodes, 405, SL("Method Not Allowed")); + add_index_stringl(&statusCodes, 406, SL("Not Acceptable")); + add_index_stringl(&statusCodes, 407, SL("Proxy Authentication Required")); + add_index_stringl(&statusCodes, 408, SL("Request Time-out")); + add_index_stringl(&statusCodes, 409, SL("Conflict")); + add_index_stringl(&statusCodes, 410, SL("Gone")); + add_index_stringl(&statusCodes, 411, SL("Length Required")); + add_index_stringl(&statusCodes, 412, SL("Precondition Failed")); + add_index_stringl(&statusCodes, 413, SL("Request Entity Too Large")); + add_index_stringl(&statusCodes, 414, SL("Request-URI Too Large")); + add_index_stringl(&statusCodes, 415, SL("Unsupported Media Type")); + add_index_stringl(&statusCodes, 416, SL("Requested range not satisfiable")); + add_index_stringl(&statusCodes, 417, SL("Expectation Failed")); + add_index_stringl(&statusCodes, 418, SL("I'm a teapot")); + add_index_stringl(&statusCodes, 421, SL("Misdirected Request")); + add_index_stringl(&statusCodes, 422, SL("Unprocessable Entity")); + add_index_stringl(&statusCodes, 423, SL("Locked")); + add_index_stringl(&statusCodes, 424, SL("Failed Dependency")); + add_index_stringl(&statusCodes, 425, SL("Unordered Collection")); + add_index_stringl(&statusCodes, 426, SL("Upgrade Required")); + add_index_stringl(&statusCodes, 428, SL("Precondition Required")); + add_index_stringl(&statusCodes, 429, SL("Too Many Requests")); + add_index_stringl(&statusCodes, 431, SL("Request Header Fields Too Large")); + add_index_stringl(&statusCodes, 451, SL("Unavailable For Legal Reasons")); + add_index_stringl(&statusCodes, 499, SL("Client Closed Request")); + add_index_stringl(&statusCodes, 500, SL("Internal Server Error")); + add_index_stringl(&statusCodes, 501, SL("Not Implemented")); + add_index_stringl(&statusCodes, 502, SL("Bad Gateway")); + add_index_stringl(&statusCodes, 503, SL("Service Unavailable")); + add_index_stringl(&statusCodes, 504, SL("Gateway Time-out")); + add_index_stringl(&statusCodes, 505, SL("HTTP Version not supported")); + add_index_stringl(&statusCodes, 506, SL("Variant Also Negotiates")); + add_index_stringl(&statusCodes, 507, SL("Insufficient Storage")); + add_index_stringl(&statusCodes, 508, SL("Loop Detected")); + add_index_stringl(&statusCodes, 510, SL("Not Extended")); + add_index_stringl(&statusCodes, 511, SL("Network Authentication Required")); + if (!(zephir_array_isset_long(&statusCodes, code))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "Non-standard statuscode given without a message", "phalcon/http/response.zep", 211); return; } - ZEPHIR_OBS_VAR(defaultMessage); - zephir_array_fetch_long(&defaultMessage, statusCodes, code, PH_NOISY, "phalcon/http/response.zep", 214 TSRMLS_CC); - zephir_get_strval(message, defaultMessage); + ZEPHIR_OBS_VAR(&defaultMessage); + zephir_array_fetch_long(&defaultMessage, &statusCodes, code, PH_NOISY, "phalcon/http/response.zep", 214 TSRMLS_CC); + zephir_get_strval(&message, &defaultMessage); } ZEPHIR_SINIT_VAR(_9); ZVAL_LONG(&_9, code); - ZEPHIR_INIT_VAR(_10); - ZEPHIR_CONCAT_SVSV(_10, "HTTP/1.1 ", &_9, " ", message); - ZEPHIR_CALL_METHOD(NULL, headers, "setraw", NULL, 0, _10); + ZEPHIR_INIT_VAR(&_10); + ZEPHIR_CONCAT_SVSV(&_10, "HTTP/1.1 ", &_9, " ", &message); + ZEPHIR_CALL_METHOD(NULL, &headers, "setraw", NULL, 0, &_10); zephir_check_call_status(); ZEPHIR_SINIT_VAR(_11); ZVAL_LONG(&_11, code); - ZEPHIR_INIT_VAR(_12); - ZEPHIR_CONCAT_VSV(_12, &_11, " ", message); - ZEPHIR_INIT_VAR(_13); - ZVAL_STRING(_13, "Status", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, headers, "set", NULL, 0, _13, _12); - zephir_check_temp_parameter(_13); + ZEPHIR_INIT_VAR(&_12); + ZEPHIR_CONCAT_VSV(&_12, &_11, " ", &message); + ZEPHIR_INIT_VAR(&_13); + ZVAL_STRING(&_13, "Status"); + ZEPHIR_CALL_METHOD(NULL, &headers, "set", NULL, 0, &_13, &_12); zephir_check_call_status(); RETURN_THIS(); @@ -303,31 +341,36 @@ PHP_METHOD(Phalcon_Http_Response, setStatusCode) { */ PHP_METHOD(Phalcon_Http_Response, getStatusCode) { - zval *statusCode = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, _3, _4; + zval statusCode, _0, _1, _2, _3, _4; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statusCode); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "Status", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, _0, "get", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "Status"); + ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, 0); - ZEPHIR_SINIT_VAR(_4); ZVAL_LONG(&_4, 3); - ZEPHIR_INIT_VAR(statusCode); - zephir_substr(statusCode, _1, 0 , 3 , 0); - ZEPHIR_INIT_NVAR(_2); - if (zephir_is_true(statusCode)) { - ZVAL_LONG(_2, zephir_get_intval(statusCode)); + ZEPHIR_INIT_VAR(&statusCode); + zephir_substr(&statusCode, &_1, 0 , 3 , 0); + ZEPHIR_INIT_NVAR(&_2); + if (zephir_is_true(&statusCode)) { + ZVAL_LONG(&_2, zephir_get_intval(&statusCode)); } else { - ZVAL_NULL(_2); + ZVAL_NULL(&_2); } - RETURN_CCTOR(_2); + RETURN_CCTOR(&_2); } @@ -340,29 +383,34 @@ PHP_METHOD(Phalcon_Http_Response, getStatusCode) { */ PHP_METHOD(Phalcon_Http_Response, getReasonPhrase) { - zval *statusReasonPhrase = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, _3; + zval statusReasonPhrase, _0, _1, _2, _3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statusReasonPhrase); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "Status", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, _0, "get", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "Status"); + ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, 4); - ZEPHIR_INIT_VAR(statusReasonPhrase); - zephir_substr(statusReasonPhrase, _1, 4 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_INIT_NVAR(_2); - if (zephir_is_true(statusReasonPhrase)) { - ZEPHIR_CPY_WRT(_2, statusReasonPhrase); + ZEPHIR_INIT_VAR(&statusReasonPhrase); + zephir_substr(&statusReasonPhrase, &_1, 4 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_INIT_NVAR(&_2); + if (zephir_is_true(&statusReasonPhrase)) { + ZEPHIR_CPY_WRT(&_2, &statusReasonPhrase); } else { - ZVAL_NULL(_2); + ZVAL_NULL(&_2); } - RETURN_CCTOR(_2); + RETURN_CCTOR(&_2); } @@ -371,13 +419,16 @@ PHP_METHOD(Phalcon_Http_Response, getReasonPhrase) { */ PHP_METHOD(Phalcon_Http_Response, setHeaders) { - zval *headers; + zval *headers, headers_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&headers_sub); zephir_fetch_params(0, 1, 0, &headers); - zephir_update_property_this(getThis(), SL("_headers"), headers TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_headers"), headers); RETURN_THISW(); } @@ -387,7 +438,8 @@ PHP_METHOD(Phalcon_Http_Response, setHeaders) { */ PHP_METHOD(Phalcon_Http_Response, getHeaders) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_headers"); @@ -398,13 +450,16 @@ PHP_METHOD(Phalcon_Http_Response, getHeaders) { */ PHP_METHOD(Phalcon_Http_Response, setCookies) { - zval *cookies; + zval *cookies, cookies_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cookies_sub); zephir_fetch_params(0, 1, 0, &cookies); - zephir_update_property_this(getThis(), SL("_cookies"), cookies TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cookies"), cookies); RETURN_THISW(); } @@ -416,7 +471,8 @@ PHP_METHOD(Phalcon_Http_Response, setCookies) { */ PHP_METHOD(Phalcon_Http_Response, getCookies) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_cookies"); @@ -432,18 +488,23 @@ PHP_METHOD(Phalcon_Http_Response, getCookies) { PHP_METHOD(Phalcon_Http_Response, setHeader) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *value, *headers = NULL; - zval *name = NULL; + zval *name_param = NULL, *value, value_sub, headers; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&headers); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &value); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); ZEPHIR_CALL_METHOD(&headers, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, headers, "set", NULL, 0, name, value); + ZEPHIR_CALL_METHOD(NULL, &headers, "set", NULL, 0, &name, value); zephir_check_call_status(); RETURN_THIS(); @@ -459,18 +520,22 @@ PHP_METHOD(Phalcon_Http_Response, setHeader) { PHP_METHOD(Phalcon_Http_Response, setRawHeader) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *header_param = NULL, *headers = NULL; - zval *header = NULL; + zval *header_param = NULL, headers; + zval header; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&header); + ZVAL_UNDEF(&headers); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &header_param); - zephir_get_strval(header, header_param); + zephir_get_strval(&header, header_param); ZEPHIR_CALL_METHOD(&headers, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, headers, "setraw", NULL, 0, header); + ZEPHIR_CALL_METHOD(NULL, &headers, "setraw", NULL, 0, &header); zephir_check_call_status(); RETURN_THIS(); @@ -481,14 +546,17 @@ PHP_METHOD(Phalcon_Http_Response, setRawHeader) { */ PHP_METHOD(Phalcon_Http_Response, resetHeaders) { - zval *headers = NULL; + zval headers; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&headers); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&headers, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, headers, "reset", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &headers, "reset", NULL, 0); zephir_check_call_status(); RETURN_THIS(); @@ -506,37 +574,42 @@ PHP_METHOD(Phalcon_Http_Response, resetHeaders) { PHP_METHOD(Phalcon_Http_Response, setExpires) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *datetime, *date = NULL, *_0, *_1 = NULL, *_2 = NULL, *_3; + zval *datetime, datetime_sub, date, _0, _1, _2, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&datetime_sub); + ZVAL_UNDEF(&date); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &datetime); - ZEPHIR_INIT_VAR(date); - if (zephir_clone(date, datetime TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&date); + if (zephir_clone(&date, datetime TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, php_date_get_timezone_ce()); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "UTC", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, php_date_get_timezone_ce()); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "UTC"); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, date, "settimezone", NULL, 0, _0); + ZEPHIR_CALL_METHOD(NULL, &date, "settimezone", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "D, d M Y H:i:s", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, date, "format", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "D, d M Y H:i:s"); + ZEPHIR_CALL_METHOD(&_2, &date, "format", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_VS(_3, _2, " GMT"); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "Expires", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, _1, _3); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_VS(&_3, &_2, " GMT"); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "Expires"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_1, &_3); zephir_check_call_status(); RETURN_THIS(); @@ -554,37 +627,42 @@ PHP_METHOD(Phalcon_Http_Response, setExpires) { PHP_METHOD(Phalcon_Http_Response, setLastModified) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *datetime, *date = NULL, *_0, *_1 = NULL, *_2 = NULL, *_3; + zval *datetime, datetime_sub, date, _0, _1, _2, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&datetime_sub); + ZVAL_UNDEF(&date); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &datetime); - ZEPHIR_INIT_VAR(date); - if (zephir_clone(date, datetime TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&date); + if (zephir_clone(&date, datetime TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, php_date_get_timezone_ce()); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "UTC", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, php_date_get_timezone_ce()); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "UTC"); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, date, "settimezone", NULL, 0, _0); + ZEPHIR_CALL_METHOD(NULL, &date, "settimezone", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "D, d M Y H:i:s", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, date, "format", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "D, d M Y H:i:s"); + ZEPHIR_CALL_METHOD(&_2, &date, "format", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_VS(_3, _2, " GMT"); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "Last-Modified", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, _1, _3); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_VS(&_3, &_2, " GMT"); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "Last-Modified"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_1, &_3); zephir_check_call_status(); RETURN_THIS(); @@ -599,40 +677,47 @@ PHP_METHOD(Phalcon_Http_Response, setLastModified) { */ PHP_METHOD(Phalcon_Http_Response, setCache) { - zval *_1, *_3; - zval *minutes_param = NULL, *date = NULL, _0, _2, *_4; + zval _1, _3; + zval *minutes_param = NULL, date, _0, _2, _4; zend_long minutes, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&date); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &minutes_param); if (UNEXPECTED(Z_TYPE_P(minutes_param) != IS_LONG)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'minutes' must be a int") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'minutes' must be of the type int") TSRMLS_CC); RETURN_MM_NULL(); } minutes = Z_LVAL_P(minutes_param); - ZEPHIR_INIT_VAR(date); - object_init_ex(date, php_date_get_date_ce()); - ZEPHIR_CALL_METHOD(NULL, date, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&date); + object_init_ex(&date, php_date_get_date_ce()); + ZEPHIR_CALL_METHOD(NULL, &date, "__construct", NULL, 0); zephir_check_call_status(); ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, minutes); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVS(_1, "+", &_0, " minutes"); - ZEPHIR_CALL_METHOD(NULL, date, "modify", NULL, 0, _1); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVS(&_1, "+", &_0, " minutes"); + ZEPHIR_CALL_METHOD(NULL, &date, "modify", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setexpires", NULL, 0, date); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setexpires", NULL, 0, &date); zephir_check_call_status(); ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, ((minutes * 60))); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SV(_3, "max-age=", &_2); - ZEPHIR_INIT_VAR(_4); - ZVAL_STRING(_4, "Cache-Control", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, _4, _3); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SV(&_3, "max-age=", &_2); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "Cache-Control"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_4, &_3); zephir_check_call_status(); RETURN_THIS(); @@ -643,17 +728,19 @@ PHP_METHOD(Phalcon_Http_Response, setCache) { */ PHP_METHOD(Phalcon_Http_Response, setNotModified) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 304); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "Not modified", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatuscode", NULL, 0, _0, _1); - zephir_check_temp_parameter(_1); + ZVAL_LONG(&_0, 304); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "Not modified"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatuscode", NULL, 0, &_0, &_1); zephir_check_call_status(); RETURN_THIS(); @@ -670,31 +757,38 @@ PHP_METHOD(Phalcon_Http_Response, setNotModified) { PHP_METHOD(Phalcon_Http_Response, setContentType) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *contentType_param = NULL, *charset = NULL, *_0$$3, *_1$$4, *_2$$4; - zval *contentType = NULL; + zval *contentType_param = NULL, *charset = NULL, charset_sub, __$null, _0$$3, _1$$4, _2$$4; + zval contentType; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&contentType); + ZVAL_UNDEF(&charset_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &contentType_param, &charset); - zephir_get_strval(contentType, contentType_param); + zephir_get_strval(&contentType, contentType_param); if (!charset) { - charset = ZEPHIR_GLOBAL(global_null); + charset = &charset_sub; + charset = &__$null; } if (Z_TYPE_P(charset) == IS_NULL) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_STRING(_0$$3, "Content-Type", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, _0$$3, contentType); - zephir_check_temp_parameter(_0$$3); + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "Content-Type"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_0$$3, &contentType); zephir_check_call_status(); } else { - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_VSV(_1$$4, contentType, "; charset=", charset); - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_STRING(_2$$4, "Content-Type", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, _2$$4, _1$$4); - zephir_check_temp_parameter(_2$$4); + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_VSV(&_1$$4, &contentType, "; charset=", charset); + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, "Content-Type"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_2$$4, &_1$$4); zephir_check_call_status(); } RETURN_THIS(); @@ -710,8 +804,12 @@ PHP_METHOD(Phalcon_Http_Response, setContentType) { */ PHP_METHOD(Phalcon_Http_Response, setContentLength) { - zval *contentLength_param = NULL, *_0, *_1; + zval *contentLength_param = NULL, _0, _1; zend_long contentLength, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &contentLength_param); @@ -719,12 +817,10 @@ PHP_METHOD(Phalcon_Http_Response, setContentLength) { contentLength = zephir_get_intval(contentLength_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Content-Length", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, contentLength); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, _0, _1); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Content-Length"); + ZVAL_LONG(&_1, contentLength); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_0, &_1); zephir_check_call_status(); RETURN_THIS(); @@ -740,19 +836,22 @@ PHP_METHOD(Phalcon_Http_Response, setContentLength) { PHP_METHOD(Phalcon_Http_Response, setEtag) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *etag_param = NULL, *_0; - zval *etag = NULL; + zval *etag_param = NULL, _0; + zval etag; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&etag); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &etag_param); - zephir_get_strval(etag, etag_param); + zephir_get_strval(&etag, etag_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Etag", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, _0, etag); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Etag"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_0, &etag); zephir_check_call_status(); RETURN_THIS(); @@ -780,14 +879,35 @@ PHP_METHOD(Phalcon_Http_Response, setEtag) { PHP_METHOD(Phalcon_Http_Response, redirect) { zend_long statusCode, ZEPHIR_LAST_CALL_STATUS; - zend_bool externalRedirect, _10, _0$$5; - zval *location = NULL, *externalRedirect_param = NULL, *statusCode_param = NULL, *header = NULL, *url = NULL, *dependencyInjector = NULL, *matched = NULL, *view = NULL, *_7 = NULL, *_8 = NULL, _1$$5, *_2$$5 = NULL, *_3$$6, _4$$6, *_5$$10 = NULL, *_6$$10, *_9$$11; + zend_bool externalRedirect, _11, _0$$5; + zval *location = NULL, location_sub, *externalRedirect_param = NULL, *statusCode_param = NULL, __$null, header, url, dependencyInjector, matched, view, _8, _9, _12, _1$$5, _2$$5, _3$$6, _4$$6, _5$$6, _6$$10, _7$$10, _10$$11; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&location_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&header); + ZVAL_UNDEF(&url); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&matched); + ZVAL_UNDEF(&view); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&_7$$10); + ZVAL_UNDEF(&_10$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &location, &externalRedirect_param, &statusCode_param); if (!location) { - ZEPHIR_CPY_WRT(location, ZEPHIR_GLOBAL(global_null)); + location = &location_sub; + ZEPHIR_CPY_WRT(location, &__$null); } else { ZEPHIR_SEPARATE_PARAM(location); } @@ -805,79 +925,76 @@ PHP_METHOD(Phalcon_Http_Response, redirect) { if (!(zephir_is_true(location))) { ZEPHIR_INIT_NVAR(location); - ZVAL_STRING(location, "", 1); + ZVAL_STRING(location, ""); } if (externalRedirect) { - ZEPHIR_CPY_WRT(header, location); + ZEPHIR_CPY_WRT(&header, location); } else { _0$$5 = Z_TYPE_P(location) == IS_STRING; if (_0$$5) { - ZEPHIR_SINIT_VAR(_1$$5); - ZVAL_STRING(&_1$$5, "://", 0); - ZEPHIR_CALL_FUNCTION(&_2$$5, "strstr", NULL, 260, location, &_1$$5); + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_STRING(&_1$$5, "://"); + ZEPHIR_CALL_FUNCTION(&_2$$5, "strstr", NULL, 222, location, &_1$$5); zephir_check_call_status(); - _0$$5 = zephir_is_true(_2$$5); + _0$$5 = zephir_is_true(&_2$$5); } if (_0$$5) { - ZEPHIR_INIT_VAR(_3$$6); - ZEPHIR_SINIT_VAR(_4$$6); - ZVAL_STRING(&_4$$6, "/^[^:\\/?#]++:/", 0); - ZEPHIR_INIT_VAR(matched); - zephir_preg_match(matched, &_4$$6, location, _3$$6, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(matched)) { - ZEPHIR_CPY_WRT(header, location); + ZEPHIR_INIT_VAR(&_3$$6); + ZEPHIR_INIT_VAR(&_4$$6); + ZVAL_STRING(&_4$$6, "/^[^:\\/?#]++:/"); + ZEPHIR_INIT_VAR(&_5$$6); + ZVAL_STRING(&_5$$6, "/^[^:\\/?#]++:/"); + ZEPHIR_INIT_VAR(&matched); + zephir_preg_match(&matched, &_5$$6, location, &_3$$6, 0, 0 , 0 TSRMLS_CC); + if (zephir_is_true(&matched)) { + ZEPHIR_CPY_WRT(&header, location); } else { - ZEPHIR_INIT_NVAR(header); - ZVAL_NULL(header); + ZEPHIR_INIT_NVAR(&header); + ZVAL_NULL(&header); } } else { - ZEPHIR_INIT_NVAR(header); - ZVAL_NULL(header); + ZEPHIR_INIT_NVAR(&header); + ZVAL_NULL(&header); } } ZEPHIR_CALL_METHOD(&dependencyInjector, this_ptr, "getdi", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(header))) { - ZEPHIR_INIT_VAR(_6$$10); - ZVAL_STRING(_6$$10, "url", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_5$$10, dependencyInjector, "getshared", NULL, 0, _6$$10); - zephir_check_temp_parameter(_6$$10); + if (!(zephir_is_true(&header))) { + ZEPHIR_INIT_VAR(&_7$$10); + ZVAL_STRING(&_7$$10, "url"); + ZEPHIR_CALL_METHOD(&_6$$10, &dependencyInjector, "getshared", NULL, 0, &_7$$10); zephir_check_call_status(); - ZEPHIR_CPY_WRT(url, _5$$10); - ZEPHIR_CALL_METHOD(&header, url, "get", NULL, 0, location); + ZEPHIR_CPY_WRT(&url, &_6$$10); + ZEPHIR_CALL_METHOD(&header, &url, "get", NULL, 0, location); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_8); - ZVAL_STRING(_8, "view", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_7, dependencyInjector, "has", NULL, 0, _8); - zephir_check_temp_parameter(_8); + ZEPHIR_INIT_VAR(&_9); + ZVAL_STRING(&_9, "view"); + ZEPHIR_CALL_METHOD(&_8, &dependencyInjector, "has", NULL, 0, &_9); zephir_check_call_status(); - if (zephir_is_true(_7)) { - ZEPHIR_INIT_VAR(_9$$11); - ZVAL_STRING(_9$$11, "view", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&view, dependencyInjector, "getshared", NULL, 0, _9$$11); - zephir_check_temp_parameter(_9$$11); + if (zephir_is_true(&_8)) { + ZEPHIR_INIT_VAR(&_10$$11); + ZVAL_STRING(&_10$$11, "view"); + ZEPHIR_CALL_METHOD(&view, &dependencyInjector, "getshared", NULL, 0, &_10$$11); zephir_check_call_status(); - if (zephir_instance_of_ev(view, phalcon_mvc_viewinterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, view, "disable", NULL, 0); + if (zephir_instance_of_ev(&view, phalcon_mvc_viewinterface_ce TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &view, "disable", NULL, 0); zephir_check_call_status(); } } - _10 = statusCode < 300; - if (!(_10)) { - _10 = statusCode > 308; + _11 = statusCode < 300; + if (!(_11)) { + _11 = statusCode > 308; } - if (_10) { + if (_11) { statusCode = 302; } - ZEPHIR_INIT_NVAR(_8); - ZVAL_LONG(_8, statusCode); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatuscode", NULL, 0, _8); + ZVAL_LONG(&_12, statusCode); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatuscode", NULL, 0, &_12); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_8); - ZVAL_STRING(_8, "Location", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, _8, header); - zephir_check_temp_parameter(_8); + ZEPHIR_INIT_NVAR(&_9); + ZVAL_STRING(&_9, "Location"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setheader", NULL, 0, &_9, &header); zephir_check_call_status(); RETURN_THIS(); @@ -893,15 +1010,18 @@ PHP_METHOD(Phalcon_Http_Response, redirect) { PHP_METHOD(Phalcon_Http_Response, setContent) { zval *content_param = NULL; - zval *content = NULL; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &content_param); - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); - zephir_update_property_this(getThis(), SL("_content"), content TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_content"), &content); RETURN_THIS(); } @@ -921,7 +1041,14 @@ PHP_METHOD(Phalcon_Http_Response, setContent) { PHP_METHOD(Phalcon_Http_Response, setJsonContent) { zend_long jsonOptions, depth, ZEPHIR_LAST_CALL_STATUS; - zval *content, *jsonOptions_param = NULL, *depth_param = NULL, *_0 = NULL, *_1, _2, _3; + zval *content, content_sub, *jsonOptions_param = NULL, *depth_param = NULL, _0, _1, _2, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &content, &jsonOptions_param, &depth_param); @@ -938,21 +1065,17 @@ PHP_METHOD(Phalcon_Http_Response, setJsonContent) { } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "application/json", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "UTF-8", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontenttype", NULL, 0, _0, _1); - zephir_check_temp_parameter(_0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "application/json"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "UTF-8"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontenttype", NULL, 0, &_0, &_1); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZEPHIR_SINIT_VAR(_2); + ZEPHIR_INIT_NVAR(&_0); ZVAL_LONG(&_2, jsonOptions); - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, depth); - zephir_json_encode(_0, &(_0), content, zephir_get_intval(&_2) TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontent", NULL, 0, _0); + zephir_json_encode(&_0, content, zephir_get_intval(&_2) ); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcontent", NULL, 0, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -964,7 +1087,12 @@ PHP_METHOD(Phalcon_Http_Response, setJsonContent) { PHP_METHOD(Phalcon_Http_Response, appendContent) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *content, *_0 = NULL, *_1; + zval *content, content_sub, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &content); @@ -973,9 +1101,9 @@ PHP_METHOD(Phalcon_Http_Response, appendContent) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "getcontent", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_VV(_1, _0, content); - zephir_update_property_this(getThis(), SL("_content"), _1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_VV(&_1, &_0, content); + zephir_update_property_zval(this_ptr, SL("_content"), &_1); RETURN_THIS(); } @@ -985,7 +1113,8 @@ PHP_METHOD(Phalcon_Http_Response, appendContent) { */ PHP_METHOD(Phalcon_Http_Response, getContent) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_content"); @@ -996,7 +1125,8 @@ PHP_METHOD(Phalcon_Http_Response, getContent) { */ PHP_METHOD(Phalcon_Http_Response, isSent) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_sent"); @@ -1007,13 +1137,16 @@ PHP_METHOD(Phalcon_Http_Response, isSent) { */ PHP_METHOD(Phalcon_Http_Response, sendHeaders) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_headers"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "send", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_headers"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "send", NULL, 0); zephir_check_call_status(); RETURN_THIS(); @@ -1024,15 +1157,18 @@ PHP_METHOD(Phalcon_Http_Response, sendHeaders) { */ PHP_METHOD(Phalcon_Http_Response, sendCookies) { - zval *cookies = NULL; + zval cookies; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cookies); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(cookies); - zephir_read_property_this(&cookies, this_ptr, SL("_cookies"), PH_NOISY_CC); - if (Z_TYPE_P(cookies) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(NULL, cookies, "send", NULL, 0); + ZEPHIR_OBS_VAR(&cookies); + zephir_read_property(&cookies, this_ptr, SL("_cookies"), PH_NOISY_CC); + if (Z_TYPE_P(&cookies) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(NULL, &cookies, "send", NULL, 0); zephir_check_call_status(); } RETURN_THIS(); @@ -1045,13 +1181,20 @@ PHP_METHOD(Phalcon_Http_Response, sendCookies) { PHP_METHOD(Phalcon_Http_Response, send) { zend_bool _1$$5; - zval *content = NULL, *file = NULL, *_0; + zval __$true, __$false, content, file, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_sent"), PH_NOISY_CC); - if (zephir_is_true(_0)) { + zephir_read_property(&_0, this_ptr, SL("_sent"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_response_exception_ce, "Response was already sent", "phalcon/http/response.zep", 626); return; } @@ -1059,26 +1202,26 @@ PHP_METHOD(Phalcon_Http_Response, send) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "sendcookies", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(content); - zephir_read_property_this(&content, this_ptr, SL("_content"), PH_NOISY_CC); - if (Z_TYPE_P(content) != IS_NULL) { - zend_print_zval(content, 0); + ZEPHIR_OBS_VAR(&content); + zephir_read_property(&content, this_ptr, SL("_content"), PH_NOISY_CC); + if (Z_TYPE_P(&content) != IS_NULL) { + zend_print_zval(&content, 0); } else { - ZEPHIR_OBS_VAR(file); - zephir_read_property_this(&file, this_ptr, SL("_file"), PH_NOISY_CC); - _1$$5 = Z_TYPE_P(file) == IS_STRING; + ZEPHIR_OBS_VAR(&file); + zephir_read_property(&file, this_ptr, SL("_file"), PH_NOISY_CC); + _1$$5 = Z_TYPE_P(&file) == IS_STRING; if (_1$$5) { - _1$$5 = ((zephir_fast_strlen_ev(file)) ? 1 : 0); + _1$$5 = ((zephir_fast_strlen_ev(&file)) ? 1 : 0); } if (_1$$5) { - ZEPHIR_CALL_FUNCTION(NULL, "readfile", NULL, 261, file); + ZEPHIR_CALL_FUNCTION(NULL, "readfile", NULL, 223, &file); zephir_check_call_status(); } } if (1) { - zephir_update_property_this(getThis(), SL("_sent"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sent"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_sent"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sent"), &__$false); } RETURN_THIS(); @@ -1090,49 +1233,58 @@ PHP_METHOD(Phalcon_Http_Response, send) { PHP_METHOD(Phalcon_Http_Response, setFileToSend) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *filePath_param = NULL, *attachmentName = NULL, *attachment = NULL, *basePath = NULL, *_0$$5 = NULL, *_1$$5; - zval *filePath = NULL; + zval *filePath_param = NULL, *attachmentName = NULL, attachmentName_sub, *attachment = NULL, attachment_sub, __$null, __$true, basePath, _0$$5, _1$$5; + zval filePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filePath); + ZVAL_UNDEF(&attachmentName_sub); + ZVAL_UNDEF(&attachment_sub); + ZVAL_NULL(&__$null); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&basePath); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &filePath_param, &attachmentName, &attachment); - zephir_get_strval(filePath, filePath_param); + zephir_get_strval(&filePath, filePath_param); if (!attachmentName) { - attachmentName = ZEPHIR_GLOBAL(global_null); + attachmentName = &attachmentName_sub; + attachmentName = &__$null; } if (!attachment) { - attachment = ZEPHIR_GLOBAL(global_true); + attachment = &attachment_sub; + attachment = &__$true; } if (Z_TYPE_P(attachmentName) != IS_STRING) { - ZEPHIR_INIT_VAR(basePath); - zephir_basename(basePath, filePath TSRMLS_CC); + ZEPHIR_INIT_VAR(&basePath); + zephir_basename(&basePath, &filePath TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(basePath, attachmentName); + ZEPHIR_CPY_WRT(&basePath, attachmentName); } if (zephir_is_true(attachment)) { - ZEPHIR_INIT_VAR(_0$$5); - ZVAL_STRING(_0$$5, "Content-Description: File Transfer", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, _0$$5); - zephir_check_temp_parameter(_0$$5); + ZEPHIR_INIT_VAR(&_0$$5); + ZVAL_STRING(&_0$$5, "Content-Description: File Transfer"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_0$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0$$5); - ZVAL_STRING(_0$$5, "Content-Type: application/octet-stream", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, _0$$5); - zephir_check_temp_parameter(_0$$5); + ZEPHIR_INIT_NVAR(&_0$$5); + ZVAL_STRING(&_0$$5, "Content-Type: application/octet-stream"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_0$$5); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1$$5); - ZEPHIR_CONCAT_SVS(_1$$5, "Content-Disposition: attachment; filename=", basePath, ";"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, _1$$5); + ZEPHIR_INIT_VAR(&_1$$5); + ZEPHIR_CONCAT_SVS(&_1$$5, "Content-Disposition: attachment; filename=", &basePath, ";"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_1$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0$$5); - ZVAL_STRING(_0$$5, "Content-Transfer-Encoding: binary", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, _0$$5); - zephir_check_temp_parameter(_0$$5); + ZEPHIR_INIT_NVAR(&_0$$5); + ZVAL_STRING(&_0$$5, "Content-Transfer-Encoding: binary"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setrawheader", NULL, 0, &_0$$5); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_file"), filePath TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_file"), &filePath); RETURN_THIS(); } @@ -1147,18 +1299,22 @@ PHP_METHOD(Phalcon_Http_Response, setFileToSend) { PHP_METHOD(Phalcon_Http_Response, removeHeader) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *headers = NULL; - zval *name = NULL; + zval *name_param = NULL, headers; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&headers); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); ZEPHIR_CALL_METHOD(&headers, this_ptr, "getheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, headers, "remove", NULL, 0, name); + ZEPHIR_CALL_METHOD(NULL, &headers, "remove", NULL, 0, &name); zephir_check_call_status(); RETURN_THIS(); diff --git a/ext/phalcon/http/response.zep.h b/ext/phalcon/http/response.zep.h index b5629b355ab..d5f32574b7a 100644 --- a/ext/phalcon/http/response.zep.h +++ b/ext/phalcon/http/response.zep.h @@ -45,101 +45,313 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setstatuscode, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setstatuscode, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setstatuscode, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) +#else ZEND_ARG_INFO(0, code) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 1) +#else ZEND_ARG_INFO(0, message) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_getstatuscode, 0, 0, IS_LONG, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_getstatuscode, 0, 0, IS_LONG, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_getreasonphrase, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_getreasonphrase, 0, 0, IS_STRING, NULL, 1) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setheaders, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setheaders, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setheaders, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, headers, Phalcon\\Http\\Response\\HeadersInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setcookies, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_getheaders, 0, 0, Phalcon\\Http\\Response\\HeadersInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_getheaders, 0, 0, IS_OBJECT, "Phalcon\\Http\\Response\\HeadersInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setcookies, 0, 1, Phalcon\\Http\\Response, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setcookies, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response", 0) +#endif ZEND_ARG_OBJ_INFO(0, cookies, Phalcon\\Http\\Response\\CookiesInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setheader, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_getcookies, 0, 0, Phalcon\\Http\\Response\\CookiesInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_getcookies, 0, 0, IS_OBJECT, "Phalcon\\Http\\Response\\CookiesInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setheader, 0, 2, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setheader, 0, 2, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setrawheader, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setrawheader, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setrawheader, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +#else ZEND_ARG_INFO(0, header) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_resetheaders, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_resetheaders, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setexpires, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setexpires, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setexpires, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, datetime, DateTime, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setlastmodified, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setlastmodified, 0, 1, Phalcon\\Http\\Response, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setlastmodified, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response", 0) +#endif ZEND_ARG_OBJ_INFO(0, datetime, DateTime, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setcache, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setcache, 0, 1, Phalcon\\Http\\Response, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setcache, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, minutes, IS_LONG, 0) +#else ZEND_ARG_INFO(0, minutes) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setcontenttype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setnotmodified, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setnotmodified, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setcontenttype, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setcontenttype, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, contentType, IS_STRING, 0) +#else ZEND_ARG_INFO(0, contentType) +#endif ZEND_ARG_INFO(0, charset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setcontentlength, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setcontentlength, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setcontentlength, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, contentLength, IS_LONG, 0) +#else ZEND_ARG_INFO(0, contentLength) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setetag, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setetag, 0, 1, Phalcon\\Http\\Response, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setetag, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, etag, IS_STRING, 0) +#else ZEND_ARG_INFO(0, etag) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_redirect, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_redirect, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_redirect, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_ARG_INFO(0, location) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, externalRedirect, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, externalRedirect) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, statusCode, IS_LONG, 0) +#else ZEND_ARG_INFO(0, statusCode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setcontent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setcontent, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setcontent, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setjsoncontent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setjsoncontent, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setjsoncontent, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_ARG_INFO(0, content) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, jsonOptions, IS_LONG, 0) +#else ZEND_ARG_INFO(0, jsonOptions) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, depth, IS_LONG, 0) +#else ZEND_ARG_INFO(0, depth) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_appendcontent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_appendcontent, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_appendcontent, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_ARG_INFO(0, content) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_setfiletosend, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_getcontent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_getcontent, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_issent, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_issent, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_sendheaders, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_sendheaders, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_sendcookies, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_sendcookies, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_send, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_send, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_setfiletosend, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_setfiletosend, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filePath) +#endif ZEND_ARG_INFO(0, attachmentName) ZEND_ARG_INFO(0, attachment) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_removeheader, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_removeheader, 0, 1, Phalcon\\Http\\Response, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_removeheader, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_response_method_entry) { PHP_ME(Phalcon_Http_Response, __construct, arginfo_phalcon_http_response___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Http_Response, setDI, arginfo_phalcon_http_response_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, getDI, arginfo_phalcon_http_response_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setStatusCode, arginfo_phalcon_http_response_setstatuscode, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, getStatusCode, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, getReasonPhrase, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, getStatusCode, arginfo_phalcon_http_response_getstatuscode, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, getReasonPhrase, arginfo_phalcon_http_response_getreasonphrase, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setHeaders, arginfo_phalcon_http_response_setheaders, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, getHeaders, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, getHeaders, arginfo_phalcon_http_response_getheaders, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setCookies, arginfo_phalcon_http_response_setcookies, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, getCookies, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, getCookies, arginfo_phalcon_http_response_getcookies, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setHeader, arginfo_phalcon_http_response_setheader, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setRawHeader, arginfo_phalcon_http_response_setrawheader, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, resetHeaders, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, resetHeaders, arginfo_phalcon_http_response_resetheaders, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setExpires, arginfo_phalcon_http_response_setexpires, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setLastModified, arginfo_phalcon_http_response_setlastmodified, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setCache, arginfo_phalcon_http_response_setcache, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, setNotModified, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, setNotModified, arginfo_phalcon_http_response_setnotmodified, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setContentType, arginfo_phalcon_http_response_setcontenttype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setContentLength, arginfo_phalcon_http_response_setcontentlength, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setEtag, arginfo_phalcon_http_response_setetag, ZEND_ACC_PUBLIC) @@ -147,11 +359,11 @@ ZEPHIR_INIT_FUNCS(phalcon_http_response_method_entry) { PHP_ME(Phalcon_Http_Response, setContent, arginfo_phalcon_http_response_setcontent, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setJsonContent, arginfo_phalcon_http_response_setjsoncontent, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, appendContent, arginfo_phalcon_http_response_appendcontent, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, getContent, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, isSent, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, sendHeaders, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, sendCookies, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response, send, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, getContent, arginfo_phalcon_http_response_getcontent, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, isSent, arginfo_phalcon_http_response_issent, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, sendHeaders, arginfo_phalcon_http_response_sendheaders, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, sendCookies, arginfo_phalcon_http_response_sendcookies, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response, send, arginfo_phalcon_http_response_send, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, setFileToSend, arginfo_phalcon_http_response_setfiletosend, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response, removeHeader, arginfo_phalcon_http_response_removeheader, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/http/response/cookies.zep.c b/ext/phalcon/http/response/cookies.zep.c index e7b9628a566..e6b3436792f 100644 --- a/ext/phalcon/http/response/cookies.zep.c +++ b/ext/phalcon/http/response/cookies.zep.c @@ -97,9 +97,15 @@ ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Cookies) { PHP_METHOD(Phalcon_Http_Response_Cookies, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *signKey = NULL; - zval *useEncryption_param = NULL, *signKey_param = NULL, *_0; + zval signKey; + zval *useEncryption_param = NULL, *signKey_param = NULL, __$true, __$false, _0; zend_bool useEncryption; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&signKey); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &useEncryption_param, &signKey_param); @@ -110,22 +116,22 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, __construct) { useEncryption = zephir_get_boolval(useEncryption_param); } if (!signKey_param) { - ZEPHIR_INIT_VAR(signKey); - ZVAL_EMPTY_STRING(signKey); + ZEPHIR_INIT_VAR(&signKey); + ZVAL_STRING(&signKey, ""); } else { - zephir_get_strval(signKey, signKey_param); + zephir_get_strval(&signKey, signKey_param); } if (useEncryption) { - zephir_update_property_this(getThis(), SL("_useEncryption"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_useEncryption"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_useEncryption"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_useEncryption"), &__$false); } - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_cookies"), _0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setsignkey", NULL, 0, signKey); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_cookies"), &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setsignkey", NULL, 0, &signKey); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -144,20 +150,23 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, __construct) { PHP_METHOD(Phalcon_Http_Response_Cookies, setSignKey) { zval *signKey_param = NULL; - zval *signKey = NULL; + zval signKey; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&signKey); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &signKey_param); if (!signKey_param) { - ZEPHIR_INIT_VAR(signKey); - ZVAL_EMPTY_STRING(signKey); + ZEPHIR_INIT_VAR(&signKey); + ZVAL_STRING(&signKey, ""); } else { - zephir_get_strval(signKey, signKey_param); + zephir_get_strval(&signKey, signKey_param); } - zephir_update_property_this(getThis(), SL("signKey"), signKey TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("signKey"), &signKey); RETURN_THIS(); } @@ -167,13 +176,16 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, setSignKey) { */ PHP_METHOD(Phalcon_Http_Response_Cookies, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -182,7 +194,8 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, setDI) { */ PHP_METHOD(Phalcon_Http_Response_Cookies, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -193,8 +206,12 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, getDI) { */ PHP_METHOD(Phalcon_Http_Response_Cookies, useEncryption) { - zval *useEncryption_param = NULL; + zval *useEncryption_param = NULL, __$true, __$false; zend_bool useEncryption; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &useEncryption_param); @@ -202,9 +219,9 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, useEncryption) { if (useEncryption) { - zephir_update_property_this(getThis(), SL("_useEncryption"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_useEncryption"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_useEncryption"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_useEncryption"), &__$false); } RETURN_THISW(); @@ -215,7 +232,8 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, useEncryption) { */ PHP_METHOD(Phalcon_Http_Response_Cookies, isUsingEncryption) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_useEncryption"); @@ -242,27 +260,53 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, isUsingEncryption) { */ PHP_METHOD(Phalcon_Http_Response_Cookies, set) { - zval *_3$$3; + zval _3$$3; zend_bool secure, httpOnly; zend_long expire, ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *value = NULL, *expire_param = NULL, *path_param = NULL, *secure_param = NULL, *domain_param = NULL, *httpOnly_param = NULL, *cookie = NULL, *encryption = NULL, *dependencyInjector = NULL, *response = NULL, *_0, *_10, *_1$$3, *_2$$3 = NULL, *_4$$3 = NULL, *_5$$3, *_6$$4, *_7$$5 = NULL, *_8$$5, *_9$$5, *_11$$6; - zval *name = NULL, *path = NULL, *domain = NULL; + zval *name_param = NULL, *value = NULL, value_sub, *expire_param = NULL, *path_param = NULL, *secure_param = NULL, *domain_param = NULL, *httpOnly_param = NULL, __$true, __$false, __$null, cookie, encryption, dependencyInjector, response, _0, _10, _1$$3, _2$$3, _4$$3, _5$$3, _6$$4, _7$$5, _8$$5, _9$$5, _11$$6; + zval name, path, domain; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&value_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&cookie); + ZVAL_UNDEF(&encryption); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_11$$6); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 6, &name_param, &value, &expire_param, &path_param, &secure_param, &domain_param, &httpOnly_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!value) { - value = ZEPHIR_GLOBAL(global_null); + value = &value_sub; + value = &__$null; } if (!expire_param) { expire = 0; @@ -270,10 +314,10 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, set) { expire = zephir_get_intval(expire_param); } if (!path_param) { - ZEPHIR_INIT_VAR(path); - ZVAL_STRING(path, "/", 1); + ZEPHIR_INIT_VAR(&path); + ZVAL_STRING(&path, "/"); } else { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } if (!secure_param) { secure = 0; @@ -281,18 +325,18 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, set) { secure = zephir_get_boolval(secure_param); } if (!domain_param) { - ZEPHIR_INIT_VAR(domain); - ZVAL_EMPTY_STRING(domain); + ZEPHIR_INIT_VAR(&domain); + ZVAL_STRING(&domain, ""); } else { if (UNEXPECTED(Z_TYPE_P(domain_param) != IS_STRING && Z_TYPE_P(domain_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'domain' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'domain' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(domain_param) == IS_STRING)) { - zephir_get_strval(domain, domain_param); + zephir_get_strval(&domain, domain_param); } else { - ZEPHIR_INIT_VAR(domain); - ZVAL_EMPTY_STRING(domain); + ZEPHIR_INIT_VAR(&domain); + ZVAL_EMPTY_STRING(&domain); } } if (!httpOnly_param) { @@ -302,94 +346,89 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, set) { } - ZEPHIR_OBS_VAR(encryption); - zephir_read_property_this(&encryption, this_ptr, SL("_useEncryption"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(cookie); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_cookies"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&cookie, _0, name, 0 TSRMLS_CC))) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_3$$3); - zephir_create_array(_3$$3, 7, 0 TSRMLS_CC); - zephir_array_fast_append(_3$$3, name); - zephir_array_fast_append(_3$$3, value); - ZEPHIR_INIT_VAR(_4$$3); - ZVAL_LONG(_4$$3, expire); - zephir_array_fast_append(_3$$3, _4$$3); - zephir_array_fast_append(_3$$3, path); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_BOOL(_4$$3, secure); - zephir_array_fast_append(_3$$3, _4$$3); - zephir_array_fast_append(_3$$3, domain); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_BOOL(_4$$3, httpOnly); - zephir_array_fast_append(_3$$3, _4$$3); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_STRING(_4$$3, "Phalcon\\Http\\Cookie", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2$$3, _1$$3, "get", NULL, 0, _4$$3, _3$$3); - zephir_check_temp_parameter(_4$$3); + ZEPHIR_OBS_VAR(&encryption); + zephir_read_property(&encryption, this_ptr, SL("_useEncryption"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&cookie); + zephir_read_property(&_0, this_ptr, SL("_cookies"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&cookie, &_0, &name, 0 TSRMLS_CC))) { + zephir_read_property(&_1$$3, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_3$$3); + zephir_create_array(&_3$$3, 7, 0 TSRMLS_CC); + zephir_array_fast_append(&_3$$3, &name); + zephir_array_fast_append(&_3$$3, value); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_LONG(&_4$$3, expire); + zephir_array_fast_append(&_3$$3, &_4$$3); + zephir_array_fast_append(&_3$$3, &path); + ZEPHIR_INIT_NVAR(&_4$$3); + ZVAL_BOOL(&_4$$3, secure); + zephir_array_fast_append(&_3$$3, &_4$$3); + zephir_array_fast_append(&_3$$3, &domain); + ZEPHIR_INIT_NVAR(&_4$$3); + ZVAL_BOOL(&_4$$3, httpOnly); + zephir_array_fast_append(&_3$$3, &_4$$3); + ZEPHIR_INIT_NVAR(&_4$$3); + ZVAL_STRING(&_4$$3, "Phalcon\\Http\\Cookie"); + ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "get", NULL, 0, &_4$$3, &_3$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(cookie, _2$$3); - _5$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, cookie, "setdi", NULL, 0, _5$$3); + ZEPHIR_CPY_WRT(&cookie, &_2$$3); + zephir_read_property(&_5$$3, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &cookie, "setdi", NULL, 0, &_5$$3); zephir_check_call_status(); - if (zephir_is_true(encryption)) { - ZEPHIR_CALL_METHOD(NULL, cookie, "useencryption", NULL, 0, encryption); + if (zephir_is_true(&encryption)) { + ZEPHIR_CALL_METHOD(NULL, &cookie, "useencryption", NULL, 0, &encryption); zephir_check_call_status(); - _6$$4 = zephir_fetch_nproperty_this(this_ptr, SL("signKey"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, cookie, "setsignkey", NULL, 0, _6$$4); + zephir_read_property(&_6$$4, this_ptr, SL("signKey"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &cookie, "setsignkey", NULL, 0, &_6$$4); zephir_check_call_status(); } - zephir_update_property_array(this_ptr, SL("_cookies"), name, cookie TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_cookies"), &name, &cookie TSRMLS_CC); } else { - ZEPHIR_CALL_METHOD(NULL, cookie, "setvalue", NULL, 0, value); + ZEPHIR_CALL_METHOD(NULL, &cookie, "setvalue", NULL, 0, value); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_7$$5); - ZVAL_LONG(_7$$5, expire); - ZEPHIR_CALL_METHOD(NULL, cookie, "setexpiration", NULL, 0, _7$$5); + ZVAL_LONG(&_7$$5, expire); + ZEPHIR_CALL_METHOD(NULL, &cookie, "setexpiration", NULL, 0, &_7$$5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, cookie, "setpath", NULL, 0, path); + ZEPHIR_CALL_METHOD(NULL, &cookie, "setpath", NULL, 0, &path); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_7$$5); if (secure) { - ZVAL_BOOL(_7$$5, 1); + ZVAL_BOOL(&_7$$5, 1); } else { - ZVAL_BOOL(_7$$5, 0); + ZVAL_BOOL(&_7$$5, 0); } - ZEPHIR_CALL_METHOD(NULL, cookie, "setsecure", NULL, 0, _7$$5); + ZEPHIR_CALL_METHOD(NULL, &cookie, "setsecure", NULL, 0, &_7$$5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, cookie, "setdomain", NULL, 0, domain); + ZEPHIR_CALL_METHOD(NULL, &cookie, "setdomain", NULL, 0, &domain); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_8$$5); if (httpOnly) { - ZVAL_BOOL(_8$$5, 1); + ZVAL_BOOL(&_8$$5, 1); } else { - ZVAL_BOOL(_8$$5, 0); + ZVAL_BOOL(&_8$$5, 0); } - ZEPHIR_CALL_METHOD(NULL, cookie, "sethttponly", NULL, 0, _8$$5); + ZEPHIR_CALL_METHOD(NULL, &cookie, "sethttponly", NULL, 0, &_8$$5); zephir_check_call_status(); - _9$$5 = zephir_fetch_nproperty_this(this_ptr, SL("signKey"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, cookie, "setsignkey", NULL, 0, _9$$5); + zephir_read_property(&_9$$5, this_ptr, SL("signKey"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &cookie, "setsignkey", NULL, 0, &_9$$5); zephir_check_call_status(); } - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_registered"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_10)) { - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_10, this_ptr, SL("_registered"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_10)) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_http_cookie_exception_ce, "A dependency injection object is required to access the 'response' service", "phalcon/http/response/cookies.zep", 228); return; } - ZEPHIR_INIT_VAR(_11$$6); - ZVAL_STRING(_11$$6, "response", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&response, dependencyInjector, "getshared", NULL, 0, _11$$6); - zephir_check_temp_parameter(_11$$6); + ZEPHIR_INIT_VAR(&_11$$6); + ZVAL_STRING(&_11$$6, "response"); + ZEPHIR_CALL_METHOD(&response, &dependencyInjector, "getshared", NULL, 0, &_11$$6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, response, "setcookies", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(NULL, &response, "setcookies", NULL, 0, this_ptr); zephir_check_call_status(); if (1) { - zephir_update_property_this(getThis(), SL("_registered"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_registered"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_registered"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_registered"), &__$false); } } RETURN_THIS(); @@ -401,57 +440,68 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, set) { */ PHP_METHOD(Phalcon_Http_Response_Cookies, get) { - zval *_3; + zval _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *dependencyInjector = NULL, *encryption = NULL, *cookie = NULL, *_0, *_1, *_2 = NULL, *_4, *_5$$5; - zval *name = NULL; + zval *name_param = NULL, dependencyInjector, encryption, cookie, _0, _1, _2, _4, _5$$5; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&encryption); + ZVAL_UNDEF(&cookie); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(cookie); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_cookies"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&cookie, _0, name, 0 TSRMLS_CC)) { - RETURN_CCTOR(cookie); + ZEPHIR_OBS_VAR(&cookie); + zephir_read_property(&_0, this_ptr, SL("_cookies"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&cookie, &_0, &name, 0 TSRMLS_CC)) { + RETURN_CCTOR(&cookie); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_3); - zephir_create_array(_3, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_3, name); - ZEPHIR_INIT_VAR(_4); - ZVAL_STRING(_4, "Phalcon\\Http\\Cookie", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, _1, "get", NULL, 0, _4, _3); - zephir_check_temp_parameter(_4); + zephir_read_property(&_1, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_3); + zephir_create_array(&_3, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_3, &name); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "Phalcon\\Http\\Cookie"); + ZEPHIR_CALL_METHOD(&_2, &_1, "get", NULL, 0, &_4, &_3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(cookie, _2); - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(NULL, cookie, "setdi", NULL, 0, dependencyInjector); + ZEPHIR_CPY_WRT(&cookie, &_2); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(NULL, &cookie, "setdi", NULL, 0, &dependencyInjector); zephir_check_call_status(); - ZEPHIR_OBS_VAR(encryption); - zephir_read_property_this(&encryption, this_ptr, SL("_useEncryption"), PH_NOISY_CC); - if (zephir_is_true(encryption)) { - ZEPHIR_CALL_METHOD(NULL, cookie, "useencryption", NULL, 0, encryption); + ZEPHIR_OBS_VAR(&encryption); + zephir_read_property(&encryption, this_ptr, SL("_useEncryption"), PH_NOISY_CC); + if (zephir_is_true(&encryption)) { + ZEPHIR_CALL_METHOD(NULL, &cookie, "useencryption", NULL, 0, &encryption); zephir_check_call_status(); - _5$$5 = zephir_fetch_nproperty_this(this_ptr, SL("signKey"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, cookie, "setsignkey", NULL, 0, _5$$5); + zephir_read_property(&_5$$5, this_ptr, SL("signKey"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &cookie, "setsignkey", NULL, 0, &_5$$5); zephir_check_call_status(); } } - RETURN_CCTOR(cookie); + RETURN_CCTOR(&cookie); } @@ -460,30 +510,34 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, get) { */ PHP_METHOD(Phalcon_Http_Response_Cookies, has) { - zval *name_param = NULL, *_COOKIE, *_0; - zval *name = NULL; + zval *name_param = NULL, *_COOKIE, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - zephir_get_global(&_COOKIE, SS("_COOKIE") TSRMLS_CC); + zephir_get_global(&_COOKIE, SL("_COOKIE")); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_cookies"), PH_NOISY_CC); - if (zephir_array_isset(_0, name)) { + zephir_read_property(&_0, this_ptr, SL("_cookies"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_0, &name)) { RETURN_MM_BOOL(1); } - if (zephir_array_isset(_COOKIE, name)) { + if (zephir_array_isset(_COOKIE, &name)) { RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); @@ -497,28 +551,33 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, has) { PHP_METHOD(Phalcon_Http_Response_Cookies, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *cookie = NULL, *_0; - zval *name = NULL; + zval *name_param = NULL, cookie, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&cookie); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - ZEPHIR_OBS_VAR(cookie); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_cookies"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&cookie, _0, name, 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, cookie, "delete", NULL, 0); + ZEPHIR_OBS_VAR(&cookie); + zephir_read_property(&_0, this_ptr, SL("_cookies"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&cookie, &_0, &name, 0 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &cookie, "delete", NULL, 0); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -532,26 +591,29 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, delete) { */ PHP_METHOD(Phalcon_Http_Response_Cookies, send) { - HashTable *_3$$3; - HashPosition _2$$3; - zval *cookie = NULL, *_0 = NULL, *_1$$3, **_4$$3; + zval cookie, _0, _1$$3, *_2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cookie); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 28); + ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 23); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_cookies"), PH_NOISY_CC); - zephir_is_iterable(_1$$3, &_3$$3, &_2$$3, 0, 0, "phalcon/http/response/cookies.zep", 341); - for ( - ; zend_hash_get_current_data_ex(_3$$3, (void**) &_4$$3, &_2$$3) == SUCCESS - ; zend_hash_move_forward_ex(_3$$3, &_2$$3) - ) { - ZEPHIR_GET_HVALUE(cookie, _4$$3); - ZEPHIR_CALL_METHOD(NULL, cookie, "send", NULL, 0); + if (!(zephir_is_true(&_0))) { + zephir_read_property(&_1$$3, this_ptr, SL("_cookies"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_1$$3, 0, "phalcon/http/response/cookies.zep", 341); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_1$$3), _2$$3) + { + ZEPHIR_INIT_NVAR(&cookie); + ZVAL_COPY(&cookie, _2$$3); + ZEPHIR_CALL_METHOD(NULL, &cookie, "send", NULL, 0); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&cookie); RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); @@ -563,13 +625,16 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, send) { */ PHP_METHOD(Phalcon_Http_Response_Cookies, reset) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_cookies"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_cookies"), &_0); RETURN_THIS(); } diff --git a/ext/phalcon/http/response/cookies.zep.h b/ext/phalcon/http/response/cookies.zep.h index f2226125457..f77a550868d 100644 --- a/ext/phalcon/http/response/cookies.zep.h +++ b/ext/phalcon/http/response/cookies.zep.h @@ -17,56 +17,160 @@ PHP_METHOD(Phalcon_Http_Response_Cookies, send); PHP_METHOD(Phalcon_Http_Response_Cookies, reset); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookies___construct, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useEncryption, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useEncryption) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, signKey, IS_STRING, 1) +#else ZEND_ARG_INFO(0, signKey) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookies_setsignkey, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookies_setsignkey, 0, 0, Phalcon\\Http\\CookieInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_setsignkey, 0, 0, IS_OBJECT, "Phalcon\\Http\\CookieInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, signKey, IS_STRING, 1) +#else ZEND_ARG_INFO(0, signKey) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookies_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookies_useencryption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookies_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookies_useencryption, 0, 1, Phalcon\\Http\\Response\\CookiesInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_useencryption, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response\\CookiesInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useEncryption, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useEncryption) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_isusingencryption, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_isusingencryption, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookies_set, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookies_set, 0, 1, Phalcon\\Http\\Response\\CookiesInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_set, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response\\CookiesInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, value) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expire, IS_LONG, 0) +#else ZEND_ARG_INFO(0, expire) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, secure, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, secure) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 1) +#else ZEND_ARG_INFO(0, domain) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, httpOnly, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, httpOnly) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookies_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookies_get, 0, 1, Phalcon\\Http\\Response\\CookiesInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_get, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response\\CookiesInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookies_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookies_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_send, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_send, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookies_reset, 0, 0, Phalcon\\Http\\Response\\CookiesInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookies_reset, 0, 0, IS_OBJECT, "Phalcon\\Http\\Response\\CookiesInterface", 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_response_cookies_method_entry) { PHP_ME(Phalcon_Http_Response_Cookies, __construct, arginfo_phalcon_http_response_cookies___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Http_Response_Cookies, setSignKey, arginfo_phalcon_http_response_cookies_setsignkey, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Cookies, setDI, arginfo_phalcon_http_response_cookies_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response_Cookies, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response_Cookies, getDI, arginfo_phalcon_http_response_cookies_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Cookies, useEncryption, arginfo_phalcon_http_response_cookies_useencryption, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response_Cookies, isUsingEncryption, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response_Cookies, isUsingEncryption, arginfo_phalcon_http_response_cookies_isusingencryption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Cookies, set, arginfo_phalcon_http_response_cookies_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Cookies, get, arginfo_phalcon_http_response_cookies_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Cookies, has, arginfo_phalcon_http_response_cookies_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Cookies, delete, arginfo_phalcon_http_response_cookies_delete, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response_Cookies, send, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response_Cookies, reset, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response_Cookies, send, arginfo_phalcon_http_response_cookies_send, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response_Cookies, reset, arginfo_phalcon_http_response_cookies_reset, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/http/response/cookiesinterface.zep.h b/ext/phalcon/http/response/cookiesinterface.zep.h index 98757598de6..82addb2f89f 100644 --- a/ext/phalcon/http/response/cookiesinterface.zep.h +++ b/ext/phalcon/http/response/cookiesinterface.zep.h @@ -3,40 +3,121 @@ extern zend_class_entry *phalcon_http_response_cookiesinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Http_Response_CookiesInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_useencryption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_useencryption, 0, 1, Phalcon\\Http\\Response\\CookiesInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_useencryption, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response\\CookiesInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useEncryption, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useEncryption) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_set, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_isusingencryption, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_isusingencryption, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_set, 0, 1, Phalcon\\Http\\Response\\CookiesInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_set, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response\\CookiesInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, value) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expire, IS_LONG, 0) +#else ZEND_ARG_INFO(0, expire) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, secure, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, secure) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 1) +#else ZEND_ARG_INFO(0, domain) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, httpOnly, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, httpOnly) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_get, 0, 1, Phalcon\\Http\\Response\\CookiesInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_get, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response\\CookiesInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_delete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_delete, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_delete, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_send, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_send, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_reset, 0, 0, Phalcon\\Http\\Response\\CookiesInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_cookiesinterface_reset, 0, 0, IS_OBJECT, "Phalcon\\Http\\Response\\CookiesInterface", 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_response_cookiesinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, useEncryption, arginfo_phalcon_http_response_cookiesinterface_useencryption) - PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, isUsingEncryption, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, isUsingEncryption, arginfo_phalcon_http_response_cookiesinterface_isusingencryption) PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, set, arginfo_phalcon_http_response_cookiesinterface_set) PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, get, arginfo_phalcon_http_response_cookiesinterface_get) PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, has, arginfo_phalcon_http_response_cookiesinterface_has) PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, delete, arginfo_phalcon_http_response_cookiesinterface_delete) - PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, send, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, reset, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, send, arginfo_phalcon_http_response_cookiesinterface_send) + PHP_ABSTRACT_ME(Phalcon_Http_Response_CookiesInterface, reset, arginfo_phalcon_http_response_cookiesinterface_reset) PHP_FE_END }; diff --git a/ext/phalcon/http/response/headers.zep.c b/ext/phalcon/http/response/headers.zep.c index d95f21aebda..7d55e657dcf 100644 --- a/ext/phalcon/http/response/headers.zep.c +++ b/ext/phalcon/http/response/headers.zep.c @@ -47,16 +47,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Http_Response_Headers) { PHP_METHOD(Phalcon_Http_Response_Headers, set) { zval *name_param = NULL, *value_param = NULL; - zval *name = NULL, *value = NULL; + zval name, value; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &value_param); - zephir_get_strval(name, name_param); - zephir_get_strval(value, value_param); + zephir_get_strval(&name, name_param); + zephir_get_strval(&value, value_param); - zephir_update_property_array(this_ptr, SL("_headers"), name, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_headers"), &name, &value TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -66,18 +70,23 @@ PHP_METHOD(Phalcon_Http_Response_Headers, set) { */ PHP_METHOD(Phalcon_Http_Response_Headers, get) { - zval *name_param = NULL, *headers = NULL, *headerValue = NULL; - zval *name = NULL; + zval *name_param = NULL, headers, headerValue; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&headers); + ZVAL_UNDEF(&headerValue); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - headers = zephir_fetch_nproperty_this(this_ptr, SL("_headers"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&headerValue, headers, name, 1 TSRMLS_CC)) { - RETURN_CTOR(headerValue); + zephir_read_property(&headers, this_ptr, SL("_headers"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&headerValue, &headers, &name, 1 TSRMLS_CC)) { + RETURN_CTOR(&headerValue); } RETURN_MM_BOOL(0); @@ -88,16 +97,20 @@ PHP_METHOD(Phalcon_Http_Response_Headers, get) { */ PHP_METHOD(Phalcon_Http_Response_Headers, setRaw) { - zval *header_param = NULL; - zval *header = NULL; + zval *header_param = NULL, __$null; + zval header; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&header); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &header_param); - zephir_get_strval(header, header_param); + zephir_get_strval(&header, header_param); - zephir_update_property_array(this_ptr, SL("_headers"), header, ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_headers"), &header, &__$null TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -107,19 +120,23 @@ PHP_METHOD(Phalcon_Http_Response_Headers, setRaw) { */ PHP_METHOD(Phalcon_Http_Response_Headers, remove) { - zval *header_param = NULL, *headers = NULL; - zval *header = NULL; + zval *header_param = NULL, headers; + zval header; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&header); + ZVAL_UNDEF(&headers); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &header_param); - zephir_get_strval(header, header_param); + zephir_get_strval(&header, header_param); - ZEPHIR_OBS_VAR(headers); - zephir_read_property_this(&headers, this_ptr, SL("_headers"), PH_NOISY_CC); - zephir_array_unset(&headers, header, PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_headers"), headers TSRMLS_CC); + ZEPHIR_OBS_VAR(&headers); + zephir_read_property(&headers, this_ptr, SL("_headers"), PH_NOISY_CC); + zephir_array_unset(&headers, &header, PH_SEPARATE); + zephir_update_property_zval(this_ptr, SL("_headers"), &headers); ZEPHIR_MM_RESTORE(); } @@ -130,52 +147,68 @@ PHP_METHOD(Phalcon_Http_Response_Headers, remove) { PHP_METHOD(Phalcon_Http_Response_Headers, send) { zend_bool _7$$6; - HashTable *_3$$3; - HashPosition _2$$3; - zval *header = NULL, *value = NULL, *_0 = NULL, *_1$$3, **_4$$3, *_5$$5 = NULL, _8$$6 = zval_used_for_init, _9$$6 = zval_used_for_init, *_10$$6 = NULL, *_11$$8 = NULL; + zend_string *_4$$3; + zend_ulong _3$$3; zephir_fcall_cache_entry *_6 = NULL; + zval __$true, header, value, _0, _1$$3, *_2$$3, _5$$5, _8$$6, _9$$6, _10$$6, _11$$8; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&header); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_10$$6); + ZVAL_UNDEF(&_11$$8); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 28); + ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 23); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_headers"), PH_NOISY_CC); - zephir_is_iterable(_1$$3, &_3$$3, &_2$$3, 0, 0, "phalcon/http/response/headers.zep", 94); - for ( - ; zend_hash_get_current_data_ex(_3$$3, (void**) &_4$$3, &_2$$3) == SUCCESS - ; zend_hash_move_forward_ex(_3$$3, &_2$$3) - ) { - ZEPHIR_GET_HMKEY(header, _3$$3, _2$$3); - ZEPHIR_GET_HVALUE(value, _4$$3); - if (Z_TYPE_P(value) != IS_NULL) { + if (!(zephir_is_true(&_0))) { + zephir_read_property(&_1$$3, this_ptr, SL("_headers"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_1$$3, 0, "phalcon/http/response/headers.zep", 94); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_1$$3), _3$$3, _4$$3, _2$$3) + { + ZEPHIR_INIT_NVAR(&header); + if (_4$$3 != NULL) { + ZVAL_STR_COPY(&header, _4$$3); + } else { + ZVAL_LONG(&header, _3$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _2$$3); + if (Z_TYPE_P(&value) != IS_NULL) { ZEPHIR_INIT_LNVAR(_5$$5); - ZEPHIR_CONCAT_VSV(_5$$5, header, ": ", value); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_6, 262, _5$$5, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CONCAT_VSV(&_5$$5, &header, ": ", &value); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_6, 224, &_5$$5, &__$true); zephir_check_call_status(); } else { - _7$$6 = zephir_memnstr_str(header, SL(":"), "phalcon/http/response/headers.zep", 87); + _7$$6 = zephir_memnstr_str(&header, SL(":"), "phalcon/http/response/headers.zep", 87); if (!(_7$$6)) { - ZEPHIR_SINIT_NVAR(_8$$6); ZVAL_LONG(&_8$$6, 0); - ZEPHIR_SINIT_NVAR(_9$$6); ZVAL_LONG(&_9$$6, 5); - ZEPHIR_INIT_NVAR(_10$$6); - zephir_substr(_10$$6, header, 0 , 5 , 0); - _7$$6 = ZEPHIR_IS_STRING(_10$$6, "HTTP/"); + ZEPHIR_INIT_NVAR(&_10$$6); + zephir_substr(&_10$$6, &header, 0 , 5 , 0); + _7$$6 = ZEPHIR_IS_STRING(&_10$$6, "HTTP/"); } if (_7$$6) { - ZEPHIR_CALL_FUNCTION(NULL, "header", &_6, 262, header, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_6, 224, &header, &__$true); zephir_check_call_status(); } else { ZEPHIR_INIT_LNVAR(_11$$8); - ZEPHIR_CONCAT_VS(_11$$8, header, ": "); - ZEPHIR_CALL_FUNCTION(NULL, "header", &_6, 262, _11$$8, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CONCAT_VS(&_11$$8, &header, ": "); + ZEPHIR_CALL_FUNCTION(NULL, "header", &_6, 224, &_11$$8, &__$true); zephir_check_call_status(); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&header); RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); @@ -187,13 +220,16 @@ PHP_METHOD(Phalcon_Http_Response_Headers, send) { */ PHP_METHOD(Phalcon_Http_Response_Headers, reset) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_headers"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_headers"), &_0); ZEPHIR_MM_RESTORE(); } @@ -203,7 +239,8 @@ PHP_METHOD(Phalcon_Http_Response_Headers, reset) { */ PHP_METHOD(Phalcon_Http_Response_Headers, toArray) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_headers"); @@ -214,70 +251,74 @@ PHP_METHOD(Phalcon_Http_Response_Headers, toArray) { */ PHP_METHOD(Phalcon_Http_Response_Headers, __set_state) { - HashTable *_1$$3; - HashPosition _0$$3; + zend_string *_2$$3; + zend_ulong _1$$3; zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *headers = NULL, *key = NULL, *value = NULL, *dataHeaders = NULL, **_2$$3; - zval *data = NULL; + zval *data_param = NULL, headers, key, value, dataHeaders, *_0$$3; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&headers); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&dataHeaders); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data_param); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); - ZEPHIR_INIT_VAR(headers); - object_init_ex(headers, phalcon_http_response_headers_ce); - if (zephir_has_constructor(headers TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, headers, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&headers); + object_init_ex(&headers, phalcon_http_response_headers_ce); + if (zephir_has_constructor(&headers TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &headers, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(dataHeaders); - if (zephir_array_isset_string_fetch(&dataHeaders, data, SS("_headers"), 0 TSRMLS_CC)) { - zephir_is_iterable(dataHeaders, &_1$$3, &_0$$3, 0, 0, "phalcon/http/response/headers.zep", 126); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(value, _2$$3); - ZEPHIR_CALL_METHOD(NULL, headers, "set", &_3, 263, key, value); + ZEPHIR_OBS_VAR(&dataHeaders); + if (zephir_array_isset_string_fetch(&dataHeaders, &data, SL("_headers"), 0)) { + zephir_is_iterable(&dataHeaders, 0, "phalcon/http/response/headers.zep", 126); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&dataHeaders), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&key, _2$$3); + } else { + ZVAL_LONG(&key, _1$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0$$3); + ZEPHIR_CALL_METHOD(NULL, &headers, "set", &_3, 225, &key, &value); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } - RETURN_CCTOR(headers); + RETURN_CCTOR(&headers); } -zend_object_value zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_headers"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_headers"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_headers"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_headers"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/http/response/headers.zep.h b/ext/phalcon/http/response/headers.zep.h index 53af1e5c93b..3a1fa2196c5 100644 --- a/ext/phalcon/http/response/headers.zep.h +++ b/ext/phalcon/http/response/headers.zep.h @@ -11,26 +11,64 @@ PHP_METHOD(Phalcon_Http_Response_Headers, send); PHP_METHOD(Phalcon_Http_Response_Headers, reset); PHP_METHOD(Phalcon_Http_Response_Headers, toArray); PHP_METHOD(Phalcon_Http_Response_Headers, __set_state); -zend_object_value zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Http_Response_Headers(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_headers_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_headers_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_headers_setraw, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +#else ZEND_ARG_INFO(0, header) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_headers_remove, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +#else ZEND_ARG_INFO(0, header) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_headers___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_headers_send, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_headers_send, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_headers_toarray, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_headers_toarray, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_headers___set_state, 0, 1, Phalcon\\Http\\Response\\HeadersInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_headers___set_state, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response\\HeadersInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() @@ -39,9 +77,9 @@ ZEPHIR_INIT_FUNCS(phalcon_http_response_headers_method_entry) { PHP_ME(Phalcon_Http_Response_Headers, get, arginfo_phalcon_http_response_headers_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Headers, setRaw, arginfo_phalcon_http_response_headers_setraw, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Headers, remove, arginfo_phalcon_http_response_headers_remove, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response_Headers, send, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response_Headers, send, arginfo_phalcon_http_response_headers_send, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Headers, reset, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Http_Response_Headers, toArray, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Http_Response_Headers, toArray, arginfo_phalcon_http_response_headers_toarray, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Http_Response_Headers, __set_state, arginfo_phalcon_http_response_headers___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/ext/phalcon/http/response/headersinterface.zep.h b/ext/phalcon/http/response/headersinterface.zep.h index 5897edc011b..51d1cf5699f 100644 --- a/ext/phalcon/http/response/headersinterface.zep.h +++ b/ext/phalcon/http/response/headersinterface.zep.h @@ -4,19 +4,46 @@ extern zend_class_entry *phalcon_http_response_headersinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Http_Response_HeadersInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_headersinterface_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) +#else ZEND_ARG_INFO(0, value) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_headersinterface_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_headersinterface_setraw, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +#else ZEND_ARG_INFO(0, header) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_response_headersinterface___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_headersinterface_send, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_headersinterface_send, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_response_headersinterface___set_state, 0, 1, Phalcon\\Http\\Response\\HeadersInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_response_headersinterface___set_state, 0, 1, IS_OBJECT, "Phalcon\\Http\\Response\\HeadersInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_END_ARG_INFO() @@ -24,7 +51,7 @@ ZEPHIR_INIT_FUNCS(phalcon_http_response_headersinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Http_Response_HeadersInterface, set, arginfo_phalcon_http_response_headersinterface_set) PHP_ABSTRACT_ME(Phalcon_Http_Response_HeadersInterface, get, arginfo_phalcon_http_response_headersinterface_get) PHP_ABSTRACT_ME(Phalcon_Http_Response_HeadersInterface, setRaw, arginfo_phalcon_http_response_headersinterface_setraw) - PHP_ABSTRACT_ME(Phalcon_Http_Response_HeadersInterface, send, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_Response_HeadersInterface, send, arginfo_phalcon_http_response_headersinterface_send) PHP_ABSTRACT_ME(Phalcon_Http_Response_HeadersInterface, reset, NULL) ZEND_FENTRY(__set_state, NULL, arginfo_phalcon_http_response_headersinterface___set_state, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/http/responseinterface.zep.h b/ext/phalcon/http/responseinterface.zep.h index c4bd68496c2..15f48298db5 100644 --- a/ext/phalcon/http/responseinterface.zep.h +++ b/ext/phalcon/http/responseinterface.zep.h @@ -3,74 +3,207 @@ extern zend_class_entry *phalcon_http_responseinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Http_ResponseInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_setstatuscode, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setstatuscode, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setstatuscode, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) +#else ZEND_ARG_INFO(0, code) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 1) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_setheader, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_getheaders, 0, 0, Phalcon\\Http\\Response\\HeadersInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_getheaders, 0, 0, IS_OBJECT, "Phalcon\\Http\\Response\\HeadersInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setheader, 0, 2, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setheader, 0, 2, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_setrawheader, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setrawheader, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setrawheader, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, header, IS_STRING, 0) +#else ZEND_ARG_INFO(0, header) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_resetheaders, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_resetheaders, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_setexpires, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setexpires, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setexpires, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, datetime, DateTime, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_setcontenttype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setnotmodified, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setnotmodified, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setcontenttype, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setcontenttype, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, contentType, IS_STRING, 0) +#else ZEND_ARG_INFO(0, contentType) +#endif ZEND_ARG_INFO(0, charset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_setcontentlength, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setcontentlength, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setcontentlength, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, contentLength, IS_LONG, 0) +#else ZEND_ARG_INFO(0, contentLength) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_redirect, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_redirect, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_redirect, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_ARG_INFO(0, location) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, externalRedirect, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, externalRedirect) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, statusCode, IS_LONG, 0) +#else ZEND_ARG_INFO(0, statusCode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_setcontent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setcontent, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setcontent, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_setjsoncontent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setjsoncontent, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setjsoncontent, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_ARG_INFO(0, content) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_appendcontent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_appendcontent, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_appendcontent, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif ZEND_ARG_INFO(0, content) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_http_responseinterface_setfiletosend, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_getcontent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_getcontent, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_sendheaders, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_sendheaders, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_sendcookies, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_sendcookies, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_send, 0, 0, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_send, 0, 0, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_http_responseinterface_setfiletosend, 0, 1, Phalcon\\Http\\ResponseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_http_responseinterface_setfiletosend, 0, 1, IS_OBJECT, "Phalcon\\Http\\ResponseInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, filePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, filePath) +#endif ZEND_ARG_INFO(0, attachmentName) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_http_responseinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setStatusCode, arginfo_phalcon_http_responseinterface_setstatuscode) - PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, getHeaders, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, getHeaders, arginfo_phalcon_http_responseinterface_getheaders) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setHeader, arginfo_phalcon_http_responseinterface_setheader) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setRawHeader, arginfo_phalcon_http_responseinterface_setrawheader) - PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, resetHeaders, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, resetHeaders, arginfo_phalcon_http_responseinterface_resetheaders) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setExpires, arginfo_phalcon_http_responseinterface_setexpires) - PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setNotModified, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setNotModified, arginfo_phalcon_http_responseinterface_setnotmodified) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setContentType, arginfo_phalcon_http_responseinterface_setcontenttype) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setContentLength, arginfo_phalcon_http_responseinterface_setcontentlength) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, redirect, arginfo_phalcon_http_responseinterface_redirect) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setContent, arginfo_phalcon_http_responseinterface_setcontent) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setJsonContent, arginfo_phalcon_http_responseinterface_setjsoncontent) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, appendContent, arginfo_phalcon_http_responseinterface_appendcontent) - PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, getContent, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, sendHeaders, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, sendCookies, NULL) - PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, send, NULL) + PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, getContent, arginfo_phalcon_http_responseinterface_getcontent) + PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, sendHeaders, arginfo_phalcon_http_responseinterface_sendheaders) + PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, sendCookies, arginfo_phalcon_http_responseinterface_sendcookies) + PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, send, arginfo_phalcon_http_responseinterface_send) PHP_ABSTRACT_ME(Phalcon_Http_ResponseInterface, setFileToSend, arginfo_phalcon_http_responseinterface_setfiletosend) PHP_FE_END }; diff --git a/ext/phalcon/image.zep.c b/ext/phalcon/image.zep.c index 516f0b5dd72..ae5b0deb184 100644 --- a/ext/phalcon/image.zep.c +++ b/ext/phalcon/image.zep.c @@ -18,23 +18,23 @@ ZEPHIR_INIT_CLASS(Phalcon_Image) { ZEPHIR_REGISTER_CLASS(Phalcon, Image, phalcon, image, NULL, 0); - zend_declare_class_constant_long(phalcon_image_ce, SL("NONE"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_image_ce, SL("NONE"), 1); - zend_declare_class_constant_long(phalcon_image_ce, SL("WIDTH"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_image_ce, SL("WIDTH"), 2); - zend_declare_class_constant_long(phalcon_image_ce, SL("HEIGHT"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_image_ce, SL("HEIGHT"), 3); - zend_declare_class_constant_long(phalcon_image_ce, SL("AUTO"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_image_ce, SL("AUTO"), 4); - zend_declare_class_constant_long(phalcon_image_ce, SL("INVERSE"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_image_ce, SL("INVERSE"), 5); - zend_declare_class_constant_long(phalcon_image_ce, SL("PRECISE"), 6 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_image_ce, SL("PRECISE"), 6); - zend_declare_class_constant_long(phalcon_image_ce, SL("TENSILE"), 7 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_image_ce, SL("TENSILE"), 7); - zend_declare_class_constant_long(phalcon_image_ce, SL("HORIZONTAL"), 11 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_image_ce, SL("HORIZONTAL"), 11); - zend_declare_class_constant_long(phalcon_image_ce, SL("VERTICAL"), 12 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_image_ce, SL("VERTICAL"), 12); return SUCCESS; diff --git a/ext/phalcon/image/adapter.zep.c b/ext/phalcon/image/adapter.zep.c index db41b56b540..4d340a105f2 100644 --- a/ext/phalcon/image/adapter.zep.c +++ b/ext/phalcon/image/adapter.zep.c @@ -76,7 +76,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter) { PHP_METHOD(Phalcon_Image_Adapter, getImage) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_image"); @@ -84,7 +85,8 @@ PHP_METHOD(Phalcon_Image_Adapter, getImage) { PHP_METHOD(Phalcon_Image_Adapter, getRealpath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_realpath"); @@ -95,7 +97,8 @@ PHP_METHOD(Phalcon_Image_Adapter, getRealpath) { */ PHP_METHOD(Phalcon_Image_Adapter, getWidth) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_width"); @@ -106,7 +109,8 @@ PHP_METHOD(Phalcon_Image_Adapter, getWidth) { */ PHP_METHOD(Phalcon_Image_Adapter, getHeight) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_height"); @@ -121,7 +125,8 @@ PHP_METHOD(Phalcon_Image_Adapter, getHeight) { */ PHP_METHOD(Phalcon_Image_Adapter, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -132,7 +137,8 @@ PHP_METHOD(Phalcon_Image_Adapter, getType) { */ PHP_METHOD(Phalcon_Image_Adapter, getMime) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_mime"); @@ -145,8 +151,37 @@ PHP_METHOD(Phalcon_Image_Adapter, resize) { zend_bool _0$$3, _1$$6, _5$$8, _13$$14; double ratio = 0; - zval *width_param = NULL, *height_param = NULL, *master_param = NULL, *_23, _24, *_25 = NULL, *_26 = NULL, _27, *_28 = NULL, *_29 = NULL, *_30, *_2$$6 = NULL, *_3$$6, *_4$$6, *_6$$8 = NULL, *_7$$8, *_8$$8, *_9$$10, *_10$$10, *_11$$12, *_12$$12, *_14$$14, *_15$$14, *_16$$14, *_17$$16, *_18$$16, *_19$$17, *_20$$17, *_21$$19, *_22$$20; + zval *width_param = NULL, *height_param = NULL, *master_param = NULL, _23, _24, _25, _26, _27, _28, _29, _30, _2$$6, _3$$6, _4$$6, _6$$8, _7$$8, _8$$8, _9$$10, _10$$10, _11$$12, _12$$12, _14$$14, _15$$14, _16$$14, _17$$16, _18$$16, _19$$17, _20$$17, _21$$19, _22$$20; zend_long width, height, master, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_23); + ZVAL_UNDEF(&_24); + ZVAL_UNDEF(&_25); + ZVAL_UNDEF(&_26); + ZVAL_UNDEF(&_27); + ZVAL_UNDEF(&_28); + ZVAL_UNDEF(&_29); + ZVAL_UNDEF(&_30); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_10$$10); + ZVAL_UNDEF(&_11$$12); + ZVAL_UNDEF(&_12$$12); + ZVAL_UNDEF(&_14$$14); + ZVAL_UNDEF(&_15$$14); + ZVAL_UNDEF(&_16$$14); + ZVAL_UNDEF(&_17$$16); + ZVAL_UNDEF(&_18$$16); + ZVAL_UNDEF(&_19$$17); + ZVAL_UNDEF(&_20$$17); + ZVAL_UNDEF(&_21$$19); + ZVAL_UNDEF(&_22$$20); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &width_param, &height_param, &master_param); @@ -187,17 +222,17 @@ PHP_METHOD(Phalcon_Image_Adapter, resize) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/image/adapter.zep", 88); return; } - ZEPHIR_INIT_VAR(_2$$6); - _3$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _4$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - if ((zephir_safe_div_zval_long(_3$$6, width TSRMLS_CC)) > (int) (zephir_safe_div_zval_long(_4$$6, height TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_2$$6); - ZVAL_LONG(_2$$6, 2); + ZEPHIR_INIT_VAR(&_2$$6); + zephir_read_property(&_3$$6, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_4$$6, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + if ((zephir_safe_div_zval_long(&_3$$6, width TSRMLS_CC)) > (int) (zephir_safe_div_zval_long(&_4$$6, height TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_2$$6); + ZVAL_LONG(&_2$$6, 2); } else { - ZEPHIR_INIT_NVAR(_2$$6); - ZVAL_LONG(_2$$6, 3); + ZEPHIR_INIT_NVAR(&_2$$6); + ZVAL_LONG(&_2$$6, 3); } - master = zephir_get_numberval(_2$$6); + master = zephir_get_numberval(&_2$$6); } if (master == 5) { _5$$8 = !width; @@ -208,17 +243,17 @@ PHP_METHOD(Phalcon_Image_Adapter, resize) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/image/adapter.zep", 97); return; } - ZEPHIR_INIT_VAR(_6$$8); - _7$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _8$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - if ((zephir_safe_div_zval_long(_7$$8, width TSRMLS_CC)) > (int) (zephir_safe_div_zval_long(_8$$8, height TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_6$$8); - ZVAL_LONG(_6$$8, 3); + ZEPHIR_INIT_VAR(&_6$$8); + zephir_read_property(&_7$$8, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_8$$8, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + if ((zephir_safe_div_zval_long(&_7$$8, width TSRMLS_CC)) > (int) (zephir_safe_div_zval_long(&_8$$8, height TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_6$$8); + ZVAL_LONG(&_6$$8, 3); } else { - ZEPHIR_INIT_NVAR(_6$$8); - ZVAL_LONG(_6$$8, 2); + ZEPHIR_INIT_NVAR(&_6$$8); + ZVAL_LONG(&_6$$8, 2); } - master = zephir_get_numberval(_6$$8); + master = zephir_get_numberval(&_6$$8); } do { if (master == 2) { @@ -226,9 +261,9 @@ PHP_METHOD(Phalcon_Image_Adapter, resize) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width must be specified", "phalcon/image/adapter.zep", 107); return; } - _9$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - _10$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - height = (long) (zephir_safe_div_long_zval((zephir_get_numberval(_9$$10) * width), _10$$10 TSRMLS_CC)); + zephir_read_property(&_9$$10, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_10$$10, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + height = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_9$$10) * width), &_10$$10 TSRMLS_CC)); break; } if (master == 3) { @@ -236,9 +271,9 @@ PHP_METHOD(Phalcon_Image_Adapter, resize) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "height must be specified", "phalcon/image/adapter.zep", 114); return; } - _11$$12 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _12$$12 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - width = (long) (zephir_safe_div_long_zval((zephir_get_numberval(_11$$12) * height), _12$$12 TSRMLS_CC)); + zephir_read_property(&_11$$12, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_12$$12, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + width = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_11$$12) * height), &_12$$12 TSRMLS_CC)); break; } if (master == 6) { @@ -250,61 +285,55 @@ PHP_METHOD(Phalcon_Image_Adapter, resize) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "width and height must be specified", "phalcon/image/adapter.zep", 121); return; } - _14$$14 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _15$$14 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_16$$14); - div_function(_16$$14, _14$$14, _15$$14 TSRMLS_CC); - ratio = zephir_get_numberval(_16$$14); + zephir_read_property(&_14$$14, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_15$$14, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_16$$14); + div_function(&_16$$14, &_14$$14, &_15$$14 TSRMLS_CC); + ratio = zephir_get_numberval(&_16$$14); if ((zephir_safe_div_long_long(width, height TSRMLS_CC)) > ratio) { - _17$$16 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - _18$$16 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - height = (long) (zephir_safe_div_long_zval((zephir_get_numberval(_17$$16) * width), _18$$16 TSRMLS_CC)); + zephir_read_property(&_17$$16, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_18$$16, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + height = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_17$$16) * width), &_18$$16 TSRMLS_CC)); } else { - _19$$17 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _20$$17 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - width = (long) (zephir_safe_div_long_zval((zephir_get_numberval(_19$$17) * height), _20$$17 TSRMLS_CC)); + zephir_read_property(&_19$$17, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_20$$17, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + width = (long) (zephir_safe_div_long_zval((zephir_get_numberval(&_19$$17) * height), &_20$$17 TSRMLS_CC)); } break; } if (master == 1) { if (!(width)) { - ZEPHIR_OBS_VAR(_21$$19); - zephir_read_property_this(&_21$$19, this_ptr, SL("_width"), PH_NOISY_CC); - width = zephir_get_intval(_21$$19); + ZEPHIR_OBS_VAR(&_21$$19); + zephir_read_property(&_21$$19, this_ptr, SL("_width"), PH_NOISY_CC); + width = zephir_get_intval(&_21$$19); } if (!(height)) { - ZEPHIR_OBS_VAR(_22$$20); - zephir_read_property_this(&_22$$20, this_ptr, SL("_height"), PH_NOISY_CC); - width = zephir_get_intval(_22$$20); + ZEPHIR_OBS_VAR(&_22$$20); + zephir_read_property(&_22$$20, this_ptr, SL("_height"), PH_NOISY_CC); + width = zephir_get_intval(&_22$$20); } break; } } while(0); } - ZEPHIR_INIT_VAR(_23); - ZEPHIR_SINIT_VAR(_24); + ZEPHIR_INIT_VAR(&_23); ZVAL_LONG(&_24, width); - zephir_round(_23, &_24, NULL, NULL TSRMLS_CC); - ZEPHIR_INIT_VAR(_25); - ZVAL_LONG(_25, 1); - ZEPHIR_CALL_FUNCTION(&_26, "max", NULL, 75, _23, _25); + zephir_round(&_23, &_24, NULL, NULL TSRMLS_CC); + ZVAL_LONG(&_25, 1); + ZEPHIR_CALL_FUNCTION(&_26, "max", NULL, 68, &_23, &_25); zephir_check_call_status(); - width = zephir_get_intval(_26); - ZEPHIR_INIT_NVAR(_25); - ZEPHIR_SINIT_VAR(_27); - ZVAL_LONG(&_27, height); - zephir_round(_25, &_27, NULL, NULL TSRMLS_CC); - ZEPHIR_INIT_VAR(_28); - ZVAL_LONG(_28, 1); - ZEPHIR_CALL_FUNCTION(&_29, "max", NULL, 75, _25, _28); + width = zephir_get_intval(&_26); + ZEPHIR_INIT_VAR(&_27); + ZVAL_LONG(&_25, height); + zephir_round(&_27, &_25, NULL, NULL TSRMLS_CC); + ZVAL_LONG(&_28, 1); + ZEPHIR_CALL_FUNCTION(&_29, "max", NULL, 68, &_27, &_28); zephir_check_call_status(); - height = zephir_get_intval(_29); - ZEPHIR_INIT_NVAR(_28); - ZVAL_LONG(_28, width); - ZEPHIR_INIT_VAR(_30); - ZVAL_LONG(_30, height); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_resize", NULL, 0, _28, _30); + height = zephir_get_intval(&_29); + ZVAL_LONG(&_28, width); + ZVAL_LONG(&_30, height); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_resize", NULL, 0, &_28, &_30); zephir_check_call_status(); RETURN_THIS(); @@ -320,8 +349,14 @@ PHP_METHOD(Phalcon_Image_Adapter, resize) { */ PHP_METHOD(Phalcon_Image_Adapter, liquidRescale) { - zval *width_param = NULL, *height_param = NULL, *deltaX_param = NULL, *rigidity_param = NULL, *_0, *_1, *_2, *_3; + zval *width_param = NULL, *height_param = NULL, *deltaX_param = NULL, *rigidity_param = NULL, _0, _1, _2, _3; zend_long width, height, deltaX, rigidity, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 2, &width_param, &height_param, &deltaX_param, &rigidity_param); @@ -340,15 +375,11 @@ PHP_METHOD(Phalcon_Image_Adapter, liquidRescale) { } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, width); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, height); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, deltaX); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, rigidity); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_liquidrescale", NULL, 0, _0, _1, _2, _3); + ZVAL_LONG(&_0, width); + ZVAL_LONG(&_1, height); + ZVAL_LONG(&_2, deltaX); + ZVAL_LONG(&_3, rigidity); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_liquidrescale", NULL, 0, &_0, &_1, &_2, &_3); zephir_check_call_status(); RETURN_THIS(); @@ -359,8 +390,28 @@ PHP_METHOD(Phalcon_Image_Adapter, liquidRescale) { */ PHP_METHOD(Phalcon_Image_Adapter, crop) { - zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, _0, _5, *_10, *_12, *_14, *_15, *_16, *_17, *_1$$3, *_2$$5, *_3$$4, *_4$$6, *_6$$7, *_7$$9, *_8$$8, *_9$$10, *_11$$11, *_13$$12; + zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, _0, _5, _10, _12, _14, _15, _16, _17, _1$$3, _2$$5, _3$$4, _4$$6, _6$$7, _7$$9, _8$$8, _9$$10, _11$$11, _13$$12; zend_long width, height, offsetX, offsetY, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_15); + ZVAL_UNDEF(&_16); + ZVAL_UNDEF(&_17); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_11$$11); + ZVAL_UNDEF(&_13$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 2, &width_param, &height_param, &offsetX_param, &offsetY_param); @@ -379,59 +430,53 @@ PHP_METHOD(Phalcon_Image_Adapter, crop) { } - ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, offsetX); if (Z_TYPE_P(&_0) == IS_NULL) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - offsetX = (long) ((zephir_safe_div_long_long(((zephir_get_numberval(_1$$3) - width)), 2 TSRMLS_CC))); + zephir_read_property(&_1$$3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + offsetX = (long) ((zephir_safe_div_long_long(((zephir_get_numberval(&_1$$3) - width)), 2 TSRMLS_CC))); } else { if (offsetX < 0) { - _2$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - offsetX = ((zephir_get_numberval(_2$$5) - width) + offsetX); + zephir_read_property(&_2$$5, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + offsetX = ((zephir_get_numberval(&_2$$5) - width) + offsetX); } - _3$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - if (ZEPHIR_LT_LONG(_3$$4, offsetX)) { - ZEPHIR_OBS_VAR(_4$$6); - zephir_read_property_this(&_4$$6, this_ptr, SL("_width"), PH_NOISY_CC); - offsetX = zephir_get_intval(_4$$6); + zephir_read_property(&_3$$4, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_LT_LONG(&_3$$4, offsetX)) { + ZEPHIR_OBS_VAR(&_4$$6); + zephir_read_property(&_4$$6, this_ptr, SL("_width"), PH_NOISY_CC); + offsetX = zephir_get_intval(&_4$$6); } } - ZEPHIR_SINIT_VAR(_5); ZVAL_LONG(&_5, offsetY); if (Z_TYPE_P(&_5) == IS_NULL) { - _6$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - offsetY = (long) ((zephir_safe_div_long_long(((zephir_get_numberval(_6$$7) - height)), 2 TSRMLS_CC))); + zephir_read_property(&_6$$7, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + offsetY = (long) ((zephir_safe_div_long_long(((zephir_get_numberval(&_6$$7) - height)), 2 TSRMLS_CC))); } else { if (offsetY < 0) { - _7$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - offsetY = ((zephir_get_numberval(_7$$9) - height) + offsetY); + zephir_read_property(&_7$$9, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + offsetY = ((zephir_get_numberval(&_7$$9) - height) + offsetY); } - _8$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - if (ZEPHIR_LT_LONG(_8$$8, offsetY)) { - ZEPHIR_OBS_VAR(_9$$10); - zephir_read_property_this(&_9$$10, this_ptr, SL("_height"), PH_NOISY_CC); - offsetY = zephir_get_intval(_9$$10); + zephir_read_property(&_8$$8, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_LT_LONG(&_8$$8, offsetY)) { + ZEPHIR_OBS_VAR(&_9$$10); + zephir_read_property(&_9$$10, this_ptr, SL("_height"), PH_NOISY_CC); + offsetY = zephir_get_intval(&_9$$10); } } - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - if (width > ((zephir_get_numberval(_10) - offsetX))) { - _11$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - width = (zephir_get_numberval(_11$$11) - offsetX); - } - _12 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - if (height > ((zephir_get_numberval(_12) - offsetY))) { - _13$$12 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - height = (zephir_get_numberval(_13$$12) - offsetY); - } - ZEPHIR_INIT_VAR(_14); - ZVAL_LONG(_14, width); - ZEPHIR_INIT_VAR(_15); - ZVAL_LONG(_15, height); - ZEPHIR_INIT_VAR(_16); - ZVAL_LONG(_16, offsetX); - ZEPHIR_INIT_VAR(_17); - ZVAL_LONG(_17, offsetY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_crop", NULL, 0, _14, _15, _16, _17); + zephir_read_property(&_10, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + if (width > ((zephir_get_numberval(&_10) - offsetX))) { + zephir_read_property(&_11$$11, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + width = (zephir_get_numberval(&_11$$11) - offsetX); + } + zephir_read_property(&_12, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + if (height > ((zephir_get_numberval(&_12) - offsetY))) { + zephir_read_property(&_13$$12, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + height = (zephir_get_numberval(&_13$$12) - offsetY); + } + ZVAL_LONG(&_14, width); + ZVAL_LONG(&_15, height); + ZVAL_LONG(&_16, offsetX); + ZVAL_LONG(&_17, offsetY); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_crop", NULL, 0, &_14, &_15, &_16, &_17); zephir_check_call_status(); RETURN_THIS(); @@ -442,8 +487,11 @@ PHP_METHOD(Phalcon_Image_Adapter, crop) { */ PHP_METHOD(Phalcon_Image_Adapter, rotate) { - zval *degrees_param = NULL, *_0; + zval *degrees_param = NULL, _0; zend_long degrees, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, °rees_param); @@ -464,9 +512,8 @@ PHP_METHOD(Phalcon_Image_Adapter, rotate) { degrees += 360; } } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, degrees); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_rotate", NULL, 0, _0); + ZVAL_LONG(&_0, degrees); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_rotate", NULL, 0, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -478,8 +525,11 @@ PHP_METHOD(Phalcon_Image_Adapter, rotate) { PHP_METHOD(Phalcon_Image_Adapter, flip) { zend_bool _0; - zval *direction_param = NULL, *_1; + zval *direction_param = NULL, _1; zend_long direction, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &direction_param); @@ -494,9 +544,8 @@ PHP_METHOD(Phalcon_Image_Adapter, flip) { if (_0) { direction = 11; } - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, direction); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_flip", NULL, 0, _1); + ZVAL_LONG(&_1, direction); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_flip", NULL, 0, &_1); zephir_check_call_status(); RETURN_THIS(); @@ -507,8 +556,11 @@ PHP_METHOD(Phalcon_Image_Adapter, flip) { */ PHP_METHOD(Phalcon_Image_Adapter, sharpen) { - zval *amount_param = NULL, *_0; + zval *amount_param = NULL, _0; zend_long amount, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &amount_param); @@ -521,9 +573,8 @@ PHP_METHOD(Phalcon_Image_Adapter, sharpen) { } else if (amount < 1) { amount = 1; } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, amount); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_sharpen", NULL, 0, _0); + ZVAL_LONG(&_0, amount); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_sharpen", NULL, 0, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -535,8 +586,15 @@ PHP_METHOD(Phalcon_Image_Adapter, sharpen) { PHP_METHOD(Phalcon_Image_Adapter, reflection) { zend_bool fadeIn, _0; - zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, *_1, *_3, *_4, *_5, *_2$$3; + zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, _1, _3, _4, _5, _2$$3; zend_long height, opacity, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &height_param, &opacity_param, &fadeIn_param); @@ -556,30 +614,27 @@ PHP_METHOD(Phalcon_Image_Adapter, reflection) { _0 = height <= 0; if (!(_0)) { - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - _0 = ZEPHIR_LT_LONG(_1, height); + zephir_read_property(&_1, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + _0 = ZEPHIR_LT_LONG(&_1, height); } if (_0) { - ZEPHIR_OBS_VAR(_2$$3); - zephir_read_property_this(&_2$$3, this_ptr, SL("_height"), PH_NOISY_CC); - height = zephir_get_intval(_2$$3); + ZEPHIR_OBS_VAR(&_2$$3); + zephir_read_property(&_2$$3, this_ptr, SL("_height"), PH_NOISY_CC); + height = zephir_get_intval(&_2$$3); } if (opacity < 0) { opacity = 0; } else if (opacity > 100) { opacity = 100; } - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, height); - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, opacity); - ZEPHIR_INIT_VAR(_5); + ZVAL_LONG(&_3, height); + ZVAL_LONG(&_4, opacity); if (fadeIn) { - ZVAL_BOOL(_5, 1); + ZVAL_BOOL(&_5, 1); } else { - ZVAL_BOOL(_5, 0); + ZVAL_BOOL(&_5, 0); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_reflection", NULL, 0, _3, _4, _5); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_reflection", NULL, 0, &_3, &_4, &_5); zephir_check_call_status(); RETURN_THIS(); @@ -591,7 +646,16 @@ PHP_METHOD(Phalcon_Image_Adapter, reflection) { PHP_METHOD(Phalcon_Image_Adapter, watermark) { zend_long offsetX, offsetY, opacity, ZEPHIR_LAST_CALL_STATUS, tmp = 0; - zval *watermark, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, *_0, *_1 = NULL, *_2, *_3, *_4, *_5, *_6; + zval *watermark, watermark_sub, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, _0, _1, _2, _3, _4, _5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&watermark_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &watermark, &offsetX_param, &offsetY_param, &opacity_param); @@ -613,23 +677,23 @@ PHP_METHOD(Phalcon_Image_Adapter, watermark) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_1, watermark, "getwidth", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - zephir_sub_function(_2, _0, _1); - tmp = zephir_get_numberval(_2); + ZEPHIR_INIT_VAR(&_2); + zephir_sub_function(&_2, &_0, &_1); + tmp = zephir_get_numberval(&_2); if (offsetX < 0) { offsetX = 0; } else if (offsetX > tmp) { offsetX = tmp; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CALL_METHOD(&_1, watermark, "getheight", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - zephir_sub_function(_3, _0, _1); - tmp = zephir_get_numberval(_3); + ZEPHIR_INIT_VAR(&_3); + zephir_sub_function(&_3, &_0, &_1); + tmp = zephir_get_numberval(&_3); if (offsetY < 0) { offsetY = 0; } else if (offsetY > tmp) { @@ -640,13 +704,10 @@ PHP_METHOD(Phalcon_Image_Adapter, watermark) { } else if (opacity > 100) { opacity = 100; } - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, offsetX); - ZEPHIR_INIT_VAR(_5); - ZVAL_LONG(_5, offsetY); - ZEPHIR_INIT_VAR(_6); - ZVAL_LONG(_6, opacity); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_watermark", NULL, 0, watermark, _4, _5, _6); + ZVAL_LONG(&_0, offsetX); + ZVAL_LONG(&_4, offsetY); + ZVAL_LONG(&_5, opacity); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_watermark", NULL, 0, watermark, &_0, &_4, &_5); zephir_check_call_status(); RETURN_THIS(); @@ -659,18 +720,44 @@ PHP_METHOD(Phalcon_Image_Adapter, text) { zend_bool _0; zend_long opacity, size, ZEPHIR_LAST_CALL_STATUS; - zval *text_param = NULL, *offsetX = NULL, *offsetY = NULL, *opacity_param = NULL, *color_param = NULL, *size_param = NULL, *fontfile_param = NULL, *colors = NULL, _1, _2, *_3, _9 = zval_used_for_init, *_10 = NULL, *_11, *_12, *_13, *_14, *_15, _4$$6, *_5$$6, *_6$$7, *_7$$7, *_8$$7 = NULL; - zval *text = NULL, *color = NULL, *fontfile = NULL; + zval *text_param = NULL, *offsetX = NULL, offsetX_sub, *offsetY = NULL, offsetY_sub, *opacity_param = NULL, *color_param = NULL, *size_param = NULL, *fontfile_param = NULL, __$false, colors, _1, _2, _3, _9, _10, _11, _12, _13, _14, _15, _4$$6, _5$$6, _6$$7, _7$$7, _8$$7; + zval text, color, fontfile; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&color); + ZVAL_UNDEF(&fontfile); + ZVAL_UNDEF(&offsetX_sub); + ZVAL_UNDEF(&offsetY_sub); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&colors); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_15); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 6, &text_param, &offsetX, &offsetY, &opacity_param, &color_param, &size_param, &fontfile_param); - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); if (!offsetX) { - offsetX = ZEPHIR_GLOBAL(global_false); + offsetX = &offsetX_sub; + offsetX = &__$false; } if (!offsetY) { - offsetY = ZEPHIR_GLOBAL(global_false); + offsetY = &offsetY_sub; + offsetY = &__$false; } if (!opacity_param) { opacity = 100; @@ -678,10 +765,10 @@ PHP_METHOD(Phalcon_Image_Adapter, text) { opacity = zephir_get_intval(opacity_param); } if (!color_param) { - ZEPHIR_INIT_VAR(color); - ZVAL_STRING(color, "000000", 1); + ZEPHIR_INIT_VAR(&color); + ZVAL_STRING(&color, "000000"); } else { - zephir_get_strval(color, color_param); + zephir_get_strval(&color, color_param); } if (!size_param) { size = 12; @@ -689,10 +776,10 @@ PHP_METHOD(Phalcon_Image_Adapter, text) { size = zephir_get_intval(size_param); } if (!fontfile_param) { - ZEPHIR_INIT_VAR(fontfile); - ZVAL_EMPTY_STRING(fontfile); + ZEPHIR_INIT_VAR(&fontfile); + ZVAL_STRING(&fontfile, ""); } else { - zephir_get_strval(fontfile, fontfile_param); + zephir_get_strval(&fontfile, fontfile_param); } @@ -703,50 +790,42 @@ PHP_METHOD(Phalcon_Image_Adapter, text) { opacity = 100; } } - _0 = zephir_fast_strlen_ev(color) > 1; + _0 = zephir_fast_strlen_ev(&color) > 1; if (_0) { - ZEPHIR_SINIT_VAR(_1); ZVAL_LONG(&_1, 0); - ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, 1); - ZEPHIR_INIT_VAR(_3); - zephir_substr(_3, color, 0 , 1 , 0); - _0 = ZEPHIR_IS_STRING_IDENTICAL(_3, "#"); + ZEPHIR_INIT_VAR(&_3); + zephir_substr(&_3, &color, 0 , 1 , 0); + _0 = ZEPHIR_IS_STRING_IDENTICAL(&_3, "#"); } if (_0) { - ZEPHIR_SINIT_VAR(_4$$6); ZVAL_LONG(&_4$$6, 1); - ZEPHIR_INIT_VAR(_5$$6); - zephir_substr(_5$$6, color, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_get_strval(color, _5$$6); - } - if (zephir_fast_strlen_ev(color) == 3) { - ZEPHIR_INIT_VAR(_6$$7); - ZVAL_STRING(_6$$7, "/./", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_7$$7); - ZVAL_STRING(_7$$7, "$0$0", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_8$$7, "preg_replace", NULL, 42, _6$$7, _7$$7, color); - zephir_check_temp_parameter(_6$$7); - zephir_check_temp_parameter(_7$$7); + ZEPHIR_INIT_VAR(&_5$$6); + zephir_substr(&_5$$6, &color, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_get_strval(&color, &_5$$6); + } + if (zephir_fast_strlen_ev(&color) == 3) { + ZEPHIR_INIT_VAR(&_6$$7); + ZVAL_STRING(&_6$$7, "/./"); + ZEPHIR_INIT_VAR(&_7$$7); + ZVAL_STRING(&_7$$7, "$0$0"); + ZEPHIR_CALL_FUNCTION(&_8$$7, "preg_replace", NULL, 35, &_6$$7, &_7$$7, &color); zephir_check_call_status(); - zephir_get_strval(color, _8$$7); + zephir_get_strval(&color, &_8$$7); } - ZEPHIR_SINIT_VAR(_9); ZVAL_LONG(&_9, 2); - ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 76, color, &_9); + ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 69, &color, &_9); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_9); - ZVAL_STRING(&_9, "hexdec", 0); - ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 77, &_9, _10); + ZEPHIR_INIT_VAR(&_11); + ZVAL_STRING(&_11, "hexdec"); + ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 70, &_11, &_10); zephir_check_call_status(); - zephir_array_fetch_long(&_11, colors, 0, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 336 TSRMLS_CC); - zephir_array_fetch_long(&_12, colors, 1, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 336 TSRMLS_CC); - zephir_array_fetch_long(&_13, colors, 2, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 336 TSRMLS_CC); - ZEPHIR_INIT_VAR(_14); - ZVAL_LONG(_14, opacity); - ZEPHIR_INIT_VAR(_15); - ZVAL_LONG(_15, size); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_text", NULL, 0, text, offsetX, offsetY, _14, _11, _12, _13, _15, fontfile); + zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 336 TSRMLS_CC); + zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 336 TSRMLS_CC); + zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 336 TSRMLS_CC); + ZVAL_LONG(&_9, opacity); + ZVAL_LONG(&_15, size); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_text", NULL, 0, &text, offsetX, offsetY, &_9, &_12, &_13, &_14, &_15, &fontfile); zephir_check_call_status(); RETURN_THIS(); @@ -758,7 +837,10 @@ PHP_METHOD(Phalcon_Image_Adapter, text) { PHP_METHOD(Phalcon_Image_Adapter, mask) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *watermark; + zval *watermark, watermark_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&watermark_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &watermark); @@ -778,13 +860,31 @@ PHP_METHOD(Phalcon_Image_Adapter, background) { zend_bool _0; zend_long opacity, ZEPHIR_LAST_CALL_STATUS; - zval *color_param = NULL, *opacity_param = NULL, *colors = NULL, _1, _2, *_3, _9 = zval_used_for_init, *_10 = NULL, *_11, *_12, *_13, *_14, _4$$3, *_5$$3, *_6$$4, *_7$$4, *_8$$4 = NULL; - zval *color = NULL; + zval *color_param = NULL, *opacity_param = NULL, colors, _1, _2, _3, _9, _10, _11, _12, _13, _14, _4$$3, _5$$3, _6$$4, _7$$4, _8$$4; + zval color; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&color); + ZVAL_UNDEF(&colors); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &color_param, &opacity_param); - zephir_get_strval(color, color_param); + zephir_get_strval(&color, color_param); if (!opacity_param) { opacity = 100; } else { @@ -792,48 +892,41 @@ PHP_METHOD(Phalcon_Image_Adapter, background) { } - _0 = zephir_fast_strlen_ev(color) > 1; + _0 = zephir_fast_strlen_ev(&color) > 1; if (_0) { - ZEPHIR_SINIT_VAR(_1); ZVAL_LONG(&_1, 0); - ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, 1); - ZEPHIR_INIT_VAR(_3); - zephir_substr(_3, color, 0 , 1 , 0); - _0 = ZEPHIR_IS_STRING_IDENTICAL(_3, "#"); + ZEPHIR_INIT_VAR(&_3); + zephir_substr(&_3, &color, 0 , 1 , 0); + _0 = ZEPHIR_IS_STRING_IDENTICAL(&_3, "#"); } if (_0) { - ZEPHIR_SINIT_VAR(_4$$3); ZVAL_LONG(&_4$$3, 1); - ZEPHIR_INIT_VAR(_5$$3); - zephir_substr(_5$$3, color, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_get_strval(color, _5$$3); - } - if (zephir_fast_strlen_ev(color) == 3) { - ZEPHIR_INIT_VAR(_6$$4); - ZVAL_STRING(_6$$4, "/./", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_7$$4); - ZVAL_STRING(_7$$4, "$0$0", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_8$$4, "preg_replace", NULL, 42, _6$$4, _7$$4, color); - zephir_check_temp_parameter(_6$$4); - zephir_check_temp_parameter(_7$$4); + ZEPHIR_INIT_VAR(&_5$$3); + zephir_substr(&_5$$3, &color, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_get_strval(&color, &_5$$3); + } + if (zephir_fast_strlen_ev(&color) == 3) { + ZEPHIR_INIT_VAR(&_6$$4); + ZVAL_STRING(&_6$$4, "/./"); + ZEPHIR_INIT_VAR(&_7$$4); + ZVAL_STRING(&_7$$4, "$0$0"); + ZEPHIR_CALL_FUNCTION(&_8$$4, "preg_replace", NULL, 35, &_6$$4, &_7$$4, &color); zephir_check_call_status(); - zephir_get_strval(color, _8$$4); + zephir_get_strval(&color, &_8$$4); } - ZEPHIR_SINIT_VAR(_9); ZVAL_LONG(&_9, 2); - ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 76, color, &_9); + ZEPHIR_CALL_FUNCTION(&_10, "str_split", NULL, 69, &color, &_9); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_9); - ZVAL_STRING(&_9, "hexdec", 0); - ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 77, &_9, _10); + ZEPHIR_INIT_VAR(&_11); + ZVAL_STRING(&_11, "hexdec"); + ZEPHIR_CALL_FUNCTION(&colors, "array_map", NULL, 70, &_11, &_10); zephir_check_call_status(); - zephir_array_fetch_long(&_11, colors, 0, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 367 TSRMLS_CC); - zephir_array_fetch_long(&_12, colors, 1, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 367 TSRMLS_CC); - zephir_array_fetch_long(&_13, colors, 2, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 367 TSRMLS_CC); - ZEPHIR_INIT_VAR(_14); - ZVAL_LONG(_14, opacity); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_background", NULL, 0, _11, _12, _13, _14); + zephir_array_fetch_long(&_12, &colors, 0, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 367 TSRMLS_CC); + zephir_array_fetch_long(&_13, &colors, 1, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 367 TSRMLS_CC); + zephir_array_fetch_long(&_14, &colors, 2, PH_NOISY | PH_READONLY, "phalcon/image/adapter.zep", 367 TSRMLS_CC); + ZVAL_LONG(&_9, opacity); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_background", NULL, 0, &_12, &_13, &_14, &_9); zephir_check_call_status(); RETURN_THIS(); @@ -844,8 +937,11 @@ PHP_METHOD(Phalcon_Image_Adapter, background) { */ PHP_METHOD(Phalcon_Image_Adapter, blur) { - zval *radius_param = NULL, *_0; + zval *radius_param = NULL, _0; zend_long radius, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &radius_param); @@ -858,9 +954,8 @@ PHP_METHOD(Phalcon_Image_Adapter, blur) { } else if (radius > 100) { radius = 100; } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, radius); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_blur", NULL, 0, _0); + ZVAL_LONG(&_0, radius); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_blur", NULL, 0, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -871,8 +966,11 @@ PHP_METHOD(Phalcon_Image_Adapter, blur) { */ PHP_METHOD(Phalcon_Image_Adapter, pixelate) { - zval *amount_param = NULL, *_0; + zval *amount_param = NULL, _0; zend_long amount, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &amount_param); @@ -883,9 +981,8 @@ PHP_METHOD(Phalcon_Image_Adapter, pixelate) { if (amount < 2) { amount = 2; } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, amount); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_pixelate", NULL, 0, _0); + ZVAL_LONG(&_0, amount); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_pixelate", NULL, 0, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -897,17 +994,23 @@ PHP_METHOD(Phalcon_Image_Adapter, pixelate) { PHP_METHOD(Phalcon_Image_Adapter, save) { zend_long quality, ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, *quality_param = NULL, *_0$$3, *_2; - zval *file = NULL, *_1$$3 = NULL; + zval *file_param = NULL, *quality_param = NULL, _0$$3, _2; + zval file, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &file_param, &quality_param); if (!file_param) { - ZEPHIR_INIT_VAR(file); - ZVAL_EMPTY_STRING(file); + ZEPHIR_INIT_VAR(&file); + ZVAL_STRING(&file, ""); } else { - zephir_get_strval(file, file_param); + zephir_get_strval(&file, file_param); } if (!quality_param) { quality = -1; @@ -916,15 +1019,14 @@ PHP_METHOD(Phalcon_Image_Adapter, save) { } - if (!(!(!file) && Z_STRLEN_P(file))) { - ZEPHIR_OBS_VAR(_0$$3); - zephir_read_property_this(&_0$$3, this_ptr, SL("_realpath"), PH_NOISY_CC); - zephir_get_strval(_1$$3, _0$$3); - ZEPHIR_CPY_WRT(file, _1$$3); + if (!(!(Z_TYPE_P(&file) == IS_UNDEF) && Z_STRLEN_P(&file))) { + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property(&_0$$3, this_ptr, SL("_realpath"), PH_NOISY_CC); + zephir_get_strval(&_1$$3, &_0$$3); + ZEPHIR_CPY_WRT(&file, &_1$$3); } - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, quality); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_save", NULL, 0, file, _2); + ZVAL_LONG(&_2, quality); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_save", NULL, 0, &file, &_2); zephir_check_call_status(); RETURN_THIS(); @@ -936,17 +1038,25 @@ PHP_METHOD(Phalcon_Image_Adapter, save) { PHP_METHOD(Phalcon_Image_Adapter, render) { zend_long quality, ZEPHIR_LAST_CALL_STATUS; - zval *ext_param = NULL, *quality_param = NULL, *_0$$3, _1$$3, *_2$$3 = NULL, *_4; - zval *ext = NULL, *_3$$3 = NULL; + zval *ext_param = NULL, *quality_param = NULL, _0$$3, _1$$3, _2$$3, _4; + zval ext, _3$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&ext); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &ext_param, &quality_param); if (!ext_param) { - ZEPHIR_INIT_VAR(ext); - ZVAL_EMPTY_STRING(ext); + ZEPHIR_INIT_VAR(&ext); + ZVAL_STRING(&ext, ""); } else { - zephir_get_strval(ext, ext_param); + zephir_get_strval(&ext, ext_param); } if (!quality_param) { quality = 100; @@ -955,27 +1065,25 @@ PHP_METHOD(Phalcon_Image_Adapter, render) { } - if (!(!(!ext) && Z_STRLEN_P(ext))) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_1$$3); + if (!(!(Z_TYPE_P(&ext) == IS_UNDEF) && Z_STRLEN_P(&ext))) { + zephir_read_property(&_0$$3, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1$$3, 4); - ZEPHIR_CALL_FUNCTION(&_2$$3, "pathinfo", NULL, 78, _0$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(&_2$$3, "pathinfo", NULL, 71, &_0$$3, &_1$$3); zephir_check_call_status(); - zephir_get_strval(_3$$3, _2$$3); - ZEPHIR_CPY_WRT(ext, _3$$3); + zephir_get_strval(&_3$$3, &_2$$3); + ZEPHIR_CPY_WRT(&ext, &_3$$3); } - if (ZEPHIR_IS_EMPTY(ext)) { - ZEPHIR_INIT_NVAR(ext); - ZVAL_STRING(ext, "png", 1); + if (ZEPHIR_IS_EMPTY(&ext)) { + ZEPHIR_INIT_NVAR(&ext); + ZVAL_STRING(&ext, "png"); } if (quality < 1) { quality = 1; } else if (quality > 100) { quality = 100; } - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, quality); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_render", NULL, 0, ext, _4); + ZVAL_LONG(&_4, quality); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_render", NULL, 0, &ext, &_4); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/image/adapter.zep.h b/ext/phalcon/image/adapter.zep.h index e68528d41a0..89acbf73553 100644 --- a/ext/phalcon/image/adapter.zep.h +++ b/ext/phalcon/image/adapter.zep.h @@ -25,95 +25,315 @@ PHP_METHOD(Phalcon_Image_Adapter, pixelate); PHP_METHOD(Phalcon_Image_Adapter, save); PHP_METHOD(Phalcon_Image_Adapter, render); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_resize, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_getwidth, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_getwidth, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_getheight, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_getheight, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_gettype, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_gettype, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_getmime, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_getmime, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_resize, 0, 0, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_resize, 0, 0, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 1) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 1) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, master, IS_LONG, 0) +#else ZEND_ARG_INFO(0, master) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_liquidrescale, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_liquidrescale, 0, 2, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_liquidrescale, 0, 2, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, deltaX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, deltaX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, rigidity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, rigidity) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_crop, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_crop, 0, 2, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_crop, 0, 2, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 1) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 1) +#else ZEND_ARG_INFO(0, offsetY) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_rotate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_rotate, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_rotate, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, degrees, IS_LONG, 0) +#else ZEND_ARG_INFO(0, degrees) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_flip, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_flip, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_flip, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, direction, IS_LONG, 0) +#else ZEND_ARG_INFO(0, direction) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_sharpen, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_sharpen, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_sharpen, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, amount, IS_LONG, 0) +#else ZEND_ARG_INFO(0, amount) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_reflection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_reflection, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_reflection, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fadeIn, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, fadeIn) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_watermark, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_watermark, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_watermark, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif ZEND_ARG_OBJ_INFO(0, watermark, Phalcon\\Image\\Adapter, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetY) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_text, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_text, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_text, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif ZEND_ARG_INFO(0, offsetX) ZEND_ARG_INFO(0, offsetY) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, color, IS_STRING, 0) +#else ZEND_ARG_INFO(0, color) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) +#else ZEND_ARG_INFO(0, size) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fontfile, IS_STRING, 1) +#else ZEND_ARG_INFO(0, fontfile) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_mask, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_mask, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_mask, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif ZEND_ARG_OBJ_INFO(0, watermark, Phalcon\\Image\\Adapter, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_background, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_background, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_background, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, color, IS_STRING, 0) +#else ZEND_ARG_INFO(0, color) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_blur, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_blur, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_blur, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, radius, IS_LONG, 0) +#else ZEND_ARG_INFO(0, radius) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_pixelate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_pixelate, 0, 1, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_pixelate, 0, 1, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, amount, IS_LONG, 0) +#else ZEND_ARG_INFO(0, amount) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_save, 0, 0, Phalcon\\Image\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_save, 0, 0, IS_OBJECT, "Phalcon\\Image\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 1) +#else ZEND_ARG_INFO(0, file) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quality) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_render, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_render, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ext, IS_STRING, 1) +#else ZEND_ARG_INFO(0, ext) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quality) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_image_adapter_method_entry) { PHP_ME(Phalcon_Image_Adapter, getImage, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Image_Adapter, getRealpath, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Image_Adapter, getWidth, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Image_Adapter, getHeight, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Image_Adapter, getType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Image_Adapter, getMime, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Image_Adapter, getWidth, arginfo_phalcon_image_adapter_getwidth, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Image_Adapter, getHeight, arginfo_phalcon_image_adapter_getheight, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Image_Adapter, getType, arginfo_phalcon_image_adapter_gettype, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Image_Adapter, getMime, arginfo_phalcon_image_adapter_getmime, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Image_Adapter, resize, arginfo_phalcon_image_adapter_resize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Image_Adapter, liquidRescale, arginfo_phalcon_image_adapter_liquidrescale, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Image_Adapter, crop, arginfo_phalcon_image_adapter_crop, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/image/adapter/gd.zep.c b/ext/phalcon/image/adapter/gd.zep.c index 5e4365d7ffd..ddc492ad54d 100644 --- a/ext/phalcon/image/adapter/gd.zep.c +++ b/ext/phalcon/image/adapter/gd.zep.c @@ -17,8 +17,8 @@ #include "kernel/exception.h" #include "kernel/memory.h" #include "kernel/fcall.h" -#include "kernel/string.h" #include "kernel/array.h" +#include "kernel/string.h" #include "kernel/concat.h" #include "kernel/file.h" #include "ext/spl/spl_exceptions.h" @@ -37,63 +37,83 @@ ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_Gd) { PHP_METHOD(Phalcon_Image_Adapter_Gd, check) { - zval *version = NULL, *info = NULL, *matches = NULL, *_0, _1 = zval_used_for_init, *_2 = NULL, _6, *_7 = NULL, *_10, *_3$$6, *_4$$6, _5$$6, *_8$$8, *_9$$8; + zval __$true, version, info, matches, _0, _1, _2, _7, _8, _11, _3$$6, _4$$6, _5$$6, _6$$6, _9$$8, _10$$8; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&version); + ZVAL_UNDEF(&info); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_9$$8); + ZVAL_UNDEF(&_10$$8); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_static_property_ce(phalcon_image_adapter_gd_ce, SL("_checked") TSRMLS_CC); - if (zephir_is_true(_0)) { + zephir_read_static_property_ce(&_0, phalcon_image_adapter_gd_ce, SL("_checked"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { RETURN_MM_BOOL(1); } - if (!((zephir_function_exists_ex(SS("gd_info") TSRMLS_CC) == SUCCESS))) { + if (!((zephir_function_exists_ex(SL("gd_info") TSRMLS_CC) == SUCCESS))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "GD is either not installed or not enabled, check your configuration", "phalcon/image/adapter/gd.zep", 38); return; } - ZEPHIR_INIT_VAR(version); - ZVAL_NULL(version); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "GD_VERSION", 0); - ZEPHIR_CALL_FUNCTION(&_2, "defined", NULL, 37, &_1); + ZEPHIR_INIT_VAR(&version); + ZVAL_NULL(&version); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "GD_VERSION"); + ZEPHIR_CALL_FUNCTION(&_2, "defined", NULL, 31, &_1); zephir_check_call_status(); - if (zephir_is_true(_2)) { - ZEPHIR_INIT_NVAR(version); - ZEPHIR_GET_CONSTANT(version, "GD_VERSION"); + if (zephir_is_true(&_2)) { + ZEPHIR_INIT_NVAR(&version); + ZEPHIR_GET_CONSTANT(&version, "GD_VERSION"); } else { - ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 264); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(matches); - ZVAL_NULL(matches); - ZEPHIR_INIT_VAR(_3$$6); - zephir_array_fetch_string(&_4$$6, info, SL("GD Version"), PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 46 TSRMLS_CC); - ZEPHIR_SINIT_VAR(_5$$6); - ZVAL_STRING(&_5$$6, "/\\d+\\.\\d+(?:\\.\\d+)?/", 0); - zephir_preg_match(_3$$6, &_5$$6, _4$$6, matches, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(_3$$6)) { - ZEPHIR_OBS_NVAR(version); - zephir_array_fetch_long(&version, matches, 0, PH_NOISY, "phalcon/image/adapter/gd.zep", 47 TSRMLS_CC); + ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 226); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&matches); + ZVAL_NULL(&matches); + zephir_array_fetch_string(&_3$$6, &info, SL("GD Version"), PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 46 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$6); + ZVAL_STRING(&_4$$6, "/\\d+\\.\\d+(?:\\.\\d+)?/"); + ZEPHIR_INIT_VAR(&_5$$6); + ZEPHIR_INIT_VAR(&_6$$6); + ZVAL_STRING(&_6$$6, "/\\d+\\.\\d+(?:\\.\\d+)?/"); + zephir_preg_match(&_5$$6, &_6$$6, &_3$$6, &matches, 0, 0 , 0 TSRMLS_CC); + if (zephir_is_true(&_5$$6)) { + ZEPHIR_OBS_NVAR(&version); + zephir_array_fetch_long(&version, &matches, 0, PH_NOISY, "phalcon/image/adapter/gd.zep", 47 TSRMLS_CC); } } - ZEPHIR_SINIT_NVAR(_1); - ZVAL_STRING(&_1, "2.0.1", 0); - ZEPHIR_SINIT_VAR(_6); - ZVAL_STRING(&_6, ">=", 0); - ZEPHIR_CALL_FUNCTION(&_7, "version_compare", NULL, 265, version, &_1, &_6); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "2.0.1"); + ZEPHIR_INIT_VAR(&_7); + ZVAL_STRING(&_7, ">="); + ZEPHIR_CALL_FUNCTION(&_8, "version_compare", NULL, 227, &version, &_1, &_7); zephir_check_call_status(); - if (!(zephir_is_true(_7))) { - ZEPHIR_INIT_VAR(_8$$8); - object_init_ex(_8$$8, phalcon_image_exception_ce); - ZEPHIR_INIT_VAR(_9$$8); - ZEPHIR_CONCAT_SV(_9$$8, "Phalcon\\Image\\Adapter\\GD requires GD version '2.0.1' or greater, you have ", version); - ZEPHIR_CALL_METHOD(NULL, _8$$8, "__construct", NULL, 9, _9$$8); - zephir_check_call_status(); - zephir_throw_exception_debug(_8$$8, "phalcon/image/adapter/gd.zep", 52 TSRMLS_CC); + if (!(zephir_is_true(&_8))) { + ZEPHIR_INIT_VAR(&_9$$8); + object_init_ex(&_9$$8, phalcon_image_exception_ce); + ZEPHIR_INIT_VAR(&_10$$8); + ZEPHIR_CONCAT_SV(&_10$$8, "Phalcon\\Image\\Adapter\\GD requires GD version '2.0.1' or greater, you have ", &version); + ZEPHIR_CALL_METHOD(NULL, &_9$$8, "__construct", NULL, 4, &_10$$8); + zephir_check_call_status(); + zephir_throw_exception_debug(&_9$$8, "phalcon/image/adapter/gd.zep", 52 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_update_static_property_ce(phalcon_image_adapter_gd_ce, SL("_checked"), &ZEPHIR_GLOBAL(global_true) TSRMLS_CC); - _10 = zephir_fetch_static_property_ce(phalcon_image_adapter_gd_ce, SL("_checked") TSRMLS_CC); - RETURN_CTOR(_10); + zend_update_static_property(phalcon_image_adapter_gd_ce, ZEND_STRL("_checked"), &__$true); + zephir_read_static_property_ce(&_11, phalcon_image_adapter_gd_ce, SL("_checked"), PH_NOISY_CC | PH_READONLY); + RETURN_CTOR(&_11); } @@ -101,21 +121,60 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) { zend_bool _25$$14; zend_long width, height, ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, *width_param = NULL, *height_param = NULL, *imageinfo = NULL, *_0, *_1, *_2$$4, *_3$$4 = NULL, *_4$$4, *_9$$4, *_24$$4, *_5$$5, *_6$$5, *_7$$5, *_8$$5, *_10$$6, *_11$$6 = NULL, *_12$$7, *_13$$7 = NULL, *_14$$8, *_15$$8 = NULL, *_16$$9, *_17$$9 = NULL, *_18$$10, *_19$$10 = NULL, *_20$$11, *_21$$12, *_22$$12, *_23$$12, _29$$14, _30$$14, *_31$$14 = NULL, *_32$$14, *_33$$14, *_34$$14, *_35$$14, *_26$$15, *_27$$15, *_28$$15; - zval *file = NULL; + zval *file_param = NULL, *width_param = NULL, *height_param = NULL, __$true, imageinfo, _0, _1, _2$$4, _3$$4, _4$$4, _9$$4, _24$$4, _5$$5, _6$$5, _7$$5, _8$$5, _10$$6, _11$$6, _12$$7, _13$$7, _14$$8, _15$$8, _16$$9, _17$$9, _18$$10, _19$$10, _20$$11, _21$$12, _22$$12, _23$$12, _29$$14, _30$$14, _31$$14, _32$$14, _33$$14, _34$$14, _26$$15, _27$$15, _28$$15; + zval file; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&file); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&imageinfo); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_9$$4); + ZVAL_UNDEF(&_24$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_10$$6); + ZVAL_UNDEF(&_11$$6); + ZVAL_UNDEF(&_12$$7); + ZVAL_UNDEF(&_13$$7); + ZVAL_UNDEF(&_14$$8); + ZVAL_UNDEF(&_15$$8); + ZVAL_UNDEF(&_16$$9); + ZVAL_UNDEF(&_17$$9); + ZVAL_UNDEF(&_18$$10); + ZVAL_UNDEF(&_19$$10); + ZVAL_UNDEF(&_20$$11); + ZVAL_UNDEF(&_21$$12); + ZVAL_UNDEF(&_22$$12); + ZVAL_UNDEF(&_23$$12); + ZVAL_UNDEF(&_29$$14); + ZVAL_UNDEF(&_30$$14); + ZVAL_UNDEF(&_31$$14); + ZVAL_UNDEF(&_32$$14); + ZVAL_UNDEF(&_33$$14); + ZVAL_UNDEF(&_34$$14); + ZVAL_UNDEF(&_26$$15); + ZVAL_UNDEF(&_27$$15); + ZVAL_UNDEF(&_28$$15); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &file_param, &width_param, &height_param); if (UNEXPECTED(Z_TYPE_P(file_param) != IS_STRING && Z_TYPE_P(file_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'file' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'file' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(file_param) == IS_STRING)) { - zephir_get_strval(file, file_param); + zephir_get_strval(&file, file_param); } else { - ZEPHIR_INIT_VAR(file); - ZVAL_EMPTY_STRING(file); + ZEPHIR_INIT_VAR(&file); + ZVAL_EMPTY_STRING(&file); } if (!width_param) { width = 0; @@ -129,78 +188,78 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) { } - _0 = zephir_fetch_static_property_ce(phalcon_image_adapter_gd_ce, SL("_checked") TSRMLS_CC); - if (!(zephir_is_true(_0))) { + zephir_read_static_property_ce(&_0, phalcon_image_adapter_gd_ce, SL("_checked"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_SELF(NULL, "check", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_file"), file TSRMLS_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - if ((zephir_file_exists(_1 TSRMLS_CC) == SUCCESS)) { - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 67, _2$$4); - zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_realpath"), _3$$4 TSRMLS_CC); - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&imageinfo, "getimagesize", NULL, 266, _4$$4); - zephir_check_call_status(); - if (zephir_is_true(imageinfo)) { - zephir_array_fetch_long(&_5$$5, imageinfo, 0, PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 76 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_width"), _5$$5 TSRMLS_CC); - zephir_array_fetch_long(&_6$$5, imageinfo, 1, PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 77 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_height"), _6$$5 TSRMLS_CC); - zephir_array_fetch_long(&_7$$5, imageinfo, 2, PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 78 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_type"), _7$$5 TSRMLS_CC); - zephir_array_fetch_string(&_8$$5, imageinfo, SL("mime"), PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 79 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_mime"), _8$$5 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_file"), &file); + zephir_read_property(&_1, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + if ((zephir_file_exists(&_1 TSRMLS_CC) == SUCCESS)) { + zephir_read_property(&_2$$4, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_3$$4, "realpath", NULL, 60, &_2$$4); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, SL("_realpath"), &_3$$4); + zephir_read_property(&_4$$4, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&imageinfo, "getimagesize", NULL, 228, &_4$$4); + zephir_check_call_status(); + if (zephir_is_true(&imageinfo)) { + zephir_array_fetch_long(&_5$$5, &imageinfo, 0, PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 76 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_width"), &_5$$5); + zephir_array_fetch_long(&_6$$5, &imageinfo, 1, PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 77 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_6$$5); + zephir_array_fetch_long(&_7$$5, &imageinfo, 2, PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 78 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), &_7$$5); + zephir_array_fetch_string(&_8$$5, &imageinfo, SL("mime"), PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 79 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_mime"), &_8$$5); } - _9$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); + zephir_read_property(&_9$$4, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); do { - if (ZEPHIR_IS_LONG(_9$$4, 1)) { - _10$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 267, _10$$6); + if (ZEPHIR_IS_LONG(&_9$$4, 1)) { + zephir_read_property(&_10$$6, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 229, &_10$$6); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), _11$$6 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &_11$$6); break; } - if (ZEPHIR_IS_LONG(_9$$4, 2)) { - _12$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_13$$7, "imagecreatefromjpeg", NULL, 268, _12$$7); + if (ZEPHIR_IS_LONG(&_9$$4, 2)) { + zephir_read_property(&_12$$7, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_13$$7, "imagecreatefromjpeg", NULL, 0, &_12$$7); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), _13$$7 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &_13$$7); break; } - if (ZEPHIR_IS_LONG(_9$$4, 3)) { - _14$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 269, _14$$8); + if (ZEPHIR_IS_LONG(&_9$$4, 3)) { + zephir_read_property(&_14$$8, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 230, &_14$$8); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), _15$$8 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &_15$$8); break; } - if (ZEPHIR_IS_LONG(_9$$4, 15)) { - _16$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 270, _16$$9); + if (ZEPHIR_IS_LONG(&_9$$4, 15)) { + zephir_read_property(&_16$$9, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 231, &_16$$9); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), _17$$9 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &_17$$9); break; } - if (ZEPHIR_IS_LONG(_9$$4, 16)) { - _18$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 271, _18$$10); + if (ZEPHIR_IS_LONG(&_9$$4, 16)) { + zephir_read_property(&_18$$10, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 232, &_18$$10); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), _19$$10 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &_19$$10); break; } - _20$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_mime"), PH_NOISY_CC); - if (zephir_is_true(_20$$11)) { - ZEPHIR_INIT_VAR(_21$$12); - object_init_ex(_21$$12, phalcon_image_exception_ce); - _22$$12 = zephir_fetch_nproperty_this(this_ptr, SL("_mime"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_23$$12); - ZEPHIR_CONCAT_SVS(_23$$12, "Installed GD does not support ", _22$$12, " images"); - ZEPHIR_CALL_METHOD(NULL, _21$$12, "__construct", NULL, 9, _23$$12); + zephir_read_property(&_20$$11, this_ptr, SL("_mime"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_20$$11)) { + ZEPHIR_INIT_VAR(&_21$$12); + object_init_ex(&_21$$12, phalcon_image_exception_ce); + zephir_read_property(&_22$$12, this_ptr, SL("_mime"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_23$$12); + ZEPHIR_CONCAT_SVS(&_23$$12, "Installed GD does not support ", &_22$$12, " images"); + ZEPHIR_CALL_METHOD(NULL, &_21$$12, "__construct", NULL, 4, &_23$$12); zephir_check_call_status(); - zephir_throw_exception_debug(_21$$12, "phalcon/image/adapter/gd.zep", 100 TSRMLS_CC); + zephir_throw_exception_debug(&_21$$12, "phalcon/image/adapter/gd.zep", 100 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } else { @@ -210,8 +269,8 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) { break; } while(0); - _24$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 272, _24$$4, ZEPHIR_GLOBAL(global_true)); + zephir_read_property(&_24$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 233, &_24$$4, &__$true); zephir_check_call_status(); } else { _25$$14 = !width; @@ -219,44 +278,43 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) { _25$$14 = !height; } if (_25$$14) { - ZEPHIR_INIT_VAR(_26$$15); - object_init_ex(_26$$15, phalcon_image_exception_ce); - _27$$15 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_28$$15); - ZEPHIR_CONCAT_SV(_28$$15, "Failed to create image from file ", _27$$15); - ZEPHIR_CALL_METHOD(NULL, _26$$15, "__construct", NULL, 9, _28$$15); + ZEPHIR_INIT_VAR(&_26$$15); + object_init_ex(&_26$$15, phalcon_image_exception_ce); + zephir_read_property(&_27$$15, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_28$$15); + ZEPHIR_CONCAT_SV(&_28$$15, "Failed to create image from file ", &_27$$15); + ZEPHIR_CALL_METHOD(NULL, &_26$$15, "__construct", NULL, 4, &_28$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_26$$15, "phalcon/image/adapter/gd.zep", 111 TSRMLS_CC); + zephir_throw_exception_debug(&_26$$15, "phalcon/image/adapter/gd.zep", 111 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_SINIT_VAR(_29$$14); ZVAL_LONG(&_29$$14, width); - ZEPHIR_SINIT_VAR(_30$$14); ZVAL_LONG(&_30$$14, height); - ZEPHIR_CALL_FUNCTION(&_31$$14, "imagecreatetruecolor", NULL, 273, &_29$$14, &_30$$14); - zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), _31$$14 TSRMLS_CC); - _32$$14 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 274, _32$$14, ZEPHIR_GLOBAL(global_true)); - zephir_check_call_status(); - _33$$14 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 272, _33$$14, ZEPHIR_GLOBAL(global_true)); - zephir_check_call_status(); - _34$$14 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_realpath"), _34$$14 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_35$$14); - ZVAL_LONG(_35$$14, width); - zephir_update_property_this(getThis(), SL("_width"), _35$$14 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_35$$14); - ZVAL_LONG(_35$$14, height); - zephir_update_property_this(getThis(), SL("_height"), _35$$14 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_35$$14); - ZVAL_LONG(_35$$14, 3); - zephir_update_property_this(getThis(), SL("_type"), _35$$14 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_35$$14); - ZVAL_STRING(_35$$14, "image/png", 1); - zephir_update_property_this(getThis(), SL("_mime"), _35$$14 TSRMLS_CC); + ZEPHIR_CALL_FUNCTION(&_31$$14, "imagecreatetruecolor", NULL, 234, &_29$$14, &_30$$14); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, SL("_image"), &_31$$14); + zephir_read_property(&_29$$14, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 235, &_29$$14, &__$true); + zephir_check_call_status(); + zephir_read_property(&_30$$14, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 233, &_30$$14, &__$true); + zephir_check_call_status(); + zephir_read_property(&_32$$14, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_realpath"), &_32$$14); + ZEPHIR_INIT_ZVAL_NREF(_33$$14); + ZVAL_LONG(&_33$$14, width); + zephir_update_property_zval(this_ptr, SL("_width"), &_33$$14); + ZEPHIR_INIT_ZVAL_NREF(_33$$14); + ZVAL_LONG(&_33$$14, height); + zephir_update_property_zval(this_ptr, SL("_height"), &_33$$14); + ZEPHIR_INIT_ZVAL_NREF(_33$$14); + ZVAL_LONG(&_33$$14, 3); + zephir_update_property_zval(this_ptr, SL("_type"), &_33$$14); + ZEPHIR_INIT_VAR(&_34$$14); + ZEPHIR_INIT_NVAR(&_34$$14); + ZVAL_STRING(&_34$$14, "image/png"); + zephir_update_property_zval(this_ptr, SL("_mime"), &_34$$14); } ZEPHIR_MM_RESTORE(); @@ -265,8 +323,47 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, __construct) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _resize) { zend_bool _4$$3, _8$$4; - zval *width_param = NULL, *height_param = NULL, *image = NULL, *pre_width = NULL, *pre_height = NULL, *reduction_width = NULL, *reduction_height = NULL, *_0, _1, *_2 = NULL, *_3$$3, *_5$$3, *_18$$3, *_19$$3, *_20$$3, _21$$3, _22$$3, _23$$3, _24$$3, _25$$3, _26$$3, *_27$$3 = NULL, _6$$4, _7$$4, *_9$$4, *_10$$4, *_11$$4, _12$$4, _13$$4, _14$$4, _15$$4, *_16$$4 = NULL, *_17$$6, *_28$$7, *_29$$7 = NULL, *_30$$7 = NULL, *_31$$8, _32$$8, _33$$8, *_34$$8, *_35$$8 = NULL, *_36$$8 = NULL; + zval *width_param = NULL, *height_param = NULL, image, pre_width, pre_height, reduction_width, reduction_height, _0, _1, _2, _3$$3, _5$$3, _18$$3, _19$$3, _20$$3, _21$$3, _22$$3, _23$$3, _24$$3, _25$$3, _6$$4, _7$$4, _9$$4, _10$$4, _11$$4, _12$$4, _13$$4, _14$$4, _15$$4, _16$$4, _17$$6, _26$$7, _27$$7, _28$$7, _29$$8, _30$$8, _31$$8, _32$$8, _33$$8; zend_long width, height, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&pre_width); + ZVAL_UNDEF(&pre_height); + ZVAL_UNDEF(&reduction_width); + ZVAL_UNDEF(&reduction_height); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_18$$3); + ZVAL_UNDEF(&_19$$3); + ZVAL_UNDEF(&_20$$3); + ZVAL_UNDEF(&_21$$3); + ZVAL_UNDEF(&_22$$3); + ZVAL_UNDEF(&_23$$3); + ZVAL_UNDEF(&_24$$3); + ZVAL_UNDEF(&_25$$3); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_9$$4); + ZVAL_UNDEF(&_10$$4); + ZVAL_UNDEF(&_11$$4); + ZVAL_UNDEF(&_12$$4); + ZVAL_UNDEF(&_13$$4); + ZVAL_UNDEF(&_14$$4); + ZVAL_UNDEF(&_15$$4); + ZVAL_UNDEF(&_16$$4); + ZVAL_UNDEF(&_17$$6); + ZVAL_UNDEF(&_26$$7); + ZVAL_UNDEF(&_27$$7); + ZVAL_UNDEF(&_28$$7); + ZVAL_UNDEF(&_29$$8); + ZVAL_UNDEF(&_30$$8); + ZVAL_UNDEF(&_31$$8); + ZVAL_UNDEF(&_32$$8); + ZVAL_UNDEF(&_33$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &width_param, &height_param); @@ -275,118 +372,102 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _resize) { height = zephir_get_intval(height_param); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_GET_CONSTANT(_0, "PHP_VERSION"); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "5.5.0", 0); - ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 265, _0, &_1); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_GET_CONSTANT(&_0, "PHP_VERSION"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "5.5.0"); + ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 227, &_0, &_1); zephir_check_call_status(); - if (ZEPHIR_LT_LONG(_2, 0)) { - ZEPHIR_OBS_VAR(pre_width); - zephir_read_property_this(&pre_width, this_ptr, SL("_width"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(pre_height); - zephir_read_property_this(&pre_height, this_ptr, SL("_height"), PH_NOISY_CC); - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _4$$3 = width > (zephir_safe_div_zval_long(_3$$3, 2 TSRMLS_CC)); + if (ZEPHIR_LT_LONG(&_2, 0)) { + ZEPHIR_OBS_VAR(&pre_width); + zephir_read_property(&pre_width, this_ptr, SL("_width"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&pre_height); + zephir_read_property(&pre_height, this_ptr, SL("_height"), PH_NOISY_CC); + zephir_read_property(&_3$$3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + _4$$3 = width > (zephir_safe_div_zval_long(&_3$$3, 2 TSRMLS_CC)); if (_4$$3) { - _5$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - _4$$3 = height > (zephir_safe_div_zval_long(_5$$3, 2 TSRMLS_CC)); + zephir_read_property(&_5$$3, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + _4$$3 = height > (zephir_safe_div_zval_long(&_5$$3, 2 TSRMLS_CC)); } if (_4$$3) { - ZEPHIR_SINIT_VAR(_6$$4); ZVAL_LONG(&_6$$4, (width * 1.1)); - ZEPHIR_INIT_VAR(reduction_width); - zephir_round(reduction_width, &_6$$4, NULL, NULL TSRMLS_CC); - ZEPHIR_SINIT_VAR(_7$$4); + ZEPHIR_INIT_VAR(&reduction_width); + zephir_round(&reduction_width, &_6$$4, NULL, NULL TSRMLS_CC); ZVAL_LONG(&_7$$4, (height * 1.1)); - ZEPHIR_INIT_VAR(reduction_height); - zephir_round(reduction_height, &_7$$4, NULL, NULL TSRMLS_CC); + ZEPHIR_INIT_VAR(&reduction_height); + zephir_round(&reduction_height, &_7$$4, NULL, NULL TSRMLS_CC); while (1) { - _8$$4 = ZEPHIR_LT_LONG(reduction_width, zephir_safe_div_zval_long(pre_width, 2 TSRMLS_CC)); + _8$$4 = ZEPHIR_LT_LONG(&reduction_width, zephir_safe_div_zval_long(&pre_width, 2 TSRMLS_CC)); if (_8$$4) { - _8$$4 = ZEPHIR_LT_LONG(reduction_height, zephir_safe_div_zval_long(pre_height, 2 TSRMLS_CC)); + _8$$4 = ZEPHIR_LT_LONG(&reduction_height, zephir_safe_div_zval_long(&pre_height, 2 TSRMLS_CC)); } if (!(_8$$4)) { break; } - ZEPHIR_INIT_NVAR(pre_width); - ZVAL_DOUBLE(pre_width, 2); - ZEPHIR_INIT_NVAR(pre_height); - ZVAL_DOUBLE(pre_height, 2); + ZEPHIR_INIT_NVAR(&pre_width); + ZVAL_DOUBLE(&pre_width, 2); + ZEPHIR_INIT_NVAR(&pre_height); + ZVAL_DOUBLE(&pre_height, 2); } - ZEPHIR_CALL_METHOD(&image, this_ptr, "_create", NULL, 0, pre_width, pre_height); + ZEPHIR_CALL_METHOD(&image, this_ptr, "_create", NULL, 0, &pre_width, &pre_height); zephir_check_call_status(); - _9$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - _10$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _11$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_12$$4); + zephir_read_property(&_9$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_10$$4, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_11$$4, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_12$$4, 0); - ZEPHIR_SINIT_VAR(_13$$4); ZVAL_LONG(&_13$$4, 0); - ZEPHIR_SINIT_VAR(_14$$4); ZVAL_LONG(&_14$$4, 0); - ZEPHIR_SINIT_VAR(_15$$4); ZVAL_LONG(&_15$$4, 0); - ZEPHIR_CALL_FUNCTION(&_16$$4, "imagecopyresized", NULL, 275, image, _9$$4, &_12$$4, &_13$$4, &_14$$4, &_15$$4, pre_width, pre_height, _10$$4, _11$$4); + ZEPHIR_CALL_FUNCTION(&_16$$4, "imagecopyresized", NULL, 236, &image, &_9$$4, &_12$$4, &_13$$4, &_14$$4, &_15$$4, &pre_width, &pre_height, &_10$$4, &_11$$4); zephir_check_call_status(); - if (zephir_is_true(_16$$4)) { - _17$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _17$$6); + if (zephir_is_true(&_16$$4)) { + zephir_read_property(&_17$$6, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_17$$6); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), image TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &image); } } - ZEPHIR_INIT_VAR(_18$$3); - ZVAL_LONG(_18$$3, width); - ZEPHIR_INIT_VAR(_19$$3); - ZVAL_LONG(_19$$3, height); - ZEPHIR_CALL_METHOD(&image, this_ptr, "_create", NULL, 0, _18$$3, _19$$3); - zephir_check_call_status(); - _20$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_21$$3); + ZVAL_LONG(&_18$$3, width); + ZVAL_LONG(&_19$$3, height); + ZEPHIR_CALL_METHOD(&image, this_ptr, "_create", NULL, 0, &_18$$3, &_19$$3); + zephir_check_call_status(); + zephir_read_property(&_18$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_19$$3, 0); + ZVAL_LONG(&_20$$3, 0); ZVAL_LONG(&_21$$3, 0); - ZEPHIR_SINIT_VAR(_22$$3); ZVAL_LONG(&_22$$3, 0); - ZEPHIR_SINIT_VAR(_23$$3); - ZVAL_LONG(&_23$$3, 0); - ZEPHIR_SINIT_VAR(_24$$3); - ZVAL_LONG(&_24$$3, 0); - ZEPHIR_SINIT_VAR(_25$$3); - ZVAL_LONG(&_25$$3, width); - ZEPHIR_SINIT_VAR(_26$$3); - ZVAL_LONG(&_26$$3, height); - ZEPHIR_CALL_FUNCTION(&_27$$3, "imagecopyresampled", NULL, 277, image, _20$$3, &_21$$3, &_22$$3, &_23$$3, &_24$$3, &_25$$3, &_26$$3, pre_width, pre_height); - zephir_check_call_status(); - if (zephir_is_true(_27$$3)) { - _28$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _28$$7); + ZVAL_LONG(&_23$$3, width); + ZVAL_LONG(&_24$$3, height); + ZEPHIR_CALL_FUNCTION(&_25$$3, "imagecopyresampled", NULL, 238, &image, &_18$$3, &_19$$3, &_20$$3, &_21$$3, &_22$$3, &_23$$3, &_24$$3, &pre_width, &pre_height); + zephir_check_call_status(); + if (zephir_is_true(&_25$$3)) { + zephir_read_property(&_26$$7, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_26$$7); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), image TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_29$$7, "imagesx", NULL, 278, image); + zephir_update_property_zval(this_ptr, SL("_image"), &image); + ZEPHIR_CALL_FUNCTION(&_27$$7, "imagesx", NULL, 239, &image); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _29$$7 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_30$$7, "imagesy", NULL, 279, image); + zephir_update_property_zval(this_ptr, SL("_width"), &_27$$7); + ZEPHIR_CALL_FUNCTION(&_28$$7, "imagesy", NULL, 240, &image); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _30$$7 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_28$$7); } } else { - _31$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_32$$8); - ZVAL_LONG(&_32$$8, width); - ZEPHIR_SINIT_VAR(_33$$8); - ZVAL_LONG(&_33$$8, height); - ZEPHIR_CALL_FUNCTION(&image, "imagescale", NULL, 280, _31$$8, &_32$$8, &_33$$8); + zephir_read_property(&_29$$8, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_30$$8, width); + ZVAL_LONG(&_31$$8, height); + ZEPHIR_CALL_FUNCTION(&image, "imagescale", NULL, 241, &_29$$8, &_30$$8, &_31$$8); zephir_check_call_status(); - _34$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _34$$8); + zephir_read_property(&_30$$8, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_30$$8); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), image TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_35$$8, "imagesx", NULL, 278, image); + zephir_update_property_zval(this_ptr, SL("_image"), &image); + ZEPHIR_CALL_FUNCTION(&_32$$8, "imagesx", NULL, 239, &image); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _35$$8 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_36$$8, "imagesy", NULL, 279, image); + zephir_update_property_zval(this_ptr, SL("_width"), &_32$$8); + ZEPHIR_CALL_FUNCTION(&_33$$8, "imagesy", NULL, 240, &image); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _36$$8 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_33$$8); } ZEPHIR_MM_RESTORE(); @@ -394,8 +475,33 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _resize) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _crop) { - zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, *image = NULL, *rect = NULL, *_0, _1, *_2 = NULL, *_3$$3, *_4$$3, *_5$$3, _6$$3, _7$$3, _8$$3, _9$$3, _10$$3, _11$$3, _12$$3, _13$$3, *_14$$3 = NULL, *_15$$4, *_16$$4 = NULL, *_17$$4 = NULL, *_18$$5 = NULL, *_19$$5, *_20$$5, *_21$$5 = NULL, *_22$$5 = NULL; + zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, image, rect, _0, _1, _2, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3, _9$$3, _10$$3, _11$$3, _12$$3, _13$$4, _14$$4, _15$$4, _16$$5, _17$$5, _18$$5, _19$$5, _20$$5; zend_long width, height, offsetX, offsetY, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&rect); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_8$$3); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_10$$3); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_13$$4); + ZVAL_UNDEF(&_14$$4); + ZVAL_UNDEF(&_15$$4); + ZVAL_UNDEF(&_16$$5); + ZVAL_UNDEF(&_17$$5); + ZVAL_UNDEF(&_18$$5); + ZVAL_UNDEF(&_19$$5); + ZVAL_UNDEF(&_20$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &width_param, &height_param, &offsetX_param, &offsetY_param); @@ -406,78 +512,68 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _crop) { offsetY = zephir_get_intval(offsetY_param); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_GET_CONSTANT(_0, "PHP_VERSION"); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "5.5.0", 0); - ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 265, _0, &_1); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_GET_CONSTANT(&_0, "PHP_VERSION"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "5.5.0"); + ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 227, &_0, &_1); zephir_check_call_status(); - if (ZEPHIR_LT_LONG(_2, 0)) { - ZEPHIR_INIT_VAR(_3$$3); - ZVAL_LONG(_3$$3, width); - ZEPHIR_INIT_VAR(_4$$3); - ZVAL_LONG(_4$$3, height); - ZEPHIR_CALL_METHOD(&image, this_ptr, "_create", NULL, 0, _3$$3, _4$$3); - zephir_check_call_status(); - _5$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_6$$3); - ZVAL_LONG(&_6$$3, 0); - ZEPHIR_SINIT_VAR(_7$$3); - ZVAL_LONG(&_7$$3, 0); - ZEPHIR_SINIT_VAR(_8$$3); - ZVAL_LONG(&_8$$3, offsetX); - ZEPHIR_SINIT_VAR(_9$$3); - ZVAL_LONG(&_9$$3, offsetY); - ZEPHIR_SINIT_VAR(_10$$3); + if (ZEPHIR_LT_LONG(&_2, 0)) { + ZVAL_LONG(&_3$$3, width); + ZVAL_LONG(&_4$$3, height); + ZEPHIR_CALL_METHOD(&image, this_ptr, "_create", NULL, 0, &_3$$3, &_4$$3); + zephir_check_call_status(); + zephir_read_property(&_3$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_4$$3, 0); + ZVAL_LONG(&_5$$3, 0); + ZVAL_LONG(&_6$$3, offsetX); + ZVAL_LONG(&_7$$3, offsetY); + ZVAL_LONG(&_8$$3, width); + ZVAL_LONG(&_9$$3, height); ZVAL_LONG(&_10$$3, width); - ZEPHIR_SINIT_VAR(_11$$3); ZVAL_LONG(&_11$$3, height); - ZEPHIR_SINIT_VAR(_12$$3); - ZVAL_LONG(&_12$$3, width); - ZEPHIR_SINIT_VAR(_13$$3); - ZVAL_LONG(&_13$$3, height); - ZEPHIR_CALL_FUNCTION(&_14$$3, "imagecopyresampled", NULL, 277, image, _5$$3, &_6$$3, &_7$$3, &_8$$3, &_9$$3, &_10$$3, &_11$$3, &_12$$3, &_13$$3); - zephir_check_call_status(); - if (zephir_is_true(_14$$3)) { - _15$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _15$$4); + ZEPHIR_CALL_FUNCTION(&_12$$3, "imagecopyresampled", NULL, 238, &image, &_3$$3, &_4$$3, &_5$$3, &_6$$3, &_7$$3, &_8$$3, &_9$$3, &_10$$3, &_11$$3); + zephir_check_call_status(); + if (zephir_is_true(&_12$$3)) { + zephir_read_property(&_13$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_13$$4); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), image TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_16$$4, "imagesx", NULL, 278, image); + zephir_update_property_zval(this_ptr, SL("_image"), &image); + ZEPHIR_CALL_FUNCTION(&_14$$4, "imagesx", NULL, 239, &image); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _16$$4 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_17$$4, "imagesy", NULL, 279, image); + zephir_update_property_zval(this_ptr, SL("_width"), &_14$$4); + ZEPHIR_CALL_FUNCTION(&_15$$4, "imagesy", NULL, 240, &image); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _17$$4 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_15$$4); } } else { - ZEPHIR_INIT_VAR(rect); - zephir_create_array(rect, 4, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_18$$5); - ZVAL_LONG(_18$$5, offsetX); - zephir_array_update_string(&rect, SL("x"), &_18$$5, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_18$$5); - ZVAL_LONG(_18$$5, offsetY); - zephir_array_update_string(&rect, SL("y"), &_18$$5, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_18$$5); - ZVAL_LONG(_18$$5, width); - zephir_array_update_string(&rect, SL("width"), &_18$$5, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_18$$5); - ZVAL_LONG(_18$$5, height); - zephir_array_update_string(&rect, SL("height"), &_18$$5, PH_COPY | PH_SEPARATE); - _19$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&image, "imagecrop", NULL, 281, _19$$5, rect); - zephir_check_call_status(); - _20$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _20$$5); - zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), image TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_21$$5, "imagesx", NULL, 278, image); - zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _21$$5 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_22$$5, "imagesy", NULL, 279, image); - zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _22$$5 TSRMLS_CC); + ZEPHIR_INIT_VAR(&rect); + zephir_create_array(&rect, 4, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_16$$5); + ZVAL_LONG(&_16$$5, offsetX); + zephir_array_update_string(&rect, SL("x"), &_16$$5, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_16$$5); + ZVAL_LONG(&_16$$5, offsetY); + zephir_array_update_string(&rect, SL("y"), &_16$$5, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_16$$5); + ZVAL_LONG(&_16$$5, width); + zephir_array_update_string(&rect, SL("width"), &_16$$5, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_16$$5); + ZVAL_LONG(&_16$$5, height); + zephir_array_update_string(&rect, SL("height"), &_16$$5, PH_COPY | PH_SEPARATE); + zephir_read_property(&_17$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&image, "imagecrop", NULL, 242, &_17$$5, &rect); + zephir_check_call_status(); + zephir_read_property(&_18$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_18$$5); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, SL("_image"), &image); + ZEPHIR_CALL_FUNCTION(&_19$$5, "imagesx", NULL, 239, &image); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, SL("_width"), &_19$$5); + ZEPHIR_CALL_FUNCTION(&_20$$5, "imagesy", NULL, 240, &image); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, SL("_height"), &_20$$5); } ZEPHIR_MM_RESTORE(); @@ -485,8 +581,25 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _crop) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _rotate) { - zval *degrees_param = NULL, *image = NULL, *transparent = NULL, *width = NULL, *height = NULL, *_0, _1 = zval_used_for_init, _2 = zval_used_for_init, _3 = zval_used_for_init, _4 = zval_used_for_init, *_5, *_6, _7, *_8 = NULL, *_9$$3; + zval *degrees_param = NULL, __$true, image, transparent, width, height, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9$$3; zend_long degrees, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&transparent); + ZVAL_UNDEF(&width); + ZVAL_UNDEF(&height); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, °rees_param); @@ -494,50 +607,39 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _rotate) { degrees = zephir_get_intval(degrees_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_1); + zephir_read_property(&_0, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1, 0); - ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, 0); - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, 0); - ZEPHIR_SINIT_VAR(_4); ZVAL_LONG(&_4, 127); - ZEPHIR_CALL_FUNCTION(&transparent, "imagecolorallocatealpha", NULL, 282, _0, &_1, &_2, &_3, &_4); + ZEPHIR_CALL_FUNCTION(&transparent, "imagecolorallocatealpha", NULL, 243, &_0, &_1, &_2, &_3, &_4); zephir_check_call_status(); - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_1); - ZVAL_LONG(&_1, (360 - degrees)); - ZEPHIR_SINIT_NVAR(_2); - ZVAL_LONG(&_2, 1); - ZEPHIR_CALL_FUNCTION(&image, "imagerotate", NULL, 283, _5, &_1, transparent, &_2); + zephir_read_property(&_1, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_2, (360 - degrees)); + ZVAL_LONG(&_3, 1); + ZEPHIR_CALL_FUNCTION(&image, "imagerotate", NULL, 244, &_1, &_2, &transparent, &_3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 272, image, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 233, &image, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&width, "imagesx", NULL, 278, image); + ZEPHIR_CALL_FUNCTION(&width, "imagesx", NULL, 239, &image); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&height, "imagesy", NULL, 279, image); + ZEPHIR_CALL_FUNCTION(&height, "imagesy", NULL, 240, &image); zephir_check_call_status(); - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_1); - ZVAL_LONG(&_1, 0); - ZEPHIR_SINIT_NVAR(_2); - ZVAL_LONG(&_2, 0); - ZEPHIR_SINIT_NVAR(_3); + zephir_read_property(&_2, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_3, 0); - ZEPHIR_SINIT_NVAR(_4); ZVAL_LONG(&_4, 0); - ZEPHIR_SINIT_VAR(_7); + ZVAL_LONG(&_5, 0); + ZVAL_LONG(&_6, 0); ZVAL_LONG(&_7, 100); - ZEPHIR_CALL_FUNCTION(&_8, "imagecopymerge", NULL, 284, _6, image, &_1, &_2, &_3, &_4, width, height, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "imagecopymerge", NULL, 245, &_2, &image, &_3, &_4, &_5, &_6, &width, &height, &_7); zephir_check_call_status(); - if (zephir_is_true(_8)) { - _9$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _9$$3); + if (zephir_is_true(&_8)) { + zephir_read_property(&_9$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_9$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), image TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_width"), width TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_height"), height TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &image); + zephir_update_property_zval(this_ptr, SL("_width"), &width); + zephir_update_property_zval(this_ptr, SL("_height"), &height); } ZEPHIR_MM_RESTORE(); @@ -546,8 +648,41 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _rotate) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _flip) { zephir_fcall_cache_entry *_14 = NULL; - zval *direction_param = NULL, *image = NULL, *_0, _1, *_2 = NULL, *_3$$3, *_4$$3, *_24$$3, *_25$$3 = NULL, *_26$$3 = NULL, *_5$$4, *_6$$5, *_7$$5, *_8$$5, _9$$5 = zval_used_for_init, _10$$5 = zval_used_for_init, _11$$5 = zval_used_for_init, _12$$5 = zval_used_for_init, _13$$5 = zval_used_for_init, *_15$$6, *_16$$7, *_17$$7, *_18$$7, _19$$7 = zval_used_for_init, _20$$7 = zval_used_for_init, _21$$7 = zval_used_for_init, _22$$7 = zval_used_for_init, _23$$7 = zval_used_for_init, *_27$$9, _28$$9, *_29$$10, _30$$10; + zval *direction_param = NULL, image, _0, _1, _2, _3$$3, _4$$3, _24$$3, _25$$3, _26$$3, _5$$4, _6$$5, _7$$5, _8$$5, _9$$5, _10$$5, _11$$5, _12$$5, _13$$5, _15$$6, _16$$7, _17$$7, _18$$7, _19$$7, _20$$7, _21$$7, _22$$7, _23$$7, _27$$9, _28$$9, _29$$10, _30$$10; zend_long direction, ZEPHIR_LAST_CALL_STATUS, x = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_24$$3); + ZVAL_UNDEF(&_25$$3); + ZVAL_UNDEF(&_26$$3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_12$$5); + ZVAL_UNDEF(&_13$$5); + ZVAL_UNDEF(&_15$$6); + ZVAL_UNDEF(&_16$$7); + ZVAL_UNDEF(&_17$$7); + ZVAL_UNDEF(&_18$$7); + ZVAL_UNDEF(&_19$$7); + ZVAL_UNDEF(&_20$$7); + ZVAL_UNDEF(&_21$$7); + ZVAL_UNDEF(&_22$$7); + ZVAL_UNDEF(&_23$$7); + ZVAL_UNDEF(&_27$$9); + ZVAL_UNDEF(&_28$$9); + ZVAL_UNDEF(&_29$$10); + ZVAL_UNDEF(&_30$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &direction_param); @@ -555,88 +690,76 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _flip) { direction = zephir_get_intval(direction_param); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_GET_CONSTANT(_0, "PHP_VERSION"); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "5.5.0", 0); - ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 265, _0, &_1); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_GET_CONSTANT(&_0, "PHP_VERSION"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "5.5.0"); + ZEPHIR_CALL_FUNCTION(&_2, "version_compare", NULL, 227, &_0, &_1); zephir_check_call_status(); - if (ZEPHIR_LT_LONG(_2, 0)) { - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _4$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&image, this_ptr, "_create", NULL, 0, _3$$3, _4$$3); + if (ZEPHIR_LT_LONG(&_2, 0)) { + zephir_read_property(&_3$$3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_4$$3, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&image, this_ptr, "_create", NULL, 0, &_3$$3, &_4$$3); zephir_check_call_status(); if (direction == 11) { x = 0; while (1) { - _5$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - if (!(ZEPHIR_GT_LONG(_5$$4, x))) { + zephir_read_property(&_5$$4, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_GT_LONG(&_5$$4, x))) { break; } x++; - _6$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - _7$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _8$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_9$$5); + zephir_read_property(&_6$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_7$$5, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_8$$5, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_9$$5, x); - ZEPHIR_SINIT_NVAR(_10$$5); ZVAL_LONG(&_10$$5, 0); - ZEPHIR_SINIT_NVAR(_11$$5); - ZVAL_LONG(&_11$$5, ((zephir_get_numberval(_7$$5) - x) - 1)); - ZEPHIR_SINIT_NVAR(_12$$5); + ZVAL_LONG(&_11$$5, ((zephir_get_numberval(&_7$$5) - x) - 1)); ZVAL_LONG(&_12$$5, 0); - ZEPHIR_SINIT_NVAR(_13$$5); ZVAL_LONG(&_13$$5, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", &_14, 285, image, _6$$5, &_9$$5, &_10$$5, &_11$$5, &_12$$5, &_13$$5, _8$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", &_14, 246, &image, &_6$$5, &_9$$5, &_10$$5, &_11$$5, &_12$$5, &_13$$5, &_8$$5); zephir_check_call_status(); } } else { x = 0; while (1) { - _15$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - if (!(ZEPHIR_GT_LONG(_15$$6, x))) { + zephir_read_property(&_15$$6, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_GT_LONG(&_15$$6, x))) { break; } x++; - _16$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - _17$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - _18$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_19$$7); + zephir_read_property(&_16$$7, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_17$$7, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_18$$7, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_19$$7, 0); - ZEPHIR_SINIT_NVAR(_20$$7); ZVAL_LONG(&_20$$7, x); - ZEPHIR_SINIT_NVAR(_21$$7); ZVAL_LONG(&_21$$7, 0); - ZEPHIR_SINIT_NVAR(_22$$7); - ZVAL_LONG(&_22$$7, ((zephir_get_numberval(_17$$7) - x) - 1)); - ZEPHIR_SINIT_NVAR(_23$$7); + ZVAL_LONG(&_22$$7, ((zephir_get_numberval(&_17$$7) - x) - 1)); ZVAL_LONG(&_23$$7, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", &_14, 285, image, _16$$7, &_19$$7, &_20$$7, &_21$$7, &_22$$7, _18$$7, &_23$$7); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", &_14, 246, &image, &_16$$7, &_19$$7, &_20$$7, &_21$$7, &_22$$7, &_18$$7, &_23$$7); zephir_check_call_status(); } } - _24$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _24$$3); + zephir_read_property(&_24$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_24$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), image TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_25$$3, "imagesx", NULL, 278, image); + zephir_update_property_zval(this_ptr, SL("_image"), &image); + ZEPHIR_CALL_FUNCTION(&_25$$3, "imagesx", NULL, 239, &image); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _25$$3 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_26$$3, "imagesy", NULL, 279, image); + zephir_update_property_zval(this_ptr, SL("_width"), &_25$$3); + ZEPHIR_CALL_FUNCTION(&_26$$3, "imagesy", NULL, 240, &image); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _26$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_26$$3); } else { if (direction == 11) { - _27$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_28$$9); + zephir_read_property(&_27$$9, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_28$$9, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 286, _27$$9, &_28$$9); + ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 247, &_27$$9, &_28$$9); zephir_check_call_status(); } else { - _29$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_30$$10); + zephir_read_property(&_29$$10, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_30$$10, 2); - ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 286, _29$$10, &_30$$10); + ZEPHIR_CALL_FUNCTION(NULL, "imageflip", NULL, 247, &_29$$10, &_30$$10); zephir_check_call_status(); } } @@ -646,9 +769,25 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _flip) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _sharpen) { - zval *_3 = NULL; - zval *amount_param = NULL, *matrix = NULL, *_0, _1 = zval_used_for_init, *_2 = NULL, *_4 = NULL, *_5, _6, _7, *_8 = NULL, *_9$$3, *_10$$3 = NULL, *_11$$3, *_12$$3 = NULL; + zval _3; + zval *amount_param = NULL, matrix, _0, _1, _2, _4, _5, _6, _7, _8, _9$$3, _10$$3, _11$$3, _12$$3; zend_long amount, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&matrix); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_10$$3); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &amount_param); @@ -656,69 +795,65 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _sharpen) { amount = zephir_get_intval(amount_param); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_SINIT_VAR(_1); + ZEPHIR_INIT_VAR(&_0); ZVAL_LONG(&_1, (-18 + ((amount * 0.08)))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 213, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 189, &_1); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_1); ZVAL_LONG(&_1, 2); - zephir_round(_0, _2, &_1, NULL TSRMLS_CC); - amount = zephir_get_intval(_0); - ZEPHIR_INIT_VAR(matrix); - zephir_create_array(matrix, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3); - zephir_create_array(_3, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, -1); - zephir_array_fast_append(_3, _4); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, -1); - zephir_array_fast_append(_3, _4); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, -1); - zephir_array_fast_append(_3, _4); - zephir_array_fast_append(matrix, _3); - ZEPHIR_INIT_NVAR(_3); - zephir_create_array(_3, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, -1); - zephir_array_fast_append(_3, _4); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, amount); - zephir_array_fast_append(_3, _4); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, -1); - zephir_array_fast_append(_3, _4); - zephir_array_fast_append(matrix, _3); - ZEPHIR_INIT_NVAR(_3); - zephir_create_array(_3, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, -1); - zephir_array_fast_append(_3, _4); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, -1); - zephir_array_fast_append(_3, _4); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, -1); - zephir_array_fast_append(_3, _4); - zephir_array_fast_append(matrix, _3); - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_6); + zephir_round(&_0, &_2, &_1, NULL TSRMLS_CC); + amount = zephir_get_intval(&_0); + ZEPHIR_INIT_VAR(&matrix); + zephir_create_array(&matrix, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3); + zephir_create_array(&_3, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4); + ZVAL_LONG(&_4, -1); + zephir_array_fast_append(&_3, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_LONG(&_4, -1); + zephir_array_fast_append(&_3, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_LONG(&_4, -1); + zephir_array_fast_append(&_3, &_4); + zephir_array_fast_append(&matrix, &_3); + ZEPHIR_INIT_NVAR(&_3); + zephir_create_array(&_3, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_LONG(&_4, -1); + zephir_array_fast_append(&_3, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_LONG(&_4, amount); + zephir_array_fast_append(&_3, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_LONG(&_4, -1); + zephir_array_fast_append(&_3, &_4); + zephir_array_fast_append(&matrix, &_3); + ZEPHIR_INIT_NVAR(&_3); + zephir_create_array(&_3, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_LONG(&_4, -1); + zephir_array_fast_append(&_3, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_LONG(&_4, -1); + zephir_array_fast_append(&_3, &_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_LONG(&_4, -1); + zephir_array_fast_append(&_3, &_4); + zephir_array_fast_append(&matrix, &_3); + zephir_read_property(&_5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_6, (amount - 8)); - ZEPHIR_SINIT_VAR(_7); ZVAL_LONG(&_7, 0); - ZEPHIR_CALL_FUNCTION(&_8, "imageconvolution", NULL, 287, _5, matrix, &_6, &_7); + ZEPHIR_CALL_FUNCTION(&_8, "imageconvolution", NULL, 248, &_5, &matrix, &_6, &_7); zephir_check_call_status(); - if (zephir_is_true(_8)) { - _9$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_10$$3, "imagesx", NULL, 278, _9$$3); + if (zephir_is_true(&_8)) { + zephir_read_property(&_9$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_10$$3, "imagesx", NULL, 239, &_9$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _10$$3 TSRMLS_CC); - _11$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_12$$3, "imagesy", NULL, 279, _11$$3); + zephir_update_property_zval(this_ptr, SL("_width"), &_10$$3); + zephir_read_property(&_11$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_12$$3, "imagesy", NULL, 240, &_11$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _12$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_12$$3); } ZEPHIR_MM_RESTORE(); @@ -726,10 +861,42 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _sharpen) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _reflection) { - zephir_fcall_cache_entry *_27 = NULL; + zephir_fcall_cache_entry *_25 = NULL; zend_bool fadeIn; - zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, *reflection = NULL, *line = NULL, *_0, _1 = zval_used_for_init, *_2 = NULL, *_3, *_4, *_5, *_6, *_7, *_8, _9, _10, _11, *_29, *_30 = NULL, *_31 = NULL, *_12$$5, *_13$$5, *_18$$5, *_19$$5 = NULL, *_20$$5, *_21$$5, _22$$5 = zval_used_for_init, _23$$5 = zval_used_for_init, _24$$5 = zval_used_for_init, _25$$5 = zval_used_for_init, _26$$5 = zval_used_for_init, *_28$$5, *_14$$6 = NULL, _15$$6 = zval_used_for_init, *_16$$7 = NULL, _17$$7 = zval_used_for_init; + zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, reflection, line, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _27, _28, _11$$5, _12$$5, _17$$5, _18$$5, _19$$5, _20$$5, _21$$5, _22$$5, _23$$5, _24$$5, _26$$5, _13$$6, _14$$6, _15$$7, _16$$7; zend_long height, opacity, ZEPHIR_LAST_CALL_STATUS, stepping = 0, offset = 0, src_y = 0, dst_y = 0, dst_opacity = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&reflection); + ZVAL_UNDEF(&line); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_27); + ZVAL_UNDEF(&_28); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_12$$5); + ZVAL_UNDEF(&_17$$5); + ZVAL_UNDEF(&_18$$5); + ZVAL_UNDEF(&_19$$5); + ZVAL_UNDEF(&_20$$5); + ZVAL_UNDEF(&_21$$5); + ZVAL_UNDEF(&_22$$5); + ZVAL_UNDEF(&_23$$5); + ZVAL_UNDEF(&_24$$5); + ZVAL_UNDEF(&_26$$5); + ZVAL_UNDEF(&_13$$6); + ZVAL_UNDEF(&_14$$6); + ZVAL_UNDEF(&_15$$7); + ZVAL_UNDEF(&_16$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &height_param, &opacity_param, &fadeIn_param); @@ -739,115 +906,91 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _reflection) { fadeIn = zephir_get_boolval(fadeIn_param); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_SINIT_VAR(_1); + ZEPHIR_INIT_VAR(&_0); ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100 TSRMLS_CC)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 213, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 189, &_1); zephir_check_call_status(); - zephir_round(_0, _2, NULL, NULL TSRMLS_CC); - opacity = zephir_get_intval(_0); + zephir_round(&_0, &_2, NULL, NULL TSRMLS_CC); + opacity = zephir_get_intval(&_0); if (opacity < 127) { stepping = (long) (zephir_safe_div_long_long(((127 - opacity)), height TSRMLS_CC)); } else { stepping = (long) (zephir_safe_div_long_long(127, height TSRMLS_CC)); } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_5); - ZVAL_LONG(_5, (zephir_get_numberval(_4) + height)); - ZEPHIR_CALL_METHOD(&reflection, this_ptr, "_create", NULL, 0, _3, _5); + zephir_read_property(&_1, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_3, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_4, (zephir_get_numberval(&_3) + height)); + ZEPHIR_CALL_METHOD(&reflection, this_ptr, "_create", NULL, 0, &_1, &_4); zephir_check_call_status(); - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - _7 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _8 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_1); - ZVAL_LONG(&_1, 0); - ZEPHIR_SINIT_VAR(_9); + zephir_read_property(&_4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_5, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_6, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_7, 0); + ZVAL_LONG(&_8, 0); ZVAL_LONG(&_9, 0); - ZEPHIR_SINIT_VAR(_10); ZVAL_LONG(&_10, 0); - ZEPHIR_SINIT_VAR(_11); - ZVAL_LONG(&_11, 0); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 285, reflection, _6, &_1, &_9, &_10, &_11, _7, _8); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 246, &reflection, &_4, &_7, &_8, &_9, &_10, &_5, &_6); zephir_check_call_status(); offset = 0; while (1) { if (!(height >= offset)) { break; } - _12$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - src_y = ((zephir_get_numberval(_12$$5) - offset) - 1); - _13$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - dst_y = (zephir_get_numberval(_13$$5) + offset); + zephir_read_property(&_11$$5, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + src_y = ((zephir_get_numberval(&_11$$5) - offset) - 1); + zephir_read_property(&_12$$5, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + dst_y = (zephir_get_numberval(&_12$$5) + offset); if (fadeIn) { - ZEPHIR_INIT_NVAR(_14$$6); - ZEPHIR_SINIT_NVAR(_15$$6); - ZVAL_LONG(&_15$$6, (opacity + ((stepping * ((height - offset)))))); - zephir_round(_14$$6, &_15$$6, NULL, NULL TSRMLS_CC); - dst_opacity = zephir_get_intval(_14$$6); + ZEPHIR_INIT_NVAR(&_13$$6); + ZVAL_LONG(&_14$$6, (opacity + ((stepping * ((height - offset)))))); + zephir_round(&_13$$6, &_14$$6, NULL, NULL TSRMLS_CC); + dst_opacity = zephir_get_intval(&_13$$6); } else { - ZEPHIR_INIT_NVAR(_16$$7); - ZEPHIR_SINIT_NVAR(_17$$7); - ZVAL_LONG(&_17$$7, (opacity + ((stepping * offset)))); - zephir_round(_16$$7, &_17$$7, NULL, NULL TSRMLS_CC); - dst_opacity = zephir_get_intval(_16$$7); + ZEPHIR_INIT_NVAR(&_15$$7); + ZVAL_LONG(&_16$$7, (opacity + ((stepping * offset)))); + zephir_round(&_15$$7, &_16$$7, NULL, NULL TSRMLS_CC); + dst_opacity = zephir_get_intval(&_15$$7); } - _18$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_19$$5); - ZVAL_LONG(_19$$5, 1); - ZEPHIR_CALL_METHOD(&line, this_ptr, "_create", NULL, 0, _18$$5, _19$$5); - zephir_check_call_status(); - _20$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - _21$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_22$$5); + zephir_read_property(&_17$$5, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_18$$5, 1); + ZEPHIR_CALL_METHOD(&line, this_ptr, "_create", NULL, 0, &_17$$5, &_18$$5); + zephir_check_call_status(); + zephir_read_property(&_18$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_19$$5, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_20$$5, 0); + ZVAL_LONG(&_21$$5, 0); + ZVAL_LONG(&_22$$5, 0); + ZVAL_LONG(&_23$$5, src_y); + ZVAL_LONG(&_24$$5, 1); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 246, &line, &_18$$5, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_19$$5, &_24$$5); + zephir_check_call_status(); + ZVAL_LONG(&_20$$5, 4); + ZVAL_LONG(&_21$$5, 0); ZVAL_LONG(&_22$$5, 0); - ZEPHIR_SINIT_NVAR(_23$$5); ZVAL_LONG(&_23$$5, 0); - ZEPHIR_SINIT_NVAR(_24$$5); - ZVAL_LONG(&_24$$5, 0); - ZEPHIR_SINIT_NVAR(_25$$5); - ZVAL_LONG(&_25$$5, src_y); - ZEPHIR_SINIT_NVAR(_26$$5); - ZVAL_LONG(&_26$$5, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 285, line, _20$$5, &_22$$5, &_23$$5, &_24$$5, &_25$$5, _21$$5, &_26$$5); + ZVAL_LONG(&_24$$5, dst_opacity); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_25, 249, &line, &_20$$5, &_21$$5, &_22$$5, &_23$$5, &_24$$5); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_22$$5); - ZVAL_LONG(&_22$$5, 4); - ZEPHIR_SINIT_NVAR(_23$$5); + zephir_read_property(&_20$$5, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_21$$5, 0); + ZVAL_LONG(&_22$$5, dst_y); ZVAL_LONG(&_23$$5, 0); - ZEPHIR_SINIT_NVAR(_24$$5); - ZVAL_LONG(&_24$$5, 0); - ZEPHIR_SINIT_NVAR(_25$$5); - ZVAL_LONG(&_25$$5, 0); - ZEPHIR_SINIT_NVAR(_26$$5); - ZVAL_LONG(&_26$$5, dst_opacity); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_27, 288, line, &_22$$5, &_23$$5, &_24$$5, &_25$$5, &_26$$5); - zephir_check_call_status(); - _28$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_22$$5); - ZVAL_LONG(&_22$$5, 0); - ZEPHIR_SINIT_NVAR(_23$$5); - ZVAL_LONG(&_23$$5, dst_y); - ZEPHIR_SINIT_NVAR(_24$$5); ZVAL_LONG(&_24$$5, 0); - ZEPHIR_SINIT_NVAR(_25$$5); - ZVAL_LONG(&_25$$5, 0); - ZEPHIR_SINIT_NVAR(_26$$5); ZVAL_LONG(&_26$$5, 1); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 285, reflection, line, &_22$$5, &_23$$5, &_24$$5, &_25$$5, _28$$5, &_26$$5); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopy", NULL, 246, &reflection, &line, &_21$$5, &_22$$5, &_23$$5, &_24$$5, &_20$$5, &_26$$5); zephir_check_call_status(); offset++; } - _29 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _29); + zephir_read_property(&_7, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_7); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), reflection TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_30, "imagesx", NULL, 278, reflection); + zephir_update_property_zval(this_ptr, SL("_image"), &reflection); + ZEPHIR_CALL_FUNCTION(&_27, "imagesx", NULL, 239, &reflection); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _30 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_31, "imagesy", NULL, 279, reflection); + zephir_update_property_zval(this_ptr, SL("_width"), &_27); + ZEPHIR_CALL_FUNCTION(&_28, "imagesy", NULL, 240, &reflection); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _31 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_28); ZEPHIR_MM_RESTORE(); } @@ -855,7 +998,31 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _reflection) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _watermark) { zend_long offsetX, offsetY, opacity, ZEPHIR_LAST_CALL_STATUS, width = 0, height = 0; - zval *watermark, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, *overlay = NULL, *color = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_9, *_10, _11, _12, _13, _14, _15, _16, *_17 = NULL, *_3$$3, _4$$3 = zval_used_for_init, *_5$$3 = NULL, _6$$3 = zval_used_for_init, _7$$3 = zval_used_for_init, _8$$3 = zval_used_for_init; + zval *watermark, watermark_sub, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, __$true, overlay, color, _0, _1, _2, _9, _10, _11, _12, _13, _14, _15, _16, _17, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&watermark_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&overlay); + ZVAL_UNDEF(&color); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_15); + ZVAL_UNDEF(&_16); + ZVAL_UNDEF(&_17); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_8$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &watermark, &offsetX_param, &offsetY_param, &opacity_param); @@ -867,69 +1034,53 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _watermark) { ZEPHIR_CALL_METHOD(&_0, watermark, "render", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&overlay, "imagecreatefromstring", NULL, 289, _0); + ZEPHIR_CALL_FUNCTION(&overlay, "imagecreatefromstring", NULL, 250, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 272, overlay, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 233, &overlay, &__$true); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 278, overlay); + ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 239, &overlay); zephir_check_call_status(); - width = zephir_get_intval(_1); - ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 279, overlay); + width = zephir_get_intval(&_1); + ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 240, &overlay); zephir_check_call_status(); - height = zephir_get_intval(_2); + height = zephir_get_intval(&_2); if (opacity < 100) { - ZEPHIR_INIT_VAR(_3$$3); - ZEPHIR_SINIT_VAR(_4$$3); + ZEPHIR_INIT_VAR(&_3$$3); ZVAL_DOUBLE(&_4$$3, ((zephir_safe_div_long_long((opacity * 127), 100 TSRMLS_CC)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_5$$3, "abs", NULL, 213, &_4$$3); + ZEPHIR_CALL_FUNCTION(&_5$$3, "abs", NULL, 189, &_4$$3); zephir_check_call_status(); - zephir_round(_3$$3, _5$$3, NULL, NULL TSRMLS_CC); - opacity = zephir_get_intval(_3$$3); - ZEPHIR_SINIT_NVAR(_4$$3); + zephir_round(&_3$$3, &_5$$3, NULL, NULL TSRMLS_CC); + opacity = zephir_get_intval(&_3$$3); ZVAL_LONG(&_4$$3, 127); - ZEPHIR_SINIT_VAR(_6$$3); ZVAL_LONG(&_6$$3, 127); - ZEPHIR_SINIT_VAR(_7$$3); ZVAL_LONG(&_7$$3, 127); - ZEPHIR_SINIT_VAR(_8$$3); ZVAL_LONG(&_8$$3, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 282, overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 243, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_4$$3); ZVAL_LONG(&_4$$3, 3); - ZEPHIR_CALL_FUNCTION(NULL, "imagelayereffect", NULL, 290, overlay, &_4$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagelayereffect", NULL, 251, &overlay, &_4$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_4$$3); ZVAL_LONG(&_4$$3, 0); - ZEPHIR_SINIT_NVAR(_6$$3); ZVAL_LONG(&_6$$3, 0); - ZEPHIR_SINIT_NVAR(_7$$3); ZVAL_LONG(&_7$$3, width); - ZEPHIR_SINIT_NVAR(_8$$3); ZVAL_LONG(&_8$$3, height); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", NULL, 291, overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3, color); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", NULL, 252, &overlay, &_4$$3, &_6$$3, &_7$$3, &_8$$3, &color); zephir_check_call_status(); } - _9 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 274, _9, ZEPHIR_GLOBAL(global_true)); + zephir_read_property(&_9, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 235, &_9, &__$true); zephir_check_call_status(); - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_11); + zephir_read_property(&_10, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_11, offsetX); - ZEPHIR_SINIT_VAR(_12); ZVAL_LONG(&_12, offsetY); - ZEPHIR_SINIT_VAR(_13); ZVAL_LONG(&_13, 0); - ZEPHIR_SINIT_VAR(_14); ZVAL_LONG(&_14, 0); - ZEPHIR_SINIT_VAR(_15); ZVAL_LONG(&_15, width); - ZEPHIR_SINIT_VAR(_16); ZVAL_LONG(&_16, height); - ZEPHIR_CALL_FUNCTION(&_17, "imagecopy", NULL, 285, _10, overlay, &_11, &_12, &_13, &_14, &_15, &_16); + ZEPHIR_CALL_FUNCTION(&_17, "imagecopy", NULL, 246, &_10, &overlay, &_11, &_12, &_13, &_14, &_15, &_16); zephir_check_call_status(); - if (zephir_is_true(_17)) { - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, overlay); + if (zephir_is_true(&_17)) { + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &overlay); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -940,13 +1091,45 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _text) { zend_bool _9$$3, _10$$3, _11$$3; zend_long offsetX, offsetY, opacity, r, g, b, size, ZEPHIR_LAST_CALL_STATUS, angle = 0, s0, s1, s4, s5, width = 0, height = 0; - zval *text_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, *r_param = NULL, *g_param = NULL, *b_param = NULL, *size_param = NULL, *fontfile_param = NULL, *space = NULL, *color = NULL, *_0, _1, *_2 = NULL, *_3$$3 = NULL, *_4$$3 = NULL, _12$$3 = zval_used_for_init, *_13$$3 = NULL, *_14$$3 = NULL, *_17$$3, _18$$3, _19$$3, _20$$3, *_21$$3, *_22$$3, *_23$$3, *_5$$4, *_6$$4, *_7$$4, *_8$$4, *_15$$6, *_16$$7, _24$$8 = zval_used_for_init, *_25$$8 = NULL, *_26$$8 = NULL, *_29$$8, _30$$8 = zval_used_for_init, _31$$8 = zval_used_for_init, _32$$8, *_33$$8, *_27$$9, *_28$$10; - zval *text = NULL, *fontfile = NULL; + zval *text_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, *r_param = NULL, *g_param = NULL, *b_param = NULL, *size_param = NULL, *fontfile_param = NULL, space, color, _0, _1, _2, _3$$3, _4$$3, _12$$3, _13$$3, _16$$3, _17$$3, _18$$3, _19$$3, _5$$4, _6$$4, _7$$4, _8$$4, _14$$6, _15$$7, _20$$8, _21$$8, _22$$8, _25$$8, _26$$8, _27$$8, _28$$8, _23$$9, _24$$10; + zval text, fontfile; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&fontfile); + ZVAL_UNDEF(&space); + ZVAL_UNDEF(&color); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_13$$3); + ZVAL_UNDEF(&_16$$3); + ZVAL_UNDEF(&_17$$3); + ZVAL_UNDEF(&_18$$3); + ZVAL_UNDEF(&_19$$3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$4); + ZVAL_UNDEF(&_14$$6); + ZVAL_UNDEF(&_15$$7); + ZVAL_UNDEF(&_20$$8); + ZVAL_UNDEF(&_21$$8); + ZVAL_UNDEF(&_22$$8); + ZVAL_UNDEF(&_25$$8); + ZVAL_UNDEF(&_26$$8); + ZVAL_UNDEF(&_27$$8); + ZVAL_UNDEF(&_28$$8); + ZVAL_UNDEF(&_23$$9); + ZVAL_UNDEF(&_24$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 9, 0, &text_param, &offsetX_param, &offsetY_param, &opacity_param, &r_param, &g_param, &b_param, &size_param, &fontfile_param); - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); offsetX = zephir_get_intval(offsetX_param); offsetY = zephir_get_intval(offsetY_param); opacity = zephir_get_intval(opacity_param); @@ -954,40 +1137,37 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _text) { g = zephir_get_intval(g_param); b = zephir_get_intval(b_param); size = zephir_get_intval(size_param); - zephir_get_strval(fontfile, fontfile_param); + zephir_get_strval(&fontfile, fontfile_param); s0 = 0; s1 = 0; s4 = 0; s5 = 0; - ZEPHIR_INIT_VAR(_0); - ZEPHIR_SINIT_VAR(_1); + ZEPHIR_INIT_VAR(&_0); ZVAL_DOUBLE(&_1, ((zephir_safe_div_long_long((opacity * 127), 100 TSRMLS_CC)) - (double) (127))); - ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 213, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "abs", NULL, 189, &_1); zephir_check_call_status(); - zephir_round(_0, _2, NULL, NULL TSRMLS_CC); - opacity = zephir_get_intval(_0); - if (!(!fontfile) && Z_STRLEN_P(fontfile)) { - ZEPHIR_INIT_VAR(_3$$3); - ZVAL_LONG(_3$$3, size); - ZEPHIR_INIT_VAR(_4$$3); - ZVAL_LONG(_4$$3, 0); - ZEPHIR_CALL_FUNCTION(&space, "imagettfbbox", NULL, 0, _3$$3, _4$$3, fontfile, text); - zephir_check_call_status(); - if (zephir_array_isset_long(space, 0)) { - ZEPHIR_OBS_VAR(_5$$4); - zephir_array_fetch_long(&_5$$4, space, 0, PH_NOISY, "phalcon/image/adapter/gd.zep", 350 TSRMLS_CC); - s0 = zephir_get_intval(_5$$4); - ZEPHIR_OBS_VAR(_6$$4); - zephir_array_fetch_long(&_6$$4, space, 1, PH_NOISY, "phalcon/image/adapter/gd.zep", 351 TSRMLS_CC); - s1 = zephir_get_intval(_6$$4); - ZEPHIR_OBS_VAR(_7$$4); - zephir_array_fetch_long(&_7$$4, space, 4, PH_NOISY, "phalcon/image/adapter/gd.zep", 352 TSRMLS_CC); - s4 = zephir_get_intval(_7$$4); - ZEPHIR_OBS_VAR(_8$$4); - zephir_array_fetch_long(&_8$$4, space, 5, PH_NOISY, "phalcon/image/adapter/gd.zep", 353 TSRMLS_CC); - s5 = zephir_get_intval(_8$$4); + zephir_round(&_0, &_2, NULL, NULL TSRMLS_CC); + opacity = zephir_get_intval(&_0); + if (!(Z_TYPE_P(&fontfile) == IS_UNDEF) && Z_STRLEN_P(&fontfile)) { + ZVAL_LONG(&_3$$3, size); + ZVAL_LONG(&_4$$3, 0); + ZEPHIR_CALL_FUNCTION(&space, "imagettfbbox", NULL, 0, &_3$$3, &_4$$3, &fontfile, &text); + zephir_check_call_status(); + if (zephir_array_isset_long(&space, 0)) { + ZEPHIR_OBS_VAR(&_5$$4); + zephir_array_fetch_long(&_5$$4, &space, 0, PH_NOISY, "phalcon/image/adapter/gd.zep", 350 TSRMLS_CC); + s0 = zephir_get_intval(&_5$$4); + ZEPHIR_OBS_VAR(&_6$$4); + zephir_array_fetch_long(&_6$$4, &space, 1, PH_NOISY, "phalcon/image/adapter/gd.zep", 351 TSRMLS_CC); + s1 = zephir_get_intval(&_6$$4); + ZEPHIR_OBS_VAR(&_7$$4); + zephir_array_fetch_long(&_7$$4, &space, 4, PH_NOISY, "phalcon/image/adapter/gd.zep", 352 TSRMLS_CC); + s4 = zephir_get_intval(&_7$$4); + ZEPHIR_OBS_VAR(&_8$$4); + zephir_array_fetch_long(&_8$$4, &space, 5, PH_NOISY, "phalcon/image/adapter/gd.zep", 353 TSRMLS_CC); + s5 = zephir_get_intval(&_8$$4); } _9$$3 = !s0; if (!(_9$$3)) { @@ -1005,85 +1185,66 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _text) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Call to imagettfbbox() failed", "phalcon/image/adapter/gd.zep", 357); return; } - ZEPHIR_SINIT_VAR(_12$$3); - ZVAL_LONG(&_12$$3, (s4 - s0)); - ZEPHIR_CALL_FUNCTION(&_13$$3, "abs", NULL, 213, &_12$$3); + ZVAL_LONG(&_3$$3, (s4 - s0)); + ZEPHIR_CALL_FUNCTION(&_12$$3, "abs", NULL, 189, &_3$$3); zephir_check_call_status(); - width = (zephir_get_numberval(_13$$3) + 10); - ZEPHIR_SINIT_NVAR(_12$$3); - ZVAL_LONG(&_12$$3, (s5 - s1)); - ZEPHIR_CALL_FUNCTION(&_14$$3, "abs", NULL, 213, &_12$$3); + width = (zephir_get_numberval(&_12$$3) + 10); + ZVAL_LONG(&_3$$3, (s5 - s1)); + ZEPHIR_CALL_FUNCTION(&_13$$3, "abs", NULL, 189, &_3$$3); zephir_check_call_status(); - height = (zephir_get_numberval(_14$$3) + 10); + height = (zephir_get_numberval(&_13$$3) + 10); if (offsetX < 0) { - _15$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - offsetX = ((zephir_get_numberval(_15$$6) - width) + offsetX); + zephir_read_property(&_14$$6, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + offsetX = ((zephir_get_numberval(&_14$$6) - width) + offsetX); } if (offsetY < 0) { - _16$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - offsetY = ((zephir_get_numberval(_16$$7) - height) + offsetY); + zephir_read_property(&_15$$7, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + offsetY = ((zephir_get_numberval(&_15$$7) - height) + offsetY); } - _17$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_12$$3); - ZVAL_LONG(&_12$$3, r); - ZEPHIR_SINIT_VAR(_18$$3); - ZVAL_LONG(&_18$$3, g); - ZEPHIR_SINIT_VAR(_19$$3); - ZVAL_LONG(&_19$$3, b); - ZEPHIR_SINIT_VAR(_20$$3); - ZVAL_LONG(&_20$$3, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 282, _17$$3, &_12$$3, &_18$$3, &_19$$3, &_20$$3); + zephir_read_property(&_3$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_4$$3, r); + ZVAL_LONG(&_16$$3, g); + ZVAL_LONG(&_17$$3, b); + ZVAL_LONG(&_18$$3, opacity); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 243, &_3$$3, &_4$$3, &_16$$3, &_17$$3, &_18$$3); zephir_check_call_status(); angle = 0; - _21$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_3$$3); - ZVAL_LONG(_3$$3, size); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_LONG(_4$$3, angle); - ZEPHIR_INIT_VAR(_22$$3); - ZVAL_LONG(_22$$3, offsetX); - ZEPHIR_INIT_VAR(_23$$3); - ZVAL_LONG(_23$$3, offsetY); - ZEPHIR_CALL_FUNCTION(NULL, "imagettftext", NULL, 0, _21$$3, _3$$3, _4$$3, _22$$3, _23$$3, color, fontfile, text); + zephir_read_property(&_4$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_16$$3, size); + ZVAL_LONG(&_17$$3, angle); + ZVAL_LONG(&_18$$3, offsetX); + ZVAL_LONG(&_19$$3, offsetY); + ZEPHIR_CALL_FUNCTION(NULL, "imagettftext", NULL, 0, &_4$$3, &_16$$3, &_17$$3, &_18$$3, &_19$$3, &color, &fontfile, &text); zephir_check_call_status(); } else { - ZEPHIR_SINIT_VAR(_24$$8); - ZVAL_LONG(&_24$$8, size); - ZEPHIR_CALL_FUNCTION(&_25$$8, "imagefontwidth", NULL, 292, &_24$$8); + ZVAL_LONG(&_20$$8, size); + ZEPHIR_CALL_FUNCTION(&_21$$8, "imagefontwidth", NULL, 253, &_20$$8); zephir_check_call_status(); - width = (zephir_get_intval(_25$$8) * zephir_fast_strlen_ev(text)); - ZEPHIR_SINIT_NVAR(_24$$8); - ZVAL_LONG(&_24$$8, size); - ZEPHIR_CALL_FUNCTION(&_26$$8, "imagefontheight", NULL, 293, &_24$$8); + width = (zephir_get_intval(&_21$$8) * zephir_fast_strlen_ev(&text)); + ZVAL_LONG(&_20$$8, size); + ZEPHIR_CALL_FUNCTION(&_22$$8, "imagefontheight", NULL, 254, &_20$$8); zephir_check_call_status(); - height = zephir_get_intval(_26$$8); + height = zephir_get_intval(&_22$$8); if (offsetX < 0) { - _27$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - offsetX = ((zephir_get_numberval(_27$$9) - width) + offsetX); + zephir_read_property(&_23$$9, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + offsetX = ((zephir_get_numberval(&_23$$9) - width) + offsetX); } if (offsetY < 0) { - _28$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - offsetY = ((zephir_get_numberval(_28$$10) - height) + offsetY); + zephir_read_property(&_24$$10, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + offsetY = ((zephir_get_numberval(&_24$$10) - height) + offsetY); } - _29$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_24$$8); - ZVAL_LONG(&_24$$8, r); - ZEPHIR_SINIT_VAR(_30$$8); - ZVAL_LONG(&_30$$8, g); - ZEPHIR_SINIT_VAR(_31$$8); - ZVAL_LONG(&_31$$8, b); - ZEPHIR_SINIT_VAR(_32$$8); - ZVAL_LONG(&_32$$8, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 282, _29$$8, &_24$$8, &_30$$8, &_31$$8, &_32$$8); - zephir_check_call_status(); - _33$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_24$$8); - ZVAL_LONG(&_24$$8, size); - ZEPHIR_SINIT_NVAR(_30$$8); - ZVAL_LONG(&_30$$8, offsetX); - ZEPHIR_SINIT_NVAR(_31$$8); - ZVAL_LONG(&_31$$8, offsetY); - ZEPHIR_CALL_FUNCTION(NULL, "imagestring", NULL, 294, _33$$8, &_24$$8, &_30$$8, &_31$$8, text, color); + zephir_read_property(&_20$$8, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_25$$8, r); + ZVAL_LONG(&_26$$8, g); + ZVAL_LONG(&_27$$8, b); + ZVAL_LONG(&_28$$8, opacity); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 243, &_20$$8, &_25$$8, &_26$$8, &_27$$8, &_28$$8); + zephir_check_call_status(); + zephir_read_property(&_25$$8, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_26$$8, size); + ZVAL_LONG(&_27$$8, offsetX); + ZVAL_LONG(&_28$$8, offsetY); + ZEPHIR_CALL_FUNCTION(NULL, "imagestring", NULL, 255, &_25$$8, &_26$$8, &_27$$8, &_28$$8, &text, &color); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -1092,10 +1253,48 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _text) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _mask) { - zend_bool _10; - zephir_fcall_cache_entry *_26 = NULL, *_27 = NULL, *_32 = NULL; + zend_bool _9; + zephir_fcall_cache_entry *_23 = NULL, *_24 = NULL, *_29 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, mask_width = 0, mask_height = 0, x = 0, y = 0, alpha = 0; - zval *mask, *maskImage = NULL, *newimage = NULL, *tempImage = NULL, *color = NULL, *index = NULL, *r = NULL, *g = NULL, *b = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_3, *_4, _5 = zval_used_for_init, _6 = zval_used_for_init, _7, _8, *_9, *_11, *_22, *_33, *_12$$3, *_13$$3, *_14$$3, *_15$$3, _16$$3, _17$$3, _18$$3, _19$$3, _20$$3, _21$$3, *_23$$4, _24$$5 = zval_used_for_init, _25$$5 = zval_used_for_init, *_30$$5, *_31$$5, *_28$$6, _29$$6 = zval_used_for_init; + zval *mask, mask_sub, __$true, maskImage, newimage, tempImage, color, index, r, g, b, _0, _1, _2, _3, _4, _5, _6, _7, _8, _10$$3, _11$$3, _12$$3, _13$$3, _14$$3, _15$$3, _16$$3, _17$$3, _18$$3, _19$$3, _20$$4, _21$$5, _22$$5, _27$$5, _28$$5, _25$$6, _26$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&mask_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&maskImage); + ZVAL_UNDEF(&newimage); + ZVAL_UNDEF(&tempImage); + ZVAL_UNDEF(&color); + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&r); + ZVAL_UNDEF(&g); + ZVAL_UNDEF(&b); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_10$$3); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_13$$3); + ZVAL_UNDEF(&_14$$3); + ZVAL_UNDEF(&_15$$3); + ZVAL_UNDEF(&_16$$3); + ZVAL_UNDEF(&_17$$3); + ZVAL_UNDEF(&_18$$3); + ZVAL_UNDEF(&_19$$3); + ZVAL_UNDEF(&_20$$4); + ZVAL_UNDEF(&_21$$5); + ZVAL_UNDEF(&_22$$5); + ZVAL_UNDEF(&_27$$5); + ZVAL_UNDEF(&_28$$5); + ZVAL_UNDEF(&_25$$6); + ZVAL_UNDEF(&_26$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &mask); @@ -1104,140 +1303,136 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _mask) { ZEPHIR_CALL_METHOD(&_0, mask, "render", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&maskImage, "imagecreatefromstring", NULL, 289, _0); + ZEPHIR_CALL_FUNCTION(&maskImage, "imagecreatefromstring", NULL, 250, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 278, maskImage); + ZEPHIR_CALL_FUNCTION(&_1, "imagesx", NULL, 239, &maskImage); zephir_check_call_status(); - mask_width = zephir_get_intval(_1); - ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 279, maskImage); + mask_width = zephir_get_intval(&_1); + ZEPHIR_CALL_FUNCTION(&_2, "imagesy", NULL, 240, &maskImage); zephir_check_call_status(); - mask_height = zephir_get_intval(_2); + mask_height = zephir_get_intval(&_2); alpha = 127; - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 272, maskImage, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 233, &maskImage, &__$true); zephir_check_call_status(); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&newimage, this_ptr, "_create", NULL, 0, _3, _4); + zephir_read_property(&_3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_4, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&newimage, this_ptr, "_create", NULL, 0, &_3, &_4); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 272, newimage, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 233, &newimage, &__$true); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_5); ZVAL_LONG(&_5, 0); - ZEPHIR_SINIT_VAR(_6); ZVAL_LONG(&_6, 0); - ZEPHIR_SINIT_VAR(_7); ZVAL_LONG(&_7, 0); - ZEPHIR_SINIT_VAR(_8); ZVAL_LONG(&_8, alpha); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 282, newimage, &_5, &_6, &_7, &_8); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 243, &newimage, &_5, &_6, &_7, &_8); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_5); ZVAL_LONG(&_5, 0); - ZEPHIR_SINIT_NVAR(_6); ZVAL_LONG(&_6, 0); - ZEPHIR_CALL_FUNCTION(NULL, "imagefill", NULL, 295, newimage, &_5, &_6, color); + ZEPHIR_CALL_FUNCTION(NULL, "imagefill", NULL, 256, &newimage, &_5, &_6, &color); zephir_check_call_status(); - _9 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _10 = !ZEPHIR_IS_LONG(_9, mask_width); - if (!(_10)) { - _11 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - _10 = !ZEPHIR_IS_LONG(_11, mask_height); + zephir_read_property(&_5, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + _9 = !ZEPHIR_IS_LONG(&_5, mask_width); + if (!(_9)) { + zephir_read_property(&_6, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + _9 = !ZEPHIR_IS_LONG(&_6, mask_height); } - if (_10) { - _12$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _13$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&tempImage, "imagecreatetruecolor", NULL, 273, _12$$3, _13$$3); - zephir_check_call_status(); - _14$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _15$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_16$$3); + if (_9) { + zephir_read_property(&_10$$3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_11$$3, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&tempImage, "imagecreatetruecolor", NULL, 234, &_10$$3, &_11$$3); + zephir_check_call_status(); + zephir_read_property(&_12$$3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_13$$3, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_14$$3, 0); + ZVAL_LONG(&_15$$3, 0); ZVAL_LONG(&_16$$3, 0); - ZEPHIR_SINIT_VAR(_17$$3); ZVAL_LONG(&_17$$3, 0); - ZEPHIR_SINIT_VAR(_18$$3); - ZVAL_LONG(&_18$$3, 0); - ZEPHIR_SINIT_VAR(_19$$3); - ZVAL_LONG(&_19$$3, 0); - ZEPHIR_SINIT_VAR(_20$$3); - ZVAL_LONG(&_20$$3, mask_width); - ZEPHIR_SINIT_VAR(_21$$3); - ZVAL_LONG(&_21$$3, mask_height); - ZEPHIR_CALL_FUNCTION(NULL, "imagecopyresampled", NULL, 277, tempImage, maskImage, &_16$$3, &_17$$3, &_18$$3, &_19$$3, _14$$3, _15$$3, &_20$$3, &_21$$3); + ZVAL_LONG(&_18$$3, mask_width); + ZVAL_LONG(&_19$$3, mask_height); + ZEPHIR_CALL_FUNCTION(NULL, "imagecopyresampled", NULL, 238, &tempImage, &maskImage, &_14$$3, &_15$$3, &_16$$3, &_17$$3, &_12$$3, &_13$$3, &_18$$3, &_19$$3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, maskImage); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &maskImage); zephir_check_call_status(); - ZEPHIR_CPY_WRT(maskImage, tempImage); + ZEPHIR_CPY_WRT(&maskImage, &tempImage); } x = 0; while (1) { - _22 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - if (!(ZEPHIR_GT_LONG(_22, x))) { + zephir_read_property(&_7, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_GT_LONG(&_7, x))) { break; } y = 0; while (1) { - _23$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - if (!(ZEPHIR_GT_LONG(_23$$4, y))) { + zephir_read_property(&_20$$4, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_GT_LONG(&_20$$4, y))) { break; } - ZEPHIR_SINIT_NVAR(_24$$5); - ZVAL_LONG(&_24$$5, x); - ZEPHIR_SINIT_NVAR(_25$$5); - ZVAL_LONG(&_25$$5, y); - ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_26, 296, maskImage, &_24$$5, &_25$$5); + ZVAL_LONG(&_21$$5, x); + ZVAL_LONG(&_22$$5, y); + ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 257, &maskImage, &_21$$5, &_22$$5); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_27, 297, maskImage, index); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 258, &maskImage, &index); zephir_check_call_status(); - if (zephir_array_isset_string(color, SS("red"))) { - zephir_array_fetch_string(&_28$$6, color, SL("red"), PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 430 TSRMLS_CC); - ZEPHIR_SINIT_NVAR(_29$$6); - ZVAL_DOUBLE(&_29$$6, zephir_safe_div_zval_long(_28$$6, 2 TSRMLS_CC)); - alpha = (127 - zephir_get_intval(&_29$$6)); + if (zephir_array_isset_string(&color, SL("red"))) { + zephir_array_fetch_string(&_25$$6, &color, SL("red"), PH_NOISY | PH_READONLY, "phalcon/image/adapter/gd.zep", 430 TSRMLS_CC); + ZVAL_DOUBLE(&_26$$6, zephir_safe_div_zval_long(&_25$$6, 2 TSRMLS_CC)); + alpha = (127 - zephir_get_intval(&_26$$6)); } - _30$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_24$$5); - ZVAL_LONG(&_24$$5, x); - ZEPHIR_SINIT_NVAR(_25$$5); - ZVAL_LONG(&_25$$5, y); - ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_26, 296, _30$$5, &_24$$5, &_25$$5); + zephir_read_property(&_21$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_22$$5, x); + ZVAL_LONG(&_27$$5, y); + ZEPHIR_CALL_FUNCTION(&index, "imagecolorat", &_23, 257, &_21$$5, &_22$$5, &_27$$5); zephir_check_call_status(); - _31$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_27, 297, _31$$5, index); + zephir_read_property(&_22$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorsforindex", &_24, 258, &_22$$5, &index); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(r); - zephir_array_fetch_string(&r, color, SL("red"), PH_NOISY, "phalcon/image/adapter/gd.zep", 435 TSRMLS_CC); - ZEPHIR_OBS_NVAR(g); - zephir_array_fetch_string(&g, color, SL("green"), PH_NOISY, "phalcon/image/adapter/gd.zep", 435 TSRMLS_CC); - ZEPHIR_OBS_NVAR(b); - zephir_array_fetch_string(&b, color, SL("blue"), PH_NOISY, "phalcon/image/adapter/gd.zep", 435 TSRMLS_CC); - ZEPHIR_SINIT_NVAR(_24$$5); - ZVAL_LONG(&_24$$5, alpha); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 282, newimage, r, g, b, &_24$$5); + ZEPHIR_OBS_NVAR(&r); + zephir_array_fetch_string(&r, &color, SL("red"), PH_NOISY, "phalcon/image/adapter/gd.zep", 435 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&g); + zephir_array_fetch_string(&g, &color, SL("green"), PH_NOISY, "phalcon/image/adapter/gd.zep", 435 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&b); + zephir_array_fetch_string(&b, &color, SL("blue"), PH_NOISY, "phalcon/image/adapter/gd.zep", 435 TSRMLS_CC); + ZVAL_LONG(&_27$$5, alpha); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 243, &newimage, &r, &g, &b, &_27$$5); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_24$$5); - ZVAL_LONG(&_24$$5, x); - ZEPHIR_SINIT_NVAR(_25$$5); - ZVAL_LONG(&_25$$5, y); - ZEPHIR_CALL_FUNCTION(NULL, "imagesetpixel", &_32, 298, newimage, &_24$$5, &_25$$5, color); + ZVAL_LONG(&_27$$5, x); + ZVAL_LONG(&_28$$5, y); + ZEPHIR_CALL_FUNCTION(NULL, "imagesetpixel", &_29, 259, &newimage, &_27$$5, &_28$$5, &color); zephir_check_call_status(); y++; } x++; } - _33 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _33); + zephir_read_property(&_8, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_8); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, maskImage); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &maskImage); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), newimage TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &newimage); ZEPHIR_MM_RESTORE(); } PHP_METHOD(Phalcon_Image_Adapter_Gd, _background) { - zval *r_param = NULL, *g_param = NULL, *b_param = NULL, *opacity_param = NULL, *background = NULL, *color = NULL, *_0, *_1, _2 = zval_used_for_init, _3 = zval_used_for_init, _4 = zval_used_for_init, _5 = zval_used_for_init, *_6, *_7, *_8, *_9 = NULL, *_10$$3; + zval *r_param = NULL, *g_param = NULL, *b_param = NULL, *opacity_param = NULL, __$true, background, color, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10$$3; zend_long r, g, b, opacity, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&background); + ZVAL_UNDEF(&color); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &r_param, &g_param, &b_param, &opacity_param); @@ -1249,40 +1444,32 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _background) { opacity = (long) (((zephir_safe_div_long_long((opacity * 127), 100 TSRMLS_CC)) - (double) (127))); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&background, this_ptr, "_create", NULL, 0, _0, _1); + zephir_read_property(&_0, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&background, this_ptr, "_create", NULL, 0, &_0, &_1); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, r); - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, g); - ZEPHIR_SINIT_VAR(_4); ZVAL_LONG(&_4, b); - ZEPHIR_SINIT_VAR(_5); ZVAL_LONG(&_5, opacity); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 282, background, &_2, &_3, &_4, &_5); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorallocatealpha", NULL, 243, &background, &_2, &_3, &_4, &_5); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 274, background, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 235, &background, &__$true); zephir_check_call_status(); - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - _7 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _8 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_2); - ZVAL_LONG(&_2, 0); - ZEPHIR_SINIT_NVAR(_3); - ZVAL_LONG(&_3, 0); - ZEPHIR_SINIT_NVAR(_4); - ZVAL_LONG(&_4, 0); - ZEPHIR_SINIT_NVAR(_5); + zephir_read_property(&_2, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_4, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_5, 0); - ZEPHIR_CALL_FUNCTION(&_9, "imagecopy", NULL, 285, background, _6, &_2, &_3, &_4, &_5, _7, _8); + ZVAL_LONG(&_6, 0); + ZVAL_LONG(&_7, 0); + ZVAL_LONG(&_8, 0); + ZEPHIR_CALL_FUNCTION(&_9, "imagecopy", NULL, 246, &background, &_2, &_5, &_6, &_7, &_8, &_3, &_4); zephir_check_call_status(); - if (zephir_is_true(_9)) { - _10$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, _10$$3); + if (zephir_is_true(&_9)) { + zephir_read_property(&_10$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &_10$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), background TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &background); } ZEPHIR_MM_RESTORE(); @@ -1291,8 +1478,12 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _background) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _blur) { zephir_fcall_cache_entry *_2 = NULL; - zval *radius_param = NULL, *_0$$3, _1$$3 = zval_used_for_init; + zval *radius_param = NULL, _0$$3, _1$$3; zend_long radius, ZEPHIR_LAST_CALL_STATUS, i = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &radius_param); @@ -1305,10 +1496,9 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _blur) { if (!(i < radius)) { break; } - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_1$$3); + zephir_read_property(&_0$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_1$$3, 7); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_2, 288, _0$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilter", &_2, 249, &_0$$3, &_1$$3); zephir_check_call_status(); i++; } @@ -1319,8 +1509,19 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _blur) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _pixelate) { zephir_fcall_cache_entry *_5 = NULL, *_9 = NULL; - zval *amount_param = NULL, *color = NULL, *_0, *_1$$3, *_2$$4, _3$$4 = zval_used_for_init, _4$$4 = zval_used_for_init, *_6$$4, _7$$4 = zval_used_for_init, _8$$4 = zval_used_for_init; + zval *amount_param = NULL, color, _0, _1$$3, _2$$4, _3$$4, _4$$4, _6$$4, _7$$4, _8$$4; zend_long amount, ZEPHIR_LAST_CALL_STATUS, x = 0, y = 0, x1 = 0, y1 = 0, x2 = 0, y2 = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&color); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &amount_param); @@ -1330,37 +1531,31 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _pixelate) { x = 0; while (1) { - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - if (!(ZEPHIR_GT_LONG(_0, x))) { + zephir_read_property(&_0, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_GT_LONG(&_0, x))) { break; } y = 0; while (1) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - if (!(ZEPHIR_GT_LONG(_1$$3, y))) { + zephir_read_property(&_1$$3, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_GT_LONG(&_1$$3, y))) { break; } x1 = (x + zephir_safe_div_long_long(amount, 2 TSRMLS_CC)); y1 = (y + zephir_safe_div_long_long(amount, 2 TSRMLS_CC)); - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_3$$4); + zephir_read_property(&_2$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_3$$4, x1); - ZEPHIR_SINIT_NVAR(_4$$4); ZVAL_LONG(&_4$$4, y1); - ZEPHIR_CALL_FUNCTION(&color, "imagecolorat", &_5, 296, _2$$4, &_3$$4, &_4$$4); + ZEPHIR_CALL_FUNCTION(&color, "imagecolorat", &_5, 257, &_2$$4, &_3$$4, &_4$$4); zephir_check_call_status(); x2 = (x + amount); y2 = (y + amount); - _6$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_3$$4); - ZVAL_LONG(&_3$$4, x); - ZEPHIR_SINIT_NVAR(_4$$4); - ZVAL_LONG(&_4$$4, y); - ZEPHIR_SINIT_NVAR(_7$$4); + zephir_read_property(&_3$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_4$$4, x); + ZVAL_LONG(&_6$$4, y); ZVAL_LONG(&_7$$4, x2); - ZEPHIR_SINIT_NVAR(_8$$4); ZVAL_LONG(&_8$$4, y2); - ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", &_9, 291, _6$$4, &_3$$4, &_4$$4, &_7$$4, &_8$$4, color); + ZEPHIR_CALL_FUNCTION(NULL, "imagefilledrectangle", &_9, 252, &_3$$4, &_4$$4, &_6$$4, &_7$$4, &_8$$4, &color); zephir_check_call_status(); y += amount; } @@ -1374,141 +1569,171 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _save) { zend_bool _8; zend_long quality, ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, *quality_param = NULL, *ext = NULL, _0 = zval_used_for_init, *_2 = NULL, *_3 = NULL, *_7 = NULL, *_9 = NULL, *_15 = NULL, *_19 = NULL, *_23 = NULL, *_27, *_1$$3, *_4$$4, *_5$$4 = NULL, *_6$$4, *_10$$5, *_11$$5 = NULL, *_12$$6, _13$$6, *_14$$9, *_16$$10, *_17$$10 = NULL, *_18$$10, *_20$$11, *_21$$11 = NULL, *_22$$11, *_24$$12, *_25$$12 = NULL, *_26$$12; - zval *file = NULL; + zval *file_param = NULL, *quality_param = NULL, __$false, ext, _0, _2, _3, _7, _9, _15, _19, _23, _27, _1$$3, _4$$4, _5$$4, _6$$4, _10$$5, _11$$5, _12$$6, _13$$6, _14$$9, _16$$10, _17$$10, _18$$10, _20$$11, _21$$11, _22$$11, _24$$12, _25$$12, _26$$12; + zval file; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&file); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&ext); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_15); + ZVAL_UNDEF(&_19); + ZVAL_UNDEF(&_23); + ZVAL_UNDEF(&_27); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_12$$6); + ZVAL_UNDEF(&_13$$6); + ZVAL_UNDEF(&_14$$9); + ZVAL_UNDEF(&_16$$10); + ZVAL_UNDEF(&_17$$10); + ZVAL_UNDEF(&_18$$10); + ZVAL_UNDEF(&_20$$11); + ZVAL_UNDEF(&_21$$11); + ZVAL_UNDEF(&_22$$11); + ZVAL_UNDEF(&_24$$12); + ZVAL_UNDEF(&_25$$12); + ZVAL_UNDEF(&_26$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &file_param, &quality_param); - zephir_get_strval(file, file_param); + zephir_get_strval(&file, file_param); quality = zephir_get_intval(quality_param); - ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, 4); - ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 78, file, &_0); + ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 71, &file, &_0); zephir_check_call_status(); - if (!(zephir_is_true(ext))) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&ext, "image_type_to_extension", NULL, 299, _1$$3, ZEPHIR_GLOBAL(global_false)); + if (!(zephir_is_true(&ext))) { + zephir_read_property(&_1$$3, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&ext, "image_type_to_extension", NULL, 260, &_1$$3, &__$false); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_2); - zephir_fast_strtolower(_2, ext); - ZEPHIR_CPY_WRT(ext, _2); - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "gif", 0); - ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 300, ext, &_0); + ZEPHIR_INIT_VAR(&_2); + zephir_fast_strtolower(&_2, &ext); + ZEPHIR_CPY_WRT(&ext, &_2); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_STRING(&_2, "gif"); + ZEPHIR_CALL_FUNCTION(&_3, "strcmp", NULL, 261, &ext, &_2); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_3, 0)) { + if (ZEPHIR_IS_LONG(&_3, 0)) { ZEPHIR_INIT_ZVAL_NREF(_4$$4); - ZVAL_LONG(_4$$4, 1); - zephir_update_property_this(getThis(), SL("_type"), _4$$4 TSRMLS_CC); - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_5$$4, "image_type_to_mime_type", NULL, 301, _4$$4); + ZVAL_LONG(&_4$$4, 1); + zephir_update_property_zval(this_ptr, SL("_type"), &_4$$4); + zephir_read_property(&_4$$4, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_5$$4, "image_type_to_mime_type", NULL, 262, &_4$$4); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_mime"), _5$$4 TSRMLS_CC); - _6$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 302, _6$$4, file); + zephir_update_property_zval(this_ptr, SL("_mime"), &_5$$4); + zephir_read_property(&_6$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 263, &_6$$4, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "jpg", 0); - ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 300, ext, &_0); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_STRING(&_2, "jpg"); + ZEPHIR_CALL_FUNCTION(&_7, "strcmp", NULL, 261, &ext, &_2); zephir_check_call_status(); - _8 = ZEPHIR_IS_LONG(_7, 0); + _8 = ZEPHIR_IS_LONG(&_7, 0); if (!(_8)) { - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "jpeg", 0); - ZEPHIR_CALL_FUNCTION(&_9, "strcmp", NULL, 300, ext, &_0); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_STRING(&_2, "jpeg"); + ZEPHIR_CALL_FUNCTION(&_9, "strcmp", NULL, 261, &ext, &_2); zephir_check_call_status(); - _8 = ZEPHIR_IS_LONG(_9, 0); + _8 = ZEPHIR_IS_LONG(&_9, 0); } if (_8) { ZEPHIR_INIT_ZVAL_NREF(_10$$5); - ZVAL_LONG(_10$$5, 2); - zephir_update_property_this(getThis(), SL("_type"), _10$$5 TSRMLS_CC); - _10$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_11$$5, "image_type_to_mime_type", NULL, 301, _10$$5); + ZVAL_LONG(&_10$$5, 2); + zephir_update_property_zval(this_ptr, SL("_type"), &_10$$5); + zephir_read_property(&_10$$5, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_11$$5, "image_type_to_mime_type", NULL, 262, &_10$$5); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_mime"), _11$$5 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_mime"), &_11$$5); if (quality >= 0) { if (quality < 1) { quality = 1; } else if (quality > 100) { quality = 100; } - _12$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_13$$6); + zephir_read_property(&_12$$6, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_13$$6, quality); - ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 303, _12$$6, file, &_13$$6); + ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 0, &_12$$6, &file, &_13$$6); zephir_check_call_status(); } else { - _14$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 303, _14$$9, file); + zephir_read_property(&_14$$9, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 0, &_14$$9, &file); zephir_check_call_status(); } RETURN_MM_BOOL(1); } - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "png", 0); - ZEPHIR_CALL_FUNCTION(&_15, "strcmp", NULL, 300, ext, &_0); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_STRING(&_2, "png"); + ZEPHIR_CALL_FUNCTION(&_15, "strcmp", NULL, 261, &ext, &_2); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_15, 0)) { + if (ZEPHIR_IS_LONG(&_15, 0)) { ZEPHIR_INIT_ZVAL_NREF(_16$$10); - ZVAL_LONG(_16$$10, 3); - zephir_update_property_this(getThis(), SL("_type"), _16$$10 TSRMLS_CC); - _16$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_17$$10, "image_type_to_mime_type", NULL, 301, _16$$10); + ZVAL_LONG(&_16$$10, 3); + zephir_update_property_zval(this_ptr, SL("_type"), &_16$$10); + zephir_read_property(&_16$$10, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_17$$10, "image_type_to_mime_type", NULL, 262, &_16$$10); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_mime"), _17$$10 TSRMLS_CC); - _18$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 304, _18$$10, file); + zephir_update_property_zval(this_ptr, SL("_mime"), &_17$$10); + zephir_read_property(&_18$$10, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 264, &_18$$10, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "wbmp", 0); - ZEPHIR_CALL_FUNCTION(&_19, "strcmp", NULL, 300, ext, &_0); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_STRING(&_2, "wbmp"); + ZEPHIR_CALL_FUNCTION(&_19, "strcmp", NULL, 261, &ext, &_2); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_19, 0)) { + if (ZEPHIR_IS_LONG(&_19, 0)) { ZEPHIR_INIT_ZVAL_NREF(_20$$11); - ZVAL_LONG(_20$$11, 15); - zephir_update_property_this(getThis(), SL("_type"), _20$$11 TSRMLS_CC); - _20$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_21$$11, "image_type_to_mime_type", NULL, 301, _20$$11); + ZVAL_LONG(&_20$$11, 15); + zephir_update_property_zval(this_ptr, SL("_type"), &_20$$11); + zephir_read_property(&_20$$11, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_21$$11, "image_type_to_mime_type", NULL, 262, &_20$$11); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_mime"), _21$$11 TSRMLS_CC); - _22$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 305, _22$$11, file); + zephir_update_property_zval(this_ptr, SL("_mime"), &_21$$11); + zephir_read_property(&_22$$11, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 265, &_22$$11, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "xbm", 0); - ZEPHIR_CALL_FUNCTION(&_23, "strcmp", NULL, 300, ext, &_0); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_STRING(&_2, "xbm"); + ZEPHIR_CALL_FUNCTION(&_23, "strcmp", NULL, 261, &ext, &_2); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_23, 0)) { + if (ZEPHIR_IS_LONG(&_23, 0)) { ZEPHIR_INIT_ZVAL_NREF(_24$$12); - ZVAL_LONG(_24$$12, 16); - zephir_update_property_this(getThis(), SL("_type"), _24$$12 TSRMLS_CC); - _24$$12 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_25$$12, "image_type_to_mime_type", NULL, 301, _24$$12); + ZVAL_LONG(&_24$$12, 16); + zephir_update_property_zval(this_ptr, SL("_type"), &_24$$12); + zephir_read_property(&_24$$12, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_25$$12, "image_type_to_mime_type", NULL, 262, &_24$$12); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_mime"), _25$$12 TSRMLS_CC); - _26$$12 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 306, _26$$12, file); + zephir_update_property_zval(this_ptr, SL("_mime"), &_25$$12); + zephir_read_property(&_26$$12, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 266, &_26$$12, &file); zephir_check_call_status(); RETURN_MM_BOOL(1); } - ZEPHIR_INIT_NVAR(_2); - object_init_ex(_2, phalcon_image_exception_ce); - ZEPHIR_INIT_VAR(_27); - ZEPHIR_CONCAT_SVS(_27, "Installed GD does not support '", ext, "' images"); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 9, _27); + ZEPHIR_INIT_NVAR(&_2); + object_init_ex(&_2, phalcon_image_exception_ce); + ZEPHIR_INIT_VAR(&_27); + ZEPHIR_CONCAT_SVS(&_27, "Installed GD does not support '", &ext, "' images"); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 4, &_27); zephir_check_call_status(); - zephir_throw_exception_debug(_2, "phalcon/image/adapter/gd.zep", 554 TSRMLS_CC); + zephir_throw_exception_debug(&_2, "phalcon/image/adapter/gd.zep", 554 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -1518,98 +1743,118 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _render) { zend_bool _5; zend_long quality, ZEPHIR_LAST_CALL_STATUS; - zval *ext_param = NULL, *quality_param = NULL, *_0, _1 = zval_used_for_init, *_2 = NULL, *_4 = NULL, *_6 = NULL, *_9 = NULL, *_11 = NULL, *_13 = NULL, *_15, *_3$$3, *_7$$4, _8$$4, *_10$$5, *_12$$6, *_14$$7; - zval *ext = NULL, *_16; + zval *ext_param = NULL, *quality_param = NULL, __$null, _0, _1, _2, _4, _6, _10, _12, _14, _3$$3, _7$$4, _8$$4, _9$$4, _11$$5, _13$$6, _15$$7; + zval ext, _16; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&ext); + ZVAL_UNDEF(&_16); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$4); + ZVAL_UNDEF(&_9$$4); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_13$$6); + ZVAL_UNDEF(&_15$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &ext_param, &quality_param); - zephir_get_strval(ext, ext_param); + zephir_get_strval(&ext, ext_param); quality = zephir_get_intval(quality_param); - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtolower(_0, ext); - zephir_get_strval(ext, _0); - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 140); + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtolower(&_0, &ext); + zephir_get_strval(&ext, &_0); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 121); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "gif", 0); - ZEPHIR_CALL_FUNCTION(&_2, "strcmp", NULL, 300, ext, &_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "gif"); + ZEPHIR_CALL_FUNCTION(&_2, "strcmp", NULL, 261, &ext, &_1); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_2, 0)) { - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 302, _3$$3); + if (ZEPHIR_IS_LONG(&_2, 0)) { + zephir_read_property(&_3$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagegif", NULL, 263, &_3$$3); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 307); + ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 267); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_SINIT_NVAR(_1); - ZVAL_STRING(&_1, "jpg", 0); - ZEPHIR_CALL_FUNCTION(&_4, "strcmp", NULL, 300, ext, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "jpg"); + ZEPHIR_CALL_FUNCTION(&_4, "strcmp", NULL, 261, &ext, &_1); zephir_check_call_status(); - _5 = ZEPHIR_IS_LONG(_4, 0); + _5 = ZEPHIR_IS_LONG(&_4, 0); if (!(_5)) { - ZEPHIR_SINIT_NVAR(_1); - ZVAL_STRING(&_1, "jpeg", 0); - ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 300, ext, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "jpeg"); + ZEPHIR_CALL_FUNCTION(&_6, "strcmp", NULL, 261, &ext, &_1); zephir_check_call_status(); - _5 = ZEPHIR_IS_LONG(_6, 0); + _5 = ZEPHIR_IS_LONG(&_6, 0); } if (_5) { - _7$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_8$$4); - ZVAL_LONG(&_8$$4, quality); - ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 303, _7$$4, ZEPHIR_GLOBAL(global_null), &_8$$4); + zephir_read_property(&_7$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_NULL(&_8$$4); + ZVAL_LONG(&_9$$4, quality); + ZEPHIR_CALL_FUNCTION(NULL, "imagejpeg", NULL, 0, &_7$$4, &_8$$4, &_9$$4); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 307); + ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 267); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_SINIT_NVAR(_1); - ZVAL_STRING(&_1, "png", 0); - ZEPHIR_CALL_FUNCTION(&_9, "strcmp", NULL, 300, ext, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "png"); + ZEPHIR_CALL_FUNCTION(&_10, "strcmp", NULL, 261, &ext, &_1); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_9, 0)) { - _10$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 304, _10$$5); + if (ZEPHIR_IS_LONG(&_10, 0)) { + zephir_read_property(&_11$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagepng", NULL, 264, &_11$$5); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 307); + ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 267); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_SINIT_NVAR(_1); - ZVAL_STRING(&_1, "wbmp", 0); - ZEPHIR_CALL_FUNCTION(&_11, "strcmp", NULL, 300, ext, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "wbmp"); + ZEPHIR_CALL_FUNCTION(&_12, "strcmp", NULL, 261, &ext, &_1); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_11, 0)) { - _12$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 305, _12$$6); + if (ZEPHIR_IS_LONG(&_12, 0)) { + zephir_read_property(&_13$$6, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagewbmp", NULL, 265, &_13$$6); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 307); + ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 267); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_SINIT_NVAR(_1); - ZVAL_STRING(&_1, "xbm", 0); - ZEPHIR_CALL_FUNCTION(&_13, "strcmp", NULL, 300, ext, &_1); + ZEPHIR_INIT_NVAR(&_1); + ZVAL_STRING(&_1, "xbm"); + ZEPHIR_CALL_FUNCTION(&_14, "strcmp", NULL, 261, &ext, &_1); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_13, 0)) { - _14$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 306, _14$$7, ZEPHIR_GLOBAL(global_null)); + if (ZEPHIR_IS_LONG(&_14, 0)) { + zephir_read_property(&_15$$7, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "imagexbm", NULL, 266, &_15$$7, &__$null); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 307); + ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 267); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(_15); - object_init_ex(_15, phalcon_image_exception_ce); - ZEPHIR_INIT_VAR(_16); - ZEPHIR_CONCAT_SVS(_16, "Installed GD does not support '", ext, "' images"); - ZEPHIR_CALL_METHOD(NULL, _15, "__construct", NULL, 9, _16); + ZEPHIR_INIT_NVAR(&_1); + object_init_ex(&_1, phalcon_image_exception_ce); + ZEPHIR_INIT_VAR(&_16); + ZEPHIR_CONCAT_SVS(&_16, "Installed GD does not support '", &ext, "' images"); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 4, &_16); zephir_check_call_status(); - zephir_throw_exception_debug(_15, "phalcon/image/adapter/gd.zep", 582 TSRMLS_CC); + zephir_throw_exception_debug(&_1, "phalcon/image/adapter/gd.zep", 582 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -1617,8 +1862,15 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _render) { PHP_METHOD(Phalcon_Image_Adapter_Gd, _create) { - zval *width_param = NULL, *height_param = NULL, *image = NULL, _0, _1; + zval *width_param = NULL, *height_param = NULL, __$false, __$true, image, _0, _1; zend_long width, height, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$false, 0); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &width_param, &height_param); @@ -1627,31 +1879,32 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _create) { height = zephir_get_intval(height_param); - ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, width); - ZEPHIR_SINIT_VAR(_1); ZVAL_LONG(&_1, height); - ZEPHIR_CALL_FUNCTION(&image, "imagecreatetruecolor", NULL, 273, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&image, "imagecreatetruecolor", NULL, 234, &_0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 274, image, ZEPHIR_GLOBAL(global_false)); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 235, &image, &__$false); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 272, image, ZEPHIR_GLOBAL(global_true)); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 233, &image, &__$true); zephir_check_call_status(); - RETURN_CCTOR(image); + RETURN_CCTOR(&image); } PHP_METHOD(Phalcon_Image_Adapter_Gd, __destruct) { - zval *image = NULL; + zval image; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&image); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(image); - zephir_read_property_this(&image, this_ptr, SL("_image"), PH_NOISY_CC); - if (Z_TYPE_P(image) == IS_RESOURCE) { - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 276, image); + ZEPHIR_OBS_VAR(&image); + zephir_read_property(&image, this_ptr, SL("_image"), PH_NOISY_CC); + if (Z_TYPE_P(&image) == IS_RESOURCE) { + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 237, &image); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/image/adapter/gd.zep.h b/ext/phalcon/image/adapter/gd.zep.h index b05669ce91f..47435a10a2a 100644 --- a/ext/phalcon/image/adapter/gd.zep.h +++ b/ext/phalcon/image/adapter/gd.zep.h @@ -22,59 +22,174 @@ PHP_METHOD(Phalcon_Image_Adapter_Gd, _render); PHP_METHOD(Phalcon_Image_Adapter_Gd, _create); PHP_METHOD(Phalcon_Image_Adapter_Gd, __destruct); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_gd_check, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_gd_check, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0) +#else ZEND_ARG_INFO(0, file) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 1) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 1) +#else ZEND_ARG_INFO(0, height) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__resize, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__crop, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetY) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__rotate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, degrees, IS_LONG, 0) +#else ZEND_ARG_INFO(0, degrees) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__flip, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, direction, IS_LONG, 0) +#else ZEND_ARG_INFO(0, direction) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__sharpen, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, amount, IS_LONG, 0) +#else ZEND_ARG_INFO(0, amount) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__reflection, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fadeIn, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, fadeIn) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__watermark, 0, 0, 4) ZEND_ARG_OBJ_INFO(0, watermark, Phalcon\\Image\\Adapter, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetY) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__text, 0, 0, 9) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetY) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, r, IS_LONG, 0) +#else ZEND_ARG_INFO(0, r) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, g, IS_LONG, 0) +#else ZEND_ARG_INFO(0, g) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, b, IS_LONG, 0) +#else ZEND_ARG_INFO(0, b) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) +#else ZEND_ARG_INFO(0, size) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fontfile, IS_STRING, 0) +#else ZEND_ARG_INFO(0, fontfile) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__mask, 0, 0, 1) @@ -82,37 +197,85 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__mask, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__background, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, r, IS_LONG, 0) +#else ZEND_ARG_INFO(0, r) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, g, IS_LONG, 0) +#else ZEND_ARG_INFO(0, g) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, b, IS_LONG, 0) +#else ZEND_ARG_INFO(0, b) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__blur, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, radius, IS_LONG, 0) +#else ZEND_ARG_INFO(0, radius) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__pixelate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, amount, IS_LONG, 0) +#else ZEND_ARG_INFO(0, amount) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__save, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0) +#else ZEND_ARG_INFO(0, file) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quality) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__render, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ext, IS_STRING, 0) +#else ZEND_ARG_INFO(0, ext) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quality) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_gd__create, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_image_adapter_gd_method_entry) { - PHP_ME(Phalcon_Image_Adapter_Gd, check, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Image_Adapter_Gd, check, arginfo_phalcon_image_adapter_gd_check, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Image_Adapter_Gd, __construct, arginfo_phalcon_image_adapter_gd___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Image_Adapter_Gd, _resize, arginfo_phalcon_image_adapter_gd__resize, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Image_Adapter_Gd, _crop, arginfo_phalcon_image_adapter_gd__crop, ZEND_ACC_PROTECTED) diff --git a/ext/phalcon/image/adapter/imagick.zep.c b/ext/phalcon/image/adapter/imagick.zep.c index 4066c6649cf..e9b2984277e 100644 --- a/ext/phalcon/image/adapter/imagick.zep.c +++ b/ext/phalcon/image/adapter/imagick.zep.c @@ -55,35 +55,45 @@ ZEPHIR_INIT_CLASS(Phalcon_Image_Adapter_Imagick) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, check) { - zval *_0, _1, _2, *_3 = NULL, *_6, _4$$5, *_5$$5 = NULL; + zval __$true, _0, _1, _2, _3, _6, _4$$5, _5$$5; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_static_property_ce(phalcon_image_adapter_imagick_ce, SL("_checked") TSRMLS_CC); - if (zephir_is_true(_0)) { + zephir_read_static_property_ce(&_0, phalcon_image_adapter_imagick_ce, SL("_checked"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { RETURN_MM_BOOL(1); } - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "imagick", 0); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "imagick"); if (!(zephir_class_exists(&_1, 1 TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick is not installed, or the extension is not loaded", "phalcon/image/adapter/imagick.zep", 55); return; } - ZEPHIR_SINIT_VAR(_2); - ZVAL_STRING(&_2, "Imagick::IMAGICK_EXTNUM", 0); - ZEPHIR_CALL_FUNCTION(&_3, "defined", NULL, 37, &_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "Imagick::IMAGICK_EXTNUM"); + ZEPHIR_CALL_FUNCTION(&_3, "defined", NULL, 31, &_2); zephir_check_call_status(); - if (zephir_is_true(_3)) { - ZEPHIR_SINIT_VAR(_4$$5); - ZVAL_STRING(&_4$$5, "Imagick::IMAGICK_EXTNUM", 0); - ZEPHIR_CALL_FUNCTION(&_5$$5, "constant", NULL, 38, &_4$$5); + if (zephir_is_true(&_3)) { + ZEPHIR_INIT_VAR(&_4$$5); + ZVAL_STRING(&_4$$5, "Imagick::IMAGICK_EXTNUM"); + ZEPHIR_CALL_FUNCTION(&_5$$5, "constant", NULL, 32, &_4$$5); zephir_check_call_status(); - zephir_update_static_property_ce(phalcon_image_adapter_imagick_ce, SL("_version"), &_5$$5 TSRMLS_CC); + zend_update_static_property(phalcon_image_adapter_imagick_ce, ZEND_STRL("_version"), &_5$$5); } - zephir_update_static_property_ce(phalcon_image_adapter_imagick_ce, SL("_checked"), &ZEPHIR_GLOBAL(global_true) TSRMLS_CC); - _6 = zephir_fetch_static_property_ce(phalcon_image_adapter_imagick_ce, SL("_checked") TSRMLS_CC); - RETURN_CTOR(_6); + zend_update_static_property(phalcon_image_adapter_imagick_ce, ZEND_STRL("_checked"), &__$true); + zephir_read_static_property_ce(&_6, phalcon_image_adapter_imagick_ce, SL("_checked"), PH_NOISY_CC | PH_READONLY); + RETURN_CTOR(&_6); } @@ -94,21 +104,63 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) { zend_bool _20$$8; zend_long width, height, ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, *width_param = NULL, *height_param = NULL, *image = NULL, *_0, *_1, *_2, *_31, *_32 = NULL, *_33, *_34 = NULL, *_35, *_36 = NULL, *_37, *_38 = NULL, *_39, *_3$$4, *_4$$4 = NULL, *_5$$4, *_6$$4 = NULL, *_7$$4, *_11$$4, *_12$$4 = NULL, *_16$$4, *_8$$5, *_9$$5, *_10$$5, *_13$$6, _14$$6, *_15$$6 = NULL, *_17$$7, *_18$$7, *_19$$7, *_24$$8, *_25$$8, *_26$$8 = NULL, *_27$$8, *_28$$8, *_29$$8, *_30$$8, *_21$$9, *_22$$9, *_23$$9; - zval *file = NULL; + zval *file_param = NULL, *width_param = NULL, *height_param = NULL, image, _0, _1, _2, _30, _31, _32, _33, _34, _35, _36, _37, _38, _3$$4, _4$$4, _5$$4, _6$$4, _7$$4, _11$$4, _12$$4, _16$$4, _8$$5, _9$$5, _10$$5, _13$$6, _14$$6, _15$$6, _17$$7, _18$$7, _19$$7, _24$$8, _25$$8, _26$$8, _27$$8, _28$$8, _29$$8, _21$$9, _22$$9, _23$$9; + zval file; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_30); + ZVAL_UNDEF(&_31); + ZVAL_UNDEF(&_32); + ZVAL_UNDEF(&_33); + ZVAL_UNDEF(&_34); + ZVAL_UNDEF(&_35); + ZVAL_UNDEF(&_36); + ZVAL_UNDEF(&_37); + ZVAL_UNDEF(&_38); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_11$$4); + ZVAL_UNDEF(&_12$$4); + ZVAL_UNDEF(&_16$$4); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_13$$6); + ZVAL_UNDEF(&_14$$6); + ZVAL_UNDEF(&_15$$6); + ZVAL_UNDEF(&_17$$7); + ZVAL_UNDEF(&_18$$7); + ZVAL_UNDEF(&_19$$7); + ZVAL_UNDEF(&_24$$8); + ZVAL_UNDEF(&_25$$8); + ZVAL_UNDEF(&_26$$8); + ZVAL_UNDEF(&_27$$8); + ZVAL_UNDEF(&_28$$8); + ZVAL_UNDEF(&_29$$8); + ZVAL_UNDEF(&_21$$9); + ZVAL_UNDEF(&_22$$9); + ZVAL_UNDEF(&_23$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &file_param, &width_param, &height_param); if (UNEXPECTED(Z_TYPE_P(file_param) != IS_STRING && Z_TYPE_P(file_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'file' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'file' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(file_param) == IS_STRING)) { - zephir_get_strval(file, file_param); + zephir_get_strval(&file, file_param); } else { - ZEPHIR_INIT_VAR(file); - ZVAL_EMPTY_STRING(file); + ZEPHIR_INIT_VAR(&file); + ZVAL_EMPTY_STRING(&file); } if (!width_param) { width = 0; @@ -122,63 +174,65 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) { } - _0 = zephir_fetch_static_property_ce(phalcon_image_adapter_imagick_ce, SL("_checked") TSRMLS_CC); - if (!(zephir_is_true(_0))) { + zephir_read_static_property_ce(&_0, phalcon_image_adapter_imagick_ce, SL("_checked"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_CALL_SELF(NULL, "check", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_file"), file TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - object_init_ex(_1, zephir_get_internal_ce(SS("imagick") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 0); - zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), _1 TSRMLS_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - if ((zephir_file_exists(_2 TSRMLS_CC) == SUCCESS)) { - _3$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_4$$4, "realpath", NULL, 67, _3$$4); - zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_realpath"), _4$$4 TSRMLS_CC); - _5$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - _7$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_realpath"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_6$$4, _5$$4, "readimage", NULL, 0, _7$$4); - zephir_check_call_status(); - if (!(zephir_is_true(_6$$4))) { - ZEPHIR_INIT_VAR(_8$$5); - object_init_ex(_8$$5, phalcon_image_exception_ce); - _9$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_10$$5); - ZEPHIR_CONCAT_SVS(_10$$5, "Imagick::readImage ", _9$$5, " failed"); - ZEPHIR_CALL_METHOD(NULL, _8$$5, "__construct", NULL, 9, _10$$5); + zephir_update_property_zval(this_ptr, SL("_file"), &file); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, zephir_get_internal_ce(SL("imagick"))); + if (zephir_has_constructor(&_1 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 0); + zephir_check_call_status(); + } + zephir_update_property_zval(this_ptr, SL("_image"), &_1); + zephir_read_property(&_2, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + if ((zephir_file_exists(&_2 TSRMLS_CC) == SUCCESS)) { + zephir_read_property(&_3$$4, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_4$$4, "realpath", NULL, 60, &_3$$4); + zephir_check_call_status(); + zephir_update_property_zval(this_ptr, SL("_realpath"), &_4$$4); + zephir_read_property(&_5$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_7$$4, this_ptr, SL("_realpath"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_6$$4, &_5$$4, "readimage", NULL, 0, &_7$$4); + zephir_check_call_status(); + if (!(zephir_is_true(&_6$$4))) { + ZEPHIR_INIT_VAR(&_8$$5); + object_init_ex(&_8$$5, phalcon_image_exception_ce); + zephir_read_property(&_9$$5, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_10$$5); + ZEPHIR_CONCAT_SVS(&_10$$5, "Imagick::readImage ", &_9$$5, " failed"); + ZEPHIR_CALL_METHOD(NULL, &_8$$5, "__construct", NULL, 4, &_10$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_8$$5, "phalcon/image/adapter/imagick.zep", 86 TSRMLS_CC); + zephir_throw_exception_debug(&_8$$5, "phalcon/image/adapter/imagick.zep", 86 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - _11$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_12$$4, _11$$4, "getimagealphachannel", NULL, 0); - zephir_check_call_status(); - if (!(zephir_is_true(_12$$4))) { - _13$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_14$$6); - ZVAL_STRING(&_14$$6, "Imagick::ALPHACHANNEL_SET", 0); - ZEPHIR_CALL_FUNCTION(&_15$$6, "constant", NULL, 38, &_14$$6); + zephir_read_property(&_11$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_12$$4, &_11$$4, "getimagealphachannel", NULL, 0); + zephir_check_call_status(); + if (!(zephir_is_true(&_12$$4))) { + zephir_read_property(&_13$$6, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_14$$6); + ZVAL_STRING(&_14$$6, "Imagick::ALPHACHANNEL_SET"); + ZEPHIR_CALL_FUNCTION(&_15$$6, "constant", NULL, 32, &_14$$6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _13$$6, "setimagealphachannel", NULL, 0, _15$$6); + ZEPHIR_CALL_METHOD(NULL, &_13$$6, "setimagealphachannel", NULL, 0, &_15$$6); zephir_check_call_status(); } - _16$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - if (ZEPHIR_IS_LONG(_16$$4, 1)) { - _17$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&image, _17$$7, "coalesceimages", NULL, 0); + zephir_read_property(&_16$$4, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_LONG(&_16$$4, 1)) { + zephir_read_property(&_17$$7, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&image, &_17$$7, "coalesceimages", NULL, 0); zephir_check_call_status(); - _18$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _18$$7, "clear", NULL, 0); + zephir_read_property(&_18$$7, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_18$$7, "clear", NULL, 0); zephir_check_call_status(); - _19$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _19$$7, "destroy", NULL, 0); + zephir_read_property(&_19$$7, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_19$$7, "destroy", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), image TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &image); } } else { _20$$8 = !width; @@ -186,64 +240,61 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) { _20$$8 = !height; } if (_20$$8) { - ZEPHIR_INIT_VAR(_21$$9); - object_init_ex(_21$$9, phalcon_image_exception_ce); - _22$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_23$$9); - ZEPHIR_CONCAT_SV(_23$$9, "Failed to create image from file ", _22$$9); - ZEPHIR_CALL_METHOD(NULL, _21$$9, "__construct", NULL, 9, _23$$9); + ZEPHIR_INIT_VAR(&_21$$9); + object_init_ex(&_21$$9, phalcon_image_exception_ce); + zephir_read_property(&_22$$9, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_23$$9); + ZEPHIR_CONCAT_SV(&_23$$9, "Failed to create image from file ", &_22$$9); + ZEPHIR_CALL_METHOD(NULL, &_21$$9, "__construct", NULL, 4, &_23$$9); zephir_check_call_status(); - zephir_throw_exception_debug(_21$$9, "phalcon/image/adapter/imagick.zep", 102 TSRMLS_CC); + zephir_throw_exception_debug(&_21$$9, "phalcon/image/adapter/imagick.zep", 102 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - _24$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_25$$8); - object_init_ex(_25$$8, zephir_get_internal_ce(SS("imagickpixel") TSRMLS_CC)); - ZEPHIR_INIT_VAR(_26$$8); - ZVAL_STRING(_26$$8, "transparent", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _25$$8, "__construct", NULL, 0, _26$$8); - zephir_check_temp_parameter(_26$$8); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_26$$8); - ZVAL_LONG(_26$$8, width); - ZEPHIR_INIT_VAR(_27$$8); - ZVAL_LONG(_27$$8, height); - ZEPHIR_CALL_METHOD(NULL, _24$$8, "newimage", NULL, 0, _26$$8, _27$$8, _25$$8); - zephir_check_call_status(); - _28$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_26$$8); - ZVAL_STRING(_26$$8, "png", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _28$$8, "setformat", NULL, 0, _26$$8); - zephir_check_temp_parameter(_26$$8); - zephir_check_call_status(); - _29$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_26$$8); - ZVAL_STRING(_26$$8, "png", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _29$$8, "setimageformat", NULL, 0, _26$$8); - zephir_check_temp_parameter(_26$$8); - zephir_check_call_status(); - _30$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_file"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_realpath"), _30$$8 TSRMLS_CC); + zephir_read_property(&_24$$8, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_25$$8); + object_init_ex(&_25$$8, zephir_get_internal_ce(SL("imagickpixel"))); + if (zephir_has_constructor(&_25$$8 TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_26$$8); + ZVAL_STRING(&_26$$8, "transparent"); + ZEPHIR_CALL_METHOD(NULL, &_25$$8, "__construct", NULL, 0, &_26$$8); + zephir_check_call_status(); + } + ZVAL_LONG(&_27$$8, width); + ZVAL_LONG(&_28$$8, height); + ZEPHIR_CALL_METHOD(NULL, &_24$$8, "newimage", NULL, 0, &_27$$8, &_28$$8, &_25$$8); + zephir_check_call_status(); + zephir_read_property(&_27$$8, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&_26$$8); + ZVAL_STRING(&_26$$8, "png"); + ZEPHIR_CALL_METHOD(NULL, &_27$$8, "setformat", NULL, 0, &_26$$8); + zephir_check_call_status(); + zephir_read_property(&_28$$8, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&_26$$8); + ZVAL_STRING(&_26$$8, "png"); + ZEPHIR_CALL_METHOD(NULL, &_28$$8, "setimageformat", NULL, 0, &_26$$8); + zephir_check_call_status(); + zephir_read_property(&_29$$8, this_ptr, SL("_file"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_realpath"), &_29$$8); } - _31 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_32, _31, "getimagewidth", NULL, 0); + zephir_read_property(&_30, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_31, &_30, "getimagewidth", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _32 TSRMLS_CC); - _33 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_34, _33, "getimageheight", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_width"), &_31); + zephir_read_property(&_32, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_33, &_32, "getimageheight", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _34 TSRMLS_CC); - _35 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_36, _35, "getimagetype", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_height"), &_33); + zephir_read_property(&_34, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_35, &_34, "getimagetype", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_type"), _36 TSRMLS_CC); - _37 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_38, _37, "getimageformat", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_type"), &_35); + zephir_read_property(&_36, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_37, &_36, "getimageformat", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_39); - ZEPHIR_CONCAT_SV(_39, "image/", _38); - zephir_update_property_this(getThis(), SL("_mime"), _39 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_38); + ZEPHIR_CONCAT_SV(&_38, "image/", &_37); + zephir_update_property_zval(this_ptr, SL("_mime"), &_38); ZEPHIR_MM_RESTORE(); } @@ -254,8 +305,17 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __construct) { PHP_METHOD(Phalcon_Image_Adapter_Imagick, _resize) { zephir_fcall_cache_entry *_3 = NULL, *_5 = NULL; - zval *width_param = NULL, *height_param = NULL, *image = NULL, *_0, *_6 = NULL, *_7 = NULL, *_1$$3 = NULL, *_2$$3 = NULL, *_4$$3 = NULL; + zval *width_param = NULL, *height_param = NULL, image, _0, _6, _7, _1$$3, _2$$3, _4$$3; zend_long width, height, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &width_param, &height_param); @@ -264,31 +324,28 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _resize) { height = zephir_get_intval(height_param); - ZEPHIR_OBS_VAR(image); - zephir_read_property_this(&image, this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 0); - ZEPHIR_CALL_METHOD(NULL, image, "setiteratorindex", NULL, 0, _0); + ZEPHIR_OBS_VAR(&image); + zephir_read_property(&image, this_ptr, SL("_image"), PH_NOISY_CC); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(NULL, &image, "setiteratorindex", NULL, 0, &_0); zephir_check_call_status(); while (1) { - ZEPHIR_INIT_NVAR(_1$$3); - ZVAL_LONG(_1$$3, width); - ZEPHIR_INIT_NVAR(_2$$3); - ZVAL_LONG(_2$$3, height); - ZEPHIR_CALL_METHOD(NULL, image, "scaleimage", &_3, 0, _1$$3, _2$$3); + ZVAL_LONG(&_1$$3, width); + ZVAL_LONG(&_2$$3, height); + ZEPHIR_CALL_METHOD(NULL, &image, "scaleimage", &_3, 0, &_1$$3, &_2$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$3, image, "nextimage", &_5, 0); + ZEPHIR_CALL_METHOD(&_4$$3, &image, "nextimage", &_5, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_4$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_4$$3)) { break; } } - ZEPHIR_CALL_METHOD(&_6, image, "getimagewidth", NULL, 0); + ZEPHIR_CALL_METHOD(&_6, &image, "getimagewidth", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _6 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_7, image, "getimageheight", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_width"), &_6); + ZEPHIR_CALL_METHOD(&_7, &image, "getimageheight", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _7 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_7); ZEPHIR_MM_RESTORE(); } @@ -304,8 +361,20 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _resize) { PHP_METHOD(Phalcon_Image_Adapter_Imagick, _liquidRescale) { zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL; - zval *width_param = NULL, *height_param = NULL, *deltaX_param = NULL, *rigidity_param = NULL, *ret = NULL, *image = NULL, *_0, *_8 = NULL, *_9 = NULL, *_1$$3 = NULL, *_2$$3 = NULL, *_3$$3 = NULL, *_4$$3 = NULL, *_6$$3 = NULL; + zval *width_param = NULL, *height_param = NULL, *deltaX_param = NULL, *rigidity_param = NULL, ret, image, _0, _8, _9, _1$$3, _2$$3, _3$$3, _4$$3, _6$$3; zend_long width, height, deltaX, rigidity, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_6$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &width_param, &height_param, &deltaX_param, &rigidity_param); @@ -316,39 +385,34 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _liquidRescale) { rigidity = zephir_get_intval(rigidity_param); - ZEPHIR_OBS_VAR(image); - zephir_read_property_this(&image, this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 0); - ZEPHIR_CALL_METHOD(NULL, image, "setiteratorindex", NULL, 0, _0); + ZEPHIR_OBS_VAR(&image); + zephir_read_property(&image, this_ptr, SL("_image"), PH_NOISY_CC); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(NULL, &image, "setiteratorindex", NULL, 0, &_0); zephir_check_call_status(); while (1) { - ZEPHIR_INIT_NVAR(_1$$3); - ZVAL_LONG(_1$$3, width); - ZEPHIR_INIT_NVAR(_2$$3); - ZVAL_LONG(_2$$3, height); - ZEPHIR_INIT_NVAR(_3$$3); - ZVAL_LONG(_3$$3, deltaX); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_LONG(_4$$3, rigidity); - ZEPHIR_CALL_METHOD(&ret, image, "liquidrescaleimage", &_5, 0, _1$$3, _2$$3, _3$$3, _4$$3); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(ret)) { + ZVAL_LONG(&_1$$3, width); + ZVAL_LONG(&_2$$3, height); + ZVAL_LONG(&_3$$3, deltaX); + ZVAL_LONG(&_4$$3, rigidity); + ZEPHIR_CALL_METHOD(&ret, &image, "liquidrescaleimage", &_5, 0, &_1$$3, &_2$$3, &_3$$3, &_4$$3); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&ret)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::liquidRescale failed", "phalcon/image/adapter/imagick.zep", 157); return; } - ZEPHIR_CALL_METHOD(&_6$$3, image, "nextimage", &_7, 0); + ZEPHIR_CALL_METHOD(&_6$$3, &image, "nextimage", &_7, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_6$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$3)) { break; } } - ZEPHIR_CALL_METHOD(&_8, image, "getimagewidth", NULL, 0); + ZEPHIR_CALL_METHOD(&_8, &image, "getimagewidth", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _8 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_9, image, "getimageheight", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_width"), &_8); + ZEPHIR_CALL_METHOD(&_9, &image, "getimageheight", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _9 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_9); ZEPHIR_MM_RESTORE(); } @@ -359,8 +423,19 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _liquidRescale) { PHP_METHOD(Phalcon_Image_Adapter_Imagick, _crop) { zephir_fcall_cache_entry *_5 = NULL, *_6 = NULL, *_8 = NULL; - zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, *image = NULL, *_0, *_9 = NULL, *_10 = NULL, *_1$$3 = NULL, *_2$$3 = NULL, *_3$$3 = NULL, *_4$$3 = NULL, *_7$$3 = NULL; + zval *width_param = NULL, *height_param = NULL, *offsetX_param = NULL, *offsetY_param = NULL, image, _0, _9, _10, _1$$3, _2$$3, _3$$3, _4$$3, _7$$3; zend_long width, height, offsetX, offsetY, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_7$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &width_param, &height_param, &offsetX_param, &offsetY_param); @@ -371,45 +446,36 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _crop) { offsetY = zephir_get_intval(offsetY_param); - ZEPHIR_OBS_VAR(image); - zephir_read_property_this(&image, this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 0); - ZEPHIR_CALL_METHOD(NULL, image, "setiteratorindex", NULL, 0, _0); + ZEPHIR_OBS_VAR(&image); + zephir_read_property(&image, this_ptr, SL("_image"), PH_NOISY_CC); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(NULL, &image, "setiteratorindex", NULL, 0, &_0); zephir_check_call_status(); while (1) { - ZEPHIR_INIT_NVAR(_1$$3); - ZVAL_LONG(_1$$3, width); - ZEPHIR_INIT_NVAR(_2$$3); - ZVAL_LONG(_2$$3, height); - ZEPHIR_INIT_NVAR(_3$$3); - ZVAL_LONG(_3$$3, offsetX); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_LONG(_4$$3, offsetY); - ZEPHIR_CALL_METHOD(NULL, image, "cropimage", &_5, 0, _1$$3, _2$$3, _3$$3, _4$$3); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_1$$3); - ZVAL_LONG(_1$$3, width); - ZEPHIR_INIT_NVAR(_2$$3); - ZVAL_LONG(_2$$3, height); - ZEPHIR_INIT_NVAR(_3$$3); - ZVAL_LONG(_3$$3, 0); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_LONG(_4$$3, 0); - ZEPHIR_CALL_METHOD(NULL, image, "setimagepage", &_6, 0, _1$$3, _2$$3, _3$$3, _4$$3); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_7$$3, image, "nextimage", &_8, 0); - zephir_check_call_status(); - if (!(zephir_is_true(_7$$3))) { + ZVAL_LONG(&_1$$3, width); + ZVAL_LONG(&_2$$3, height); + ZVAL_LONG(&_3$$3, offsetX); + ZVAL_LONG(&_4$$3, offsetY); + ZEPHIR_CALL_METHOD(NULL, &image, "cropimage", &_5, 0, &_1$$3, &_2$$3, &_3$$3, &_4$$3); + zephir_check_call_status(); + ZVAL_LONG(&_1$$3, width); + ZVAL_LONG(&_2$$3, height); + ZVAL_LONG(&_3$$3, 0); + ZVAL_LONG(&_4$$3, 0); + ZEPHIR_CALL_METHOD(NULL, &image, "setimagepage", &_6, 0, &_1$$3, &_2$$3, &_3$$3, &_4$$3); + zephir_check_call_status(); + ZEPHIR_CALL_METHOD(&_7$$3, &image, "nextimage", &_8, 0); + zephir_check_call_status(); + if (!(zephir_is_true(&_7$$3))) { break; } } - ZEPHIR_CALL_METHOD(&_9, image, "getimagewidth", NULL, 0); + ZEPHIR_CALL_METHOD(&_9, &image, "getimagewidth", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _9 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_10, image, "getimageheight", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_width"), &_9); + ZEPHIR_CALL_METHOD(&_10, &image, "getimageheight", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _10 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_10); ZEPHIR_MM_RESTORE(); } @@ -419,8 +485,23 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _crop) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _rotate) { - zval *degrees_param = NULL, *pixel = NULL, *_0, *_1, *_10, *_11 = NULL, *_12, *_13 = NULL, *_2$$3, *_3$$3 = NULL, *_4$$3, *_5$$3, *_6$$3, *_7$$3 = NULL, *_8$$3, *_9$$3 = NULL; + zval *degrees_param = NULL, pixel, _0, _1, _9, _10, _11, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3; zend_long degrees, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pixel); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_8$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, °rees_param); @@ -428,45 +509,43 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _rotate) { degrees = zephir_get_intval(degrees_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_CALL_METHOD(NULL, _0, "setiteratorindex", NULL, 0, _1); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(pixel); - object_init_ex(pixel, zephir_get_internal_ce(SS("imagickpixel") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, pixel, "__construct", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_1, 0); + ZEPHIR_CALL_METHOD(NULL, &_0, "setiteratorindex", NULL, 0, &_1); zephir_check_call_status(); + ZEPHIR_INIT_VAR(&pixel); + object_init_ex(&pixel, zephir_get_internal_ce(SL("imagickpixel"))); + if (zephir_has_constructor(&pixel TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &pixel, "__construct", NULL, 0); + zephir_check_call_status(); + } while (1) { - _2$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_3$$3); - ZVAL_LONG(_3$$3, degrees); - ZEPHIR_CALL_METHOD(NULL, _2$$3, "rotateimage", NULL, 0, pixel, _3$$3); - zephir_check_call_status(); - _4$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - _5$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _6$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_3$$3); - ZVAL_LONG(_3$$3, 0); - ZEPHIR_INIT_NVAR(_7$$3); - ZVAL_LONG(_7$$3, 0); - ZEPHIR_CALL_METHOD(NULL, _4$$3, "setimagepage", NULL, 0, _5$$3, _6$$3, _3$$3, _7$$3); - zephir_check_call_status(); - _8$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_9$$3, _8$$3, "nextimage", NULL, 0); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_9$$3)) { + zephir_read_property(&_2$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_3$$3, degrees); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "rotateimage", NULL, 0, &pixel, &_3$$3); + zephir_check_call_status(); + zephir_read_property(&_3$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_4$$3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_5$$3, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_6$$3, 0); + ZVAL_LONG(&_7$$3, 0); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "setimagepage", NULL, 0, &_4$$3, &_5$$3, &_6$$3, &_7$$3); + zephir_check_call_status(); + zephir_read_property(&_6$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_8$$3, &_6$$3, "nextimage", NULL, 0); + zephir_check_call_status(); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_8$$3)) { break; } } - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_11, _10, "getimagewidth", NULL, 0); + zephir_read_property(&_1, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_9, &_1, "getimagewidth", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _11 TSRMLS_CC); - _12 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_13, _12, "getimageheight", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_width"), &_9); + zephir_read_property(&_10, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_11, &_10, "getimageheight", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _13 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_11); ZEPHIR_MM_RESTORE(); } @@ -476,8 +555,16 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _rotate) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _flip) { - zval *direction_param = NULL, *func = NULL, *_0, *_1, *_2$$4, *_3$$4, *_4$$4 = NULL; + zval *direction_param = NULL, func, _0, _1, _2$$4, _3$$4, _4$$4; zend_long direction, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&func); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &direction_param); @@ -485,25 +572,24 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _flip) { direction = zephir_get_intval(direction_param); - ZEPHIR_INIT_VAR(func); - ZVAL_STRING(func, "flipImage", 1); + ZEPHIR_INIT_VAR(&func); + ZVAL_STRING(&func, "flipImage"); if (direction == 11) { - ZEPHIR_INIT_NVAR(func); - ZVAL_STRING(func, "flopImage", 1); + ZEPHIR_INIT_NVAR(&func); + ZVAL_STRING(&func, "flopImage"); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_CALL_METHOD(NULL, _0, "setiteratorindex", NULL, 0, _1); + zephir_read_property(&_0, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_1, 0); + ZEPHIR_CALL_METHOD(NULL, &_0, "setiteratorindex", NULL, 0, &_1); zephir_check_call_status(); while (1) { - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD_ZVAL(NULL, _2$$4, func, NULL, 0); + zephir_read_property(&_2$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD_ZVAL(NULL, &_2$$4, &func, NULL, 0); zephir_check_call_status(); - _3$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_4$$4, _3$$4, "nextimage", NULL, 0); + zephir_read_property(&_3$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_4$$4, &_3$$4, "nextimage", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_4$$4)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_4$$4)) { break; } } @@ -516,8 +602,17 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _flip) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _sharpen) { - zval *amount_param = NULL, *_0 = NULL, *_1, *_2, *_3$$3, *_4$$3 = NULL, *_5$$3 = NULL, *_6$$3, *_7$$3 = NULL; + zval *amount_param = NULL, _0, _1, _2, _3$$3, _4$$3, _5$$3, _6$$3; zend_long amount, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &amount_param); @@ -525,33 +620,30 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _sharpen) { amount = zephir_get_intval(amount_param); - ZEPHIR_INIT_VAR(_0); + ZEPHIR_INIT_VAR(&_0); if (amount < 5) { - ZEPHIR_INIT_NVAR(_0); - ZVAL_LONG(_0, 5); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, 5); } else { - ZEPHIR_INIT_NVAR(_0); - ZVAL_LONG(_0, amount); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, amount); } - amount = zephir_get_numberval(_0); + amount = zephir_get_numberval(&_0); amount = (long) (zephir_safe_div_long_long(((amount * 3.0)), 100 TSRMLS_CC)); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_CALL_METHOD(NULL, _1, "setiteratorindex", NULL, 0, _2); + zephir_read_property(&_1, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_2, 0); + ZEPHIR_CALL_METHOD(NULL, &_1, "setiteratorindex", NULL, 0, &_2); zephir_check_call_status(); while (1) { - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_LONG(_4$$3, 0); - ZEPHIR_INIT_NVAR(_5$$3); - ZVAL_LONG(_5$$3, amount); - ZEPHIR_CALL_METHOD(NULL, _3$$3, "sharpenimage", NULL, 0, _4$$3, _5$$3); + zephir_read_property(&_3$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_4$$3, 0); + ZVAL_LONG(&_5$$3, amount); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "sharpenimage", NULL, 0, &_4$$3, &_5$$3); zephir_check_call_status(); - _6$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_7$$3, _6$$3, "nextimage", NULL, 0); + zephir_read_property(&_4$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_6$$3, &_4$$3, "nextimage", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_7$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$3)) { break; } } @@ -564,10 +656,64 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _sharpen) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _reflection) { - zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL, *_11 = NULL, *_13 = NULL, *_14 = NULL, *_16 = NULL, *_21 = NULL, *_24 = NULL, *_27 = NULL, *_29 = NULL, *_35 = NULL, *_38 = NULL, *_41 = NULL, *_44 = NULL, *_48 = NULL, *_56 = NULL; - zend_bool fadeIn, _57$$13; - zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, *reflection = NULL, *fade = NULL, *pseudo = NULL, *image = NULL, *pixel = NULL, *ret = NULL, *_0, *_4 = NULL, *_17 = NULL, *_18 = NULL, *_30, *_31 = NULL, *_32, *_59, *_60, *_61, *_62 = NULL, *_63, *_64 = NULL, *_1$$3, *_2$$4, *_3$$4 = NULL, *_6$$5 = NULL, *_8$$5 = NULL, *_9$$5 = NULL, *_10$$5 = NULL, *_12$$5 = NULL, *_15$$5 = NULL, _19$$7 = zval_used_for_init, *_20$$7 = NULL, *_22$$7 = NULL, *_23$$7 = NULL, *_25$$7 = NULL, *_26$$7 = NULL, *_28$$7 = NULL, *_33$$10, *_34$$10 = NULL, _36$$10 = zval_used_for_init, *_37$$10 = NULL, *_39$$10, *_40$$10 = NULL, *_42$$10, *_43$$10 = NULL, *_45$$10, *_46$$10 = NULL, *_47$$10 = NULL, *_49$$10, *_50$$10 = NULL, _51$$13 = zval_used_for_init, *_52$$13 = NULL, *_53$$13, *_54$$13 = NULL, *_55$$13 = NULL, *_58$$13 = NULL; + zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL, *_11 = NULL, *_13 = NULL, *_14 = NULL, *_16 = NULL, *_21 = NULL, *_24 = NULL, *_27 = NULL, *_29 = NULL, *_35 = NULL, *_38 = NULL, *_40 = NULL, *_43 = NULL, *_48 = NULL, *_55 = NULL; + zend_bool fadeIn, _56$$13; + zval *height_param = NULL, *opacity_param = NULL, *fadeIn_param = NULL, reflection, fade, pseudo, image, pixel, ret, _0, _4, _17, _18, _30, _31, _32, _58, _59, _60, _61, _62, _1$$3, _2$$4, _3$$4, _6$$5, _8$$5, _9$$5, _10$$5, _12$$5, _15$$5, _19$$7, _20$$7, _22$$7, _23$$7, _25$$7, _26$$7, _28$$7, _33$$10, _34$$10, _36$$10, _37$$10, _39$$10, _41$$10, _42$$10, _44$$10, _45$$10, _46$$10, _47$$10, _49$$10, _50$$13, _51$$13, _52$$13, _53$$13, _54$$13, _57$$13; zend_long height, opacity, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&reflection); + ZVAL_UNDEF(&fade); + ZVAL_UNDEF(&pseudo); + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&pixel); + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_17); + ZVAL_UNDEF(&_18); + ZVAL_UNDEF(&_30); + ZVAL_UNDEF(&_31); + ZVAL_UNDEF(&_32); + ZVAL_UNDEF(&_58); + ZVAL_UNDEF(&_59); + ZVAL_UNDEF(&_60); + ZVAL_UNDEF(&_61); + ZVAL_UNDEF(&_62); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_12$$5); + ZVAL_UNDEF(&_15$$5); + ZVAL_UNDEF(&_19$$7); + ZVAL_UNDEF(&_20$$7); + ZVAL_UNDEF(&_22$$7); + ZVAL_UNDEF(&_23$$7); + ZVAL_UNDEF(&_25$$7); + ZVAL_UNDEF(&_26$$7); + ZVAL_UNDEF(&_28$$7); + ZVAL_UNDEF(&_33$$10); + ZVAL_UNDEF(&_34$$10); + ZVAL_UNDEF(&_36$$10); + ZVAL_UNDEF(&_37$$10); + ZVAL_UNDEF(&_39$$10); + ZVAL_UNDEF(&_41$$10); + ZVAL_UNDEF(&_42$$10); + ZVAL_UNDEF(&_44$$10); + ZVAL_UNDEF(&_45$$10); + ZVAL_UNDEF(&_46$$10); + ZVAL_UNDEF(&_47$$10); + ZVAL_UNDEF(&_49$$10); + ZVAL_UNDEF(&_50$$13); + ZVAL_UNDEF(&_51$$13); + ZVAL_UNDEF(&_52$$13); + ZVAL_UNDEF(&_53$$13); + ZVAL_UNDEF(&_54$$13); + ZVAL_UNDEF(&_57$$13); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &height_param, &opacity_param, &fadeIn_param); @@ -577,223 +723,211 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _reflection) { fadeIn = zephir_get_boolval(fadeIn_param); - _0 = zephir_fetch_static_property_ce(phalcon_image_adapter_imagick_ce, SL("_version") TSRMLS_CC); - ZEPHIR_INIT_VAR(reflection); - if (ZEPHIR_GE_LONG(_0, 30100)) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - if (zephir_clone(reflection, _1$$3 TSRMLS_CC) == FAILURE) { + zephir_read_static_property_ce(&_0, phalcon_image_adapter_imagick_ce, SL("_version"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&reflection); + if (ZEPHIR_GE_LONG(&_0, 30100)) { + zephir_read_property(&_1$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + if (zephir_clone(&reflection, &_1$$3 TSRMLS_CC) == FAILURE) { RETURN_MM(); } } else { - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_3$$4, _2$$4, "clone", NULL, 0); + zephir_read_property(&_2$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_3$$4, &_2$$4, "clone", NULL, 0); zephir_check_call_status(); - if (zephir_clone(reflection, _3$$4 TSRMLS_CC) == FAILURE) { + if (zephir_clone(&reflection, &_3$$4 TSRMLS_CC) == FAILURE) { RETURN_MM(); } } - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_CALL_METHOD(NULL, reflection, "setiteratorindex", NULL, 0, _4); + ZVAL_LONG(&_4, 0); + ZEPHIR_CALL_METHOD(NULL, &reflection, "setiteratorindex", NULL, 0, &_4); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(NULL, reflection, "flipimage", &_5, 0); + ZEPHIR_CALL_METHOD(NULL, &reflection, "flipimage", &_5, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$5, reflection, "getimagewidth", &_7, 0); + ZEPHIR_CALL_METHOD(&_6$$5, &reflection, "getimagewidth", &_7, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_8$$5); - ZVAL_LONG(_8$$5, height); - ZEPHIR_INIT_NVAR(_9$$5); - ZVAL_LONG(_9$$5, 0); - ZEPHIR_INIT_NVAR(_10$$5); - ZVAL_LONG(_10$$5, 0); - ZEPHIR_CALL_METHOD(NULL, reflection, "cropimage", &_11, 0, _6$$5, _8$$5, _9$$5, _10$$5); + ZVAL_LONG(&_8$$5, height); + ZVAL_LONG(&_9$$5, 0); + ZVAL_LONG(&_10$$5, 0); + ZEPHIR_CALL_METHOD(NULL, &reflection, "cropimage", &_11, 0, &_6$$5, &_8$$5, &_9$$5, &_10$$5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_12$$5, reflection, "getimagewidth", &_13, 0); + ZEPHIR_CALL_METHOD(&_12$$5, &reflection, "getimagewidth", &_13, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_8$$5); - ZVAL_LONG(_8$$5, height); - ZEPHIR_INIT_NVAR(_9$$5); - ZVAL_LONG(_9$$5, 0); - ZEPHIR_INIT_NVAR(_10$$5); - ZVAL_LONG(_10$$5, 0); - ZEPHIR_CALL_METHOD(NULL, reflection, "setimagepage", &_14, 0, _12$$5, _8$$5, _9$$5, _10$$5); + ZVAL_LONG(&_8$$5, height); + ZVAL_LONG(&_9$$5, 0); + ZVAL_LONG(&_10$$5, 0); + ZEPHIR_CALL_METHOD(NULL, &reflection, "setimagepage", &_14, 0, &_12$$5, &_8$$5, &_9$$5, &_10$$5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_15$$5, reflection, "nextimage", &_16, 0); + ZEPHIR_CALL_METHOD(&_15$$5, &reflection, "nextimage", &_16, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_15$$5)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_15$$5)) { break; } } if (fadeIn) { - ZEPHIR_INIT_VAR(pseudo); - ZVAL_STRING(pseudo, "gradient:black-transparent", 1); + ZEPHIR_INIT_VAR(&pseudo); + ZVAL_STRING(&pseudo, "gradient:black-transparent"); } else { - ZEPHIR_INIT_NVAR(pseudo); - ZVAL_STRING(pseudo, "gradient:transparent-black", 1); + ZEPHIR_INIT_NVAR(&pseudo); + ZVAL_STRING(&pseudo, "gradient:transparent-black"); } - ZEPHIR_INIT_VAR(fade); - object_init_ex(fade, zephir_get_internal_ce(SS("imagick") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, fade, "__construct", NULL, 0); - zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_17, reflection, "getimagewidth", NULL, 0); + ZEPHIR_INIT_VAR(&fade); + object_init_ex(&fade, zephir_get_internal_ce(SL("imagick"))); + if (zephir_has_constructor(&fade TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &fade, "__construct", NULL, 0); + zephir_check_call_status(); + } + ZEPHIR_CALL_METHOD(&_17, &reflection, "getimagewidth", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_18, reflection, "getimageheight", NULL, 0); + ZEPHIR_CALL_METHOD(&_18, &reflection, "getimageheight", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, fade, "newpseudoimage", NULL, 0, _17, _18, pseudo); + ZEPHIR_CALL_METHOD(NULL, &fade, "newpseudoimage", NULL, 0, &_17, &_18, &pseudo); zephir_check_call_status(); opacity /= 100; - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_CALL_METHOD(NULL, reflection, "setiteratorindex", NULL, 0, _4); + ZVAL_LONG(&_4, 0); + ZEPHIR_CALL_METHOD(NULL, &reflection, "setiteratorindex", NULL, 0, &_4); zephir_check_call_status(); while (1) { - ZEPHIR_SINIT_NVAR(_19$$7); - ZVAL_STRING(&_19$$7, "Imagick::COMPOSITE_DSTOUT", 0); - ZEPHIR_CALL_FUNCTION(&_20$$7, "constant", &_21, 38, &_19$$7); + ZEPHIR_INIT_NVAR(&_19$$7); + ZVAL_STRING(&_19$$7, "Imagick::COMPOSITE_DSTOUT"); + ZEPHIR_CALL_FUNCTION(&_20$$7, "constant", &_21, 32, &_19$$7); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_22$$7); - ZVAL_LONG(_22$$7, 0); - ZEPHIR_INIT_NVAR(_23$$7); - ZVAL_LONG(_23$$7, 0); - ZEPHIR_CALL_METHOD(&ret, reflection, "compositeimage", &_24, 0, fade, _20$$7, _22$$7, _23$$7); + ZVAL_LONG(&_22$$7, 0); + ZVAL_LONG(&_23$$7, 0); + ZEPHIR_CALL_METHOD(&ret, &reflection, "compositeimage", &_24, 0, &fade, &_20$$7, &_22$$7, &_23$$7); zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(ret)) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&ret)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/image/adapter/imagick.zep", 292); return; } - ZEPHIR_SINIT_NVAR(_19$$7); - ZVAL_STRING(&_19$$7, "Imagick::EVALUATE_MULTIPLY", 0); - ZEPHIR_CALL_FUNCTION(&_25$$7, "constant", &_21, 38, &_19$$7); + ZEPHIR_INIT_NVAR(&_19$$7); + ZVAL_STRING(&_19$$7, "Imagick::EVALUATE_MULTIPLY"); + ZEPHIR_CALL_FUNCTION(&_25$$7, "constant", &_21, 32, &_19$$7); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_19$$7); - ZVAL_STRING(&_19$$7, "Imagick::CHANNEL_ALPHA", 0); - ZEPHIR_CALL_FUNCTION(&_26$$7, "constant", &_21, 38, &_19$$7); + ZEPHIR_INIT_NVAR(&_19$$7); + ZVAL_STRING(&_19$$7, "Imagick::CHANNEL_ALPHA"); + ZEPHIR_CALL_FUNCTION(&_26$$7, "constant", &_21, 32, &_19$$7); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_22$$7); - ZVAL_LONG(_22$$7, opacity); - ZEPHIR_CALL_METHOD(NULL, reflection, "evaluateimage", &_27, 0, _25$$7, _22$$7, _26$$7); + ZVAL_LONG(&_22$$7, opacity); + ZEPHIR_CALL_METHOD(NULL, &reflection, "evaluateimage", &_27, 0, &_25$$7, &_22$$7, &_26$$7); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_28$$7, reflection, "nextimage", &_29, 0); + ZEPHIR_CALL_METHOD(&_28$$7, &reflection, "nextimage", &_29, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_28$$7)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_28$$7)) { break; } } - ZEPHIR_CALL_METHOD(NULL, fade, "destroy", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(image); - object_init_ex(image, zephir_get_internal_ce(SS("imagick") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, image, "__construct", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &fade, "destroy", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(pixel); - object_init_ex(pixel, zephir_get_internal_ce(SS("imagickpixel") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, pixel, "__construct", NULL, 0); - zephir_check_call_status(); - _30 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_31, _30, "getimageheight", NULL, 0); + ZEPHIR_INIT_VAR(&image); + object_init_ex(&image, zephir_get_internal_ce(SL("imagick"))); + if (zephir_has_constructor(&image TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &image, "__construct", NULL, 0); + zephir_check_call_status(); + } + ZEPHIR_INIT_VAR(&pixel); + object_init_ex(&pixel, zephir_get_internal_ce(SL("imagickpixel"))); + if (zephir_has_constructor(&pixel TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &pixel, "__construct", NULL, 0); + zephir_check_call_status(); + } + zephir_read_property(&_4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_30, &_4, "getimageheight", NULL, 0); zephir_check_call_status(); - height = (zephir_get_numberval(_31) + height); - _32 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_CALL_METHOD(NULL, _32, "setiteratorindex", NULL, 0, _4); + height = (zephir_get_numberval(&_30) + height); + zephir_read_property(&_31, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_32, 0); + ZEPHIR_CALL_METHOD(NULL, &_31, "setiteratorindex", NULL, 0, &_32); zephir_check_call_status(); while (1) { - _33$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_34$$10); - ZVAL_LONG(_34$$10, height); - ZEPHIR_CALL_METHOD(NULL, image, "newimage", &_35, 0, _33$$10, _34$$10, pixel); + zephir_read_property(&_33$$10, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_34$$10, height); + ZEPHIR_CALL_METHOD(NULL, &image, "newimage", &_35, 0, &_33$$10, &_34$$10, &pixel); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_36$$10); - ZVAL_STRING(&_36$$10, "Imagick::ALPHACHANNEL_SET", 0); - ZEPHIR_CALL_FUNCTION(&_37$$10, "constant", &_21, 38, &_36$$10); + ZEPHIR_INIT_NVAR(&_36$$10); + ZVAL_STRING(&_36$$10, "Imagick::ALPHACHANNEL_SET"); + ZEPHIR_CALL_FUNCTION(&_37$$10, "constant", &_21, 32, &_36$$10); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, image, "setimagealphachannel", &_38, 0, _37$$10); + ZEPHIR_CALL_METHOD(NULL, &image, "setimagealphachannel", &_38, 0, &_37$$10); zephir_check_call_status(); - _39$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_40$$10, _39$$10, "getcolorspace", NULL, 0); + zephir_read_property(&_34$$10, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_39$$10, &_34$$10, "getcolorspace", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, image, "setcolorspace", &_41, 0, _40$$10); + ZEPHIR_CALL_METHOD(NULL, &image, "setcolorspace", &_40, 0, &_39$$10); zephir_check_call_status(); - _42$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_43$$10, _42$$10, "getimagedelay", NULL, 0); + zephir_read_property(&_41$$10, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_42$$10, &_41$$10, "getimagedelay", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, image, "setimagedelay", &_44, 0, _43$$10); + ZEPHIR_CALL_METHOD(NULL, &image, "setimagedelay", &_43, 0, &_42$$10); zephir_check_call_status(); - _45$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_36$$10); - ZVAL_STRING(&_36$$10, "Imagick::COMPOSITE_SRC", 0); - ZEPHIR_CALL_FUNCTION(&_46$$10, "constant", &_21, 38, &_36$$10); + zephir_read_property(&_44$$10, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&_36$$10); + ZVAL_STRING(&_36$$10, "Imagick::COMPOSITE_SRC"); + ZEPHIR_CALL_FUNCTION(&_45$$10, "constant", &_21, 32, &_36$$10); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_34$$10); - ZVAL_LONG(_34$$10, 0); - ZEPHIR_INIT_NVAR(_47$$10); - ZVAL_LONG(_47$$10, 0); - ZEPHIR_CALL_METHOD(&ret, image, "compositeimage", &_48, 0, _45$$10, _46$$10, _34$$10, _47$$10); + ZVAL_LONG(&_46$$10, 0); + ZVAL_LONG(&_47$$10, 0); + ZEPHIR_CALL_METHOD(&ret, &image, "compositeimage", &_48, 0, &_44$$10, &_45$$10, &_46$$10, &_47$$10); zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(ret)) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&ret)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/image/adapter/imagick.zep", 317); return; } - _49$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_50$$10, _49$$10, "nextimage", NULL, 0); + zephir_read_property(&_46$$10, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_49$$10, &_46$$10, "nextimage", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_50$$10)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_49$$10)) { break; } } - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_CALL_METHOD(NULL, image, "setiteratorindex", NULL, 0, _4); + ZVAL_LONG(&_32, 0); + ZEPHIR_CALL_METHOD(NULL, &image, "setiteratorindex", NULL, 0, &_32); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_CALL_METHOD(NULL, reflection, "setiteratorindex", NULL, 0, _4); + ZVAL_LONG(&_32, 0); + ZEPHIR_CALL_METHOD(NULL, &reflection, "setiteratorindex", NULL, 0, &_32); zephir_check_call_status(); while (1) { - ZEPHIR_SINIT_NVAR(_51$$13); - ZVAL_STRING(&_51$$13, "Imagick::COMPOSITE_OVER", 0); - ZEPHIR_CALL_FUNCTION(&_52$$13, "constant", &_21, 38, &_51$$13); + ZEPHIR_INIT_NVAR(&_50$$13); + ZVAL_STRING(&_50$$13, "Imagick::COMPOSITE_OVER"); + ZEPHIR_CALL_FUNCTION(&_51$$13, "constant", &_21, 32, &_50$$13); zephir_check_call_status(); - _53$$13 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_54$$13); - ZVAL_LONG(_54$$13, 0); - ZEPHIR_CALL_METHOD(&ret, image, "compositeimage", &_48, 0, reflection, _52$$13, _54$$13, _53$$13); + zephir_read_property(&_52$$13, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_53$$13, 0); + ZEPHIR_CALL_METHOD(&ret, &image, "compositeimage", &_48, 0, &reflection, &_51$$13, &_53$$13, &_52$$13); zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(ret)) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&ret)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/image/adapter/imagick.zep", 332); return; } - ZEPHIR_CALL_METHOD(&_55$$13, image, "nextimage", &_56, 0); + ZEPHIR_CALL_METHOD(&_54$$13, &image, "nextimage", &_55, 0); zephir_check_call_status(); - _57$$13 = ZEPHIR_IS_FALSE_IDENTICAL(_55$$13); - if (!(_57$$13)) { - ZEPHIR_CALL_METHOD(&_58$$13, reflection, "nextimage", NULL, 0); + _56$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_54$$13); + if (!(_56$$13)) { + ZEPHIR_CALL_METHOD(&_57$$13, &reflection, "nextimage", NULL, 0); zephir_check_call_status(); - _57$$13 = ZEPHIR_IS_FALSE_IDENTICAL(_58$$13); + _56$$13 = ZEPHIR_IS_FALSE_IDENTICAL(&_57$$13); } - if (_57$$13) { + if (_56$$13) { break; } } - ZEPHIR_CALL_METHOD(NULL, reflection, "destroy", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &reflection, "destroy", NULL, 0); zephir_check_call_status(); - _59 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _59, "clear", NULL, 0); + zephir_read_property(&_32, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_32, "clear", NULL, 0); zephir_check_call_status(); - _60 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _60, "destroy", NULL, 0); + zephir_read_property(&_58, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_58, "destroy", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), image TSRMLS_CC); - _61 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_62, _61, "getimagewidth", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_image"), &image); + zephir_read_property(&_59, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_60, &_59, "getimagewidth", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_width"), _62 TSRMLS_CC); - _63 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_64, _63, "getimageheight", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_width"), &_60); + zephir_read_property(&_61, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_62, &_61, "getimageheight", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_height"), _64 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_height"), &_62); ZEPHIR_MM_RESTORE(); } @@ -805,7 +939,24 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _watermark) { zephir_fcall_cache_entry *_7 = NULL; zend_long offsetX, offsetY, opacity, ZEPHIR_LAST_CALL_STATUS; - zval *image, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, *watermark = NULL, *ret = NULL, *version = NULL, *method = NULL, *_1 = NULL, *_2 = NULL, *_3, *_0$$3, *_4$$5, _5$$5 = zval_used_for_init, *_6$$5 = NULL, *_8$$5 = NULL, *_9$$5 = NULL, *_10$$5, *_11$$5 = NULL; + zval *image, image_sub, *offsetX_param = NULL, *offsetY_param = NULL, *opacity_param = NULL, watermark, ret, version, method, _1, _2, _3, _0$$3, _4$$5, _5$$5, _6$$5, _8$$5, _9$$5, _10$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&image_sub); + ZVAL_UNDEF(&watermark); + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&version); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &image, &offsetX_param, &offsetY_param, &opacity_param); @@ -816,60 +967,58 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _watermark) { opacity = (long) (zephir_safe_div_long_long(opacity, 100 TSRMLS_CC)); - ZEPHIR_INIT_VAR(watermark); - object_init_ex(watermark, zephir_get_internal_ce(SS("imagick") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, watermark, "__construct", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(method); - ZVAL_STRING(method, "setImageOpacity", 1); - if (EXPECTED((zephir_method_exists_ex(watermark, SS("getversion") TSRMLS_CC) == SUCCESS))) { - ZEPHIR_CALL_METHOD(&version, watermark, "getversion", NULL, 0); - zephir_check_call_status(); - zephir_array_fetch_string(&_0$$3, version, SL("versionNumber"), PH_NOISY | PH_READONLY, "phalcon/image/adapter/imagick.zep", 365 TSRMLS_CC); - if (ZEPHIR_GE_LONG(_0$$3, 0x700)) { - ZEPHIR_INIT_NVAR(method); - ZVAL_STRING(method, "setImageAlpha", 1); + ZEPHIR_INIT_VAR(&watermark); + object_init_ex(&watermark, zephir_get_internal_ce(SL("imagick"))); + if (zephir_has_constructor(&watermark TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &watermark, "__construct", NULL, 0); + zephir_check_call_status(); + } + ZEPHIR_INIT_VAR(&method); + ZVAL_STRING(&method, "setImageOpacity"); + if (EXPECTED((zephir_method_exists_ex(&watermark, SL("getversion") TSRMLS_CC) == SUCCESS))) { + ZEPHIR_CALL_METHOD(&version, &watermark, "getversion", NULL, 0); + zephir_check_call_status(); + zephir_array_fetch_string(&_0$$3, &version, SL("versionNumber"), PH_NOISY | PH_READONLY, "phalcon/image/adapter/imagick.zep", 365 TSRMLS_CC); + if (ZEPHIR_GE_LONG(&_0$$3, 0x700)) { + ZEPHIR_INIT_NVAR(&method); + ZVAL_STRING(&method, "setImageAlpha"); } } ZEPHIR_CALL_METHOD(&_1, image, "render", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, watermark, "readimageblob", NULL, 0, _1); + ZEPHIR_CALL_METHOD(NULL, &watermark, "readimageblob", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, opacity); - ZEPHIR_CALL_METHOD_ZVAL(NULL, watermark, method, NULL, 0, _2); + ZVAL_LONG(&_2, opacity); + ZEPHIR_CALL_METHOD_ZVAL(NULL, &watermark, &method, NULL, 0, &_2); zephir_check_call_status(); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_CALL_METHOD(NULL, _3, "setiteratorindex", NULL, 0, _2); + zephir_read_property(&_2, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_3, 0); + ZEPHIR_CALL_METHOD(NULL, &_2, "setiteratorindex", NULL, 0, &_3); zephir_check_call_status(); while (1) { - _4$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_5$$5); - ZVAL_STRING(&_5$$5, "Imagick::COMPOSITE_OVER", 0); - ZEPHIR_CALL_FUNCTION(&_6$$5, "constant", &_7, 38, &_5$$5); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_8$$5); - ZVAL_LONG(_8$$5, offsetX); - ZEPHIR_INIT_NVAR(_9$$5); - ZVAL_LONG(_9$$5, offsetY); - ZEPHIR_CALL_METHOD(&ret, _4$$5, "compositeimage", NULL, 0, watermark, _6$$5, _8$$5, _9$$5); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(ret)) { + zephir_read_property(&_4$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&_5$$5); + ZVAL_STRING(&_5$$5, "Imagick::COMPOSITE_OVER"); + ZEPHIR_CALL_FUNCTION(&_6$$5, "constant", &_7, 32, &_5$$5); + zephir_check_call_status(); + ZVAL_LONG(&_8$$5, offsetX); + ZVAL_LONG(&_9$$5, offsetY); + ZEPHIR_CALL_METHOD(&ret, &_4$$5, "compositeimage", NULL, 0, &watermark, &_6$$5, &_8$$5, &_9$$5); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&ret)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/image/adapter/imagick.zep", 379); return; } - _10$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_11$$5, _10$$5, "nextimage", NULL, 0); + zephir_read_property(&_8$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_10$$5, &_8$$5, "nextimage", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_11$$5)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_10$$5)) { break; } } - ZEPHIR_CALL_METHOD(NULL, watermark, "clear", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &watermark, "clear", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, watermark, "destroy", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &watermark, "destroy", NULL, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -880,15 +1029,49 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _watermark) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { - zend_bool _7$$7; + zend_bool _6$$7; zend_long opacity, r, g, b, size, ZEPHIR_LAST_CALL_STATUS, x = 0, y = 0; - zval *text_param = NULL, *offsetX = NULL, *offsetY = NULL, *opacity_param = NULL, *r_param = NULL, *g_param = NULL, *b_param = NULL, *size_param = NULL, *fontfile_param = NULL, *draw = NULL, *color = NULL, *gravity = NULL, _0, _1, _2, _3, *_4, *_24, *_25, *_5$$4, *_6$$5, _8$$8, _9$$10, _10$$12, _11$$13, _12$$17, _13$$18, _14$$20, _15$$21, _16$$27, _17$$28, _18$$30, _19$$31, _20$$35, _21$$36, _22$$38, _23$$39, *_26$$40, *_27$$40 = NULL, *_28$$40, *_29$$40 = NULL; - zval *text = NULL, *fontfile = NULL; + zval *text_param = NULL, *offsetX = NULL, offsetX_sub, *offsetY = NULL, offsetY_sub, *opacity_param = NULL, *r_param = NULL, *g_param = NULL, *b_param = NULL, *size_param = NULL, *fontfile_param = NULL, draw, color, gravity, _0, _1, _2, _3, _4$$4, _5$$5, _7$$8, _8$$10, _9$$12, _10$$13, _11$$17, _12$$18, _13$$20, _14$$21, _15$$27, _16$$28, _17$$30, _18$$31, _19$$35, _20$$36, _21$$38, _22$$39, _23$$40, _24$$40, _25$$40; + zval text, fontfile; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&fontfile); + ZVAL_UNDEF(&offsetX_sub); + ZVAL_UNDEF(&offsetY_sub); + ZVAL_UNDEF(&draw); + ZVAL_UNDEF(&color); + ZVAL_UNDEF(&gravity); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_8$$10); + ZVAL_UNDEF(&_9$$12); + ZVAL_UNDEF(&_10$$13); + ZVAL_UNDEF(&_11$$17); + ZVAL_UNDEF(&_12$$18); + ZVAL_UNDEF(&_13$$20); + ZVAL_UNDEF(&_14$$21); + ZVAL_UNDEF(&_15$$27); + ZVAL_UNDEF(&_16$$28); + ZVAL_UNDEF(&_17$$30); + ZVAL_UNDEF(&_18$$31); + ZVAL_UNDEF(&_19$$35); + ZVAL_UNDEF(&_20$$36); + ZVAL_UNDEF(&_21$$38); + ZVAL_UNDEF(&_22$$39); + ZVAL_UNDEF(&_23$$40); + ZVAL_UNDEF(&_24$$40); + ZVAL_UNDEF(&_25$$40); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 9, 0, &text_param, &offsetX, &offsetY, &opacity_param, &r_param, &g_param, &b_param, &size_param, &fontfile_param); - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); ZEPHIR_SEPARATE_PARAM(offsetX); ZEPHIR_SEPARATE_PARAM(offsetY); opacity = zephir_get_intval(opacity_param); @@ -896,79 +1079,78 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { g = zephir_get_intval(g_param); b = zephir_get_intval(b_param); size = zephir_get_intval(size_param); - zephir_get_strval(fontfile, fontfile_param); + zephir_get_strval(&fontfile, fontfile_param); opacity = (long) (zephir_safe_div_long_long(opacity, 100 TSRMLS_CC)); - ZEPHIR_INIT_VAR(draw); - object_init_ex(draw, zephir_get_internal_ce(SS("imagickdraw") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, draw, "__construct", NULL, 0); - zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "rgb(%d, %d, %d)", 0); - ZEPHIR_SINIT_VAR(_1); + ZEPHIR_INIT_VAR(&draw); + object_init_ex(&draw, zephir_get_internal_ce(SL("imagickdraw"))); + if (zephir_has_constructor(&draw TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &draw, "__construct", NULL, 0); + zephir_check_call_status(); + } + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "rgb(%d, %d, %d)"); ZVAL_LONG(&_1, r); - ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, g); - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, b); - ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 164, &_0, &_1, &_2, &_3); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4); - object_init_ex(_4, zephir_get_internal_ce(SS("imagickpixel") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 0, color); + ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 145, &_0, &_1, &_2, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, draw, "setfillcolor", NULL, 0, _4); + ZEPHIR_INIT_NVAR(&_0); + object_init_ex(&_0, zephir_get_internal_ce(SL("imagickpixel"))); + if (zephir_has_constructor(&_0 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0, &color); + zephir_check_call_status(); + } + ZEPHIR_CALL_METHOD(NULL, &draw, "setfillcolor", NULL, 0, &_0); zephir_check_call_status(); - if (!(!fontfile) && Z_STRLEN_P(fontfile)) { - ZEPHIR_CALL_METHOD(NULL, draw, "setfont", NULL, 0, fontfile); + if (!(Z_TYPE_P(&fontfile) == IS_UNDEF) && Z_STRLEN_P(&fontfile)) { + ZEPHIR_CALL_METHOD(NULL, &draw, "setfont", NULL, 0, &fontfile); zephir_check_call_status(); } if (size) { - ZEPHIR_INIT_VAR(_5$$4); - ZVAL_LONG(_5$$4, size); - ZEPHIR_CALL_METHOD(NULL, draw, "setfontsize", NULL, 0, _5$$4); + ZVAL_LONG(&_4$$4, size); + ZEPHIR_CALL_METHOD(NULL, &draw, "setfontsize", NULL, 0, &_4$$4); zephir_check_call_status(); } if (opacity) { - ZEPHIR_INIT_VAR(_6$$5); - ZVAL_LONG(_6$$5, opacity); - ZEPHIR_CALL_METHOD(NULL, draw, "setfillopacity", NULL, 0, _6$$5); + ZVAL_LONG(&_5$$5, opacity); + ZEPHIR_CALL_METHOD(NULL, &draw, "setfillopacity", NULL, 0, &_5$$5); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(gravity); - ZVAL_NULL(gravity); - if (Z_TYPE_P(offsetX) == IS_BOOL) { - if (Z_TYPE_P(offsetY) == IS_BOOL) { + ZEPHIR_INIT_VAR(&gravity); + ZVAL_NULL(&gravity); + if (((Z_TYPE_P(offsetX) == IS_TRUE || Z_TYPE_P(offsetX) == IS_FALSE) == 1)) { + if (((Z_TYPE_P(offsetY) == IS_TRUE || Z_TYPE_P(offsetY) == IS_FALSE) == 1)) { ZEPHIR_INIT_NVAR(offsetX); ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_NVAR(offsetY); ZVAL_LONG(offsetY, 0); - _7$$7 = zephir_is_true(offsetX); - if (_7$$7) { - _7$$7 = zephir_is_true(offsetY); + _6$$7 = zephir_is_true(offsetX); + if (_6$$7) { + _6$$7 = zephir_is_true(offsetY); } - if (_7$$7) { - ZEPHIR_SINIT_VAR(_8$$8); - ZVAL_STRING(&_8$$8, "Imagick::GRAVITY_SOUTHEAST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_8$$8); + if (_6$$7) { + ZEPHIR_INIT_VAR(&_7$$8); + ZVAL_STRING(&_7$$8, "Imagick::GRAVITY_SOUTHEAST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_7$$8); zephir_check_call_status(); } else { if (zephir_is_true(offsetX)) { - ZEPHIR_SINIT_VAR(_9$$10); - ZVAL_STRING(&_9$$10, "Imagick::GRAVITY_EAST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_9$$10); + ZEPHIR_INIT_VAR(&_8$$10); + ZVAL_STRING(&_8$$10, "Imagick::GRAVITY_EAST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_8$$10); zephir_check_call_status(); } else { if (zephir_is_true(offsetY)) { - ZEPHIR_SINIT_VAR(_10$$12); - ZVAL_STRING(&_10$$12, "Imagick::GRAVITY_SOUTH", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_10$$12); + ZEPHIR_INIT_VAR(&_9$$12); + ZVAL_STRING(&_9$$12, "Imagick::GRAVITY_SOUTH"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_9$$12); zephir_check_call_status(); } else { - ZEPHIR_SINIT_VAR(_11$$13); - ZVAL_STRING(&_11$$13, "Imagick::GRAVITY_CENTER", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_11$$13); + ZEPHIR_INIT_VAR(&_10$$13); + ZVAL_STRING(&_10$$13, "Imagick::GRAVITY_CENTER"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_10$$13); zephir_check_call_status(); } } @@ -982,15 +1164,15 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_NVAR(offsetY); ZVAL_LONG(offsetY, (y * -1)); - ZEPHIR_SINIT_VAR(_12$$17); - ZVAL_STRING(&_12$$17, "Imagick::GRAVITY_SOUTHEAST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_12$$17); + ZEPHIR_INIT_VAR(&_11$$17); + ZVAL_STRING(&_11$$17, "Imagick::GRAVITY_SOUTHEAST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_11$$17); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, 0); - ZEPHIR_SINIT_VAR(_13$$18); - ZVAL_STRING(&_13$$18, "Imagick::GRAVITY_NORTHEAST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_13$$18); + ZEPHIR_INIT_VAR(&_12$$18); + ZVAL_STRING(&_12$$18, "Imagick::GRAVITY_NORTHEAST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_12$$18); zephir_check_call_status(); } } else { @@ -999,15 +1181,15 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_NVAR(offsetY); ZVAL_LONG(offsetY, (y * -1)); - ZEPHIR_SINIT_VAR(_14$$20); - ZVAL_STRING(&_14$$20, "Imagick::GRAVITY_SOUTH", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_14$$20); + ZEPHIR_INIT_VAR(&_13$$20); + ZVAL_STRING(&_13$$20, "Imagick::GRAVITY_SOUTH"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_13$$20); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, 0); - ZEPHIR_SINIT_VAR(_15$$21); - ZVAL_STRING(&_15$$21, "Imagick::GRAVITY_NORTH", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_15$$21); + ZEPHIR_INIT_VAR(&_14$$21); + ZVAL_STRING(&_14$$21, "Imagick::GRAVITY_NORTH"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_14$$21); zephir_check_call_status(); } } @@ -1017,22 +1199,22 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { if (Z_TYPE_P(offsetX) == IS_LONG) { x = zephir_get_intval(offsetX); if (zephir_is_true(offsetX)) { - if (Z_TYPE_P(offsetY) == IS_BOOL) { + if (((Z_TYPE_P(offsetY) == IS_TRUE || Z_TYPE_P(offsetY) == IS_FALSE) == 1)) { if (zephir_is_true(offsetY)) { ZEPHIR_INIT_NVAR(offsetY); if (x < 0) { ZEPHIR_INIT_NVAR(offsetX); ZVAL_LONG(offsetX, (x * -1)); ZVAL_LONG(offsetY, 0); - ZEPHIR_SINIT_VAR(_16$$27); - ZVAL_STRING(&_16$$27, "Imagick::GRAVITY_SOUTHEAST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_16$$27); + ZEPHIR_INIT_VAR(&_15$$27); + ZVAL_STRING(&_15$$27, "Imagick::GRAVITY_SOUTHEAST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_15$$27); zephir_check_call_status(); } else { ZVAL_LONG(offsetY, 0); - ZEPHIR_SINIT_VAR(_17$$28); - ZVAL_STRING(&_17$$28, "Imagick::GRAVITY_SOUTH", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_17$$28); + ZEPHIR_INIT_VAR(&_16$$28); + ZVAL_STRING(&_16$$28, "Imagick::GRAVITY_SOUTH"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_16$$28); zephir_check_call_status(); } } else { @@ -1041,15 +1223,15 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { ZEPHIR_INIT_NVAR(offsetX); ZVAL_LONG(offsetX, (x * -1)); ZVAL_LONG(offsetY, 0); - ZEPHIR_SINIT_VAR(_18$$30); - ZVAL_STRING(&_18$$30, "Imagick::GRAVITY_EAST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_18$$30); + ZEPHIR_INIT_VAR(&_17$$30); + ZVAL_STRING(&_17$$30, "Imagick::GRAVITY_EAST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_17$$30); zephir_check_call_status(); } else { ZVAL_LONG(offsetY, 0); - ZEPHIR_SINIT_VAR(_19$$31); - ZVAL_STRING(&_19$$31, "Imagick::GRAVITY_WEST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_19$$31); + ZEPHIR_INIT_VAR(&_18$$31); + ZVAL_STRING(&_18$$31, "Imagick::GRAVITY_WEST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_18$$31); zephir_check_call_status(); } } @@ -1063,15 +1245,15 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { ZVAL_LONG(offsetX, (x * -1)); ZEPHIR_INIT_NVAR(offsetY); ZVAL_LONG(offsetY, (y * -1)); - ZEPHIR_SINIT_VAR(_20$$35); - ZVAL_STRING(&_20$$35, "Imagick::GRAVITY_SOUTHEAST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_20$$35); + ZEPHIR_INIT_VAR(&_19$$35); + ZVAL_STRING(&_19$$35, "Imagick::GRAVITY_SOUTHEAST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_19$$35); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, (x * -1)); - ZEPHIR_SINIT_VAR(_21$$36); - ZVAL_STRING(&_21$$36, "Imagick::GRAVITY_NORTHEAST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_21$$36); + ZEPHIR_INIT_VAR(&_20$$36); + ZVAL_STRING(&_20$$36, "Imagick::GRAVITY_NORTHEAST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_20$$36); zephir_check_call_status(); } } else { @@ -1080,15 +1262,15 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { ZVAL_LONG(offsetX, 0); ZEPHIR_INIT_NVAR(offsetY); ZVAL_LONG(offsetY, (y * -1)); - ZEPHIR_SINIT_VAR(_22$$38); - ZVAL_STRING(&_22$$38, "Imagick::GRAVITY_SOUTHWEST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_22$$38); + ZEPHIR_INIT_VAR(&_21$$38); + ZVAL_STRING(&_21$$38, "Imagick::GRAVITY_SOUTHWEST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_21$$38); zephir_check_call_status(); } else { ZVAL_LONG(offsetX, 0); - ZEPHIR_SINIT_VAR(_23$$39); - ZVAL_STRING(&_23$$39, "Imagick::GRAVITY_NORTHWEST", 0); - ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 38, &_23$$39); + ZEPHIR_INIT_VAR(&_22$$39); + ZVAL_STRING(&_22$$39, "Imagick::GRAVITY_NORTHWEST"); + ZEPHIR_CALL_FUNCTION(&gravity, "constant", NULL, 32, &_22$$39); zephir_check_call_status(); } } @@ -1097,27 +1279,25 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { } } } - ZEPHIR_CALL_METHOD(NULL, draw, "setgravity", NULL, 0, gravity); + ZEPHIR_CALL_METHOD(NULL, &draw, "setgravity", NULL, 0, &gravity); zephir_check_call_status(); - _24 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_25); - ZVAL_LONG(_25, 0); - ZEPHIR_CALL_METHOD(NULL, _24, "setiteratorindex", NULL, 0, _25); + zephir_read_property(&_1, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_2, 0); + ZEPHIR_CALL_METHOD(NULL, &_1, "setiteratorindex", NULL, 0, &_2); zephir_check_call_status(); while (1) { - _26$$40 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_27$$40); - ZVAL_LONG(_27$$40, 0); - ZEPHIR_CALL_METHOD(NULL, _26$$40, "annotateimage", NULL, 0, draw, offsetX, offsetY, _27$$40, text); + zephir_read_property(&_23$$40, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_24$$40, 0); + ZEPHIR_CALL_METHOD(NULL, &_23$$40, "annotateimage", NULL, 0, &draw, offsetX, offsetY, &_24$$40, &text); zephir_check_call_status(); - _28$$40 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_29$$40, _28$$40, "nextimage", NULL, 0); + zephir_read_property(&_24$$40, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_25$$40, &_24$$40, "nextimage", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_29$$40)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_25$$40)) { break; } } - ZEPHIR_CALL_METHOD(NULL, draw, "destroy", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &draw, "destroy", NULL, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -1128,59 +1308,72 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _text) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _mask) { - zephir_fcall_cache_entry *_8 = NULL; + zephir_fcall_cache_entry *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *image, *mask = NULL, *ret = NULL, *_0 = NULL, *_1, *_2, *_3$$3, *_4$$3 = NULL, *_5$$3, _6$$3 = zval_used_for_init, *_7$$3 = NULL, *_9$$3 = NULL, *_10$$3, *_11$$3 = NULL; + zval *image, image_sub, mask, ret, _0, _1, _2, _3$$3, _4$$3, _5$$3, _6$$3, _8$$3, _9$$3, _10$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&image_sub); + ZVAL_UNDEF(&mask); + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_8$$3); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_10$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &image); - ZEPHIR_INIT_VAR(mask); - object_init_ex(mask, zephir_get_internal_ce(SS("imagick") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, mask, "__construct", NULL, 0); - zephir_check_call_status(); + ZEPHIR_INIT_VAR(&mask); + object_init_ex(&mask, zephir_get_internal_ce(SL("imagick"))); + if (zephir_has_constructor(&mask TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &mask, "__construct", NULL, 0); + zephir_check_call_status(); + } ZEPHIR_CALL_METHOD(&_0, image, "render", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, mask, "readimageblob", NULL, 0, _0); + ZEPHIR_CALL_METHOD(NULL, &mask, "readimageblob", NULL, 0, &_0); zephir_check_call_status(); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, 0); - ZEPHIR_CALL_METHOD(NULL, _1, "setiteratorindex", NULL, 0, _2); + zephir_read_property(&_1, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_2, 0); + ZEPHIR_CALL_METHOD(NULL, &_1, "setiteratorindex", NULL, 0, &_2); zephir_check_call_status(); while (1) { - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_LONG(_4$$3, 1); - ZEPHIR_CALL_METHOD(NULL, _3$$3, "setimagematte", NULL, 0, _4$$3); - zephir_check_call_status(); - _5$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_6$$3); - ZVAL_STRING(&_6$$3, "Imagick::COMPOSITE_DSTIN", 0); - ZEPHIR_CALL_FUNCTION(&_7$$3, "constant", &_8, 38, &_6$$3); - zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_LONG(_4$$3, 0); - ZEPHIR_INIT_NVAR(_9$$3); - ZVAL_LONG(_9$$3, 0); - ZEPHIR_CALL_METHOD(&ret, _5$$3, "compositeimage", NULL, 0, mask, _7$$3, _4$$3, _9$$3); - zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(ret)) { + zephir_read_property(&_3$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_4$$3, 1); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "setimagematte", NULL, 0, &_4$$3); + zephir_check_call_status(); + zephir_read_property(&_4$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&_5$$3); + ZVAL_STRING(&_5$$3, "Imagick::COMPOSITE_DSTIN"); + ZEPHIR_CALL_FUNCTION(&_6$$3, "constant", &_7, 32, &_5$$3); + zephir_check_call_status(); + ZVAL_LONG(&_8$$3, 0); + ZVAL_LONG(&_9$$3, 0); + ZEPHIR_CALL_METHOD(&ret, &_4$$3, "compositeimage", NULL, 0, &mask, &_6$$3, &_8$$3, &_9$$3); + zephir_check_call_status(); + if (!ZEPHIR_IS_TRUE_IDENTICAL(&ret)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/image/adapter/imagick.zep", 544); return; } - _10$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_11$$3, _10$$3, "nextimage", NULL, 0); + zephir_read_property(&_8$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_10$$3, &_8$$3, "nextimage", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_11$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_10$$3)) { break; } } - ZEPHIR_CALL_METHOD(NULL, mask, "clear", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &mask, "clear", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, mask, "destroy", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &mask, "destroy", NULL, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -1191,9 +1384,35 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _mask) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _background) { - zephir_fcall_cache_entry *_8 = NULL, *_10 = NULL, *_13 = NULL, *_14 = NULL, *_15 = NULL, *_20 = NULL, *_23 = NULL, *_27 = NULL; - zval *r_param = NULL, *g_param = NULL, *b_param = NULL, *opacity_param = NULL, *background = NULL, *color = NULL, *pixel1 = NULL, *pixel2 = NULL, *ret = NULL, _0, _1, _2, _3, *_4 = NULL, *_5, *_30, *_31, *_6$$3, *_7$$3, *_9$$3 = NULL, _16$$3 = zval_used_for_init, *_17$$3 = NULL, *_18$$3 = NULL, *_19$$3 = NULL, *_21$$3, *_22$$3 = NULL, *_24$$3, *_25$$3 = NULL, *_26$$3 = NULL, *_28$$3, *_29$$3 = NULL, _11$$4 = zval_used_for_init, *_12$$4 = NULL; + zephir_fcall_cache_entry *_6 = NULL, *_8 = NULL, *_11 = NULL, *_12 = NULL, *_13 = NULL, *_18 = NULL, *_20 = NULL, *_25 = NULL; + zval *r_param = NULL, *g_param = NULL, *b_param = NULL, *opacity_param = NULL, background, color, pixel1, pixel2, ret, _0, _1, _2, _3, _4$$3, _5$$3, _7$$3, _14$$3, _15$$3, _16$$3, _17$$3, _19$$3, _21$$3, _22$$3, _23$$3, _24$$3, _26$$3, _9$$4, _10$$4; zend_long r, g, b, opacity, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&background); + ZVAL_UNDEF(&color); + ZVAL_UNDEF(&pixel1); + ZVAL_UNDEF(&pixel2); + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_14$$3); + ZVAL_UNDEF(&_15$$3); + ZVAL_UNDEF(&_16$$3); + ZVAL_UNDEF(&_17$$3); + ZVAL_UNDEF(&_19$$3); + ZVAL_UNDEF(&_21$$3); + ZVAL_UNDEF(&_22$$3); + ZVAL_UNDEF(&_23$$3); + ZVAL_UNDEF(&_24$$3); + ZVAL_UNDEF(&_26$$3); + ZVAL_UNDEF(&_9$$4); + ZVAL_UNDEF(&_10$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &r_param, &g_param, &b_param, &opacity_param); @@ -1204,100 +1423,98 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _background) { opacity = zephir_get_intval(opacity_param); - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "rgb(%d, %d, %d)", 0); - ZEPHIR_SINIT_VAR(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "rgb(%d, %d, %d)"); ZVAL_LONG(&_1, r); - ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, g); - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, b); - ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 164, &_0, &_1, &_2, &_3); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(pixel1); - object_init_ex(pixel1, zephir_get_internal_ce(SS("imagickpixel") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, pixel1, "__construct", NULL, 0, color); + ZEPHIR_CALL_FUNCTION(&color, "sprintf", NULL, 145, &_0, &_1, &_2, &_3); zephir_check_call_status(); + ZEPHIR_INIT_VAR(&pixel1); + object_init_ex(&pixel1, zephir_get_internal_ce(SL("imagickpixel"))); + if (zephir_has_constructor(&pixel1 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &pixel1, "__construct", NULL, 0, &color); + zephir_check_call_status(); + } opacity = (long) (zephir_safe_div_long_long(opacity, 100 TSRMLS_CC)); - ZEPHIR_INIT_VAR(pixel2); - object_init_ex(pixel2, zephir_get_internal_ce(SS("imagickpixel") TSRMLS_CC)); - ZEPHIR_INIT_VAR(_4); - ZVAL_STRING(_4, "transparent", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, pixel2, "__construct", NULL, 0, _4); - zephir_check_temp_parameter(_4); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(background); - object_init_ex(background, zephir_get_internal_ce(SS("imagick") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, background, "__construct", NULL, 0); - zephir_check_call_status(); - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, 0); - ZEPHIR_CALL_METHOD(NULL, _5, "setiteratorindex", NULL, 0, _4); + ZEPHIR_INIT_VAR(&pixel2); + object_init_ex(&pixel2, zephir_get_internal_ce(SL("imagickpixel"))); + if (zephir_has_constructor(&pixel2 TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "transparent"); + ZEPHIR_CALL_METHOD(NULL, &pixel2, "__construct", NULL, 0, &_0); + zephir_check_call_status(); + } + ZEPHIR_INIT_VAR(&background); + object_init_ex(&background, zephir_get_internal_ce(SL("imagick"))); + if (zephir_has_constructor(&background TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &background, "__construct", NULL, 0); + zephir_check_call_status(); + } + zephir_read_property(&_1, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_2, 0); + ZEPHIR_CALL_METHOD(NULL, &_1, "setiteratorindex", NULL, 0, &_2); zephir_check_call_status(); while (1) { - _6$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _7$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, background, "newimage", &_8, 0, _6$$3, _7$$3, pixel1); + zephir_read_property(&_4$$3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_5$$3, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &background, "newimage", &_6, 0, &_4$$3, &_5$$3, &pixel1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_9$$3, background, "getimagealphachannel", &_10, 0); + ZEPHIR_CALL_METHOD(&_7$$3, &background, "getimagealphachannel", &_8, 0); zephir_check_call_status(); - if (!(zephir_is_true(_9$$3))) { - ZEPHIR_SINIT_NVAR(_11$$4); - ZVAL_STRING(&_11$$4, "Imagick::ALPHACHANNEL_SET", 0); - ZEPHIR_CALL_FUNCTION(&_12$$4, "constant", &_13, 38, &_11$$4); + if (!(zephir_is_true(&_7$$3))) { + ZEPHIR_INIT_NVAR(&_9$$4); + ZVAL_STRING(&_9$$4, "Imagick::ALPHACHANNEL_SET"); + ZEPHIR_CALL_FUNCTION(&_10$$4, "constant", &_11, 32, &_9$$4); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, background, "setimagealphachannel", &_14, 0, _12$$4); + ZEPHIR_CALL_METHOD(NULL, &background, "setimagealphachannel", &_12, 0, &_10$$4); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, background, "setimagebackgroundcolor", &_15, 0, pixel2); + ZEPHIR_CALL_METHOD(NULL, &background, "setimagebackgroundcolor", &_13, 0, &pixel2); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_16$$3); - ZVAL_STRING(&_16$$3, "Imagick::EVALUATE_MULTIPLY", 0); - ZEPHIR_CALL_FUNCTION(&_17$$3, "constant", &_13, 38, &_16$$3); + ZEPHIR_INIT_NVAR(&_14$$3); + ZVAL_STRING(&_14$$3, "Imagick::EVALUATE_MULTIPLY"); + ZEPHIR_CALL_FUNCTION(&_15$$3, "constant", &_11, 32, &_14$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_16$$3); - ZVAL_STRING(&_16$$3, "Imagick::CHANNEL_ALPHA", 0); - ZEPHIR_CALL_FUNCTION(&_18$$3, "constant", &_13, 38, &_16$$3); + ZEPHIR_INIT_NVAR(&_14$$3); + ZVAL_STRING(&_14$$3, "Imagick::CHANNEL_ALPHA"); + ZEPHIR_CALL_FUNCTION(&_16$$3, "constant", &_11, 32, &_14$$3); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_19$$3); - ZVAL_LONG(_19$$3, opacity); - ZEPHIR_CALL_METHOD(NULL, background, "evaluateimage", &_20, 0, _17$$3, _19$$3, _18$$3); + ZVAL_LONG(&_17$$3, opacity); + ZEPHIR_CALL_METHOD(NULL, &background, "evaluateimage", &_18, 0, &_15$$3, &_17$$3, &_16$$3); zephir_check_call_status(); - _21$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_22$$3, _21$$3, "getcolorspace", NULL, 0); + zephir_read_property(&_17$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_19$$3, &_17$$3, "getcolorspace", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, background, "setcolorspace", &_23, 0, _22$$3); + ZEPHIR_CALL_METHOD(NULL, &background, "setcolorspace", &_20, 0, &_19$$3); zephir_check_call_status(); - _24$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_NVAR(_16$$3); - ZVAL_STRING(&_16$$3, "Imagick::COMPOSITE_DISSOLVE", 0); - ZEPHIR_CALL_FUNCTION(&_25$$3, "constant", &_13, 38, &_16$$3); + zephir_read_property(&_21$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&_14$$3); + ZVAL_STRING(&_14$$3, "Imagick::COMPOSITE_DISSOLVE"); + ZEPHIR_CALL_FUNCTION(&_22$$3, "constant", &_11, 32, &_14$$3); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_19$$3); - ZVAL_LONG(_19$$3, 0); - ZEPHIR_INIT_NVAR(_26$$3); - ZVAL_LONG(_26$$3, 0); - ZEPHIR_CALL_METHOD(&ret, background, "compositeimage", &_27, 0, _24$$3, _25$$3, _19$$3, _26$$3); + ZVAL_LONG(&_23$$3, 0); + ZVAL_LONG(&_24$$3, 0); + ZEPHIR_CALL_METHOD(&ret, &background, "compositeimage", &_25, 0, &_21$$3, &_22$$3, &_23$$3, &_24$$3); zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(ret)) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&ret)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_image_exception_ce, "Imagick::compositeImage failed", "phalcon/image/adapter/imagick.zep", 583); return; } - _28$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_29$$3, _28$$3, "nextimage", NULL, 0); + zephir_read_property(&_23$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_26$$3, &_23$$3, "nextimage", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_29$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_26$$3)) { break; } } - _30 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _30, "clear", NULL, 0); + zephir_read_property(&_2, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_2, "clear", NULL, 0); zephir_check_call_status(); - _31 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _31, "destroy", NULL, 0); + zephir_read_property(&_3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_3, "destroy", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_image"), background TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_image"), &background); ZEPHIR_MM_RESTORE(); } @@ -1309,8 +1526,16 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _background) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _blur) { - zval *radius_param = NULL, *_0, *_1, *_2$$3, *_3$$3 = NULL, *_4$$3 = NULL, *_5$$3, *_6$$3 = NULL; + zval *radius_param = NULL, _0, _1, _2$$3, _3$$3, _4$$3, _5$$3; zend_long radius, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &radius_param); @@ -1318,23 +1543,20 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _blur) { radius = zephir_get_intval(radius_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_CALL_METHOD(NULL, _0, "setiteratorindex", NULL, 0, _1); + zephir_read_property(&_0, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_1, 0); + ZEPHIR_CALL_METHOD(NULL, &_0, "setiteratorindex", NULL, 0, &_1); zephir_check_call_status(); while (1) { - _2$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_3$$3); - ZVAL_LONG(_3$$3, radius); - ZEPHIR_INIT_NVAR(_4$$3); - ZVAL_LONG(_4$$3, 100); - ZEPHIR_CALL_METHOD(NULL, _2$$3, "blurimage", NULL, 0, _3$$3, _4$$3); + zephir_read_property(&_2$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_3$$3, radius); + ZVAL_LONG(&_4$$3, 100); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "blurimage", NULL, 0, &_3$$3, &_4$$3); zephir_check_call_status(); - _5$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_6$$3, _5$$3, "nextimage", NULL, 0); + zephir_read_property(&_3$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_5$$3, &_3$$3, "nextimage", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_6$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_5$$3)) { break; } } @@ -1349,8 +1571,20 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _blur) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _pixelate) { - zval *amount_param = NULL, *_0, *_1, *_2, *_3, *_4$$3, *_5$$3 = NULL, *_6$$3 = NULL, *_7$$3, *_8$$3, *_9$$3, *_10$$3, *_11$$3 = NULL; + zval *amount_param = NULL, _0, _1, _2, _3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3, _9$$3; zend_long amount, ZEPHIR_LAST_CALL_STATUS, width = 0, height = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_8$$3); + ZVAL_UNDEF(&_9$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &amount_param); @@ -1358,32 +1592,29 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _pixelate) { amount = zephir_get_intval(amount_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - width = (long) (zephir_safe_div_zval_long(_0, amount TSRMLS_CC)); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - height = (long) (zephir_safe_div_zval_long(_1, amount TSRMLS_CC)); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, 0); - ZEPHIR_CALL_METHOD(NULL, _2, "setiteratorindex", NULL, 0, _3); + zephir_read_property(&_0, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + width = (long) (zephir_safe_div_zval_long(&_0, amount TSRMLS_CC)); + zephir_read_property(&_1, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + height = (long) (zephir_safe_div_zval_long(&_1, amount TSRMLS_CC)); + zephir_read_property(&_2, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_3, 0); + ZEPHIR_CALL_METHOD(NULL, &_2, "setiteratorindex", NULL, 0, &_3); zephir_check_call_status(); while (1) { - _4$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_5$$3); - ZVAL_LONG(_5$$3, width); - ZEPHIR_INIT_NVAR(_6$$3); - ZVAL_LONG(_6$$3, height); - ZEPHIR_CALL_METHOD(NULL, _4$$3, "scaleimage", NULL, 0, _5$$3, _6$$3); - zephir_check_call_status(); - _7$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - _8$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_width"), PH_NOISY_CC); - _9$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_height"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _7$$3, "scaleimage", NULL, 0, _8$$3, _9$$3); - zephir_check_call_status(); - _10$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_11$$3, _10$$3, "nextimage", NULL, 0); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_11$$3)) { + zephir_read_property(&_4$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_5$$3, width); + ZVAL_LONG(&_6$$3, height); + ZEPHIR_CALL_METHOD(NULL, &_4$$3, "scaleimage", NULL, 0, &_5$$3, &_6$$3); + zephir_check_call_status(); + zephir_read_property(&_5$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_6$$3, this_ptr, SL("_width"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_7$$3, this_ptr, SL("_height"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_5$$3, "scaleimage", NULL, 0, &_6$$3, &_7$$3); + zephir_check_call_status(); + zephir_read_property(&_8$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_9$$3, &_8$$3, "nextimage", NULL, 0); + zephir_check_call_status(); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_9$$3)) { break; } } @@ -1398,73 +1629,98 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _save) { zend_bool _14$$4; zend_long quality, ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, *quality_param = NULL, *ext = NULL, *fp = NULL, _0 = zval_used_for_init, *_1, *_2, *_3, *_4 = NULL, *_5, *_6 = NULL, *_7, *_8 = NULL, *_9$$3, _10$$3, *_11$$3, _12$$4 = zval_used_for_init, *_13$$4 = NULL, *_15$$4 = NULL, *_21$$4, *_16$$5, _17$$5, *_18$$5 = NULL, *_19$$6, *_20$$6; - zval *file = NULL; + zval *file_param = NULL, *quality_param = NULL, ext, fp, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9$$3, _10$$3, _11$$3, _12$$4, _13$$4, _15$$4, _21$$4, _16$$5, _17$$5, _18$$5, _19$$6, _20$$6; + zval file; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&ext); + ZVAL_UNDEF(&fp); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_10$$3); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_12$$4); + ZVAL_UNDEF(&_13$$4); + ZVAL_UNDEF(&_15$$4); + ZVAL_UNDEF(&_21$$4); + ZVAL_UNDEF(&_16$$5); + ZVAL_UNDEF(&_17$$5); + ZVAL_UNDEF(&_18$$5); + ZVAL_UNDEF(&_19$$6); + ZVAL_UNDEF(&_20$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &file_param, &quality_param); - zephir_get_strval(file, file_param); + zephir_get_strval(&file, file_param); quality = zephir_get_intval(quality_param); - ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, 4); - ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 78, file, &_0); + ZEPHIR_CALL_FUNCTION(&ext, "pathinfo", NULL, 71, &file, &_0); zephir_check_call_status(); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _1, "setformat", NULL, 0, ext); + zephir_read_property(&_0, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "setformat", NULL, 0, &ext); zephir_check_call_status(); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _2, "setimageformat", NULL, 0, ext); + zephir_read_property(&_1, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_1, "setimageformat", NULL, 0, &ext); zephir_check_call_status(); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_4, _3, "getimagetype", NULL, 0); + zephir_read_property(&_2, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_3, &_2, "getimagetype", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_type"), _4 TSRMLS_CC); - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_6, _5, "getimageformat", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_type"), &_3); + zephir_read_property(&_4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_5, &_4, "getimageformat", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_7); - ZEPHIR_CONCAT_SV(_7, "image/", _6); - zephir_update_property_this(getThis(), SL("_mime"), _7 TSRMLS_CC); - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "gif", 0); - ZEPHIR_CALL_FUNCTION(&_8, "strcasecmp", NULL, 16, ext, &_0); + ZEPHIR_INIT_VAR(&_6); + ZEPHIR_CONCAT_SV(&_6, "image/", &_5); + zephir_update_property_zval(this_ptr, SL("_mime"), &_6); + ZEPHIR_INIT_VAR(&_7); + ZVAL_STRING(&_7, "gif"); + ZEPHIR_CALL_FUNCTION(&_8, "strcasecmp", NULL, 11, &ext, &_7); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_8, 0)) { - _9$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _9$$3, "optimizeimagelayers", NULL, 0); + if (ZEPHIR_IS_LONG(&_8, 0)) { + zephir_read_property(&_9$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_9$$3, "optimizeimagelayers", NULL, 0); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_10$$3); - ZVAL_STRING(&_10$$3, "w", 0); - ZEPHIR_CALL_FUNCTION(&fp, "fopen", NULL, 308, file, &_10$$3); + ZEPHIR_INIT_VAR(&_10$$3); + ZVAL_STRING(&_10$$3, "w"); + ZEPHIR_CALL_FUNCTION(&fp, "fopen", NULL, 268, &file, &_10$$3); zephir_check_call_status(); - _11$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _11$$3, "writeimagesfile", NULL, 0, fp); + zephir_read_property(&_11$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_11$$3, "writeimagesfile", NULL, 0, &fp); zephir_check_call_status(); - zephir_fclose(fp TSRMLS_CC); + zephir_fclose(&fp TSRMLS_CC); RETURN_MM_NULL(); } else { - ZEPHIR_SINIT_VAR(_12$$4); - ZVAL_STRING(&_12$$4, "jpg", 0); - ZEPHIR_CALL_FUNCTION(&_13$$4, "strcasecmp", NULL, 16, ext, &_12$$4); + ZEPHIR_INIT_VAR(&_12$$4); + ZVAL_STRING(&_12$$4, "jpg"); + ZEPHIR_CALL_FUNCTION(&_13$$4, "strcasecmp", NULL, 11, &ext, &_12$$4); zephir_check_call_status(); - _14$$4 = ZEPHIR_IS_LONG(_13$$4, 0); + _14$$4 = ZEPHIR_IS_LONG(&_13$$4, 0); if (!(_14$$4)) { - ZEPHIR_SINIT_NVAR(_12$$4); - ZVAL_STRING(&_12$$4, "jpeg", 0); - ZEPHIR_CALL_FUNCTION(&_15$$4, "strcasecmp", NULL, 16, ext, &_12$$4); + ZEPHIR_INIT_NVAR(&_12$$4); + ZVAL_STRING(&_12$$4, "jpeg"); + ZEPHIR_CALL_FUNCTION(&_15$$4, "strcasecmp", NULL, 11, &ext, &_12$$4); zephir_check_call_status(); - _14$$4 = ZEPHIR_IS_LONG(_15$$4, 0); + _14$$4 = ZEPHIR_IS_LONG(&_15$$4, 0); } if (_14$$4) { - _16$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_17$$5); - ZVAL_STRING(&_17$$5, "Imagick::COMPRESSION_JPEG", 0); - ZEPHIR_CALL_FUNCTION(&_18$$5, "constant", NULL, 38, &_17$$5); + zephir_read_property(&_16$$5, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_17$$5); + ZVAL_STRING(&_17$$5, "Imagick::COMPRESSION_JPEG"); + ZEPHIR_CALL_FUNCTION(&_18$$5, "constant", NULL, 32, &_17$$5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _16$$5, "setimagecompression", NULL, 0, _18$$5); + ZEPHIR_CALL_METHOD(NULL, &_16$$5, "setimagecompression", NULL, 0, &_18$$5); zephir_check_call_status(); } if (quality >= 0) { @@ -1473,14 +1729,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _save) { } else if (quality > 100) { quality = 100; } - _19$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_20$$6); - ZVAL_LONG(_20$$6, quality); - ZEPHIR_CALL_METHOD(NULL, _19$$6, "setimagecompressionquality", NULL, 0, _20$$6); + zephir_read_property(&_19$$6, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_20$$6, quality); + ZEPHIR_CALL_METHOD(NULL, &_19$$6, "setimagecompressionquality", NULL, 0, &_20$$6); zephir_check_call_status(); } - _21$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _21$$4, "writeimage", NULL, 0, file); + zephir_read_property(&_21$$4, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_21$$4, "writeimage", NULL, 0, &file); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -1494,66 +1749,80 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _render) { zend_bool _7$$4; zend_long quality, ZEPHIR_LAST_CALL_STATUS; - zval *extension_param = NULL, *quality_param = NULL, *image = NULL, *_0 = NULL, *_1 = NULL, *_2, _3, *_4 = NULL, _5$$4 = zval_used_for_init, *_6$$4 = NULL, *_8$$4 = NULL, *_11$$4, _9$$5, *_10$$5 = NULL; - zval *extension = NULL; + zval *extension_param = NULL, *quality_param = NULL, image, _0, _1, _2, _3, _4, _5$$4, _6$$4, _8$$4, _11$$4, _9$$5, _10$$5; + zval extension; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&extension); + ZVAL_UNDEF(&image); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_8$$4); + ZVAL_UNDEF(&_11$$4); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&_10$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &extension_param, &quality_param); - zephir_get_strval(extension, extension_param); + zephir_get_strval(&extension, extension_param); quality = zephir_get_intval(quality_param); - ZEPHIR_OBS_VAR(image); - zephir_read_property_this(&image, this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, image, "setformat", NULL, 0, extension); + ZEPHIR_OBS_VAR(&image); + zephir_read_property(&image, this_ptr, SL("_image"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(NULL, &image, "setformat", NULL, 0, &extension); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, image, "setimageformat", NULL, 0, extension); + ZEPHIR_CALL_METHOD(NULL, &image, "setimageformat", NULL, 0, &extension); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, image, "stripimage", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &image, "stripimage", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, image, "getimagetype", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &image, "getimagetype", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_type"), _0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_1, image, "getimageformat", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_type"), &_0); + ZEPHIR_CALL_METHOD(&_1, &image, "getimageformat", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SV(_2, "image/", _1); - zephir_update_property_this(getThis(), SL("_mime"), _2 TSRMLS_CC); - ZEPHIR_SINIT_VAR(_3); - ZVAL_STRING(&_3, "gif", 0); - ZEPHIR_CALL_FUNCTION(&_4, "strcasecmp", NULL, 16, extension, &_3); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SV(&_2, "image/", &_1); + zephir_update_property_zval(this_ptr, SL("_mime"), &_2); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "gif"); + ZEPHIR_CALL_FUNCTION(&_4, "strcasecmp", NULL, 11, &extension, &_3); zephir_check_call_status(); - if (ZEPHIR_IS_LONG_IDENTICAL(_4, 0)) { - ZEPHIR_CALL_METHOD(NULL, image, "optimizeimagelayers", NULL, 0); + if (ZEPHIR_IS_LONG_IDENTICAL(&_4, 0)) { + ZEPHIR_CALL_METHOD(NULL, &image, "optimizeimagelayers", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_SINIT_VAR(_5$$4); - ZVAL_STRING(&_5$$4, "jpg", 0); - ZEPHIR_CALL_FUNCTION(&_6$$4, "strcasecmp", NULL, 16, extension, &_5$$4); + ZEPHIR_INIT_VAR(&_5$$4); + ZVAL_STRING(&_5$$4, "jpg"); + ZEPHIR_CALL_FUNCTION(&_6$$4, "strcasecmp", NULL, 11, &extension, &_5$$4); zephir_check_call_status(); - _7$$4 = ZEPHIR_IS_LONG_IDENTICAL(_6$$4, 0); + _7$$4 = ZEPHIR_IS_LONG_IDENTICAL(&_6$$4, 0); if (!(_7$$4)) { - ZEPHIR_SINIT_NVAR(_5$$4); - ZVAL_STRING(&_5$$4, "jpeg", 0); - ZEPHIR_CALL_FUNCTION(&_8$$4, "strcasecmp", NULL, 16, extension, &_5$$4); + ZEPHIR_INIT_NVAR(&_5$$4); + ZVAL_STRING(&_5$$4, "jpeg"); + ZEPHIR_CALL_FUNCTION(&_8$$4, "strcasecmp", NULL, 11, &extension, &_5$$4); zephir_check_call_status(); - _7$$4 = ZEPHIR_IS_LONG_IDENTICAL(_8$$4, 0); + _7$$4 = ZEPHIR_IS_LONG_IDENTICAL(&_8$$4, 0); } if (_7$$4) { - ZEPHIR_SINIT_VAR(_9$$5); - ZVAL_STRING(&_9$$5, "Imagick::COMPRESSION_JPEG", 0); - ZEPHIR_CALL_FUNCTION(&_10$$5, "constant", NULL, 38, &_9$$5); + ZEPHIR_INIT_VAR(&_9$$5); + ZVAL_STRING(&_9$$5, "Imagick::COMPRESSION_JPEG"); + ZEPHIR_CALL_FUNCTION(&_10$$5, "constant", NULL, 32, &_9$$5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, image, "setimagecompression", NULL, 0, _10$$5); + ZEPHIR_CALL_METHOD(NULL, &image, "setimagecompression", NULL, 0, &_10$$5); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_11$$4); - ZVAL_LONG(_11$$4, quality); - ZEPHIR_CALL_METHOD(NULL, image, "setimagecompressionquality", NULL, 0, _11$$4); + ZVAL_LONG(&_11$$4, quality); + ZEPHIR_CALL_METHOD(NULL, &image, "setimagecompressionquality", NULL, 0, &_11$$4); zephir_check_call_status(); } - ZEPHIR_RETURN_CALL_METHOD(image, "getimageblob", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&image, "getimageblob", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -1564,19 +1833,24 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, _render) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __destruct) { - zval *_0, *_1$$3, *_2$$3; + zval _0, _1$$3, _2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_image"), PH_NOISY_CC); - if (zephir_instance_of_ev(_0, zephir_get_internal_ce(SS("imagick") TSRMLS_CC) TSRMLS_CC)) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "clear", NULL, 0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_image"), PH_NOISY_CC); + if (zephir_instance_of_ev(&_0, zephir_get_internal_ce(SL("imagick")) TSRMLS_CC)) { + zephir_read_property(&_1$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "clear", NULL, 0); zephir_check_call_status(); - _2$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _2$$3, "destroy", NULL, 0); + zephir_read_property(&_2$$3, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "destroy", NULL, 0); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -1588,7 +1862,8 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __destruct) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, getInternalImInstance) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_image"); @@ -1601,8 +1876,13 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, getInternalImInstance) { */ PHP_METHOD(Phalcon_Image_Adapter_Imagick, setResourceLimit) { - zval *type_param = NULL, *limit_param = NULL, *_0, *_1, *_2; + zval *type_param = NULL, *limit_param = NULL, _0, _1, _2; zend_long type, limit, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &limit_param); @@ -1611,12 +1891,10 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, setResourceLimit) { limit = zephir_get_intval(limit_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_image"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, type); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, limit); - ZEPHIR_CALL_METHOD(NULL, _0, "setresourcelimit", NULL, 0, _1, _2); + zephir_read_property(&_0, this_ptr, SL("_image"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_1, type); + ZVAL_LONG(&_2, limit); + ZEPHIR_CALL_METHOD(NULL, &_0, "setresourcelimit", NULL, 0, &_1, &_2); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/image/adapter/imagick.zep.h b/ext/phalcon/image/adapter/imagick.zep.h index 6990cf308a6..63944cb82e7 100644 --- a/ext/phalcon/image/adapter/imagick.zep.h +++ b/ext/phalcon/image/adapter/imagick.zep.h @@ -24,66 +24,189 @@ PHP_METHOD(Phalcon_Image_Adapter_Imagick, __destruct); PHP_METHOD(Phalcon_Image_Adapter_Imagick, getInternalImInstance); PHP_METHOD(Phalcon_Image_Adapter_Imagick, setResourceLimit); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_imagick_check, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_imagick_check, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0) +#else ZEND_ARG_INFO(0, file) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 1) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 1) +#else ZEND_ARG_INFO(0, height) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__resize, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__liquidrescale, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, deltaX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, deltaX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, rigidity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, rigidity) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__crop, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetY) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__rotate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, degrees, IS_LONG, 0) +#else ZEND_ARG_INFO(0, degrees) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__flip, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, direction, IS_LONG, 0) +#else ZEND_ARG_INFO(0, direction) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__sharpen, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, amount, IS_LONG, 0) +#else ZEND_ARG_INFO(0, amount) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__reflection, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fadeIn, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, fadeIn) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__watermark, 0, 0, 4) ZEND_ARG_OBJ_INFO(0, image, Phalcon\\Image\\Adapter, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetY) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__text, 0, 0, 9) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif ZEND_ARG_INFO(0, offsetX) ZEND_ARG_INFO(0, offsetY) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, r, IS_LONG, 0) +#else ZEND_ARG_INFO(0, r) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, g, IS_LONG, 0) +#else ZEND_ARG_INFO(0, g) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, b, IS_LONG, 0) +#else ZEND_ARG_INFO(0, b) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) +#else ZEND_ARG_INFO(0, size) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fontfile, IS_STRING, 0) +#else ZEND_ARG_INFO(0, fontfile) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__mask, 0, 0, 1) @@ -91,37 +214,96 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__mask, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__background, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, r, IS_LONG, 0) +#else ZEND_ARG_INFO(0, r) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, g, IS_LONG, 0) +#else ZEND_ARG_INFO(0, g) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, b, IS_LONG, 0) +#else ZEND_ARG_INFO(0, b) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__blur, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, radius, IS_LONG, 0) +#else ZEND_ARG_INFO(0, radius) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__pixelate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, amount, IS_LONG, 0) +#else ZEND_ARG_INFO(0, amount) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__save, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 0) +#else ZEND_ARG_INFO(0, file) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quality) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick__render, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_imagick__render, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_imagick__render, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extension, IS_STRING, 0) +#else ZEND_ARG_INFO(0, extension) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quality) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_adapter_imagick_getinternaliminstance, 0, 0, Imagick, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_adapter_imagick_getinternaliminstance, 0, 0, IS_OBJECT, "Imagick", 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapter_imagick_setresourcelimit, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, limit, IS_LONG, 0) +#else ZEND_ARG_INFO(0, limit) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_image_adapter_imagick_method_entry) { - PHP_ME(Phalcon_Image_Adapter_Imagick, check, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Image_Adapter_Imagick, check, arginfo_phalcon_image_adapter_imagick_check, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Image_Adapter_Imagick, __construct, arginfo_phalcon_image_adapter_imagick___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Image_Adapter_Imagick, _resize, arginfo_phalcon_image_adapter_imagick__resize, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Image_Adapter_Imagick, _liquidRescale, arginfo_phalcon_image_adapter_imagick__liquidrescale, ZEND_ACC_PROTECTED) @@ -139,7 +321,7 @@ ZEPHIR_INIT_FUNCS(phalcon_image_adapter_imagick_method_entry) { PHP_ME(Phalcon_Image_Adapter_Imagick, _save, arginfo_phalcon_image_adapter_imagick__save, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Image_Adapter_Imagick, _render, arginfo_phalcon_image_adapter_imagick__render, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Image_Adapter_Imagick, __destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) - PHP_ME(Phalcon_Image_Adapter_Imagick, getInternalImInstance, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Image_Adapter_Imagick, getInternalImInstance, arginfo_phalcon_image_adapter_imagick_getinternaliminstance, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Image_Adapter_Imagick, setResourceLimit, arginfo_phalcon_image_adapter_imagick_setresourcelimit, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/image/adapterinterface.zep.h b/ext/phalcon/image/adapterinterface.zep.h index 921146459b9..0e6025e3bf0 100644 --- a/ext/phalcon/image/adapterinterface.zep.h +++ b/ext/phalcon/image/adapterinterface.zep.h @@ -4,51 +4,143 @@ extern zend_class_entry *phalcon_image_adapterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Image_AdapterInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_resize, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 1) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 1) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, master, IS_LONG, 0) +#else ZEND_ARG_INFO(0, master) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_crop, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, width, IS_LONG, 0) +#else ZEND_ARG_INFO(0, width) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 1) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 1) +#else ZEND_ARG_INFO(0, offsetY) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_rotate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, degrees, IS_LONG, 0) +#else ZEND_ARG_INFO(0, degrees) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_flip, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, direction, IS_LONG, 0) +#else ZEND_ARG_INFO(0, direction) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_sharpen, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, amount, IS_LONG, 0) +#else ZEND_ARG_INFO(0, amount) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_reflection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, height, IS_LONG, 0) +#else ZEND_ARG_INFO(0, height) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fadeIn, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, fadeIn) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_watermark, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, watermark, Phalcon\\Image\\Adapter, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetY) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_text, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetX, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetX) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offsetY, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offsetY) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, color, IS_STRING, 0) +#else ZEND_ARG_INFO(0, color) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 0) +#else ZEND_ARG_INFO(0, size) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, fontfile, IS_STRING, 1) +#else ZEND_ARG_INFO(0, fontfile) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_mask, 0, 0, 1) @@ -56,26 +148,58 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_mask, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_background, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, color, IS_STRING, 0) +#else ZEND_ARG_INFO(0, color) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, opacity, IS_LONG, 0) +#else ZEND_ARG_INFO(0, opacity) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_blur, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, radius, IS_LONG, 0) +#else ZEND_ARG_INFO(0, radius) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_pixelate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, amount, IS_LONG, 0) +#else ZEND_ARG_INFO(0, amount) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, file, IS_STRING, 1) +#else ZEND_ARG_INFO(0, file) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quality) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_adapterinterface_render, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, ext, IS_STRING, 1) +#else ZEND_ARG_INFO(0, ext) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quality, IS_LONG, 0) +#else ZEND_ARG_INFO(0, quality) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_image_adapterinterface_method_entry) { diff --git a/ext/phalcon/image/factory.zep.c b/ext/phalcon/image/factory.zep.c index da0a4a0a2aa..b00f77d889f 100644 --- a/ext/phalcon/image/factory.zep.c +++ b/ext/phalcon/image/factory.zep.c @@ -51,17 +51,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Image_Factory) { PHP_METHOD(Phalcon_Image_Factory, load) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *_0; + zval *config, config_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Phalcon\\Image\\Adapter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, _0, config); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Phalcon\\Image\\Adapter"); + ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, &_0, config); zephir_check_call_status(); RETURN_MM(); @@ -72,13 +75,27 @@ PHP_METHOD(Phalcon_Image_Factory, loadClass) { zend_class_entry *_8$$6, *_4$$8, *_6$$7; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *namespace_param = NULL, *config = NULL, *adapter = NULL, *className = NULL, *file = NULL, *height = NULL, *width = NULL, *_1$$3 = NULL, *_2$$6, *_7$$6 = NULL, *_3$$8 = NULL, *_5$$7 = NULL; - zval *namespace = NULL; + zval *namespace_param = NULL, *config = NULL, config_sub, adapter, className, file, height, width, _1$$3, _2$$6, _7$$6, _3$$8, _5$$7; + zval namespace; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespace); + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&height); + ZVAL_UNDEF(&width); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_5$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &namespace_param, &config); - zephir_get_strval(namespace, namespace_param); + zephir_get_strval(&namespace, namespace_param); ZEPHIR_SEPARATE_PARAM(config); @@ -89,50 +106,50 @@ PHP_METHOD(Phalcon_Image_Factory, loadClass) { if (_0) { ZEPHIR_CALL_METHOD(&_1$$3, config, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(config, _1$$3); + ZEPHIR_CPY_WRT(config, &_1$$3); } if (Z_TYPE_P(config) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "Config must be array or Phalcon\\Config object", "phalcon/image/factory.zep", 61); return; } - ZEPHIR_OBS_VAR(file); - if (!(zephir_array_isset_string_fetch(&file, config, SS("file"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&file); + if (!(zephir_array_isset_string_fetch(&file, config, SL("file"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "You must provide 'file' option in factory config parameter.", "phalcon/image/factory.zep", 65); return; } - ZEPHIR_OBS_VAR(adapter); - if (zephir_array_isset_string_fetch(&adapter, config, SS("adapter"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_2$$6); - zephir_camelize(_2$$6, adapter, NULL ); - ZEPHIR_INIT_VAR(className); - ZEPHIR_CONCAT_VSV(className, namespace, "\\", _2$$6); - ZEPHIR_OBS_VAR(width); - if (zephir_array_isset_string_fetch(&width, config, SS("width"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_VAR(height); - if (zephir_array_isset_string_fetch(&height, config, SS("height"), 0 TSRMLS_CC)) { - zephir_fetch_safe_class(_3$$8, className); - _4$$8 = zend_fetch_class(Z_STRVAL_P(_3$$8), Z_STRLEN_P(_3$$8), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + ZEPHIR_OBS_VAR(&adapter); + if (zephir_array_isset_string_fetch(&adapter, config, SL("adapter"), 0)) { + ZEPHIR_INIT_VAR(&_2$$6); + zephir_camelize(&_2$$6, &adapter, NULL ); + ZEPHIR_INIT_VAR(&className); + ZEPHIR_CONCAT_VSV(&className, &namespace, "\\", &_2$$6); + ZEPHIR_OBS_VAR(&width); + if (zephir_array_isset_string_fetch(&width, config, SL("width"), 0)) { + ZEPHIR_OBS_VAR(&height); + if (zephir_array_isset_string_fetch(&height, config, SL("height"), 0)) { + zephir_fetch_safe_class(&_3$$8, &className); + _4$$8 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_3$$8), Z_STRLEN_P(&_3$$8), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _4$$8); if (zephir_has_constructor(return_value TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, file, width, height); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &file, &width, &height); zephir_check_call_status(); } RETURN_MM(); } - zephir_fetch_safe_class(_5$$7, className); - _6$$7 = zend_fetch_class(Z_STRVAL_P(_5$$7), Z_STRLEN_P(_5$$7), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + zephir_fetch_safe_class(&_5$$7, &className); + _6$$7 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_5$$7), Z_STRLEN_P(&_5$$7), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _6$$7); if (zephir_has_constructor(return_value TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, file, width); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &file, &width); zephir_check_call_status(); } RETURN_MM(); } - zephir_fetch_safe_class(_7$$6, className); - _8$$6 = zend_fetch_class(Z_STRVAL_P(_7$$6), Z_STRLEN_P(_7$$6), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + zephir_fetch_safe_class(&_7$$6, &className); + _8$$6 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_7$$6), Z_STRLEN_P(&_7$$6), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _8$$6); if (zephir_has_constructor(return_value TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, file); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &file); zephir_check_call_status(); } RETURN_MM(); diff --git a/ext/phalcon/image/factory.zep.h b/ext/phalcon/image/factory.zep.h index 68fd5c08bc4..4ac610b4222 100644 --- a/ext/phalcon/image/factory.zep.h +++ b/ext/phalcon/image/factory.zep.h @@ -6,12 +6,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Image_Factory); PHP_METHOD(Phalcon_Image_Factory, load); PHP_METHOD(Phalcon_Image_Factory, loadClass); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_factory_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_image_factory_load, 0, 1, Phalcon\\Image\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_image_factory_load, 0, 1, IS_OBJECT, "Phalcon\\Image\\AdapterInterface", 0) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_image_factory_loadclass, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespace) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/kernel.zep.c b/ext/phalcon/kernel.zep.c index f197ff14019..97bf5150734 100644 --- a/ext/phalcon/kernel.zep.c +++ b/ext/phalcon/kernel.zep.c @@ -41,20 +41,23 @@ ZEPHIR_INIT_CLASS(Phalcon_Kernel) { PHP_METHOD(Phalcon_Kernel, preComputeHashKey) { zval *key_param = NULL; - zval *key = NULL; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } diff --git a/ext/phalcon/kernel.zep.h b/ext/phalcon/kernel.zep.h index 671080a33a2..9ea96f14761 100644 --- a/ext/phalcon/kernel.zep.h +++ b/ext/phalcon/kernel.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Kernel); PHP_METHOD(Phalcon_Kernel, preComputeHashKey); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_kernel_precomputehashkey, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_kernel_method_entry) { diff --git a/ext/phalcon/loader.zep.c b/ext/phalcon/loader.zep.c index 410d677e1b2..31421d70b93 100644 --- a/ext/phalcon/loader.zep.c +++ b/ext/phalcon/loader.zep.c @@ -99,23 +99,29 @@ ZEPHIR_INIT_CLASS(Phalcon_Loader) { */ PHP_METHOD(Phalcon_Loader, setFileCheckingCallback) { - zval *callback = NULL, *_0$$4 = NULL; + zval *callback = NULL, callback_sub, __$null, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&callback_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &callback); if (!callback) { - callback = ZEPHIR_GLOBAL(global_null); + callback = &callback_sub; + callback = &__$null; } if (EXPECTED(zephir_is_callable(callback TSRMLS_CC))) { - zephir_update_property_this(getThis(), SL("fileCheckingCallback"), callback TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("fileCheckingCallback"), callback); } else if (Z_TYPE_P(callback) == IS_NULL) { - ZEPHIR_INIT_VAR(_0$$4); - ZEPHIR_INIT_NVAR(_0$$4); - zephir_create_closure_ex(_0$$4, NULL, phalcon_0__closure_ce, SS("__invoke") TSRMLS_CC); - zephir_update_property_this(getThis(), SL("fileCheckingCallback"), _0$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$4); + ZEPHIR_INIT_NVAR(&_0$$4); + zephir_create_closure_ex(&_0$$4, NULL, phalcon_0__closure_ce, SL("__invoke")); + zephir_update_property_zval(this_ptr, SL("fileCheckingCallback"), &_0$$4); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_loader_exception_ce, "The 'callback' parameter must be either a callable or NULL.", "phalcon/loader.zep", 100); return; @@ -129,13 +135,16 @@ PHP_METHOD(Phalcon_Loader, setFileCheckingCallback) { */ PHP_METHOD(Phalcon_Loader, setEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); } @@ -144,7 +153,8 @@ PHP_METHOD(Phalcon_Loader, setEventsManager) { */ PHP_METHOD(Phalcon_Loader, getEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -156,15 +166,19 @@ PHP_METHOD(Phalcon_Loader, getEventsManager) { PHP_METHOD(Phalcon_Loader, setExtensions) { zval *extensions_param = NULL; - zval *extensions = NULL; + zval extensions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&extensions); - zephir_fetch_params(0, 1, 0, &extensions_param); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &extensions_param); - extensions = extensions_param; + ZEPHIR_OBS_COPY_OR_DUP(&extensions, extensions_param); - zephir_update_property_this(getThis(), SL("_extensions"), extensions TSRMLS_CC); - RETURN_THISW(); + zephir_update_property_zval(this_ptr, SL("_extensions"), &extensions); + RETURN_THIS(); } @@ -173,7 +187,8 @@ PHP_METHOD(Phalcon_Loader, setExtensions) { */ PHP_METHOD(Phalcon_Loader, getExtensions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_extensions"); @@ -184,17 +199,28 @@ PHP_METHOD(Phalcon_Loader, getExtensions) { */ PHP_METHOD(Phalcon_Loader, registerNamespaces) { - HashTable *_1$$3; - HashPosition _0$$3; + zend_string *_2$$3; + zend_ulong _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool merge; - zval *namespaces_param = NULL, *merge_param = NULL, *preparedNamespaces = NULL, *name = NULL, *paths = NULL, **_2$$3, *_3$$4, *_5$$4 = NULL, *_6$$4, *_7$$4, *_4$$5 = NULL; - zval *namespaces = NULL; + zval *namespaces_param = NULL, *merge_param = NULL, preparedNamespaces, name, paths, *_0$$3, _3$$4, _5$$4, _6$$4, _7$$4, _4$$5; + zval namespaces; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespaces); + ZVAL_UNDEF(&preparedNamespaces); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&paths); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &namespaces_param, &merge_param); - namespaces = namespaces_param; + ZEPHIR_OBS_COPY_OR_DUP(&namespaces, namespaces_param); if (!merge_param) { merge = 0; } else { @@ -202,30 +228,36 @@ PHP_METHOD(Phalcon_Loader, registerNamespaces) { } - ZEPHIR_CALL_METHOD(&preparedNamespaces, this_ptr, "preparenamespace", NULL, 0, namespaces); + ZEPHIR_CALL_METHOD(&preparedNamespaces, this_ptr, "preparenamespace", NULL, 0, &namespaces); zephir_check_call_status(); if (merge) { - zephir_is_iterable(preparedNamespaces, &_1$$3, &_0$$3, 0, 0, "phalcon/loader.zep", 156); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(name, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(paths, _2$$3); - _3$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_namespaces"), PH_NOISY_CC); - if (!(zephir_array_isset(_3$$4, name))) { - ZEPHIR_INIT_NVAR(_4$$5); - array_init(_4$$5); - zephir_update_property_array(this_ptr, SL("_namespaces"), name, _4$$5 TSRMLS_CC); + zephir_is_iterable(&preparedNamespaces, 0, "phalcon/loader.zep", 156); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&preparedNamespaces), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&name); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&name, _2$$3); + } else { + ZVAL_LONG(&name, _1$$3); } - ZEPHIR_INIT_NVAR(_5$$4); - _6$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_namespaces"), PH_NOISY_CC); - zephir_array_fetch(&_7$$4, _6$$4, name, PH_NOISY | PH_READONLY, "phalcon/loader.zep", 154 TSRMLS_CC); - zephir_fast_array_merge(_5$$4, &(_7$$4), &(paths) TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_namespaces"), name, _5$$4 TSRMLS_CC); - } + ZEPHIR_INIT_NVAR(&paths); + ZVAL_COPY(&paths, _0$$3); + zephir_read_property(&_3$$4, this_ptr, SL("_namespaces"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_3$$4, &name))) { + ZEPHIR_INIT_NVAR(&_4$$5); + array_init(&_4$$5); + zephir_update_property_array(this_ptr, SL("_namespaces"), &name, &_4$$5 TSRMLS_CC); + } + ZEPHIR_INIT_NVAR(&_5$$4); + zephir_read_property(&_6$$4, this_ptr, SL("_namespaces"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_7$$4, &_6$$4, &name, PH_NOISY | PH_READONLY, "phalcon/loader.zep", 154 TSRMLS_CC); + zephir_fast_array_merge(&_5$$4, &_7$$4, &paths TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_namespaces"), &name, &_5$$4 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&paths); + ZEPHIR_INIT_NVAR(&name); } else { - zephir_update_property_this(getThis(), SL("_namespaces"), preparedNamespaces TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_namespaces"), &preparedNamespaces); } RETURN_THIS(); @@ -233,36 +265,49 @@ PHP_METHOD(Phalcon_Loader, registerNamespaces) { PHP_METHOD(Phalcon_Loader, prepareNamespace) { - HashTable *_1; - HashPosition _0; - zval *namespace_param = NULL, *localPaths = NULL, *name = NULL, *paths = NULL, *prepared = NULL, **_2; - zval *namespace = NULL; + zend_string *_2; + zend_ulong _1; + zval *namespace_param = NULL, localPaths, name, paths, prepared, *_0; + zval namespace; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespace); + ZVAL_UNDEF(&localPaths); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&paths); + ZVAL_UNDEF(&prepared); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &namespace_param); - namespace = namespace_param; - - - ZEPHIR_INIT_VAR(prepared); - array_init(prepared); - zephir_is_iterable(namespace, &_1, &_0, 0, 0, "phalcon/loader.zep", 178); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(name, _1, _0); - ZEPHIR_GET_HVALUE(paths, _2); - if (Z_TYPE_P(paths) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(localPaths); - zephir_create_array(localPaths, 1, 0 TSRMLS_CC); - zephir_array_fast_append(localPaths, paths); + ZEPHIR_OBS_COPY_OR_DUP(&namespace, namespace_param); + + + ZEPHIR_INIT_VAR(&prepared); + array_init(&prepared); + zephir_is_iterable(&namespace, 0, "phalcon/loader.zep", 178); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&namespace), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&name); + if (_2 != NULL) { + ZVAL_STR_COPY(&name, _2); } else { - ZEPHIR_CPY_WRT(localPaths, paths); + ZVAL_LONG(&name, _1); } - zephir_array_update_zval(&prepared, name, &localPaths, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(prepared); + ZEPHIR_INIT_NVAR(&paths); + ZVAL_COPY(&paths, _0); + if (Z_TYPE_P(&paths) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&localPaths); + zephir_create_array(&localPaths, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&localPaths, &paths); + } else { + ZEPHIR_CPY_WRT(&localPaths, &paths); + } + zephir_array_update_zval(&prepared, &name, &localPaths, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&paths); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&prepared); } @@ -271,7 +316,8 @@ PHP_METHOD(Phalcon_Loader, prepareNamespace) { */ PHP_METHOD(Phalcon_Loader, getNamespaces) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_namespaces"); @@ -283,13 +329,18 @@ PHP_METHOD(Phalcon_Loader, getNamespaces) { PHP_METHOD(Phalcon_Loader, registerDirs) { zend_bool merge; - zval *directories_param = NULL, *merge_param = NULL, *_0$$3, *_1$$3; - zval *directories = NULL; + zval *directories_param = NULL, *merge_param = NULL, _0$$3, _1$$3; + zval directories; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&directories); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &directories_param, &merge_param); - directories = directories_param; + ZEPHIR_OBS_COPY_OR_DUP(&directories, directories_param); if (!merge_param) { merge = 0; } else { @@ -298,12 +349,12 @@ PHP_METHOD(Phalcon_Loader, registerDirs) { if (merge) { - ZEPHIR_INIT_VAR(_0$$3); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_directories"), PH_NOISY_CC); - zephir_fast_array_merge(_0$$3, &(_1$$3), &(directories) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_directories"), _0$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_read_property(&_1$$3, this_ptr, SL("_directories"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_0$$3, &_1$$3, &directories TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_directories"), &_0$$3); } else { - zephir_update_property_this(getThis(), SL("_directories"), directories TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_directories"), &directories); } RETURN_THIS(); @@ -314,7 +365,8 @@ PHP_METHOD(Phalcon_Loader, registerDirs) { */ PHP_METHOD(Phalcon_Loader, getDirs) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_directories"); @@ -327,13 +379,18 @@ PHP_METHOD(Phalcon_Loader, getDirs) { PHP_METHOD(Phalcon_Loader, registerFiles) { zend_bool merge; - zval *files_param = NULL, *merge_param = NULL, *_0$$3, *_1$$3; - zval *files = NULL; + zval *files_param = NULL, *merge_param = NULL, _0$$3, _1$$3; + zval files; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&files); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &files_param, &merge_param); - files = files_param; + ZEPHIR_OBS_COPY_OR_DUP(&files, files_param); if (!merge_param) { merge = 0; } else { @@ -342,12 +399,12 @@ PHP_METHOD(Phalcon_Loader, registerFiles) { if (merge) { - ZEPHIR_INIT_VAR(_0$$3); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_files"), PH_NOISY_CC); - zephir_fast_array_merge(_0$$3, &(_1$$3), &(files) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_files"), _0$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_read_property(&_1$$3, this_ptr, SL("_files"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_0$$3, &_1$$3, &files TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_files"), &_0$$3); } else { - zephir_update_property_this(getThis(), SL("_files"), files TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_files"), &files); } RETURN_THIS(); @@ -358,7 +415,8 @@ PHP_METHOD(Phalcon_Loader, registerFiles) { */ PHP_METHOD(Phalcon_Loader, getFiles) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_files"); @@ -370,13 +428,18 @@ PHP_METHOD(Phalcon_Loader, getFiles) { PHP_METHOD(Phalcon_Loader, registerClasses) { zend_bool merge; - zval *classes_param = NULL, *merge_param = NULL, *_0$$3, *_1$$3; - zval *classes = NULL; + zval *classes_param = NULL, *merge_param = NULL, _0$$3, _1$$3; + zval classes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&classes); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &classes_param, &merge_param); - classes = classes_param; + ZEPHIR_OBS_COPY_OR_DUP(&classes, classes_param); if (!merge_param) { merge = 0; } else { @@ -385,12 +448,12 @@ PHP_METHOD(Phalcon_Loader, registerClasses) { if (merge) { - ZEPHIR_INIT_VAR(_0$$3); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_classes"), PH_NOISY_CC); - zephir_fast_array_merge(_0$$3, &(_1$$3), &(classes) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_classes"), _0$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_read_property(&_1$$3, this_ptr, SL("_classes"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_0$$3, &_1$$3, &classes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_classes"), &_0$$3); } else { - zephir_update_property_this(getThis(), SL("_classes"), classes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_classes"), &classes); } RETURN_THIS(); @@ -401,7 +464,8 @@ PHP_METHOD(Phalcon_Loader, registerClasses) { */ PHP_METHOD(Phalcon_Loader, getClasses) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_classes"); @@ -412,10 +476,18 @@ PHP_METHOD(Phalcon_Loader, getClasses) { */ PHP_METHOD(Phalcon_Loader, register) { - zval *_1$$3; + zval _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *prepend_param = NULL, *_0, *_2$$3, _3$$3; + zval *prepend_param = NULL, __$true, __$false, _0, _2$$3, _3$$3; zend_bool prepend; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &prepend_param); @@ -427,24 +499,23 @@ PHP_METHOD(Phalcon_Loader, register) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_registered"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_registered"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "loadfiles", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1$$3); - zephir_create_array(_1$$3, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_1$$3, this_ptr); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "autoLoad", 1); - zephir_array_fast_append(_1$$3, _2$$3); - ZEPHIR_SINIT_VAR(_3$$3); + ZEPHIR_INIT_VAR(&_1$$3); + zephir_create_array(&_1$$3, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_1$$3, this_ptr); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "autoLoad"); + zephir_array_fast_append(&_1$$3, &_2$$3); ZVAL_BOOL(&_3$$3, (prepend ? 1 : 0)); - ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_register", NULL, 309, _1$$3, ZEPHIR_GLOBAL(global_true), &_3$$3); + ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_register", NULL, 269, &_1$$3, &__$true, &_3$$3); zephir_check_call_status(); if (1) { - zephir_update_property_this(getThis(), SL("_registered"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_registered"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_registered"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_registered"), &__$false); } } RETURN_THIS(); @@ -456,26 +527,33 @@ PHP_METHOD(Phalcon_Loader, register) { */ PHP_METHOD(Phalcon_Loader, unregister) { - zval *_1$$3; - zval *_0, *_2$$3; + zval _1$$3; + zval __$true, __$false, _0, _2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_registered"), PH_NOISY_CC); - if (ZEPHIR_IS_TRUE_IDENTICAL(_0)) { - ZEPHIR_INIT_VAR(_1$$3); - zephir_create_array(_1$$3, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_1$$3, this_ptr); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "autoLoad", 1); - zephir_array_fast_append(_1$$3, _2$$3); - ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_unregister", NULL, 310, _1$$3); + zephir_read_property(&_0, this_ptr, SL("_registered"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { + ZEPHIR_INIT_VAR(&_1$$3); + zephir_create_array(&_1$$3, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_1$$3, this_ptr); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "autoLoad"); + zephir_array_fast_append(&_1$$3, &_2$$3); + ZEPHIR_CALL_FUNCTION(NULL, "spl_autoload_unregister", NULL, 270, &_1$$3); zephir_check_call_status(); if (0) { - zephir_update_property_this(getThis(), SL("_registered"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_registered"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_registered"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_registered"), &__$false); } } RETURN_THIS(); @@ -487,53 +565,61 @@ PHP_METHOD(Phalcon_Loader, unregister) { */ PHP_METHOD(Phalcon_Loader, loadFiles) { - HashTable *_2; - HashPosition _1; - zval *filePath = NULL, *fileCheckingCallback = NULL, *_0, **_3, *_4$$3 = NULL, *_7$$3 = NULL, *_5$$4, *_6$$4 = NULL, *_9$$5 = NULL, *_10$$6, *_11$$6 = NULL; - zephir_fcall_cache_entry *_8 = NULL; + zval filePath, fileCheckingCallback, _0, *_1, _2$$3, _5$$3, _3$$4, _4$$4, _7$$5, _8$$6, _9$$6; + zephir_fcall_cache_entry *_6 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filePath); + ZVAL_UNDEF(&fileCheckingCallback); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_9$$6); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("fileCheckingCallback"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(fileCheckingCallback, _0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_files"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/loader.zep", 323); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(filePath, _3); - ZEPHIR_OBS_NVAR(_4$$3); - zephir_read_property_this(&_4$$3, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(_4$$3) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_checkedPath"), filePath TSRMLS_CC); - _5$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_6$$4); - ZVAL_STRING(_6$$4, "loader:beforeCheckPath", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _5$$4, "fire", NULL, 0, _6$$4, this_ptr, filePath); - zephir_check_temp_parameter(_6$$4); + zephir_read_property(&_0, this_ptr, SL("fileCheckingCallback"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&fileCheckingCallback, &_0); + zephir_read_property(&_0, this_ptr, SL("_files"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/loader.zep", 323); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&filePath); + ZVAL_COPY(&filePath, _1); + ZEPHIR_OBS_NVAR(&_2$$3); + zephir_read_property(&_2$$3, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&_2$$3) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_checkedPath"), &filePath); + zephir_read_property(&_3$$4, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&_4$$4); + ZVAL_STRING(&_4$$4, "loader:beforeCheckPath"); + ZEPHIR_CALL_METHOD(NULL, &_3$$4, "fire", NULL, 0, &_4$$4, this_ptr, &filePath); zephir_check_call_status(); } - ZEPHIR_CALL_FUNCTION(&_7$$3, "call_user_func", &_8, 311, fileCheckingCallback, filePath); + ZEPHIR_CALL_FUNCTION(&_5$$3, "call_user_func", &_6, 271, &fileCheckingCallback, &filePath); zephir_check_call_status(); - if (zephir_is_true(_7$$3)) { - ZEPHIR_OBS_NVAR(_9$$5); - zephir_read_property_this(&_9$$5, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(_9$$5) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_foundPath"), filePath TSRMLS_CC); - _10$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_11$$6); - ZVAL_STRING(_11$$6, "loader:pathFound", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _10$$6, "fire", NULL, 0, _11$$6, this_ptr, filePath); - zephir_check_temp_parameter(_11$$6); + if (zephir_is_true(&_5$$3)) { + ZEPHIR_OBS_NVAR(&_7$$5); + zephir_read_property(&_7$$5, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&_7$$5) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_foundPath"), &filePath); + zephir_read_property(&_8$$6, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "loader:pathFound"); + ZEPHIR_CALL_METHOD(NULL, &_8$$6, "fire", NULL, 0, &_9$$6, this_ptr, &filePath); zephir_check_call_status(); } - if (zephir_require_zval(filePath TSRMLS_CC) == FAILURE) { + if (zephir_require_zval(&filePath TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&filePath); ZEPHIR_MM_RESTORE(); } @@ -543,184 +629,215 @@ PHP_METHOD(Phalcon_Loader, loadFiles) { */ PHP_METHOD(Phalcon_Loader, autoLoad) { - HashTable *_4, *_23, *_10$$6, *_14$$9, *_27$$14; - HashPosition _3, _22, _9$$6, _13$$9, _26$$14; - zephir_fcall_cache_entry *_17 = NULL, *_19 = NULL, *_21 = NULL, *_30 = NULL, *_33 = NULL; + zend_string *_5; + zend_ulong _4; + zephir_fcall_cache_entry *_13 = NULL, *_15 = NULL, *_17 = NULL, *_22 = NULL, *_25 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *className_param = NULL, *eventsManager = NULL, *classes = NULL, *extensions = NULL, *filePath = NULL, *ds = NULL, *fixedDirectory = NULL, *directories = NULL, *ns = NULL, *namespaces = NULL, *nsPrefix = NULL, *directory = NULL, *fileName = NULL, *extension = NULL, *nsClassName = NULL, *fileCheckingCallback = NULL, *_2, **_5, **_24, *_0$$3, *_1$$5, *_6$$6 = NULL, _7$$6 = zval_used_for_init, *_8$$6 = NULL, **_11$$6, *_12$$9 = NULL, **_15$$9, *_16$$11 = NULL, *_18$$10 = NULL, *_20$$13 = NULL, *_25$$14 = NULL, **_28$$14, *_29$$16 = NULL, *_31$$15 = NULL, *_32$$18 = NULL, *_34$$19; - zval *className = NULL; + zval *className_param = NULL, eventsManager, classes, extensions, filePath, ds, fixedDirectory, directories, ns, namespaces, nsPrefix, directory, fileName, extension, nsClassName, fileCheckingCallback, _2, *_3, *_18, _0$$3, _1$$5, _6$$6, _7$$6, _8$$6, *_9$$6, _10$$9, *_11$$9, _12$$11, _14$$10, _16$$13, _19$$14, *_20$$14, _21$$16, _23$$15, _24$$18, _26$$19; + zval className; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&classes); + ZVAL_UNDEF(&extensions); + ZVAL_UNDEF(&filePath); + ZVAL_UNDEF(&ds); + ZVAL_UNDEF(&fixedDirectory); + ZVAL_UNDEF(&directories); + ZVAL_UNDEF(&ns); + ZVAL_UNDEF(&namespaces); + ZVAL_UNDEF(&nsPrefix); + ZVAL_UNDEF(&directory); + ZVAL_UNDEF(&fileName); + ZVAL_UNDEF(&extension); + ZVAL_UNDEF(&nsClassName); + ZVAL_UNDEF(&fileCheckingCallback); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_10$$9); + ZVAL_UNDEF(&_12$$11); + ZVAL_UNDEF(&_14$$10); + ZVAL_UNDEF(&_16$$13); + ZVAL_UNDEF(&_19$$14); + ZVAL_UNDEF(&_21$$16); + ZVAL_UNDEF(&_23$$15); + ZVAL_UNDEF(&_24$$18); + ZVAL_UNDEF(&_26$$19); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &className_param); if (UNEXPECTED(Z_TYPE_P(className_param) != IS_STRING && Z_TYPE_P(className_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'className' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'className' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(className_param) == IS_STRING)) { - zephir_get_strval(className, className_param); + zephir_get_strval(&className, className_param); } else { - ZEPHIR_INIT_VAR(className); - ZVAL_EMPTY_STRING(className); + ZEPHIR_INIT_VAR(&className); + ZVAL_EMPTY_STRING(&className); } - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_STRING(_0$$3, "loader:beforeCheckClass", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _0$$3, this_ptr, className); - zephir_check_temp_parameter(_0$$3); + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "loader:beforeCheckClass"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_0$$3, this_ptr, &className); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(classes); - zephir_read_property_this(&classes, this_ptr, SL("_classes"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(filePath); - if (zephir_array_isset_fetch(&filePath, classes, className, 0 TSRMLS_CC)) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_foundPath"), filePath TSRMLS_CC); - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_STRING(_1$$5, "loader:pathFound", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _1$$5, this_ptr, filePath); - zephir_check_temp_parameter(_1$$5); + ZEPHIR_OBS_VAR(&classes); + zephir_read_property(&classes, this_ptr, SL("_classes"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&filePath); + if (zephir_array_isset_fetch(&filePath, &classes, &className, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_foundPath"), &filePath); + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_STRING(&_1$$5, "loader:pathFound"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_1$$5, this_ptr, &filePath); zephir_check_call_status(); } - if (zephir_require_zval(filePath TSRMLS_CC) == FAILURE) { + if (zephir_require_zval(&filePath TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } RETURN_MM_BOOL(1); } - ZEPHIR_OBS_VAR(extensions); - zephir_read_property_this(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(ds); - ZVAL_STRING(ds, "/", 1); - ZEPHIR_INIT_VAR(ns); - ZVAL_STRING(ns, "\\", 1); - ZEPHIR_OBS_VAR(namespaces); - zephir_read_property_this(&namespaces, this_ptr, SL("_namespaces"), PH_NOISY_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("fileCheckingCallback"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(fileCheckingCallback, _2); - zephir_is_iterable(namespaces, &_4, &_3, 0, 0, "phalcon/loader.zep", 429); - for ( - ; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS - ; zend_hash_move_forward_ex(_4, &_3) - ) { - ZEPHIR_GET_HMKEY(nsPrefix, _4, _3); - ZEPHIR_GET_HVALUE(directories, _5); - if (!(zephir_start_with(className, nsPrefix, NULL))) { + ZEPHIR_OBS_VAR(&extensions); + zephir_read_property(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&ds); + ZVAL_STRING(&ds, "/"); + ZEPHIR_INIT_VAR(&ns); + ZVAL_STRING(&ns, "\\"); + ZEPHIR_OBS_VAR(&namespaces); + zephir_read_property(&namespaces, this_ptr, SL("_namespaces"), PH_NOISY_CC); + zephir_read_property(&_2, this_ptr, SL("fileCheckingCallback"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&fileCheckingCallback, &_2); + zephir_is_iterable(&namespaces, 0, "phalcon/loader.zep", 429); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&namespaces), _4, _5, _3) + { + ZEPHIR_INIT_NVAR(&nsPrefix); + if (_5 != NULL) { + ZVAL_STR_COPY(&nsPrefix, _5); + } else { + ZVAL_LONG(&nsPrefix, _4); + } + ZEPHIR_INIT_NVAR(&directories); + ZVAL_COPY(&directories, _3); + if (!(zephir_start_with(&className, &nsPrefix, NULL))) { continue; } ZEPHIR_INIT_LNVAR(_6$$6); - ZEPHIR_CONCAT_VV(_6$$6, nsPrefix, ns); - ZEPHIR_SINIT_NVAR(_7$$6); - ZVAL_LONG(&_7$$6, zephir_fast_strlen_ev(_6$$6)); - ZEPHIR_INIT_NVAR(fileName); - zephir_substr(fileName, className, zephir_get_intval(&_7$$6), 0, ZEPHIR_SUBSTR_NO_LENGTH); - if (!(zephir_is_true(fileName))) { + ZEPHIR_CONCAT_VV(&_6$$6, &nsPrefix, &ns); + ZVAL_LONG(&_7$$6, zephir_fast_strlen_ev(&_6$$6)); + ZEPHIR_INIT_NVAR(&fileName); + zephir_substr(&fileName, &className, zephir_get_intval(&_7$$6), 0, ZEPHIR_SUBSTR_NO_LENGTH); + if (!(zephir_is_true(&fileName))) { continue; } - ZEPHIR_INIT_NVAR(_8$$6); - zephir_fast_str_replace(&_8$$6, ns, ds, fileName TSRMLS_CC); - ZEPHIR_CPY_WRT(fileName, _8$$6); - zephir_is_iterable(directories, &_10$$6, &_9$$6, 0, 0, "phalcon/loader.zep", 424); - for ( - ; zend_hash_get_current_data_ex(_10$$6, (void**) &_11$$6, &_9$$6) == SUCCESS - ; zend_hash_move_forward_ex(_10$$6, &_9$$6) - ) { - ZEPHIR_GET_HVALUE(directory, _11$$6); - ZEPHIR_INIT_NVAR(_12$$9); - zephir_fast_trim(_12$$9, directory, ds, ZEPHIR_TRIM_RIGHT TSRMLS_CC); - ZEPHIR_INIT_NVAR(fixedDirectory); - ZEPHIR_CONCAT_VV(fixedDirectory, _12$$9, ds); - zephir_is_iterable(extensions, &_14$$9, &_13$$9, 0, 0, "phalcon/loader.zep", 423); - for ( - ; zend_hash_get_current_data_ex(_14$$9, (void**) &_15$$9, &_13$$9) == SUCCESS - ; zend_hash_move_forward_ex(_14$$9, &_13$$9) - ) { - ZEPHIR_GET_HVALUE(extension, _15$$9); - ZEPHIR_INIT_NVAR(filePath); - ZEPHIR_CONCAT_VVSV(filePath, fixedDirectory, fileName, ".", extension); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_checkedPath"), filePath TSRMLS_CC); - ZEPHIR_INIT_NVAR(_16$$11); - ZVAL_STRING(_16$$11, "loader:beforeCheckPath", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_17, 0, _16$$11, this_ptr); - zephir_check_temp_parameter(_16$$11); + ZEPHIR_INIT_NVAR(&_8$$6); + zephir_fast_str_replace(&_8$$6, &ns, &ds, &fileName TSRMLS_CC); + ZEPHIR_CPY_WRT(&fileName, &_8$$6); + zephir_is_iterable(&directories, 0, "phalcon/loader.zep", 424); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&directories), _9$$6) + { + ZEPHIR_INIT_NVAR(&directory); + ZVAL_COPY(&directory, _9$$6); + ZEPHIR_INIT_NVAR(&_10$$9); + zephir_fast_trim(&_10$$9, &directory, &ds, ZEPHIR_TRIM_RIGHT TSRMLS_CC); + ZEPHIR_INIT_NVAR(&fixedDirectory); + ZEPHIR_CONCAT_VV(&fixedDirectory, &_10$$9, &ds); + zephir_is_iterable(&extensions, 0, "phalcon/loader.zep", 423); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&extensions), _11$$9) + { + ZEPHIR_INIT_NVAR(&extension); + ZVAL_COPY(&extension, _11$$9); + ZEPHIR_INIT_NVAR(&filePath); + ZEPHIR_CONCAT_VVSV(&filePath, &fixedDirectory, &fileName, ".", &extension); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_checkedPath"), &filePath); + ZEPHIR_INIT_NVAR(&_12$$11); + ZVAL_STRING(&_12$$11, "loader:beforeCheckPath"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_13, 0, &_12$$11, this_ptr); zephir_check_call_status(); } - ZEPHIR_CALL_FUNCTION(&_18$$10, "call_user_func", &_19, 311, fileCheckingCallback, filePath); + ZEPHIR_CALL_FUNCTION(&_14$$10, "call_user_func", &_15, 271, &fileCheckingCallback, &filePath); zephir_check_call_status(); - if (zephir_is_true(_18$$10)) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_foundPath"), filePath TSRMLS_CC); - ZEPHIR_INIT_NVAR(_20$$13); - ZVAL_STRING(_20$$13, "loader:pathFound", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_21, 0, _20$$13, this_ptr, filePath); - zephir_check_temp_parameter(_20$$13); + if (zephir_is_true(&_14$$10)) { + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_foundPath"), &filePath); + ZEPHIR_INIT_NVAR(&_16$$13); + ZVAL_STRING(&_16$$13, "loader:pathFound"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_17, 0, &_16$$13, this_ptr, &filePath); zephir_check_call_status(); } - if (zephir_require_zval(filePath TSRMLS_CC) == FAILURE) { + if (zephir_require_zval(&filePath TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } RETURN_MM_BOOL(1); } - } - } - } - ZEPHIR_INIT_VAR(nsClassName); - zephir_fast_str_replace(&nsClassName, ns, ds, className TSRMLS_CC); - ZEPHIR_OBS_NVAR(directories); - zephir_read_property_this(&directories, this_ptr, SL("_directories"), PH_NOISY_CC); - zephir_is_iterable(directories, &_23, &_22, 0, 0, "phalcon/loader.zep", 484); - for ( - ; zend_hash_get_current_data_ex(_23, (void**) &_24, &_22) == SUCCESS - ; zend_hash_move_forward_ex(_23, &_22) - ) { - ZEPHIR_GET_HVALUE(directory, _24); - ZEPHIR_INIT_NVAR(_25$$14); - zephir_fast_trim(_25$$14, directory, ds, ZEPHIR_TRIM_RIGHT TSRMLS_CC); - ZEPHIR_INIT_NVAR(fixedDirectory); - ZEPHIR_CONCAT_VV(fixedDirectory, _25$$14, ds); - zephir_is_iterable(extensions, &_27$$14, &_26$$14, 0, 0, "phalcon/loader.zep", 479); - for ( - ; zend_hash_get_current_data_ex(_27$$14, (void**) &_28$$14, &_26$$14) == SUCCESS - ; zend_hash_move_forward_ex(_27$$14, &_26$$14) - ) { - ZEPHIR_GET_HVALUE(extension, _28$$14); - ZEPHIR_INIT_NVAR(filePath); - ZEPHIR_CONCAT_VVSV(filePath, fixedDirectory, nsClassName, ".", extension); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_checkedPath"), filePath TSRMLS_CC); - ZEPHIR_INIT_NVAR(_29$$16); - ZVAL_STRING(_29$$16, "loader:beforeCheckPath", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_30, 0, _29$$16, this_ptr, filePath); - zephir_check_temp_parameter(_29$$16); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&extension); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&directory); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&directories); + ZEPHIR_INIT_NVAR(&nsPrefix); + ZEPHIR_INIT_VAR(&nsClassName); + zephir_fast_str_replace(&nsClassName, &ns, &ds, &className TSRMLS_CC); + ZEPHIR_OBS_NVAR(&directories); + zephir_read_property(&directories, this_ptr, SL("_directories"), PH_NOISY_CC); + zephir_is_iterable(&directories, 0, "phalcon/loader.zep", 484); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&directories), _18) + { + ZEPHIR_INIT_NVAR(&directory); + ZVAL_COPY(&directory, _18); + ZEPHIR_INIT_NVAR(&_19$$14); + zephir_fast_trim(&_19$$14, &directory, &ds, ZEPHIR_TRIM_RIGHT TSRMLS_CC); + ZEPHIR_INIT_NVAR(&fixedDirectory); + ZEPHIR_CONCAT_VV(&fixedDirectory, &_19$$14, &ds); + zephir_is_iterable(&extensions, 0, "phalcon/loader.zep", 479); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&extensions), _20$$14) + { + ZEPHIR_INIT_NVAR(&extension); + ZVAL_COPY(&extension, _20$$14); + ZEPHIR_INIT_NVAR(&filePath); + ZEPHIR_CONCAT_VVSV(&filePath, &fixedDirectory, &nsClassName, ".", &extension); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_checkedPath"), &filePath); + ZEPHIR_INIT_NVAR(&_21$$16); + ZVAL_STRING(&_21$$16, "loader:beforeCheckPath"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_22, 0, &_21$$16, this_ptr, &filePath); zephir_check_call_status(); } - ZEPHIR_CALL_FUNCTION(&_31$$15, "call_user_func", &_19, 311, fileCheckingCallback, filePath); + ZEPHIR_CALL_FUNCTION(&_23$$15, "call_user_func", &_15, 271, &fileCheckingCallback, &filePath); zephir_check_call_status(); - if (zephir_is_true(_31$$15)) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_foundPath"), filePath TSRMLS_CC); - ZEPHIR_INIT_NVAR(_32$$18); - ZVAL_STRING(_32$$18, "loader:pathFound", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_33, 0, _32$$18, this_ptr, filePath); - zephir_check_temp_parameter(_32$$18); + if (zephir_is_true(&_23$$15)) { + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_foundPath"), &filePath); + ZEPHIR_INIT_NVAR(&_24$$18); + ZVAL_STRING(&_24$$18, "loader:pathFound"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_25, 0, &_24$$18, this_ptr, &filePath); zephir_check_call_status(); } - if (zephir_require_zval(filePath TSRMLS_CC) == FAILURE) { + if (zephir_require_zval(&filePath TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } RETURN_MM_BOOL(1); } - } - } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_34$$19); - ZVAL_STRING(_34$$19, "loader:afterCheckClass", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _34$$19, this_ptr, className); - zephir_check_temp_parameter(_34$$19); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&extension); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&directory); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_26$$19); + ZVAL_STRING(&_26$$19, "loader:afterCheckClass"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_26$$19, this_ptr, &className); zephir_check_call_status(); } RETURN_MM_BOOL(0); @@ -732,7 +849,8 @@ PHP_METHOD(Phalcon_Loader, autoLoad) { */ PHP_METHOD(Phalcon_Loader, getFoundPath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_foundPath"); @@ -743,68 +861,69 @@ PHP_METHOD(Phalcon_Loader, getFoundPath) { */ PHP_METHOD(Phalcon_Loader, getCheckedPath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_checkedPath"); } -zend_object_value zephir_init_properties_Phalcon_Loader(zend_class_entry *class_type TSRMLS_DC) { - - zval *_7$$6; - zval *_0, *_2, *_4, *_6, *_9, *_1$$3, *_3$$4, *_5$$5, *_8$$6, *_10$$7; +zend_object *zephir_init_properties_Phalcon_Loader(zend_class_entry *class_type TSRMLS_DC) { + + zval _7$$6; + zval _0, _2, _4, _6, _9, _1$$3, _3$$4, _5$$5, _8$$6, _10$$7; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_7$$6); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_files"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_files"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_files"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_files"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_directories"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("_directories"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_directories"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("_directories"), &_3$$4); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_namespaces"), PH_NOISY_CC); - if (Z_TYPE_P(_4) == IS_NULL) { - ZEPHIR_INIT_VAR(_5$$5); - array_init(_5$$5); - zephir_update_property_this(getThis(), SL("_namespaces"), _5$$5 TSRMLS_CC); + zephir_read_property(&_4, this_ptr, SL("_namespaces"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_4) == IS_NULL) { + ZEPHIR_INIT_VAR(&_5$$5); + array_init(&_5$$5); + zephir_update_property_zval(this_ptr, SL("_namespaces"), &_5$$5); } - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_extensions"), PH_NOISY_CC); - if (Z_TYPE_P(_6) == IS_NULL) { - ZEPHIR_INIT_VAR(_7$$6); - zephir_create_array(_7$$6, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_8$$6); - ZVAL_STRING(_8$$6, "php", 1); - zephir_array_fast_append(_7$$6, _8$$6); - zephir_update_property_this(getThis(), SL("_extensions"), _7$$6 TSRMLS_CC); + zephir_read_property(&_6, this_ptr, SL("_extensions"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_6) == IS_NULL) { + ZEPHIR_INIT_VAR(&_7$$6); + zephir_create_array(&_7$$6, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_8$$6); + ZVAL_STRING(&_8$$6, "php"); + zephir_array_fast_append(&_7$$6, &_8$$6); + zephir_update_property_zval(this_ptr, SL("_extensions"), &_7$$6); } - _9 = zephir_fetch_nproperty_this(this_ptr, SL("_classes"), PH_NOISY_CC); - if (Z_TYPE_P(_9) == IS_NULL) { - ZEPHIR_INIT_VAR(_10$$7); - array_init(_10$$7); - zephir_update_property_this(getThis(), SL("_classes"), _10$$7 TSRMLS_CC); + zephir_read_property(&_9, this_ptr, SL("_classes"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_9) == IS_NULL) { + ZEPHIR_INIT_VAR(&_10$$7); + array_init(&_10$$7); + zephir_update_property_zval(this_ptr, SL("_classes"), &_10$$7); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/loader.zep.h b/ext/phalcon/loader.zep.h index a30dc7ccb45..865ca7a7c7a 100644 --- a/ext/phalcon/loader.zep.h +++ b/ext/phalcon/loader.zep.h @@ -23,9 +23,13 @@ PHP_METHOD(Phalcon_Loader, loadFiles); PHP_METHOD(Phalcon_Loader, autoLoad); PHP_METHOD(Phalcon_Loader, getFoundPath); PHP_METHOD(Phalcon_Loader, getCheckedPath); -zend_object_value zephir_init_properties_Phalcon_Loader(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Loader(zend_class_entry *class_type TSRMLS_DC); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_setfilecheckingcallback, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_loader_setfilecheckingcallback, 0, 0, Phalcon\\Loader, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_setfilecheckingcallback, 0, 0, IS_OBJECT, "Phalcon\\Loader", 0) +#endif ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO() @@ -33,62 +37,181 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_seteventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_setextensions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_loader_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_loader_setextensions, 0, 1, Phalcon\\Loader, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_setextensions, 0, 1, IS_OBJECT, "Phalcon\\Loader", 0) +#endif ZEND_ARG_ARRAY_INFO(0, extensions, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_registernamespaces, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getextensions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getextensions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_loader_registernamespaces, 0, 1, Phalcon\\Loader, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_registernamespaces, 0, 1, IS_OBJECT, "Phalcon\\Loader", 0) +#endif ZEND_ARG_ARRAY_INFO(0, namespaces, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_preparenamespace, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_preparenamespace, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_preparenamespace, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, namespace, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_registerdirs, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getnamespaces, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getnamespaces, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_loader_registerdirs, 0, 1, Phalcon\\Loader, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_registerdirs, 0, 1, IS_OBJECT, "Phalcon\\Loader", 0) +#endif ZEND_ARG_ARRAY_INFO(0, directories, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getdirs, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getdirs, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_registerfiles, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_loader_registerfiles, 0, 1, Phalcon\\Loader, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_registerfiles, 0, 1, IS_OBJECT, "Phalcon\\Loader", 0) +#endif ZEND_ARG_ARRAY_INFO(0, files, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getfiles, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getfiles, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_registerclasses, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_loader_registerclasses, 0, 1, Phalcon\\Loader, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_registerclasses, 0, 1, IS_OBJECT, "Phalcon\\Loader", 0) +#endif ZEND_ARG_ARRAY_INFO(0, classes, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getclasses, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getclasses, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_register, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_loader_register, 0, 0, Phalcon\\Loader, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_register, 0, 0, IS_OBJECT, "Phalcon\\Loader", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prepend, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, prepend) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_loader_unregister, 0, 0, Phalcon\\Loader, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_unregister, 0, 0, IS_OBJECT, "Phalcon\\Loader", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_loader_autoload, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_autoload, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_autoload, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getfoundpath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getfoundpath, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getcheckedpath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_loader_getcheckedpath, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_loader_method_entry) { PHP_ME(Phalcon_Loader, setFileCheckingCallback, arginfo_phalcon_loader_setfilecheckingcallback, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, setEventsManager, arginfo_phalcon_loader_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Loader, getEventsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Loader, getEventsManager, arginfo_phalcon_loader_geteventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, setExtensions, arginfo_phalcon_loader_setextensions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Loader, getExtensions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Loader, getExtensions, arginfo_phalcon_loader_getextensions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, registerNamespaces, arginfo_phalcon_loader_registernamespaces, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, prepareNamespace, arginfo_phalcon_loader_preparenamespace, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Loader, getNamespaces, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Loader, getNamespaces, arginfo_phalcon_loader_getnamespaces, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, registerDirs, arginfo_phalcon_loader_registerdirs, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Loader, getDirs, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Loader, getDirs, arginfo_phalcon_loader_getdirs, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, registerFiles, arginfo_phalcon_loader_registerfiles, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Loader, getFiles, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Loader, getFiles, arginfo_phalcon_loader_getfiles, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, registerClasses, arginfo_phalcon_loader_registerclasses, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Loader, getClasses, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Loader, getClasses, arginfo_phalcon_loader_getclasses, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, register, arginfo_phalcon_loader_register, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Loader, unregister, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Loader, unregister, arginfo_phalcon_loader_unregister, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, loadFiles, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Loader, autoLoad, arginfo_phalcon_loader_autoload, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Loader, getFoundPath, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Loader, getCheckedPath, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Loader, getFoundPath, arginfo_phalcon_loader_getfoundpath, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Loader, getCheckedPath, arginfo_phalcon_loader_getcheckedpath, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/logger.zep.c b/ext/phalcon/logger.zep.c index 2c98cfc3d04..6969da63977 100644 --- a/ext/phalcon/logger.zep.c +++ b/ext/phalcon/logger.zep.c @@ -32,27 +32,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger) { ZEPHIR_REGISTER_CLASS(Phalcon, Logger, phalcon, logger, NULL, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); - zend_declare_class_constant_long(phalcon_logger_ce, SL("SPECIAL"), 9 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("SPECIAL"), 9); - zend_declare_class_constant_long(phalcon_logger_ce, SL("CUSTOM"), 8 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("CUSTOM"), 8); - zend_declare_class_constant_long(phalcon_logger_ce, SL("DEBUG"), 7 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("DEBUG"), 7); - zend_declare_class_constant_long(phalcon_logger_ce, SL("INFO"), 6 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("INFO"), 6); - zend_declare_class_constant_long(phalcon_logger_ce, SL("NOTICE"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("NOTICE"), 5); - zend_declare_class_constant_long(phalcon_logger_ce, SL("WARNING"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("WARNING"), 4); - zend_declare_class_constant_long(phalcon_logger_ce, SL("ERROR"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("ERROR"), 3); - zend_declare_class_constant_long(phalcon_logger_ce, SL("ALERT"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("ALERT"), 2); - zend_declare_class_constant_long(phalcon_logger_ce, SL("CRITICAL"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("CRITICAL"), 1); - zend_declare_class_constant_long(phalcon_logger_ce, SL("EMERGENCE"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("EMERGENCE"), 0); - zend_declare_class_constant_long(phalcon_logger_ce, SL("EMERGENCY"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_logger_ce, SL("EMERGENCY"), 0); return SUCCESS; diff --git a/ext/phalcon/logger/adapter.zep.c b/ext/phalcon/logger/adapter.zep.c index f5dde05e61d..6f645a96379 100644 --- a/ext/phalcon/logger/adapter.zep.c +++ b/ext/phalcon/logger/adapter.zep.c @@ -70,8 +70,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter) { */ PHP_METHOD(Phalcon_Logger_Adapter, setLogLevel) { - zval *level_param = NULL, *_0; + zval *level_param = NULL, _0; zend_long level; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &level_param); @@ -79,8 +82,8 @@ PHP_METHOD(Phalcon_Logger_Adapter, setLogLevel) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, level); - zephir_update_property_this(getThis(), SL("_logLevel"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, level); + zephir_update_property_zval(this_ptr, SL("_logLevel"), &_0); RETURN_THISW(); } @@ -90,7 +93,8 @@ PHP_METHOD(Phalcon_Logger_Adapter, setLogLevel) { */ PHP_METHOD(Phalcon_Logger_Adapter, getLogLevel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_logLevel"); @@ -101,13 +105,16 @@ PHP_METHOD(Phalcon_Logger_Adapter, getLogLevel) { */ PHP_METHOD(Phalcon_Logger_Adapter, setFormatter) { - zval *formatter; + zval *formatter, formatter_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&formatter_sub); zephir_fetch_params(0, 1, 0, &formatter); - zephir_update_property_this(getThis(), SL("_formatter"), formatter TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_formatter"), formatter); RETURN_THISW(); } @@ -117,12 +124,17 @@ PHP_METHOD(Phalcon_Logger_Adapter, setFormatter) { */ PHP_METHOD(Phalcon_Logger_Adapter, begin) { - + zval __$true, __$false; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + if (1) { - zephir_update_property_this(getThis(), SL("_transaction"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_transaction"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_transaction"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_transaction"), &__$false); } RETURN_THISW(); @@ -133,45 +145,55 @@ PHP_METHOD(Phalcon_Logger_Adapter, begin) { */ PHP_METHOD(Phalcon_Logger_Adapter, commit) { - HashTable *_3; - HashPosition _2; - zval *message = NULL, *_0, *_1, **_4, *_10, *_5$$4 = NULL, *_6$$4 = NULL, *_7$$4 = NULL, *_8$$4 = NULL; - zephir_fcall_cache_entry *_9 = NULL; + zephir_fcall_cache_entry *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval __$true, __$false, message, _0, _1, *_2, _8, _3$$4, _4$$4, _5$$4, _6$$4; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_transaction"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_transaction"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "There is no active transaction", "phalcon/logger/adapter.zep", 107); return; } if (0) { - zephir_update_property_this(getThis(), SL("_transaction"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_transaction"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_transaction"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); - } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_queue"), PH_NOISY_CC); - zephir_is_iterable(_1, &_3, &_2, 0, 0, "phalcon/logger/adapter.zep", 125); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HVALUE(message, _4); - ZEPHIR_CALL_METHOD(&_5$$4, message, "getmessage", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_transaction"), &__$false); + } + zephir_read_property(&_1, this_ptr, SL("_queue"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_1, 0, "phalcon/logger/adapter.zep", 125); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_1), _2) + { + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _2); + ZEPHIR_CALL_METHOD(&_3$$4, &message, "getmessage", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$4, message, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(&_4$$4, &message, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_7$$4, message, "gettime", NULL, 0); + ZEPHIR_CALL_METHOD(&_5$$4, &message, "gettime", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$4, message, "getcontext", NULL, 0); + ZEPHIR_CALL_METHOD(&_6$$4, &message, "getcontext", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "loginternal", &_9, 0, _5$$4, _6$$4, _7$$4, _8$$4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "loginternal", &_7, 0, &_3$$4, &_4$$4, &_5$$4, &_6$$4); zephir_check_call_status(); - } - ZEPHIR_INIT_VAR(_10); - array_init(_10); - zephir_update_property_this(getThis(), SL("_queue"), _10 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); + ZEPHIR_INIT_VAR(&_8); + array_init(&_8); + zephir_update_property_zval(this_ptr, SL("_queue"), &_8); RETURN_THIS(); } @@ -181,24 +203,30 @@ PHP_METHOD(Phalcon_Logger_Adapter, commit) { */ PHP_METHOD(Phalcon_Logger_Adapter, rollback) { - zval *transaction = NULL, *_0; + zval __$true, __$false, transaction, _0; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&transaction); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(transaction); - zephir_read_property_this(&transaction, this_ptr, SL("_transaction"), PH_NOISY_CC); - if (!(zephir_is_true(transaction))) { + ZEPHIR_OBS_VAR(&transaction); + zephir_read_property(&transaction, this_ptr, SL("_transaction"), PH_NOISY_CC); + if (!(zephir_is_true(&transaction))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "There is no active transaction", "phalcon/logger/adapter.zep", 139); return; } if (0) { - zephir_update_property_this(getThis(), SL("_transaction"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_transaction"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_transaction"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_transaction"), &__$false); } - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_queue"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_queue"), &_0); RETURN_THIS(); } @@ -208,7 +236,8 @@ PHP_METHOD(Phalcon_Logger_Adapter, rollback) { */ PHP_METHOD(Phalcon_Logger_Adapter, isTransaction) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_transaction"); @@ -220,34 +249,38 @@ PHP_METHOD(Phalcon_Logger_Adapter, isTransaction) { PHP_METHOD(Phalcon_Logger_Adapter, critical) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); RETURN_MM(); @@ -259,34 +292,38 @@ PHP_METHOD(Phalcon_Logger_Adapter, critical) { PHP_METHOD(Phalcon_Logger_Adapter, emergency) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 0); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 0); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); RETURN_MM(); @@ -298,34 +335,38 @@ PHP_METHOD(Phalcon_Logger_Adapter, emergency) { PHP_METHOD(Phalcon_Logger_Adapter, debug) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 7); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 7); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); RETURN_MM(); @@ -337,34 +378,38 @@ PHP_METHOD(Phalcon_Logger_Adapter, debug) { PHP_METHOD(Phalcon_Logger_Adapter, error) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 3); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 3); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); RETURN_MM(); @@ -376,34 +421,38 @@ PHP_METHOD(Phalcon_Logger_Adapter, error) { PHP_METHOD(Phalcon_Logger_Adapter, info) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 6); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 6); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); RETURN_MM(); @@ -415,34 +464,38 @@ PHP_METHOD(Phalcon_Logger_Adapter, info) { PHP_METHOD(Phalcon_Logger_Adapter, notice) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 5); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 5); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); RETURN_MM(); @@ -454,34 +507,38 @@ PHP_METHOD(Phalcon_Logger_Adapter, notice) { PHP_METHOD(Phalcon_Logger_Adapter, warning) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 4); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 4); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); RETURN_MM(); @@ -493,34 +550,38 @@ PHP_METHOD(Phalcon_Logger_Adapter, warning) { PHP_METHOD(Phalcon_Logger_Adapter, alert) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 2); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); RETURN_MM(); @@ -533,20 +594,33 @@ PHP_METHOD(Phalcon_Logger_Adapter, log) { zend_bool _0, _1$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *type, *message = NULL, *context_param = NULL, *timestamp = NULL, *toggledMessage = NULL, *toggledType = NULL, *_2, *_3$$8, *_4$$9; + zval context; + zval *type, type_sub, *message = NULL, message_sub, *context_param = NULL, __$null, timestamp, toggledMessage, toggledType, _2, _3$$8, _4$$9; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type_sub); + ZVAL_UNDEF(&message_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(×tamp); + ZVAL_UNDEF(&toggledMessage); + ZVAL_UNDEF(&toggledType); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &type, &message, &context_param); if (!message) { - message = ZEPHIR_GLOBAL(global_null); + message = &message_sub; + message = &__$null; } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } @@ -555,38 +629,38 @@ PHP_METHOD(Phalcon_Logger_Adapter, log) { _0 = Z_TYPE_P(message) == IS_LONG; } if (_0) { - ZEPHIR_CPY_WRT(toggledMessage, type); - ZEPHIR_CPY_WRT(toggledType, message); + ZEPHIR_CPY_WRT(&toggledMessage, type); + ZEPHIR_CPY_WRT(&toggledType, message); } else { _1$$4 = Z_TYPE_P(type) == IS_STRING; if (_1$$4) { _1$$4 = Z_TYPE_P(message) == IS_NULL; } if (_1$$4) { - ZEPHIR_CPY_WRT(toggledMessage, type); - ZEPHIR_CPY_WRT(toggledType, message); + ZEPHIR_CPY_WRT(&toggledMessage, type); + ZEPHIR_CPY_WRT(&toggledType, message); } else { - ZEPHIR_CPY_WRT(toggledMessage, message); - ZEPHIR_CPY_WRT(toggledType, type); + ZEPHIR_CPY_WRT(&toggledMessage, message); + ZEPHIR_CPY_WRT(&toggledType, type); } } - if (Z_TYPE_P(toggledType) == IS_NULL) { - ZEPHIR_INIT_NVAR(toggledType); - ZVAL_LONG(toggledType, 7); - } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_logLevel"), PH_NOISY_CC); - if (ZEPHIR_GE(_2, toggledType)) { - ZEPHIR_INIT_VAR(timestamp); - zephir_time(timestamp); - _3$$8 = zephir_fetch_nproperty_this(this_ptr, SL("_transaction"), PH_NOISY_CC); - if (zephir_is_true(_3$$8)) { - ZEPHIR_INIT_VAR(_4$$9); - object_init_ex(_4$$9, phalcon_logger_item_ce); - ZEPHIR_CALL_METHOD(NULL, _4$$9, "__construct", NULL, 23, toggledMessage, toggledType, timestamp, context); + if (Z_TYPE_P(&toggledType) == IS_NULL) { + ZEPHIR_INIT_NVAR(&toggledType); + ZVAL_LONG(&toggledType, 7); + } + zephir_read_property(&_2, this_ptr, SL("_logLevel"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_GE(&_2, &toggledType)) { + ZEPHIR_INIT_VAR(×tamp); + zephir_time(×tamp); + zephir_read_property(&_3$$8, this_ptr, SL("_transaction"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_3$$8)) { + ZEPHIR_INIT_VAR(&_4$$9); + object_init_ex(&_4$$9, phalcon_logger_item_ce); + ZEPHIR_CALL_METHOD(NULL, &_4$$9, "__construct", NULL, 18, &toggledMessage, &toggledType, ×tamp, &context); zephir_check_call_status(); - zephir_update_property_array_append(this_ptr, SL("_queue"), _4$$9 TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_queue"), &_4$$9 TSRMLS_CC); } else { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "loginternal", NULL, 0, toggledMessage, toggledType, timestamp, context); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "loginternal", NULL, 0, &toggledMessage, &toggledType, ×tamp, &context); zephir_check_call_status(); } } @@ -594,34 +668,25 @@ PHP_METHOD(Phalcon_Logger_Adapter, log) { } -zend_object_value zephir_init_properties_Phalcon_Logger_Adapter(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Logger_Adapter(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_queue"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_queue"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_queue"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_queue"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/logger/adapter.zep.h b/ext/phalcon/logger/adapter.zep.h index bf3d9244d3d..161f8aa9470 100644 --- a/ext/phalcon/logger/adapter.zep.h +++ b/ext/phalcon/logger/adapter.zep.h @@ -19,57 +19,172 @@ PHP_METHOD(Phalcon_Logger_Adapter, notice); PHP_METHOD(Phalcon_Logger_Adapter, warning); PHP_METHOD(Phalcon_Logger_Adapter, alert); PHP_METHOD(Phalcon_Logger_Adapter, log); -zend_object_value zephir_init_properties_Phalcon_Logger_Adapter(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Logger_Adapter(zend_class_entry *class_type TSRMLS_DC); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_setloglevel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_setloglevel, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_setloglevel, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) +#else ZEND_ARG_INFO(0, level) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_setformatter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_getloglevel, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_getloglevel, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_setformatter, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_setformatter, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, formatter, Phalcon\\Logger\\FormatterInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_critical, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_begin, 0, 0, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_begin, 0, 0, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_commit, 0, 0, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_commit, 0, 0, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_rollback, 0, 0, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_rollback, 0, 0, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_istransaction, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_istransaction, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_critical, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_critical, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_emergency, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_emergency, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_emergency, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_debug, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_debug, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_debug, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_error, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_error, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_error, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_info, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_info, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_info, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_notice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_notice, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_notice, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_warning, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_warning, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_warning, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_alert, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_alert, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_alert, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_log, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_log, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_log, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif ZEND_ARG_INFO(0, type) ZEND_ARG_INFO(0, message) ZEND_ARG_ARRAY_INFO(0, context, 1) @@ -77,12 +192,12 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_logger_adapter_method_entry) { PHP_ME(Phalcon_Logger_Adapter, setLogLevel, arginfo_phalcon_logger_adapter_setloglevel, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter, getLogLevel, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter, getLogLevel, arginfo_phalcon_logger_adapter_getloglevel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter, setFormatter, arginfo_phalcon_logger_adapter_setformatter, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter, begin, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter, commit, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter, rollback, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter, isTransaction, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter, begin, arginfo_phalcon_logger_adapter_begin, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter, commit, arginfo_phalcon_logger_adapter_commit, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter, rollback, arginfo_phalcon_logger_adapter_rollback, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter, isTransaction, arginfo_phalcon_logger_adapter_istransaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter, critical, arginfo_phalcon_logger_adapter_critical, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter, emergency, arginfo_phalcon_logger_adapter_emergency, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter, debug, arginfo_phalcon_logger_adapter_debug, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/logger/adapter/blackhole.zep.c b/ext/phalcon/logger/adapter/blackhole.zep.c index 65eff3cc1a0..4cd5d56e35a 100644 --- a/ext/phalcon/logger/adapter/blackhole.zep.c +++ b/ext/phalcon/logger/adapter/blackhole.zep.c @@ -36,19 +36,23 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_Blackhole) { */ PHP_METHOD(Phalcon_Logger_Adapter_Blackhole, getFormatter) { - zval *_0, *_1$$3; + zval _0, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); - if (Z_TYPE_P(_0) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_logger_formatter_line_ce); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 312); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_logger_formatter_line_ce); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 272); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_formatter"), _1$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_formatter"), &_1$$3); } RETURN_MM_MEMBER(getThis(), "_formatter"); @@ -59,18 +63,22 @@ PHP_METHOD(Phalcon_Logger_Adapter_Blackhole, getFormatter) { */ PHP_METHOD(Phalcon_Logger_Adapter_Blackhole, logInternal) { - zval *context = NULL; + zval context; zend_long type, time; zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL; - zval *message = NULL; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &message_param, &type_param, &time_param, &context_param); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); type = zephir_get_intval(type_param); time = zephir_get_intval(time_param); - zephir_get_arrval(context, context_param); + zephir_get_arrval(&context, context_param); @@ -81,7 +89,8 @@ PHP_METHOD(Phalcon_Logger_Adapter_Blackhole, logInternal) { */ PHP_METHOD(Phalcon_Logger_Adapter_Blackhole, close) { - + zval *this_ptr = getThis(); + } diff --git a/ext/phalcon/logger/adapter/blackhole.zep.h b/ext/phalcon/logger/adapter/blackhole.zep.h index 8fd9a124cdd..94239d0c71b 100644 --- a/ext/phalcon/logger/adapter/blackhole.zep.h +++ b/ext/phalcon/logger/adapter/blackhole.zep.h @@ -7,16 +7,42 @@ PHP_METHOD(Phalcon_Logger_Adapter_Blackhole, getFormatter); PHP_METHOD(Phalcon_Logger_Adapter_Blackhole, logInternal); PHP_METHOD(Phalcon_Logger_Adapter_Blackhole, close); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_blackhole_getformatter, 0, 0, Phalcon\\Logger\\FormatterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_blackhole_getformatter, 0, 0, IS_OBJECT, "Phalcon\\Logger\\FormatterInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_blackhole_loginternal, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, time, IS_LONG, 0) +#else ZEND_ARG_INFO(0, time) +#endif ZEND_ARG_ARRAY_INFO(0, context, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_blackhole_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_blackhole_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_logger_adapter_blackhole_method_entry) { - PHP_ME(Phalcon_Logger_Adapter_Blackhole, getFormatter, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_Blackhole, getFormatter, arginfo_phalcon_logger_adapter_blackhole_getformatter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter_Blackhole, logInternal, arginfo_phalcon_logger_adapter_blackhole_loginternal, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter_Blackhole, close, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_Blackhole, close, arginfo_phalcon_logger_adapter_blackhole_close, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/logger/adapter/file.zep.c b/ext/phalcon/logger/adapter/file.zep.c index e24f240e083..4250724ec50 100644 --- a/ext/phalcon/logger/adapter/file.zep.c +++ b/ext/phalcon/logger/adapter/file.zep.c @@ -69,7 +69,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_File) { */ PHP_METHOD(Phalcon_Logger_Adapter_File, getPath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_path"); @@ -84,58 +85,68 @@ PHP_METHOD(Phalcon_Logger_Adapter_File, getPath) { PHP_METHOD(Phalcon_Logger_Adapter_File, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *options = NULL, *mode = NULL, *handler = NULL, *_0$$7; - zval *name = NULL, *_1$$7; + zval *name_param = NULL, *options = NULL, options_sub, __$null, mode, handler, _0$$7; + zval name, _1$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_1$$7); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&_0$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &options); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - ZEPHIR_INIT_VAR(mode); - ZVAL_NULL(mode); + ZEPHIR_INIT_VAR(&mode); + ZVAL_NULL(&mode); if (Z_TYPE_P(options) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(mode); - if (zephir_array_isset_string_fetch(&mode, options, SS("mode"), 0 TSRMLS_CC)) { - if (zephir_memnstr_str(mode, SL("r"), "phalcon/logger/adapter/file.zep", 74)) { + ZEPHIR_OBS_NVAR(&mode); + if (zephir_array_isset_string_fetch(&mode, options, SL("mode"), 0)) { + if (zephir_memnstr_str(&mode, SL("r"), "phalcon/logger/adapter/file.zep", 74)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Logger must be opened in append or write mode", "phalcon/logger/adapter/file.zep", 75); return; } } } - if (Z_TYPE_P(mode) == IS_NULL) { - ZEPHIR_INIT_NVAR(mode); - ZVAL_STRING(mode, "ab", 1); + if (Z_TYPE_P(&mode) == IS_NULL) { + ZEPHIR_INIT_NVAR(&mode); + ZVAL_STRING(&mode, "ab"); } - ZEPHIR_CALL_FUNCTION(&handler, "fopen", NULL, 308, name, mode); + ZEPHIR_CALL_FUNCTION(&handler, "fopen", NULL, 268, &name, &mode); zephir_check_call_status(); - if (Z_TYPE_P(handler) != IS_RESOURCE) { - ZEPHIR_INIT_VAR(_0$$7); - object_init_ex(_0$$7, phalcon_logger_exception_ce); - ZEPHIR_INIT_VAR(_1$$7); - ZEPHIR_CONCAT_SVS(_1$$7, "Can't open log file at '", name, "'"); - ZEPHIR_CALL_METHOD(NULL, _0$$7, "__construct", NULL, 9, _1$$7); + if (Z_TYPE_P(&handler) != IS_RESOURCE) { + ZEPHIR_INIT_VAR(&_0$$7); + object_init_ex(&_0$$7, phalcon_logger_exception_ce); + ZEPHIR_INIT_VAR(&_1$$7); + ZEPHIR_CONCAT_SVS(&_1$$7, "Can't open log file at '", &name, "'"); + ZEPHIR_CALL_METHOD(NULL, &_0$$7, "__construct", NULL, 4, &_1$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$7, "phalcon/logger/adapter/file.zep", 89 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$7, "phalcon/logger/adapter/file.zep", 89 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_update_property_this(getThis(), SL("_path"), name TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_fileHandler"), handler TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_path"), &name); + zephir_update_property_zval(this_ptr, SL("_options"), options); + zephir_update_property_zval(this_ptr, SL("_fileHandler"), &handler); ZEPHIR_MM_RESTORE(); } @@ -145,19 +156,23 @@ PHP_METHOD(Phalcon_Logger_Adapter_File, __construct) { */ PHP_METHOD(Phalcon_Logger_Adapter_File, getFormatter) { - zval *_0, *_1$$3; + zval _0, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); - if (Z_TYPE_P(_0) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_logger_formatter_line_ce); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 312); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_logger_formatter_line_ce); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 272); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_formatter"), _1$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_formatter"), &_1$$3); } RETURN_MM_MEMBER(getThis(), "_formatter"); @@ -168,35 +183,42 @@ PHP_METHOD(Phalcon_Logger_Adapter_File, getFormatter) { */ PHP_METHOD(Phalcon_Logger_Adapter_File, logInternal) { - zval *context = NULL; + zval context; zend_long type, time, ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, *fileHandler = NULL, *_0 = NULL, *_1 = NULL, *_2, *_3; - zval *message = NULL; + zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, fileHandler, _0, _1, _2, _3; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&fileHandler); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &message_param, &type_param, &time_param, &context_param); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); type = zephir_get_intval(type_param); time = zephir_get_intval(time_param); - zephir_get_arrval(context, context_param); + zephir_get_arrval(&context, context_param); - ZEPHIR_OBS_VAR(fileHandler); - zephir_read_property_this(&fileHandler, this_ptr, SL("_fileHandler"), PH_NOISY_CC); - if (Z_TYPE_P(fileHandler) != IS_RESOURCE) { + ZEPHIR_OBS_VAR(&fileHandler); + zephir_read_property(&fileHandler, this_ptr, SL("_fileHandler"), PH_NOISY_CC); + if (Z_TYPE_P(&fileHandler) != IS_RESOURCE) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Cannot send message to the log because it is invalid", "phalcon/logger/adapter/file.zep", 118); return; } ZEPHIR_CALL_METHOD(&_0, this_ptr, "getformatter", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, type); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, time); - ZEPHIR_CALL_METHOD(&_1, _0, "format", NULL, 0, message, _2, _3, context); + ZVAL_LONG(&_2, type); + ZVAL_LONG(&_3, time); + ZEPHIR_CALL_METHOD(&_1, &_0, "format", NULL, 0, &message, &_2, &_3, &context); zephir_check_call_status(); - zephir_fwrite(NULL, fileHandler, _1 TSRMLS_CC); + zephir_fwrite(NULL, &fileHandler, &_1 TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -206,11 +228,14 @@ PHP_METHOD(Phalcon_Logger_Adapter_File, logInternal) { */ PHP_METHOD(Phalcon_Logger_Adapter_File, close) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_fileHandler"), PH_NOISY_CC); - RETURN_BOOL(zephir_fclose(_0 TSRMLS_CC)); + + zephir_read_property(&_0, this_ptr, SL("_fileHandler"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_fclose(&_0 TSRMLS_CC)); } @@ -219,34 +244,40 @@ PHP_METHOD(Phalcon_Logger_Adapter_File, close) { */ PHP_METHOD(Phalcon_Logger_Adapter_File, __wakeup) { - zval *path = NULL, *mode = NULL, *_0, *_1 = NULL; + zval path, mode, _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(path); - zephir_read_property_this(&path, this_ptr, SL("_path"), PH_NOISY_CC); - if (Z_TYPE_P(path) != IS_STRING) { + ZEPHIR_OBS_VAR(&path); + zephir_read_property(&path, this_ptr, SL("_path"), PH_NOISY_CC); + if (Z_TYPE_P(&path) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Invalid data passed to Phalcon\\Logger\\Adapter\\File::__wakeup()", "phalcon/logger/adapter/file.zep", 141); return; } - ZEPHIR_OBS_VAR(mode); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!(zephir_array_isset_string_fetch(&mode, _0, SS("mode"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(mode); - ZVAL_STRING(mode, "ab", 1); + ZEPHIR_OBS_VAR(&mode); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_string_fetch(&mode, &_0, SL("mode"), 0))) { + ZEPHIR_INIT_NVAR(&mode); + ZVAL_STRING(&mode, "ab"); } - if (Z_TYPE_P(mode) != IS_STRING) { + if (Z_TYPE_P(&mode) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Invalid data passed to Phalcon\\Logger\\Adapter\\File::__wakeup()", "phalcon/logger/adapter/file.zep", 149); return; } - if (zephir_memnstr_str(mode, SL("r"), "phalcon/logger/adapter/file.zep", 152)) { + if (zephir_memnstr_str(&mode, SL("r"), "phalcon/logger/adapter/file.zep", 152)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Logger must be opened in append or write mode", "phalcon/logger/adapter/file.zep", 153); return; } - ZEPHIR_CALL_FUNCTION(&_1, "fopen", NULL, 308, path, mode); + ZEPHIR_CALL_FUNCTION(&_1, "fopen", NULL, 268, &path, &mode); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_fileHandler"), _1 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_fileHandler"), &_1); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/logger/adapter/file.zep.h b/ext/phalcon/logger/adapter/file.zep.h index d5a93dc4eac..3faeaf418c8 100644 --- a/ext/phalcon/logger/adapter/file.zep.h +++ b/ext/phalcon/logger/adapter/file.zep.h @@ -11,23 +11,53 @@ PHP_METHOD(Phalcon_Logger_Adapter_File, close); PHP_METHOD(Phalcon_Logger_Adapter_File, __wakeup); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_file___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_file_getformatter, 0, 0, Phalcon\\Logger\\FormatterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_file_getformatter, 0, 0, IS_OBJECT, "Phalcon\\Logger\\FormatterInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_file_loginternal, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, time, IS_LONG, 0) +#else ZEND_ARG_INFO(0, time) +#endif ZEND_ARG_ARRAY_INFO(0, context, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_file_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_file_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_logger_adapter_file_method_entry) { PHP_ME(Phalcon_Logger_Adapter_File, getPath, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter_File, __construct, arginfo_phalcon_logger_adapter_file___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Logger_Adapter_File, getFormatter, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_File, getFormatter, arginfo_phalcon_logger_adapter_file_getformatter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter_File, logInternal, arginfo_phalcon_logger_adapter_file_loginternal, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter_File, close, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_File, close, arginfo_phalcon_logger_adapter_file_close, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter_File, __wakeup, NULL, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/logger/adapter/firephp.zep.c b/ext/phalcon/logger/adapter/firephp.zep.c index bbc7ff17f8a..051053e1a55 100644 --- a/ext/phalcon/logger/adapter/firephp.zep.c +++ b/ext/phalcon/logger/adapter/firephp.zep.c @@ -54,21 +54,25 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_Firephp) { */ PHP_METHOD(Phalcon_Logger_Adapter_Firephp, getFormatter) { - zval *_0, *_1$$3; + zval _0, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); - if (Z_TYPE_P(_0) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_logger_formatter_firephp_ce); - if (zephir_has_constructor(_1$$3 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_logger_formatter_firephp_ce); + if (zephir_has_constructor(&_1$$3 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_formatter"), _1$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_formatter"), &_1$$3); } RETURN_MM_MEMBER(getThis(), "_formatter"); @@ -79,75 +83,96 @@ PHP_METHOD(Phalcon_Logger_Adapter_Firephp, getFormatter) { */ PHP_METHOD(Phalcon_Logger_Adapter_Firephp, logInternal) { - HashTable *_7; - HashPosition _6; - zval *context = NULL; + zend_string *_7; + zend_ulong _6; + zval context; zend_long type, time, ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, *chunk = NULL, *format = NULL, *chString = NULL, *content = NULL, *key = NULL, *index = NULL, *_0, *_2 = NULL, *_3, *_4, _5, **_8, _1$$3 = zval_used_for_init; - zval *message = NULL, *_9$$4 = NULL; + zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, __$true, __$false, chunk, format, chString, content, key, index, _0, _2, _3, _4, *_5, _1$$3; + zval message, _8$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_8$$4); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&chunk); + ZVAL_UNDEF(&format); + ZVAL_UNDEF(&chString); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &message_param, &type_param, &time_param, &context_param); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); type = zephir_get_intval(type_param); time = zephir_get_intval(time_param); - zephir_get_arrval(context, context_param); + zephir_get_arrval(&context, context_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { - ZEPHIR_SINIT_VAR(_1$$3); - ZVAL_STRING(&_1$$3, "X-Wf-Protocol-1: http://meta.wildfirehq.org/Protocol/JsonStream/0.2", 0); - ZEPHIR_CALL_FUNCTION(NULL, "header", NULL, 262, &_1$$3); + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "X-Wf-Protocol-1: http://meta.wildfirehq.org/Protocol/JsonStream/0.2"); + ZEPHIR_CALL_FUNCTION(NULL, "header", NULL, 224, &_1$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_1$$3); - ZVAL_STRING(&_1$$3, "X-Wf-1-Plugin-1: http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3", 0); - ZEPHIR_CALL_FUNCTION(NULL, "header", NULL, 262, &_1$$3); + ZEPHIR_INIT_NVAR(&_1$$3); + ZVAL_STRING(&_1$$3, "X-Wf-1-Plugin-1: http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3"); + ZEPHIR_CALL_FUNCTION(NULL, "header", NULL, 224, &_1$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_1$$3); - ZVAL_STRING(&_1$$3, "X-Wf-Structure-1: http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1", 0); - ZEPHIR_CALL_FUNCTION(NULL, "header", NULL, 262, &_1$$3); + ZEPHIR_INIT_NVAR(&_1$$3); + ZVAL_STRING(&_1$$3, "X-Wf-Structure-1: http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1"); + ZEPHIR_CALL_FUNCTION(NULL, "header", NULL, 224, &_1$$3); zephir_check_call_status(); if (1) { - zephir_update_property_this(getThis(), SL("_initialized"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_initialized"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_initialized"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_initialized"), &__$false); } } ZEPHIR_CALL_METHOD(&_2, this_ptr, "getformatter", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, type); - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, time); - ZEPHIR_CALL_METHOD(&format, _2, "format", NULL, 0, message, _3, _4, context); + ZVAL_LONG(&_3, type); + ZVAL_LONG(&_4, time); + ZEPHIR_CALL_METHOD(&format, &_2, "format", NULL, 0, &message, &_3, &_4, &context); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_5); - ZVAL_LONG(&_5, 4500); - ZEPHIR_CALL_FUNCTION(&chunk, "str_split", NULL, 76, format, &_5); + ZVAL_LONG(&_3, 4500); + ZEPHIR_CALL_FUNCTION(&chunk, "str_split", NULL, 69, &format, &_3); zephir_check_call_status(); - ZEPHIR_OBS_VAR(index); - zephir_read_property_this(&index, this_ptr, SL("_index"), PH_NOISY_CC); - zephir_is_iterable(chunk, &_7, &_6, 0, 0, "phalcon/logger/adapter/firephp.zep", 94); - for ( - ; zend_hash_get_current_data_ex(_7, (void**) &_8, &_6) == SUCCESS - ; zend_hash_move_forward_ex(_7, &_6) - ) { - ZEPHIR_GET_HMKEY(key, _7, _6); - ZEPHIR_GET_HVALUE(chString, _8); - zephir_get_strval(_9$$4, index); - ZEPHIR_INIT_NVAR(content); - ZEPHIR_CONCAT_SVSV(content, "X-Wf-1-1-1-", _9$$4, ": ", chString); - if (zephir_array_isset_long(chunk, (zephir_get_numberval(key) + 1))) { + ZEPHIR_OBS_VAR(&index); + zephir_read_property(&index, this_ptr, SL("_index"), PH_NOISY_CC); + zephir_is_iterable(&chunk, 0, "phalcon/logger/adapter/firephp.zep", 94); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&chunk), _6, _7, _5) + { + ZEPHIR_INIT_NVAR(&key); + if (_7 != NULL) { + ZVAL_STR_COPY(&key, _7); + } else { + ZVAL_LONG(&key, _6); + } + ZEPHIR_INIT_NVAR(&chString); + ZVAL_COPY(&chString, _5); + zephir_get_strval(&_8$$4, &index); + ZEPHIR_INIT_NVAR(&content); + ZEPHIR_CONCAT_SVSV(&content, "X-Wf-1-1-1-", &_8$$4, ": ", &chString); + if (zephir_array_isset_long(&chunk, (zephir_get_numberval(&key) + 1))) { zephir_concat_self_str(&content, SL("|\\") TSRMLS_CC); } - ZEPHIR_CALL_FUNCTION(NULL, "header", NULL, 262, content); + ZEPHIR_CALL_FUNCTION(NULL, "header", NULL, 224, &content); zephir_check_call_status(); - ZEPHIR_SEPARATE(index); - zephir_increment(index); - } - zephir_update_property_this(getThis(), SL("_index"), index TSRMLS_CC); + ZEPHIR_SEPARATE(&index); + zephir_increment(&index); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&chString); + ZEPHIR_INIT_NVAR(&key); + zephir_update_property_zval(this_ptr, SL("_index"), &index); ZEPHIR_MM_RESTORE(); } @@ -157,7 +182,8 @@ PHP_METHOD(Phalcon_Logger_Adapter_Firephp, logInternal) { */ PHP_METHOD(Phalcon_Logger_Adapter_Firephp, close) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); diff --git a/ext/phalcon/logger/adapter/firephp.zep.h b/ext/phalcon/logger/adapter/firephp.zep.h index feed2ff6d37..ac572637a1f 100644 --- a/ext/phalcon/logger/adapter/firephp.zep.h +++ b/ext/phalcon/logger/adapter/firephp.zep.h @@ -7,16 +7,42 @@ PHP_METHOD(Phalcon_Logger_Adapter_Firephp, getFormatter); PHP_METHOD(Phalcon_Logger_Adapter_Firephp, logInternal); PHP_METHOD(Phalcon_Logger_Adapter_Firephp, close); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_firephp_getformatter, 0, 0, Phalcon\\Logger\\FormatterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_firephp_getformatter, 0, 0, IS_OBJECT, "Phalcon\\Logger\\FormatterInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_firephp_loginternal, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, time, IS_LONG, 0) +#else ZEND_ARG_INFO(0, time) +#endif ZEND_ARG_ARRAY_INFO(0, context, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_firephp_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_firephp_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_logger_adapter_firephp_method_entry) { - PHP_ME(Phalcon_Logger_Adapter_Firephp, getFormatter, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_Firephp, getFormatter, arginfo_phalcon_logger_adapter_firephp_getformatter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter_Firephp, logInternal, arginfo_phalcon_logger_adapter_firephp_loginternal, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter_Firephp, close, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_Firephp, close, arginfo_phalcon_logger_adapter_firephp_close, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/logger/adapter/stream.zep.c b/ext/phalcon/logger/adapter/stream.zep.c index 751ed743e14..ec8fe6b4f1c 100644 --- a/ext/phalcon/logger/adapter/stream.zep.c +++ b/ext/phalcon/logger/adapter/stream.zep.c @@ -64,51 +64,61 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_Stream) { PHP_METHOD(Phalcon_Logger_Adapter_Stream, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *options = NULL, *mode = NULL, *stream = NULL, *_0$$6; - zval *name = NULL, *_1$$6; + zval *name_param = NULL, *options = NULL, options_sub, __$null, mode, stream, _0$$6; + zval name, _1$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_1$$6); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&mode); + ZVAL_UNDEF(&stream); + ZVAL_UNDEF(&_0$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &options); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - ZEPHIR_OBS_VAR(mode); - if (zephir_array_isset_string_fetch(&mode, options, SS("mode"), 0 TSRMLS_CC)) { - if (zephir_memnstr_str(mode, SL("r"), "phalcon/logger/adapter/stream.zep", 64)) { + ZEPHIR_OBS_VAR(&mode); + if (zephir_array_isset_string_fetch(&mode, options, SL("mode"), 0)) { + if (zephir_memnstr_str(&mode, SL("r"), "phalcon/logger/adapter/stream.zep", 64)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Stream must be opened in append or write mode", "phalcon/logger/adapter/stream.zep", 65); return; } } else { - ZEPHIR_INIT_NVAR(mode); - ZVAL_STRING(mode, "ab", 1); + ZEPHIR_INIT_NVAR(&mode); + ZVAL_STRING(&mode, "ab"); } - ZEPHIR_CALL_FUNCTION(&stream, "fopen", NULL, 308, name, mode); + ZEPHIR_CALL_FUNCTION(&stream, "fopen", NULL, 268, &name, &mode); zephir_check_call_status(); - if (!(zephir_is_true(stream))) { - ZEPHIR_INIT_VAR(_0$$6); - object_init_ex(_0$$6, phalcon_logger_exception_ce); - ZEPHIR_INIT_VAR(_1$$6); - ZEPHIR_CONCAT_SVS(_1$$6, "Can't open stream '", name, "'"); - ZEPHIR_CALL_METHOD(NULL, _0$$6, "__construct", NULL, 9, _1$$6); + if (!(zephir_is_true(&stream))) { + ZEPHIR_INIT_VAR(&_0$$6); + object_init_ex(&_0$$6, phalcon_logger_exception_ce); + ZEPHIR_INIT_VAR(&_1$$6); + ZEPHIR_CONCAT_SVS(&_1$$6, "Can't open stream '", &name, "'"); + ZEPHIR_CALL_METHOD(NULL, &_0$$6, "__construct", NULL, 4, &_1$$6); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$6, "phalcon/logger/adapter/stream.zep", 76 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$6, "phalcon/logger/adapter/stream.zep", 76 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_update_property_this(getThis(), SL("_stream"), stream TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stream"), &stream); ZEPHIR_MM_RESTORE(); } @@ -118,19 +128,23 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, __construct) { */ PHP_METHOD(Phalcon_Logger_Adapter_Stream, getFormatter) { - zval *_0, *_1$$3; + zval _0, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); - if (Z_TYPE_P(_0) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_logger_formatter_line_ce); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 312); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_logger_formatter_line_ce); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 272); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_formatter"), _1$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_formatter"), &_1$$3); } RETURN_MM_MEMBER(getThis(), "_formatter"); @@ -141,35 +155,42 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, getFormatter) { */ PHP_METHOD(Phalcon_Logger_Adapter_Stream, logInternal) { - zval *context = NULL; + zval context; zend_long type, time, ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, *stream = NULL, *_0 = NULL, *_1 = NULL, *_2, *_3; - zval *message = NULL; + zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, stream, _0, _1, _2, _3; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&stream); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &message_param, &type_param, &time_param, &context_param); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); type = zephir_get_intval(type_param); time = zephir_get_intval(time_param); - zephir_get_arrval(context, context_param); + zephir_get_arrval(&context, context_param); - ZEPHIR_OBS_VAR(stream); - zephir_read_property_this(&stream, this_ptr, SL("_stream"), PH_NOISY_CC); - if (Z_TYPE_P(stream) != IS_RESOURCE) { + ZEPHIR_OBS_VAR(&stream); + zephir_read_property(&stream, this_ptr, SL("_stream"), PH_NOISY_CC); + if (Z_TYPE_P(&stream) != IS_RESOURCE) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "Cannot send message to the log because it is invalid", "phalcon/logger/adapter/stream.zep", 103); return; } ZEPHIR_CALL_METHOD(&_0, this_ptr, "getformatter", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, type); - ZEPHIR_INIT_VAR(_3); - ZVAL_LONG(_3, time); - ZEPHIR_CALL_METHOD(&_1, _0, "format", NULL, 0, message, _2, _3, context); + ZVAL_LONG(&_2, type); + ZVAL_LONG(&_3, time); + ZEPHIR_CALL_METHOD(&_1, &_0, "format", NULL, 0, &message, &_2, &_3, &context); zephir_check_call_status(); - zephir_fwrite(NULL, stream, _1 TSRMLS_CC); + zephir_fwrite(NULL, &stream, &_1 TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -179,11 +200,14 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, logInternal) { */ PHP_METHOD(Phalcon_Logger_Adapter_Stream, close) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_stream"), PH_NOISY_CC); - RETURN_BOOL(zephir_fclose(_0 TSRMLS_CC)); + zephir_read_property(&_0, this_ptr, SL("_stream"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_fclose(&_0 TSRMLS_CC)); } diff --git a/ext/phalcon/logger/adapter/stream.zep.h b/ext/phalcon/logger/adapter/stream.zep.h index 918c7780ddc..beddd17336d 100644 --- a/ext/phalcon/logger/adapter/stream.zep.h +++ b/ext/phalcon/logger/adapter/stream.zep.h @@ -9,21 +9,51 @@ PHP_METHOD(Phalcon_Logger_Adapter_Stream, logInternal); PHP_METHOD(Phalcon_Logger_Adapter_Stream, close); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_stream___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_stream_getformatter, 0, 0, Phalcon\\Logger\\FormatterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_stream_getformatter, 0, 0, IS_OBJECT, "Phalcon\\Logger\\FormatterInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_stream_loginternal, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, time, IS_LONG, 0) +#else ZEND_ARG_INFO(0, time) +#endif ZEND_ARG_ARRAY_INFO(0, context, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_stream_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_stream_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_logger_adapter_stream_method_entry) { PHP_ME(Phalcon_Logger_Adapter_Stream, __construct, arginfo_phalcon_logger_adapter_stream___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Logger_Adapter_Stream, getFormatter, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_Stream, getFormatter, arginfo_phalcon_logger_adapter_stream_getformatter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter_Stream, logInternal, arginfo_phalcon_logger_adapter_stream_loginternal, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter_Stream, close, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_Stream, close, arginfo_phalcon_logger_adapter_stream_close, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/logger/adapter/syslog.zep.c b/ext/phalcon/logger/adapter/syslog.zep.c index da40386c275..d21fd904945 100644 --- a/ext/phalcon/logger/adapter/syslog.zep.c +++ b/ext/phalcon/logger/adapter/syslog.zep.c @@ -62,33 +62,43 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Adapter_Syslog) { PHP_METHOD(Phalcon_Logger_Adapter_Syslog, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name, *options = NULL, *option = NULL, *facility = NULL; + zval *name, name_sub, *options = NULL, options_sub, __$true, __$false, __$null, option, facility; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&option); + ZVAL_UNDEF(&facility); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (zephir_is_true(name)) { - ZEPHIR_OBS_VAR(option); - if (!(zephir_array_isset_string_fetch(&option, options, SS("option"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(option); - ZVAL_LONG(option, 4); + ZEPHIR_OBS_VAR(&option); + if (!(zephir_array_isset_string_fetch(&option, options, SL("option"), 0))) { + ZEPHIR_INIT_NVAR(&option); + ZVAL_LONG(&option, 4); } - ZEPHIR_OBS_VAR(facility); - if (!(zephir_array_isset_string_fetch(&facility, options, SS("facility"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(facility); - ZVAL_LONG(facility, 8); + ZEPHIR_OBS_VAR(&facility); + if (!(zephir_array_isset_string_fetch(&facility, options, SL("facility"), 0))) { + ZEPHIR_INIT_NVAR(&facility); + ZVAL_LONG(&facility, 8); } - ZEPHIR_CALL_FUNCTION(NULL, "openlog", NULL, 313, name, option, facility); + ZEPHIR_CALL_FUNCTION(NULL, "openlog", NULL, 273, name, &option, &facility); zephir_check_call_status(); if (1) { - zephir_update_property_this(getThis(), SL("_opened"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_opened"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_opened"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_opened"), &__$false); } } ZEPHIR_MM_RESTORE(); @@ -100,21 +110,25 @@ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, __construct) { */ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, getFormatter) { - zval *_0, *_1$$3; + zval _0, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); - if (Z_TYPE_P(_0) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_logger_formatter_syslog_ce); - if (zephir_has_constructor(_1$$3 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_formatter"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_logger_formatter_syslog_ce); + if (zephir_has_constructor(&_1$$3 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_formatter"), _1$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_formatter"), &_1$$3); } RETURN_MM_MEMBER(getThis(), "_formatter"); @@ -125,35 +139,43 @@ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, getFormatter) { */ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, logInternal) { - zval *context = NULL; + zval context; zend_long type, time, ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, *appliedFormat = NULL, *_0 = NULL, *_1, *_2, *_3, *_4; - zval *message = NULL; + zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context_param = NULL, appliedFormat, _0, _1, _2, _3, _4; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&appliedFormat); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &message_param, &type_param, &time_param, &context_param); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); type = zephir_get_intval(type_param); time = zephir_get_intval(time_param); - zephir_get_arrval(context, context_param); + zephir_get_arrval(&context, context_param); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getformatter", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, type); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, time); - ZEPHIR_CALL_METHOD(&appliedFormat, _0, "format", NULL, 0, message, _1, _2, context); + ZVAL_LONG(&_1, type); + ZVAL_LONG(&_2, time); + ZEPHIR_CALL_METHOD(&appliedFormat, &_0, "format", NULL, 0, &message, &_1, &_2, &context); zephir_check_call_status(); - if (Z_TYPE_P(appliedFormat) != IS_ARRAY) { + if (Z_TYPE_P(&appliedFormat) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_logger_exception_ce, "The formatted message is not valid", "phalcon/logger/adapter/syslog.zep", 101); return; } - zephir_array_fetch_long(&_3, appliedFormat, 0, PH_NOISY | PH_READONLY, "phalcon/logger/adapter/syslog.zep", 104 TSRMLS_CC); - zephir_array_fetch_long(&_4, appliedFormat, 1, PH_NOISY | PH_READONLY, "phalcon/logger/adapter/syslog.zep", 104 TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(NULL, "syslog", NULL, 314, _3, _4); + zephir_array_fetch_long(&_3, &appliedFormat, 0, PH_NOISY | PH_READONLY, "phalcon/logger/adapter/syslog.zep", 104 TSRMLS_CC); + zephir_array_fetch_long(&_4, &appliedFormat, 1, PH_NOISY | PH_READONLY, "phalcon/logger/adapter/syslog.zep", 104 TSRMLS_CC); + ZEPHIR_CALL_FUNCTION(NULL, "syslog", NULL, 274, &_3, &_4); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -164,16 +186,19 @@ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, logInternal) { */ PHP_METHOD(Phalcon_Logger_Adapter_Syslog, close) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_opened"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { + zephir_read_property(&_0, this_ptr, SL("_opened"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { RETURN_MM_BOOL(1); } - ZEPHIR_RETURN_CALL_FUNCTION("closelog", NULL, 315); + ZEPHIR_RETURN_CALL_FUNCTION("closelog", NULL, 275); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/logger/adapter/syslog.zep.h b/ext/phalcon/logger/adapter/syslog.zep.h index 6f98301f4b2..878964fbf7e 100644 --- a/ext/phalcon/logger/adapter/syslog.zep.h +++ b/ext/phalcon/logger/adapter/syslog.zep.h @@ -13,17 +13,43 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_syslog___construct, 0, 0, ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapter_syslog_getformatter, 0, 0, Phalcon\\Logger\\FormatterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_syslog_getformatter, 0, 0, IS_OBJECT, "Phalcon\\Logger\\FormatterInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapter_syslog_loginternal, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, time, IS_LONG, 0) +#else ZEND_ARG_INFO(0, time) +#endif ZEND_ARG_ARRAY_INFO(0, context, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_syslog_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapter_syslog_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_logger_adapter_syslog_method_entry) { PHP_ME(Phalcon_Logger_Adapter_Syslog, __construct, arginfo_phalcon_logger_adapter_syslog___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Logger_Adapter_Syslog, getFormatter, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_Syslog, getFormatter, arginfo_phalcon_logger_adapter_syslog_getformatter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Adapter_Syslog, logInternal, arginfo_phalcon_logger_adapter_syslog_loginternal, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Adapter_Syslog, close, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Adapter_Syslog, close, arginfo_phalcon_logger_adapter_syslog_close, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/logger/adapterinterface.zep.h b/ext/phalcon/logger/adapterinterface.zep.h index ae874c470ac..945b564b854 100644 --- a/ext/phalcon/logger/adapterinterface.zep.h +++ b/ext/phalcon/logger/adapterinterface.zep.h @@ -3,65 +3,179 @@ extern zend_class_entry *phalcon_logger_adapterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Logger_AdapterInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_setformatter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_setformatter, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_setformatter, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, formatter, Phalcon\\Logger\\FormatterInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_setloglevel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_getformatter, 0, 0, Phalcon\\Logger\\FormatterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_getformatter, 0, 0, IS_OBJECT, "Phalcon\\Logger\\FormatterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_setloglevel, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_setloglevel, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) +#else ZEND_ARG_INFO(0, level) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_getloglevel, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_getloglevel, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_log, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_log, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_log, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif ZEND_ARG_INFO(0, type) ZEND_ARG_INFO(0, message) ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_debug, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_begin, 0, 0, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_begin, 0, 0, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_commit, 0, 0, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_commit, 0, 0, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_rollback, 0, 0, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_rollback, 0, 0, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_debug, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_debug, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_error, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_error, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_error, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_info, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_info, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_info, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_notice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_notice, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_notice, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_warning, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_warning, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_warning, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_alert, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_alert, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_alert, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_adapterinterface_emergency, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_adapterinterface_emergency, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_adapterinterface_emergency, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_logger_adapterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, setFormatter, arginfo_phalcon_logger_adapterinterface_setformatter) - PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, getFormatter, NULL) + PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, getFormatter, arginfo_phalcon_logger_adapterinterface_getformatter) PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, setLogLevel, arginfo_phalcon_logger_adapterinterface_setloglevel) - PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, getLogLevel, NULL) + PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, getLogLevel, arginfo_phalcon_logger_adapterinterface_getloglevel) PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, log, arginfo_phalcon_logger_adapterinterface_log) - PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, begin, NULL) - PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, commit, NULL) - PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, rollback, NULL) - PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, close, NULL) + PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, begin, arginfo_phalcon_logger_adapterinterface_begin) + PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, commit, arginfo_phalcon_logger_adapterinterface_commit) + PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, rollback, arginfo_phalcon_logger_adapterinterface_rollback) + PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, close, arginfo_phalcon_logger_adapterinterface_close) PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, debug, arginfo_phalcon_logger_adapterinterface_debug) PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, error, arginfo_phalcon_logger_adapterinterface_error) PHP_ABSTRACT_ME(Phalcon_Logger_AdapterInterface, info, arginfo_phalcon_logger_adapterinterface_info) diff --git a/ext/phalcon/logger/factory.zep.c b/ext/phalcon/logger/factory.zep.c index 5a252c29ef8..9fafecb9675 100644 --- a/ext/phalcon/logger/factory.zep.c +++ b/ext/phalcon/logger/factory.zep.c @@ -49,17 +49,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Factory) { PHP_METHOD(Phalcon_Logger_Factory, load) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *_0; + zval *config, config_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Phalcon\\Logger\\Adapter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, _0, config); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Phalcon\\Logger\\Adapter"); + ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, &_0, config); zephir_check_call_status(); RETURN_MM(); @@ -70,13 +73,24 @@ PHP_METHOD(Phalcon_Logger_Factory, loadClass) { zend_class_entry *_6$$5, *_4$$6; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *namespace_param = NULL, *config = NULL, *adapter = NULL, *className = NULL, *name = NULL, *_1$$3 = NULL, *_2$$5, *_5$$5 = NULL, *_3$$6 = NULL; - zval *namespace = NULL; + zval *namespace_param = NULL, *config = NULL, config_sub, adapter, className, name, _1$$3, _2$$5, _5$$5, _3$$6; + zval namespace; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespace); + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&adapter); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_3$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &namespace_param, &config); - zephir_get_strval(namespace, namespace_param); + zephir_get_strval(&namespace, namespace_param); ZEPHIR_SEPARATE_PARAM(config); @@ -87,37 +101,37 @@ PHP_METHOD(Phalcon_Logger_Factory, loadClass) { if (_0) { ZEPHIR_CALL_METHOD(&_1$$3, config, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(config, _1$$3); + ZEPHIR_CPY_WRT(config, &_1$$3); } if (Z_TYPE_P(config) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "Config must be array or Phalcon\\Config object", "phalcon/logger/factory.zep", 59); return; } - ZEPHIR_OBS_VAR(adapter); - if (zephir_array_isset_string_fetch(&adapter, config, SS("adapter"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_2$$5); - zephir_camelize(_2$$5, adapter, NULL ); - ZEPHIR_INIT_VAR(className); - ZEPHIR_CONCAT_VSV(className, namespace, "\\", _2$$5); - if (!ZEPHIR_IS_STRING(className, "Phalcon\\Logger\\Adapter\\Firephp")) { - zephir_array_unset_string(&config, SS("adapter"), PH_SEPARATE); - ZEPHIR_OBS_VAR(name); - if (!(zephir_array_isset_string_fetch(&name, config, SS("name"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&adapter); + if (zephir_array_isset_string_fetch(&adapter, config, SL("adapter"), 0)) { + ZEPHIR_INIT_VAR(&_2$$5); + zephir_camelize(&_2$$5, &adapter, NULL ); + ZEPHIR_INIT_VAR(&className); + ZEPHIR_CONCAT_VSV(&className, &namespace, "\\", &_2$$5); + if (!ZEPHIR_IS_STRING(&className, "Phalcon\\Logger\\Adapter\\Firephp")) { + zephir_array_unset_string(config, SL("adapter"), PH_SEPARATE); + ZEPHIR_OBS_VAR(&name); + if (!(zephir_array_isset_string_fetch(&name, config, SL("name"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_factory_exception_ce, "You must provide 'name' option in factory config parameter.", "phalcon/logger/factory.zep", 68); return; } - zephir_array_unset_string(&config, SS("name"), PH_SEPARATE); - zephir_fetch_safe_class(_3$$6, className); - _4$$6 = zend_fetch_class(Z_STRVAL_P(_3$$6), Z_STRLEN_P(_3$$6), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + zephir_array_unset_string(config, SL("name"), PH_SEPARATE); + zephir_fetch_safe_class(&_3$$6, &className); + _4$$6 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_3$$6), Z_STRLEN_P(&_3$$6), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _4$$6); if (zephir_has_constructor(return_value TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, name, config); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &name, config); zephir_check_call_status(); } RETURN_MM(); } - zephir_fetch_safe_class(_5$$5, className); - _6$$5 = zend_fetch_class(Z_STRVAL_P(_5$$5), Z_STRLEN_P(_5$$5), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + zephir_fetch_safe_class(&_5$$5, &className); + _6$$5 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_5$$5), Z_STRLEN_P(&_5$$5), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _6$$5); if (zephir_has_constructor(return_value TSRMLS_CC)) { ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0); diff --git a/ext/phalcon/logger/factory.zep.h b/ext/phalcon/logger/factory.zep.h index 9dddf72dc91..2743883cc02 100644 --- a/ext/phalcon/logger/factory.zep.h +++ b/ext/phalcon/logger/factory.zep.h @@ -6,12 +6,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Factory); PHP_METHOD(Phalcon_Logger_Factory, load); PHP_METHOD(Phalcon_Logger_Factory, loadClass); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_factory_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_factory_load, 0, 1, Phalcon\\Logger\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_factory_load, 0, 1, IS_OBJECT, "Phalcon\\Logger\\AdapterInterface", 0) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_factory_loadclass, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespace, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespace) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/logger/formatter.zep.c b/ext/phalcon/logger/formatter.zep.c index 6d11950a1c9..decc4b2ad4e 100644 --- a/ext/phalcon/logger/formatter.zep.c +++ b/ext/phalcon/logger/formatter.zep.c @@ -40,6 +40,8 @@ PHP_METHOD(Phalcon_Logger_Formatter, getTypeString) { zval *type_param = NULL; zend_long type; + zval *this_ptr = getThis(); + zephir_fetch_params(0, 1, 0, &type_param); @@ -48,38 +50,38 @@ PHP_METHOD(Phalcon_Logger_Formatter, getTypeString) { do { if (type == 7) { - RETURN_STRING("DEBUG", 1); + RETURN_STRING("DEBUG"); } if (type == 3) { - RETURN_STRING("ERROR", 1); + RETURN_STRING("ERROR"); } if (type == 4) { - RETURN_STRING("WARNING", 1); + RETURN_STRING("WARNING"); } if (type == 1) { - RETURN_STRING("CRITICAL", 1); + RETURN_STRING("CRITICAL"); } if (type == 8) { - RETURN_STRING("CUSTOM", 1); + RETURN_STRING("CUSTOM"); } if (type == 2) { - RETURN_STRING("ALERT", 1); + RETURN_STRING("ALERT"); } if (type == 5) { - RETURN_STRING("NOTICE", 1); + RETURN_STRING("NOTICE"); } if (type == 6) { - RETURN_STRING("INFO", 1); + RETURN_STRING("INFO"); } if (type == 0) { - RETURN_STRING("EMERGENCY", 1); + RETURN_STRING("EMERGENCY"); } if (type == 9) { - RETURN_STRING("SPECIAL", 1); + RETURN_STRING("SPECIAL"); } } while(0); - RETURN_STRING("CUSTOM", 1); + RETURN_STRING("CUSTOM"); } @@ -92,19 +94,29 @@ PHP_METHOD(Phalcon_Logger_Formatter, getTypeString) { */ PHP_METHOD(Phalcon_Logger_Formatter, interpolate) { - HashTable *_2$$3; - HashPosition _1$$3; + zend_string *_3$$3; + zend_ulong _2$$3; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *context = NULL, *replace = NULL, *key = NULL, *value = NULL, **_3$$3, *_4$$4 = NULL; - zval *message = NULL; + zval *message_param = NULL, *context = NULL, context_sub, __$null, replace, key, value, *_1$$3, _4$$4; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&replace); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); if (!context) { - context = ZEPHIR_GLOBAL(global_null); + context = &context_sub; + context = &__$null; } @@ -113,24 +125,30 @@ PHP_METHOD(Phalcon_Logger_Formatter, interpolate) { _0 = zephir_fast_count_int(context TSRMLS_CC) > 0; } if (_0) { - ZEPHIR_INIT_VAR(replace); - array_init(replace); - zephir_is_iterable(context, &_2$$3, &_1$$3, 0, 0, "phalcon/logger/formatter.zep", 89); - for ( - ; zend_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS - ; zend_hash_move_forward_ex(_2$$3, &_1$$3) - ) { - ZEPHIR_GET_HMKEY(key, _2$$3, _1$$3); - ZEPHIR_GET_HVALUE(value, _3$$3); + ZEPHIR_INIT_VAR(&replace); + array_init(&replace); + zephir_is_iterable(context, 0, "phalcon/logger/formatter.zep", 89); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(context), _2$$3, _3$$3, _1$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_3$$3 != NULL) { + ZVAL_STR_COPY(&key, _3$$3); + } else { + ZVAL_LONG(&key, _2$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1$$3); ZEPHIR_INIT_LNVAR(_4$$4); - ZEPHIR_CONCAT_SVS(_4$$4, "{", key, "}"); - zephir_array_update_zval(&replace, _4$$4, &value, PH_COPY | PH_SEPARATE); - } - ZEPHIR_RETURN_CALL_FUNCTION("strtr", NULL, 27, message, replace); + ZEPHIR_CONCAT_SVS(&_4$$4, "{", &key, "}"); + zephir_array_update_zval(&replace, &_4$$4, &value, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_RETURN_CALL_FUNCTION("strtr", NULL, 22, &message, &replace); zephir_check_call_status(); RETURN_MM(); } - RETURN_CTOR(message); + RETURN_CTOR(&message); } diff --git a/ext/phalcon/logger/formatter.zep.h b/ext/phalcon/logger/formatter.zep.h index 8cac244a78a..16149b1f63d 100644 --- a/ext/phalcon/logger/formatter.zep.h +++ b/ext/phalcon/logger/formatter.zep.h @@ -6,12 +6,24 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter); PHP_METHOD(Phalcon_Logger_Formatter, getTypeString); PHP_METHOD(Phalcon_Logger_Formatter, interpolate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_gettypestring, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_gettypestring, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_gettypestring, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_interpolate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/logger/formatter/firephp.zep.c b/ext/phalcon/logger/formatter/firephp.zep.c index 5cf91297d12..1b2b5e6a8b0 100644 --- a/ext/phalcon/logger/formatter/firephp.zep.c +++ b/ext/phalcon/logger/formatter/firephp.zep.c @@ -47,6 +47,8 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, getTypeString) { zval *type_param = NULL; zend_long type; + zval *this_ptr = getThis(); + zephir_fetch_params(0, 1, 0, &type_param); @@ -55,20 +57,20 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, getTypeString) { do { if (type == 0 || type == 1 || type == 3) { - RETURN_STRING("ERROR", 1); + RETURN_STRING("ERROR"); } if (type == 2 || type == 4) { - RETURN_STRING("WARN", 1); + RETURN_STRING("WARN"); } if (type == 6 || type == 5 || type == 8) { - RETURN_STRING("INFO", 1); + RETURN_STRING("INFO"); } if (type == 7 || type == 9) { - RETURN_STRING("LOG", 1); + RETURN_STRING("LOG"); } } while(0); - RETURN_STRING("CUSTOM", 1); + RETURN_STRING("CUSTOM"); } @@ -77,8 +79,12 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, getTypeString) { */ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, setShowBacktrace) { - zval *isShow_param = NULL; + zval *isShow_param = NULL, __$true, __$false; zend_bool isShow; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 0, 1, &isShow_param); @@ -90,9 +96,9 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, setShowBacktrace) { if (isShow) { - zephir_update_property_this(getThis(), SL("_showBacktrace"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_showBacktrace"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_showBacktrace"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_showBacktrace"), &__$false); } RETURN_THISW(); @@ -103,7 +109,8 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, setShowBacktrace) { */ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, getShowBacktrace) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_showBacktrace"); @@ -114,8 +121,12 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, getShowBacktrace) { */ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, enableLabels) { - zval *isEnable_param = NULL; + zval *isEnable_param = NULL, __$true, __$false; zend_bool isEnable; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 0, 1, &isEnable_param); @@ -127,9 +138,9 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, enableLabels) { if (isEnable) { - zephir_update_property_this(getThis(), SL("_enableLabels"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_enableLabels"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_enableLabels"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_enableLabels"), &__$false); } RETURN_THISW(); @@ -140,7 +151,8 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, enableLabels) { */ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, labelsEnabled) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_enableLabels"); @@ -158,111 +170,142 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, labelsEnabled) { */ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, format) { - HashTable *_7$$4; - HashPosition _6$$4; - zval *_18; - zend_bool _11, _14; + zend_string *_7$$4; + zend_ulong _6$$4; + zval _17; + zend_bool _10, _13; zend_long type, timestamp, ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, *meta = NULL, *body = NULL, *backtrace = NULL, *encoded = NULL, *len = NULL, *lastTrace = NULL, *_1 = NULL, *_2, *_3, *_9, *_10, *_12, *_13, *_15, *_0$$3 = NULL, *param$$4 = NULL, *backtraceItem$$4 = NULL, *key$$4 = NULL, **_8$$4, *_4$$5, *_5$$6, *_16$$11, *_17$$11; - zval *message = NULL; + zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, context_sub, __$null, meta, body, backtrace, encoded, len, lastTrace, _1, _2, _8, _9, _11, _12, _14, _0$$3, param$$4, backtraceItem$$4, key$$4, *_5$$4, _3$$5, _4$$6, _15$$11, _16$$11; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&meta); + ZVAL_UNDEF(&body); + ZVAL_UNDEF(&backtrace); + ZVAL_UNDEF(&encoded); + ZVAL_UNDEF(&len); + ZVAL_UNDEF(&lastTrace); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(¶m$$4); + ZVAL_UNDEF(&backtraceItem$$4); + ZVAL_UNDEF(&key$$4); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_15$$11); + ZVAL_UNDEF(&_16$$11); + ZVAL_UNDEF(&_17); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &message_param, &type_param, ×tamp_param, &context); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); type = zephir_get_intval(type_param); timestamp = zephir_get_intval(timestamp_param); if (!context) { - context = ZEPHIR_GLOBAL(global_null); + context = &context_sub; + context = &__$null; } if (Z_TYPE_P(context) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "interpolate", NULL, 0, message, context); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "interpolate", NULL, 0, &message, context); zephir_check_call_status(); - zephir_get_strval(message, _0$$3); + zephir_get_strval(&message, &_0$$3); } - ZEPHIR_INIT_VAR(meta); - zephir_create_array(meta, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, type); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "gettypestring", NULL, 0, _2); + ZEPHIR_INIT_VAR(&meta); + zephir_create_array(&meta, 1, 0 TSRMLS_CC); + ZVAL_LONG(&_2, type); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "gettypestring", NULL, 0, &_2); zephir_check_call_status(); zephir_array_update_string(&meta, SL("Type"), &_1, PH_COPY | PH_SEPARATE); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC); - if (zephir_is_true(_3)) { - ZEPHIR_INIT_VAR(param$$4); - ZVAL_LONG(param$$4, 2); - ZEPHIR_CALL_FUNCTION(&backtrace, "debug_backtrace", NULL, 176, param$$4); + zephir_read_property(&_2, this_ptr, SL("_showBacktrace"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_2)) { + ZEPHIR_INIT_VAR(¶m$$4); + ZVAL_LONG(¶m$$4, 2); + ZEPHIR_CALL_FUNCTION(&backtrace, "debug_backtrace", NULL, 156, ¶m$$4); zephir_check_call_status(); - ZEPHIR_MAKE_REF(backtrace); - ZEPHIR_CALL_FUNCTION(&lastTrace, "end", NULL, 316, backtrace); - ZEPHIR_UNREF(backtrace); + ZEPHIR_MAKE_REF(&backtrace); + ZEPHIR_CALL_FUNCTION(&lastTrace, "end", NULL, 276, &backtrace); + ZEPHIR_UNREF(&backtrace); zephir_check_call_status(); - if (zephir_array_isset_string(lastTrace, SS("file"))) { - zephir_array_fetch_string(&_4$$5, lastTrace, SL("file"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 130 TSRMLS_CC); - zephir_array_update_string(&meta, SL("File"), &_4$$5, PH_COPY | PH_SEPARATE); - } - if (zephir_array_isset_string(lastTrace, SS("line"))) { - zephir_array_fetch_string(&_5$$6, lastTrace, SL("line"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 134 TSRMLS_CC); - zephir_array_update_string(&meta, SL("Line"), &_5$$6, PH_COPY | PH_SEPARATE); + if (zephir_array_isset_string(&lastTrace, SL("file"))) { + zephir_array_fetch_string(&_3$$5, &lastTrace, SL("file"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 130 TSRMLS_CC); + zephir_array_update_string(&meta, SL("File"), &_3$$5, PH_COPY | PH_SEPARATE); } - zephir_is_iterable(backtrace, &_7$$4, &_6$$4, 1, 0, "phalcon/logger/formatter/firephp.zep", 143); - for ( - ; zend_hash_get_current_data_ex(_7$$4, (void**) &_8$$4, &_6$$4) == SUCCESS - ; zend_hash_move_forward_ex(_7$$4, &_6$$4) - ) { - ZEPHIR_GET_HMKEY(key$$4, _7$$4, _6$$4); - ZEPHIR_GET_HVALUE(backtraceItem$$4, _8$$4); - zephir_array_unset_string(&backtraceItem$$4, SS("object"), PH_SEPARATE); - zephir_array_unset_string(&backtraceItem$$4, SS("args"), PH_SEPARATE); - zephir_array_update_zval(&backtrace, key$$4, &backtraceItem$$4, PH_COPY | PH_SEPARATE); + if (zephir_array_isset_string(&lastTrace, SL("line"))) { + zephir_array_fetch_string(&_4$$6, &lastTrace, SL("line"), PH_NOISY | PH_READONLY, "phalcon/logger/formatter/firephp.zep", 134 TSRMLS_CC); + zephir_array_update_string(&meta, SL("Line"), &_4$$6, PH_COPY | PH_SEPARATE); } - zend_hash_destroy(_7$$4); - FREE_HASHTABLE(_7$$4); + zephir_is_iterable(&backtrace, 1, "phalcon/logger/formatter/firephp.zep", 143); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&backtrace), _6$$4, _7$$4, _5$$4) + { + ZEPHIR_INIT_NVAR(&key$$4); + if (_7$$4 != NULL) { + ZVAL_STR_COPY(&key$$4, _7$$4); + } else { + ZVAL_LONG(&key$$4, _6$$4); + } + ZEPHIR_INIT_NVAR(&backtraceItem$$4); + ZVAL_COPY(&backtraceItem$$4, _5$$4); + zephir_array_unset_string(&backtraceItem$$4, SL("object"), PH_SEPARATE); + zephir_array_unset_string(&backtraceItem$$4, SL("args"), PH_SEPARATE); + zephir_array_update_zval(&backtrace, &key$$4, &backtraceItem$$4, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&backtraceItem$$4); + ZEPHIR_INIT_NVAR(&key$$4); } - _9 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC); - if (zephir_is_true(_9)) { + zephir_read_property(&_8, this_ptr, SL("_enableLabels"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_8)) { zephir_array_update_string(&meta, SL("Label"), &message, PH_COPY | PH_SEPARATE); } - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC); - _11 = !zephir_is_true(_10); - if (_11) { - _12 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC); - _11 = !zephir_is_true(_12); + zephir_read_property(&_9, this_ptr, SL("_enableLabels"), PH_NOISY_CC | PH_READONLY); + _10 = !zephir_is_true(&_9); + if (_10) { + zephir_read_property(&_11, this_ptr, SL("_showBacktrace"), PH_NOISY_CC | PH_READONLY); + _10 = !zephir_is_true(&_11); } - _13 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC); - _14 = zephir_is_true(_13); - if (_14) { - _15 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC); - _14 = !zephir_is_true(_15); + zephir_read_property(&_12, this_ptr, SL("_enableLabels"), PH_NOISY_CC | PH_READONLY); + _13 = zephir_is_true(&_12); + if (_13) { + zephir_read_property(&_14, this_ptr, SL("_showBacktrace"), PH_NOISY_CC | PH_READONLY); + _13 = !zephir_is_true(&_14); } - if (_11) { - ZEPHIR_CPY_WRT(body, message); - } else if (_14) { - ZEPHIR_INIT_NVAR(body); - ZVAL_STRING(body, "", 1); + if (_10) { + ZEPHIR_CPY_WRT(&body, &message); + } else if (_13) { + ZEPHIR_INIT_NVAR(&body); + ZVAL_STRING(&body, ""); } else { - ZEPHIR_INIT_NVAR(body); - array_init(body); - _16$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_showBacktrace"), PH_NOISY_CC); - if (zephir_is_true(_16$$11)) { + ZEPHIR_INIT_NVAR(&body); + array_init(&body); + zephir_read_property(&_15$$11, this_ptr, SL("_showBacktrace"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_15$$11)) { zephir_array_update_string(&body, SL("backtrace"), &backtrace, PH_COPY | PH_SEPARATE); } - _17$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_enableLabels"), PH_NOISY_CC); - if (!(zephir_is_true(_17$$11))) { + zephir_read_property(&_16$$11, this_ptr, SL("_enableLabels"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_16$$11))) { zephir_array_update_string(&body, SL("message"), &message, PH_COPY | PH_SEPARATE); } } - ZEPHIR_INIT_VAR(_18); - zephir_create_array(_18, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_18, meta); - zephir_array_fast_append(_18, body); - ZEPHIR_INIT_VAR(encoded); - zephir_json_encode(encoded, &(encoded), _18, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(len); - ZVAL_LONG(len, zephir_fast_strlen_ev(encoded)); - ZEPHIR_CONCAT_VSVS(return_value, len, "|", encoded, "|"); + ZEPHIR_INIT_VAR(&_17); + zephir_create_array(&_17, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_17, &meta); + zephir_array_fast_append(&_17, &body); + ZEPHIR_INIT_VAR(&encoded); + zephir_json_encode(&encoded, &_17, 0 ); + ZEPHIR_INIT_VAR(&len); + ZVAL_LONG(&len, zephir_fast_strlen_ev(&encoded)); + ZEPHIR_CONCAT_VSVS(return_value, &len, "|", &encoded, "|"); RETURN_MM(); } diff --git a/ext/phalcon/logger/formatter/firephp.zep.h b/ext/phalcon/logger/formatter/firephp.zep.h index a1b925c7ec2..ce438f95efa 100644 --- a/ext/phalcon/logger/formatter/firephp.zep.h +++ b/ext/phalcon/logger/formatter/firephp.zep.h @@ -10,31 +10,85 @@ PHP_METHOD(Phalcon_Logger_Formatter_Firephp, enableLabels); PHP_METHOD(Phalcon_Logger_Formatter_Firephp, labelsEnabled); PHP_METHOD(Phalcon_Logger_Formatter_Firephp, format); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_firephp_gettypestring, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_gettypestring, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_gettypestring, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_firephp_setshowbacktrace, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_formatter_firephp_setshowbacktrace, 0, 0, Phalcon\\Logger\\Formatter\\Firephp, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_setshowbacktrace, 0, 0, IS_OBJECT, "Phalcon\\Logger\\Formatter\\Firephp", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, isShow, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, isShow) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_firephp_enablelabels, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_getshowbacktrace, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_getshowbacktrace, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_logger_formatter_firephp_enablelabels, 0, 0, Phalcon\\Logger\\Formatter\\Firephp, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_enablelabels, 0, 0, IS_OBJECT, "Phalcon\\Logger\\Formatter\\Firephp", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, isEnable, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, isEnable) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_labelsenabled, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_labelsenabled, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_firephp_format, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_format, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_firephp_format, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) +#else ZEND_ARG_INFO(0, timestamp) +#endif ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_logger_formatter_firephp_method_entry) { PHP_ME(Phalcon_Logger_Formatter_Firephp, getTypeString, arginfo_phalcon_logger_formatter_firephp_gettypestring, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Formatter_Firephp, setShowBacktrace, arginfo_phalcon_logger_formatter_firephp_setshowbacktrace, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Formatter_Firephp, getShowBacktrace, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Formatter_Firephp, getShowBacktrace, arginfo_phalcon_logger_formatter_firephp_getshowbacktrace, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Formatter_Firephp, enableLabels, arginfo_phalcon_logger_formatter_firephp_enablelabels, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Formatter_Firephp, labelsEnabled, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Formatter_Firephp, labelsEnabled, arginfo_phalcon_logger_formatter_firephp_labelsenabled, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Formatter_Firephp, format, arginfo_phalcon_logger_formatter_firephp_format, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/logger/formatter/json.zep.c b/ext/phalcon/logger/formatter/json.zep.c index e4d527c714f..65912e5d00c 100644 --- a/ext/phalcon/logger/formatter/json.zep.c +++ b/ext/phalcon/logger/formatter/json.zep.c @@ -44,43 +44,54 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_Json) { */ PHP_METHOD(Phalcon_Logger_Formatter_Json, format) { - zval *_2; + zval _2; zend_long type, timestamp, ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, *_0$$3 = NULL, *_1, *_3 = NULL, *_4 = NULL; - zval *message = NULL; + zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, context_sub, __$null, _0$$3, _1, _3, _4, _5; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &message_param, &type_param, ×tamp_param, &context); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); type = zephir_get_intval(type_param); timestamp = zephir_get_intval(timestamp_param); if (!context) { - context = ZEPHIR_GLOBAL(global_null); + context = &context_sub; + context = &__$null; } if (Z_TYPE_P(context) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "interpolate", NULL, 0, message, context); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "interpolate", NULL, 0, &message, context); zephir_check_call_status(); - zephir_get_strval(message, _0$$3); + zephir_get_strval(&message, &_0$$3); } - ZEPHIR_INIT_VAR(_1); - ZEPHIR_INIT_VAR(_2); - zephir_create_array(_2, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_4); - ZVAL_LONG(_4, type); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "gettypestring", NULL, 0, _4); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_INIT_VAR(&_2); + zephir_create_array(&_2, 3, 0 TSRMLS_CC); + ZVAL_LONG(&_4, type); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "gettypestring", NULL, 0, &_4); zephir_check_call_status(); zephir_array_update_string(&_2, SL("type"), &_3, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_2, SL("message"), &message, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, timestamp); - zephir_array_update_string(&_2, SL("timestamp"), &_4, PH_COPY | PH_SEPARATE); - zephir_json_encode(_1, &(_1), _2, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_4); - ZEPHIR_GET_CONSTANT(_4, "PHP_EOL"); - ZEPHIR_CONCAT_VV(return_value, _1, _4); + ZEPHIR_INIT_VAR(&_5); + ZVAL_LONG(&_5, timestamp); + zephir_array_update_string(&_2, SL("timestamp"), &_5, PH_COPY | PH_SEPARATE); + zephir_json_encode(&_1, &_2, 0 ); + ZEPHIR_INIT_NVAR(&_5); + ZEPHIR_GET_CONSTANT(&_5, "PHP_EOL"); + ZEPHIR_CONCAT_VV(return_value, &_1, &_5); RETURN_MM(); } diff --git a/ext/phalcon/logger/formatter/json.zep.h b/ext/phalcon/logger/formatter/json.zep.h index f903c8250d0..897a7694e9e 100644 --- a/ext/phalcon/logger/formatter/json.zep.h +++ b/ext/phalcon/logger/formatter/json.zep.h @@ -5,10 +5,26 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_Json); PHP_METHOD(Phalcon_Logger_Formatter_Json, format); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_json_format, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_json_format, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_json_format, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) +#else ZEND_ARG_INFO(0, timestamp) +#endif ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/logger/formatter/line.zep.c b/ext/phalcon/logger/formatter/line.zep.c index 060fc64f9ec..f4146a5022b 100644 --- a/ext/phalcon/logger/formatter/line.zep.c +++ b/ext/phalcon/logger/formatter/line.zep.c @@ -52,7 +52,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_Line) { */ PHP_METHOD(Phalcon_Logger_Formatter_Line, getDateFormat) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dateFormat"); @@ -64,15 +65,18 @@ PHP_METHOD(Phalcon_Logger_Formatter_Line, getDateFormat) { PHP_METHOD(Phalcon_Logger_Formatter_Line, setDateFormat) { zval *dateFormat_param = NULL; - zval *dateFormat = NULL; + zval dateFormat; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dateFormat); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &dateFormat_param); - zephir_get_strval(dateFormat, dateFormat_param); + zephir_get_strval(&dateFormat, dateFormat_param); - zephir_update_property_this(getThis(), SL("_dateFormat"), dateFormat TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dateFormat"), &dateFormat); RETURN_THIS(); } @@ -82,7 +86,8 @@ PHP_METHOD(Phalcon_Logger_Formatter_Line, setDateFormat) { */ PHP_METHOD(Phalcon_Logger_Formatter_Line, getFormat) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_format"); @@ -94,15 +99,18 @@ PHP_METHOD(Phalcon_Logger_Formatter_Line, getFormat) { PHP_METHOD(Phalcon_Logger_Formatter_Line, setFormat) { zval *format_param = NULL; - zval *format = NULL; + zval format; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&format); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &format_param); - zephir_get_strval(format, format_param); + zephir_get_strval(&format, format_param); - zephir_update_property_this(getThis(), SL("_format"), format TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_format"), &format); RETURN_THIS(); } @@ -115,23 +123,30 @@ PHP_METHOD(Phalcon_Logger_Formatter_Line, setFormat) { */ PHP_METHOD(Phalcon_Logger_Formatter_Line, __construct) { - zval *format = NULL, *dateFormat = NULL; + zval *format = NULL, format_sub, *dateFormat = NULL, dateFormat_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&format_sub); + ZVAL_UNDEF(&dateFormat_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 2, &format, &dateFormat); if (!format) { - format = ZEPHIR_GLOBAL(global_null); + format = &format_sub; + format = &__$null; } if (!dateFormat) { - dateFormat = ZEPHIR_GLOBAL(global_null); + dateFormat = &dateFormat_sub; + dateFormat = &__$null; } if (zephir_is_true(format)) { - zephir_update_property_this(getThis(), SL("_format"), format TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_format"), format); } if (zephir_is_true(dateFormat)) { - zephir_update_property_this(getThis(), SL("_dateFormat"), dateFormat TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dateFormat"), dateFormat); } } @@ -148,60 +163,78 @@ PHP_METHOD(Phalcon_Logger_Formatter_Line, __construct) { PHP_METHOD(Phalcon_Logger_Formatter_Line, format) { zend_long type, timestamp, ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, *format = NULL, *_8, _9, *_10, *_11, *_0$$3, *_1$$3, _2$$3 = zval_used_for_init, *_3$$3 = NULL, *_4$$4, *_5$$4 = NULL, *_6$$4, _7$$4; - zval *message = NULL; + zval *message_param = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, context_sub, __$null, format, _9, _10, _11, _12, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3, _5$$4, _6$$4, _7$$4, _8$$4; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&format); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &message_param, &type_param, ×tamp_param, &context); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); type = zephir_get_intval(type_param); timestamp = zephir_get_intval(timestamp_param); if (!context) { - context = ZEPHIR_GLOBAL(global_null); + context = &context_sub; + context = &__$null; } - ZEPHIR_OBS_VAR(format); - zephir_read_property_this(&format, this_ptr, SL("_format"), PH_NOISY_CC); - if (zephir_memnstr_str(format, SL("%date%"), "phalcon/logger/formatter/line.zep", 80)) { - ZEPHIR_INIT_VAR(_0$$3); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dateFormat"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_2$$3); + ZEPHIR_OBS_VAR(&format); + zephir_read_property(&format, this_ptr, SL("_format"), PH_NOISY_CC); + if (zephir_memnstr_str(&format, SL("%date%"), "phalcon/logger/formatter/line.zep", 80)) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_read_property(&_1$$3, this_ptr, SL("_dateFormat"), PH_NOISY_CC | PH_READONLY); ZVAL_LONG(&_2$$3, timestamp); - ZEPHIR_CALL_FUNCTION(&_3$$3, "date", NULL, 317, _1$$3, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "date", NULL, 277, &_1$$3, &_2$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_2$$3); - ZVAL_STRING(&_2$$3, "%date%", 0); - zephir_fast_str_replace(&_0$$3, &_2$$3, _3$$3, format TSRMLS_CC); - ZEPHIR_CPY_WRT(format, _0$$3); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "%date%"); + zephir_fast_str_replace(&_0$$3, &_4$$3, &_3$$3, &format TSRMLS_CC); + ZEPHIR_CPY_WRT(&format, &_0$$3); } - if (zephir_memnstr_str(format, SL("%type%"), "phalcon/logger/formatter/line.zep", 87)) { - ZEPHIR_INIT_VAR(_4$$4); - ZEPHIR_INIT_VAR(_6$$4); - ZVAL_LONG(_6$$4, type); - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "gettypestring", NULL, 0, _6$$4); + if (zephir_memnstr_str(&format, SL("%type%"), "phalcon/logger/formatter/line.zep", 87)) { + ZEPHIR_INIT_VAR(&_5$$4); + ZVAL_LONG(&_7$$4, type); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "gettypestring", NULL, 0, &_7$$4); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_7$$4); - ZVAL_STRING(&_7$$4, "%type%", 0); - zephir_fast_str_replace(&_4$$4, &_7$$4, _5$$4, format TSRMLS_CC); - ZEPHIR_CPY_WRT(format, _4$$4); + ZEPHIR_INIT_VAR(&_8$$4); + ZVAL_STRING(&_8$$4, "%type%"); + zephir_fast_str_replace(&_5$$4, &_8$$4, &_6$$4, &format TSRMLS_CC); + ZEPHIR_CPY_WRT(&format, &_5$$4); } - ZEPHIR_INIT_VAR(_8); - ZEPHIR_SINIT_VAR(_9); - ZVAL_STRING(&_9, "%message%", 0); - zephir_fast_str_replace(&_8, &_9, message, format TSRMLS_CC); - ZEPHIR_INIT_VAR(_10); - ZEPHIR_GET_CONSTANT(_10, "PHP_EOL"); - ZEPHIR_INIT_VAR(_11); - ZEPHIR_CONCAT_VV(_11, _8, _10); - ZEPHIR_CPY_WRT(format, _11); + ZEPHIR_INIT_VAR(&_9); + ZEPHIR_INIT_VAR(&_10); + ZVAL_STRING(&_10, "%message%"); + zephir_fast_str_replace(&_9, &_10, &message, &format TSRMLS_CC); + ZEPHIR_INIT_VAR(&_11); + ZEPHIR_GET_CONSTANT(&_11, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_12); + ZEPHIR_CONCAT_VV(&_12, &_9, &_11); + ZEPHIR_CPY_WRT(&format, &_12); if (Z_TYPE_P(context) == IS_ARRAY) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "interpolate", NULL, 0, format, context); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "interpolate", NULL, 0, &format, context); zephir_check_call_status(); RETURN_MM(); } - RETURN_CCTOR(format); + RETURN_CCTOR(&format); } diff --git a/ext/phalcon/logger/formatter/line.zep.h b/ext/phalcon/logger/formatter/line.zep.h index e7152402b02..869ed485f88 100644 --- a/ext/phalcon/logger/formatter/line.zep.h +++ b/ext/phalcon/logger/formatter/line.zep.h @@ -10,12 +10,34 @@ PHP_METHOD(Phalcon_Logger_Formatter_Line, setFormat); PHP_METHOD(Phalcon_Logger_Formatter_Line, __construct); PHP_METHOD(Phalcon_Logger_Formatter_Line, format); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_line_getdateformat, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_line_getdateformat, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_line_setdateformat, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dateFormat, IS_STRING, 0) +#else ZEND_ARG_INFO(0, dateFormat) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_line_getformat, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_line_getformat, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_line_setformat, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, format, IS_STRING, 0) +#else ZEND_ARG_INFO(0, format) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_line___construct, 0, 0, 0) @@ -23,17 +45,33 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_line___construct, 0, 0, ZEND_ARG_INFO(0, dateFormat) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_line_format, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_line_format, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_line_format, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) +#else ZEND_ARG_INFO(0, timestamp) +#endif ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_logger_formatter_line_method_entry) { - PHP_ME(Phalcon_Logger_Formatter_Line, getDateFormat, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Formatter_Line, getDateFormat, arginfo_phalcon_logger_formatter_line_getdateformat, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Formatter_Line, setDateFormat, arginfo_phalcon_logger_formatter_line_setdateformat, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Formatter_Line, getFormat, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Formatter_Line, getFormat, arginfo_phalcon_logger_formatter_line_getformat, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Formatter_Line, setFormat, arginfo_phalcon_logger_formatter_line_setformat, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Formatter_Line, __construct, arginfo_phalcon_logger_formatter_line___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Logger_Formatter_Line, format, arginfo_phalcon_logger_formatter_line_format, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/logger/formatter/syslog.zep.c b/ext/phalcon/logger/formatter/syslog.zep.c index 615779927e7..a2934ba3f90 100644 --- a/ext/phalcon/logger/formatter/syslog.zep.c +++ b/ext/phalcon/logger/formatter/syslog.zep.c @@ -43,7 +43,14 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_Syslog) { PHP_METHOD(Phalcon_Logger_Formatter_Syslog, format) { zend_long type, timestamp, ZEPHIR_LAST_CALL_STATUS; - zval *message = NULL, *type_param = NULL, *timestamp_param = NULL, *context = NULL, *_0$$3 = NULL, *_1; + zval *message = NULL, message_sub, *type_param = NULL, *timestamp_param = NULL, *context = NULL, context_sub, __$null, _0$$3, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message_sub); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &message, &type_param, ×tamp_param, &context); @@ -52,19 +59,20 @@ PHP_METHOD(Phalcon_Logger_Formatter_Syslog, format) { type = zephir_get_intval(type_param); timestamp = zephir_get_intval(timestamp_param); if (!context) { - context = ZEPHIR_GLOBAL(global_null); + context = &context_sub; + context = &__$null; } if (Z_TYPE_P(context) == IS_ARRAY) { ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "interpolate", NULL, 0, message, context); zephir_check_call_status(); - ZEPHIR_CPY_WRT(message, _0$$3); + ZEPHIR_CPY_WRT(message, &_0$$3); } zephir_create_array(return_value, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, type); - zephir_array_fast_append(return_value, _1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_LONG(&_1, type); + zephir_array_fast_append(return_value, &_1); zephir_array_fast_append(return_value, message); RETURN_MM(); diff --git a/ext/phalcon/logger/formatter/syslog.zep.h b/ext/phalcon/logger/formatter/syslog.zep.h index 94cebcfc4f8..1f56ab171ca 100644 --- a/ext/phalcon/logger/formatter/syslog.zep.h +++ b/ext/phalcon/logger/formatter/syslog.zep.h @@ -5,10 +5,22 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Formatter_Syslog); PHP_METHOD(Phalcon_Logger_Formatter_Syslog, format); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatter_syslog_format, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_syslog_format, 0, 3, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_formatter_syslog_format, 0, 3, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, message) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) +#else ZEND_ARG_INFO(0, timestamp) +#endif ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/logger/formatterinterface.zep.h b/ext/phalcon/logger/formatterinterface.zep.h index de5f3b449de..42d1a95b2df 100644 --- a/ext/phalcon/logger/formatterinterface.zep.h +++ b/ext/phalcon/logger/formatterinterface.zep.h @@ -4,9 +4,21 @@ extern zend_class_entry *phalcon_logger_formatterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Logger_FormatterInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_formatterinterface_format, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, timestamp, IS_LONG, 0) +#else ZEND_ARG_INFO(0, timestamp) +#endif ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/logger/item.zep.c b/ext/phalcon/logger/item.zep.c index 4e685d915b5..1a5e333b57e 100644 --- a/ext/phalcon/logger/item.zep.c +++ b/ext/phalcon/logger/item.zep.c @@ -59,7 +59,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Item) { */ PHP_METHOD(Phalcon_Logger_Item, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -70,7 +71,8 @@ PHP_METHOD(Phalcon_Logger_Item, getType) { */ PHP_METHOD(Phalcon_Logger_Item, getMessage) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_message"); @@ -81,7 +83,8 @@ PHP_METHOD(Phalcon_Logger_Item, getMessage) { */ PHP_METHOD(Phalcon_Logger_Item, getTime) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_time"); @@ -89,7 +92,8 @@ PHP_METHOD(Phalcon_Logger_Item, getTime) { PHP_METHOD(Phalcon_Logger_Item, getContext) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_context"); @@ -106,13 +110,19 @@ PHP_METHOD(Phalcon_Logger_Item, getContext) { PHP_METHOD(Phalcon_Logger_Item, __construct) { zend_long type, time; - zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context = NULL, *_0; - zval *message = NULL; + zval *message_param = NULL, *type_param = NULL, *time_param = NULL, *context = NULL, context_sub, __$null, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&context_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 2, &message_param, &type_param, &time_param, &context); - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); type = zephir_get_intval(type_param); if (!time_param) { time = 0; @@ -120,19 +130,20 @@ PHP_METHOD(Phalcon_Logger_Item, __construct) { time = zephir_get_intval(time_param); } if (!context) { - context = ZEPHIR_GLOBAL(global_null); + context = &context_sub; + context = &__$null; } - zephir_update_property_this(getThis(), SL("_message"), message TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_message"), &message); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, type); - zephir_update_property_this(getThis(), SL("_type"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, type); + zephir_update_property_zval(this_ptr, SL("_type"), &_0); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, time); - zephir_update_property_this(getThis(), SL("_time"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, time); + zephir_update_property_zval(this_ptr, SL("_time"), &_0); if (Z_TYPE_P(context) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_context"), context TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_context"), context); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/logger/item.zep.h b/ext/phalcon/logger/item.zep.h index b44c1d99b40..3bd4ee07349 100644 --- a/ext/phalcon/logger/item.zep.h +++ b/ext/phalcon/logger/item.zep.h @@ -9,16 +9,35 @@ PHP_METHOD(Phalcon_Logger_Item, getTime); PHP_METHOD(Phalcon_Logger_Item, getContext); PHP_METHOD(Phalcon_Logger_Item, __construct); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_item_getmessage, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_logger_item_getmessage, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_item___construct, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, time, IS_LONG, 0) +#else ZEND_ARG_INFO(0, time) +#endif ZEND_ARG_INFO(0, context) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_logger_item_method_entry) { PHP_ME(Phalcon_Logger_Item, getType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Logger_Item, getMessage, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Logger_Item, getMessage, arginfo_phalcon_logger_item_getmessage, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Item, getTime, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Item, getContext, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Logger_Item, __construct, arginfo_phalcon_logger_item___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) diff --git a/ext/phalcon/logger/multiple.zep.c b/ext/phalcon/logger/multiple.zep.c index 8866ec019ae..a7e485449cc 100644 --- a/ext/phalcon/logger/multiple.zep.c +++ b/ext/phalcon/logger/multiple.zep.c @@ -41,7 +41,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Logger_Multiple) { PHP_METHOD(Phalcon_Logger_Multiple, getLoggers) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_loggers"); @@ -49,7 +50,8 @@ PHP_METHOD(Phalcon_Logger_Multiple, getLoggers) { PHP_METHOD(Phalcon_Logger_Multiple, getFormatter) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_formatter"); @@ -57,7 +59,8 @@ PHP_METHOD(Phalcon_Logger_Multiple, getFormatter) { PHP_METHOD(Phalcon_Logger_Multiple, getLogLevel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_logLevel"); @@ -68,7 +71,10 @@ PHP_METHOD(Phalcon_Logger_Multiple, getLogLevel) { */ PHP_METHOD(Phalcon_Logger_Multiple, push) { - zval *logger; + zval *logger, logger_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&logger_sub); zephir_fetch_params(0, 1, 0, &logger); @@ -83,30 +89,33 @@ PHP_METHOD(Phalcon_Logger_Multiple, push) { */ PHP_METHOD(Phalcon_Logger_Multiple, setFormatter) { - HashTable *_1$$3; - HashPosition _0$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *formatter, *loggers = NULL, *logger = NULL, **_2$$3; + zval *formatter, formatter_sub, loggers, logger, *_0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&formatter_sub); + ZVAL_UNDEF(&loggers); + ZVAL_UNDEF(&logger); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &formatter); - ZEPHIR_OBS_VAR(loggers); - zephir_read_property_this(&loggers, this_ptr, SL("_loggers"), PH_NOISY_CC); - if (Z_TYPE_P(loggers) == IS_ARRAY) { - zephir_is_iterable(loggers, &_1$$3, &_0$$3, 0, 0, "phalcon/logger/multiple.zep", 61); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(logger, _2$$3); - ZEPHIR_CALL_METHOD(NULL, logger, "setformatter", NULL, 0, formatter); + ZEPHIR_OBS_VAR(&loggers); + zephir_read_property(&loggers, this_ptr, SL("_loggers"), PH_NOISY_CC); + if (Z_TYPE_P(&loggers) == IS_ARRAY) { + zephir_is_iterable(&loggers, 0, "phalcon/logger/multiple.zep", 61); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&loggers), _0$$3) + { + ZEPHIR_INIT_NVAR(&logger); + ZVAL_COPY(&logger, _0$$3); + ZEPHIR_CALL_METHOD(NULL, &logger, "setformatter", NULL, 0, formatter); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&logger); } - zephir_update_property_this(getThis(), SL("_formatter"), formatter TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_formatter"), formatter); ZEPHIR_MM_RESTORE(); } @@ -116,10 +125,14 @@ PHP_METHOD(Phalcon_Logger_Multiple, setFormatter) { */ PHP_METHOD(Phalcon_Logger_Multiple, setLogLevel) { - HashTable *_1$$3; - HashPosition _0$$3; - zval *level_param = NULL, *loggers = NULL, *logger = NULL, *_4, **_2$$3, *_3$$4 = NULL; + zval *level_param = NULL, loggers, logger, _2, *_0$$3, _1$$4; zend_long level, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&loggers); + ZVAL_UNDEF(&logger); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &level_param); @@ -127,24 +140,23 @@ PHP_METHOD(Phalcon_Logger_Multiple, setLogLevel) { level = zephir_get_intval(level_param); - ZEPHIR_OBS_VAR(loggers); - zephir_read_property_this(&loggers, this_ptr, SL("_loggers"), PH_NOISY_CC); - if (Z_TYPE_P(loggers) == IS_ARRAY) { - zephir_is_iterable(loggers, &_1$$3, &_0$$3, 0, 0, "phalcon/logger/multiple.zep", 77); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(logger, _2$$3); - ZEPHIR_INIT_NVAR(_3$$4); - ZVAL_LONG(_3$$4, level); - ZEPHIR_CALL_METHOD(NULL, logger, "setloglevel", NULL, 0, _3$$4); + ZEPHIR_OBS_VAR(&loggers); + zephir_read_property(&loggers, this_ptr, SL("_loggers"), PH_NOISY_CC); + if (Z_TYPE_P(&loggers) == IS_ARRAY) { + zephir_is_iterable(&loggers, 0, "phalcon/logger/multiple.zep", 77); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&loggers), _0$$3) + { + ZEPHIR_INIT_NVAR(&logger); + ZVAL_COPY(&logger, _0$$3); + ZVAL_LONG(&_1$$4, level); + ZEPHIR_CALL_METHOD(NULL, &logger, "setloglevel", NULL, 0, &_1$$4); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&logger); } - ZEPHIR_INIT_ZVAL_NREF(_4); - ZVAL_LONG(_4, level); - zephir_update_property_this(getThis(), SL("_logLevel"), _4 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_2); + ZVAL_LONG(&_2, level); + zephir_update_property_zval(this_ptr, SL("_logLevel"), &_2); ZEPHIR_MM_RESTORE(); } @@ -154,38 +166,45 @@ PHP_METHOD(Phalcon_Logger_Multiple, setLogLevel) { */ PHP_METHOD(Phalcon_Logger_Multiple, log) { - HashTable *_1$$3; - HashPosition _0$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *type, *message = NULL, *context_param = NULL, *loggers = NULL, *logger = NULL, **_2$$3; + zval context; + zval *type, type_sub, *message = NULL, message_sub, *context_param = NULL, __$null, loggers, logger, *_0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type_sub); + ZVAL_UNDEF(&message_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&loggers); + ZVAL_UNDEF(&logger); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &type, &message, &context_param); if (!message) { - message = ZEPHIR_GLOBAL(global_null); + message = &message_sub; + message = &__$null; } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_OBS_VAR(loggers); - zephir_read_property_this(&loggers, this_ptr, SL("_loggers"), PH_NOISY_CC); - if (Z_TYPE_P(loggers) == IS_ARRAY) { - zephir_is_iterable(loggers, &_1$$3, &_0$$3, 0, 0, "phalcon/logger/multiple.zep", 93); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(logger, _2$$3); - ZEPHIR_CALL_METHOD(NULL, logger, "log", NULL, 0, type, message, context); + ZEPHIR_OBS_VAR(&loggers); + zephir_read_property(&loggers, this_ptr, SL("_loggers"), PH_NOISY_CC); + if (Z_TYPE_P(&loggers) == IS_ARRAY) { + zephir_is_iterable(&loggers, 0, "phalcon/logger/multiple.zep", 93); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&loggers), _0$$3) + { + ZEPHIR_INIT_NVAR(&logger); + ZVAL_COPY(&logger, _0$$3); + ZEPHIR_CALL_METHOD(NULL, &logger, "log", NULL, 0, type, message, &context); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&logger); } ZEPHIR_MM_RESTORE(); @@ -197,34 +216,38 @@ PHP_METHOD(Phalcon_Logger_Multiple, log) { PHP_METHOD(Phalcon_Logger_Multiple, critical) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 1); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 1); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -236,34 +259,38 @@ PHP_METHOD(Phalcon_Logger_Multiple, critical) { PHP_METHOD(Phalcon_Logger_Multiple, emergency) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -275,34 +302,38 @@ PHP_METHOD(Phalcon_Logger_Multiple, emergency) { PHP_METHOD(Phalcon_Logger_Multiple, debug) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 7); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 7); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -314,34 +345,38 @@ PHP_METHOD(Phalcon_Logger_Multiple, debug) { PHP_METHOD(Phalcon_Logger_Multiple, error) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 3); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -353,34 +388,38 @@ PHP_METHOD(Phalcon_Logger_Multiple, error) { PHP_METHOD(Phalcon_Logger_Multiple, info) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 6); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 6); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -392,34 +431,38 @@ PHP_METHOD(Phalcon_Logger_Multiple, info) { PHP_METHOD(Phalcon_Logger_Multiple, notice) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 5); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 5); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -431,34 +474,38 @@ PHP_METHOD(Phalcon_Logger_Multiple, notice) { PHP_METHOD(Phalcon_Logger_Multiple, warning) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 4); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -470,34 +517,38 @@ PHP_METHOD(Phalcon_Logger_Multiple, warning) { PHP_METHOD(Phalcon_Logger_Multiple, alert) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *context = NULL; - zval *message_param = NULL, *context_param = NULL, *_0; - zval *message = NULL; + zval context; + zval *message_param = NULL, *context_param = NULL, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&context); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &context_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!context_param) { - ZEPHIR_INIT_VAR(context); - array_init(context); + ZEPHIR_INIT_VAR(&context); + array_init(&context); } else { - context = context_param; + ZEPHIR_OBS_COPY_OR_DUP(&context, context_param); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 2); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, _0, message, context); + ZVAL_LONG(&_0, 2); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "log", NULL, 0, &_0, &message, &context); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/logger/multiple.zep.h b/ext/phalcon/logger/multiple.zep.h index 82ead275c1a..9324b6faaac 100644 --- a/ext/phalcon/logger/multiple.zep.h +++ b/ext/phalcon/logger/multiple.zep.h @@ -28,7 +28,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_setformatter, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_setloglevel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) +#else ZEND_ARG_INFO(0, level) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_log, 0, 0, 1) @@ -38,42 +42,74 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_log, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_critical, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_emergency, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_debug, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_error, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_info, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_notice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_warning, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_logger_multiple_alert, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_ARRAY_INFO(0, context, 1) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/application.zep.c b/ext/phalcon/mvc/application.zep.c index 8f8d9e1753b..17a4462f61d 100644 --- a/ext/phalcon/mvc/application.zep.c +++ b/ext/phalcon/mvc/application.zep.c @@ -88,8 +88,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Application) { */ PHP_METHOD(Phalcon_Mvc_Application, sendHeadersOnHandleRequest) { - zval *sendHeaders_param = NULL; + zval *sendHeaders_param = NULL, __$true, __$false; zend_bool sendHeaders; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &sendHeaders_param); @@ -97,9 +101,9 @@ PHP_METHOD(Phalcon_Mvc_Application, sendHeadersOnHandleRequest) { if (sendHeaders) { - zephir_update_property_this(getThis(), SL("_sendHeaders"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sendHeaders"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_sendHeaders"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sendHeaders"), &__$false); } RETURN_THISW(); @@ -110,8 +114,12 @@ PHP_METHOD(Phalcon_Mvc_Application, sendHeadersOnHandleRequest) { */ PHP_METHOD(Phalcon_Mvc_Application, sendCookiesOnHandleRequest) { - zval *sendCookies_param = NULL; + zval *sendCookies_param = NULL, __$true, __$false; zend_bool sendCookies; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &sendCookies_param); @@ -119,9 +127,9 @@ PHP_METHOD(Phalcon_Mvc_Application, sendCookiesOnHandleRequest) { if (sendCookies) { - zephir_update_property_this(getThis(), SL("_sendCookies"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sendCookies"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_sendCookies"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sendCookies"), &__$false); } RETURN_THISW(); @@ -133,8 +141,12 @@ PHP_METHOD(Phalcon_Mvc_Application, sendCookiesOnHandleRequest) { */ PHP_METHOD(Phalcon_Mvc_Application, useImplicitView) { - zval *implicitView_param = NULL; + zval *implicitView_param = NULL, __$true, __$false; zend_bool implicitView; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &implicitView_param); @@ -142,9 +154,9 @@ PHP_METHOD(Phalcon_Mvc_Application, useImplicitView) { if (implicitView) { - zephir_update_property_this(getThis(), SL("_implicitView"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_implicitView"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_implicitView"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_implicitView"), &__$false); } RETURN_THISW(); @@ -155,323 +167,367 @@ PHP_METHOD(Phalcon_Mvc_Application, useImplicitView) { */ PHP_METHOD(Phalcon_Mvc_Application, handle) { - zval *_16$$22; + zval _16$$22; zend_class_entry *_6$$8; zend_bool returnedResponse = 0, _26, _12$$13, _31$$32, _33$$32; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri_param = NULL, *dependencyInjector = NULL, *eventsManager = NULL, *router = NULL, *dispatcher = NULL, *response = NULL, *view = NULL, *module = NULL, *moduleObject = NULL, *moduleName = NULL, *className = NULL, *path = NULL, *implicitView = NULL, *controller = NULL, *possibleResponse = NULL, *renderStatus = NULL, *matchedRoute = NULL, *match = NULL, *_0, *_3 = NULL, *_4 = NULL, *_20 = NULL, *_21 = NULL, *_22 = NULL, *_23 = NULL, *_41, *_1$$4 = NULL, *_2$$4, *_5$$8 = NULL, *_7$$7 = NULL, *_8$$9 = NULL, *_9$$9, *_10$$14 = NULL, *_11$$14, *_13$$21, *_14$$21, *_15$$17 = NULL, *_17$$24, *_18$$25 = NULL, *_19$$25, *_24$$27 = NULL, *_25$$27, *_27$$29 = NULL, *_28$$29, *_29$$31 = NULL, *_30$$31, *_32$$33, *_34$$36, *_35$$37 = NULL, *_36$$37 = NULL, *_37$$40 = NULL, *_38$$40, *_39$$41 = NULL, *_40$$42; - zval *uri = NULL; + zval *uri_param = NULL, __$false, dependencyInjector, eventsManager, router, dispatcher, response, view, module, moduleObject, moduleName, className, path, implicitView, controller, possibleResponse, renderStatus, matchedRoute, match, _0, _3, _4, _20, _21, _22, _23, _41, _1$$4, _2$$4, _5$$8, _7$$7, _8$$9, _9$$9, _10$$14, _11$$14, _13$$21, _14$$21, _15$$17, _17$$24, _18$$25, _19$$25, _24$$27, _25$$27, _27$$29, _28$$29, _29$$31, _30$$31, _32$$33, _34$$36, _35$$37, _36$$37, _37$$40, _38$$40, _39$$41, _40$$42; + zval uri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uri); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&dispatcher); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&view); + ZVAL_UNDEF(&module); + ZVAL_UNDEF(&moduleObject); + ZVAL_UNDEF(&moduleName); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&implicitView); + ZVAL_UNDEF(&controller); + ZVAL_UNDEF(&possibleResponse); + ZVAL_UNDEF(&renderStatus); + ZVAL_UNDEF(&matchedRoute); + ZVAL_UNDEF(&match); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_20); + ZVAL_UNDEF(&_21); + ZVAL_UNDEF(&_22); + ZVAL_UNDEF(&_23); + ZVAL_UNDEF(&_41); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_10$$14); + ZVAL_UNDEF(&_11$$14); + ZVAL_UNDEF(&_13$$21); + ZVAL_UNDEF(&_14$$21); + ZVAL_UNDEF(&_15$$17); + ZVAL_UNDEF(&_17$$24); + ZVAL_UNDEF(&_18$$25); + ZVAL_UNDEF(&_19$$25); + ZVAL_UNDEF(&_24$$27); + ZVAL_UNDEF(&_25$$27); + ZVAL_UNDEF(&_27$$29); + ZVAL_UNDEF(&_28$$29); + ZVAL_UNDEF(&_29$$31); + ZVAL_UNDEF(&_30$$31); + ZVAL_UNDEF(&_32$$33); + ZVAL_UNDEF(&_34$$36); + ZVAL_UNDEF(&_35$$37); + ZVAL_UNDEF(&_36$$37); + ZVAL_UNDEF(&_37$$40); + ZVAL_UNDEF(&_38$$40); + ZVAL_UNDEF(&_39$$41); + ZVAL_UNDEF(&_40$$42); + ZVAL_UNDEF(&_16$$22); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &uri_param); if (!uri_param) { - ZEPHIR_INIT_VAR(uri); - ZVAL_EMPTY_STRING(uri); + ZEPHIR_INIT_VAR(&uri); + ZVAL_STRING(&uri, ""); } else { - zephir_get_strval(uri, uri_param); + zephir_get_strval(&uri, uri_param); } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "A dependency injection object is required to access internal services", "phalcon/mvc/application.zep", 127); return; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_STRING(_2$$4, "application:boot", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$4, eventsManager, "fire", NULL, 0, _2$$4, this_ptr); - zephir_check_temp_parameter(_2$$4); + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, "application:boot"); + ZEPHIR_CALL_METHOD(&_1$$4, &eventsManager, "fire", NULL, 0, &_2$$4, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1$$4)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$4)) { RETURN_MM_BOOL(0); } } - ZEPHIR_INIT_VAR(_4); - ZVAL_STRING(_4, "router", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3, dependencyInjector, "getshared", NULL, 0, _4); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "router"); + ZEPHIR_CALL_METHOD(&_3, &dependencyInjector, "getshared", NULL, 0, &_4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(router, _3); - ZEPHIR_CALL_METHOD(NULL, router, "handle", NULL, 0, uri); + ZEPHIR_CPY_WRT(&router, &_3); + ZEPHIR_CALL_METHOD(NULL, &router, "handle", NULL, 0, &uri); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&matchedRoute, router, "getmatchedroute", NULL, 0); + ZEPHIR_CALL_METHOD(&matchedRoute, &router, "getmatchedroute", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(matchedRoute) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&match, matchedRoute, "getmatch", NULL, 0); + if (Z_TYPE_P(&matchedRoute) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&match, &matchedRoute, "getmatch", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(match) != IS_NULL) { - if (zephir_instance_of_ev(match, zend_ce_closure TSRMLS_CC)) { - _6$$8 = zend_fetch_class(SL("Closure"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - ZEPHIR_CALL_CE_STATIC(&_5$$8, _6$$8, "bind", NULL, 0, match, dependencyInjector); + if (Z_TYPE_P(&match) != IS_NULL) { + if (zephir_instance_of_ev(&match, zend_ce_closure TSRMLS_CC)) { + _6$$8 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO); + ZEPHIR_CALL_CE_STATIC(&_5$$8, _6$$8, "bind", NULL, 0, &match, &dependencyInjector); zephir_check_call_status(); - ZEPHIR_CPY_WRT(match, _5$$8); + ZEPHIR_CPY_WRT(&match, &_5$$8); } - ZEPHIR_CALL_METHOD(&_7$$7, router, "getparams", NULL, 0); + ZEPHIR_CALL_METHOD(&_7$$7, &router, "getparams", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(possibleResponse); - ZEPHIR_CALL_USER_FUNC_ARRAY(possibleResponse, match, _7$$7); + ZEPHIR_INIT_VAR(&possibleResponse); + ZEPHIR_CALL_USER_FUNC_ARRAY(&possibleResponse, &match, &_7$$7); zephir_check_call_status(); - if (Z_TYPE_P(possibleResponse) == IS_STRING) { - ZEPHIR_INIT_VAR(_9$$9); - ZVAL_STRING(_9$$9, "response", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_8$$9, dependencyInjector, "getshared", NULL, 0, _9$$9); - zephir_check_temp_parameter(_9$$9); + if (Z_TYPE_P(&possibleResponse) == IS_STRING) { + ZEPHIR_INIT_VAR(&_9$$9); + ZVAL_STRING(&_9$$9, "response"); + ZEPHIR_CALL_METHOD(&_8$$9, &dependencyInjector, "getshared", NULL, 0, &_9$$9); zephir_check_call_status(); - ZEPHIR_CPY_WRT(response, _8$$9); - ZEPHIR_CALL_METHOD(NULL, response, "setcontent", NULL, 0, possibleResponse); + ZEPHIR_CPY_WRT(&response, &_8$$9); + ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &possibleResponse); zephir_check_call_status(); - RETURN_CCTOR(response); + RETURN_CCTOR(&response); } - if (Z_TYPE_P(possibleResponse) == IS_OBJECT) { - if (zephir_instance_of_ev(possibleResponse, phalcon_http_responseinterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, possibleResponse, "sendheaders", NULL, 0); + if (Z_TYPE_P(&possibleResponse) == IS_OBJECT) { + if (zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &possibleResponse, "sendheaders", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, possibleResponse, "sendcookies", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &possibleResponse, "sendcookies", NULL, 0); zephir_check_call_status(); - RETURN_CCTOR(possibleResponse); + RETURN_CCTOR(&possibleResponse); } } } } - ZEPHIR_CALL_METHOD(&moduleName, router, "getmodulename", NULL, 0); + ZEPHIR_CALL_METHOD(&moduleName, &router, "getmodulename", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(moduleName))) { - ZEPHIR_OBS_NVAR(moduleName); - zephir_read_property_this(&moduleName, this_ptr, SL("_defaultModule"), PH_NOISY_CC); + if (!(zephir_is_true(&moduleName))) { + ZEPHIR_OBS_NVAR(&moduleName); + zephir_read_property(&moduleName, this_ptr, SL("_defaultModule"), PH_NOISY_CC); } - ZEPHIR_INIT_VAR(moduleObject); - ZVAL_NULL(moduleObject); - if (zephir_is_true(moduleName)) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_11$$14); - ZVAL_STRING(_11$$14, "application:beforeStartModule", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_10$$14, eventsManager, "fire", NULL, 0, _11$$14, this_ptr, moduleName); - zephir_check_temp_parameter(_11$$14); + ZEPHIR_INIT_VAR(&moduleObject); + ZVAL_NULL(&moduleObject); + if (zephir_is_true(&moduleName)) { + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_11$$14); + ZVAL_STRING(&_11$$14, "application:beforeStartModule"); + ZEPHIR_CALL_METHOD(&_10$$14, &eventsManager, "fire", NULL, 0, &_11$$14, this_ptr, &moduleName); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_10$$14)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_10$$14)) { RETURN_MM_BOOL(0); } } - ZEPHIR_CALL_METHOD(&module, this_ptr, "getmodule", NULL, 0, moduleName); + ZEPHIR_CALL_METHOD(&module, this_ptr, "getmodule", NULL, 0, &moduleName); zephir_check_call_status(); - _12$$13 = Z_TYPE_P(module) != IS_ARRAY; + _12$$13 = Z_TYPE_P(&module) != IS_ARRAY; if (_12$$13) { - _12$$13 = Z_TYPE_P(module) != IS_OBJECT; + _12$$13 = Z_TYPE_P(&module) != IS_OBJECT; } if (_12$$13) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/mvc/application.zep", 218); return; } - if (Z_TYPE_P(module) == IS_ARRAY) { - ZEPHIR_OBS_VAR(className); - if (!(zephir_array_isset_string_fetch(&className, module, SS("className"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(className); - ZVAL_STRING(className, "Module", 1); + if (Z_TYPE_P(&module) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&className); + if (!(zephir_array_isset_string_fetch(&className, &module, SL("className"), 0))) { + ZEPHIR_INIT_NVAR(&className); + ZVAL_STRING(&className, "Module"); } - ZEPHIR_OBS_VAR(path); - if (zephir_array_isset_string_fetch(&path, module, SS("path"), 0 TSRMLS_CC)) { - if (!(zephir_class_exists(className, zephir_is_true(ZEPHIR_GLOBAL(global_false)) TSRMLS_CC))) { - if (!((zephir_file_exists(path TSRMLS_CC) == SUCCESS))) { - ZEPHIR_INIT_VAR(_13$$21); - object_init_ex(_13$$21, phalcon_mvc_application_exception_ce); - ZEPHIR_INIT_VAR(_14$$21); - ZEPHIR_CONCAT_SVS(_14$$21, "Module definition path '", path, "' doesn't exist"); - ZEPHIR_CALL_METHOD(NULL, _13$$21, "__construct", NULL, 9, _14$$21); + ZEPHIR_OBS_VAR(&path); + if (zephir_array_isset_string_fetch(&path, &module, SL("path"), 0)) { + if (!(zephir_class_exists(&className, zephir_is_true(&__$false) TSRMLS_CC))) { + if (!((zephir_file_exists(&path TSRMLS_CC) == SUCCESS))) { + ZEPHIR_INIT_VAR(&_13$$21); + object_init_ex(&_13$$21, phalcon_mvc_application_exception_ce); + ZEPHIR_INIT_VAR(&_14$$21); + ZEPHIR_CONCAT_SVS(&_14$$21, "Module definition path '", &path, "' doesn't exist"); + ZEPHIR_CALL_METHOD(NULL, &_13$$21, "__construct", NULL, 4, &_14$$21); zephir_check_call_status(); - zephir_throw_exception_debug(_13$$21, "phalcon/mvc/application.zep", 239 TSRMLS_CC); + zephir_throw_exception_debug(&_13$$21, "phalcon/mvc/application.zep", 239 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_require_zval(path TSRMLS_CC) == FAILURE) { + if (zephir_require_zval(&path TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } } } - ZEPHIR_CALL_METHOD(&_15$$17, dependencyInjector, "get", NULL, 0, className); + ZEPHIR_CALL_METHOD(&_15$$17, &dependencyInjector, "get", NULL, 0, &className); zephir_check_call_status(); - ZEPHIR_CPY_WRT(moduleObject, _15$$17); - ZEPHIR_CALL_METHOD(NULL, moduleObject, "registerautoloaders", NULL, 0, dependencyInjector); + ZEPHIR_CPY_WRT(&moduleObject, &_15$$17); + ZEPHIR_CALL_METHOD(NULL, &moduleObject, "registerautoloaders", NULL, 0, &dependencyInjector); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, moduleObject, "registerservices", NULL, 0, dependencyInjector); + ZEPHIR_CALL_METHOD(NULL, &moduleObject, "registerservices", NULL, 0, &dependencyInjector); zephir_check_call_status(); } else { - if (!(zephir_instance_of_ev(module, zend_ce_closure TSRMLS_CC))) { + if (!(zephir_instance_of_ev(&module, zend_ce_closure TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_application_exception_ce, "Invalid module definition", "phalcon/mvc/application.zep", 260); return; } - ZEPHIR_INIT_VAR(_16$$22); - zephir_create_array(_16$$22, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_16$$22, dependencyInjector); - ZEPHIR_INIT_NVAR(moduleObject); - ZEPHIR_CALL_USER_FUNC_ARRAY(moduleObject, module, _16$$22); + ZEPHIR_INIT_VAR(&_16$$22); + zephir_create_array(&_16$$22, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_16$$22, &dependencyInjector); + ZEPHIR_INIT_NVAR(&moduleObject); + ZEPHIR_CALL_USER_FUNC_ARRAY(&moduleObject, &module, &_16$$22); zephir_check_call_status(); } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_17$$24); - ZVAL_STRING(_17$$24, "application:afterStartModule", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _17$$24, this_ptr, moduleObject); - zephir_check_temp_parameter(_17$$24); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_17$$24); + ZVAL_STRING(&_17$$24, "application:afterStartModule"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_17$$24, this_ptr, &moduleObject); zephir_check_call_status(); } } - ZEPHIR_OBS_VAR(implicitView); - zephir_read_property_this(&implicitView, this_ptr, SL("_implicitView"), PH_NOISY_CC); - if (ZEPHIR_IS_TRUE_IDENTICAL(implicitView)) { - ZEPHIR_INIT_VAR(_19$$25); - ZVAL_STRING(_19$$25, "view", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_18$$25, dependencyInjector, "getshared", NULL, 0, _19$$25); - zephir_check_temp_parameter(_19$$25); + ZEPHIR_OBS_VAR(&implicitView); + zephir_read_property(&implicitView, this_ptr, SL("_implicitView"), PH_NOISY_CC); + if (ZEPHIR_IS_TRUE_IDENTICAL(&implicitView)) { + ZEPHIR_INIT_VAR(&_19$$25); + ZVAL_STRING(&_19$$25, "view"); + ZEPHIR_CALL_METHOD(&_18$$25, &dependencyInjector, "getshared", NULL, 0, &_19$$25); zephir_check_call_status(); - ZEPHIR_CPY_WRT(view, _18$$25); + ZEPHIR_CPY_WRT(&view, &_18$$25); } - ZEPHIR_INIT_NVAR(_4); - ZVAL_STRING(_4, "dispatcher", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3, dependencyInjector, "getshared", NULL, 0, _4); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "dispatcher"); + ZEPHIR_CALL_METHOD(&_3, &dependencyInjector, "getshared", NULL, 0, &_4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(dispatcher, _3); - ZEPHIR_CALL_METHOD(&_3, router, "getmodulename", NULL, 0); + ZEPHIR_CPY_WRT(&dispatcher, &_3); + ZEPHIR_CALL_METHOD(&_3, &router, "getmodulename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, dispatcher, "setmodulename", NULL, 0, _3); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setmodulename", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_20, router, "getnamespacename", NULL, 0); + ZEPHIR_CALL_METHOD(&_20, &router, "getnamespacename", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, dispatcher, "setnamespacename", NULL, 0, _20); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setnamespacename", NULL, 0, &_20); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_21, router, "getcontrollername", NULL, 0); + ZEPHIR_CALL_METHOD(&_21, &router, "getcontrollername", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, dispatcher, "setcontrollername", NULL, 0, _21); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setcontrollername", NULL, 0, &_21); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_22, router, "getactionname", NULL, 0); + ZEPHIR_CALL_METHOD(&_22, &router, "getactionname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, dispatcher, "setactionname", NULL, 0, _22); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setactionname", NULL, 0, &_22); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_23, router, "getparams", NULL, 0); + ZEPHIR_CALL_METHOD(&_23, &router, "getparams", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, dispatcher, "setparams", NULL, 0, _23); + ZEPHIR_CALL_METHOD(NULL, &dispatcher, "setparams", NULL, 0, &_23); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(implicitView)) { - ZEPHIR_CALL_METHOD(NULL, view, "start", NULL, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&implicitView)) { + ZEPHIR_CALL_METHOD(NULL, &view, "start", NULL, 0); zephir_check_call_status(); } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_25$$27); - ZVAL_STRING(_25$$27, "application:beforeHandleRequest", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_24$$27, eventsManager, "fire", NULL, 0, _25$$27, this_ptr, dispatcher); - zephir_check_temp_parameter(_25$$27); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_25$$27); + ZVAL_STRING(&_25$$27, "application:beforeHandleRequest"); + ZEPHIR_CALL_METHOD(&_24$$27, &eventsManager, "fire", NULL, 0, &_25$$27, this_ptr, &dispatcher); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_24$$27)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_24$$27)) { RETURN_MM_BOOL(0); } } - ZEPHIR_CALL_METHOD(&controller, dispatcher, "dispatch", NULL, 0); + ZEPHIR_CALL_METHOD(&controller, &dispatcher, "dispatch", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&possibleResponse, dispatcher, "getreturnedvalue", NULL, 0); + ZEPHIR_CALL_METHOD(&possibleResponse, &dispatcher, "getreturnedvalue", NULL, 0); zephir_check_call_status(); - _26 = Z_TYPE_P(possibleResponse) == IS_BOOL; + _26 = ((Z_TYPE_P(&possibleResponse) == IS_TRUE || Z_TYPE_P(&possibleResponse) == IS_FALSE) == 1); if (_26) { - _26 = ZEPHIR_IS_FALSE_IDENTICAL(possibleResponse); + _26 = ZEPHIR_IS_FALSE_IDENTICAL(&possibleResponse); } if (_26) { - ZEPHIR_INIT_VAR(_28$$29); - ZVAL_STRING(_28$$29, "response", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_27$$29, dependencyInjector, "getshared", NULL, 0, _28$$29); - zephir_check_temp_parameter(_28$$29); + ZEPHIR_INIT_VAR(&_28$$29); + ZVAL_STRING(&_28$$29, "response"); + ZEPHIR_CALL_METHOD(&_27$$29, &dependencyInjector, "getshared", NULL, 0, &_28$$29); zephir_check_call_status(); - ZEPHIR_CPY_WRT(response, _27$$29); + ZEPHIR_CPY_WRT(&response, &_27$$29); } else { - if (Z_TYPE_P(possibleResponse) == IS_STRING) { - ZEPHIR_INIT_VAR(_30$$31); - ZVAL_STRING(_30$$31, "response", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_29$$31, dependencyInjector, "getshared", NULL, 0, _30$$31); - zephir_check_temp_parameter(_30$$31); + if (Z_TYPE_P(&possibleResponse) == IS_STRING) { + ZEPHIR_INIT_VAR(&_30$$31); + ZVAL_STRING(&_30$$31, "response"); + ZEPHIR_CALL_METHOD(&_29$$31, &dependencyInjector, "getshared", NULL, 0, &_30$$31); zephir_check_call_status(); - ZEPHIR_CPY_WRT(response, _29$$31); - ZEPHIR_CALL_METHOD(NULL, response, "setcontent", NULL, 0, possibleResponse); + ZEPHIR_CPY_WRT(&response, &_29$$31); + ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &possibleResponse); zephir_check_call_status(); } else { - _31$$32 = (Z_TYPE_P(possibleResponse) == IS_OBJECT); + _31$$32 = (Z_TYPE_P(&possibleResponse) == IS_OBJECT); if (_31$$32) { - _31$$32 = (zephir_instance_of_ev(possibleResponse, phalcon_http_responseinterface_ce TSRMLS_CC)); + _31$$32 = (zephir_instance_of_ev(&possibleResponse, phalcon_http_responseinterface_ce TSRMLS_CC)); } returnedResponse = _31$$32; - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_32$$33); - ZVAL_STRING(_32$$33, "application:afterHandleRequest", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _32$$33, this_ptr, controller); - zephir_check_temp_parameter(_32$$33); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_32$$33); + ZVAL_STRING(&_32$$33, "application:afterHandleRequest"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_32$$33, this_ptr, &controller); zephir_check_call_status(); } _33$$32 = returnedResponse == 0; if (_33$$32) { - _33$$32 = ZEPHIR_IS_TRUE_IDENTICAL(implicitView); + _33$$32 = ZEPHIR_IS_TRUE_IDENTICAL(&implicitView); } if (_33$$32) { - if (Z_TYPE_P(controller) == IS_OBJECT) { - ZEPHIR_INIT_VAR(renderStatus); - ZVAL_BOOL(renderStatus, 1); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_34$$36); - ZVAL_STRING(_34$$36, "application:viewRender", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&renderStatus, eventsManager, "fire", NULL, 0, _34$$36, this_ptr, view); - zephir_check_temp_parameter(_34$$36); + if (Z_TYPE_P(&controller) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&renderStatus); + ZVAL_BOOL(&renderStatus, 1); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_34$$36); + ZVAL_STRING(&_34$$36, "application:viewRender"); + ZEPHIR_CALL_METHOD(&renderStatus, &eventsManager, "fire", NULL, 0, &_34$$36, this_ptr, &view); zephir_check_call_status(); } - if (!ZEPHIR_IS_FALSE_IDENTICAL(renderStatus)) { - ZEPHIR_CALL_METHOD(&_35$$37, dispatcher, "getcontrollername", NULL, 0); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&renderStatus)) { + ZEPHIR_CALL_METHOD(&_35$$37, &dispatcher, "getcontrollername", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_36$$37, dispatcher, "getactionname", NULL, 0); + ZEPHIR_CALL_METHOD(&_36$$37, &dispatcher, "getactionname", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, view, "render", NULL, 0, _35$$37, _36$$37); + ZEPHIR_CALL_METHOD(NULL, &view, "render", NULL, 0, &_35$$37, &_36$$37); zephir_check_call_status(); } } } - if (ZEPHIR_IS_TRUE_IDENTICAL(implicitView)) { - ZEPHIR_CALL_METHOD(NULL, view, "finish", NULL, 0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&implicitView)) { + ZEPHIR_CALL_METHOD(NULL, &view, "finish", NULL, 0); zephir_check_call_status(); } if (returnedResponse == 1) { - ZEPHIR_CPY_WRT(response, possibleResponse); + ZEPHIR_CPY_WRT(&response, &possibleResponse); } else { - ZEPHIR_INIT_VAR(_38$$40); - ZVAL_STRING(_38$$40, "response", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_37$$40, dependencyInjector, "getshared", NULL, 0, _38$$40); - zephir_check_temp_parameter(_38$$40); + ZEPHIR_INIT_VAR(&_38$$40); + ZVAL_STRING(&_38$$40, "response"); + ZEPHIR_CALL_METHOD(&_37$$40, &dependencyInjector, "getshared", NULL, 0, &_38$$40); zephir_check_call_status(); - ZEPHIR_CPY_WRT(response, _37$$40); - if (ZEPHIR_IS_TRUE_IDENTICAL(implicitView)) { - ZEPHIR_CALL_METHOD(&_39$$41, view, "getcontent", NULL, 0); + ZEPHIR_CPY_WRT(&response, &_37$$40); + if (ZEPHIR_IS_TRUE_IDENTICAL(&implicitView)) { + ZEPHIR_CALL_METHOD(&_39$$41, &view, "getcontent", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, response, "setcontent", NULL, 0, _39$$41); + ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &_39$$41); zephir_check_call_status(); } } } } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_40$$42); - ZVAL_STRING(_40$$42, "application:beforeSendResponse", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _40$$42, this_ptr, response); - zephir_check_temp_parameter(_40$$42); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_40$$42); + ZVAL_STRING(&_40$$42, "application:beforeSendResponse"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_40$$42, this_ptr, &response); zephir_check_call_status(); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_sendHeaders"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - ZEPHIR_CALL_METHOD(NULL, response, "sendheaders", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_sendHeaders"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + ZEPHIR_CALL_METHOD(NULL, &response, "sendheaders", NULL, 0); zephir_check_call_status(); } - _41 = zephir_fetch_nproperty_this(this_ptr, SL("_sendCookies"), PH_NOISY_CC); - if (zephir_is_true(_41)) { - ZEPHIR_CALL_METHOD(NULL, response, "sendcookies", NULL, 0); + zephir_read_property(&_41, this_ptr, SL("_sendCookies"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_41)) { + ZEPHIR_CALL_METHOD(NULL, &response, "sendcookies", NULL, 0); zephir_check_call_status(); } - RETURN_CCTOR(response); + RETURN_CCTOR(&response); } diff --git a/ext/phalcon/mvc/application.zep.h b/ext/phalcon/mvc/application.zep.h index d6106dcaa2b..86433393a5e 100644 --- a/ext/phalcon/mvc/application.zep.h +++ b/ext/phalcon/mvc/application.zep.h @@ -8,20 +8,48 @@ PHP_METHOD(Phalcon_Mvc_Application, sendCookiesOnHandleRequest); PHP_METHOD(Phalcon_Mvc_Application, useImplicitView); PHP_METHOD(Phalcon_Mvc_Application, handle); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_application_sendheadersonhandlerequest, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_application_sendheadersonhandlerequest, 0, 1, Phalcon\\Mvc\\Application, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_application_sendheadersonhandlerequest, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Application", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sendHeaders, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, sendHeaders) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_application_sendcookiesonhandlerequest, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_application_sendcookiesonhandlerequest, 0, 1, Phalcon\\Mvc\\Application, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_application_sendcookiesonhandlerequest, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Application", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sendCookies, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, sendCookies) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_application_useimplicitview, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_application_useimplicitview, 0, 1, Phalcon\\Mvc\\Application, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_application_useimplicitview, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Application", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, implicitView, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, implicitView) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_application_handle, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) +#else ZEND_ARG_INFO(0, uri) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_application_method_entry) { diff --git a/ext/phalcon/mvc/collection.zep.c b/ext/phalcon/mvc/collection.zep.c index 6fa26f3cc8b..5ed0c453d6d 100644 --- a/ext/phalcon/mvc/collection.zep.c +++ b/ext/phalcon/mvc/collection.zep.c @@ -56,19 +56,19 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection) { zend_declare_property_bool(phalcon_mvc_collection_ce, SL("_skipped"), 0, ZEND_ACC_PROTECTED TSRMLS_CC); phalcon_mvc_collection_ce->create_object = zephir_init_properties_Phalcon_Mvc_Collection; - zend_declare_class_constant_long(phalcon_mvc_collection_ce, SL("OP_NONE"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_collection_ce, SL("OP_NONE"), 0); - zend_declare_class_constant_long(phalcon_mvc_collection_ce, SL("OP_CREATE"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_collection_ce, SL("OP_CREATE"), 1); - zend_declare_class_constant_long(phalcon_mvc_collection_ce, SL("OP_UPDATE"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_collection_ce, SL("OP_UPDATE"), 2); - zend_declare_class_constant_long(phalcon_mvc_collection_ce, SL("OP_DELETE"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_collection_ce, SL("OP_DELETE"), 3); - zend_declare_class_constant_long(phalcon_mvc_collection_ce, SL("DIRTY_STATE_PERSISTENT"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_collection_ce, SL("DIRTY_STATE_PERSISTENT"), 0); - zend_declare_class_constant_long(phalcon_mvc_collection_ce, SL("DIRTY_STATE_TRANSIENT"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_collection_ce, SL("DIRTY_STATE_TRANSIENT"), 1); - zend_declare_class_constant_long(phalcon_mvc_collection_ce, SL("DIRTY_STATE_DETACHED"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_collection_ce, SL("DIRTY_STATE_DETACHED"), 2); zend_class_implements(phalcon_mvc_collection_ce TSRMLS_CC, 1, phalcon_mvc_entityinterface_ce); zend_class_implements(phalcon_mvc_collection_ce TSRMLS_CC, 1, phalcon_mvc_collectioninterface_ce); @@ -85,47 +85,54 @@ PHP_METHOD(Phalcon_Mvc_Collection, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *dependencyInjector = NULL, *modelsManager = NULL, *_1$$5; + zval *dependencyInjector = NULL, dependencyInjector_sub, *modelsManager = NULL, modelsManager_sub, __$null, _1$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&modelsManager_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &dependencyInjector, &modelsManager); if (!dependencyInjector) { - ZEPHIR_CPY_WRT(dependencyInjector, ZEPHIR_GLOBAL(global_null)); + dependencyInjector = &dependencyInjector_sub; + ZEPHIR_CPY_WRT(dependencyInjector, &__$null); } else { ZEPHIR_SEPARATE_PARAM(dependencyInjector); } if (!modelsManager) { - ZEPHIR_CPY_WRT(modelsManager, ZEPHIR_GLOBAL(global_null)); + modelsManager = &modelsManager_sub; + ZEPHIR_CPY_WRT(modelsManager, &__$null); } else { ZEPHIR_SEPARATE_PARAM(modelsManager); } if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_CALL_CE_STATIC(dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); } if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "A dependency injector container is required to obtain the services related to the ODM", "phalcon/mvc/collection.zep", 92); return; } - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); if (Z_TYPE_P(modelsManager) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_STRING(_1$$5, "collectionManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&modelsManager, dependencyInjector, "getshared", NULL, 0, _1$$5); - zephir_check_temp_parameter(_1$$5); + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_STRING(&_1$$5, "collectionManager"); + ZEPHIR_CALL_METHOD(modelsManager, dependencyInjector, "getshared", NULL, 0, &_1$$5); zephir_check_call_status(); if (Z_TYPE_P(modelsManager) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The injected service 'modelsManager' is not valid", "phalcon/mvc/collection.zep", 103); return; } } - zephir_update_property_this(getThis(), SL("_modelsManager"), modelsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelsManager"), modelsManager); ZEPHIR_CALL_METHOD(NULL, modelsManager, "initialize", NULL, 0, this_ptr); zephir_check_call_status(); - if ((zephir_method_exists_ex(this_ptr, SS("onconstruct") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(this_ptr, SL("onconstruct") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "onconstruct", NULL, 0); zephir_check_call_status(); } @@ -141,7 +148,13 @@ PHP_METHOD(Phalcon_Mvc_Collection, __construct) { PHP_METHOD(Phalcon_Mvc_Collection, setId) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, *mongoId = NULL, *_0$$3, *_1$$3 = NULL; + zval *id, id_sub, mongoId, _0$$3, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&mongoId); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &id); @@ -149,23 +162,23 @@ PHP_METHOD(Phalcon_Mvc_Collection, setId) { if (Z_TYPE_P(id) != IS_OBJECT) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1$$3, _0$$3, "isusingimplicitobjectids", NULL, 0, this_ptr); + zephir_read_property(&_0$$3, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1$$3, &_0$$3, "isusingimplicitobjectids", NULL, 0, this_ptr); zephir_check_call_status(); - if (zephir_is_true(_1$$3)) { - ZEPHIR_INIT_VAR(mongoId); - object_init_ex(mongoId, zephir_get_internal_ce(SS("mongoid") TSRMLS_CC)); - if (zephir_has_constructor(mongoId TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, mongoId, "__construct", NULL, 0, id); + if (zephir_is_true(&_1$$3)) { + ZEPHIR_INIT_VAR(&mongoId); + object_init_ex(&mongoId, zephir_get_internal_ce(SL("mongoid"))); + if (zephir_has_constructor(&mongoId TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &mongoId, "__construct", NULL, 0, id); zephir_check_call_status(); } } else { - ZEPHIR_CPY_WRT(mongoId, id); + ZEPHIR_CPY_WRT(&mongoId, id); } } else { - ZEPHIR_CPY_WRT(mongoId, id); + ZEPHIR_CPY_WRT(&mongoId, id); } - zephir_update_property_this(getThis(), SL("_id"), mongoId TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_id"), &mongoId); ZEPHIR_MM_RESTORE(); } @@ -177,7 +190,8 @@ PHP_METHOD(Phalcon_Mvc_Collection, setId) { */ PHP_METHOD(Phalcon_Mvc_Collection, getId) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_id"); @@ -188,13 +202,16 @@ PHP_METHOD(Phalcon_Mvc_Collection, getId) { */ PHP_METHOD(Phalcon_Mvc_Collection, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -203,7 +220,8 @@ PHP_METHOD(Phalcon_Mvc_Collection, setDI) { */ PHP_METHOD(Phalcon_Mvc_Collection, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -215,15 +233,19 @@ PHP_METHOD(Phalcon_Mvc_Collection, getDI) { PHP_METHOD(Phalcon_Mvc_Collection, setEventsManager) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventsManager, *_0; + zval *eventsManager, eventsManager_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &eventsManager); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "setcustomeventsmanager", NULL, 0, this_ptr, eventsManager); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "setcustomeventsmanager", NULL, 0, this_ptr, eventsManager); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -234,13 +256,16 @@ PHP_METHOD(Phalcon_Mvc_Collection, setEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Collection, getEventsManager) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getcustomeventsmanager", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getcustomeventsmanager", NULL, 0, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -251,7 +276,8 @@ PHP_METHOD(Phalcon_Mvc_Collection, getEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Collection, getCollectionManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_modelsManager"); @@ -262,26 +288,30 @@ PHP_METHOD(Phalcon_Mvc_Collection, getCollectionManager) { */ PHP_METHOD(Phalcon_Mvc_Collection, getReservedAttributes) { - zval *reserved = NULL; + zval __$true, reserved; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&reserved); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(reserved); - zephir_read_static_property_ce(&reserved, phalcon_mvc_collection_ce, SL("_reserved") TSRMLS_CC); - if (Z_TYPE_P(reserved) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(reserved); - zephir_create_array(reserved, 8, 0 TSRMLS_CC); - zephir_array_update_string(&reserved, SL("_connection"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&reserved, SL("_dependencyInjector"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&reserved, SL("_source"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&reserved, SL("_operationMade"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&reserved, SL("_errorMessages"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&reserved, SL("_dirtyState"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&reserved, SL("_modelsManager"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&reserved, SL("_skipped"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_update_static_property_ce(phalcon_mvc_collection_ce, SL("_reserved"), &reserved TSRMLS_CC); - } - RETURN_CCTOR(reserved); + ZEPHIR_OBS_VAR(&reserved); + zephir_read_static_property_ce(&reserved, phalcon_mvc_collection_ce, SL("_reserved"), PH_NOISY_CC); + if (Z_TYPE_P(&reserved) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&reserved); + zephir_create_array(&reserved, 8, 0 TSRMLS_CC); + zephir_array_update_string(&reserved, SL("_connection"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&reserved, SL("_dependencyInjector"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&reserved, SL("_source"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&reserved, SL("_operationMade"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&reserved, SL("_errorMessages"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&reserved, SL("_dirtyState"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&reserved, SL("_modelsManager"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&reserved, SL("_skipped"), &__$true, PH_COPY | PH_SEPARATE); + zend_update_static_property(phalcon_mvc_collection_ce, ZEND_STRL("_reserved"), &reserved); + } + RETURN_CCTOR(&reserved); } @@ -291,8 +321,12 @@ PHP_METHOD(Phalcon_Mvc_Collection, getReservedAttributes) { PHP_METHOD(Phalcon_Mvc_Collection, useImplicitObjectIds) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *useImplicitObjectIds_param = NULL, *_0, *_1; + zval *useImplicitObjectIds_param = NULL, _0, _1; zend_bool useImplicitObjectIds; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &useImplicitObjectIds_param); @@ -300,14 +334,13 @@ PHP_METHOD(Phalcon_Mvc_Collection, useImplicitObjectIds) { useImplicitObjectIds = zephir_get_boolval(useImplicitObjectIds_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); if (useImplicitObjectIds) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, _0, "useimplicitobjectids", NULL, 0, this_ptr, _1); + ZEPHIR_CALL_METHOD(NULL, &_0, "useimplicitobjectids", NULL, 0, this_ptr, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -319,24 +352,27 @@ PHP_METHOD(Phalcon_Mvc_Collection, useImplicitObjectIds) { PHP_METHOD(Phalcon_Mvc_Collection, setSource) { zval *source_param = NULL; - zval *source = NULL; + zval source; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&source); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &source_param); if (UNEXPECTED(Z_TYPE_P(source_param) != IS_STRING && Z_TYPE_P(source_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'source' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'source' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(source_param) == IS_STRING)) { - zephir_get_strval(source, source_param); + zephir_get_strval(&source, source_param); } else { - ZEPHIR_INIT_VAR(source); - ZVAL_EMPTY_STRING(source); + ZEPHIR_INIT_VAR(&source); + ZVAL_EMPTY_STRING(&source); } - zephir_update_property_this(getThis(), SL("_source"), source TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_source"), &source); RETURN_THIS(); } @@ -346,18 +382,24 @@ PHP_METHOD(Phalcon_Mvc_Collection, setSource) { */ PHP_METHOD(Phalcon_Mvc_Collection, getSource) { - zval *collection = NULL, *_0, *_1$$3, *_2$$3; + zval collection, _0, _1$$3, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_source"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { - ZEPHIR_CPY_WRT(collection, this_ptr); - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_INIT_VAR(_2$$3); - zephir_get_class_ns(_2$$3, collection, 0 TSRMLS_CC); - zephir_uncamelize(_1$$3, _2$$3, NULL ); - zephir_update_property_this(getThis(), SL("_source"), _1$$3 TSRMLS_CC); + zephir_read_property(&_0, this_ptr, SL("_source"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { + ZEPHIR_CPY_WRT(&collection, this_ptr); + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_INIT_VAR(&_2$$3); + zephir_get_class_ns(&_2$$3, &collection, 0 TSRMLS_CC); + zephir_uncamelize(&_1$$3, &_2$$3, NULL ); + zephir_update_property_zval(this_ptr, SL("_source"), &_1$$3); } RETURN_MM_MEMBER(getThis(), "_source"); @@ -369,26 +411,30 @@ PHP_METHOD(Phalcon_Mvc_Collection, getSource) { PHP_METHOD(Phalcon_Mvc_Collection, setConnectionService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *connectionService_param = NULL, *_0; - zval *connectionService = NULL; + zval *connectionService_param = NULL, _0; + zval connectionService; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&connectionService); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &connectionService_param); if (UNEXPECTED(Z_TYPE_P(connectionService_param) != IS_STRING && Z_TYPE_P(connectionService_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(connectionService_param) == IS_STRING)) { - zephir_get_strval(connectionService, connectionService_param); + zephir_get_strval(&connectionService, connectionService_param); } else { - ZEPHIR_INIT_VAR(connectionService); - ZVAL_EMPTY_STRING(connectionService); + ZEPHIR_INIT_VAR(&connectionService); + ZVAL_EMPTY_STRING(&connectionService); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "setconnectionservice", NULL, 0, this_ptr, connectionService); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "setconnectionservice", NULL, 0, this_ptr, &connectionService); zephir_check_call_status(); RETURN_THIS(); @@ -399,13 +445,16 @@ PHP_METHOD(Phalcon_Mvc_Collection, setConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Collection, getConnectionService) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getconnectionservice", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getconnectionservice", NULL, 0, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -418,18 +467,23 @@ PHP_METHOD(Phalcon_Mvc_Collection, getConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Collection, getConnection) { - zval *_0, *_1$$3, *_2$$3 = NULL; + zval _0, _1$$3, _2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_connection"), PH_NOISY_CC); - if (Z_TYPE_P(_0) != IS_OBJECT) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2$$3, _1$$3, "getconnection", NULL, 0, this_ptr); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_connection"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) != IS_OBJECT) { + zephir_read_property(&_1$$3, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "getconnection", NULL, 0, this_ptr); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_connection"), _2$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_connection"), &_2$$3); } RETURN_MM_MEMBER(getThis(), "_connection"); @@ -447,30 +501,34 @@ PHP_METHOD(Phalcon_Mvc_Collection, getConnection) { */ PHP_METHOD(Phalcon_Mvc_Collection, readAttribute) { - zval *attribute_param = NULL, *_0; - zval *attribute = NULL; + zval *attribute_param = NULL, _0; + zval attribute; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attribute_param); if (UNEXPECTED(Z_TYPE_P(attribute_param) != IS_STRING && Z_TYPE_P(attribute_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(attribute_param) == IS_STRING)) { - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); } else { - ZEPHIR_INIT_VAR(attribute); - ZVAL_EMPTY_STRING(attribute); + ZEPHIR_INIT_VAR(&attribute); + ZVAL_EMPTY_STRING(&attribute); } - if (!(zephir_isset_property_zval(this_ptr, attribute TSRMLS_CC))) { + if (!(zephir_isset_property_zval(this_ptr, &attribute TSRMLS_CC))) { RETURN_MM_NULL(); } - ZEPHIR_OBS_VAR(_0); - zephir_read_property_zval(&_0, this_ptr, attribute, PH_NOISY_CC); - RETURN_CCTOR(_0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property_zval(&_0, this_ptr, &attribute, PH_NOISY_CC); + RETURN_CCTOR(&_0); } @@ -486,16 +544,20 @@ PHP_METHOD(Phalcon_Mvc_Collection, readAttribute) { */ PHP_METHOD(Phalcon_Mvc_Collection, writeAttribute) { - zval *attribute_param = NULL, *value; - zval *attribute = NULL; + zval *attribute_param = NULL, *value, value_sub; + zval attribute; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &attribute_param, &value); - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); - zephir_update_property_zval_zval(getThis(), attribute, value TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, &attribute, value TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -505,38 +567,51 @@ PHP_METHOD(Phalcon_Mvc_Collection, writeAttribute) { */ PHP_METHOD(Phalcon_Mvc_Collection, cloneResult) { - HashTable *_1; - HashPosition _0; + zend_string *_2; + zend_ulong _1; zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *document = NULL; - zval *collection, *document_param = NULL, *clonedCollection = NULL, *key = NULL, *value = NULL, **_2; + zval document; + zval *collection, collection_sub, *document_param = NULL, clonedCollection, key, value, *_0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection_sub); + ZVAL_UNDEF(&clonedCollection); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&document); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &collection, &document_param); - document = document_param; + ZEPHIR_OBS_COPY_OR_DUP(&document, document_param); - ZEPHIR_INIT_VAR(clonedCollection); - if (zephir_clone(clonedCollection, collection TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&clonedCollection); + if (zephir_clone(&clonedCollection, collection TSRMLS_CC) == FAILURE) { RETURN_MM(); } - zephir_is_iterable(document, &_1, &_0, 0, 0, "phalcon/mvc/collection.zep", 334); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(key, _1, _0); - ZEPHIR_GET_HVALUE(value, _2); - ZEPHIR_CALL_METHOD(NULL, clonedCollection, "writeattribute", &_3, 0, key, value); + zephir_is_iterable(&document, 0, "phalcon/mvc/collection.zep", 334); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&document), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&key); + if (_2 != NULL) { + ZVAL_STR_COPY(&key, _2); + } else { + ZVAL_LONG(&key, _1); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + ZEPHIR_CALL_METHOD(NULL, &clonedCollection, "writeattribute", &_3, 0, &key, &value); zephir_check_call_status(); - } - if ((zephir_method_exists_ex(clonedCollection, SS("afterfetch") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(NULL, clonedCollection, "afterfetch", NULL, 0); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + if ((zephir_method_exists_ex(&clonedCollection, SL("afterfetch") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD(NULL, &clonedCollection, "afterfetch", NULL, 0); zephir_check_call_status(); } - RETURN_CCTOR(clonedCollection); + RETURN_CCTOR(&clonedCollection); } @@ -552,12 +627,34 @@ PHP_METHOD(Phalcon_Mvc_Collection, cloneResult) { PHP_METHOD(Phalcon_Mvc_Collection, _getResultset) { zend_class_entry *_1$$3; - HashTable *_8; - HashPosition _7; - zephir_fcall_cache_entry *_11 = NULL; + zephir_fcall_cache_entry *_9 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool unique, _2$$3; - zval *params, *collection, *connection, *unique_param = NULL, *source = NULL, *mongoCollection = NULL, *conditions = NULL, *base = NULL, *documentsCursor = NULL, *fields = NULL, *skip = NULL, *limit = NULL, *sort = NULL, *document = NULL, *collections = NULL, *className = NULL, *_6 = NULL, **_9, *_0$$3 = NULL, *_3$$4, *_4$$4, *_5$$6, *_10$$19 = NULL; + zval *params, params_sub, *collection, collection_sub, *connection, connection_sub, *unique_param = NULL, __$false, source, mongoCollection, conditions, base, documentsCursor, fields, skip, limit, sort, document, collections, className, _6, *_7, _0$$3, _3$$4, _4$$4, _5$$6, _8$$19; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶ms_sub); + ZVAL_UNDEF(&collection_sub); + ZVAL_UNDEF(&connection_sub); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&mongoCollection); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&base); + ZVAL_UNDEF(&documentsCursor); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&skip); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&sort); + ZVAL_UNDEF(&document); + ZVAL_UNDEF(&collections); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_8$$19); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, ¶ms, &collection, &connection, &unique_param); @@ -565,114 +662,113 @@ PHP_METHOD(Phalcon_Mvc_Collection, _getResultset) { unique = zephir_get_boolval(unique_param); - ZEPHIR_OBS_VAR(className); - if (zephir_array_isset_string_fetch(&className, params, SS("class"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(base); - zephir_fetch_safe_class(_0$$3, className); - _1$$3 = zend_fetch_class(Z_STRVAL_P(_0$$3), Z_STRLEN_P(_0$$3), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(base, _1$$3); - if (zephir_has_constructor(base TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, base, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&className); + if (zephir_array_isset_string_fetch(&className, params, SL("class"), 0)) { + ZEPHIR_INIT_VAR(&base); + zephir_fetch_safe_class(&_0$$3, &className); + _1$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_0$$3), Z_STRLEN_P(&_0$$3), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&base, _1$$3); + if (zephir_has_constructor(&base TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &base, "__construct", NULL, 0); zephir_check_call_status(); } - _2$$3 = zephir_instance_of_ev(base, phalcon_mvc_collectioninterface_ce TSRMLS_CC); + _2$$3 = zephir_instance_of_ev(&base, phalcon_mvc_collectioninterface_ce TSRMLS_CC); if (!(_2$$3)) { - _2$$3 = zephir_instance_of_ev(base, phalcon_mvc_collection_document_ce TSRMLS_CC); + _2$$3 = zephir_instance_of_ev(&base, phalcon_mvc_collection_document_ce TSRMLS_CC); } if (!(_2$$3)) { - ZEPHIR_INIT_VAR(_3$$4); - object_init_ex(_3$$4, phalcon_mvc_collection_exception_ce); - ZEPHIR_INIT_VAR(_4$$4); - ZEPHIR_CONCAT_SVS(_4$$4, "Object of class '", className, "' must be an implementation of Phalcon\\Mvc\\CollectionInterface or an instance of Phalcon\\Mvc\\Collection\\Document"); - ZEPHIR_CALL_METHOD(NULL, _3$$4, "__construct", NULL, 9, _4$$4); + ZEPHIR_INIT_VAR(&_3$$4); + object_init_ex(&_3$$4, phalcon_mvc_collection_exception_ce); + ZEPHIR_INIT_VAR(&_4$$4); + ZEPHIR_CONCAT_SVS(&_4$$4, "Object of class '", &className, "' must be an implementation of Phalcon\\Mvc\\CollectionInterface or an instance of Phalcon\\Mvc\\Collection\\Document"); + ZEPHIR_CALL_METHOD(NULL, &_3$$4, "__construct", NULL, 4, &_4$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$4, "phalcon/mvc/collection.zep", 364 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$4, "phalcon/mvc/collection.zep", 364 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(base, collection); + ZEPHIR_CPY_WRT(&base, collection); } - if (zephir_instance_of_ev(base, phalcon_mvc_collection_ce TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_5$$6); - ZVAL_LONG(_5$$6, 0); - ZEPHIR_CALL_METHOD(NULL, base, "setdirtystate", NULL, 0, _5$$6); + if (zephir_instance_of_ev(&base, phalcon_mvc_collection_ce TSRMLS_CC)) { + ZVAL_LONG(&_5$$6, 0); + ZEPHIR_CALL_METHOD(NULL, &base, "setdirtystate", NULL, 0, &_5$$6); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&source, collection, "getsource", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(source)) { + if (ZEPHIR_IS_EMPTY(&source)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Method getSource() returns empty string", "phalcon/mvc/collection.zep", 376); return; } - ZEPHIR_CALL_METHOD(&mongoCollection, connection, "selectcollection", NULL, 0, source); + ZEPHIR_CALL_METHOD(&mongoCollection, connection, "selectcollection", NULL, 0, &source); zephir_check_call_status(); - if (Z_TYPE_P(mongoCollection) != IS_OBJECT) { + if (Z_TYPE_P(&mongoCollection) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Couldn't select mongo collection", "phalcon/mvc/collection.zep", 382); return; } - ZEPHIR_OBS_VAR(conditions); + ZEPHIR_OBS_VAR(&conditions); if (!(zephir_array_isset_long_fetch(&conditions, params, 0, 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(conditions); - if (!(zephir_array_isset_string_fetch(&conditions, params, SS("conditions"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(conditions); - array_init(conditions); + ZEPHIR_OBS_NVAR(&conditions); + if (!(zephir_array_isset_string_fetch(&conditions, params, SL("conditions"), 0))) { + ZEPHIR_INIT_NVAR(&conditions); + array_init(&conditions); } } - if (Z_TYPE_P(conditions) != IS_ARRAY) { + if (Z_TYPE_P(&conditions) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Find parameters must be an array", "phalcon/mvc/collection.zep", 395); return; } - ZEPHIR_OBS_VAR(fields); - if (zephir_array_isset_string_fetch(&fields, params, SS("fields"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&documentsCursor, mongoCollection, "find", NULL, 0, conditions, fields); + ZEPHIR_OBS_VAR(&fields); + if (zephir_array_isset_string_fetch(&fields, params, SL("fields"), 0)) { + ZEPHIR_CALL_METHOD(&documentsCursor, &mongoCollection, "find", NULL, 0, &conditions, &fields); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&documentsCursor, mongoCollection, "find", NULL, 0, conditions); + ZEPHIR_CALL_METHOD(&documentsCursor, &mongoCollection, "find", NULL, 0, &conditions); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(limit); - if (zephir_array_isset_string_fetch(&limit, params, SS("limit"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, documentsCursor, "limit", NULL, 0, limit); + ZEPHIR_OBS_VAR(&limit); + if (zephir_array_isset_string_fetch(&limit, params, SL("limit"), 0)) { + ZEPHIR_CALL_METHOD(NULL, &documentsCursor, "limit", NULL, 0, &limit); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(sort); - if (zephir_array_isset_string_fetch(&sort, params, SS("sort"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, documentsCursor, "sort", NULL, 0, sort); + ZEPHIR_OBS_VAR(&sort); + if (zephir_array_isset_string_fetch(&sort, params, SL("sort"), 0)) { + ZEPHIR_CALL_METHOD(NULL, &documentsCursor, "sort", NULL, 0, &sort); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(skip); - if (zephir_array_isset_string_fetch(&skip, params, SS("skip"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, documentsCursor, "skip", NULL, 0, skip); + ZEPHIR_OBS_VAR(&skip); + if (zephir_array_isset_string_fetch(&skip, params, SL("skip"), 0)) { + ZEPHIR_CALL_METHOD(NULL, &documentsCursor, "skip", NULL, 0, &skip); zephir_check_call_status(); } if (unique == 1) { - ZEPHIR_CALL_METHOD(NULL, documentsCursor, "rewind", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &documentsCursor, "rewind", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&document, documentsCursor, "current", NULL, 0); + ZEPHIR_CALL_METHOD(&document, &documentsCursor, "current", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(document) != IS_ARRAY) { + if (Z_TYPE_P(&document) != IS_ARRAY) { RETURN_MM_BOOL(0); } - ZEPHIR_RETURN_CALL_STATIC("cloneresult", NULL, 0, base, document); + ZEPHIR_RETURN_CALL_STATIC("cloneresult", NULL, 0, &base, &document); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(collections); - array_init(collections); - ZEPHIR_CALL_FUNCTION(&_6, "iterator_to_array", NULL, 318, documentsCursor, ZEPHIR_GLOBAL(global_false)); - zephir_check_call_status(); - zephir_is_iterable(_6, &_8, &_7, 0, 0, "phalcon/mvc/collection.zep", 459); - for ( - ; zend_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS - ; zend_hash_move_forward_ex(_8, &_7) - ) { - ZEPHIR_GET_HVALUE(document, _9); - ZEPHIR_CALL_STATIC(&_10$$19, "cloneresult", &_11, 0, base, document); + ZEPHIR_INIT_VAR(&collections); + array_init(&collections); + ZEPHIR_CALL_FUNCTION(&_6, "iterator_to_array", NULL, 278, &documentsCursor, &__$false); + zephir_check_call_status(); + zephir_is_iterable(&_6, 0, "phalcon/mvc/collection.zep", 459); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_6), _7) + { + ZEPHIR_INIT_NVAR(&document); + ZVAL_COPY(&document, _7); + ZEPHIR_CALL_STATIC(&_8$$19, "cloneresult", &_9, 0, &base, &document); zephir_check_call_status(); - zephir_array_append(&collections, _10$$19, PH_SEPARATE, "phalcon/mvc/collection.zep", 456); - } - RETURN_CCTOR(collections); + zephir_array_append(&collections, &_8$$19, PH_SEPARATE, "phalcon/mvc/collection.zep", 456); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&document); + RETURN_CCTOR(&collections); } @@ -688,7 +784,18 @@ PHP_METHOD(Phalcon_Mvc_Collection, _getGroupResultset) { zend_bool _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *params, *collection, *connection, *source = NULL, *mongoCollection = NULL, *conditions = NULL, *limit = NULL, *sort = NULL, *documentsCursor = NULL; + zval *params, params_sub, *collection, collection_sub, *connection, connection_sub, source, mongoCollection, conditions, limit, sort, documentsCursor; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶ms_sub); + ZVAL_UNDEF(&collection_sub); + ZVAL_UNDEF(&connection_sub); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&mongoCollection); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&sort); + ZVAL_UNDEF(&documentsCursor); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, ¶ms, &collection, &connection); @@ -697,49 +804,49 @@ PHP_METHOD(Phalcon_Mvc_Collection, _getGroupResultset) { ZEPHIR_CALL_METHOD(&source, collection, "getsource", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(source)) { + if (ZEPHIR_IS_EMPTY(&source)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Method getSource() returns empty string", "phalcon/mvc/collection.zep", 476); return; } - ZEPHIR_CALL_METHOD(&mongoCollection, connection, "selectcollection", NULL, 0, source); + ZEPHIR_CALL_METHOD(&mongoCollection, connection, "selectcollection", NULL, 0, &source); zephir_check_call_status(); - ZEPHIR_OBS_VAR(conditions); + ZEPHIR_OBS_VAR(&conditions); if (!(zephir_array_isset_long_fetch(&conditions, params, 0, 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(conditions); - if (!(zephir_array_isset_string_fetch(&conditions, params, SS("conditions"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(conditions); - array_init(conditions); + ZEPHIR_OBS_NVAR(&conditions); + if (!(zephir_array_isset_string_fetch(&conditions, params, SL("conditions"), 0))) { + ZEPHIR_INIT_NVAR(&conditions); + array_init(&conditions); } } - _0 = zephir_array_isset_string(params, SS("limit")); + _0 = zephir_array_isset_string(params, SL("limit")); if (!(_0)) { - _0 = zephir_array_isset_string(params, SS("sort")); + _0 = zephir_array_isset_string(params, SL("sort")); } _1 = _0; if (!(_1)) { - _1 = zephir_array_isset_string(params, SS("skip")); + _1 = zephir_array_isset_string(params, SL("skip")); } if (_1) { - ZEPHIR_CALL_METHOD(&documentsCursor, mongoCollection, "find", NULL, 0, conditions); + ZEPHIR_CALL_METHOD(&documentsCursor, &mongoCollection, "find", NULL, 0, &conditions); zephir_check_call_status(); - ZEPHIR_OBS_VAR(limit); - if (zephir_array_isset_string_fetch(&limit, params, SS("limit"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, documentsCursor, "limit", NULL, 0, limit); + ZEPHIR_OBS_VAR(&limit); + if (zephir_array_isset_string_fetch(&limit, params, SL("limit"), 0)) { + ZEPHIR_CALL_METHOD(NULL, &documentsCursor, "limit", NULL, 0, &limit); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(sort); - if (zephir_array_isset_string_fetch(&sort, params, SS("sort"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, documentsCursor, "sort", NULL, 0, sort); + ZEPHIR_OBS_VAR(&sort); + if (zephir_array_isset_string_fetch(&sort, params, SL("sort"), 0)) { + ZEPHIR_CALL_METHOD(NULL, &documentsCursor, "sort", NULL, 0, &sort); zephir_check_call_status(); } - ZEPHIR_OBS_NVAR(sort); - if (zephir_array_isset_string_fetch(&sort, params, SS("skip"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, documentsCursor, "skip", NULL, 0, sort); + ZEPHIR_OBS_NVAR(&sort); + if (zephir_array_isset_string_fetch(&sort, params, SL("skip"), 0)) { + ZEPHIR_CALL_METHOD(NULL, &documentsCursor, "skip", NULL, 0, &sort); zephir_check_call_status(); } - RETURN_MM_LONG(zephir_fast_count_int(documentsCursor TSRMLS_CC)); + RETURN_MM_LONG(zephir_fast_count_int(&documentsCursor TSRMLS_CC)); } - ZEPHIR_RETURN_CALL_METHOD(mongoCollection, "count", NULL, 0, conditions); + ZEPHIR_RETURN_CALL_METHOD(&mongoCollection, "count", NULL, 0, &conditions); zephir_check_call_status(); RETURN_MM(); @@ -757,7 +864,22 @@ PHP_METHOD(Phalcon_Mvc_Collection, _preSave) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool disableEvents, exists; - zval *dependencyInjector, *disableEvents_param = NULL, *exists_param = NULL, *eventName = NULL, *_3 = NULL, *_4, *_0$$3 = NULL, *_1$$3, *_2$$3 = NULL, *_5$$9, *_6$$10 = NULL, *_7$$10 = NULL, *_8$$10 = NULL, *_9$$10 = NULL, *_10$$10 = NULL; + zval *dependencyInjector, dependencyInjector_sub, *disableEvents_param = NULL, *exists_param = NULL, eventName, _3, _4, _0$$3, _1$$3, _2$$3, _5$$9, _6$$10, _7$$10, _8$$10, _9$$10, _10$$10; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&_7$$10); + ZVAL_UNDEF(&_8$$10); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_10$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &dependencyInjector, &disableEvents_param, &exists_param); @@ -767,78 +889,73 @@ PHP_METHOD(Phalcon_Mvc_Collection, _preSave) { if (!(disableEvents)) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "beforeValidation", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "fireeventcancel", NULL, 0, _1$$3); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "beforeValidation"); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "fireeventcancel", NULL, 0, &_1$$3); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0$$3)) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(eventName); + ZEPHIR_INIT_VAR(&eventName); if (!(exists)) { - ZVAL_STRING(eventName, "beforeValidationOnCreate", 1); + ZVAL_STRING(&eventName, "beforeValidationOnCreate"); } else { - ZVAL_STRING(eventName, "beforeValidationOnUpdate", 1); + ZVAL_STRING(&eventName, "beforeValidationOnUpdate"); } - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "fireeventcancel", NULL, 0, eventName); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "fireeventcancel", NULL, 0, &eventName); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_2$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_2$$3)) { RETURN_MM_BOOL(0); } } - ZEPHIR_INIT_VAR(_4); - ZVAL_STRING(_4, "validation", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "fireeventcancel", NULL, 0, _4); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "validation"); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "fireeventcancel", NULL, 0, &_4); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_3)) { if (!(disableEvents)) { - ZEPHIR_INIT_VAR(_5$$9); - ZVAL_STRING(_5$$9, "onValidationFails", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _5$$9); - zephir_check_temp_parameter(_5$$9); + ZEPHIR_INIT_VAR(&_5$$9); + ZVAL_STRING(&_5$$9, "onValidationFails"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_5$$9); zephir_check_call_status(); } RETURN_MM_BOOL(0); } if (!(disableEvents)) { - ZEPHIR_INIT_NVAR(eventName); + ZEPHIR_INIT_NVAR(&eventName); if (!(exists)) { - ZVAL_STRING(eventName, "afterValidationOnCreate", 1); + ZVAL_STRING(&eventName, "afterValidationOnCreate"); } else { - ZVAL_STRING(eventName, "afterValidationOnUpdate", 1); + ZVAL_STRING(&eventName, "afterValidationOnUpdate"); } - ZEPHIR_CALL_METHOD(&_6$$10, this_ptr, "fireeventcancel", NULL, 0, eventName); + ZEPHIR_CALL_METHOD(&_6$$10, this_ptr, "fireeventcancel", NULL, 0, &eventName); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_6$$10)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$10)) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(_8$$10); - ZVAL_STRING(_8$$10, "afterValidation", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_7$$10, this_ptr, "fireeventcancel", NULL, 0, _8$$10); - zephir_check_temp_parameter(_8$$10); + ZEPHIR_INIT_VAR(&_8$$10); + ZVAL_STRING(&_8$$10, "afterValidation"); + ZEPHIR_CALL_METHOD(&_7$$10, this_ptr, "fireeventcancel", NULL, 0, &_8$$10); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_7$$10)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_7$$10)) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_NVAR(_8$$10); - ZVAL_STRING(_8$$10, "beforeSave", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_9$$10, this_ptr, "fireeventcancel", NULL, 0, _8$$10); - zephir_check_temp_parameter(_8$$10); + ZEPHIR_INIT_NVAR(&_8$$10); + ZVAL_STRING(&_8$$10, "beforeSave"); + ZEPHIR_CALL_METHOD(&_9$$10, this_ptr, "fireeventcancel", NULL, 0, &_8$$10); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_9$$10)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_9$$10)) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_NVAR(eventName); + ZEPHIR_INIT_NVAR(&eventName); if (exists) { - ZVAL_STRING(eventName, "beforeUpdate", 1); + ZVAL_STRING(&eventName, "beforeUpdate"); } else { - ZVAL_STRING(eventName, "beforeCreate", 1); + ZVAL_STRING(&eventName, "beforeCreate"); } - ZEPHIR_CALL_METHOD(&_10$$10, this_ptr, "fireeventcancel", NULL, 0, eventName); + ZEPHIR_CALL_METHOD(&_10$$10, this_ptr, "fireeventcancel", NULL, 0, &eventName); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_10$$10)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_10$$10)) { RETURN_MM_BOOL(0); } } @@ -852,8 +969,14 @@ PHP_METHOD(Phalcon_Mvc_Collection, _preSave) { PHP_METHOD(Phalcon_Mvc_Collection, _postSave) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *disableEvents_param = NULL, *success_param = NULL, *exists_param = NULL, *eventName = NULL, *_2, *_0$$4, *_1$$7; + zval *disableEvents_param = NULL, *success_param = NULL, *exists_param = NULL, eventName, _2, _0$$4, _1$$7; zend_bool disableEvents, success, exists; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &disableEvents_param, &success_param, &exists_param); @@ -865,36 +988,33 @@ PHP_METHOD(Phalcon_Mvc_Collection, _postSave) { if (success) { if (!(disableEvents)) { - ZEPHIR_INIT_VAR(eventName); + ZEPHIR_INIT_VAR(&eventName); if (exists) { - ZVAL_STRING(eventName, "afterUpdate", 1); + ZVAL_STRING(&eventName, "afterUpdate"); } else { - ZVAL_STRING(eventName, "afterCreate", 1); + ZVAL_STRING(&eventName, "afterCreate"); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, eventName); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &eventName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_0$$4); - ZVAL_STRING(_0$$4, "afterSave", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _0$$4); - zephir_check_temp_parameter(_0$$4); + ZEPHIR_INIT_VAR(&_0$$4); + ZVAL_STRING(&_0$$4, "afterSave"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_0$$4); zephir_check_call_status(); } RETURN_MM_BOOL(success); } if (!(disableEvents)) { - ZEPHIR_INIT_VAR(_1$$7); - ZVAL_STRING(_1$$7, "notSave", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _1$$7); - zephir_check_temp_parameter(_1$$7); + ZEPHIR_INIT_VAR(&_1$$7); + ZVAL_STRING(&_1$$7, "notSave"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_1$$7); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_2); if (disableEvents) { - ZVAL_BOOL(_2, 1); + ZVAL_BOOL(&_2, 1); } else { - ZVAL_BOOL(_2, 0); + ZVAL_BOOL(&_2, 0); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_canceloperation", NULL, 0, _2); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_canceloperation", NULL, 0, &_2); zephir_check_call_status(); RETURN_MM_BOOL(0); @@ -951,11 +1071,22 @@ PHP_METHOD(Phalcon_Mvc_Collection, _postSave) { */ PHP_METHOD(Phalcon_Mvc_Collection, validate) { - HashTable *_3$$4; - HashPosition _2$$4; - zephir_fcall_cache_entry *_7 = NULL, *_12 = NULL, *_13 = NULL, *_14 = NULL; + zephir_fcall_cache_entry *_5 = NULL, *_10 = NULL, *_11 = NULL, *_12 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *validator, *messages = NULL, *message = NULL, *_0$$3 = NULL, *_1$$4 = NULL, **_4$$4, *_5$$6, *_6$$7 = NULL, *_8$$8 = NULL, *_9$$8 = NULL, *_10$$8 = NULL, *_11$$8 = NULL; + zval *validator, validator_sub, messages, message, _0$$3, _1$$4, *_2$$4, _3$$6, _4$$7, _6$$8, _7$$8, _8$$8, _9$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&validator_sub); + ZVAL_UNDEF(&messages); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &validator); @@ -965,52 +1096,51 @@ PHP_METHOD(Phalcon_Mvc_Collection, validate) { if (zephir_instance_of_ev(validator, phalcon_mvc_model_validatorinterface_ce TSRMLS_CC)) { ZEPHIR_CALL_METHOD(&_0$$3, validator, "validate", NULL, 0, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0$$3)) { ZEPHIR_CALL_METHOD(&_1$$4, validator, "getmessages", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_1$$4, &_3$$4, &_2$$4, 0, 0, "phalcon/mvc/collection.zep", 700); - for ( - ; zend_hash_get_current_data_ex(_3$$4, (void**) &_4$$4, &_2$$4) == SUCCESS - ; zend_hash_move_forward_ex(_3$$4, &_2$$4) - ) { - ZEPHIR_GET_HVALUE(message, _4$$4); - zephir_update_property_array_append(this_ptr, SL("_errorMessages"), message TSRMLS_CC); - } + zephir_is_iterable(&_1$$4, 0, "phalcon/mvc/collection.zep", 700); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_1$$4), _2$$4) + { + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _2$$4); + zephir_update_property_array_append(this_ptr, SL("_errorMessages"), &message TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); } } else if (zephir_instance_of_ev(validator, phalcon_validationinterface_ce TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_5$$6); - ZVAL_NULL(_5$$6); - ZEPHIR_CALL_METHOD(&messages, validator, "validate", NULL, 0, _5$$6, this_ptr); + ZVAL_NULL(&_3$$6); + ZEPHIR_CALL_METHOD(&messages, validator, "validate", NULL, 0, &_3$$6, this_ptr); zephir_check_call_status(); - if (Z_TYPE_P(messages) != IS_BOOL) { - ZEPHIR_CALL_METHOD(NULL, messages, "rewind", NULL, 0); + if (((Z_TYPE_P(&messages) == IS_TRUE || Z_TYPE_P(&messages) == IS_FALSE) != 1)) { + ZEPHIR_CALL_METHOD(NULL, &messages, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_6$$7, messages, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_4$$7, &messages, "valid", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_6$$7))) { + if (!(zephir_is_true(&_4$$7))) { break; } - ZEPHIR_CALL_METHOD(&message, messages, "current", &_7, 0); + ZEPHIR_CALL_METHOD(&message, &messages, "current", &_5, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_8$$8); - object_init_ex(_8$$8, phalcon_mvc_model_message_ce); - ZEPHIR_CALL_METHOD(&_9$$8, message, "getmessage", NULL, 0); + ZEPHIR_INIT_NVAR(&_6$$8); + object_init_ex(&_6$$8, phalcon_mvc_model_message_ce); + ZEPHIR_CALL_METHOD(&_7$$8, &message, "getmessage", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_10$$8, message, "getfield", NULL, 0); + ZEPHIR_CALL_METHOD(&_8$$8, &message, "getfield", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$8, message, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(&_9$$8, &message, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _8$$8, "__construct", &_12, 8, _9$$8, _10$$8, _11$$8); + ZEPHIR_CALL_METHOD(NULL, &_6$$8, "__construct", &_10, 3, &_7$$8, &_8$$8, &_9$$8); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_13, 0, _8$$8); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_11, 0, &_6$$8); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, messages, "next", &_14, 0); + ZEPHIR_CALL_METHOD(NULL, &messages, "next", &_12, 0); zephir_check_call_status(); } - RETURN_MM_BOOL(!(zephir_fast_count_int(messages TSRMLS_CC))); + RETURN_MM_BOOL(!(zephir_fast_count_int(&messages TSRMLS_CC))); } - RETURN_CCTOR(messages); + RETURN_CCTOR(&messages); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "You should pass Phalcon\\Mvc\\Model\\ValidatorInterface or Phalcon\\ValidationInterface object", "phalcon/mvc/collection.zep", 732); return; @@ -1047,11 +1177,14 @@ PHP_METHOD(Phalcon_Mvc_Collection, validate) { */ PHP_METHOD(Phalcon_Mvc_Collection, validationHasFailed) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_errorMessages"), PH_NOISY_CC); - RETURN_BOOL((zephir_fast_count_int(_0 TSRMLS_CC) > 0)); + zephir_read_property(&_0, this_ptr, SL("_errorMessages"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL((zephir_fast_count_int(&_0 TSRMLS_CC) > 0)); } @@ -1061,30 +1194,34 @@ PHP_METHOD(Phalcon_Mvc_Collection, validationHasFailed) { PHP_METHOD(Phalcon_Mvc_Collection, fireEvent) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventName_param = NULL, *_0; - zval *eventName = NULL; + zval *eventName_param = NULL, _0; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &eventName_param); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } - if ((zephir_method_exists(this_ptr, eventName TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, eventName, NULL, 0); + if ((zephir_method_exists(this_ptr, &eventName TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &eventName, NULL, 0); zephir_check_call_status(); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "notifyevent", NULL, 0, eventName, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "notifyevent", NULL, 0, &eventName, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -1096,35 +1233,41 @@ PHP_METHOD(Phalcon_Mvc_Collection, fireEvent) { PHP_METHOD(Phalcon_Mvc_Collection, fireEventCancel) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventName_param = NULL, *_0$$3 = NULL, *_1, *_2 = NULL; - zval *eventName = NULL; + zval *eventName_param = NULL, _0$$3, _1, _2; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &eventName_param); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } - if ((zephir_method_exists(this_ptr, eventName TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(&_0$$3, this_ptr, eventName, NULL, 0); + if ((zephir_method_exists(this_ptr, &eventName TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD_ZVAL(&_0$$3, this_ptr, &eventName, NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0$$3)) { RETURN_MM_BOOL(0); } } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "notifyevent", NULL, 0, eventName, this_ptr); + zephir_read_property(&_1, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "notifyevent", NULL, 0, &eventName, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_2)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_2)) { RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1); @@ -1137,8 +1280,12 @@ PHP_METHOD(Phalcon_Mvc_Collection, fireEventCancel) { PHP_METHOD(Phalcon_Mvc_Collection, _cancelOperation) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *disableEvents_param = NULL, *eventName = NULL, *_0$$3; + zval *disableEvents_param = NULL, eventName, _0$$3; zend_bool disableEvents; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &disableEvents_param); @@ -1147,14 +1294,14 @@ PHP_METHOD(Phalcon_Mvc_Collection, _cancelOperation) { if (!(disableEvents)) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_operationMade"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(eventName); - if (ZEPHIR_IS_LONG(_0$$3, 3)) { - ZVAL_STRING(eventName, "notDeleted", 1); + zephir_read_property(&_0$$3, this_ptr, SL("_operationMade"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&eventName); + if (ZEPHIR_IS_LONG(&_0$$3, 3)) { + ZVAL_STRING(&eventName, "notDeleted"); } else { - ZVAL_STRING(eventName, "notSaved", 1); + ZVAL_STRING(&eventName, "notSaved"); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, eventName); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &eventName); zephir_check_call_status(); } RETURN_MM_BOOL(0); @@ -1169,56 +1316,68 @@ PHP_METHOD(Phalcon_Mvc_Collection, _cancelOperation) { */ PHP_METHOD(Phalcon_Mvc_Collection, _exists) { - zval *_4; + zval _4; zend_bool exists = 0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collection, *id = NULL, *mongoId = NULL, *_2, *_3 = NULL, *_0$$5, *_1$$5 = NULL, *_5$$9, *_6$$10; + zval *collection, collection_sub, id, mongoId, _2, _3, _0$$5, _1$$5, _5$$9, _6$$10; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection_sub); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&mongoId); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &collection); - ZEPHIR_OBS_VAR(id); + ZEPHIR_OBS_VAR(&id); if (!(zephir_fetch_property(&id, this_ptr, SL("_id"), PH_SILENT_CC))) { RETURN_MM_BOOL(0); } - if (Z_TYPE_P(id) == IS_OBJECT) { - ZEPHIR_CPY_WRT(mongoId, id); + if (Z_TYPE_P(&id) == IS_OBJECT) { + ZEPHIR_CPY_WRT(&mongoId, &id); } else { - _0$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1$$5, _0$$5, "isusingimplicitobjectids", NULL, 0, this_ptr); + zephir_read_property(&_0$$5, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1$$5, &_0$$5, "isusingimplicitobjectids", NULL, 0, this_ptr); zephir_check_call_status(); - if (zephir_is_true(_1$$5)) { - ZEPHIR_INIT_NVAR(mongoId); - object_init_ex(mongoId, zephir_get_internal_ce(SS("mongoid") TSRMLS_CC)); - if (zephir_has_constructor(mongoId TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, mongoId, "__construct", NULL, 0, id); + if (zephir_is_true(&_1$$5)) { + ZEPHIR_INIT_NVAR(&mongoId); + object_init_ex(&mongoId, zephir_get_internal_ce(SL("mongoid"))); + if (zephir_has_constructor(&mongoId TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &mongoId, "__construct", NULL, 0, &id); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_id"), mongoId TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_id"), &mongoId); } else { - ZEPHIR_CPY_WRT(mongoId, id); + ZEPHIR_CPY_WRT(&mongoId, &id); } } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_dirtyState"), PH_NOISY_CC); - if (!(zephir_is_true(_2))) { + zephir_read_property(&_2, this_ptr, SL("_dirtyState"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_2))) { RETURN_MM_BOOL(1); } - ZEPHIR_INIT_VAR(_4); - zephir_create_array(_4, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4); + zephir_create_array(&_4, 1, 0 TSRMLS_CC); zephir_array_update_string(&_4, SL("_id"), &mongoId, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_3, collection, "count", NULL, 0, _4); + ZEPHIR_CALL_METHOD(&_3, collection, "count", NULL, 0, &_4); zephir_check_call_status(); - exists = ZEPHIR_GT_LONG(_3, 0); + exists = ZEPHIR_GT_LONG(&_3, 0); if (exists) { ZEPHIR_INIT_ZVAL_NREF(_5$$9); - ZVAL_LONG(_5$$9, 0); - zephir_update_property_this(getThis(), SL("_dirtyState"), _5$$9 TSRMLS_CC); + ZVAL_LONG(&_5$$9, 0); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_5$$9); } else { ZEPHIR_INIT_ZVAL_NREF(_6$$10); - ZVAL_LONG(_6$$10, 1); - zephir_update_property_this(getThis(), SL("_dirtyState"), _6$$10 TSRMLS_CC); + ZVAL_LONG(&_6$$10, 1); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_6$$10); } RETURN_MM_BOOL(exists); @@ -1249,7 +1408,8 @@ PHP_METHOD(Phalcon_Mvc_Collection, _exists) { */ PHP_METHOD(Phalcon_Mvc_Collection, getMessages) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_errorMessages"); @@ -1278,7 +1438,10 @@ PHP_METHOD(Phalcon_Mvc_Collection, getMessages) { */ PHP_METHOD(Phalcon_Mvc_Collection, appendMessage) { - zval *message; + zval *message, message_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message_sub); zephir_fetch_params(0, 1, 0, &message); @@ -1294,28 +1457,34 @@ PHP_METHOD(Phalcon_Mvc_Collection, appendMessage) { */ PHP_METHOD(Phalcon_Mvc_Collection, prepareCU) { - zval *dependencyInjector = NULL, *connection = NULL, *source = NULL, *collection = NULL; + zval dependencyInjector, connection, source, collection; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&collection); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "A dependency injector container is required to obtain the services related to the ODM", "phalcon/mvc/collection.zep", 941); return; } ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(source)) { + if (ZEPHIR_IS_EMPTY(&source)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Method getSource() returns empty string", "phalcon/mvc/collection.zep", 946); return; } ZEPHIR_CALL_METHOD(&connection, this_ptr, "getconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&collection, connection, "selectcollection", NULL, 0, source); + ZEPHIR_CALL_METHOD(&collection, &connection, "selectcollection", NULL, 0, &source); zephir_check_call_status(); - RETURN_CCTOR(collection); + RETURN_CCTOR(&collection); } @@ -1324,69 +1493,87 @@ PHP_METHOD(Phalcon_Mvc_Collection, prepareCU) { */ PHP_METHOD(Phalcon_Mvc_Collection, save) { - zval *_6; + zval _6; zend_bool success = 0; - zval *exists = NULL, *data = NULL, *status = NULL, *id = NULL, *ok = NULL, *collection = NULL, *_2, *_3 = NULL, *_4, *_5, *_8, *_9, *_0$$3, *_1$$4, *_7$$9; + zval __$true, exists, data, status, id, ok, collection, _2, _3, _4, _5, _8, _9, _0$$3, _1$$4, _7$$9; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&exists); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&ok); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&collection, this_ptr, "preparecu", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&exists, this_ptr, "_exists", NULL, 0, collection); + ZEPHIR_CALL_METHOD(&exists, this_ptr, "_exists", NULL, 0, &collection); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(exists)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&exists)) { ZEPHIR_INIT_ZVAL_NREF(_0$$3); - ZVAL_LONG(_0$$3, 1); - zephir_update_property_this(getThis(), SL("_operationMade"), _0$$3 TSRMLS_CC); + ZVAL_LONG(&_0$$3, 1); + zephir_update_property_zval(this_ptr, SL("_operationMade"), &_0$$3); } else { ZEPHIR_INIT_ZVAL_NREF(_1$$4); - ZVAL_LONG(_1$$4, 2); - zephir_update_property_this(getThis(), SL("_operationMade"), _1$$4 TSRMLS_CC); + ZVAL_LONG(&_1$$4, 2); + zephir_update_property_zval(this_ptr, SL("_operationMade"), &_1$$4); } - ZEPHIR_INIT_VAR(_2); - array_init(_2); - zephir_update_property_this(getThis(), SL("_errorMessages"), _2 TSRMLS_CC); - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - _5 = zephir_fetch_static_property_ce(phalcon_mvc_collection_ce, SL("_disableEvents") TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "_presave", NULL, 319, _4, _5, exists); + ZEPHIR_INIT_VAR(&_2); + array_init(&_2); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_2); + zephir_read_property(&_4, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + zephir_read_static_property_ce(&_5, phalcon_mvc_collection_ce, SL("_disableEvents"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "_presave", NULL, 279, &_4, &_5, &exists); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_3)) { RETURN_MM_BOOL(0); } ZEPHIR_CALL_METHOD(&data, this_ptr, "toarray", NULL, 0); zephir_check_call_status(); success = 0; - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_6, SL("w"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&status, collection, "save", NULL, 0, data, _6); - zephir_check_call_status(); - if (Z_TYPE_P(status) == IS_ARRAY) { - ZEPHIR_OBS_VAR(ok); - if (zephir_array_isset_string_fetch(&ok, status, SS("ok"), 0 TSRMLS_CC)) { - if (zephir_is_true(ok)) { + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_6, SL("w"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&status, &collection, "save", NULL, 0, &data, &_6); + zephir_check_call_status(); + if (Z_TYPE_P(&status) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&ok); + if (zephir_array_isset_string_fetch(&ok, &status, SL("ok"), 0)) { + if (zephir_is_true(&ok)) { success = 1; - if (ZEPHIR_IS_FALSE_IDENTICAL(exists)) { - ZEPHIR_OBS_VAR(id); - if (zephir_array_isset_string_fetch(&id, data, SS("_id"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_id"), id TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&exists)) { + ZEPHIR_OBS_VAR(&id); + if (zephir_array_isset_string_fetch(&id, &data, SL("_id"), 0)) { + zephir_update_property_zval(this_ptr, SL("_id"), &id); } ZEPHIR_INIT_ZVAL_NREF(_7$$9); - ZVAL_LONG(_7$$9, 0); - zephir_update_property_this(getThis(), SL("_dirtyState"), _7$$9 TSRMLS_CC); + ZVAL_LONG(&_7$$9, 0); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_7$$9); } } } } - _8 = zephir_fetch_static_property_ce(phalcon_mvc_collection_ce, SL("_disableEvents") TSRMLS_CC); - ZEPHIR_INIT_VAR(_9); + zephir_read_static_property_ce(&_8, phalcon_mvc_collection_ce, SL("_disableEvents"), PH_NOISY_CC | PH_READONLY); if (success) { - ZVAL_BOOL(_9, 1); + ZVAL_BOOL(&_9, 1); } else { - ZVAL_BOOL(_9, 0); + ZVAL_BOOL(&_9, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_postsave", NULL, 320, _8, _9, exists); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_postsave", NULL, 280, &_8, &_9, &exists); zephir_check_call_status(); RETURN_MM(); @@ -1397,10 +1584,28 @@ PHP_METHOD(Phalcon_Mvc_Collection, save) { */ PHP_METHOD(Phalcon_Mvc_Collection, create) { - zval *_5; - zval *data = NULL, *status = NULL, *id = NULL, *ok = NULL, *collection = NULL, *_0, *_1, *_2 = NULL, *_3, *_4, *_7, *_8, *_9, *_6$$7; + zval _5; zend_bool exists = 0, success = 0; + zval __$true, data, status, id, ok, collection, _0, _1, _2, _3, _4, _7, _8, _9, _6$$7; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&ok); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); @@ -1408,63 +1613,60 @@ PHP_METHOD(Phalcon_Mvc_Collection, create) { zephir_check_call_status(); exists = 0; ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 1); - zephir_update_property_this(getThis(), SL("_operationMade"), _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - array_init(_1); - zephir_update_property_this(getThis(), SL("_errorMessages"), _1 TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - _3 = zephir_fetch_static_property_ce(phalcon_mvc_collection_ce, SL("_disableEvents") TSRMLS_CC); - ZEPHIR_INIT_VAR(_4); + ZVAL_LONG(&_0, 1); + zephir_update_property_zval(this_ptr, SL("_operationMade"), &_0); + ZEPHIR_INIT_VAR(&_1); + array_init(&_1); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_1); + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + zephir_read_static_property_ce(&_3, phalcon_mvc_collection_ce, SL("_disableEvents"), PH_NOISY_CC | PH_READONLY); if (exists) { - ZVAL_BOOL(_4, 1); + ZVAL_BOOL(&_4, 1); } else { - ZVAL_BOOL(_4, 0); + ZVAL_BOOL(&_4, 0); } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "_presave", NULL, 319, _0, _3, _4); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "_presave", NULL, 279, &_0, &_3, &_4); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_2)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_2)) { RETURN_MM_BOOL(0); } ZEPHIR_CALL_METHOD(&data, this_ptr, "toarray", NULL, 0); zephir_check_call_status(); success = 0; - ZEPHIR_INIT_VAR(_5); - zephir_create_array(_5, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_5, SL("w"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&status, collection, "insert", NULL, 0, data, _5); - zephir_check_call_status(); - if (Z_TYPE_P(status) == IS_ARRAY) { - ZEPHIR_OBS_VAR(ok); - if (zephir_array_isset_string_fetch(&ok, status, SS("ok"), 0 TSRMLS_CC)) { - if (zephir_is_true(ok)) { + ZEPHIR_INIT_VAR(&_5); + zephir_create_array(&_5, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_5, SL("w"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&status, &collection, "insert", NULL, 0, &data, &_5); + zephir_check_call_status(); + if (Z_TYPE_P(&status) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&ok); + if (zephir_array_isset_string_fetch(&ok, &status, SL("ok"), 0)) { + if (zephir_is_true(&ok)) { success = 1; if (exists == 0) { - ZEPHIR_OBS_VAR(id); - if (zephir_array_isset_string_fetch(&id, data, SS("_id"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_id"), id TSRMLS_CC); + ZEPHIR_OBS_VAR(&id); + if (zephir_array_isset_string_fetch(&id, &data, SL("_id"), 0)) { + zephir_update_property_zval(this_ptr, SL("_id"), &id); } ZEPHIR_INIT_ZVAL_NREF(_6$$7); - ZVAL_LONG(_6$$7, 0); - zephir_update_property_this(getThis(), SL("_dirtyState"), _6$$7 TSRMLS_CC); + ZVAL_LONG(&_6$$7, 0); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_6$$7); } } } } - _7 = zephir_fetch_static_property_ce(phalcon_mvc_collection_ce, SL("_disableEvents") TSRMLS_CC); - ZEPHIR_INIT_VAR(_8); + zephir_read_static_property_ce(&_7, phalcon_mvc_collection_ce, SL("_disableEvents"), PH_NOISY_CC | PH_READONLY); if (success) { - ZVAL_BOOL(_8, 1); + ZVAL_BOOL(&_8, 1); } else { - ZVAL_BOOL(_8, 0); + ZVAL_BOOL(&_8, 0); } - ZEPHIR_INIT_VAR(_9); if (exists) { - ZVAL_BOOL(_9, 1); + ZVAL_BOOL(&_9, 1); } else { - ZVAL_BOOL(_9, 0); + ZVAL_BOOL(&_9, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_postsave", NULL, 320, _7, _8, _9); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_postsave", NULL, 280, &_7, &_8, &_9); zephir_check_call_status(); RETURN_MM(); @@ -1493,16 +1695,42 @@ PHP_METHOD(Phalcon_Mvc_Collection, createIfNotExist) { zend_bool exists = 0, success = 0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *criteria_param = NULL, *data = NULL, *keys = NULL, *query = NULL, *status = NULL, *doc = NULL, *collection = NULL, *_0, *_1, *_2 = NULL, *_3, *_4, *_5 = NULL, *_8 = NULL, *_13, *_14, *_9$$7, *_10$$7, *_11$$8, *_12$$8; - zval *criteria = NULL, *_6, *_7; + zval *criteria_param = NULL, __$false, __$true, data, keys, query, status, doc, collection, _0, _1, _2, _3, _4, _5, _8, _13, _14, _9$$7, _10$$7, _11$$8, _12$$8; + zval criteria, _6, _7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&criteria); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_BOOL(&__$false, 0); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&keys); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&doc); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_12$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &criteria_param); - criteria = criteria_param; + ZEPHIR_OBS_COPY_OR_DUP(&criteria, criteria_param); - if (ZEPHIR_IS_EMPTY(criteria)) { + if (ZEPHIR_IS_EMPTY(&criteria)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Criteria parameter must be array with one or more attributes of the model", "phalcon/mvc/collection.zep", 1101); return; } @@ -1510,84 +1738,79 @@ PHP_METHOD(Phalcon_Mvc_Collection, createIfNotExist) { zephir_check_call_status(); exists = 0; ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_operationMade"), _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - array_init(_1); - zephir_update_property_this(getThis(), SL("_errorMessages"), _1 TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - _3 = zephir_fetch_static_property_ce(phalcon_mvc_collection_ce, SL("_disableEvents") TSRMLS_CC); - ZEPHIR_INIT_VAR(_4); + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_operationMade"), &_0); + ZEPHIR_INIT_VAR(&_1); + array_init(&_1); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_1); + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + zephir_read_static_property_ce(&_3, phalcon_mvc_collection_ce, SL("_disableEvents"), PH_NOISY_CC | PH_READONLY); if (exists) { - ZVAL_BOOL(_4, 1); + ZVAL_BOOL(&_4, 1); } else { - ZVAL_BOOL(_4, 0); + ZVAL_BOOL(&_4, 0); } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "_presave", NULL, 319, _0, _3, _4); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "_presave", NULL, 279, &_0, &_3, &_4); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_2)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_2)) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_FUNCTION(&keys, "array_flip", NULL, 321, criteria); + ZEPHIR_CALL_FUNCTION(&keys, "array_flip", NULL, 281, &criteria); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&data, this_ptr, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_5, "array_diff_key", NULL, 322, keys, data); + ZEPHIR_CALL_FUNCTION(&_5, "array_diff_key", NULL, 282, &keys, &data); zephir_check_call_status(); - if (zephir_is_true(_5)) { + if (zephir_is_true(&_5)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Criteria parameter must be array with one or more attributes of the model", "phalcon/mvc/collection.zep", 1136); return; } - ZEPHIR_CALL_FUNCTION(&query, "array_intersect_key", NULL, 323, data, keys); + ZEPHIR_CALL_FUNCTION(&query, "array_intersect_key", NULL, 283, &data, &keys); zephir_check_call_status(); success = 0; - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 1, 0 TSRMLS_CC); zephir_array_update_string(&_6, SL("$setOnInsert"), &data, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_7); - zephir_create_array(_7, 2, 0 TSRMLS_CC); - zephir_array_update_string(&_7, SL("new"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_7, SL("upsert"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_8); - ZVAL_NULL(_8); - ZEPHIR_CALL_METHOD(&status, collection, "findandmodify", NULL, 0, query, _6, _8, _7); - zephir_check_call_status(); - if (Z_TYPE_P(status) == IS_NULL) { - ZEPHIR_CALL_METHOD(&doc, collection, "findone", NULL, 0, query); + ZEPHIR_INIT_VAR(&_7); + zephir_create_array(&_7, 2, 0 TSRMLS_CC); + zephir_array_update_string(&_7, SL("new"), &__$false, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_7, SL("upsert"), &__$true, PH_COPY | PH_SEPARATE); + ZVAL_NULL(&_8); + ZEPHIR_CALL_METHOD(&status, &collection, "findandmodify", NULL, 0, &query, &_6, &_8, &_7); + zephir_check_call_status(); + if (Z_TYPE_P(&status) == IS_NULL) { + ZEPHIR_CALL_METHOD(&doc, &collection, "findone", NULL, 0, &query); zephir_check_call_status(); - if (Z_TYPE_P(doc) == IS_ARRAY) { + if (Z_TYPE_P(&doc) == IS_ARRAY) { success = 1; ZEPHIR_INIT_ZVAL_NREF(_9$$7); - ZVAL_LONG(_9$$7, 1); - zephir_update_property_this(getThis(), SL("_operationMade"), _9$$7 TSRMLS_CC); - zephir_array_fetch_string(&_10$$7, doc, SL("_id"), PH_NOISY | PH_READONLY, "phalcon/mvc/collection.zep", 1156 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_id"), _10$$7 TSRMLS_CC); + ZVAL_LONG(&_9$$7, 1); + zephir_update_property_zval(this_ptr, SL("_operationMade"), &_9$$7); + zephir_array_fetch_string(&_10$$7, &doc, SL("_id"), PH_NOISY | PH_READONLY, "phalcon/mvc/collection.zep", 1156 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_id"), &_10$$7); } } else { - ZEPHIR_INIT_VAR(_11$$8); - object_init_ex(_11$$8, phalcon_mvc_model_message_ce); - ZEPHIR_INIT_VAR(_12$$8); - ZVAL_STRING(_12$$8, "Document already exists", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _11$$8, "__construct", NULL, 8, _12$$8); - zephir_check_temp_parameter(_12$$8); + ZEPHIR_INIT_VAR(&_11$$8); + object_init_ex(&_11$$8, phalcon_mvc_model_message_ce); + ZEPHIR_INIT_VAR(&_12$$8); + ZVAL_STRING(&_12$$8, "Document already exists"); + ZEPHIR_CALL_METHOD(NULL, &_11$$8, "__construct", NULL, 3, &_12$$8); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _11$$8); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_11$$8); zephir_check_call_status(); } - _13 = zephir_fetch_static_property_ce(phalcon_mvc_collection_ce, SL("_disableEvents") TSRMLS_CC); - ZEPHIR_INIT_NVAR(_8); + zephir_read_static_property_ce(&_8, phalcon_mvc_collection_ce, SL("_disableEvents"), PH_NOISY_CC | PH_READONLY); if (success) { - ZVAL_BOOL(_8, 1); + ZVAL_BOOL(&_13, 1); } else { - ZVAL_BOOL(_8, 0); + ZVAL_BOOL(&_13, 0); } - ZEPHIR_INIT_VAR(_14); if (exists) { - ZVAL_BOOL(_14, 1); + ZVAL_BOOL(&_14, 1); } else { - ZVAL_BOOL(_14, 0); + ZVAL_BOOL(&_14, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_postsave", NULL, 320, _13, _8, _14); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_postsave", NULL, 280, &_8, &_13, &_14); zephir_check_call_status(); RETURN_MM(); @@ -1598,65 +1821,81 @@ PHP_METHOD(Phalcon_Mvc_Collection, createIfNotExist) { */ PHP_METHOD(Phalcon_Mvc_Collection, update) { - zval *_4, *_6; + zval _4, _6; zend_bool success = 0; - zval *exists = NULL, *data = NULL, *status = NULL, *ok = NULL, *collection = NULL, *_0, *_1, *_2 = NULL, *_3, *_5, *_7, *_8; + zval __$true, exists, data, status, ok, collection, _0, _1, _2, _3, _5, _7, _8; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&exists); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&ok); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&collection, this_ptr, "preparecu", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&exists, this_ptr, "_exists", NULL, 0, collection); + ZEPHIR_CALL_METHOD(&exists, this_ptr, "_exists", NULL, 0, &collection); zephir_check_call_status(); - if (!(zephir_is_true(exists))) { + if (!(zephir_is_true(&exists))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The document cannot be updated because it doesn't exist", "phalcon/mvc/collection.zep", 1183); return; } ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 2); - zephir_update_property_this(getThis(), SL("_operationMade"), _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - array_init(_1); - zephir_update_property_this(getThis(), SL("_errorMessages"), _1 TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - _3 = zephir_fetch_static_property_ce(phalcon_mvc_collection_ce, SL("_disableEvents") TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "_presave", NULL, 319, _0, _3, exists); - zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_2)) { + ZVAL_LONG(&_0, 2); + zephir_update_property_zval(this_ptr, SL("_operationMade"), &_0); + ZEPHIR_INIT_VAR(&_1); + array_init(&_1); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_1); + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + zephir_read_static_property_ce(&_3, phalcon_mvc_collection_ce, SL("_disableEvents"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "_presave", NULL, 279, &_0, &_3, &exists); + zephir_check_call_status(); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_2)) { RETURN_MM_BOOL(0); } ZEPHIR_CALL_METHOD(&data, this_ptr, "toarray", NULL, 0); zephir_check_call_status(); success = 0; - ZEPHIR_INIT_VAR(_4); - zephir_create_array(_4, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_5); - zephir_read_property_this(&_5, this_ptr, SL("_id"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_4); + zephir_create_array(&_4, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_5); + zephir_read_property(&_5, this_ptr, SL("_id"), PH_NOISY_CC); zephir_array_update_string(&_4, SL("_id"), &_5, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_6, SL("w"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&status, collection, "update", NULL, 0, _4, data, _6); - zephir_check_call_status(); - if (Z_TYPE_P(status) == IS_ARRAY) { - ZEPHIR_OBS_VAR(ok); - if (zephir_array_isset_string_fetch(&ok, status, SS("ok"), 0 TSRMLS_CC)) { - if (zephir_is_true(ok)) { + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_6, SL("w"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&status, &collection, "update", NULL, 0, &_4, &data, &_6); + zephir_check_call_status(); + if (Z_TYPE_P(&status) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&ok); + if (zephir_array_isset_string_fetch(&ok, &status, SL("ok"), 0)) { + if (zephir_is_true(&ok)) { success = 1; } } } else { success = 0; } - _7 = zephir_fetch_static_property_ce(phalcon_mvc_collection_ce, SL("_disableEvents") TSRMLS_CC); - ZEPHIR_INIT_VAR(_8); + zephir_read_static_property_ce(&_7, phalcon_mvc_collection_ce, SL("_disableEvents"), PH_NOISY_CC | PH_READONLY); if (success) { - ZVAL_BOOL(_8, 1); + ZVAL_BOOL(&_8, 1); } else { - ZVAL_BOOL(_8, 0); + ZVAL_BOOL(&_8, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_postsave", NULL, 320, _7, _8, exists); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_postsave", NULL, 280, &_7, &_8, &exists); zephir_check_call_status(); RETURN_MM(); @@ -1682,10 +1921,25 @@ PHP_METHOD(Phalcon_Mvc_Collection, update) { */ PHP_METHOD(Phalcon_Mvc_Collection, findById) { - zend_class_entry *_4$$3; - zval *_7, *_8; + zend_class_entry *_5$$3; + zval _8, _9; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, *className = NULL, *collection = NULL, *mongoId = NULL, *_0$$3, *_1$$3, _2$$3, *_3$$3 = NULL, *_5$$3 = NULL, *_6$$3 = NULL; + zval *id, id_sub, className, collection, mongoId, _0$$3, _1$$3, _2$$3, _3$$3, _4$$3, _6$$3, _7$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&mongoId); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &id); @@ -1693,48 +1947,50 @@ PHP_METHOD(Phalcon_Mvc_Collection, findById) { if (Z_TYPE_P(id) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_SINIT_VAR(_2$$3); - ZVAL_STRING(&_2$$3, "/^[a-f\\d]{24}$/i", 0); - zephir_preg_match(_1$$3, &_2$$3, id, _0$$3, 0, 0 , 0 TSRMLS_CC); - if (!(zephir_is_true(_1$$3))) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "/^[a-f\\d]{24}$/i"); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_INIT_VAR(&_3$$3); + ZVAL_STRING(&_3$$3, "/^[a-f\\d]{24}$/i"); + zephir_preg_match(&_2$$3, &_3$$3, id, &_0$$3, 0, 0 , 0 TSRMLS_CC); + if (!(zephir_is_true(&_2$$3))) { RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(className); - zephir_get_called_class(className TSRMLS_CC); - ZEPHIR_INIT_VAR(collection); - zephir_fetch_safe_class(_3$$3, className); - _4$$3 = zend_fetch_class(Z_STRVAL_P(_3$$3), Z_STRLEN_P(_3$$3), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(collection, _4$$3); - if (zephir_has_constructor(collection TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, collection, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&className); + zephir_get_called_class(&className TSRMLS_CC); + ZEPHIR_INIT_VAR(&collection); + zephir_fetch_safe_class(&_4$$3, &className); + _5$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_4$$3), Z_STRLEN_P(&_4$$3), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&collection, _5$$3); + if (zephir_has_constructor(&collection TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&_5$$3, collection, "getcollectionmanager", NULL, 0); + ZEPHIR_CALL_METHOD(&_6$$3, &collection, "getcollectionmanager", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$3, _5$$3, "isusingimplicitobjectids", NULL, 0, collection); + ZEPHIR_CALL_METHOD(&_7$$3, &_6$$3, "isusingimplicitobjectids", NULL, 0, &collection); zephir_check_call_status(); - if (zephir_is_true(_6$$3)) { - ZEPHIR_INIT_VAR(mongoId); - object_init_ex(mongoId, zephir_get_internal_ce(SS("mongoid") TSRMLS_CC)); - if (zephir_has_constructor(mongoId TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, mongoId, "__construct", NULL, 0, id); + if (zephir_is_true(&_7$$3)) { + ZEPHIR_INIT_VAR(&mongoId); + object_init_ex(&mongoId, zephir_get_internal_ce(SL("mongoid"))); + if (zephir_has_constructor(&mongoId TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &mongoId, "__construct", NULL, 0, id); zephir_check_call_status(); } } else { - ZEPHIR_CPY_WRT(mongoId, id); + ZEPHIR_CPY_WRT(&mongoId, id); } } else { - ZEPHIR_CPY_WRT(mongoId, id); + ZEPHIR_CPY_WRT(&mongoId, id); } - ZEPHIR_INIT_VAR(_7); - zephir_create_array(_7, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_8); - zephir_create_array(_8, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_8, SL("_id"), &mongoId, PH_COPY | PH_SEPARATE); - zephir_array_fast_append(_7, _8); - ZEPHIR_RETURN_CALL_STATIC("findfirst", NULL, 0, _7); + ZEPHIR_INIT_VAR(&_8); + zephir_create_array(&_8, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_9); + zephir_create_array(&_9, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_9, SL("_id"), &mongoId, PH_COPY | PH_SEPARATE); + zephir_array_fast_append(&_8, &_9); + ZEPHIR_RETURN_CALL_STATIC("findfirst", NULL, 0, &_8); zephir_check_call_status(); RETURN_MM(); @@ -1790,35 +2046,42 @@ PHP_METHOD(Phalcon_Mvc_Collection, findFirst) { zend_class_entry *_1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters_param = NULL, *className = NULL, *collection = NULL, *connection = NULL, *_0 = NULL, *_2; - zval *parameters = NULL; + zval *parameters_param = NULL, className, collection, connection, _0, _2; + zval parameters; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters_param); if (!parameters_param) { - ZEPHIR_INIT_VAR(parameters); - array_init(parameters); + ZEPHIR_INIT_VAR(¶meters); + array_init(¶meters); } else { - zephir_get_arrval(parameters, parameters_param); + zephir_get_arrval(¶meters, parameters_param); } - ZEPHIR_INIT_VAR(className); - zephir_get_called_class(className TSRMLS_CC); - ZEPHIR_INIT_VAR(collection); - zephir_fetch_safe_class(_0, className); - _1 = zend_fetch_class(Z_STRVAL_P(_0), Z_STRLEN_P(_0), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(collection, _1); - if (zephir_has_constructor(collection TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, collection, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&className); + zephir_get_called_class(&className TSRMLS_CC); + ZEPHIR_INIT_VAR(&collection); + zephir_fetch_safe_class(&_0, &className); + _1 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_0), Z_STRLEN_P(&_0), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&collection, _1); + if (zephir_has_constructor(&collection TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&connection, collection, "getconnection", NULL, 0); + ZEPHIR_CALL_METHOD(&connection, &collection, "getconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZVAL_BOOL(_2, 1); - ZEPHIR_RETURN_CALL_STATIC("_getresultset", NULL, 0, parameters, collection, connection, _2); + ZVAL_BOOL(&_2, 1); + ZEPHIR_RETURN_CALL_STATIC("_getresultset", NULL, 0, ¶meters, &collection, &connection, &_2); zephir_check_call_status(); RETURN_MM(); @@ -1882,35 +2145,42 @@ PHP_METHOD(Phalcon_Mvc_Collection, find) { zend_class_entry *_1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters_param = NULL, *className = NULL, *collection = NULL, *_0 = NULL, *_2 = NULL, *_3; - zval *parameters = NULL; + zval *parameters_param = NULL, className, collection, _0, _2, _3; + zval parameters; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters_param); if (!parameters_param) { - ZEPHIR_INIT_VAR(parameters); - array_init(parameters); + ZEPHIR_INIT_VAR(¶meters); + array_init(¶meters); } else { - zephir_get_arrval(parameters, parameters_param); + zephir_get_arrval(¶meters, parameters_param); } - ZEPHIR_INIT_VAR(className); - zephir_get_called_class(className TSRMLS_CC); - ZEPHIR_INIT_VAR(collection); - zephir_fetch_safe_class(_0, className); - _1 = zend_fetch_class(Z_STRVAL_P(_0), Z_STRLEN_P(_0), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(collection, _1); - if (zephir_has_constructor(collection TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, collection, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&className); + zephir_get_called_class(&className TSRMLS_CC); + ZEPHIR_INIT_VAR(&collection); + zephir_fetch_safe_class(&_0, &className); + _1 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_0), Z_STRLEN_P(&_0), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&collection, _1); + if (zephir_has_constructor(&collection TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&_2, collection, "getconnection", NULL, 0); + ZEPHIR_CALL_METHOD(&_2, &collection, "getconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3); - ZVAL_BOOL(_3, 0); - ZEPHIR_RETURN_CALL_STATIC("_getresultset", NULL, 0, parameters, collection, _2, _3); + ZVAL_BOOL(&_3, 0); + ZEPHIR_RETURN_CALL_STATIC("_getresultset", NULL, 0, ¶meters, &collection, &_2, &_3); zephir_check_call_status(); RETURN_MM(); @@ -1927,33 +2197,40 @@ PHP_METHOD(Phalcon_Mvc_Collection, count) { zend_class_entry *_1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters_param = NULL, *className = NULL, *collection = NULL, *connection = NULL, *_0 = NULL; - zval *parameters = NULL; + zval *parameters_param = NULL, className, collection, connection, _0; + zval parameters; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters_param); if (!parameters_param) { - ZEPHIR_INIT_VAR(parameters); - array_init(parameters); + ZEPHIR_INIT_VAR(¶meters); + array_init(¶meters); } else { - zephir_get_arrval(parameters, parameters_param); + zephir_get_arrval(¶meters, parameters_param); } - ZEPHIR_INIT_VAR(className); - zephir_get_called_class(className TSRMLS_CC); - ZEPHIR_INIT_VAR(collection); - zephir_fetch_safe_class(_0, className); - _1 = zend_fetch_class(Z_STRVAL_P(_0), Z_STRLEN_P(_0), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(collection, _1); - if (zephir_has_constructor(collection TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, collection, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&className); + zephir_get_called_class(&className TSRMLS_CC); + ZEPHIR_INIT_VAR(&collection); + zephir_fetch_safe_class(&_0, &className); + _1 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_0), Z_STRLEN_P(&_0), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&collection, _1); + if (zephir_has_constructor(&collection TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&connection, collection, "getconnection", NULL, 0); + ZEPHIR_CALL_METHOD(&connection, &collection, "getconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_STATIC("_getgroupresultset", NULL, 0, parameters, collection, connection); + ZEPHIR_RETURN_CALL_STATIC("_getgroupresultset", NULL, 0, ¶meters, &collection, &connection); zephir_check_call_status(); RETURN_MM(); @@ -1966,47 +2243,57 @@ PHP_METHOD(Phalcon_Mvc_Collection, aggregate) { zend_class_entry *_1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters_param = NULL, *options_param = NULL, *className = NULL, *model = NULL, *connection = NULL, *source = NULL, *_0 = NULL, *_2 = NULL; - zval *parameters = NULL, *options = NULL; + zval *parameters_param = NULL, *options_param = NULL, className, model, connection, source, _0, _2; + zval parameters, options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, ¶meters_param, &options_param); if (!parameters_param) { - ZEPHIR_INIT_VAR(parameters); - array_init(parameters); + ZEPHIR_INIT_VAR(¶meters); + array_init(¶meters); } else { - zephir_get_arrval(parameters, parameters_param); + zephir_get_arrval(¶meters, parameters_param); } if (!options_param) { - ZEPHIR_INIT_VAR(options); - array_init(options); + ZEPHIR_INIT_VAR(&options); + array_init(&options); } else { - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); } - ZEPHIR_INIT_VAR(className); - zephir_get_called_class(className TSRMLS_CC); - ZEPHIR_INIT_VAR(model); - zephir_fetch_safe_class(_0, className); - _1 = zend_fetch_class(Z_STRVAL_P(_0), Z_STRLEN_P(_0), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(model, _1); - if (zephir_has_constructor(model TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, model, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&className); + zephir_get_called_class(&className TSRMLS_CC); + ZEPHIR_INIT_VAR(&model); + zephir_fetch_safe_class(&_0, &className); + _1 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_0), Z_STRLEN_P(&_0), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&model, _1); + if (zephir_has_constructor(&model TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &model, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&connection, model, "getconnection", NULL, 0); + ZEPHIR_CALL_METHOD(&connection, &model, "getconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, model, "getsource", NULL, 0); + ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(source)) { + if (ZEPHIR_IS_EMPTY(&source)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Method getSource() returns empty string", "phalcon/mvc/collection.zep", 1429); return; } - ZEPHIR_CALL_METHOD(&_2, connection, "selectcollection", NULL, 0, source); + ZEPHIR_CALL_METHOD(&_2, &connection, "selectcollection", NULL, 0, &source); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(_2, "aggregate", NULL, 0, parameters, options); + ZEPHIR_RETURN_CALL_METHOD(&_2, "aggregate", NULL, 0, ¶meters, &options); zephir_check_call_status(); RETURN_MM(); @@ -2019,71 +2306,93 @@ PHP_METHOD(Phalcon_Mvc_Collection, summatory) { zend_class_entry *_1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *field_param = NULL, *conditions = NULL, *finalize = NULL, *className = NULL, *model = NULL, *connection = NULL, *source = NULL, *collection = NULL, *initial = NULL, *reduce = NULL, *group = NULL, *retval = NULL, *firstRetval = NULL, *_0 = NULL, *_2 = NULL, *_4$$6; - zval *field = NULL, *_3; + zval *field_param = NULL, *conditions = NULL, conditions_sub, *finalize = NULL, finalize_sub, __$null, className, model, connection, source, collection, initial, reduce, group, retval, firstRetval, _0, _2, _4$$6; + zval field, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&finalize_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&initial); + ZVAL_UNDEF(&reduce); + ZVAL_UNDEF(&group); + ZVAL_UNDEF(&retval); + ZVAL_UNDEF(&firstRetval); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &field_param, &conditions, &finalize); if (UNEXPECTED(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(field_param) == IS_STRING)) { - zephir_get_strval(field, field_param); + zephir_get_strval(&field, field_param); } else { - ZEPHIR_INIT_VAR(field); - ZVAL_EMPTY_STRING(field); + ZEPHIR_INIT_VAR(&field); + ZVAL_EMPTY_STRING(&field); } if (!conditions) { - conditions = ZEPHIR_GLOBAL(global_null); + conditions = &conditions_sub; + conditions = &__$null; } if (!finalize) { - finalize = ZEPHIR_GLOBAL(global_null); + finalize = &finalize_sub; + finalize = &__$null; } - ZEPHIR_INIT_VAR(className); - zephir_get_called_class(className TSRMLS_CC); - ZEPHIR_INIT_VAR(model); - zephir_fetch_safe_class(_0, className); - _1 = zend_fetch_class(Z_STRVAL_P(_0), Z_STRLEN_P(_0), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(model, _1); - if (zephir_has_constructor(model TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, model, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&className); + zephir_get_called_class(&className TSRMLS_CC); + ZEPHIR_INIT_VAR(&model); + zephir_fetch_safe_class(&_0, &className); + _1 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_0), Z_STRLEN_P(&_0), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&model, _1); + if (zephir_has_constructor(&model TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &model, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&connection, model, "getconnection", NULL, 0); + ZEPHIR_CALL_METHOD(&connection, &model, "getconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, model, "getsource", NULL, 0); + ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(source)) { + if (ZEPHIR_IS_EMPTY(&source)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Method getSource() returns empty string", "phalcon/mvc/collection.zep", 1451); return; } - ZEPHIR_CALL_METHOD(&collection, connection, "selectcollection", NULL, 0, source); + ZEPHIR_CALL_METHOD(&collection, &connection, "selectcollection", NULL, 0, &source); zephir_check_call_status(); - ZEPHIR_INIT_VAR(initial); - zephir_create_array(initial, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - array_init(_2); + ZEPHIR_INIT_VAR(&initial); + zephir_create_array(&initial, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + array_init(&_2); zephir_array_update_string(&initial, SL("summatory"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SVSVSVS(_3, "function (curr, result) { if (typeof result.summatory[curr.", field, "] === \"undefined\") { result.summatory[curr.", field, "] = 1; } else { result.summatory[curr.", field, "]++; } }"); - ZEPHIR_CPY_WRT(reduce, _3); - ZEPHIR_INIT_NVAR(_2); - array_init(_2); - ZEPHIR_CALL_METHOD(&group, collection, "group", NULL, 0, _2, initial, reduce); - zephir_check_call_status(); - if (zephir_array_isset_string_fetch(&retval, group, SS("retval"), 1 TSRMLS_CC)) { - if (zephir_array_isset_long_fetch(&firstRetval, retval, 0, 1 TSRMLS_CC)) { - if (zephir_array_isset_string(firstRetval, SS("summatory"))) { - zephir_array_fetch_string(&_4$$6, firstRetval, SL("summatory"), PH_NOISY | PH_READONLY, "phalcon/mvc/collection.zep", 1471 TSRMLS_CC); - RETURN_CTOR(_4$$6); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SVSVSVS(&_3, "function (curr, result) { if (typeof result.summatory[curr.", &field, "] === \"undefined\") { result.summatory[curr.", &field, "] = 1; } else { result.summatory[curr.", &field, "]++; } }"); + ZEPHIR_CPY_WRT(&reduce, &_3); + ZEPHIR_INIT_NVAR(&_2); + array_init(&_2); + ZEPHIR_CALL_METHOD(&group, &collection, "group", NULL, 0, &_2, &initial, &reduce); + zephir_check_call_status(); + if (zephir_array_isset_string_fetch(&retval, &group, SL("retval"), 1)) { + if (zephir_array_isset_long_fetch(&firstRetval, &retval, 0, 1 TSRMLS_CC)) { + if (zephir_array_isset_string(&firstRetval, SL("summatory"))) { + zephir_array_fetch_string(&_4$$6, &firstRetval, SL("summatory"), PH_NOISY | PH_READONLY, "phalcon/mvc/collection.zep", 1471 TSRMLS_CC); + RETURN_CTOR(&_4$$6); } - RETURN_CTOR(firstRetval); + RETURN_CTOR(&firstRetval); } - RETURN_CTOR(retval); + RETURN_CTOR(&retval); } array_init(return_value); RETURN_MM(); @@ -2107,87 +2416,105 @@ PHP_METHOD(Phalcon_Mvc_Collection, summatory) { */ PHP_METHOD(Phalcon_Mvc_Collection, delete) { - zval *_5, *_6; + zval _5, _6; zend_bool success = 0; - zval *disableEvents = NULL, *status = NULL, *id = NULL, *connection = NULL, *source = NULL, *collection = NULL, *mongoId = NULL, *ok = NULL, *_2, *_0$$4 = NULL, *_1$$4, *_3$$9, *_4$$9 = NULL, *_7$$15, *_8$$14; + zval __$true, disableEvents, status, id, connection, source, collection, mongoId, ok, _2, _0$$4, _1$$4, _3$$9, _4$$9, _7$$15, _8$$14; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&disableEvents); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&mongoId); + ZVAL_UNDEF(&ok); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&_7$$15); + ZVAL_UNDEF(&_8$$14); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(id); + ZEPHIR_OBS_VAR(&id); if (!(zephir_fetch_property(&id, this_ptr, SL("_id"), PH_SILENT_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The document cannot be deleted because it doesn't exist", "phalcon/mvc/collection.zep", 1502); return; } - ZEPHIR_OBS_VAR(disableEvents); - zephir_read_static_property_ce(&disableEvents, phalcon_mvc_collection_ce, SL("_disableEvents") TSRMLS_CC); - if (!(zephir_is_true(disableEvents))) { - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_STRING(_1$$4, "beforeDelete", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0$$4, this_ptr, "fireeventcancel", NULL, 0, _1$$4); - zephir_check_temp_parameter(_1$$4); + ZEPHIR_OBS_VAR(&disableEvents); + zephir_read_static_property_ce(&disableEvents, phalcon_mvc_collection_ce, SL("_disableEvents"), PH_NOISY_CC); + if (!(zephir_is_true(&disableEvents))) { + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_STRING(&_1$$4, "beforeDelete"); + ZEPHIR_CALL_METHOD(&_0$$4, this_ptr, "fireeventcancel", NULL, 0, &_1$$4); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$4)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0$$4)) { RETURN_MM_BOOL(0); } } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_skipped"), PH_NOISY_CC); - if (ZEPHIR_IS_TRUE_IDENTICAL(_2)) { + zephir_read_property(&_2, this_ptr, SL("_skipped"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_2)) { RETURN_MM_BOOL(1); } ZEPHIR_CALL_METHOD(&connection, this_ptr, "getconnection", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(source)) { + if (ZEPHIR_IS_EMPTY(&source)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Method getSource() returns empty string", "phalcon/mvc/collection.zep", 1521); return; } - ZEPHIR_CALL_METHOD(&collection, connection, "selectcollection", NULL, 0, source); + ZEPHIR_CALL_METHOD(&collection, &connection, "selectcollection", NULL, 0, &source); zephir_check_call_status(); - if (Z_TYPE_P(id) == IS_OBJECT) { - ZEPHIR_CPY_WRT(mongoId, id); + if (Z_TYPE_P(&id) == IS_OBJECT) { + ZEPHIR_CPY_WRT(&mongoId, &id); } else { - _3$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_4$$9, _3$$9, "isusingimplicitobjectids", NULL, 0, this_ptr); + zephir_read_property(&_3$$9, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_4$$9, &_3$$9, "isusingimplicitobjectids", NULL, 0, this_ptr); zephir_check_call_status(); - if (zephir_is_true(_4$$9)) { - ZEPHIR_INIT_NVAR(mongoId); - object_init_ex(mongoId, zephir_get_internal_ce(SS("mongoid") TSRMLS_CC)); - if (zephir_has_constructor(mongoId TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, mongoId, "__construct", NULL, 0, id); + if (zephir_is_true(&_4$$9)) { + ZEPHIR_INIT_NVAR(&mongoId); + object_init_ex(&mongoId, zephir_get_internal_ce(SL("mongoid"))); + if (zephir_has_constructor(&mongoId TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &mongoId, "__construct", NULL, 0, &id); zephir_check_call_status(); } } else { - ZEPHIR_CPY_WRT(mongoId, id); + ZEPHIR_CPY_WRT(&mongoId, &id); } } success = 0; - ZEPHIR_INIT_VAR(_5); - zephir_create_array(_5, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5); + zephir_create_array(&_5, 1, 0 TSRMLS_CC); zephir_array_update_string(&_5, SL("_id"), &mongoId, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_6, SL("w"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&status, collection, "remove", NULL, 0, _5, _6); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_6, SL("w"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&status, &collection, "remove", NULL, 0, &_5, &_6); zephir_check_call_status(); - if (Z_TYPE_P(status) != IS_ARRAY) { + if (Z_TYPE_P(&status) != IS_ARRAY) { RETURN_MM_BOOL(0); } - ZEPHIR_OBS_VAR(ok); - if (zephir_array_isset_string_fetch(&ok, status, SS("ok"), 0 TSRMLS_CC)) { - if (zephir_is_true(ok)) { + ZEPHIR_OBS_VAR(&ok); + if (zephir_array_isset_string_fetch(&ok, &status, SL("ok"), 0)) { + if (zephir_is_true(&ok)) { success = 1; - if (!(zephir_is_true(disableEvents))) { - ZEPHIR_INIT_VAR(_7$$15); - ZVAL_STRING(_7$$15, "afterDelete", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _7$$15); - zephir_check_temp_parameter(_7$$15); + if (!(zephir_is_true(&disableEvents))) { + ZEPHIR_INIT_VAR(&_7$$15); + ZVAL_STRING(&_7$$15, "afterDelete"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_7$$15); zephir_check_call_status(); } ZEPHIR_INIT_ZVAL_NREF(_8$$14); - ZVAL_LONG(_8$$14, 2); - zephir_update_property_this(getThis(), SL("_dirtyState"), _8$$14 TSRMLS_CC); + ZVAL_LONG(&_8$$14, 2); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_8$$14); } } else { success = 0; @@ -2201,8 +2528,11 @@ PHP_METHOD(Phalcon_Mvc_Collection, delete) { */ PHP_METHOD(Phalcon_Mvc_Collection, setDirtyState) { - zval *dirtyState_param = NULL, *_0; + zval *dirtyState_param = NULL, _0; zend_long dirtyState; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &dirtyState_param); @@ -2210,8 +2540,8 @@ PHP_METHOD(Phalcon_Mvc_Collection, setDirtyState) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, dirtyState); - zephir_update_property_this(getThis(), SL("_dirtyState"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, dirtyState); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_0); RETURN_THISW(); } @@ -2221,7 +2551,8 @@ PHP_METHOD(Phalcon_Mvc_Collection, setDirtyState) { */ PHP_METHOD(Phalcon_Mvc_Collection, getDirtyState) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dirtyState"); @@ -2233,15 +2564,19 @@ PHP_METHOD(Phalcon_Mvc_Collection, getDirtyState) { PHP_METHOD(Phalcon_Mvc_Collection, addBehavior) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *behavior, *_0; + zval *behavior, behavior_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&behavior_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &behavior); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "addbehavior", NULL, 0, this_ptr, behavior); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "addbehavior", NULL, 0, this_ptr, behavior); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -2252,8 +2587,12 @@ PHP_METHOD(Phalcon_Mvc_Collection, addBehavior) { */ PHP_METHOD(Phalcon_Mvc_Collection, skipOperation) { - zval *skip_param = NULL; + zval *skip_param = NULL, __$true, __$false; zend_bool skip; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &skip_param); @@ -2261,9 +2600,9 @@ PHP_METHOD(Phalcon_Mvc_Collection, skipOperation) { if (skip) { - zephir_update_property_this(getThis(), SL("_skipped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_skipped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_skipped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_skipped"), &__$false); } } @@ -2279,37 +2618,50 @@ PHP_METHOD(Phalcon_Mvc_Collection, skipOperation) { */ PHP_METHOD(Phalcon_Mvc_Collection, toArray) { - HashTable *_2; - HashPosition _1; - zval *data = NULL, *reserved = NULL, *key = NULL, *value = NULL, *_0 = NULL, **_3; + zend_string *_3; + zend_ulong _2; + zval data, reserved, key, value, _0, *_1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&reserved); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&reserved, this_ptr, "getreservedattributes", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(data); - array_init(data); - ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 22, this_ptr); - zephir_check_call_status(); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/mvc/collection.zep", 1635); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(key, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); - if (ZEPHIR_IS_STRING(key, "_id")) { - if (zephir_is_true(value)) { - zephir_array_update_zval(&data, key, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&data); + array_init(&data); + ZEPHIR_CALL_FUNCTION(&_0, "get_object_vars", NULL, 17, this_ptr); + zephir_check_call_status(); + zephir_is_iterable(&_0, 0, "phalcon/mvc/collection.zep", 1635); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + if (ZEPHIR_IS_STRING(&key, "_id")) { + if (zephir_is_true(&value)) { + zephir_array_update_zval(&data, &key, &value, PH_COPY | PH_SEPARATE); } } else { - if (!(zephir_array_isset(reserved, key))) { - zephir_array_update_zval(&data, key, &value, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset(&reserved, &key))) { + zephir_array_update_zval(&data, &key, &value, PH_COPY | PH_SEPARATE); } } - } - RETURN_CCTOR(data); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + RETURN_CCTOR(&data); } @@ -2318,14 +2670,17 @@ PHP_METHOD(Phalcon_Mvc_Collection, toArray) { */ PHP_METHOD(Phalcon_Mvc_Collection, serialize) { - zval *_0 = NULL; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 68, _0); + ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 61, &_0); zephir_check_call_status(); RETURN_MM(); @@ -2336,79 +2691,84 @@ PHP_METHOD(Phalcon_Mvc_Collection, serialize) { */ PHP_METHOD(Phalcon_Mvc_Collection, unserialize) { - HashTable *_3$$3; - HashPosition _2$$3; + zend_string *_4$$3; + zend_ulong _3$$3; zephir_fcall_cache_entry *_0 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, *attributes = NULL, *dependencyInjector = NULL, *manager = NULL, *key = NULL, *value = NULL, *_1$$3, **_4$$3; + zval *data, data_sub, attributes, dependencyInjector, manager, key, value, _1$$3, *_2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_FUNCTION(&attributes, "unserialize", NULL, 69, data); + ZEPHIR_CALL_FUNCTION(&attributes, "unserialize", NULL, 62, data); zephir_check_call_status(); - if (Z_TYPE_P(attributes) == IS_ARRAY) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + if (Z_TYPE_P(&attributes) == IS_ARRAY) { + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "A dependency injector container is required to obtain the services related to the ODM", "phalcon/mvc/collection.zep", 1664); return; } - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "collectionManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&manager, dependencyInjector, "getshared", NULL, 0, _1$$3); - zephir_check_temp_parameter(_1$$3); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), &dependencyInjector); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "collectionManager"); + ZEPHIR_CALL_METHOD(&manager, &dependencyInjector, "getshared", NULL, 0, &_1$$3); zephir_check_call_status(); - if (Z_TYPE_P(manager) != IS_OBJECT) { + if (Z_TYPE_P(&manager) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The injected service 'collectionManager' is not valid", "phalcon/mvc/collection.zep", 1677); return; } - zephir_update_property_this(getThis(), SL("_modelsManager"), manager TSRMLS_CC); - zephir_is_iterable(attributes, &_3$$3, &_2$$3, 0, 0, "phalcon/mvc/collection.zep", 1691); - for ( - ; zend_hash_get_current_data_ex(_3$$3, (void**) &_4$$3, &_2$$3) == SUCCESS - ; zend_hash_move_forward_ex(_3$$3, &_2$$3) - ) { - ZEPHIR_GET_HMKEY(key, _3$$3, _2$$3); - ZEPHIR_GET_HVALUE(value, _4$$3); - zephir_update_property_zval_zval(getThis(), key, value TSRMLS_CC); - } + zephir_update_property_zval(this_ptr, SL("_modelsManager"), &manager); + zephir_is_iterable(&attributes, 0, "phalcon/mvc/collection.zep", 1691); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attributes), _3$$3, _4$$3, _2$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_4$$3 != NULL) { + ZVAL_STR_COPY(&key, _4$$3); + } else { + ZVAL_LONG(&key, _3$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _2$$3); + zephir_update_property_zval_zval(this_ptr, &key, &value TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } ZEPHIR_MM_RESTORE(); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Collection(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Collection(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_errorMessages"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_errorMessages"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_errorMessages"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/collection.zep.h b/ext/phalcon/mvc/collection.zep.h index 80574a3a5c4..e5a7111f90d 100644 --- a/ext/phalcon/mvc/collection.zep.h +++ b/ext/phalcon/mvc/collection.zep.h @@ -52,7 +52,7 @@ PHP_METHOD(Phalcon_Mvc_Collection, skipOperation); PHP_METHOD(Phalcon_Mvc_Collection, toArray); PHP_METHOD(Phalcon_Mvc_Collection, serialize); PHP_METHOD(Phalcon_Mvc_Collection, unserialize); -zend_object_value zephir_init_properties_Phalcon_Mvc_Collection(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Collection(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection___construct, 0, 0, 0) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 1) @@ -67,32 +67,106 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_seteventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Mvc\\Collection\\ManagerInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_geteventsmanager, 0, 0, Phalcon\\Mvc\\Collection\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Collection\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_getcollectionmanager, 0, 0, Phalcon\\Mvc\\Collection\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getcollectionmanager, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Collection\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getreservedattributes, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getreservedattributes, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_useimplicitobjectids, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useImplicitObjectIds, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useImplicitObjectIds) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_setsource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_setsource, 0, 1, Phalcon\\Mvc\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_setsource, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) +#else ZEND_ARG_INFO(0, source) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_setconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getsource, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getsource, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_setconnectionservice, 0, 1, Phalcon\\Mvc\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_setconnectionservice, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getconnectionservice, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getconnectionservice, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_readattribute, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_writeattribute, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_cloneresult, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_cloneresult, 0, 2, Phalcon\\Mvc\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_cloneresult, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\CollectionInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_ARG_ARRAY_INFO(0, document, 0) ZEND_END_ARG_INFO() @@ -101,84 +175,237 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection__getresultset, 0, 0, 4) ZEND_ARG_INFO(0, params) ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_ARG_INFO(0, connection) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, unique, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, unique) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection__getgroupresultset, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__getgroupresultset, 0, 3, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__getgroupresultset, 0, 3, IS_LONG, NULL, 0) +#endif ZEND_ARG_INFO(0, params) ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Mvc\\Collection, 0) ZEND_ARG_INFO(0, connection) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection__presave, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__presave, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__presave, 0, 3, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, dependencyInjector) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, disableEvents, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, disableEvents) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, exists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, exists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection__postsave, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__postsave, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__postsave, 0, 3, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, disableEvents, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, disableEvents) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, success, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, success) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, exists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, exists) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_validate, 0, 0, 1) ZEND_ARG_INFO(0, validator) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_fireevent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_validationhasfailed, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_validationhasfailed, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_fireevent, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_fireevent, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_fireeventcancel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_fireeventcancel, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_fireeventcancel, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection__canceloperation, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__canceloperation, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__canceloperation, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, disableEvents, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, disableEvents) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection__exists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__exists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection__exists, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, collection) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_getmessages, 0, 0, Phalcon\\Mvc\\Model\\MessageInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\MessageInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_appendmessage, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, message, Phalcon\\Mvc\\Model\\MessageInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_createifnotexist, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_save, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_create, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_create, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_createifnotexist, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_createifnotexist, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, criteria, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_findbyid, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_update, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_update, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_findbyid, 0, 1, Phalcon\\Mvc\\CollectionInterface, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_findbyid, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\CollectionInterface", 1) +#endif ZEND_ARG_INFO(0, id) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_findfirst, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_findfirst, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_findfirst, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, parameters, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_find, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_find, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_find, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, parameters, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_count, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_count, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, parameters, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_aggregate, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_aggregate, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_aggregate, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, parameters, 1) ZEND_ARG_ARRAY_INFO(0, options, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_summatory, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_summatory, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_summatory, 0, 1, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, field, IS_STRING, 0) +#else ZEND_ARG_INFO(0, field) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, finalize) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_setdirtystate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_delete, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_delete, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_setdirtystate, 0, 1, Phalcon\\Mvc\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_setdirtystate, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\CollectionInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getdirtystate, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_getdirtystate, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_addbehavior, 0, 0, 1) @@ -186,7 +413,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_addbehavior, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_skipoperation, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, skip, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, skip) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_toarray, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_toarray, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_serialize, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_serialize, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_unserialize, 0, 0, 1) @@ -198,16 +443,16 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_collection_method_entry) { PHP_ME(Phalcon_Mvc_Collection, setId, arginfo_phalcon_mvc_collection_setid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, getId, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, setDI, arginfo_phalcon_mvc_collection_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, getDI, arginfo_phalcon_mvc_collection_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, setEventsManager, arginfo_phalcon_mvc_collection_seteventsmanager, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Collection, getEventsManager, NULL, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Collection, getCollectionManager, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection, getReservedAttributes, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, getEventsManager, arginfo_phalcon_mvc_collection_geteventsmanager, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_Collection, getCollectionManager, arginfo_phalcon_mvc_collection_getcollectionmanager, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, getReservedAttributes, arginfo_phalcon_mvc_collection_getreservedattributes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, useImplicitObjectIds, arginfo_phalcon_mvc_collection_useimplicitobjectids, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Collection, setSource, arginfo_phalcon_mvc_collection_setsource, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Collection, getSource, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, getSource, arginfo_phalcon_mvc_collection_getsource, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, setConnectionService, arginfo_phalcon_mvc_collection_setconnectionservice, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection, getConnectionService, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, getConnectionService, arginfo_phalcon_mvc_collection_getconnectionservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, getConnection, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, readAttribute, arginfo_phalcon_mvc_collection_readattribute, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, writeAttribute, arginfo_phalcon_mvc_collection_writeattribute, ZEND_ACC_PUBLIC) @@ -217,31 +462,31 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_collection_method_entry) { PHP_ME(Phalcon_Mvc_Collection, _preSave, arginfo_phalcon_mvc_collection__presave, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Collection, _postSave, arginfo_phalcon_mvc_collection__postsave, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Collection, validate, arginfo_phalcon_mvc_collection_validate, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Collection, validationHasFailed, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, validationHasFailed, arginfo_phalcon_mvc_collection_validationhasfailed, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, fireEvent, arginfo_phalcon_mvc_collection_fireevent, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, fireEventCancel, arginfo_phalcon_mvc_collection_fireeventcancel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, _cancelOperation, arginfo_phalcon_mvc_collection__canceloperation, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Collection, _exists, arginfo_phalcon_mvc_collection__exists, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Collection, getMessages, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, getMessages, arginfo_phalcon_mvc_collection_getmessages, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, appendMessage, arginfo_phalcon_mvc_collection_appendmessage, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, prepareCU, NULL, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Collection, save, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection, create, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, save, arginfo_phalcon_mvc_collection_save, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, create, arginfo_phalcon_mvc_collection_create, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, createIfNotExist, arginfo_phalcon_mvc_collection_createifnotexist, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection, update, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, update, arginfo_phalcon_mvc_collection_update, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, findById, arginfo_phalcon_mvc_collection_findbyid, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Mvc_Collection, findFirst, arginfo_phalcon_mvc_collection_findfirst, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Mvc_Collection, find, arginfo_phalcon_mvc_collection_find, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Mvc_Collection, count, arginfo_phalcon_mvc_collection_count, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Mvc_Collection, aggregate, arginfo_phalcon_mvc_collection_aggregate, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Mvc_Collection, summatory, arginfo_phalcon_mvc_collection_summatory, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Mvc_Collection, delete, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, delete, arginfo_phalcon_mvc_collection_delete, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, setDirtyState, arginfo_phalcon_mvc_collection_setdirtystate, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection, getDirtyState, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, getDirtyState, arginfo_phalcon_mvc_collection_getdirtystate, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, addBehavior, arginfo_phalcon_mvc_collection_addbehavior, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Collection, skipOperation, arginfo_phalcon_mvc_collection_skipoperation, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection, toArray, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection, serialize, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, toArray, arginfo_phalcon_mvc_collection_toarray, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection, serialize, arginfo_phalcon_mvc_collection_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection, unserialize, arginfo_phalcon_mvc_collection_unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/collection/behavior.zep.c b/ext/phalcon/mvc/collection/behavior.zep.c index 87727099559..e035d3a4356 100644 --- a/ext/phalcon/mvc/collection/behavior.zep.c +++ b/ext/phalcon/mvc/collection/behavior.zep.c @@ -43,16 +43,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection_Behavior) { */ PHP_METHOD(Phalcon_Mvc_Collection_Behavior, __construct) { - zval *options = NULL; + zval *options = NULL, options_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), options); } @@ -61,26 +66,30 @@ PHP_METHOD(Phalcon_Mvc_Collection_Behavior, __construct) { */ PHP_METHOD(Phalcon_Mvc_Collection_Behavior, mustTakeAction) { - zval *eventName_param = NULL, *_0; - zval *eventName = NULL; + zval *eventName_param = NULL, _0; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &eventName_param); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, eventName)); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &eventName)); } @@ -92,37 +101,42 @@ PHP_METHOD(Phalcon_Mvc_Collection_Behavior, mustTakeAction) { */ PHP_METHOD(Phalcon_Mvc_Collection_Behavior, getOptions) { - zval *eventName_param = NULL, *options = NULL, *eventOptions = NULL; - zval *eventName = NULL; + zval *eventName_param = NULL, options, eventOptions; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&eventOptions); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &eventName_param); if (!eventName_param) { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_STRING(&eventName, ""); } else { if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } } - options = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!ZEPHIR_IS_STRING_IDENTICAL(eventName, "")) { - if (zephir_array_isset_fetch(&eventOptions, options, eventName, 1 TSRMLS_CC)) { - RETURN_CTOR(eventOptions); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!ZEPHIR_IS_STRING_IDENTICAL(&eventName, "")) { + if (zephir_array_isset_fetch(&eventOptions, &options, &eventName, 1 TSRMLS_CC)) { + RETURN_CTOR(&eventOptions); } RETURN_MM_NULL(); } - RETURN_CTOR(options); + RETURN_CTOR(&options); } @@ -131,13 +145,17 @@ PHP_METHOD(Phalcon_Mvc_Collection_Behavior, getOptions) { */ PHP_METHOD(Phalcon_Mvc_Collection_Behavior, notify) { - zval *type_param = NULL, *model; - zval *type = NULL; + zval *type_param = NULL, *model, model_sub; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&model_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &model); - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); RETURN_MM_NULL(); @@ -149,15 +167,22 @@ PHP_METHOD(Phalcon_Mvc_Collection_Behavior, notify) { */ PHP_METHOD(Phalcon_Mvc_Collection_Behavior, missingMethod) { - zval *method = NULL; - zval *model, *method_param = NULL, *arguments = NULL; + zval method; + zval *model, model_sub, *method_param = NULL, *arguments = NULL, arguments_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&arguments_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&method); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &model, &method_param, &arguments); - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); if (!arguments) { - arguments = ZEPHIR_GLOBAL(global_null); + arguments = &arguments_sub; + arguments = &__$null; } diff --git a/ext/phalcon/mvc/collection/behavior.zep.h b/ext/phalcon/mvc/collection/behavior.zep.h index 0040eca55c8..8ee1d2efeb6 100644 --- a/ext/phalcon/mvc/collection/behavior.zep.h +++ b/ext/phalcon/mvc/collection/behavior.zep.h @@ -13,22 +13,42 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_behavior___construct, 0, 0 ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_behavior_musttakeaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_behavior_musttakeaction, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_behavior_musttakeaction, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_behavior_getoptions, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_behavior_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_behavior_missingmethod, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/collection/behavior/softdelete.zep.c b/ext/phalcon/mvc/collection/behavior/softdelete.zep.c index 702170c561a..905da5a5e01 100644 --- a/ext/phalcon/mvc/collection/behavior/softdelete.zep.c +++ b/ext/phalcon/mvc/collection/behavior/softdelete.zep.c @@ -40,71 +40,81 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection_Behavior_SoftDelete) { */ PHP_METHOD(Phalcon_Mvc_Collection_Behavior_SoftDelete, notify) { - HashTable *_5$$7; - HashPosition _4$$7; - zephir_fcall_cache_entry *_7 = NULL; + zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *model, *options = NULL, *value = NULL, *field = NULL, *updateModel = NULL, *message = NULL, *_0$$3, *_1$$3 = NULL, *_2$$6 = NULL, *_3$$7 = NULL, **_6$$7; - zval *type = NULL; + zval *type_param = NULL, *model, model_sub, options, value, field, updateModel, message, _0$$3, _1$$3, _2$$6, _3$$7, *_4$$7; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&updateModel); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &model); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - if (ZEPHIR_IS_STRING(type, "beforeDelete")) { + if (ZEPHIR_IS_STRING(&type, "beforeDelete")) { ZEPHIR_CALL_METHOD(&options, this_ptr, "getoptions", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(value); - if (!(zephir_array_isset_string_fetch(&value, options, SS("value"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&value); + if (!(zephir_array_isset_string_fetch(&value, &options, SL("value"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The option 'value' is required", "phalcon/mvc/collection/behavior/softdelete.zep", 50); return; } - ZEPHIR_OBS_VAR(field); - if (!(zephir_array_isset_string_fetch(&field, options, SS("field"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&field); + if (!(zephir_array_isset_string_fetch(&field, &options, SL("field"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The option 'field' is required", "phalcon/mvc/collection/behavior/softdelete.zep", 57); return; } - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_BOOL(_0$$3, 1); - ZEPHIR_CALL_METHOD(NULL, model, "skipoperation", NULL, 0, _0$$3); + ZVAL_BOOL(&_0$$3, 1); + ZEPHIR_CALL_METHOD(NULL, model, "skipoperation", NULL, 0, &_0$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, model, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&_1$$3, model, "readattribute", NULL, 0, &field); zephir_check_call_status(); - if (!ZEPHIR_IS_EQUAL(_1$$3, value)) { - ZEPHIR_INIT_VAR(updateModel); - if (zephir_clone(updateModel, model TSRMLS_CC) == FAILURE) { + if (!ZEPHIR_IS_EQUAL(&_1$$3, &value)) { + ZEPHIR_INIT_VAR(&updateModel); + if (zephir_clone(&updateModel, model TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_CALL_METHOD(NULL, updateModel, "writeattribute", NULL, 0, field, value); + ZEPHIR_CALL_METHOD(NULL, &updateModel, "writeattribute", NULL, 0, &field, &value); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2$$6, updateModel, "save", NULL, 0); + ZEPHIR_CALL_METHOD(&_2$$6, &updateModel, "save", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_2$$6))) { - ZEPHIR_CALL_METHOD(&_3$$7, updateModel, "getmessages", NULL, 0); + if (!(zephir_is_true(&_2$$6))) { + ZEPHIR_CALL_METHOD(&_3$$7, &updateModel, "getmessages", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_3$$7, &_5$$7, &_4$$7, 0, 0, "phalcon/mvc/collection/behavior/softdelete.zep", 89); - for ( - ; zend_hash_get_current_data_ex(_5$$7, (void**) &_6$$7, &_4$$7) == SUCCESS - ; zend_hash_move_forward_ex(_5$$7, &_4$$7) - ) { - ZEPHIR_GET_HVALUE(message, _6$$7); - ZEPHIR_CALL_METHOD(NULL, model, "appendmessage", &_7, 0, message); + zephir_is_iterable(&_3$$7, 0, "phalcon/mvc/collection/behavior/softdelete.zep", 89); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3$$7), _4$$7) + { + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _4$$7); + ZEPHIR_CALL_METHOD(NULL, model, "appendmessage", &_5, 0, &message); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, field, value); + ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, &field, &value); zephir_check_call_status(); } } diff --git a/ext/phalcon/mvc/collection/behavior/softdelete.zep.h b/ext/phalcon/mvc/collection/behavior/softdelete.zep.h index 171cabd0828..382a98ea337 100644 --- a/ext/phalcon/mvc/collection/behavior/softdelete.zep.h +++ b/ext/phalcon/mvc/collection/behavior/softdelete.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection_Behavior_SoftDelete); PHP_METHOD(Phalcon_Mvc_Collection_Behavior_SoftDelete, notify); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_behavior_softdelete_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/collection/behavior/timestampable.zep.c b/ext/phalcon/mvc/collection/behavior/timestampable.zep.c index fc4cbf9c11c..5058e4e206e 100644 --- a/ext/phalcon/mvc/collection/behavior/timestampable.zep.c +++ b/ext/phalcon/mvc/collection/behavior/timestampable.zep.c @@ -42,75 +42,84 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection_Behavior_Timestampable) { */ PHP_METHOD(Phalcon_Mvc_Collection_Behavior_Timestampable, notify) { - HashTable *_2$$12; - HashPosition _1$$12; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *model, *options = NULL, *timestamp = NULL, *singleField = NULL, *field = NULL, *generator = NULL, *format = NULL, *_0 = NULL, **_3$$12; - zval *type = NULL; + zval *type_param = NULL, *model, model_sub, options, timestamp, singleField, field, generator, format, _0, *_1$$12; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(×tamp); + ZVAL_UNDEF(&singleField); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&generator); + ZVAL_UNDEF(&format); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &model); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "musttakeaction", NULL, 0, type); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "musttakeaction", NULL, 0, &type); zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(_0)) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { RETURN_MM_NULL(); } - ZEPHIR_CALL_METHOD(&options, this_ptr, "getoptions", NULL, 0, type); + ZEPHIR_CALL_METHOD(&options, this_ptr, "getoptions", NULL, 0, &type); zephir_check_call_status(); - if (Z_TYPE_P(options) == IS_ARRAY) { - ZEPHIR_OBS_VAR(field); - if (!(zephir_array_isset_string_fetch(&field, options, SS("field"), 0 TSRMLS_CC))) { + if (Z_TYPE_P(&options) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&field); + if (!(zephir_array_isset_string_fetch(&field, &options, SL("field"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The option 'field' is required", "phalcon/mvc/collection/behavior/timestampable.zep", 56); return; } - ZEPHIR_INIT_VAR(timestamp); - ZVAL_NULL(timestamp); - ZEPHIR_OBS_VAR(format); - if (zephir_array_isset_string_fetch(&format, options, SS("format"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_FUNCTION(×tamp, "date", NULL, 317, format); + ZEPHIR_INIT_VAR(×tamp); + ZVAL_NULL(×tamp); + ZEPHIR_OBS_VAR(&format); + if (zephir_array_isset_string_fetch(&format, &options, SL("format"), 0)) { + ZEPHIR_CALL_FUNCTION(×tamp, "date", NULL, 277, &format); zephir_check_call_status(); } else { - ZEPHIR_OBS_VAR(generator); - if (zephir_array_isset_string_fetch(&generator, options, SS("generator"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(generator) == IS_OBJECT) { - if (zephir_instance_of_ev(generator, zend_ce_closure TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(timestamp); - ZEPHIR_CALL_USER_FUNC(timestamp, generator); + ZEPHIR_OBS_VAR(&generator); + if (zephir_array_isset_string_fetch(&generator, &options, SL("generator"), 0)) { + if (Z_TYPE_P(&generator) == IS_OBJECT) { + if (zephir_instance_of_ev(&generator, zend_ce_closure TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(×tamp); + ZEPHIR_CALL_USER_FUNC(×tamp, &generator); zephir_check_call_status(); } } } } - if (Z_TYPE_P(timestamp) == IS_NULL) { - ZEPHIR_INIT_NVAR(timestamp); - zephir_time(timestamp); + if (Z_TYPE_P(×tamp) == IS_NULL) { + ZEPHIR_INIT_NVAR(×tamp); + zephir_time(×tamp); } - if (Z_TYPE_P(field) == IS_ARRAY) { - zephir_is_iterable(field, &_2$$12, &_1$$12, 0, 0, "phalcon/mvc/collection/behavior/timestampable.zep", 94); - for ( - ; zend_hash_get_current_data_ex(_2$$12, (void**) &_3$$12, &_1$$12) == SUCCESS - ; zend_hash_move_forward_ex(_2$$12, &_1$$12) - ) { - ZEPHIR_GET_HVALUE(singleField, _3$$12); - ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", &_4, 0, singleField, timestamp); + if (Z_TYPE_P(&field) == IS_ARRAY) { + zephir_is_iterable(&field, 0, "phalcon/mvc/collection/behavior/timestampable.zep", 94); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&field), _1$$12) + { + ZEPHIR_INIT_NVAR(&singleField); + ZVAL_COPY(&singleField, _1$$12); + ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", &_2, 0, &singleField, ×tamp); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&singleField); } else { - ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, field, timestamp); + ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, &field, ×tamp); zephir_check_call_status(); } } diff --git a/ext/phalcon/mvc/collection/behavior/timestampable.zep.h b/ext/phalcon/mvc/collection/behavior/timestampable.zep.h index ddee921b80c..c0d1d2092dd 100644 --- a/ext/phalcon/mvc/collection/behavior/timestampable.zep.h +++ b/ext/phalcon/mvc/collection/behavior/timestampable.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection_Behavior_Timestampable); PHP_METHOD(Phalcon_Mvc_Collection_Behavior_Timestampable, notify); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_behavior_timestampable_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/collection/behaviorinterface.zep.h b/ext/phalcon/mvc/collection/behaviorinterface.zep.h index 28114385007..ccef5e9b606 100644 --- a/ext/phalcon/mvc/collection/behaviorinterface.zep.h +++ b/ext/phalcon/mvc/collection/behaviorinterface.zep.h @@ -4,13 +4,21 @@ extern zend_class_entry *phalcon_mvc_collection_behaviorinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection_BehaviorInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_behaviorinterface_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_behaviorinterface_missingmethod, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Mvc\\CollectionInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/collection/document.zep.c b/ext/phalcon/mvc/collection/document.zep.c index 413d3f100ff..3e6fe0f872a 100644 --- a/ext/phalcon/mvc/collection/document.zep.c +++ b/ext/phalcon/mvc/collection/document.zep.c @@ -45,7 +45,10 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection_Document) { */ PHP_METHOD(Phalcon_Mvc_Collection_Document, offsetExists) { - zval *index; + zval *index, index_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); zephir_fetch_params(0, 1, 0, &index); @@ -60,16 +63,20 @@ PHP_METHOD(Phalcon_Mvc_Collection_Document, offsetExists) { */ PHP_METHOD(Phalcon_Mvc_Collection_Document, offsetGet) { - zval *index, *value = NULL; + zval *index, index_sub, value; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index); - ZEPHIR_OBS_VAR(value); + ZEPHIR_OBS_VAR(&value); if (zephir_fetch_property_zval(&value, this_ptr, index, PH_SILENT_CC)) { - RETURN_CCTOR(value); + RETURN_CCTOR(&value); } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The index does not exist in the row", "phalcon/mvc/collection/document.zep", 53); return; @@ -81,13 +88,17 @@ PHP_METHOD(Phalcon_Mvc_Collection_Document, offsetGet) { */ PHP_METHOD(Phalcon_Mvc_Collection_Document, offsetSet) { - zval *index, *value; + zval *index, index_sub, *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&value_sub); zephir_fetch_params(0, 2, 0, &index, &value); - zephir_update_property_zval_zval(getThis(), index, value TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, index, value TSRMLS_CC); } @@ -98,7 +109,10 @@ PHP_METHOD(Phalcon_Mvc_Collection_Document, offsetSet) { */ PHP_METHOD(Phalcon_Mvc_Collection_Document, offsetUnset) { - zval *offset; + zval *offset, offset_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&offset_sub); zephir_fetch_params(0, 1, 0, &offset); @@ -121,16 +135,20 @@ PHP_METHOD(Phalcon_Mvc_Collection_Document, offsetUnset) { */ PHP_METHOD(Phalcon_Mvc_Collection_Document, readAttribute) { - zval *attribute, *value = NULL; + zval *attribute, attribute_sub, value; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute_sub); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attribute); - ZEPHIR_OBS_VAR(value); + ZEPHIR_OBS_VAR(&value); if (zephir_fetch_property_zval(&value, this_ptr, attribute, PH_SILENT_CC)) { - RETURN_CTOR(value); + RETURN_CTOR(&value); } RETURN_MM_NULL(); @@ -148,25 +166,29 @@ PHP_METHOD(Phalcon_Mvc_Collection_Document, readAttribute) { */ PHP_METHOD(Phalcon_Mvc_Collection_Document, writeAttribute) { - zval *attribute_param = NULL, *value; - zval *attribute = NULL; + zval *attribute_param = NULL, *value, value_sub; + zval attribute; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &attribute_param, &value); if (UNEXPECTED(Z_TYPE_P(attribute_param) != IS_STRING && Z_TYPE_P(attribute_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(attribute_param) == IS_STRING)) { - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); } else { - ZEPHIR_INIT_VAR(attribute); - ZVAL_EMPTY_STRING(attribute); + ZEPHIR_INIT_VAR(&attribute); + ZVAL_EMPTY_STRING(&attribute); } - zephir_update_property_zval_zval(getThis(), attribute, value TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, &attribute, value TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -179,10 +201,12 @@ PHP_METHOD(Phalcon_Mvc_Collection_Document, writeAttribute) { PHP_METHOD(Phalcon_Mvc_Collection_Document, toArray) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 22, this_ptr); + ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 17, this_ptr); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/mvc/collection/document.zep.h b/ext/phalcon/mvc/collection/document.zep.h index adf6efd9e5d..232fbfee1a5 100644 --- a/ext/phalcon/mvc/collection/document.zep.h +++ b/ext/phalcon/mvc/collection/document.zep.h @@ -11,7 +11,11 @@ PHP_METHOD(Phalcon_Mvc_Collection_Document, readAttribute); PHP_METHOD(Phalcon_Mvc_Collection_Document, writeAttribute); PHP_METHOD(Phalcon_Mvc_Collection_Document, toArray); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_document_offsetexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_document_offsetexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_document_offsetexists, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() @@ -33,7 +37,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_document_readattribute, 0, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_document_writeattribute, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/collection/manager.zep.c b/ext/phalcon/mvc/collection/manager.zep.c index 56639b37c8d..edce6eb0d56 100644 --- a/ext/phalcon/mvc/collection/manager.zep.c +++ b/ext/phalcon/mvc/collection/manager.zep.c @@ -74,7 +74,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection_Manager) { PHP_METHOD(Phalcon_Mvc_Collection_Manager, getServiceName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_serviceName"); @@ -82,13 +83,16 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getServiceName) { PHP_METHOD(Phalcon_Mvc_Collection_Manager, setServiceName) { - zval *serviceName; + zval *serviceName, serviceName_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&serviceName_sub); zephir_fetch_params(0, 1, 0, &serviceName); - zephir_update_property_this(getThis(), SL("_serviceName"), serviceName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_serviceName"), serviceName); RETURN_THISW(); } @@ -98,13 +102,16 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, setServiceName) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -113,7 +120,8 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, setDI) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -124,13 +132,16 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getDI) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, setEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); } @@ -139,7 +150,8 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, setEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -150,16 +162,21 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, setCustomEventsManager) { - zval *model, *eventsManager, *_0; + zval *model, model_sub, *eventsManager, eventsManager_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&eventsManager_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &eventsManager); - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 0 TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_customEventsManager"), _0, eventsManager TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 0 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_customEventsManager"), &_0, eventsManager TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -169,21 +186,27 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, setCustomEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getCustomEventsManager) { - zval *model, *customEventsManager = NULL, *className = NULL, *_0$$4; + zval *model, model_sub, customEventsManager, className, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&customEventsManager); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_OBS_VAR(customEventsManager); - zephir_read_property_this(&customEventsManager, this_ptr, SL("_customEventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(customEventsManager) == IS_ARRAY) { - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, model, 1 TSRMLS_CC); - if (zephir_array_isset(customEventsManager, className)) { - zephir_array_fetch(&_0$$4, customEventsManager, className, PH_NOISY | PH_READONLY, "phalcon/mvc/collection/manager.zep", 122 TSRMLS_CC); - RETURN_CTOR(_0$$4); + ZEPHIR_OBS_VAR(&customEventsManager); + zephir_read_property(&customEventsManager, this_ptr, SL("_customEventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&customEventsManager) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, model, 1 TSRMLS_CC); + if (zephir_array_isset(&customEventsManager, &className)) { + zephir_array_fetch(&_0$$4, &customEventsManager, &className, PH_NOISY | PH_READONLY, "phalcon/mvc/collection/manager.zep", 122 TSRMLS_CC); + RETURN_CTOR(&_0$$4); } } RETURN_MM_NULL(); @@ -196,33 +219,39 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getCustomEventsManager) { PHP_METHOD(Phalcon_Mvc_Collection_Manager, initialize) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *className = NULL, *initialized = NULL, *eventsManager = NULL, *_0$$5; + zval *model, model_sub, className, initialized, eventsManager, _0$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&initialized); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&_0$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, model, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(initialized); - zephir_read_property_this(&initialized, this_ptr, SL("_initialized"), PH_NOISY_CC); - if (!(zephir_array_isset(initialized, className))) { - if ((zephir_method_exists_ex(model, SS("initialize") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, model, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&initialized); + zephir_read_property(&initialized, this_ptr, SL("_initialized"), PH_NOISY_CC); + if (!(zephir_array_isset(&initialized, &className))) { + if ((zephir_method_exists_ex(model, SL("initialize") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, model, "initialize", NULL, 0); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$5); - ZVAL_STRING(_0$$5, "collectionManager:afterInitialize", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _0$$5, model); - zephir_check_temp_parameter(_0$$5); + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_0$$5); + ZVAL_STRING(&_0$$5, "collectionManager:afterInitialize"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_0$$5, model); zephir_check_call_status(); } - zephir_update_property_array(this_ptr, SL("_initialized"), className, model TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_lastInitialized"), model TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_initialized"), &className, model TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_lastInitialized"), model); } ZEPHIR_MM_RESTORE(); @@ -233,28 +262,33 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, initialize) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, isInitialized) { - zval *modelName_param = NULL, *_0, *_1; - zval *modelName = NULL; + zval *modelName_param = NULL, _0, _1; + zval modelName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &modelName_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_fast_strtolower(_1, modelName); - RETURN_MM_BOOL(zephir_array_isset(_0, _1)); + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_fast_strtolower(&_1, &modelName); + RETURN_MM_BOOL(zephir_array_isset(&_0, &_1)); } @@ -263,7 +297,8 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, isInitialized) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getLastInitialized) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lastInitialized"); @@ -274,27 +309,32 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getLastInitialized) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, setConnectionService) { - zval *connectionService = NULL; - zval *model, *connectionService_param = NULL, *_0; + zval connectionService; + zval *model, model_sub, *connectionService_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&connectionService); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &connectionService_param); if (UNEXPECTED(Z_TYPE_P(connectionService_param) != IS_STRING && Z_TYPE_P(connectionService_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(connectionService_param) == IS_STRING)) { - zephir_get_strval(connectionService, connectionService_param); + zephir_get_strval(&connectionService, connectionService_param); } else { - ZEPHIR_INIT_VAR(connectionService); - ZVAL_EMPTY_STRING(connectionService); + ZEPHIR_INIT_VAR(&connectionService); + ZVAL_EMPTY_STRING(&connectionService); } - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 0 TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_connectionServices"), _0, connectionService TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 0 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_connectionServices"), &_0, &connectionService TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -304,24 +344,31 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, setConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getConnectionService) { - zval *model, *service = NULL, *entityName = NULL, *_0, *_1$$3; + zval *model, model_sub, service, entityName, _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_OBS_VAR(service); - zephir_read_property_this(&service, this_ptr, SL("_serviceName"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 0 TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_connectionServices"), PH_NOISY_CC); - if (zephir_array_isset(_0, entityName)) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_connectionServices"), PH_NOISY_CC); - ZEPHIR_OBS_NVAR(service); - zephir_array_fetch(&service, _1$$3, entityName, PH_NOISY, "phalcon/mvc/collection/manager.zep", 198 TSRMLS_CC); + ZEPHIR_OBS_VAR(&service); + zephir_read_property(&service, this_ptr, SL("_serviceName"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 0 TSRMLS_CC); + zephir_read_property(&_0, this_ptr, SL("_connectionServices"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_0, &entityName)) { + zephir_read_property(&_1$$3, this_ptr, SL("_connectionServices"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_OBS_NVAR(&service); + zephir_array_fetch(&service, &_1$$3, &entityName, PH_NOISY, "phalcon/mvc/collection/manager.zep", 198 TSRMLS_CC); } - RETURN_CCTOR(service); + RETURN_CCTOR(&service); } @@ -331,7 +378,12 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getConnectionService) { PHP_METHOD(Phalcon_Mvc_Collection_Manager, useImplicitObjectIds) { zend_bool useImplicitObjectIds; - zval *model, *useImplicitObjectIds_param = NULL, *_0, *_1; + zval *model, model_sub, *useImplicitObjectIds_param = NULL, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &useImplicitObjectIds_param); @@ -339,11 +391,11 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, useImplicitObjectIds) { useImplicitObjectIds = zephir_get_boolval(useImplicitObjectIds_param); - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_BOOL(_1, useImplicitObjectIds); - zephir_update_property_array(this_ptr, SL("_implicitObjectsIds"), _0, _1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + ZVAL_BOOL(&_1, useImplicitObjectIds); + zephir_update_property_array(this_ptr, SL("_implicitObjectsIds"), &_0, &_1 TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -353,18 +405,24 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, useImplicitObjectIds) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, isUsingImplicitObjectIds) { - zval *model, *implicit = NULL, *_0, *_1; + zval *model, model_sub, implicit, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&implicit); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_implicitObjectsIds"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_get_class(_1, model, 0 TSRMLS_CC); - if (zephir_array_isset_fetch(&implicit, _0, _1, 1 TSRMLS_CC)) { - RETURN_CTOR(implicit); + zephir_read_property(&_0, this_ptr, SL("_implicitObjectsIds"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_get_class(&_1, model, 0 TSRMLS_CC); + if (zephir_array_isset_fetch(&implicit, &_0, &_1, 1 TSRMLS_CC)) { + RETURN_CTOR(&implicit); } RETURN_MM_BOOL(1); @@ -379,38 +437,46 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, isUsingImplicitObjectIds) { PHP_METHOD(Phalcon_Mvc_Collection_Manager, getConnection) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *service = NULL, *connectionService = NULL, *connection = NULL, *dependencyInjector = NULL, *entityName = NULL; + zval *model, model_sub, service, connectionService, connection, dependencyInjector, entityName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&connectionService); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&entityName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_OBS_VAR(service); - zephir_read_property_this(&service, this_ptr, SL("_serviceName"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(connectionService); - zephir_read_property_this(&connectionService, this_ptr, SL("_connectionServices"), PH_NOISY_CC); - if (Z_TYPE_P(connectionService) == IS_ARRAY) { - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 0 TSRMLS_CC); - if (zephir_array_isset(connectionService, entityName)) { - ZEPHIR_OBS_NVAR(service); - zephir_array_fetch(&service, connectionService, entityName, PH_NOISY, "phalcon/mvc/collection/manager.zep", 248 TSRMLS_CC); + ZEPHIR_OBS_VAR(&service); + zephir_read_property(&service, this_ptr, SL("_serviceName"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&connectionService); + zephir_read_property(&connectionService, this_ptr, SL("_connectionServices"), PH_NOISY_CC); + if (Z_TYPE_P(&connectionService) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 0 TSRMLS_CC); + if (zephir_array_isset(&connectionService, &entityName)) { + ZEPHIR_OBS_NVAR(&service); + zephir_array_fetch(&service, &connectionService, &entityName, PH_NOISY, "phalcon/mvc/collection/manager.zep", 248 TSRMLS_CC); } } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "A dependency injector container is required to obtain the services related to the ORM", "phalcon/mvc/collection/manager.zep", 254); return; } - ZEPHIR_CALL_METHOD(&connection, dependencyInjector, "getshared", NULL, 0, service); + ZEPHIR_CALL_METHOD(&connection, &dependencyInjector, "getshared", NULL, 0, &service); zephir_check_call_status(); - if (Z_TYPE_P(connection) != IS_OBJECT) { + if (Z_TYPE_P(&connection) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "Invalid injected connection service", "phalcon/mvc/collection/manager.zep", 262); return; } - RETURN_CCTOR(connection); + RETURN_CCTOR(&connection); } @@ -420,77 +486,89 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, getConnection) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, notifyEvent) { - HashTable *_2$$4; - HashPosition _1$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventName_param = NULL, *model, *behavior = NULL, *behaviors = NULL, *modelsBehaviors = NULL, *eventsManager = NULL, *status = NULL, *customEventsManager = NULL, *_0$$3, **_3$$4, *_5$$9; - zval *eventName = NULL, *_4$$7, *_6$$10; + zval *eventName_param = NULL, *model, model_sub, behavior, behaviors, modelsBehaviors, eventsManager, status, customEventsManager, _0$$3, *_1$$4, _3$$9; + zval eventName, _2$$7, _4$$10; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_4$$10); + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&behavior); + ZVAL_UNDEF(&behaviors); + ZVAL_UNDEF(&modelsBehaviors); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&customEventsManager); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_3$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &eventName_param, &model); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } - ZEPHIR_INIT_VAR(status); - ZVAL_NULL(status); - ZEPHIR_OBS_VAR(behaviors); - zephir_read_property_this(&behaviors, this_ptr, SL("_behaviors"), PH_NOISY_CC); - if (Z_TYPE_P(behaviors) == IS_ARRAY) { - ZEPHIR_OBS_VAR(modelsBehaviors); - ZEPHIR_INIT_VAR(_0$$3); - zephir_get_class(_0$$3, model, 1 TSRMLS_CC); - if (zephir_array_isset_fetch(&modelsBehaviors, behaviors, _0$$3, 0 TSRMLS_CC)) { - zephir_is_iterable(modelsBehaviors, &_2$$4, &_1$$4, 0, 0, "phalcon/mvc/collection/manager.zep", 289); - for ( - ; zend_hash_get_current_data_ex(_2$$4, (void**) &_3$$4, &_1$$4) == SUCCESS - ; zend_hash_move_forward_ex(_2$$4, &_1$$4) - ) { - ZEPHIR_GET_HVALUE(behavior, _3$$4); - ZEPHIR_CALL_METHOD(&status, behavior, "notify", NULL, 0, eventName, model); + ZEPHIR_INIT_VAR(&status); + ZVAL_NULL(&status); + ZEPHIR_OBS_VAR(&behaviors); + zephir_read_property(&behaviors, this_ptr, SL("_behaviors"), PH_NOISY_CC); + if (Z_TYPE_P(&behaviors) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&modelsBehaviors); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_get_class(&_0$$3, model, 1 TSRMLS_CC); + if (zephir_array_isset_fetch(&modelsBehaviors, &behaviors, &_0$$3, 0 TSRMLS_CC)) { + zephir_is_iterable(&modelsBehaviors, 0, "phalcon/mvc/collection/manager.zep", 289); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&modelsBehaviors), _1$$4) + { + ZEPHIR_INIT_NVAR(&behavior); + ZVAL_COPY(&behavior, _1$$4); + ZEPHIR_CALL_METHOD(&status, &behavior, "notify", NULL, 0, &eventName, model); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(status)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&status)) { RETURN_MM_BOOL(0); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&behavior); } } - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_4$$7); - ZEPHIR_CONCAT_SV(_4$$7, "collection:", eventName); - ZEPHIR_CALL_METHOD(&status, eventsManager, "fire", NULL, 0, _4$$7, model); + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$7); + ZEPHIR_CONCAT_SV(&_2$$7, "collection:", &eventName); + ZEPHIR_CALL_METHOD(&status, &eventsManager, "fire", NULL, 0, &_2$$7, model); zephir_check_call_status(); - if (!(zephir_is_true(status))) { - RETURN_CCTOR(status); + if (!(zephir_is_true(&status))) { + RETURN_CCTOR(&status); } } - ZEPHIR_OBS_VAR(customEventsManager); - zephir_read_property_this(&customEventsManager, this_ptr, SL("_customEventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(customEventsManager) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_5$$9); - zephir_get_class(_5$$9, model, 1 TSRMLS_CC); - if (zephir_array_isset(customEventsManager, _5$$9)) { - ZEPHIR_INIT_VAR(_6$$10); - ZEPHIR_CONCAT_SV(_6$$10, "collection:", eventName); - ZEPHIR_CALL_METHOD(&status, customEventsManager, "fire", NULL, 0, _6$$10, model); + ZEPHIR_OBS_VAR(&customEventsManager); + zephir_read_property(&customEventsManager, this_ptr, SL("_customEventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&customEventsManager) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_3$$9); + zephir_get_class(&_3$$9, model, 1 TSRMLS_CC); + if (zephir_array_isset(&customEventsManager, &_3$$9)) { + ZEPHIR_INIT_VAR(&_4$$10); + ZEPHIR_CONCAT_SV(&_4$$10, "collection:", &eventName); + ZEPHIR_CALL_METHOD(&status, &customEventsManager, "fire", NULL, 0, &_4$$10, model); zephir_check_call_status(); - if (!(zephir_is_true(status))) { - RETURN_CCTOR(status); + if (!(zephir_is_true(&status))) { + RETURN_CCTOR(&status); } } } - RETURN_CCTOR(status); + RETURN_CCTOR(&status); } @@ -501,54 +579,64 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, notifyEvent) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, missingMethod) { - HashTable *_2$$4; - HashPosition _1$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventName = NULL, *_4$$7; - zval *model, *eventName_param = NULL, *data, *behaviors = NULL, *modelsBehaviors = NULL, *result = NULL, *eventsManager = NULL, *behavior = NULL, *_0$$3, **_3$$4; + zval eventName, _2$$7; + zval *model, model_sub, *eventName_param = NULL, *data, data_sub, behaviors, modelsBehaviors, result, eventsManager, behavior, _0$$3, *_1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&behaviors); + ZVAL_UNDEF(&modelsBehaviors); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&behavior); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_2$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &model, &eventName_param, &data); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } - ZEPHIR_OBS_VAR(behaviors); - zephir_read_property_this(&behaviors, this_ptr, SL("_behaviors"), PH_NOISY_CC); - if (Z_TYPE_P(behaviors) == IS_ARRAY) { - ZEPHIR_OBS_VAR(modelsBehaviors); - ZEPHIR_INIT_VAR(_0$$3); - zephir_get_class(_0$$3, model, 1 TSRMLS_CC); - if (zephir_array_isset_fetch(&modelsBehaviors, behaviors, _0$$3, 0 TSRMLS_CC)) { - zephir_is_iterable(modelsBehaviors, &_2$$4, &_1$$4, 0, 0, "phalcon/mvc/collection/manager.zep", 345); - for ( - ; zend_hash_get_current_data_ex(_2$$4, (void**) &_3$$4, &_1$$4) == SUCCESS - ; zend_hash_move_forward_ex(_2$$4, &_1$$4) - ) { - ZEPHIR_GET_HVALUE(behavior, _3$$4); - ZEPHIR_CALL_METHOD(&result, behavior, "missingmethod", NULL, 0, model, eventName, data); + ZEPHIR_OBS_VAR(&behaviors); + zephir_read_property(&behaviors, this_ptr, SL("_behaviors"), PH_NOISY_CC); + if (Z_TYPE_P(&behaviors) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&modelsBehaviors); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_get_class(&_0$$3, model, 1 TSRMLS_CC); + if (zephir_array_isset_fetch(&modelsBehaviors, &behaviors, &_0$$3, 0 TSRMLS_CC)) { + zephir_is_iterable(&modelsBehaviors, 0, "phalcon/mvc/collection/manager.zep", 345); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&modelsBehaviors), _1$$4) + { + ZEPHIR_INIT_NVAR(&behavior); + ZVAL_COPY(&behavior, _1$$4); + ZEPHIR_CALL_METHOD(&result, &behavior, "missingmethod", NULL, 0, model, &eventName, data); zephir_check_call_status(); - if (Z_TYPE_P(result) != IS_NULL) { - RETURN_CCTOR(result); + if (Z_TYPE_P(&result) != IS_NULL) { + RETURN_CCTOR(&result); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&behavior); } } - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_4$$7); - ZEPHIR_CONCAT_SV(_4$$7, "model:", eventName); - ZEPHIR_RETURN_CALL_METHOD(eventsManager, "fire", NULL, 0, _4$$7, model, data); + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$7); + ZEPHIR_CONCAT_SV(&_2$$7, "model:", &eventName); + ZEPHIR_RETURN_CALL_METHOD(&eventsManager, "fire", NULL, 0, &_2$$7, model, data); zephir_check_call_status(); RETURN_MM(); } @@ -561,23 +649,30 @@ PHP_METHOD(Phalcon_Mvc_Collection_Manager, missingMethod) { */ PHP_METHOD(Phalcon_Mvc_Collection_Manager, addBehavior) { - zval *model, *behavior, *entityName = NULL, *modelsBehaviors = NULL, *_0; + zval *model, model_sub, *behavior, behavior_sub, entityName, modelsBehaviors, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&behavior_sub); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&modelsBehaviors); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &behavior); - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 1 TSRMLS_CC); - ZEPHIR_OBS_VAR(modelsBehaviors); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_behaviors"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&modelsBehaviors, _0, entityName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(modelsBehaviors); - array_init(modelsBehaviors); + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 1 TSRMLS_CC); + ZEPHIR_OBS_VAR(&modelsBehaviors); + zephir_read_property(&_0, this_ptr, SL("_behaviors"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&modelsBehaviors, &_0, &entityName, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&modelsBehaviors); + array_init(&modelsBehaviors); } zephir_array_append(&modelsBehaviors, behavior, PH_SEPARATE, "phalcon/mvc/collection/manager.zep", 378); - zephir_update_property_array(this_ptr, SL("_behaviors"), entityName, modelsBehaviors TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_behaviors"), &entityName, &modelsBehaviors TSRMLS_CC); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/mvc/collection/manager.zep.h b/ext/phalcon/mvc/collection/manager.zep.h index 320ecf4f774..02e0adc6c43 100644 --- a/ext/phalcon/mvc/collection/manager.zep.h +++ b/ext/phalcon/mvc/collection/manager.zep.h @@ -31,10 +31,24 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_manager_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_seteventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_manager_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_setcustomeventsmanager, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) @@ -48,25 +62,56 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_initialize, 0, 0, ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_isinitialized, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_isinitialized, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_isinitialized, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_manager_getlastinitialized, 0, 0, Phalcon\\Mvc\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_getlastinitialized, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\CollectionInterface", 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_setconnectionservice, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_getconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_getconnectionservice, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_getconnectionservice, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_useimplicitobjectids, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useImplicitObjectIds, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useImplicitObjectIds) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_isusingimplicitobjectids, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_isusingimplicitobjectids, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_isusingimplicitobjectids, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() @@ -75,13 +120,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_getconnection, 0, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_notifyevent, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_manager_missingmethod, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_missingmethod, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_manager_missingmethod, 0, 3, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -94,14 +151,14 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_collection_manager_method_entry) { PHP_ME(Phalcon_Mvc_Collection_Manager, getServiceName, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, setServiceName, arginfo_phalcon_mvc_collection_manager_setservicename, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, setDI, arginfo_phalcon_mvc_collection_manager_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection_Manager, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection_Manager, getDI, arginfo_phalcon_mvc_collection_manager_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, setEventsManager, arginfo_phalcon_mvc_collection_manager_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection_Manager, getEventsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection_Manager, getEventsManager, arginfo_phalcon_mvc_collection_manager_geteventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, setCustomEventsManager, arginfo_phalcon_mvc_collection_manager_setcustomeventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, getCustomEventsManager, arginfo_phalcon_mvc_collection_manager_getcustomeventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, initialize, arginfo_phalcon_mvc_collection_manager_initialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, isInitialized, arginfo_phalcon_mvc_collection_manager_isinitialized, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Collection_Manager, getLastInitialized, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Collection_Manager, getLastInitialized, arginfo_phalcon_mvc_collection_manager_getlastinitialized, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, setConnectionService, arginfo_phalcon_mvc_collection_manager_setconnectionservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, getConnectionService, arginfo_phalcon_mvc_collection_manager_getconnectionservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Collection_Manager, useImplicitObjectIds, arginfo_phalcon_mvc_collection_manager_useimplicitobjectids, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/mvc/collection/managerinterface.zep.h b/ext/phalcon/mvc/collection/managerinterface.zep.h index d034a6eb3d6..c234a532d4f 100644 --- a/ext/phalcon/mvc/collection/managerinterface.zep.h +++ b/ext/phalcon/mvc/collection/managerinterface.zep.h @@ -8,7 +8,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_setcustom ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_getcustomeventsmanager, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_getcustomeventsmanager, 0, 1, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_getcustomeventsmanager, 0, 1, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() @@ -16,30 +20,65 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_initializ ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_isinitialized, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_isinitialized, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_isinitialized, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_getlastinitialized, 0, 0, Phalcon\\Mvc\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_getlastinitialized, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\CollectionInterface", 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_setconnectionservice, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_useimplicitobjectids, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useImplicitObjectIds, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useImplicitObjectIds) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_isusingimplicitobjectids, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_isusingimplicitobjectids, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_isusingimplicitobjectids, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_getconnection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_getconnection, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_getconnection, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collection_managerinterface_notifyevent, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_END_ARG_INFO() @@ -53,7 +92,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_collection_managerinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Collection_ManagerInterface, getCustomEventsManager, arginfo_phalcon_mvc_collection_managerinterface_getcustomeventsmanager) PHP_ABSTRACT_ME(Phalcon_Mvc_Collection_ManagerInterface, initialize, arginfo_phalcon_mvc_collection_managerinterface_initialize) PHP_ABSTRACT_ME(Phalcon_Mvc_Collection_ManagerInterface, isInitialized, arginfo_phalcon_mvc_collection_managerinterface_isinitialized) - PHP_ABSTRACT_ME(Phalcon_Mvc_Collection_ManagerInterface, getLastInitialized, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Collection_ManagerInterface, getLastInitialized, arginfo_phalcon_mvc_collection_managerinterface_getlastinitialized) PHP_ABSTRACT_ME(Phalcon_Mvc_Collection_ManagerInterface, setConnectionService, arginfo_phalcon_mvc_collection_managerinterface_setconnectionservice) PHP_ABSTRACT_ME(Phalcon_Mvc_Collection_ManagerInterface, useImplicitObjectIds, arginfo_phalcon_mvc_collection_managerinterface_useimplicitobjectids) PHP_ABSTRACT_ME(Phalcon_Mvc_Collection_ManagerInterface, isUsingImplicitObjectIds, arginfo_phalcon_mvc_collection_managerinterface_isusingimplicitobjectids) diff --git a/ext/phalcon/mvc/collectioninterface.zep.h b/ext/phalcon/mvc/collectioninterface.zep.h index c5d690d0170..6180b56ee1c 100644 --- a/ext/phalcon/mvc/collectioninterface.zep.h +++ b/ext/phalcon/mvc/collectioninterface.zep.h @@ -7,32 +7,110 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_setid, 0, 0, 1) ZEND_ARG_INFO(0, id) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_getreservedattributes, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_getreservedattributes, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_getsource, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_getsource, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_setconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_setdirtystate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collectioninterface_setdirtystate, 0, 1, Phalcon\\Mvc\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_setdirtystate, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\CollectionInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_cloneresult, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_getdirtystate, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_getdirtystate, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collectioninterface_cloneresult, 0, 2, Phalcon\\Mvc\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_cloneresult, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\CollectionInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Mvc\\CollectionInterface, 0) ZEND_ARG_ARRAY_INFO(0, document, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_fireevent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_fireevent, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_fireevent, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_fireeventcancel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_fireeventcancel, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_fireeventcancel, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_validationhasfailed, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_validationhasfailed, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collectioninterface_getmessages, 0, 0, Phalcon\\Mvc\\Model\\MessageInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\MessageInterface", 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_appendmessage, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, message, Phalcon\\Mvc\\Model\\MessageInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_findbyid, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_save, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_collectioninterface_findbyid, 0, 1, Phalcon\\Mvc\\CollectionInterface, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_findbyid, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\CollectionInterface", 1) +#endif ZEND_ARG_INFO(0, id) ZEND_END_ARG_INFO() @@ -48,26 +126,33 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_collectioninterface_count, 0, 0, 0) ZEND_ARG_ARRAY_INFO(0, parameters, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_delete, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_collectioninterface_delete, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_collectioninterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, setId, arginfo_phalcon_mvc_collectioninterface_setid) PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getId, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getReservedAttributes, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getSource, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getReservedAttributes, arginfo_phalcon_mvc_collectioninterface_getreservedattributes) + PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getSource, arginfo_phalcon_mvc_collectioninterface_getsource) PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, setConnectionService, arginfo_phalcon_mvc_collectioninterface_setconnectionservice) PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getConnection, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, setDirtyState, arginfo_phalcon_mvc_collectioninterface_setdirtystate) - PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getDirtyState, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getDirtyState, arginfo_phalcon_mvc_collectioninterface_getdirtystate) ZEND_FENTRY(cloneResult, NULL, arginfo_phalcon_mvc_collectioninterface_cloneresult, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, fireEvent, arginfo_phalcon_mvc_collectioninterface_fireevent) PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, fireEventCancel, arginfo_phalcon_mvc_collectioninterface_fireeventcancel) - PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, validationHasFailed, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getMessages, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, validationHasFailed, arginfo_phalcon_mvc_collectioninterface_validationhasfailed) + PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, getMessages, arginfo_phalcon_mvc_collectioninterface_getmessages) PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, appendMessage, arginfo_phalcon_mvc_collectioninterface_appendmessage) - PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, save, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, save, arginfo_phalcon_mvc_collectioninterface_save) ZEND_FENTRY(findById, NULL, arginfo_phalcon_mvc_collectioninterface_findbyid, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) ZEND_FENTRY(findFirst, NULL, arginfo_phalcon_mvc_collectioninterface_findfirst, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) ZEND_FENTRY(find, NULL, arginfo_phalcon_mvc_collectioninterface_find, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) ZEND_FENTRY(count, NULL, arginfo_phalcon_mvc_collectioninterface_count, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) - PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, delete, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_CollectionInterface, delete, arginfo_phalcon_mvc_collectioninterface_delete) PHP_FE_END }; diff --git a/ext/phalcon/mvc/controller.zep.c b/ext/phalcon/mvc/controller.zep.c index 1546e2590fa..14fb3b99383 100644 --- a/ext/phalcon/mvc/controller.zep.c +++ b/ext/phalcon/mvc/controller.zep.c @@ -70,10 +70,12 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Controller) { PHP_METHOD(Phalcon_Mvc_Controller, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); - if ((zephir_method_exists_ex(this_ptr, SS("onconstruct") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(this_ptr, SL("onconstruct") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "onconstruct", NULL, 0); zephir_check_call_status(); } diff --git a/ext/phalcon/mvc/controller/bindmodelinterface.zep.h b/ext/phalcon/mvc/controller/bindmodelinterface.zep.h index 0d6596e500d..e83b2b27eef 100644 --- a/ext/phalcon/mvc/controller/bindmodelinterface.zep.h +++ b/ext/phalcon/mvc/controller/bindmodelinterface.zep.h @@ -3,7 +3,14 @@ extern zend_class_entry *phalcon_mvc_controller_bindmodelinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Controller_BindModelInterface); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_controller_bindmodelinterface_getmodelname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_controller_bindmodelinterface_getmodelname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_controller_bindmodelinterface_method_entry) { - ZEND_FENTRY(getModelName, NULL, NULL, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) + ZEND_FENTRY(getModelName, NULL, arginfo_phalcon_mvc_controller_bindmodelinterface_getmodelname, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/dispatcher.zep.c b/ext/phalcon/mvc/dispatcher.zep.c index 03d97384359..2e2d6677388 100644 --- a/ext/phalcon/mvc/dispatcher.zep.c +++ b/ext/phalcon/mvc/dispatcher.zep.c @@ -62,24 +62,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Dispatcher) { PHP_METHOD(Phalcon_Mvc_Dispatcher, setControllerSuffix) { zval *controllerSuffix_param = NULL; - zval *controllerSuffix = NULL; + zval controllerSuffix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&controllerSuffix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &controllerSuffix_param); if (UNEXPECTED(Z_TYPE_P(controllerSuffix_param) != IS_STRING && Z_TYPE_P(controllerSuffix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerSuffix' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerSuffix' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(controllerSuffix_param) == IS_STRING)) { - zephir_get_strval(controllerSuffix, controllerSuffix_param); + zephir_get_strval(&controllerSuffix, controllerSuffix_param); } else { - ZEPHIR_INIT_VAR(controllerSuffix); - ZVAL_EMPTY_STRING(controllerSuffix); + ZEPHIR_INIT_VAR(&controllerSuffix); + ZVAL_EMPTY_STRING(&controllerSuffix); } - zephir_update_property_this(getThis(), SL("_handlerSuffix"), controllerSuffix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_handlerSuffix"), &controllerSuffix); ZEPHIR_MM_RESTORE(); } @@ -90,24 +93,27 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, setControllerSuffix) { PHP_METHOD(Phalcon_Mvc_Dispatcher, setDefaultController) { zval *controllerName_param = NULL; - zval *controllerName = NULL; + zval controllerName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&controllerName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &controllerName_param); if (UNEXPECTED(Z_TYPE_P(controllerName_param) != IS_STRING && Z_TYPE_P(controllerName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(controllerName_param) == IS_STRING)) { - zephir_get_strval(controllerName, controllerName_param); + zephir_get_strval(&controllerName, controllerName_param); } else { - ZEPHIR_INIT_VAR(controllerName); - ZVAL_EMPTY_STRING(controllerName); + ZEPHIR_INIT_VAR(&controllerName); + ZVAL_EMPTY_STRING(&controllerName); } - zephir_update_property_this(getThis(), SL("_defaultHandler"), controllerName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultHandler"), &controllerName); ZEPHIR_MM_RESTORE(); } @@ -118,24 +124,27 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, setDefaultController) { PHP_METHOD(Phalcon_Mvc_Dispatcher, setControllerName) { zval *controllerName_param = NULL; - zval *controllerName = NULL; + zval controllerName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&controllerName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &controllerName_param); if (UNEXPECTED(Z_TYPE_P(controllerName_param) != IS_STRING && Z_TYPE_P(controllerName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(controllerName_param) == IS_STRING)) { - zephir_get_strval(controllerName, controllerName_param); + zephir_get_strval(&controllerName, controllerName_param); } else { - ZEPHIR_INIT_VAR(controllerName); - ZVAL_EMPTY_STRING(controllerName); + ZEPHIR_INIT_VAR(&controllerName); + ZVAL_EMPTY_STRING(&controllerName); } - zephir_update_property_this(getThis(), SL("_handlerName"), controllerName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_handlerName"), &controllerName); ZEPHIR_MM_RESTORE(); } @@ -145,7 +154,8 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, setControllerName) { */ PHP_METHOD(Phalcon_Mvc_Dispatcher, getControllerName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_handlerName"); @@ -156,7 +166,8 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, getControllerName) { */ PHP_METHOD(Phalcon_Mvc_Dispatcher, getPreviousNamespaceName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_previousNamespaceName"); @@ -167,7 +178,8 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, getPreviousNamespaceName) { */ PHP_METHOD(Phalcon_Mvc_Dispatcher, getPreviousControllerName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_previousHandlerName"); @@ -178,7 +190,8 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, getPreviousControllerName) { */ PHP_METHOD(Phalcon_Mvc_Dispatcher, getPreviousActionName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_previousActionName"); @@ -190,21 +203,33 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, getPreviousActionName) { PHP_METHOD(Phalcon_Mvc_Dispatcher, _throwDispatchException) { zend_long exceptionCode, ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *exceptionCode_param = NULL, *dependencyInjector = NULL, *response = NULL, *exception = NULL, *_3 = NULL, *_4 = NULL, *_5, *_0$$3, *_1$$3, *_2$$3; - zval *message = NULL; + zval *message_param = NULL, *exceptionCode_param = NULL, dependencyInjector, response, exception, _3, _4, _5, _0$$3, _1$$3, _2$$3; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&exception); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &exceptionCode_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!exceptionCode_param) { exceptionCode = 0; @@ -213,47 +238,41 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, _throwDispatchException) { } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_mvc_dispatcher_exception_ce); - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "A dependency injection container is required to access the 'response' service", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_LONG(_2$$3, 0); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 9, _1$$3, _2$$3); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_mvc_dispatcher_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "A dependency injection container is required to access the 'response' service"); + ZVAL_LONG(&_2$$3, 0); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 4, &_1$$3, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/mvc/dispatcher.zep", 127 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/mvc/dispatcher.zep", 127 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(_4); - ZVAL_STRING(_4, "response", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3, dependencyInjector, "getshared", NULL, 0, _4); - zephir_check_temp_parameter(_4); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "response"); + ZEPHIR_CALL_METHOD(&_3, &dependencyInjector, "getshared", NULL, 0, &_4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(response, _3); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, 404); - ZEPHIR_INIT_VAR(_5); - ZVAL_STRING(_5, "Not Found", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, response, "setstatuscode", NULL, 0, _4, _5); - zephir_check_temp_parameter(_5); + ZEPHIR_CPY_WRT(&response, &_3); + ZVAL_LONG(&_5, 404); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, "Not Found"); + ZEPHIR_CALL_METHOD(NULL, &response, "setstatuscode", NULL, 0, &_5, &_4); zephir_check_call_status(); - ZEPHIR_INIT_VAR(exception); - object_init_ex(exception, phalcon_mvc_dispatcher_exception_ce); - ZEPHIR_INIT_NVAR(_4); - ZVAL_LONG(_4, exceptionCode); - ZEPHIR_CALL_METHOD(NULL, exception, "__construct", NULL, 9, message, _4); + ZEPHIR_INIT_VAR(&exception); + object_init_ex(&exception, phalcon_mvc_dispatcher_exception_ce); + ZVAL_LONG(&_5, exceptionCode); + ZEPHIR_CALL_METHOD(NULL, &exception, "__construct", NULL, 4, &message, &_5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "_handleexception", NULL, 0, exception); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "_handleexception", NULL, 0, &exception); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_3)) { RETURN_MM_BOOL(0); } - zephir_throw_exception_debug(exception, "phalcon/mvc/dispatcher.zep", 149 TSRMLS_CC); + zephir_throw_exception_debug(&exception, "phalcon/mvc/dispatcher.zep", 149 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -265,22 +284,28 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, _throwDispatchException) { PHP_METHOD(Phalcon_Mvc_Dispatcher, _handleException) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *exception, *eventsManager = NULL, *_0, *_1$$3 = NULL, *_2$$3; + zval *exception, exception_sub, eventsManager, _0, _1$$3, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&exception_sub); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &exception); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "dispatch:beforeException", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$3, eventsManager, "fire", NULL, 0, _2$$3, this_ptr, exception); - zephir_check_temp_parameter(_2$$3); + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "dispatch:beforeException"); + ZEPHIR_CALL_METHOD(&_1$$3, &eventsManager, "fire", NULL, 0, &_2$$3, this_ptr, exception); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1$$3)) { RETURN_MM_BOOL(0); } } @@ -346,23 +371,28 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, forward) { zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *forward, *eventsManager = NULL, *_0, *_1$$3; + zval *forward, forward_sub, eventsManager, _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&forward_sub); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &forward); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "dispatch:beforeForward", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _1$$3, this_ptr, forward); - zephir_check_temp_parameter(_1$$3); + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "dispatch:beforeForward"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_1$$3, this_ptr, forward); zephir_check_call_status(); } - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_dispatcher_ce, getThis(), "forward", &_2, 324, forward); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_dispatcher_ce, getThis(), "forward", &_2, 0, forward); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -374,6 +404,8 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, forward) { PHP_METHOD(Phalcon_Mvc_Dispatcher, getControllerClass) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -388,7 +420,8 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, getControllerClass) { */ PHP_METHOD(Phalcon_Mvc_Dispatcher, getLastController) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lastHandler"); @@ -399,7 +432,8 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, getLastController) { */ PHP_METHOD(Phalcon_Mvc_Dispatcher, getActiveController) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_activeHandler"); diff --git a/ext/phalcon/mvc/dispatcher.zep.h b/ext/phalcon/mvc/dispatcher.zep.h index a4385a2b59b..f1db2cfee72 100644 --- a/ext/phalcon/mvc/dispatcher.zep.h +++ b/ext/phalcon/mvc/dispatcher.zep.h @@ -18,20 +18,68 @@ PHP_METHOD(Phalcon_Mvc_Dispatcher, getLastController); PHP_METHOD(Phalcon_Mvc_Dispatcher, getActiveController); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_dispatcher_setcontrollersuffix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerSuffix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerSuffix) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_dispatcher_setdefaultcontroller, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_dispatcher_setcontrollername, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getcontrollername, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getcontrollername, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getpreviousnamespacename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getpreviousnamespacename, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getpreviouscontrollername, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getpreviouscontrollername, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getpreviousactionname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getpreviousactionname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_dispatcher__throwdispatchexception, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, exceptionCode, IS_LONG, 0) +#else ZEND_ARG_INFO(0, exceptionCode) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_dispatcher__handleexception, 0, 0, 1) @@ -42,19 +90,40 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_dispatcher_forward, 0, 0, 1) ZEND_ARG_INFO(0, forward) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getcontrollerclass, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getcontrollerclass, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_dispatcher_getlastcontroller, 0, 0, Phalcon\\Mvc\\ControllerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getlastcontroller, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ControllerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_dispatcher_getactivecontroller, 0, 0, Phalcon\\Mvc\\ControllerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcher_getactivecontroller, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ControllerInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_dispatcher_method_entry) { PHP_ME(Phalcon_Mvc_Dispatcher, setControllerSuffix, arginfo_phalcon_mvc_dispatcher_setcontrollersuffix, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Dispatcher, setDefaultController, arginfo_phalcon_mvc_dispatcher_setdefaultcontroller, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Dispatcher, setControllerName, arginfo_phalcon_mvc_dispatcher_setcontrollername, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Dispatcher, getControllerName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Dispatcher, getPreviousNamespaceName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Dispatcher, getPreviousControllerName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Dispatcher, getPreviousActionName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Dispatcher, getControllerName, arginfo_phalcon_mvc_dispatcher_getcontrollername, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Dispatcher, getPreviousNamespaceName, arginfo_phalcon_mvc_dispatcher_getpreviousnamespacename, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Dispatcher, getPreviousControllerName, arginfo_phalcon_mvc_dispatcher_getpreviouscontrollername, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Dispatcher, getPreviousActionName, arginfo_phalcon_mvc_dispatcher_getpreviousactionname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Dispatcher, _throwDispatchException, arginfo_phalcon_mvc_dispatcher__throwdispatchexception, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Dispatcher, _handleException, arginfo_phalcon_mvc_dispatcher__handleexception, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Dispatcher, forward, arginfo_phalcon_mvc_dispatcher_forward, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Dispatcher, getControllerClass, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Dispatcher, getLastController, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Dispatcher, getActiveController, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Dispatcher, getControllerClass, arginfo_phalcon_mvc_dispatcher_getcontrollerclass, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Dispatcher, getLastController, arginfo_phalcon_mvc_dispatcher_getlastcontroller, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Dispatcher, getActiveController, arginfo_phalcon_mvc_dispatcher_getactivecontroller, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/dispatcherinterface.zep.h b/ext/phalcon/mvc/dispatcherinterface.zep.h index b94830626e4..123b8bba688 100644 --- a/ext/phalcon/mvc/dispatcherinterface.zep.h +++ b/ext/phalcon/mvc/dispatcherinterface.zep.h @@ -4,23 +4,56 @@ extern zend_class_entry *phalcon_mvc_dispatcherinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_DispatcherInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_dispatcherinterface_setcontrollersuffix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerSuffix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerSuffix) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_dispatcherinterface_setdefaultcontroller, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_dispatcherinterface_setcontrollername, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcherinterface_getcontrollername, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcherinterface_getcontrollername, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_dispatcherinterface_getlastcontroller, 0, 0, Phalcon\\Mvc\\ControllerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcherinterface_getlastcontroller, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ControllerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_dispatcherinterface_getactivecontroller, 0, 0, Phalcon\\Mvc\\ControllerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_dispatcherinterface_getactivecontroller, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ControllerInterface", 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_dispatcherinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_DispatcherInterface, setControllerSuffix, arginfo_phalcon_mvc_dispatcherinterface_setcontrollersuffix) PHP_ABSTRACT_ME(Phalcon_Mvc_DispatcherInterface, setDefaultController, arginfo_phalcon_mvc_dispatcherinterface_setdefaultcontroller) PHP_ABSTRACT_ME(Phalcon_Mvc_DispatcherInterface, setControllerName, arginfo_phalcon_mvc_dispatcherinterface_setcontrollername) - PHP_ABSTRACT_ME(Phalcon_Mvc_DispatcherInterface, getControllerName, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_DispatcherInterface, getLastController, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_DispatcherInterface, getActiveController, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_DispatcherInterface, getControllerName, arginfo_phalcon_mvc_dispatcherinterface_getcontrollername) + PHP_ABSTRACT_ME(Phalcon_Mvc_DispatcherInterface, getLastController, arginfo_phalcon_mvc_dispatcherinterface_getlastcontroller) + PHP_ABSTRACT_ME(Phalcon_Mvc_DispatcherInterface, getActiveController, arginfo_phalcon_mvc_dispatcherinterface_getactivecontroller) PHP_FE_END }; diff --git a/ext/phalcon/mvc/entityinterface.zep.h b/ext/phalcon/mvc/entityinterface.zep.h index 7c68baf1577..713b1f5f4ef 100644 --- a/ext/phalcon/mvc/entityinterface.zep.h +++ b/ext/phalcon/mvc/entityinterface.zep.h @@ -4,11 +4,19 @@ extern zend_class_entry *phalcon_mvc_entityinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_EntityInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_entityinterface_readattribute, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_entityinterface_writeattribute, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/micro.zep.c b/ext/phalcon/mvc/micro.zep.c index 4ad4c710eae..6436f55b0cd 100644 --- a/ext/phalcon/mvc/micro.zep.c +++ b/ext/phalcon/mvc/micro.zep.c @@ -86,13 +86,18 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Micro) { PHP_METHOD(Phalcon_Mvc_Micro, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *dependencyInjector = NULL; + zval *dependencyInjector = NULL, dependencyInjector_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &dependencyInjector); if (!dependencyInjector) { - dependencyInjector = ZEPHIR_GLOBAL(global_null); + dependencyInjector = &dependencyInjector_sub; + dependencyInjector = &__$null; } @@ -112,26 +117,30 @@ PHP_METHOD(Phalcon_Mvc_Micro, __construct) { PHP_METHOD(Phalcon_Mvc_Micro, setDI) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *dependencyInjector, *_0 = NULL, *_1, *_2$$3; + zval *dependencyInjector, dependencyInjector_sub, _0, _1, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &dependencyInjector); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "application", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0, dependencyInjector, "has", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "application"); + ZEPHIR_CALL_METHOD(&_0, dependencyInjector, "has", NULL, 0, &_1); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "application", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "set", NULL, 0, _2$$3, this_ptr); - zephir_check_temp_parameter(_2$$3); + if (!(zephir_is_true(&_0))) { + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "application"); + ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "set", NULL, 0, &_2$$3, this_ptr); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); ZEPHIR_MM_RESTORE(); } @@ -146,32 +155,39 @@ PHP_METHOD(Phalcon_Mvc_Micro, setDI) { PHP_METHOD(Phalcon_Mvc_Micro, map) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *router = NULL, *route = NULL, *_0 = NULL; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &routePattern_param, &handler); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&route, router, "add", NULL, 0, routePattern); + ZEPHIR_CALL_METHOD(&route, &router, "add", NULL, 0, &routePattern); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, route, "getrouteid", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_handlers"), _0, handler TSRMLS_CC); - RETURN_CCTOR(route); + zephir_update_property_array(this_ptr, SL("_handlers"), &_0, handler TSRMLS_CC); + RETURN_CCTOR(&route); } @@ -185,32 +201,39 @@ PHP_METHOD(Phalcon_Mvc_Micro, map) { PHP_METHOD(Phalcon_Mvc_Micro, get) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *router = NULL, *route = NULL, *_0 = NULL; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &routePattern_param, &handler); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&route, router, "addget", NULL, 0, routePattern); + ZEPHIR_CALL_METHOD(&route, &router, "addget", NULL, 0, &routePattern); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, route, "getrouteid", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_handlers"), _0, handler TSRMLS_CC); - RETURN_CCTOR(route); + zephir_update_property_array(this_ptr, SL("_handlers"), &_0, handler TSRMLS_CC); + RETURN_CCTOR(&route); } @@ -224,32 +247,39 @@ PHP_METHOD(Phalcon_Mvc_Micro, get) { PHP_METHOD(Phalcon_Mvc_Micro, post) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *router = NULL, *route = NULL, *_0 = NULL; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &routePattern_param, &handler); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&route, router, "addpost", NULL, 0, routePattern); + ZEPHIR_CALL_METHOD(&route, &router, "addpost", NULL, 0, &routePattern); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, route, "getrouteid", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_handlers"), _0, handler TSRMLS_CC); - RETURN_CCTOR(route); + zephir_update_property_array(this_ptr, SL("_handlers"), &_0, handler TSRMLS_CC); + RETURN_CCTOR(&route); } @@ -263,32 +293,39 @@ PHP_METHOD(Phalcon_Mvc_Micro, post) { PHP_METHOD(Phalcon_Mvc_Micro, put) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *router = NULL, *route = NULL, *_0 = NULL; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &routePattern_param, &handler); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&route, router, "addput", NULL, 0, routePattern); + ZEPHIR_CALL_METHOD(&route, &router, "addput", NULL, 0, &routePattern); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, route, "getrouteid", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_handlers"), _0, handler TSRMLS_CC); - RETURN_CCTOR(route); + zephir_update_property_array(this_ptr, SL("_handlers"), &_0, handler TSRMLS_CC); + RETURN_CCTOR(&route); } @@ -302,32 +339,39 @@ PHP_METHOD(Phalcon_Mvc_Micro, put) { PHP_METHOD(Phalcon_Mvc_Micro, patch) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *router = NULL, *route = NULL, *_0 = NULL; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &routePattern_param, &handler); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&route, router, "addpatch", NULL, 0, routePattern); + ZEPHIR_CALL_METHOD(&route, &router, "addpatch", NULL, 0, &routePattern); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, route, "getrouteid", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_handlers"), _0, handler TSRMLS_CC); - RETURN_CCTOR(route); + zephir_update_property_array(this_ptr, SL("_handlers"), &_0, handler TSRMLS_CC); + RETURN_CCTOR(&route); } @@ -341,32 +385,39 @@ PHP_METHOD(Phalcon_Mvc_Micro, patch) { PHP_METHOD(Phalcon_Mvc_Micro, head) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *router = NULL, *route = NULL, *_0 = NULL; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &routePattern_param, &handler); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&route, router, "addhead", NULL, 0, routePattern); + ZEPHIR_CALL_METHOD(&route, &router, "addhead", NULL, 0, &routePattern); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, route, "getrouteid", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_handlers"), _0, handler TSRMLS_CC); - RETURN_CCTOR(route); + zephir_update_property_array(this_ptr, SL("_handlers"), &_0, handler TSRMLS_CC); + RETURN_CCTOR(&route); } @@ -380,32 +431,39 @@ PHP_METHOD(Phalcon_Mvc_Micro, head) { PHP_METHOD(Phalcon_Mvc_Micro, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *router = NULL, *route = NULL, *_0 = NULL; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &routePattern_param, &handler); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&route, router, "adddelete", NULL, 0, routePattern); + ZEPHIR_CALL_METHOD(&route, &router, "adddelete", NULL, 0, &routePattern); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, route, "getrouteid", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_handlers"), _0, handler TSRMLS_CC); - RETURN_CCTOR(route); + zephir_update_property_array(this_ptr, SL("_handlers"), &_0, handler TSRMLS_CC); + RETURN_CCTOR(&route); } @@ -419,32 +477,39 @@ PHP_METHOD(Phalcon_Mvc_Micro, delete) { PHP_METHOD(Phalcon_Mvc_Micro, options) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *router = NULL, *route = NULL, *_0 = NULL; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, router, route, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &routePattern_param, &handler); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } ZEPHIR_CALL_METHOD(&router, this_ptr, "getrouter", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&route, router, "addoptions", NULL, 0, routePattern); + ZEPHIR_CALL_METHOD(&route, &router, "addoptions", NULL, 0, &routePattern); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, route, "getrouteid", NULL, 0); + ZEPHIR_CALL_METHOD(&_0, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_handlers"), _0, handler TSRMLS_CC); - RETURN_CCTOR(route); + zephir_update_property_array(this_ptr, SL("_handlers"), &_0, handler TSRMLS_CC); + RETURN_CCTOR(&route); } @@ -453,12 +518,26 @@ PHP_METHOD(Phalcon_Mvc_Micro, options) { */ PHP_METHOD(Phalcon_Mvc_Micro, mount) { - zend_bool _5$$8, _6$$8; - HashTable *_2$$5; - HashPosition _1$$5; - zephir_fcall_cache_entry *_4 = NULL; + zend_bool _3$$8, _4$$8; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collection, *mainHandler = NULL, *handlers = NULL, *lazyHandler = NULL, *prefix = NULL, *methods = NULL, *pattern = NULL, *subHandler = NULL, *realHandler = NULL, *prefixedPattern = NULL, *route = NULL, *handler = NULL, *name = NULL, *_0$$5 = NULL, **_3$$5; + zval *collection, collection_sub, mainHandler, handlers, lazyHandler, prefix, methods, pattern, subHandler, realHandler, prefixedPattern, route, handler, name, _0$$5, *_1$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collection_sub); + ZVAL_UNDEF(&mainHandler); + ZVAL_UNDEF(&handlers); + ZVAL_UNDEF(&lazyHandler); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&methods); + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&subHandler); + ZVAL_UNDEF(&realHandler); + ZVAL_UNDEF(&prefixedPattern); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_0$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &collection); @@ -467,80 +546,80 @@ PHP_METHOD(Phalcon_Mvc_Micro, mount) { ZEPHIR_CALL_METHOD(&mainHandler, collection, "gethandler", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(mainHandler)) { + if (ZEPHIR_IS_EMPTY(&mainHandler)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "Collection requires a main handler", "phalcon/mvc/micro.zep", 378); return; } ZEPHIR_CALL_METHOD(&handlers, collection, "gethandlers", NULL, 0); zephir_check_call_status(); - if (!(zephir_fast_count_int(handlers TSRMLS_CC))) { + if (!(zephir_fast_count_int(&handlers TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "There are no handlers to mount", "phalcon/mvc/micro.zep", 383); return; } - if (Z_TYPE_P(handlers) == IS_ARRAY) { + if (Z_TYPE_P(&handlers) == IS_ARRAY) { ZEPHIR_CALL_METHOD(&_0$$5, collection, "islazy", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_0$$5)) { - ZEPHIR_INIT_VAR(lazyHandler); - object_init_ex(lazyHandler, phalcon_mvc_micro_lazyloader_ce); - ZEPHIR_CALL_METHOD(NULL, lazyHandler, "__construct", NULL, 325, mainHandler); + if (zephir_is_true(&_0$$5)) { + ZEPHIR_INIT_VAR(&lazyHandler); + object_init_ex(&lazyHandler, phalcon_mvc_micro_lazyloader_ce); + ZEPHIR_CALL_METHOD(NULL, &lazyHandler, "__construct", NULL, 284, &mainHandler); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(lazyHandler, mainHandler); + ZEPHIR_CPY_WRT(&lazyHandler, &mainHandler); } ZEPHIR_CALL_METHOD(&prefix, collection, "getprefix", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(handlers, &_2$$5, &_1$$5, 0, 0, "phalcon/mvc/micro.zep", 441); - for ( - ; zend_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS - ; zend_hash_move_forward_ex(_2$$5, &_1$$5) - ) { - ZEPHIR_GET_HVALUE(handler, _3$$5); - if (Z_TYPE_P(handler) != IS_ARRAY) { + zephir_is_iterable(&handlers, 0, "phalcon/mvc/micro.zep", 441); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&handlers), _1$$5) + { + ZEPHIR_INIT_NVAR(&handler); + ZVAL_COPY(&handler, _1$$5); + if (Z_TYPE_P(&handler) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "One of the registered handlers is invalid", "phalcon/mvc/micro.zep", 405); return; } - ZEPHIR_OBS_NVAR(methods); - zephir_array_fetch_long(&methods, handler, 0, PH_NOISY, "phalcon/mvc/micro.zep", 408 TSRMLS_CC); - ZEPHIR_OBS_NVAR(pattern); - zephir_array_fetch_long(&pattern, handler, 1, PH_NOISY, "phalcon/mvc/micro.zep", 409 TSRMLS_CC); - ZEPHIR_OBS_NVAR(subHandler); - zephir_array_fetch_long(&subHandler, handler, 2, PH_NOISY, "phalcon/mvc/micro.zep", 410 TSRMLS_CC); - ZEPHIR_OBS_NVAR(name); - zephir_array_fetch_long(&name, handler, 3, PH_NOISY, "phalcon/mvc/micro.zep", 411 TSRMLS_CC); - ZEPHIR_INIT_NVAR(realHandler); - zephir_create_array(realHandler, 2, 0 TSRMLS_CC); - zephir_array_fast_append(realHandler, lazyHandler); - zephir_array_fast_append(realHandler, subHandler); - if (!(ZEPHIR_IS_EMPTY(prefix))) { - if (ZEPHIR_IS_STRING(pattern, "/")) { - ZEPHIR_CPY_WRT(prefixedPattern, prefix); + ZEPHIR_OBS_NVAR(&methods); + zephir_array_fetch_long(&methods, &handler, 0, PH_NOISY, "phalcon/mvc/micro.zep", 408 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&pattern); + zephir_array_fetch_long(&pattern, &handler, 1, PH_NOISY, "phalcon/mvc/micro.zep", 409 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&subHandler); + zephir_array_fetch_long(&subHandler, &handler, 2, PH_NOISY, "phalcon/mvc/micro.zep", 410 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&name); + zephir_array_fetch_long(&name, &handler, 3, PH_NOISY, "phalcon/mvc/micro.zep", 411 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&realHandler); + zephir_create_array(&realHandler, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&realHandler, &lazyHandler); + zephir_array_fast_append(&realHandler, &subHandler); + if (!(ZEPHIR_IS_EMPTY(&prefix))) { + if (ZEPHIR_IS_STRING(&pattern, "/")) { + ZEPHIR_CPY_WRT(&prefixedPattern, &prefix); } else { - ZEPHIR_INIT_NVAR(prefixedPattern); - ZEPHIR_CONCAT_VV(prefixedPattern, prefix, pattern); + ZEPHIR_INIT_NVAR(&prefixedPattern); + ZEPHIR_CONCAT_VV(&prefixedPattern, &prefix, &pattern); } } else { - ZEPHIR_CPY_WRT(prefixedPattern, pattern); + ZEPHIR_CPY_WRT(&prefixedPattern, &pattern); } - ZEPHIR_CALL_METHOD(&route, this_ptr, "map", &_4, 0, prefixedPattern, realHandler); + ZEPHIR_CALL_METHOD(&route, this_ptr, "map", &_2, 0, &prefixedPattern, &realHandler); zephir_check_call_status(); - _5$$8 = Z_TYPE_P(methods) == IS_STRING; - if (_5$$8) { - _5$$8 = !ZEPHIR_IS_STRING(methods, ""); + _3$$8 = Z_TYPE_P(&methods) == IS_STRING; + if (_3$$8) { + _3$$8 = !ZEPHIR_IS_STRING(&methods, ""); } - _6$$8 = _5$$8; - if (!(_6$$8)) { - _6$$8 = Z_TYPE_P(methods) == IS_ARRAY; + _4$$8 = _3$$8; + if (!(_4$$8)) { + _4$$8 = Z_TYPE_P(&methods) == IS_ARRAY; } - if (_6$$8) { - ZEPHIR_CALL_METHOD(NULL, route, "via", NULL, 0, methods); + if (_4$$8) { + ZEPHIR_CALL_METHOD(NULL, &route, "via", NULL, 0, &methods); zephir_check_call_status(); } - if (Z_TYPE_P(name) == IS_STRING) { - ZEPHIR_CALL_METHOD(NULL, route, "setname", NULL, 0, name); + if (Z_TYPE_P(&name) == IS_STRING) { + ZEPHIR_CALL_METHOD(NULL, &route, "setname", NULL, 0, &name); zephir_check_call_status(); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&handler); } RETURN_THIS(); @@ -554,13 +633,16 @@ PHP_METHOD(Phalcon_Mvc_Micro, mount) { */ PHP_METHOD(Phalcon_Mvc_Micro, notFound) { - zval *handler; + zval *handler, handler_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); zephir_fetch_params(0, 1, 0, &handler); - zephir_update_property_this(getThis(), SL("_notFoundHandler"), handler TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_notFoundHandler"), handler); RETURN_THISW(); } @@ -573,13 +655,16 @@ PHP_METHOD(Phalcon_Mvc_Micro, notFound) { */ PHP_METHOD(Phalcon_Mvc_Micro, error) { - zval *handler; + zval *handler, handler_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); zephir_fetch_params(0, 1, 0, &handler); - zephir_update_property_this(getThis(), SL("_errorHandler"), handler TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_errorHandler"), handler); RETURN_THISW(); } @@ -589,28 +674,31 @@ PHP_METHOD(Phalcon_Mvc_Micro, error) { */ PHP_METHOD(Phalcon_Mvc_Micro, getRouter) { - zval *router = NULL, *_0$$3 = NULL; + zval router, _0$$3, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(router); - zephir_read_property_this(&router, this_ptr, SL("_router"), PH_NOISY_CC); - if (Z_TYPE_P(router) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_STRING(_0$$3, "router", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&router, this_ptr, "getsharedservice", NULL, 0, _0$$3); - zephir_check_temp_parameter(_0$$3); + ZEPHIR_OBS_VAR(&router); + zephir_read_property(&router, this_ptr, SL("_router"), PH_NOISY_CC); + if (Z_TYPE_P(&router) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "router"); + ZEPHIR_CALL_METHOD(&router, this_ptr, "getsharedservice", NULL, 0, &_0$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, router, "clear", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &router, "clear", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0$$3); - ZVAL_BOOL(_0$$3, 1); - ZEPHIR_CALL_METHOD(NULL, router, "removeextraslashes", NULL, 0, _0$$3); + ZVAL_BOOL(&_1$$3, 1); + ZEPHIR_CALL_METHOD(NULL, &router, "removeextraslashes", NULL, 0, &_1$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_router"), router TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_router"), &router); } - RETURN_CCTOR(router); + RETURN_CCTOR(&router); } @@ -626,21 +714,27 @@ PHP_METHOD(Phalcon_Mvc_Micro, setService) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool shared; - zval *serviceName_param = NULL, *definition, *shared_param = NULL, *dependencyInjector = NULL, *_0; - zval *serviceName = NULL; + zval *serviceName_param = NULL, *definition, definition_sub, *shared_param = NULL, dependencyInjector, _0; + zval serviceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&serviceName); + ZVAL_UNDEF(&definition_sub); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &serviceName_param, &definition, &shared_param); if (UNEXPECTED(Z_TYPE_P(serviceName_param) != IS_STRING && Z_TYPE_P(serviceName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(serviceName_param) == IS_STRING)) { - zephir_get_strval(serviceName, serviceName_param); + zephir_get_strval(&serviceName, serviceName_param); } else { - ZEPHIR_INIT_VAR(serviceName); - ZVAL_EMPTY_STRING(serviceName); + ZEPHIR_INIT_VAR(&serviceName); + ZVAL_EMPTY_STRING(&serviceName); } if (!shared_param) { shared = 0; @@ -649,22 +743,21 @@ PHP_METHOD(Phalcon_Mvc_Micro, setService) { } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_INIT_NVAR(dependencyInjector); - object_init_ex(dependencyInjector, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "__construct", NULL, 197); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_NVAR(&dependencyInjector); + object_init_ex(&dependencyInjector, phalcon_di_factorydefault_ce); + ZEPHIR_CALL_METHOD(NULL, &dependencyInjector, "__construct", NULL, 285); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), &dependencyInjector); } - ZEPHIR_INIT_VAR(_0); if (shared) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "set", NULL, 326, serviceName, definition, _0); + ZEPHIR_RETURN_CALL_METHOD(&dependencyInjector, "set", NULL, 286, &serviceName, definition, &_0); zephir_check_call_status(); RETURN_MM(); @@ -676,34 +769,38 @@ PHP_METHOD(Phalcon_Mvc_Micro, setService) { PHP_METHOD(Phalcon_Mvc_Micro, hasService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *serviceName_param = NULL, *dependencyInjector = NULL; - zval *serviceName = NULL; + zval *serviceName_param = NULL, dependencyInjector; + zval serviceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&serviceName); + ZVAL_UNDEF(&dependencyInjector); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &serviceName_param); if (UNEXPECTED(Z_TYPE_P(serviceName_param) != IS_STRING && Z_TYPE_P(serviceName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(serviceName_param) == IS_STRING)) { - zephir_get_strval(serviceName, serviceName_param); + zephir_get_strval(&serviceName, serviceName_param); } else { - ZEPHIR_INIT_VAR(serviceName); - ZVAL_EMPTY_STRING(serviceName); + ZEPHIR_INIT_VAR(&serviceName); + ZVAL_EMPTY_STRING(&serviceName); } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_INIT_NVAR(dependencyInjector); - object_init_ex(dependencyInjector, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "__construct", NULL, 197); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_NVAR(&dependencyInjector); + object_init_ex(&dependencyInjector, phalcon_di_factorydefault_ce); + ZEPHIR_CALL_METHOD(NULL, &dependencyInjector, "__construct", NULL, 285); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), &dependencyInjector); } - ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "has", NULL, 327, serviceName); + ZEPHIR_RETURN_CALL_METHOD(&dependencyInjector, "has", NULL, 287, &serviceName); zephir_check_call_status(); RETURN_MM(); @@ -718,34 +815,38 @@ PHP_METHOD(Phalcon_Mvc_Micro, hasService) { PHP_METHOD(Phalcon_Mvc_Micro, getService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *serviceName_param = NULL, *dependencyInjector = NULL; - zval *serviceName = NULL; + zval *serviceName_param = NULL, dependencyInjector; + zval serviceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&serviceName); + ZVAL_UNDEF(&dependencyInjector); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &serviceName_param); if (UNEXPECTED(Z_TYPE_P(serviceName_param) != IS_STRING && Z_TYPE_P(serviceName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'serviceName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(serviceName_param) == IS_STRING)) { - zephir_get_strval(serviceName, serviceName_param); + zephir_get_strval(&serviceName, serviceName_param); } else { - ZEPHIR_INIT_VAR(serviceName); - ZVAL_EMPTY_STRING(serviceName); + ZEPHIR_INIT_VAR(&serviceName); + ZVAL_EMPTY_STRING(&serviceName); } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_INIT_NVAR(dependencyInjector); - object_init_ex(dependencyInjector, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "__construct", NULL, 197); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_NVAR(&dependencyInjector); + object_init_ex(&dependencyInjector, phalcon_di_factorydefault_ce); + ZEPHIR_CALL_METHOD(NULL, &dependencyInjector, "__construct", NULL, 285); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), &dependencyInjector); } - ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "get", NULL, 328, serviceName); + ZEPHIR_RETURN_CALL_METHOD(&dependencyInjector, "get", NULL, 288, &serviceName); zephir_check_call_status(); RETURN_MM(); @@ -760,23 +861,27 @@ PHP_METHOD(Phalcon_Mvc_Micro, getService) { PHP_METHOD(Phalcon_Mvc_Micro, getSharedService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *serviceName, *dependencyInjector = NULL; + zval *serviceName, serviceName_sub, dependencyInjector; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&serviceName_sub); + ZVAL_UNDEF(&dependencyInjector); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &serviceName); - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_INIT_NVAR(dependencyInjector); - object_init_ex(dependencyInjector, phalcon_di_factorydefault_ce); - ZEPHIR_CALL_METHOD(NULL, dependencyInjector, "__construct", NULL, 197); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_NVAR(&dependencyInjector); + object_init_ex(&dependencyInjector, phalcon_di_factorydefault_ce); + ZEPHIR_CALL_METHOD(NULL, &dependencyInjector, "__construct", NULL, 285); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), &dependencyInjector); } - ZEPHIR_RETURN_CALL_METHOD(dependencyInjector, "getshared", NULL, 329, serviceName); + ZEPHIR_RETURN_CALL_METHOD(&dependencyInjector, "getshared", NULL, 289, serviceName); zephir_check_call_status(); RETURN_MM(); @@ -790,490 +895,554 @@ PHP_METHOD(Phalcon_Mvc_Micro, getSharedService) { */ PHP_METHOD(Phalcon_Mvc_Micro, handle) { - zval *_60$$60; - zend_class_entry *_20$$20; - HashTable *_11$$12, *_30$$30, *_40$$38, *_52$$50; - HashPosition _10$$12, _29$$30, _39$$38, _51$$50; - zend_bool _18$$7, _26$$7, _23$$24, _32$$31; + zval _52$$60; + zend_class_entry *_18$$20; + zend_bool _16$$7, _24$$7, _21$$24, _28$$31; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri = NULL, *dependencyInjector = NULL, *eventsManager = NULL, *status = NULL, *router = NULL, *matchedRoute = NULL, *handler = NULL, *beforeHandlers = NULL, *params = NULL, *returnedValue = NULL, *e = NULL, *errorHandler = NULL, *afterHandlers = NULL, *notFoundHandler = NULL, *finishHandlers = NULL, *finish = NULL, *before = NULL, *after = NULL, *response = NULL, *modelBinder = NULL, *bindCacheKey = NULL, *routeName = NULL, *realHandler = NULL, *methodName = NULL, *lazyReturned = NULL, *afterBindingHandlers = NULL, *afterBinding = NULL, *_58, *_0$$5 = NULL, *_1$$5, *_2$$4 = NULL, *_3$$4, *_4$$7, *_5$$7 = NULL, *_6$$8, *_7$$8, *_8$$9 = NULL, *_9$$9, **_12$$12, *_17$$12, *_13$$15, *_14$$17 = NULL, *_15$$17 = NULL, *_16$$13, *_19$$20 = NULL, *_21$$23 = NULL, *_22$$21 = NULL, *_24$$25, *_25$$25 = NULL, *_27$$28 = NULL, *_28$$28, **_31$$30, *_37$$30, *_36$$31, *_33$$32, *_34$$34 = NULL, *_35$$34 = NULL, *_38$$37, **_41$$38, *_42$$41, *_43$$43 = NULL, *_44$$43 = NULL, *_45$$39, *_46$$46 = NULL, *_47$$46, *_48$$48, *_49$$48, *_50$$49, **_53$$50, *_54$$53, *_55$$55 = NULL, *_56$$55 = NULL, *_57$$51, *_59$$59, *_61$$68 = NULL, *_62$$68, *_63$$71 = NULL; + zval *uri = NULL, uri_sub, __$true, __$false, __$null, dependencyInjector, eventsManager, status, router, matchedRoute, handler, beforeHandlers, params, returnedValue, e, errorHandler, afterHandlers, notFoundHandler, finishHandlers, finish, before, after, response, modelBinder, bindCacheKey, routeName, realHandler, methodName, lazyReturned, afterBindingHandlers, afterBinding, _50, _0$$5, _1$$5, _2$$4, _3$$4, _4$$7, _5$$7, _6$$8, _7$$8, _8$$9, _9$$9, *_10$$12, _15$$12, _11$$15, _12$$17, _13$$17, _14$$13, _17$$20, _19$$23, _20$$21, _22$$25, _23$$25, _25$$28, _26$$28, *_27$$30, _33$$30, _32$$31, _29$$32, _30$$34, _31$$34, _34$$37, *_35$$38, _36$$41, _37$$43, _38$$43, _39$$39, _40$$46, _41$$46, _42$$48, _43$$48, _44$$49, *_45$$50, _46$$53, _47$$55, _48$$55, _49$$51, _51$$59, _53$$68, _54$$68, _55$$71; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uri_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&matchedRoute); + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&beforeHandlers); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&returnedValue); + ZVAL_UNDEF(&e); + ZVAL_UNDEF(&errorHandler); + ZVAL_UNDEF(&afterHandlers); + ZVAL_UNDEF(¬FoundHandler); + ZVAL_UNDEF(&finishHandlers); + ZVAL_UNDEF(&finish); + ZVAL_UNDEF(&before); + ZVAL_UNDEF(&after); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&modelBinder); + ZVAL_UNDEF(&bindCacheKey); + ZVAL_UNDEF(&routeName); + ZVAL_UNDEF(&realHandler); + ZVAL_UNDEF(&methodName); + ZVAL_UNDEF(&lazyReturned); + ZVAL_UNDEF(&afterBindingHandlers); + ZVAL_UNDEF(&afterBinding); + ZVAL_UNDEF(&_50); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_15$$12); + ZVAL_UNDEF(&_11$$15); + ZVAL_UNDEF(&_12$$17); + ZVAL_UNDEF(&_13$$17); + ZVAL_UNDEF(&_14$$13); + ZVAL_UNDEF(&_17$$20); + ZVAL_UNDEF(&_19$$23); + ZVAL_UNDEF(&_20$$21); + ZVAL_UNDEF(&_22$$25); + ZVAL_UNDEF(&_23$$25); + ZVAL_UNDEF(&_25$$28); + ZVAL_UNDEF(&_26$$28); + ZVAL_UNDEF(&_33$$30); + ZVAL_UNDEF(&_32$$31); + ZVAL_UNDEF(&_29$$32); + ZVAL_UNDEF(&_30$$34); + ZVAL_UNDEF(&_31$$34); + ZVAL_UNDEF(&_34$$37); + ZVAL_UNDEF(&_36$$41); + ZVAL_UNDEF(&_37$$43); + ZVAL_UNDEF(&_38$$43); + ZVAL_UNDEF(&_39$$39); + ZVAL_UNDEF(&_40$$46); + ZVAL_UNDEF(&_41$$46); + ZVAL_UNDEF(&_42$$48); + ZVAL_UNDEF(&_43$$48); + ZVAL_UNDEF(&_44$$49); + ZVAL_UNDEF(&_46$$53); + ZVAL_UNDEF(&_47$$55); + ZVAL_UNDEF(&_48$$55); + ZVAL_UNDEF(&_49$$51); + ZVAL_UNDEF(&_51$$59); + ZVAL_UNDEF(&_53$$68); + ZVAL_UNDEF(&_54$$68); + ZVAL_UNDEF(&_55$$71); + ZVAL_UNDEF(&_52$$60); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &uri); if (!uri) { - uri = ZEPHIR_GLOBAL(global_null); + uri = &uri_sub; + uri = &__$null; } - ZEPHIR_INIT_VAR(status); - ZVAL_NULL(status); - ZEPHIR_INIT_VAR(realHandler); - ZVAL_NULL(realHandler); - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&status); + ZVAL_NULL(&status); + ZEPHIR_INIT_VAR(&realHandler); + ZVAL_NULL(&realHandler); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "A dependency injection container is required to access required micro services", "phalcon/mvc/micro.zep", 592); return; } /* try_start_1: */ - ZEPHIR_INIT_VAR(returnedValue); - ZVAL_NULL(returnedValue); - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_STRING(_1$$5, "micro:beforeHandleRoute", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0$$5, eventsManager, "fire", NULL, 0, _1$$5, this_ptr); - zephir_check_temp_parameter(_1$$5); + ZEPHIR_INIT_VAR(&returnedValue); + ZVAL_NULL(&returnedValue); + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_STRING(&_1$$5, "micro:beforeHandleRoute"); + ZEPHIR_CALL_METHOD(&_0$$5, &eventsManager, "fire", NULL, 0, &_1$$5, this_ptr); zephir_check_call_status_or_jump(try_end_1); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$5)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0$$5)) { RETURN_MM_BOOL(0); } } - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_STRING(_3$$4, "router", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2$$4, dependencyInjector, "getshared", NULL, 0, _3$$4); - zephir_check_temp_parameter(_3$$4); + ZEPHIR_INIT_VAR(&_3$$4); + ZVAL_STRING(&_3$$4, "router"); + ZEPHIR_CALL_METHOD(&_2$$4, &dependencyInjector, "getshared", NULL, 0, &_3$$4); zephir_check_call_status_or_jump(try_end_1); - ZEPHIR_CPY_WRT(router, _2$$4); - ZEPHIR_CALL_METHOD(NULL, router, "handle", NULL, 0, uri); + ZEPHIR_CPY_WRT(&router, &_2$$4); + ZEPHIR_CALL_METHOD(NULL, &router, "handle", NULL, 0, uri); zephir_check_call_status_or_jump(try_end_1); - ZEPHIR_CALL_METHOD(&matchedRoute, router, "getmatchedroute", NULL, 0); + ZEPHIR_CALL_METHOD(&matchedRoute, &router, "getmatchedroute", NULL, 0); zephir_check_call_status_or_jump(try_end_1); - if (Z_TYPE_P(matchedRoute) == IS_OBJECT) { - ZEPHIR_OBS_VAR(handler); - _4$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_handlers"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_5$$7, matchedRoute, "getrouteid", NULL, 0); + if (Z_TYPE_P(&matchedRoute) == IS_OBJECT) { + ZEPHIR_OBS_VAR(&handler); + zephir_read_property(&_4$$7, this_ptr, SL("_handlers"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_5$$7, &matchedRoute, "getrouteid", NULL, 0); zephir_check_call_status_or_jump(try_end_1); - if (!(zephir_array_isset_fetch(&handler, _4$$7, _5$$7, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_6$$8); - object_init_ex(_6$$8, phalcon_mvc_micro_exception_ce); - ZEPHIR_INIT_VAR(_7$$8); - ZVAL_STRING(_7$$8, "Matched route doesn't have an associated handler", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _6$$8, "__construct", NULL, 9, _7$$8); - zephir_check_temp_parameter(_7$$8); + if (!(zephir_array_isset_fetch(&handler, &_4$$7, &_5$$7, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_6$$8); + object_init_ex(&_6$$8, phalcon_mvc_micro_exception_ce); + ZEPHIR_INIT_VAR(&_7$$8); + ZVAL_STRING(&_7$$8, "Matched route doesn't have an associated handler"); + ZEPHIR_CALL_METHOD(NULL, &_6$$8, "__construct", NULL, 4, &_7$$8); zephir_check_call_status_or_jump(try_end_1); - zephir_throw_exception_debug(_6$$8, "phalcon/mvc/micro.zep", 626 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$8, "phalcon/mvc/micro.zep", 626 TSRMLS_CC); goto try_end_1; } - zephir_update_property_this(getThis(), SL("_activeHandler"), handler TSRMLS_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_9$$9); - ZVAL_STRING(_9$$9, "micro:beforeExecuteRoute", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_8$$9, eventsManager, "fire", NULL, 0, _9$$9, this_ptr); - zephir_check_temp_parameter(_9$$9); + zephir_update_property_zval(this_ptr, SL("_activeHandler"), &handler); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_9$$9); + ZVAL_STRING(&_9$$9, "micro:beforeExecuteRoute"); + ZEPHIR_CALL_METHOD(&_8$$9, &eventsManager, "fire", NULL, 0, &_9$$9, this_ptr); zephir_check_call_status_or_jump(try_end_1); - if (ZEPHIR_IS_FALSE_IDENTICAL(_8$$9)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_8$$9)) { RETURN_MM_BOOL(0); } else { - ZEPHIR_OBS_NVAR(handler); - zephir_read_property_this(&handler, this_ptr, SL("_activeHandler"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&handler); + zephir_read_property(&handler, this_ptr, SL("_activeHandler"), PH_NOISY_CC); } } - ZEPHIR_OBS_VAR(beforeHandlers); - zephir_read_property_this(&beforeHandlers, this_ptr, SL("_beforeHandlers"), PH_NOISY_CC); - if (Z_TYPE_P(beforeHandlers) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&beforeHandlers); + zephir_read_property(&beforeHandlers, this_ptr, SL("_beforeHandlers"), PH_NOISY_CC); + if (Z_TYPE_P(&beforeHandlers) == IS_ARRAY) { if (0) { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$false); } - zephir_is_iterable(beforeHandlers, &_11$$12, &_10$$12, 0, 0, "phalcon/mvc/micro.zep", 694); - for ( - ; zend_hash_get_current_data_ex(_11$$12, (void**) &_12$$12, &_10$$12) == SUCCESS - ; zend_hash_move_forward_ex(_11$$12, &_10$$12) - ) { - ZEPHIR_GET_HVALUE(before, _12$$12); - if (Z_TYPE_P(before) == IS_OBJECT) { - if (zephir_instance_of_ev(before, phalcon_mvc_micro_middlewareinterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&status, before, "call", NULL, 0, this_ptr); + zephir_is_iterable(&beforeHandlers, 0, "phalcon/mvc/micro.zep", 694); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&beforeHandlers), _10$$12) + { + ZEPHIR_INIT_NVAR(&before); + ZVAL_COPY(&before, _10$$12); + if (Z_TYPE_P(&before) == IS_OBJECT) { + if (zephir_instance_of_ev(&before, phalcon_mvc_micro_middlewareinterface_ce TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(&status, &before, "call", NULL, 0, this_ptr); zephir_check_call_status_or_jump(try_end_1); - _13$$15 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_13$$15)) { + zephir_read_property(&_11$$15, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_11$$15)) { break; } continue; } } - if (!(zephir_is_callable(before TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_14$$17); - object_init_ex(_14$$17, phalcon_mvc_micro_exception_ce); - ZEPHIR_INIT_NVAR(_15$$17); - ZVAL_STRING(_15$$17, "'before' handler is not callable", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _14$$17, "__construct", NULL, 9, _15$$17); - zephir_check_temp_parameter(_15$$17); + if (!(zephir_is_callable(&before TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_12$$17); + object_init_ex(&_12$$17, phalcon_mvc_micro_exception_ce); + ZEPHIR_INIT_NVAR(&_13$$17); + ZVAL_STRING(&_13$$17, "'before' handler is not callable"); + ZEPHIR_CALL_METHOD(NULL, &_12$$17, "__construct", NULL, 4, &_13$$17); zephir_check_call_status_or_jump(try_end_1); - zephir_throw_exception_debug(_14$$17, "phalcon/mvc/micro.zep", 676 TSRMLS_CC); + zephir_throw_exception_debug(&_12$$17, "phalcon/mvc/micro.zep", 676 TSRMLS_CC); goto try_end_1; } - ZEPHIR_INIT_NVAR(status); - ZEPHIR_CALL_USER_FUNC(status, before); + ZEPHIR_INIT_NVAR(&status); + ZEPHIR_CALL_USER_FUNC(&status, &before); zephir_check_call_status_or_jump(try_end_1); - _16$$13 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_16$$13)) { + zephir_read_property(&_14$$13, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_14$$13)) { break; } - } - _17$$12 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_17$$12)) { - RETURN_CCTOR(status); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&before); + zephir_read_property(&_15$$12, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_15$$12)) { + RETURN_CCTOR(&status); } } - ZEPHIR_CALL_METHOD(¶ms, router, "getparams", NULL, 0); + ZEPHIR_CALL_METHOD(¶ms, &router, "getparams", NULL, 0); zephir_check_call_status_or_jump(try_end_1); - ZEPHIR_OBS_VAR(modelBinder); - zephir_read_property_this(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); - _18$$7 = Z_TYPE_P(handler) == IS_OBJECT; - if (_18$$7) { - _18$$7 = zephir_instance_of_ev(handler, zend_ce_closure TSRMLS_CC); + ZEPHIR_OBS_VAR(&modelBinder); + zephir_read_property(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); + _16$$7 = Z_TYPE_P(&handler) == IS_OBJECT; + if (_16$$7) { + _16$$7 = zephir_instance_of_ev(&handler, zend_ce_closure TSRMLS_CC); } - if (_18$$7) { - _20$$20 = zend_fetch_class(SL("Closure"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - ZEPHIR_CALL_CE_STATIC(&_19$$20, _20$$20, "bind", NULL, 0, handler, this_ptr); + if (_16$$7) { + _18$$20 = zephir_fetch_class_str_ex(SL("Closure"), ZEND_FETCH_CLASS_AUTO); + ZEPHIR_CALL_CE_STATIC(&_17$$20, _18$$20, "bind", NULL, 0, &handler, this_ptr); zephir_check_call_status_or_jump(try_end_1); - ZEPHIR_CPY_WRT(handler, _19$$20); - if (Z_TYPE_P(modelBinder) != IS_NULL) { - ZEPHIR_CALL_METHOD(&routeName, matchedRoute, "getname", NULL, 0); + ZEPHIR_CPY_WRT(&handler, &_17$$20); + if (Z_TYPE_P(&modelBinder) != IS_NULL) { + ZEPHIR_CALL_METHOD(&routeName, &matchedRoute, "getname", NULL, 0); zephir_check_call_status_or_jump(try_end_1); - ZEPHIR_INIT_VAR(bindCacheKey); - if (Z_TYPE_P(routeName) != IS_NULL) { - ZEPHIR_CONCAT_SV(bindCacheKey, "_PHMB_", routeName); + ZEPHIR_INIT_VAR(&bindCacheKey); + if (Z_TYPE_P(&routeName) != IS_NULL) { + ZEPHIR_CONCAT_SV(&bindCacheKey, "_PHMB_", &routeName); } else { - ZEPHIR_CALL_METHOD(&_21$$23, matchedRoute, "getpattern", NULL, 0); + ZEPHIR_CALL_METHOD(&_19$$23, &matchedRoute, "getpattern", NULL, 0); zephir_check_call_status_or_jump(try_end_1); - ZEPHIR_CONCAT_SV(bindCacheKey, "_PHMB_", _21$$23); + ZEPHIR_CONCAT_SV(&bindCacheKey, "_PHMB_", &_19$$23); } - ZEPHIR_CALL_METHOD(&_22$$21, modelBinder, "bindtohandler", NULL, 0, handler, params, bindCacheKey); + ZEPHIR_CALL_METHOD(&_20$$21, &modelBinder, "bindtohandler", NULL, 0, &handler, ¶ms, &bindCacheKey); zephir_check_call_status_or_jump(try_end_1); - ZEPHIR_CPY_WRT(params, _22$$21); + ZEPHIR_CPY_WRT(¶ms, &_20$$21); } } - if (Z_TYPE_P(handler) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(realHandler); - zephir_array_fetch_long(&realHandler, handler, 0, PH_NOISY, "phalcon/mvc/micro.zep", 725 TSRMLS_CC); - _23$$24 = zephir_instance_of_ev(realHandler, phalcon_mvc_controller_ce TSRMLS_CC); - if (_23$$24) { - _23$$24 = Z_TYPE_P(modelBinder) != IS_NULL; + if (Z_TYPE_P(&handler) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&realHandler); + zephir_array_fetch_long(&realHandler, &handler, 0, PH_NOISY, "phalcon/mvc/micro.zep", 725 TSRMLS_CC); + _21$$24 = zephir_instance_of_ev(&realHandler, phalcon_mvc_controller_ce TSRMLS_CC); + if (_21$$24) { + _21$$24 = Z_TYPE_P(&modelBinder) != IS_NULL; } - if (_23$$24) { - ZEPHIR_OBS_VAR(methodName); - zephir_array_fetch_long(&methodName, handler, 1, PH_NOISY, "phalcon/mvc/micro.zep", 728 TSRMLS_CC); - ZEPHIR_INIT_VAR(_24$$25); - zephir_get_class(_24$$25, realHandler, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(bindCacheKey); - ZEPHIR_CONCAT_SVSV(bindCacheKey, "_PHMB_", _24$$25, "_", methodName); - ZEPHIR_CALL_METHOD(&_25$$25, modelBinder, "bindtohandler", NULL, 0, realHandler, params, bindCacheKey, methodName); + if (_21$$24) { + ZEPHIR_OBS_VAR(&methodName); + zephir_array_fetch_long(&methodName, &handler, 1, PH_NOISY, "phalcon/mvc/micro.zep", 728 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_22$$25); + zephir_get_class(&_22$$25, &realHandler, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&bindCacheKey); + ZEPHIR_CONCAT_SVSV(&bindCacheKey, "_PHMB_", &_22$$25, "_", &methodName); + ZEPHIR_CALL_METHOD(&_23$$25, &modelBinder, "bindtohandler", NULL, 0, &realHandler, ¶ms, &bindCacheKey, &methodName); zephir_check_call_status_or_jump(try_end_1); - ZEPHIR_CPY_WRT(params, _25$$25); + ZEPHIR_CPY_WRT(¶ms, &_23$$25); } } - _26$$7 = Z_TYPE_P(realHandler) != IS_NULL; - if (_26$$7) { - _26$$7 = zephir_instance_of_ev(realHandler, phalcon_mvc_micro_lazyloader_ce TSRMLS_CC); + _24$$7 = Z_TYPE_P(&realHandler) != IS_NULL; + if (_24$$7) { + _24$$7 = zephir_instance_of_ev(&realHandler, phalcon_mvc_micro_lazyloader_ce TSRMLS_CC); } - if (_26$$7) { - ZEPHIR_OBS_NVAR(methodName); - zephir_array_fetch_long(&methodName, handler, 1, PH_NOISY, "phalcon/mvc/micro.zep", 738 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&lazyReturned, realHandler, "callmethod", NULL, 0, methodName, params, modelBinder); + if (_24$$7) { + ZEPHIR_OBS_NVAR(&methodName); + zephir_array_fetch_long(&methodName, &handler, 1, PH_NOISY, "phalcon/mvc/micro.zep", 738 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&lazyReturned, &realHandler, "callmethod", NULL, 0, &methodName, ¶ms, &modelBinder); zephir_check_call_status_or_jump(try_end_1); - ZEPHIR_CPY_WRT(returnedValue, lazyReturned); + ZEPHIR_CPY_WRT(&returnedValue, &lazyReturned); } else { - ZEPHIR_INIT_NVAR(returnedValue); - ZEPHIR_CALL_USER_FUNC_ARRAY(returnedValue, handler, params); + ZEPHIR_INIT_NVAR(&returnedValue); + ZEPHIR_CALL_USER_FUNC_ARRAY(&returnedValue, &handler, ¶ms); zephir_check_call_status_or_jump(try_end_1); } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_28$$28); - ZVAL_STRING(_28$$28, "micro:afterBinding", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_27$$28, eventsManager, "fire", NULL, 0, _28$$28, this_ptr); - zephir_check_temp_parameter(_28$$28); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_26$$28); + ZVAL_STRING(&_26$$28, "micro:afterBinding"); + ZEPHIR_CALL_METHOD(&_25$$28, &eventsManager, "fire", NULL, 0, &_26$$28, this_ptr); zephir_check_call_status_or_jump(try_end_1); - if (ZEPHIR_IS_FALSE_IDENTICAL(_27$$28)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_25$$28)) { RETURN_MM_BOOL(0); } } - ZEPHIR_OBS_VAR(afterBindingHandlers); - zephir_read_property_this(&afterBindingHandlers, this_ptr, SL("_afterBindingHandlers"), PH_NOISY_CC); - if (Z_TYPE_P(afterBindingHandlers) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&afterBindingHandlers); + zephir_read_property(&afterBindingHandlers, this_ptr, SL("_afterBindingHandlers"), PH_NOISY_CC); + if (Z_TYPE_P(&afterBindingHandlers) == IS_ARRAY) { if (0) { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$false); } - zephir_is_iterable(afterBindingHandlers, &_30$$30, &_29$$30, 0, 0, "phalcon/mvc/micro.zep", 803); - for ( - ; zend_hash_get_current_data_ex(_30$$30, (void**) &_31$$30, &_29$$30) == SUCCESS - ; zend_hash_move_forward_ex(_30$$30, &_29$$30) - ) { - ZEPHIR_GET_HVALUE(afterBinding, _31$$30); - _32$$31 = Z_TYPE_P(afterBinding) == IS_OBJECT; - if (_32$$31) { - _32$$31 = zephir_instance_of_ev(afterBinding, phalcon_mvc_micro_middlewareinterface_ce TSRMLS_CC); + zephir_is_iterable(&afterBindingHandlers, 0, "phalcon/mvc/micro.zep", 803); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&afterBindingHandlers), _27$$30) + { + ZEPHIR_INIT_NVAR(&afterBinding); + ZVAL_COPY(&afterBinding, _27$$30); + _28$$31 = Z_TYPE_P(&afterBinding) == IS_OBJECT; + if (_28$$31) { + _28$$31 = zephir_instance_of_ev(&afterBinding, phalcon_mvc_micro_middlewareinterface_ce TSRMLS_CC); } - if (_32$$31) { - ZEPHIR_CALL_METHOD(&status, afterBinding, "call", NULL, 0, this_ptr); + if (_28$$31) { + ZEPHIR_CALL_METHOD(&status, &afterBinding, "call", NULL, 0, this_ptr); zephir_check_call_status_or_jump(try_end_1); - _33$$32 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_33$$32)) { + zephir_read_property(&_29$$32, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_29$$32)) { break; } continue; } - if (!(zephir_is_callable(afterBinding TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_34$$34); - object_init_ex(_34$$34, phalcon_mvc_micro_exception_ce); - ZEPHIR_INIT_NVAR(_35$$34); - ZVAL_STRING(_35$$34, "'afterBinding' handler is not callable", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _34$$34, "__construct", NULL, 9, _35$$34); - zephir_check_temp_parameter(_35$$34); + if (!(zephir_is_callable(&afterBinding TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_30$$34); + object_init_ex(&_30$$34, phalcon_mvc_micro_exception_ce); + ZEPHIR_INIT_NVAR(&_31$$34); + ZVAL_STRING(&_31$$34, "'afterBinding' handler is not callable"); + ZEPHIR_CALL_METHOD(NULL, &_30$$34, "__construct", NULL, 4, &_31$$34); zephir_check_call_status_or_jump(try_end_1); - zephir_throw_exception_debug(_34$$34, "phalcon/mvc/micro.zep", 785 TSRMLS_CC); + zephir_throw_exception_debug(&_30$$34, "phalcon/mvc/micro.zep", 785 TSRMLS_CC); goto try_end_1; } - ZEPHIR_INIT_NVAR(status); - ZEPHIR_CALL_USER_FUNC(status, afterBinding); + ZEPHIR_INIT_NVAR(&status); + ZEPHIR_CALL_USER_FUNC(&status, &afterBinding); zephir_check_call_status_or_jump(try_end_1); - _36$$31 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_36$$31)) { + zephir_read_property(&_32$$31, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_32$$31)) { break; } - } - _37$$30 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_37$$30)) { - RETURN_CCTOR(status); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&afterBinding); + zephir_read_property(&_33$$30, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_33$$30)) { + RETURN_CCTOR(&status); } } - zephir_update_property_this(getThis(), SL("_returnedValue"), returnedValue TSRMLS_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_38$$37); - ZVAL_STRING(_38$$37, "micro:afterExecuteRoute", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _38$$37, this_ptr); - zephir_check_temp_parameter(_38$$37); + zephir_update_property_zval(this_ptr, SL("_returnedValue"), &returnedValue); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_34$$37); + ZVAL_STRING(&_34$$37, "micro:afterExecuteRoute"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_34$$37, this_ptr); zephir_check_call_status_or_jump(try_end_1); } - ZEPHIR_OBS_VAR(afterHandlers); - zephir_read_property_this(&afterHandlers, this_ptr, SL("_afterHandlers"), PH_NOISY_CC); - if (Z_TYPE_P(afterHandlers) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&afterHandlers); + zephir_read_property(&afterHandlers, this_ptr, SL("_afterHandlers"), PH_NOISY_CC); + if (Z_TYPE_P(&afterHandlers) == IS_ARRAY) { if (0) { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$false); } - zephir_is_iterable(afterHandlers, &_40$$38, &_39$$38, 0, 0, "phalcon/mvc/micro.zep", 862); - for ( - ; zend_hash_get_current_data_ex(_40$$38, (void**) &_41$$38, &_39$$38) == SUCCESS - ; zend_hash_move_forward_ex(_40$$38, &_39$$38) - ) { - ZEPHIR_GET_HVALUE(after, _41$$38); - if (Z_TYPE_P(after) == IS_OBJECT) { - if (zephir_instance_of_ev(after, phalcon_mvc_micro_middlewareinterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&status, after, "call", NULL, 0, this_ptr); + zephir_is_iterable(&afterHandlers, 0, "phalcon/mvc/micro.zep", 862); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&afterHandlers), _35$$38) + { + ZEPHIR_INIT_NVAR(&after); + ZVAL_COPY(&after, _35$$38); + if (Z_TYPE_P(&after) == IS_OBJECT) { + if (zephir_instance_of_ev(&after, phalcon_mvc_micro_middlewareinterface_ce TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(&status, &after, "call", NULL, 0, this_ptr); zephir_check_call_status_or_jump(try_end_1); - _42$$41 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_42$$41)) { + zephir_read_property(&_36$$41, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_36$$41)) { break; } continue; } } - if (!(zephir_is_callable(after TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_43$$43); - object_init_ex(_43$$43, phalcon_mvc_micro_exception_ce); - ZEPHIR_INIT_NVAR(_44$$43); - ZVAL_STRING(_44$$43, "One of the 'after' handlers is not callable", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _43$$43, "__construct", NULL, 9, _44$$43); - zephir_check_temp_parameter(_44$$43); + if (!(zephir_is_callable(&after TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_37$$43); + object_init_ex(&_37$$43, phalcon_mvc_micro_exception_ce); + ZEPHIR_INIT_NVAR(&_38$$43); + ZVAL_STRING(&_38$$43, "One of the 'after' handlers is not callable"); + ZEPHIR_CALL_METHOD(NULL, &_37$$43, "__construct", NULL, 4, &_38$$43); zephir_check_call_status_or_jump(try_end_1); - zephir_throw_exception_debug(_43$$43, "phalcon/mvc/micro.zep", 850 TSRMLS_CC); + zephir_throw_exception_debug(&_37$$43, "phalcon/mvc/micro.zep", 850 TSRMLS_CC); goto try_end_1; } - ZEPHIR_INIT_NVAR(status); - ZEPHIR_CALL_USER_FUNC(status, after); + ZEPHIR_INIT_NVAR(&status); + ZEPHIR_CALL_USER_FUNC(&status, &after); zephir_check_call_status_or_jump(try_end_1); - _45$$39 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_45$$39)) { + zephir_read_property(&_39$$39, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_39$$39)) { break; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&after); } } else { - ZEPHIR_OBS_NVAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_47$$46); - ZVAL_STRING(_47$$46, "micro:beforeNotFound", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_46$$46, eventsManager, "fire", NULL, 0, _47$$46, this_ptr); - zephir_check_temp_parameter(_47$$46); + ZEPHIR_OBS_NVAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_41$$46); + ZVAL_STRING(&_41$$46, "micro:beforeNotFound"); + ZEPHIR_CALL_METHOD(&_40$$46, &eventsManager, "fire", NULL, 0, &_41$$46, this_ptr); zephir_check_call_status_or_jump(try_end_1); - if (ZEPHIR_IS_FALSE_IDENTICAL(_46$$46)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_40$$46)) { RETURN_MM_BOOL(0); } } - ZEPHIR_OBS_VAR(notFoundHandler); - zephir_read_property_this(¬FoundHandler, this_ptr, SL("_notFoundHandler"), PH_NOISY_CC); - if (!(zephir_is_callable(notFoundHandler TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_48$$48); - object_init_ex(_48$$48, phalcon_mvc_micro_exception_ce); - ZEPHIR_INIT_VAR(_49$$48); - ZVAL_STRING(_49$$48, "Not-Found handler is not callable or is not defined", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _48$$48, "__construct", NULL, 9, _49$$48); - zephir_check_temp_parameter(_49$$48); + ZEPHIR_OBS_VAR(¬FoundHandler); + zephir_read_property(¬FoundHandler, this_ptr, SL("_notFoundHandler"), PH_NOISY_CC); + if (!(zephir_is_callable(¬FoundHandler TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_42$$48); + object_init_ex(&_42$$48, phalcon_mvc_micro_exception_ce); + ZEPHIR_INIT_VAR(&_43$$48); + ZVAL_STRING(&_43$$48, "Not-Found handler is not callable or is not defined"); + ZEPHIR_CALL_METHOD(NULL, &_42$$48, "__construct", NULL, 4, &_43$$48); zephir_check_call_status_or_jump(try_end_1); - zephir_throw_exception_debug(_48$$48, "phalcon/mvc/micro.zep", 881 TSRMLS_CC); + zephir_throw_exception_debug(&_42$$48, "phalcon/mvc/micro.zep", 881 TSRMLS_CC); goto try_end_1; } - ZEPHIR_INIT_NVAR(returnedValue); - ZEPHIR_CALL_USER_FUNC(returnedValue, notFoundHandler); + ZEPHIR_INIT_NVAR(&returnedValue); + ZEPHIR_CALL_USER_FUNC(&returnedValue, ¬FoundHandler); zephir_check_call_status_or_jump(try_end_1); } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_50$$49); - ZVAL_STRING(_50$$49, "micro:afterHandleRoute", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _50$$49, this_ptr, returnedValue); - zephir_check_temp_parameter(_50$$49); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_44$$49); + ZVAL_STRING(&_44$$49, "micro:afterHandleRoute"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_44$$49, this_ptr, &returnedValue); zephir_check_call_status_or_jump(try_end_1); } - ZEPHIR_OBS_VAR(finishHandlers); - zephir_read_property_this(&finishHandlers, this_ptr, SL("_finishHandlers"), PH_NOISY_CC); - if (Z_TYPE_P(finishHandlers) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&finishHandlers); + zephir_read_property(&finishHandlers, this_ptr, SL("_finishHandlers"), PH_NOISY_CC); + if (Z_TYPE_P(&finishHandlers) == IS_ARRAY) { if (0) { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$false); } - ZEPHIR_INIT_NVAR(params); - ZVAL_NULL(params); - zephir_is_iterable(finishHandlers, &_52$$50, &_51$$50, 0, 0, "phalcon/mvc/micro.zep", 952); - for ( - ; zend_hash_get_current_data_ex(_52$$50, (void**) &_53$$50, &_51$$50) == SUCCESS - ; zend_hash_move_forward_ex(_52$$50, &_51$$50) - ) { - ZEPHIR_GET_HVALUE(finish, _53$$50); - if (Z_TYPE_P(finish) == IS_OBJECT) { - if (zephir_instance_of_ev(finish, phalcon_mvc_micro_middlewareinterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&status, finish, "call", NULL, 0, this_ptr); + ZEPHIR_INIT_NVAR(¶ms); + ZVAL_NULL(¶ms); + zephir_is_iterable(&finishHandlers, 0, "phalcon/mvc/micro.zep", 952); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&finishHandlers), _45$$50) + { + ZEPHIR_INIT_NVAR(&finish); + ZVAL_COPY(&finish, _45$$50); + if (Z_TYPE_P(&finish) == IS_OBJECT) { + if (zephir_instance_of_ev(&finish, phalcon_mvc_micro_middlewareinterface_ce TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(&status, &finish, "call", NULL, 0, this_ptr); zephir_check_call_status_or_jump(try_end_1); - _54$$53 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_54$$53)) { + zephir_read_property(&_46$$53, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_46$$53)) { break; } continue; } } - if (!(zephir_is_callable(finish TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_55$$55); - object_init_ex(_55$$55, phalcon_mvc_micro_exception_ce); - ZEPHIR_INIT_NVAR(_56$$55); - ZVAL_STRING(_56$$55, "One of the 'finish' handlers is not callable", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _55$$55, "__construct", NULL, 9, _56$$55); - zephir_check_temp_parameter(_56$$55); + if (!(zephir_is_callable(&finish TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_47$$55); + object_init_ex(&_47$$55, phalcon_mvc_micro_exception_ce); + ZEPHIR_INIT_NVAR(&_48$$55); + ZVAL_STRING(&_48$$55, "One of the 'finish' handlers is not callable"); + ZEPHIR_CALL_METHOD(NULL, &_47$$55, "__construct", NULL, 4, &_48$$55); zephir_check_call_status_or_jump(try_end_1); - zephir_throw_exception_debug(_55$$55, "phalcon/mvc/micro.zep", 933 TSRMLS_CC); + zephir_throw_exception_debug(&_47$$55, "phalcon/mvc/micro.zep", 933 TSRMLS_CC); goto try_end_1; } - if (Z_TYPE_P(params) == IS_NULL) { - ZEPHIR_INIT_NVAR(params); - zephir_create_array(params, 1, 0 TSRMLS_CC); - zephir_array_fast_append(params, this_ptr); + if (Z_TYPE_P(¶ms) == IS_NULL) { + ZEPHIR_INIT_NVAR(¶ms); + zephir_create_array(¶ms, 1, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, this_ptr); } - ZEPHIR_INIT_NVAR(status); - ZEPHIR_CALL_USER_FUNC_ARRAY(status, finish, params); + ZEPHIR_INIT_NVAR(&status); + ZEPHIR_CALL_USER_FUNC_ARRAY(&status, &finish, ¶ms); zephir_check_call_status_or_jump(try_end_1); - _57$$51 = zephir_fetch_nproperty_this(this_ptr, SL("_stopped"), PH_NOISY_CC); - if (zephir_is_true(_57$$51)) { + zephir_read_property(&_49$$51, this_ptr, SL("_stopped"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_49$$51)) { break; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&finish); } try_end_1: if (EG(exception)) { - ZEPHIR_INIT_VAR(_58); - ZEPHIR_CPY_WRT(_58, EG(exception)); - if (zephir_instance_of_ev(_58, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_50); + ZVAL_OBJ(&_50, EG(exception)); + Z_ADDREF_P(&_50); + if (zephir_instance_of_ev(&_50, zend_exception_get_default(TSRMLS_C) TSRMLS_CC)) { zend_clear_exception(TSRMLS_C); - ZEPHIR_CPY_WRT(e, _58); - ZEPHIR_OBS_NVAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_59$$59); - ZVAL_STRING(_59$$59, "micro:beforeException", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&returnedValue, eventsManager, "fire", NULL, 0, _59$$59, this_ptr, e); - zephir_check_temp_parameter(_59$$59); + ZEPHIR_CPY_WRT(&e, &_50); + ZEPHIR_OBS_NVAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_51$$59); + ZVAL_STRING(&_51$$59, "micro:beforeException"); + ZEPHIR_CALL_METHOD(&returnedValue, &eventsManager, "fire", NULL, 0, &_51$$59, this_ptr, &e); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(errorHandler); - zephir_read_property_this(&errorHandler, this_ptr, SL("_errorHandler"), PH_NOISY_CC); - if (zephir_is_true(errorHandler)) { - if (!(zephir_is_callable(errorHandler TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&errorHandler); + zephir_read_property(&errorHandler, this_ptr, SL("_errorHandler"), PH_NOISY_CC); + if (zephir_is_true(&errorHandler)) { + if (!(zephir_is_callable(&errorHandler TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_micro_exception_ce, "Error handler is not callable", "phalcon/mvc/micro.zep", 971); return; } - ZEPHIR_INIT_VAR(_60$$60); - zephir_create_array(_60$$60, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_60$$60, e); - ZEPHIR_INIT_NVAR(returnedValue); - ZEPHIR_CALL_USER_FUNC_ARRAY(returnedValue, errorHandler, _60$$60); + ZEPHIR_INIT_VAR(&_52$$60); + zephir_create_array(&_52$$60, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_52$$60, &e); + ZEPHIR_INIT_NVAR(&returnedValue); + ZEPHIR_CALL_USER_FUNC_ARRAY(&returnedValue, &errorHandler, &_52$$60); zephir_check_call_status(); - if (Z_TYPE_P(returnedValue) == IS_OBJECT) { - if (!(zephir_instance_of_ev(returnedValue, phalcon_http_responseinterface_ce TSRMLS_CC))) { - zephir_throw_exception_debug(e, "phalcon/mvc/micro.zep", 980 TSRMLS_CC); + if (Z_TYPE_P(&returnedValue) == IS_OBJECT) { + if (!(zephir_instance_of_ev(&returnedValue, phalcon_http_responseinterface_ce TSRMLS_CC))) { + zephir_throw_exception_debug(&e, "phalcon/mvc/micro.zep", 980 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - if (!ZEPHIR_IS_FALSE_IDENTICAL(returnedValue)) { - zephir_throw_exception_debug(e, "phalcon/mvc/micro.zep", 984 TSRMLS_CC); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&returnedValue)) { + zephir_throw_exception_debug(&e, "phalcon/mvc/micro.zep", 984 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } else { - if (!ZEPHIR_IS_FALSE_IDENTICAL(returnedValue)) { - zephir_throw_exception_debug(e, "phalcon/mvc/micro.zep", 990 TSRMLS_CC); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&returnedValue)) { + zephir_throw_exception_debug(&e, "phalcon/mvc/micro.zep", 990 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } } - if (Z_TYPE_P(returnedValue) == IS_STRING) { - ZEPHIR_INIT_VAR(_62$$68); - ZVAL_STRING(_62$$68, "response", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_61$$68, dependencyInjector, "getshared", NULL, 0, _62$$68); - zephir_check_temp_parameter(_62$$68); + if (Z_TYPE_P(&returnedValue) == IS_STRING) { + ZEPHIR_INIT_VAR(&_54$$68); + ZVAL_STRING(&_54$$68, "response"); + ZEPHIR_CALL_METHOD(&_53$$68, &dependencyInjector, "getshared", NULL, 0, &_54$$68); zephir_check_call_status(); - ZEPHIR_CPY_WRT(response, _61$$68); - ZEPHIR_CALL_METHOD(&_61$$68, response, "issent", NULL, 0); + ZEPHIR_CPY_WRT(&response, &_53$$68); + ZEPHIR_CALL_METHOD(&_53$$68, &response, "issent", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_61$$68))) { - ZEPHIR_CALL_METHOD(NULL, response, "setcontent", NULL, 0, returnedValue); + if (!(zephir_is_true(&_53$$68))) { + ZEPHIR_CALL_METHOD(NULL, &response, "setcontent", NULL, 0, &returnedValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, response, "send", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &response, "send", NULL, 0); zephir_check_call_status(); } } - if (Z_TYPE_P(returnedValue) == IS_OBJECT) { - if (zephir_instance_of_ev(returnedValue, phalcon_http_responseinterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_63$$71, returnedValue, "issent", NULL, 0); + if (Z_TYPE_P(&returnedValue) == IS_OBJECT) { + if (zephir_instance_of_ev(&returnedValue, phalcon_http_responseinterface_ce TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(&_55$$71, &returnedValue, "issent", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_63$$71))) { - ZEPHIR_CALL_METHOD(NULL, returnedValue, "send", NULL, 0); + if (!(zephir_is_true(&_55$$71))) { + ZEPHIR_CALL_METHOD(NULL, &returnedValue, "send", NULL, 0); zephir_check_call_status(); } } } - RETURN_CCTOR(returnedValue); + RETURN_CCTOR(&returnedValue); } @@ -1282,12 +1451,17 @@ PHP_METHOD(Phalcon_Mvc_Micro, handle) { */ PHP_METHOD(Phalcon_Mvc_Micro, stop) { - + zval __$true, __$false; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + if (1) { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_stopped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_stopped"), &__$false); } } @@ -1299,13 +1473,16 @@ PHP_METHOD(Phalcon_Mvc_Micro, stop) { */ PHP_METHOD(Phalcon_Mvc_Micro, setActiveHandler) { - zval *activeHandler; + zval *activeHandler, activeHandler_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&activeHandler_sub); zephir_fetch_params(0, 1, 0, &activeHandler); - zephir_update_property_this(getThis(), SL("_activeHandler"), activeHandler TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_activeHandler"), activeHandler); } @@ -1316,7 +1493,8 @@ PHP_METHOD(Phalcon_Mvc_Micro, setActiveHandler) { */ PHP_METHOD(Phalcon_Mvc_Micro, getActiveHandler) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_activeHandler"); @@ -1329,7 +1507,8 @@ PHP_METHOD(Phalcon_Mvc_Micro, getActiveHandler) { */ PHP_METHOD(Phalcon_Mvc_Micro, getReturnedValue) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_returnedValue"); @@ -1344,7 +1523,10 @@ PHP_METHOD(Phalcon_Mvc_Micro, getReturnedValue) { PHP_METHOD(Phalcon_Mvc_Micro, offsetExists) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias; + zval *alias, alias_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&alias_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &alias); @@ -1370,7 +1552,11 @@ PHP_METHOD(Phalcon_Mvc_Micro, offsetExists) { PHP_METHOD(Phalcon_Mvc_Micro, offsetSet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias, *definition; + zval *alias, alias_sub, *definition, definition_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&alias_sub); + ZVAL_UNDEF(&definition_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &alias, &definition); @@ -1398,7 +1584,10 @@ PHP_METHOD(Phalcon_Mvc_Micro, offsetSet) { PHP_METHOD(Phalcon_Mvc_Micro, offsetGet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias; + zval *alias, alias_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&alias_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &alias); @@ -1418,7 +1607,10 @@ PHP_METHOD(Phalcon_Mvc_Micro, offsetGet) { */ PHP_METHOD(Phalcon_Mvc_Micro, offsetUnset) { - zval *alias; + zval *alias, alias_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&alias_sub); zephir_fetch_params(0, 1, 0, &alias); @@ -1437,7 +1629,10 @@ PHP_METHOD(Phalcon_Mvc_Micro, offsetUnset) { */ PHP_METHOD(Phalcon_Mvc_Micro, before) { - zval *handler; + zval *handler, handler_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); zephir_fetch_params(0, 1, 0, &handler); @@ -1456,7 +1651,10 @@ PHP_METHOD(Phalcon_Mvc_Micro, before) { */ PHP_METHOD(Phalcon_Mvc_Micro, afterBinding) { - zval *handler; + zval *handler, handler_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); zephir_fetch_params(0, 1, 0, &handler); @@ -1475,7 +1673,10 @@ PHP_METHOD(Phalcon_Mvc_Micro, afterBinding) { */ PHP_METHOD(Phalcon_Mvc_Micro, after) { - zval *handler; + zval *handler, handler_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); zephir_fetch_params(0, 1, 0, &handler); @@ -1494,7 +1695,10 @@ PHP_METHOD(Phalcon_Mvc_Micro, after) { */ PHP_METHOD(Phalcon_Mvc_Micro, finish) { - zval *handler; + zval *handler, handler_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); zephir_fetch_params(0, 1, 0, &handler); @@ -1510,7 +1714,8 @@ PHP_METHOD(Phalcon_Mvc_Micro, finish) { */ PHP_METHOD(Phalcon_Mvc_Micro, getHandlers) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_handlers"); @@ -1521,7 +1726,8 @@ PHP_METHOD(Phalcon_Mvc_Micro, getHandlers) { */ PHP_METHOD(Phalcon_Mvc_Micro, getModelBinder) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_modelBinder"); @@ -1538,30 +1744,38 @@ PHP_METHOD(Phalcon_Mvc_Micro, getModelBinder) { PHP_METHOD(Phalcon_Mvc_Micro, setModelBinder) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *modelBinder, *cache = NULL, *dependencyInjector = NULL, *_0$$3 = NULL; + zval *modelBinder, modelBinder_sub, *cache = NULL, cache_sub, __$null, dependencyInjector, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelBinder_sub); + ZVAL_UNDEF(&cache_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &modelBinder, &cache); if (!cache) { - ZEPHIR_CPY_WRT(cache, ZEPHIR_GLOBAL(global_null)); + cache = &cache_sub; + ZEPHIR_CPY_WRT(cache, &__$null); } else { ZEPHIR_SEPARATE_PARAM(cache); } if (Z_TYPE_P(cache) == IS_STRING) { - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0$$3, dependencyInjector, "get", NULL, 0, cache); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&_0$$3, &dependencyInjector, "get", NULL, 0, cache); zephir_check_call_status(); - ZEPHIR_CPY_WRT(cache, _0$$3); + ZEPHIR_CPY_WRT(cache, &_0$$3); } if (Z_TYPE_P(cache) != IS_NULL) { ZEPHIR_CALL_METHOD(NULL, modelBinder, "setcache", NULL, 0, cache); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_modelBinder"), modelBinder TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelBinder"), modelBinder); RETURN_THIS(); } @@ -1571,15 +1785,18 @@ PHP_METHOD(Phalcon_Mvc_Micro, setModelBinder) { */ PHP_METHOD(Phalcon_Mvc_Micro, getBoundModels) { - zval *modelBinder = NULL; + zval modelBinder; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelBinder); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(modelBinder); - zephir_read_property_this(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); - if (Z_TYPE_P(modelBinder) != IS_NULL) { - ZEPHIR_RETURN_CALL_METHOD(modelBinder, "getboundmodels", NULL, 0); + ZEPHIR_OBS_VAR(&modelBinder); + zephir_read_property(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); + if (Z_TYPE_P(&modelBinder) != IS_NULL) { + ZEPHIR_RETURN_CALL_METHOD(&modelBinder, "getboundmodels", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -1588,34 +1805,25 @@ PHP_METHOD(Phalcon_Mvc_Micro, getBoundModels) { } -zend_object_value zephir_init_properties_Phalcon_Mvc_Micro(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Micro(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_handlers"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_handlers"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_handlers"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_handlers"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/micro.zep.h b/ext/phalcon/mvc/micro.zep.h index a1fd9aa2e2e..4d870865922 100644 --- a/ext/phalcon/mvc/micro.zep.h +++ b/ext/phalcon/mvc/micro.zep.h @@ -38,7 +38,7 @@ PHP_METHOD(Phalcon_Mvc_Micro, getHandlers); PHP_METHOD(Phalcon_Mvc_Micro, getModelBinder); PHP_METHOD(Phalcon_Mvc_Micro, setModelBinder); PHP_METHOD(Phalcon_Mvc_Micro, getBoundModels); -zend_object_value zephir_init_properties_Phalcon_Mvc_Micro(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Micro(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro___construct, 0, 0, 0) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 1) @@ -48,70 +48,177 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_map, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_map, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_map, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_get, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_get, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_get, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_post, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_post, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_post, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_put, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_put, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_put, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_patch, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_patch, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_patch, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_head, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_head, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_head, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_delete, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_delete, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_delete, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_options, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_options, 0, 2, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_options, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_mount, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_mount, 0, 1, Phalcon\\Mvc\\Micro, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_mount, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro", 0) +#endif ZEND_ARG_OBJ_INFO(0, collection, Phalcon\\Mvc\\Micro\\CollectionInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_notfound, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_notfound, 0, 1, Phalcon\\Mvc\\Micro, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_notfound, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro", 0) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_error, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_error, 0, 1, Phalcon\\Mvc\\Micro, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_error, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro", 0) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_setservice, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_getrouter, 0, 0, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_getrouter, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_setservice, 0, 2, Phalcon\\Di\\ServiceInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_setservice, 0, 2, IS_OBJECT, "Phalcon\\Di\\ServiceInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, serviceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, serviceName) +#endif ZEND_ARG_INFO(0, definition) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, shared, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, shared) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_hasservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_hasservice, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_hasservice, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, serviceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, serviceName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_getservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, serviceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, serviceName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_getsharedservice, 0, 0, 1) @@ -126,7 +233,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_setactivehandler, 0, 0, 1) ZEND_ARG_INFO(0, activeHandler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_offsetexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_offsetexists, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() @@ -143,27 +254,68 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_offsetunset, 0, 0, 1) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_before, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_before, 0, 1, Phalcon\\Mvc\\Micro, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_before, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro", 0) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_afterbinding, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_afterbinding, 0, 1, Phalcon\\Mvc\\Micro, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_afterbinding, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro", 0) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_after, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_after, 0, 1, Phalcon\\Mvc\\Micro, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_after, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro", 0) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_finish, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_finish, 0, 1, Phalcon\\Mvc\\Micro, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_finish, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro", 0) +#endif ZEND_ARG_INFO(0, handler) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_setmodelbinder, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_gethandlers, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_gethandlers, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_getmodelbinder, 0, 0, Phalcon\\Mvc\\Model\\BinderInterface, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_getmodelbinder, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\BinderInterface", 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_setmodelbinder, 0, 1, Phalcon\\Mvc\\Micro, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_setmodelbinder, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro", 0) +#endif ZEND_ARG_OBJ_INFO(0, modelBinder, Phalcon\\Mvc\\Model\\BinderInterface, 0) ZEND_ARG_INFO(0, cache) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_getboundmodels, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_getboundmodels, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_micro_method_entry) { PHP_ME(Phalcon_Mvc_Micro, __construct, arginfo_phalcon_mvc_micro___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Micro, setDI, arginfo_phalcon_mvc_micro_setdi, ZEND_ACC_PUBLIC) @@ -178,7 +330,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_micro_method_entry) { PHP_ME(Phalcon_Mvc_Micro, mount, arginfo_phalcon_mvc_micro_mount, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro, notFound, arginfo_phalcon_mvc_micro_notfound, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro, error, arginfo_phalcon_mvc_micro_error, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Micro, getRouter, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Micro, getRouter, arginfo_phalcon_mvc_micro_getrouter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro, setService, arginfo_phalcon_mvc_micro_setservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro, hasService, arginfo_phalcon_mvc_micro_hasservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro, getService, arginfo_phalcon_mvc_micro_getservice, ZEND_ACC_PUBLIC) @@ -196,9 +348,9 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_micro_method_entry) { PHP_ME(Phalcon_Mvc_Micro, afterBinding, arginfo_phalcon_mvc_micro_afterbinding, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro, after, arginfo_phalcon_mvc_micro_after, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro, finish, arginfo_phalcon_mvc_micro_finish, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Micro, getHandlers, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Micro, getModelBinder, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Micro, getHandlers, arginfo_phalcon_mvc_micro_gethandlers, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Micro, getModelBinder, arginfo_phalcon_mvc_micro_getmodelbinder, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro, setModelBinder, arginfo_phalcon_mvc_micro_setmodelbinder, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Micro, getBoundModels, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Micro, getBoundModels, arginfo_phalcon_mvc_micro_getboundmodels, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/micro/collection.zep.c b/ext/phalcon/mvc/micro/collection.zep.c index 0f5ba16a4dd..7cab5faa12d 100644 --- a/ext/phalcon/mvc/micro/collection.zep.c +++ b/ext/phalcon/mvc/micro/collection.zep.c @@ -67,21 +67,28 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Micro_Collection) { */ PHP_METHOD(Phalcon_Mvc_Micro_Collection, _addMap) { - zval *_0; - zval *method, *routePattern, *handler, *name; + zval _0; + zval *method, method_sub, *routePattern, routePattern_sub, *handler, handler_sub, *name, name_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method_sub); + ZVAL_UNDEF(&routePattern_sub); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &method, &routePattern, &handler, &name); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 4, 0 TSRMLS_CC); - zephir_array_fast_append(_0, method); - zephir_array_fast_append(_0, routePattern); - zephir_array_fast_append(_0, handler); - zephir_array_fast_append(_0, name); - zephir_update_property_array_append(this_ptr, SL("_handlers"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 4, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, method); + zephir_array_fast_append(&_0, routePattern); + zephir_array_fast_append(&_0, handler); + zephir_array_fast_append(&_0, name); + zephir_update_property_array_append(this_ptr, SL("_handlers"), &_0 TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -92,24 +99,27 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, _addMap) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, setPrefix) { zval *prefix_param = NULL; - zval *prefix = NULL; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &prefix_param); if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } else { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_EMPTY_STRING(&prefix); } - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); RETURN_THIS(); } @@ -119,7 +129,8 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, setPrefix) { */ PHP_METHOD(Phalcon_Mvc_Micro_Collection, getPrefix) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_prefix"); @@ -132,7 +143,8 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, getPrefix) { */ PHP_METHOD(Phalcon_Mvc_Micro_Collection, getHandlers) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_handlers"); @@ -148,7 +160,12 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, getHandlers) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, setHandler) { zend_bool lazy; - zval *handler, *lazy_param = NULL; + zval *handler, handler_sub, *lazy_param = NULL, __$true, __$false; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 1, &handler, &lazy_param); @@ -159,11 +176,11 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, setHandler) { } - zephir_update_property_this(getThis(), SL("_handler"), handler TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_handler"), handler); if (lazy) { - zephir_update_property_this(getThis(), SL("_lazy"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_lazy"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_lazy"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_lazy"), &__$false); } RETURN_THISW(); @@ -174,22 +191,26 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, setHandler) { */ PHP_METHOD(Phalcon_Mvc_Micro_Collection, setLazy) { - zval *lazy_param = NULL; + zval *lazy_param = NULL, __$true, __$false; zend_bool lazy; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &lazy_param); - if (UNEXPECTED(Z_TYPE_P(lazy_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'lazy' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(lazy_param) != IS_TRUE && Z_TYPE_P(lazy_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'lazy' must be of the type bool") TSRMLS_CC); RETURN_NULL(); } - lazy = Z_BVAL_P(lazy_param); + lazy = (Z_TYPE_P(lazy_param) == IS_TRUE); if (lazy) { - zephir_update_property_this(getThis(), SL("_lazy"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_lazy"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_lazy"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_lazy"), &__$false); } RETURN_THISW(); @@ -200,7 +221,8 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, setLazy) { */ PHP_METHOD(Phalcon_Mvc_Micro_Collection, isLazy) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lazy"); @@ -213,7 +235,8 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, isLazy) { */ PHP_METHOD(Phalcon_Mvc_Micro_Collection, getHandler) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_handler"); @@ -230,30 +253,37 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, getHandler) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, map) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *name = NULL, *_0; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, *name = NULL, name_sub, __$null, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &routePattern_param, &handler, &name); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } if (!name) { - name = ZEPHIR_GLOBAL(global_null); + name = &name_sub; + name = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_NULL(_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, _0, routePattern, handler, name); + ZVAL_NULL(&_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, &_0, &routePattern, handler, name); zephir_check_call_status(); RETURN_THIS(); @@ -271,28 +301,36 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, map) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, mapVia) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *method, *name = NULL; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, *method, method_sub, *name = NULL, name_sub, __$null; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&method_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &routePattern_param, &handler, &method, &name); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } if (!name) { - name = ZEPHIR_GLOBAL(global_null); + name = &name_sub; + name = &__$null; } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, method, routePattern, handler, name); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, method, &routePattern, handler, name); zephir_check_call_status(); RETURN_THIS(); @@ -309,31 +347,38 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, mapVia) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, get) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *name = NULL, *_0; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, *name = NULL, name_sub, __$null, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &routePattern_param, &handler, &name); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } if (!name) { - name = ZEPHIR_GLOBAL(global_null); + name = &name_sub; + name = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "GET", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, _0, routePattern, handler, name); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "GET"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, &_0, &routePattern, handler, name); zephir_check_call_status(); RETURN_THIS(); @@ -350,31 +395,38 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, get) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, post) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *name = NULL, *_0; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, *name = NULL, name_sub, __$null, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &routePattern_param, &handler, &name); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } if (!name) { - name = ZEPHIR_GLOBAL(global_null); + name = &name_sub; + name = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "POST", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, _0, routePattern, handler, name); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "POST"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, &_0, &routePattern, handler, name); zephir_check_call_status(); RETURN_THIS(); @@ -391,31 +443,38 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, post) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, put) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *name = NULL, *_0; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, *name = NULL, name_sub, __$null, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &routePattern_param, &handler, &name); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } if (!name) { - name = ZEPHIR_GLOBAL(global_null); + name = &name_sub; + name = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "PUT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, _0, routePattern, handler, name); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "PUT"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, &_0, &routePattern, handler, name); zephir_check_call_status(); RETURN_THIS(); @@ -432,31 +491,38 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, put) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, patch) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *name = NULL, *_0; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, *name = NULL, name_sub, __$null, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &routePattern_param, &handler, &name); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } if (!name) { - name = ZEPHIR_GLOBAL(global_null); + name = &name_sub; + name = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "PATCH", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, _0, routePattern, handler, name); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "PATCH"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, &_0, &routePattern, handler, name); zephir_check_call_status(); RETURN_THIS(); @@ -473,31 +539,38 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, patch) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, head) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *name = NULL, *_0; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, *name = NULL, name_sub, __$null, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &routePattern_param, &handler, &name); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } if (!name) { - name = ZEPHIR_GLOBAL(global_null); + name = &name_sub; + name = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "HEAD", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, _0, routePattern, handler, name); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "HEAD"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, &_0, &routePattern, handler, name); zephir_check_call_status(); RETURN_THIS(); @@ -514,31 +587,38 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, head) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, delete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *name = NULL, *_0; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, *name = NULL, name_sub, __$null, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &routePattern_param, &handler, &name); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } if (!name) { - name = ZEPHIR_GLOBAL(global_null); + name = &name_sub; + name = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "DELETE", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, _0, routePattern, handler, name); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "DELETE"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, &_0, &routePattern, handler, name); zephir_check_call_status(); RETURN_THIS(); @@ -554,31 +634,38 @@ PHP_METHOD(Phalcon_Mvc_Micro_Collection, delete) { PHP_METHOD(Phalcon_Mvc_Micro_Collection, options) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *routePattern_param = NULL, *handler, *name = NULL, *_0; - zval *routePattern = NULL; + zval *routePattern_param = NULL, *handler, handler_sub, *name = NULL, name_sub, __$null, _0; + zval routePattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&routePattern); + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&name_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &routePattern_param, &handler, &name); if (UNEXPECTED(Z_TYPE_P(routePattern_param) != IS_STRING && Z_TYPE_P(routePattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'routePattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(routePattern_param) == IS_STRING)) { - zephir_get_strval(routePattern, routePattern_param); + zephir_get_strval(&routePattern, routePattern_param); } else { - ZEPHIR_INIT_VAR(routePattern); - ZVAL_EMPTY_STRING(routePattern); + ZEPHIR_INIT_VAR(&routePattern); + ZVAL_EMPTY_STRING(&routePattern); } if (!name) { - name = ZEPHIR_GLOBAL(global_null); + name = &name_sub; + name = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "OPTIONS", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, _0, routePattern, handler, name); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "OPTIONS"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_addmap", NULL, 0, &_0, &routePattern, handler, name); zephir_check_call_status(); RETURN_THIS(); diff --git a/ext/phalcon/mvc/micro/collection.zep.h b/ext/phalcon/mvc/micro/collection.zep.h index 8728f5ab2e5..ef8d0b27678 100644 --- a/ext/phalcon/mvc/micro/collection.zep.h +++ b/ext/phalcon/mvc/micro/collection.zep.h @@ -28,70 +28,180 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection__addmap, 0, 0, 4) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_setprefix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_setprefix, 0, 1, Phalcon\\Mvc\\Micro\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_setprefix, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro\\CollectionInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_sethandler, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_getprefix, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_getprefix, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_sethandler, 0, 1, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_sethandler, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif ZEND_ARG_INFO(0, handler) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lazy, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, lazy) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_setlazy, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_setlazy, 0, 1, Phalcon\\Mvc\\Micro\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_setlazy, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro\\CollectionInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lazy, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, lazy) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_islazy, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_islazy, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_map, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_map, 0, 2, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_map, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_mapvia, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_mapvia, 0, 3, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_mapvia, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, method) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_get, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_get, 0, 2, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_get, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_post, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_post, 0, 2, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_post, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_put, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_put, 0, 2, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_put, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_patch, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_patch, 0, 2, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_patch, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_head, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_head, 0, 2, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_head, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_delete, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_delete, 0, 2, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_delete, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collection_options, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collection_options, 0, 2, Phalcon\\Mvc\\Micro\\Collection, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collection_options, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Micro\\Collection", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() @@ -99,11 +209,11 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_micro_collection_method_entry) { PHP_ME(Phalcon_Mvc_Micro_Collection, _addMap, arginfo_phalcon_mvc_micro_collection__addmap, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Micro_Collection, setPrefix, arginfo_phalcon_mvc_micro_collection_setprefix, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Micro_Collection, getPrefix, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Micro_Collection, getPrefix, arginfo_phalcon_mvc_micro_collection_getprefix, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro_Collection, getHandlers, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro_Collection, setHandler, arginfo_phalcon_mvc_micro_collection_sethandler, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro_Collection, setLazy, arginfo_phalcon_mvc_micro_collection_setlazy, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Micro_Collection, isLazy, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Micro_Collection, isLazy, arginfo_phalcon_mvc_micro_collection_islazy, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro_Collection, getHandler, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro_Collection, map, arginfo_phalcon_mvc_micro_collection_map, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Micro_Collection, mapVia, arginfo_phalcon_mvc_micro_collection_mapvia, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/mvc/micro/collectioninterface.zep.h b/ext/phalcon/mvc/micro/collectioninterface.zep.h index 4a56a515305..436dc0186ac 100644 --- a/ext/phalcon/mvc/micro/collectioninterface.zep.h +++ b/ext/phalcon/mvc/micro/collectioninterface.zep.h @@ -3,74 +3,140 @@ extern zend_class_entry *phalcon_mvc_micro_collectioninterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Micro_CollectionInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_setprefix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_setprefix, 0, 1, Phalcon\\Mvc\\Micro\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_setprefix, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro\\CollectionInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, prefix) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_getprefix, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_getprefix, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_sethandler, 0, 0, 1) ZEND_ARG_INFO(0, handler) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lazy, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, lazy) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_setlazy, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_setlazy, 0, 1, Phalcon\\Mvc\\Micro\\CollectionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_setlazy, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Micro\\CollectionInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lazy, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, lazy) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_islazy, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_islazy, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_map, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_get, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_post, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_put, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_patch, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_head, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_delete, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_collectioninterface_options, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, routePattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, routePattern) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_micro_collectioninterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, setPrefix, arginfo_phalcon_mvc_micro_collectioninterface_setprefix) - PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, getPrefix, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, getPrefix, arginfo_phalcon_mvc_micro_collectioninterface_getprefix) PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, getHandlers, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, setHandler, arginfo_phalcon_mvc_micro_collectioninterface_sethandler) PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, setLazy, arginfo_phalcon_mvc_micro_collectioninterface_setlazy) - PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, isLazy, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, isLazy, arginfo_phalcon_mvc_micro_collectioninterface_islazy) PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, getHandler, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, map, arginfo_phalcon_mvc_micro_collectioninterface_map) PHP_ABSTRACT_ME(Phalcon_Mvc_Micro_CollectionInterface, get, arginfo_phalcon_mvc_micro_collectioninterface_get) diff --git a/ext/phalcon/mvc/micro/lazyloader.zep.c b/ext/phalcon/mvc/micro/lazyloader.zep.c index cdd0f894a55..7939dcce2a5 100644 --- a/ext/phalcon/mvc/micro/lazyloader.zep.c +++ b/ext/phalcon/mvc/micro/lazyloader.zep.c @@ -43,7 +43,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Micro_LazyLoader) { PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, getDefinition) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_definition"); @@ -55,24 +56,27 @@ PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, getDefinition) { PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, __construct) { zval *definition_param = NULL; - zval *definition = NULL; + zval definition; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&definition); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &definition_param); if (UNEXPECTED(Z_TYPE_P(definition_param) != IS_STRING && Z_TYPE_P(definition_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'definition' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'definition' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(definition_param) == IS_STRING)) { - zephir_get_strval(definition, definition_param); + zephir_get_strval(&definition, definition_param); } else { - ZEPHIR_INIT_VAR(definition); - ZVAL_EMPTY_STRING(definition); + ZEPHIR_INIT_VAR(&definition); + ZVAL_EMPTY_STRING(&definition); } - zephir_update_property_this(getThis(), SL("_definition"), definition TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_definition"), &definition); ZEPHIR_MM_RESTORE(); } @@ -87,56 +91,67 @@ PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, __construct) { PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, __call) { zend_class_entry *_1$$3; - zval *_3; + zval _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *arguments = NULL, *handler = NULL, *definition = NULL, *modelBinder = NULL, *bindCacheKey = NULL, *_0$$3 = NULL, *_2$$4 = NULL; - zval *method = NULL; + zval *method_param = NULL, *arguments = NULL, arguments_sub, handler, definition, modelBinder, bindCacheKey, _0$$3, _2$$4; + zval method; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&arguments_sub); + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&modelBinder); + ZVAL_UNDEF(&bindCacheKey); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &method_param, &arguments); if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); } else { - ZEPHIR_INIT_VAR(method); - ZVAL_EMPTY_STRING(method); + ZEPHIR_INIT_VAR(&method); + ZVAL_EMPTY_STRING(&method); } ZEPHIR_SEPARATE_PARAM(arguments); - ZEPHIR_OBS_VAR(handler); - zephir_read_property_this(&handler, this_ptr, SL("_handler"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(definition); - zephir_read_property_this(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); - if (Z_TYPE_P(handler) != IS_OBJECT) { - ZEPHIR_INIT_NVAR(handler); - zephir_fetch_safe_class(_0$$3, definition); - _1$$3 = zend_fetch_class(Z_STRVAL_P(_0$$3), Z_STRLEN_P(_0$$3), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(handler, _1$$3); - if (zephir_has_constructor(handler TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, handler, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&handler); + zephir_read_property(&handler, this_ptr, SL("_handler"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&definition); + zephir_read_property(&definition, this_ptr, SL("_definition"), PH_NOISY_CC); + if (Z_TYPE_P(&handler) != IS_OBJECT) { + ZEPHIR_INIT_NVAR(&handler); + zephir_fetch_safe_class(&_0$$3, &definition); + _1$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_0$$3), Z_STRLEN_P(&_0$$3), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&handler, _1$$3); + if (zephir_has_constructor(&handler TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &handler, "__construct", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_handler"), handler TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_handler"), &handler); } - ZEPHIR_OBS_VAR(modelBinder); - zephir_read_property_this(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); - if (Z_TYPE_P(modelBinder) != IS_NULL) { - ZEPHIR_INIT_VAR(bindCacheKey); - ZEPHIR_CONCAT_SVSV(bindCacheKey, "_PHMB_", definition, "_", method); - ZEPHIR_CALL_METHOD(&_2$$4, modelBinder, "bindtohandler", NULL, 0, handler, arguments, bindCacheKey, method); + ZEPHIR_OBS_VAR(&modelBinder); + zephir_read_property(&modelBinder, this_ptr, SL("_modelBinder"), PH_NOISY_CC); + if (Z_TYPE_P(&modelBinder) != IS_NULL) { + ZEPHIR_INIT_VAR(&bindCacheKey); + ZEPHIR_CONCAT_SVSV(&bindCacheKey, "_PHMB_", &definition, "_", &method); + ZEPHIR_CALL_METHOD(&_2$$4, &modelBinder, "bindtohandler", NULL, 0, &handler, arguments, &bindCacheKey, &method); zephir_check_call_status(); - ZEPHIR_CPY_WRT(arguments, _2$$4); + ZEPHIR_CPY_WRT(arguments, &_2$$4); } - ZEPHIR_INIT_VAR(_3); - zephir_create_array(_3, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_3, handler); - zephir_array_fast_append(_3, method); - ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, _3, arguments); + ZEPHIR_INIT_VAR(&_3); + zephir_create_array(&_3, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_3, &handler); + zephir_array_fast_append(&_3, &method); + ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_3, arguments); zephir_check_call_status(); RETURN_MM(); @@ -152,29 +167,36 @@ PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, __call) { PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, callMethod) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *arguments, *modelBinder = NULL; - zval *method = NULL; + zval *method_param = NULL, *arguments, arguments_sub, *modelBinder = NULL, modelBinder_sub, __$null; + zval method; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&arguments_sub); + ZVAL_UNDEF(&modelBinder_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &method_param, &arguments, &modelBinder); if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); } else { - ZEPHIR_INIT_VAR(method); - ZVAL_EMPTY_STRING(method); + ZEPHIR_INIT_VAR(&method); + ZVAL_EMPTY_STRING(&method); } if (!modelBinder) { - modelBinder = ZEPHIR_GLOBAL(global_null); + modelBinder = &modelBinder_sub; + modelBinder = &__$null; } - zephir_update_property_this(getThis(), SL("_modelBinder"), modelBinder TSRMLS_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "__call", NULL, 0, method, arguments); + zephir_update_property_zval(this_ptr, SL("_modelBinder"), modelBinder); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "__call", NULL, 0, &method, arguments); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/mvc/micro/lazyloader.zep.h b/ext/phalcon/mvc/micro/lazyloader.zep.h index 5322d971c09..c20646920da 100644 --- a/ext/phalcon/mvc/micro/lazyloader.zep.h +++ b/ext/phalcon/mvc/micro/lazyloader.zep.h @@ -9,16 +9,28 @@ PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, __call); PHP_METHOD(Phalcon_Mvc_Micro_LazyLoader, callMethod); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_lazyloader___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, definition, IS_STRING, 0) +#else ZEND_ARG_INFO(0, definition) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_lazyloader___call, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_micro_lazyloader_callmethod, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_ARG_OBJ_INFO(0, modelBinder, Phalcon\\Mvc\\Model\\BinderInterface, 1) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model.zep.c b/ext/phalcon/mvc/model.zep.c index fe3094996c2..e3ec08f1156 100644 --- a/ext/phalcon/mvc/model.zep.c +++ b/ext/phalcon/mvc/model.zep.c @@ -91,35 +91,36 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model) { zend_declare_property_null(phalcon_mvc_model_ce, SL("_oldSnapshot"), ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_class_constant_string(phalcon_mvc_model_ce, SL("TRANSACTION_INDEX"), "transaction" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_mvc_model_ce, SL("TRANSACTION_INDEX"), "transaction"); - zend_declare_class_constant_long(phalcon_mvc_model_ce, SL("OP_NONE"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_ce, SL("OP_NONE"), 0); - zend_declare_class_constant_long(phalcon_mvc_model_ce, SL("OP_CREATE"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_ce, SL("OP_CREATE"), 1); - zend_declare_class_constant_long(phalcon_mvc_model_ce, SL("OP_UPDATE"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_ce, SL("OP_UPDATE"), 2); - zend_declare_class_constant_long(phalcon_mvc_model_ce, SL("OP_DELETE"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_ce, SL("OP_DELETE"), 3); - zend_declare_class_constant_long(phalcon_mvc_model_ce, SL("DIRTY_STATE_PERSISTENT"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_ce, SL("DIRTY_STATE_PERSISTENT"), 0); - zend_declare_class_constant_long(phalcon_mvc_model_ce, SL("DIRTY_STATE_TRANSIENT"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_ce, SL("DIRTY_STATE_TRANSIENT"), 1); - zend_declare_class_constant_long(phalcon_mvc_model_ce, SL("DIRTY_STATE_DETACHED"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_ce, SL("DIRTY_STATE_DETACHED"), 2); zend_class_implements(phalcon_mvc_model_ce TSRMLS_CC, 1, phalcon_mvc_entityinterface_ce); zend_class_implements(phalcon_mvc_model_ce TSRMLS_CC, 1, phalcon_mvc_modelinterface_ce); zend_class_implements(phalcon_mvc_model_ce TSRMLS_CC, 1, phalcon_mvc_model_resultinterface_ce); zend_class_implements(phalcon_mvc_model_ce TSRMLS_CC, 1, phalcon_di_injectionawareinterface_ce); zend_class_implements(phalcon_mvc_model_ce TSRMLS_CC, 1, zend_ce_serializable); - zend_class_implements(phalcon_mvc_model_ce TSRMLS_CC, 1, zephir_get_internal_ce(SS("jsonserializable") TSRMLS_CC)); + zend_class_implements(phalcon_mvc_model_ce TSRMLS_CC, 1, zephir_get_internal_ce(SL("jsonserializable"))); return SUCCESS; } PHP_METHOD(Phalcon_Mvc_Model, getTransaction) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_transaction"); @@ -132,54 +133,65 @@ PHP_METHOD(Phalcon_Mvc_Model, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL; - zval *data = NULL, *dependencyInjector = NULL, *modelsManager = NULL, *_0, *_2$$5 = NULL, *_3$$5; + zval *data = NULL, data_sub, *dependencyInjector = NULL, dependencyInjector_sub, *modelsManager = NULL, modelsManager_sub, __$null, _0, _2$$5, _3$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&modelsManager_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &data, &dependencyInjector, &modelsManager); if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } if (!dependencyInjector) { - ZEPHIR_CPY_WRT(dependencyInjector, ZEPHIR_GLOBAL(global_null)); + dependencyInjector = &dependencyInjector_sub; + ZEPHIR_CPY_WRT(dependencyInjector, &__$null); } else { ZEPHIR_SEPARATE_PARAM(dependencyInjector); } if (!modelsManager) { - ZEPHIR_CPY_WRT(modelsManager, ZEPHIR_GLOBAL(global_null)); + modelsManager = &modelsManager_sub; + ZEPHIR_CPY_WRT(modelsManager, &__$null); } else { ZEPHIR_SEPARATE_PARAM(modelsManager); } - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_oldSnapshot"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_oldSnapshot"), &_0); if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_1, 1); + ZEPHIR_CALL_CE_STATIC(dependencyInjector, phalcon_di_ce, "getdefault", &_1, 0); zephir_check_call_status(); } if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A dependency injector container is required to obtain the services related to the ORM", "phalcon/mvc/model.zep", 147); return; } - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); if (Z_TYPE_P(modelsManager) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_3$$5); - ZVAL_STRING(_3$$5, "modelsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2$$5, dependencyInjector, "getshared", NULL, 0, _3$$5); - zephir_check_temp_parameter(_3$$5); + ZEPHIR_INIT_VAR(&_3$$5); + ZVAL_STRING(&_3$$5, "modelsManager"); + ZEPHIR_CALL_METHOD(&_2$$5, dependencyInjector, "getshared", NULL, 0, &_3$$5); zephir_check_call_status(); - ZEPHIR_CPY_WRT(modelsManager, _2$$5); + ZEPHIR_CPY_WRT(modelsManager, &_2$$5); if (Z_TYPE_P(modelsManager) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The injected service 'modelsManager' is not valid", "phalcon/mvc/model.zep", 158); return; } } - zephir_update_property_this(getThis(), SL("_modelsManager"), modelsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelsManager"), modelsManager); ZEPHIR_CALL_METHOD(NULL, modelsManager, "initialize", NULL, 0, this_ptr); zephir_check_call_status(); - if ((zephir_method_exists_ex(this_ptr, SS("onconstruct") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(this_ptr, SL("onconstruct") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "onconstruct", NULL, 0, data); zephir_check_call_status(); } @@ -196,13 +208,16 @@ PHP_METHOD(Phalcon_Mvc_Model, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -211,7 +226,8 @@ PHP_METHOD(Phalcon_Mvc_Model, setDI) { */ PHP_METHOD(Phalcon_Mvc_Model, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -223,15 +239,19 @@ PHP_METHOD(Phalcon_Mvc_Model, getDI) { PHP_METHOD(Phalcon_Mvc_Model, setEventsManager) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventsManager, *_0; + zval *eventsManager, eventsManager_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &eventsManager); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "setcustomeventsmanager", NULL, 0, this_ptr, eventsManager); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "setcustomeventsmanager", NULL, 0, this_ptr, eventsManager); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -242,13 +262,16 @@ PHP_METHOD(Phalcon_Mvc_Model, setEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Model, getEventsManager) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getcustomeventsmanager", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getcustomeventsmanager", NULL, 0, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -259,29 +282,35 @@ PHP_METHOD(Phalcon_Mvc_Model, getEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Model, getModelsMetaData) { - zval *metaData = NULL, *dependencyInjector = NULL, *_0$$3, *_1$$3 = NULL, *_2$$3; + zval metaData, dependencyInjector, _0$$3, _1$$3, _2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(metaData); - zephir_read_property_this(&metaData, this_ptr, SL("_modelsMetaData"), PH_NOISY_CC); - if (Z_TYPE_P(metaData) != IS_OBJECT) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0$$3); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$3, dependencyInjector, "getshared", NULL, 0, _2$$3); - zephir_check_temp_parameter(_2$$3); + ZEPHIR_OBS_VAR(&metaData); + zephir_read_property(&metaData, this_ptr, SL("_modelsMetaData"), PH_NOISY_CC); + if (Z_TYPE_P(&metaData) != IS_OBJECT) { + zephir_read_property(&_0$$3, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0$$3); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "modelsMetadata"); + ZEPHIR_CALL_METHOD(&_1$$3, &dependencyInjector, "getshared", NULL, 0, &_2$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(metaData, _1$$3); - if (Z_TYPE_P(metaData) != IS_OBJECT) { + ZEPHIR_CPY_WRT(&metaData, &_1$$3); + if (Z_TYPE_P(&metaData) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The injected service 'modelsMetadata' is not valid", "phalcon/mvc/model.zep", 233); return; } - zephir_update_property_this(getThis(), SL("_modelsMetaData"), metaData TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelsMetaData"), &metaData); } - RETURN_CCTOR(metaData); + RETURN_CCTOR(&metaData); } @@ -290,7 +319,8 @@ PHP_METHOD(Phalcon_Mvc_Model, getModelsMetaData) { */ PHP_METHOD(Phalcon_Mvc_Model, getModelsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_modelsManager"); @@ -337,13 +367,16 @@ PHP_METHOD(Phalcon_Mvc_Model, getModelsManager) { */ PHP_METHOD(Phalcon_Mvc_Model, setTransaction) { - zval *transaction; + zval *transaction, transaction_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&transaction_sub); zephir_fetch_params(0, 1, 0, &transaction); - zephir_update_property_this(getThis(), SL("_transaction"), transaction TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_transaction"), transaction); RETURN_THISW(); } @@ -354,26 +387,30 @@ PHP_METHOD(Phalcon_Mvc_Model, setTransaction) { PHP_METHOD(Phalcon_Mvc_Model, setSource) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *source_param = NULL, *_0; - zval *source = NULL; + zval *source_param = NULL, _0; + zval source; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &source_param); if (UNEXPECTED(Z_TYPE_P(source_param) != IS_STRING && Z_TYPE_P(source_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'source' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'source' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(source_param) == IS_STRING)) { - zephir_get_strval(source, source_param); + zephir_get_strval(&source, source_param); } else { - ZEPHIR_INIT_VAR(source); - ZVAL_EMPTY_STRING(source); + ZEPHIR_INIT_VAR(&source); + ZVAL_EMPTY_STRING(&source); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "setmodelsource", NULL, 0, this_ptr, source); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "setmodelsource", NULL, 0, this_ptr, &source); zephir_check_call_status(); RETURN_THIS(); @@ -384,13 +421,16 @@ PHP_METHOD(Phalcon_Mvc_Model, setSource) { */ PHP_METHOD(Phalcon_Mvc_Model, getSource) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getmodelsource", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getmodelsource", NULL, 0, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -402,26 +442,30 @@ PHP_METHOD(Phalcon_Mvc_Model, getSource) { PHP_METHOD(Phalcon_Mvc_Model, setSchema) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *schema_param = NULL, *_0; - zval *schema = NULL; + zval *schema_param = NULL, _0; + zval schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &schema_param); if (UNEXPECTED(Z_TYPE_P(schema_param) != IS_STRING && Z_TYPE_P(schema_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schema_param) == IS_STRING)) { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } else { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_EMPTY_STRING(&schema); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "setmodelschema", NULL, 0, this_ptr, schema); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "setmodelschema", NULL, 0, this_ptr, &schema); zephir_check_call_status(); RETURN_MM(); @@ -432,13 +476,16 @@ PHP_METHOD(Phalcon_Mvc_Model, setSchema) { */ PHP_METHOD(Phalcon_Mvc_Model, getSchema) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getmodelschema", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getmodelschema", NULL, 0, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -450,26 +497,30 @@ PHP_METHOD(Phalcon_Mvc_Model, getSchema) { PHP_METHOD(Phalcon_Mvc_Model, setConnectionService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *connectionService_param = NULL, *_0; - zval *connectionService = NULL; + zval *connectionService_param = NULL, _0; + zval connectionService; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&connectionService); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &connectionService_param); if (UNEXPECTED(Z_TYPE_P(connectionService_param) != IS_STRING && Z_TYPE_P(connectionService_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(connectionService_param) == IS_STRING)) { - zephir_get_strval(connectionService, connectionService_param); + zephir_get_strval(&connectionService, connectionService_param); } else { - ZEPHIR_INIT_VAR(connectionService); - ZVAL_EMPTY_STRING(connectionService); + ZEPHIR_INIT_VAR(&connectionService); + ZVAL_EMPTY_STRING(&connectionService); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "setconnectionservice", NULL, 0, this_ptr, connectionService); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "setconnectionservice", NULL, 0, this_ptr, &connectionService); zephir_check_call_status(); RETURN_THIS(); @@ -481,26 +532,30 @@ PHP_METHOD(Phalcon_Mvc_Model, setConnectionService) { PHP_METHOD(Phalcon_Mvc_Model, setReadConnectionService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *connectionService_param = NULL, *_0; - zval *connectionService = NULL; + zval *connectionService_param = NULL, _0; + zval connectionService; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&connectionService); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &connectionService_param); if (UNEXPECTED(Z_TYPE_P(connectionService_param) != IS_STRING && Z_TYPE_P(connectionService_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(connectionService_param) == IS_STRING)) { - zephir_get_strval(connectionService, connectionService_param); + zephir_get_strval(&connectionService, connectionService_param); } else { - ZEPHIR_INIT_VAR(connectionService); - ZVAL_EMPTY_STRING(connectionService); + ZEPHIR_INIT_VAR(&connectionService); + ZVAL_EMPTY_STRING(&connectionService); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "setreadconnectionservice", NULL, 0, this_ptr, connectionService); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "setreadconnectionservice", NULL, 0, this_ptr, &connectionService); zephir_check_call_status(); RETURN_THIS(); @@ -512,26 +567,30 @@ PHP_METHOD(Phalcon_Mvc_Model, setReadConnectionService) { PHP_METHOD(Phalcon_Mvc_Model, setWriteConnectionService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *connectionService_param = NULL, *_0; - zval *connectionService = NULL; + zval *connectionService_param = NULL, _0; + zval connectionService; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&connectionService); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &connectionService_param); if (UNEXPECTED(Z_TYPE_P(connectionService_param) != IS_STRING && Z_TYPE_P(connectionService_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(connectionService_param) == IS_STRING)) { - zephir_get_strval(connectionService, connectionService_param); + zephir_get_strval(&connectionService, connectionService_param); } else { - ZEPHIR_INIT_VAR(connectionService); - ZVAL_EMPTY_STRING(connectionService); + ZEPHIR_INIT_VAR(&connectionService); + ZVAL_EMPTY_STRING(&connectionService); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "setwriteconnectionservice", NULL, 0, this_ptr, connectionService); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "setwriteconnectionservice", NULL, 0, this_ptr, &connectionService); zephir_check_call_status(); RETURN_MM(); @@ -542,13 +601,16 @@ PHP_METHOD(Phalcon_Mvc_Model, setWriteConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Model, getReadConnectionService) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getreadconnectionservice", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getreadconnectionservice", NULL, 0, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -559,13 +621,16 @@ PHP_METHOD(Phalcon_Mvc_Model, getReadConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Model, getWriteConnectionService) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getwriteconnectionservice", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getwriteconnectionservice", NULL, 0, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -576,8 +641,11 @@ PHP_METHOD(Phalcon_Mvc_Model, getWriteConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Model, setDirtyState) { - zval *dirtyState_param = NULL, *_0; + zval *dirtyState_param = NULL, _0; zend_long dirtyState; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &dirtyState_param); @@ -585,8 +653,8 @@ PHP_METHOD(Phalcon_Mvc_Model, setDirtyState) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, dirtyState); - zephir_update_property_this(getThis(), SL("_dirtyState"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, dirtyState); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_0); RETURN_THISW(); } @@ -596,7 +664,8 @@ PHP_METHOD(Phalcon_Mvc_Model, setDirtyState) { */ PHP_METHOD(Phalcon_Mvc_Model, getDirtyState) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dirtyState"); @@ -607,20 +676,24 @@ PHP_METHOD(Phalcon_Mvc_Model, getDirtyState) { */ PHP_METHOD(Phalcon_Mvc_Model, getReadConnection) { - zval *transaction = NULL, *_0; + zval transaction, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&transaction); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_transaction"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(transaction, _0); - if (Z_TYPE_P(transaction) == IS_OBJECT) { - ZEPHIR_RETURN_CALL_METHOD(transaction, "getconnection", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_transaction"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&transaction, &_0); + if (Z_TYPE_P(&transaction) == IS_OBJECT) { + ZEPHIR_RETURN_CALL_METHOD(&transaction, "getconnection", NULL, 0); zephir_check_call_status(); RETURN_MM(); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getreadconnection", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getreadconnection", NULL, 0, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -631,20 +704,24 @@ PHP_METHOD(Phalcon_Mvc_Model, getReadConnection) { */ PHP_METHOD(Phalcon_Mvc_Model, getWriteConnection) { - zval *transaction = NULL, *_0; + zval transaction, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&transaction); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_transaction"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(transaction, _0); - if (Z_TYPE_P(transaction) == IS_OBJECT) { - ZEPHIR_RETURN_CALL_METHOD(transaction, "getconnection", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_transaction"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&transaction, &_0); + if (Z_TYPE_P(&transaction) == IS_OBJECT) { + ZEPHIR_RETURN_CALL_METHOD(&transaction, "getconnection", NULL, 0); zephir_check_call_status(); RETURN_MM(); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getwriteconnection", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getwriteconnection", NULL, 0, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -703,77 +780,103 @@ PHP_METHOD(Phalcon_Mvc_Model, getWriteConnection) { */ PHP_METHOD(Phalcon_Mvc_Model, assign) { - zend_bool _10$$16; - HashTable *_5, *_1$$3; - HashPosition _4, _0$$3; - zephir_fcall_cache_entry *_9 = NULL, *_12 = NULL; + zend_bool _8$$16; + zend_string *_2$$3; + zend_ulong _1$$3; + zephir_fcall_cache_entry *_7 = NULL, *_10 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *dataColumnMap = NULL, *whiteList = NULL, *key = NULL, *keyMapped = NULL, *value = NULL, *attribute = NULL, *attributeField = NULL, *metaData = NULL, *columnMap = NULL, *dataMapped = NULL, *disableAssignSetters = NULL, *_3 = NULL, **_6, **_2$$3, *_7$$13 = NULL, *_8$$13 = NULL, *_11$$16 = NULL; - zval *data = NULL; + zval *data_param = NULL, *dataColumnMap = NULL, dataColumnMap_sub, *whiteList = NULL, whiteList_sub, __$null, key, keyMapped, value, attribute, attributeField, metaData, columnMap, dataMapped, disableAssignSetters, _3, *_4, *_0$$3, _5$$13, _6$$13, _9$$16; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&dataColumnMap_sub); + ZVAL_UNDEF(&whiteList_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&keyMapped); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&attributeField); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&dataMapped); + ZVAL_UNDEF(&disableAssignSetters); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5$$13); + ZVAL_UNDEF(&_6$$13); + ZVAL_UNDEF(&_9$$16); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &data_param, &dataColumnMap, &whiteList); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); if (!dataColumnMap) { - dataColumnMap = ZEPHIR_GLOBAL(global_null); + dataColumnMap = &dataColumnMap_sub; + dataColumnMap = &__$null; } if (!whiteList) { - whiteList = ZEPHIR_GLOBAL(global_null); + whiteList = &whiteList_sub; + whiteList = &__$null; } - ZEPHIR_INIT_VAR(disableAssignSetters); - ZVAL_BOOL(disableAssignSetters, ZEPHIR_GLOBAL(orm).disable_assign_setters); + ZEPHIR_INIT_VAR(&disableAssignSetters); + ZVAL_BOOL(&disableAssignSetters, ZEPHIR_GLOBAL(orm).disable_assign_setters); if (Z_TYPE_P(dataColumnMap) == IS_ARRAY) { - ZEPHIR_INIT_VAR(dataMapped); - array_init(dataMapped); - zephir_is_iterable(data, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model.zep", 484); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(value, _2$$3); - ZEPHIR_OBS_NVAR(keyMapped); - if (zephir_array_isset_fetch(&keyMapped, dataColumnMap, key, 0 TSRMLS_CC)) { - zephir_array_update_zval(&dataMapped, keyMapped, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&dataMapped); + array_init(&dataMapped); + zephir_is_iterable(&data, 0, "phalcon/mvc/model.zep", 484); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&key, _2$$3); + } else { + ZVAL_LONG(&key, _1$$3); } - } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0$$3); + ZEPHIR_OBS_NVAR(&keyMapped); + if (zephir_array_isset_fetch(&keyMapped, dataColumnMap, &key, 0 TSRMLS_CC)) { + zephir_array_update_zval(&dataMapped, &keyMapped, &value, PH_COPY | PH_SEPARATE); + } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } else { - ZEPHIR_CPY_WRT(dataMapped, data); + ZEPHIR_CPY_WRT(&dataMapped, &data); } - if (zephir_fast_count_int(dataMapped TSRMLS_CC) == 0) { + if (zephir_fast_count_int(&dataMapped TSRMLS_CC) == 0) { RETURN_THIS(); } ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); if (ZEPHIR_GLOBAL(orm).column_renaming) { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getcolumnmap", NULL, 0, this_ptr); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); - } - ZEPHIR_CALL_METHOD(&_3, metaData, "getattributes", NULL, 0, this_ptr); - zephir_check_call_status(); - zephir_is_iterable(_3, &_5, &_4, 0, 0, "phalcon/mvc/model.zep", 533); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(attribute, _6); - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, attribute, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); + } + ZEPHIR_CALL_METHOD(&_3, &metaData, "getattributes", NULL, 0, this_ptr); + zephir_check_call_status(); + zephir_is_iterable(&_3, 0, "phalcon/mvc/model.zep", 533); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3), _4) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _4); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &attribute, 0 TSRMLS_CC))) { if (!(ZEPHIR_GLOBAL(orm).ignore_unknown_columns)) { - ZEPHIR_INIT_NVAR(_7$$13); - object_init_ex(_7$$13, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_8$$13); - ZEPHIR_CONCAT_SVS(_8$$13, "Column '", attribute, "' doesn\\'t make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _7$$13, "__construct", &_9, 9, _8$$13); + ZEPHIR_INIT_NVAR(&_5$$13); + object_init_ex(&_5$$13, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_6$$13); + ZEPHIR_CONCAT_SVS(&_6$$13, "Column '", &attribute, "' doesn\\'t make part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_5$$13, "__construct", &_7, 4, &_6$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$13, "phalcon/mvc/model.zep", 506 TSRMLS_CC); + zephir_throw_exception_debug(&_5$$13, "phalcon/mvc/model.zep", 506 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } else { @@ -781,26 +884,27 @@ PHP_METHOD(Phalcon_Mvc_Model, assign) { } } } else { - ZEPHIR_CPY_WRT(attributeField, attribute); + ZEPHIR_CPY_WRT(&attributeField, &attribute); } - ZEPHIR_OBS_NVAR(value); - if (zephir_array_isset_fetch(&value, dataMapped, attributeField, 0 TSRMLS_CC)) { + ZEPHIR_OBS_NVAR(&value); + if (zephir_array_isset_fetch(&value, &dataMapped, &attributeField, 0 TSRMLS_CC)) { if (Z_TYPE_P(whiteList) == IS_ARRAY) { - if (!(zephir_fast_in_array(attributeField, whiteList TSRMLS_CC))) { + if (!(zephir_fast_in_array(&attributeField, whiteList TSRMLS_CC))) { continue; } } - _10$$16 = zephir_is_true(disableAssignSetters); - if (!(_10$$16)) { - ZEPHIR_CALL_METHOD(&_11$$16, this_ptr, "_possiblesetter", &_12, 330, attributeField, value); + _8$$16 = zephir_is_true(&disableAssignSetters); + if (!(_8$$16)) { + ZEPHIR_CALL_METHOD(&_9$$16, this_ptr, "_possiblesetter", &_10, 290, &attributeField, &value); zephir_check_call_status(); - _10$$16 = !zephir_is_true(_11$$16); + _8$$16 = !zephir_is_true(&_9$$16); } - if (_10$$16) { - zephir_update_property_zval_zval(getThis(), attributeField, value TSRMLS_CC); + if (_8$$16) { + zephir_update_property_zval_zval(this_ptr, &attributeField, &value TSRMLS_CC); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); RETURN_THIS(); } @@ -827,18 +931,36 @@ PHP_METHOD(Phalcon_Mvc_Model, assign) { */ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) { - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zephir_fcall_cache_entry *_6 = NULL, *_10 = NULL; zend_bool keepSnapshots, _7$$4; zend_long dirtyState, ZEPHIR_LAST_CALL_STATUS; - zval *data = NULL; - zval *base, *data_param = NULL, *columnMap, *dirtyState_param = NULL, *keepSnapshots_param = NULL, *instance = NULL, *attribute = NULL, *key = NULL, *value = NULL, *castValue = NULL, *attributeName = NULL, *_0, **_3, *_4$$7 = NULL, *_5$$7 = NULL, *_8$$10, _9$$11 = zval_used_for_init, *_11$$15, *_12$$19; + zval data; + zval *base, base_sub, *data_param = NULL, *columnMap, columnMap_sub, *dirtyState_param = NULL, *keepSnapshots_param = NULL, instance, attribute, key, value, castValue, attributeName, _0, *_1, _4$$7, _5$$7, _8$$10, _9$$11, _11$$15, _12$$19; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&base_sub); + ZVAL_UNDEF(&columnMap_sub); + ZVAL_UNDEF(&instance); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&castValue); + ZVAL_UNDEF(&attributeName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_8$$10); + ZVAL_UNDEF(&_9$$11); + ZVAL_UNDEF(&_11$$15); + ZVAL_UNDEF(&_12$$19); + ZVAL_UNDEF(&data); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 2, &base, &data_param, &columnMap, &dirtyState_param, &keepSnapshots_param); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); if (!dirtyState_param) { dirtyState = 0; } else { @@ -851,106 +973,109 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) { } - ZEPHIR_INIT_VAR(instance); - if (zephir_clone(instance, base TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&instance); + if (zephir_clone(&instance, base TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, dirtyState); - ZEPHIR_CALL_METHOD(NULL, instance, "setdirtystate", NULL, 0, _0); - zephir_check_call_status(); - zephir_is_iterable(data, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 635); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(key, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); - if (Z_TYPE_P(key) == IS_STRING) { + ZVAL_LONG(&_0, dirtyState); + ZEPHIR_CALL_METHOD(NULL, &instance, "setdirtystate", NULL, 0, &_0); + zephir_check_call_status(); + zephir_is_iterable(&data, 0, "phalcon/mvc/model.zep", 635); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + if (Z_TYPE_P(&key) == IS_STRING) { if (Z_TYPE_P(columnMap) != IS_ARRAY) { - zephir_update_property_zval_zval(instance, key, value TSRMLS_CC); + zephir_update_property_zval_zval(&instance, &key, &value TSRMLS_CC); continue; } - ZEPHIR_OBS_NVAR(attribute); - if (!(zephir_array_isset_fetch(&attribute, columnMap, key, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&attribute); + if (!(zephir_array_isset_fetch(&attribute, columnMap, &key, 0 TSRMLS_CC))) { if (!(ZEPHIR_GLOBAL(orm).ignore_unknown_columns)) { - ZEPHIR_INIT_NVAR(_4$$7); - object_init_ex(_4$$7, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_4$$7); + object_init_ex(&_4$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_5$$7); - ZEPHIR_CONCAT_SVS(_5$$7, "Column '", key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _4$$7, "__construct", &_6, 9, _5$$7); + ZEPHIR_CONCAT_SVS(&_5$$7, "Column '", &key, "' doesn't make part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_4$$7, "__construct", &_6, 4, &_5$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$7, "phalcon/mvc/model.zep", 578 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$7, "phalcon/mvc/model.zep", 578 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } else { continue; } } - if (Z_TYPE_P(attribute) != IS_ARRAY) { - zephir_update_property_zval_zval(instance, attribute, value TSRMLS_CC); + if (Z_TYPE_P(&attribute) != IS_ARRAY) { + zephir_update_property_zval_zval(&instance, &attribute, &value TSRMLS_CC); continue; } - _7$$4 = !ZEPHIR_IS_STRING(value, ""); + _7$$4 = !ZEPHIR_IS_STRING(&value, ""); if (_7$$4) { - _7$$4 = Z_TYPE_P(value) != IS_NULL; + _7$$4 = Z_TYPE_P(&value) != IS_NULL; } if (_7$$4) { - zephir_array_fetch_long(&_8$$10, attribute, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 590 TSRMLS_CC); + zephir_array_fetch_long(&_8$$10, &attribute, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 590 TSRMLS_CC); do { - if (ZEPHIR_IS_LONG(_8$$10, 0)) { - ZEPHIR_SINIT_NVAR(_9$$11); + if (ZEPHIR_IS_LONG(&_8$$10, 0)) { ZVAL_LONG(&_9$$11, 10); - ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_10, 39, value, &_9$$11); + ZEPHIR_CALL_FUNCTION(&castValue, "intval", &_10, 33, &value, &_9$$11); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(_8$$10, 9) || ZEPHIR_IS_LONG(_8$$10, 3) || ZEPHIR_IS_LONG(_8$$10, 7)) { - ZEPHIR_INIT_NVAR(castValue); - ZVAL_DOUBLE(castValue, zephir_get_doubleval(value)); + if (ZEPHIR_IS_LONG(&_8$$10, 9) || ZEPHIR_IS_LONG(&_8$$10, 3) || ZEPHIR_IS_LONG(&_8$$10, 7)) { + ZEPHIR_INIT_NVAR(&castValue); + ZVAL_DOUBLE(&castValue, zephir_get_doubleval(&value)); break; } - if (ZEPHIR_IS_LONG(_8$$10, 8)) { - ZEPHIR_INIT_NVAR(castValue); - ZVAL_BOOL(castValue, zephir_get_boolval(value)); + if (ZEPHIR_IS_LONG(&_8$$10, 8)) { + ZEPHIR_INIT_NVAR(&castValue); + ZVAL_BOOL(&castValue, zephir_get_boolval(&value)); break; } - ZEPHIR_CPY_WRT(castValue, value); + ZEPHIR_CPY_WRT(&castValue, &value); break; } while(0); } else { - zephir_array_fetch_long(&_11$$15, attribute, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 611 TSRMLS_CC); + zephir_array_fetch_long(&_11$$15, &attribute, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 611 TSRMLS_CC); do { - if (ZEPHIR_IS_LONG(_11$$15, 0) || ZEPHIR_IS_LONG(_11$$15, 9) || ZEPHIR_IS_LONG(_11$$15, 3) || ZEPHIR_IS_LONG(_11$$15, 7) || ZEPHIR_IS_LONG(_11$$15, 8)) { - ZEPHIR_INIT_NVAR(castValue); - ZVAL_NULL(castValue); + if (ZEPHIR_IS_LONG(&_11$$15, 0) || ZEPHIR_IS_LONG(&_11$$15, 9) || ZEPHIR_IS_LONG(&_11$$15, 3) || ZEPHIR_IS_LONG(&_11$$15, 7) || ZEPHIR_IS_LONG(&_11$$15, 8)) { + ZEPHIR_INIT_NVAR(&castValue); + ZVAL_NULL(&castValue); break; } - ZEPHIR_CPY_WRT(castValue, value); + ZEPHIR_CPY_WRT(&castValue, &value); break; } while(0); } - ZEPHIR_OBS_NVAR(attributeName); - zephir_array_fetch_long(&attributeName, attribute, 0, PH_NOISY, "phalcon/mvc/model.zep", 627 TSRMLS_CC); - zephir_update_property_zval_zval(instance, attributeName, castValue TSRMLS_CC); + ZEPHIR_OBS_NVAR(&attributeName); + zephir_array_fetch_long(&attributeName, &attribute, 0, PH_NOISY, "phalcon/mvc/model.zep", 627 TSRMLS_CC); + zephir_update_property_zval_zval(&instance, &attributeName, &castValue TSRMLS_CC); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); if (keepSnapshots) { - ZEPHIR_CALL_METHOD(NULL, instance, "setsnapshotdata", NULL, 0, data, columnMap); + ZEPHIR_CALL_METHOD(NULL, &instance, "setsnapshotdata", NULL, 0, &data, columnMap); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, instance, "setoldsnapshotdata", NULL, 0, data, columnMap); + ZEPHIR_CALL_METHOD(NULL, &instance, "setoldsnapshotdata", NULL, 0, &data, columnMap); zephir_check_call_status(); } - if ((zephir_method_exists_ex(instance, SS("fireevent") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_VAR(_12$$19); - ZVAL_STRING(_12$$19, "afterFetch", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, instance, "fireevent", NULL, 0, _12$$19); - zephir_check_temp_parameter(_12$$19); + if ((zephir_method_exists_ex(&instance, SL("fireevent") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_INIT_VAR(&_12$$19); + ZVAL_STRING(&_12$$19, "afterFetch"); + ZEPHIR_CALL_METHOD(NULL, &instance, "fireevent", NULL, 0, &_12$$19); zephir_check_call_status(); } - RETURN_CCTOR(instance); + RETURN_CCTOR(&instance); } @@ -964,82 +1089,100 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMap) { */ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) { - HashTable *_1; - HashPosition _0; + zend_string *_2; + zend_ulong _1; zephir_fcall_cache_entry *_5 = NULL; zend_long hydrationMode, ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *columnMap, *hydrationMode_param = NULL, *hydrateArray = NULL, *hydrateObject = NULL, *key = NULL, *value = NULL, *attribute = NULL, *attributeName = NULL, **_2, *_3$$11 = NULL, *_4$$11 = NULL; - zval *data = NULL; + zval *data_param = NULL, *columnMap, columnMap_sub, *hydrationMode_param = NULL, hydrateArray, hydrateObject, key, value, attribute, attributeName, *_0, _3$$11, _4$$11; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&columnMap_sub); + ZVAL_UNDEF(&hydrateArray); + ZVAL_UNDEF(&hydrateObject); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&attributeName); + ZVAL_UNDEF(&_3$$11); + ZVAL_UNDEF(&_4$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &data_param, &columnMap, &hydrationMode_param); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); hydrationMode = zephir_get_intval(hydrationMode_param); if (Z_TYPE_P(columnMap) != IS_ARRAY) { if (hydrationMode == 1) { - RETURN_CTOR(data); + RETURN_CTOR(&data); } } if (hydrationMode == 1) { - ZEPHIR_INIT_VAR(hydrateArray); - array_init(hydrateArray); + ZEPHIR_INIT_VAR(&hydrateArray); + array_init(&hydrateArray); } else { - ZEPHIR_INIT_VAR(hydrateObject); - object_init(hydrateObject); - } - zephir_is_iterable(data, &_1, &_0, 0, 0, "phalcon/mvc/model.zep", 721); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(key, _1, _0); - ZEPHIR_GET_HVALUE(value, _2); - if (Z_TYPE_P(key) != IS_STRING) { + ZEPHIR_INIT_VAR(&hydrateObject); + object_init(&hydrateObject); + } + zephir_is_iterable(&data, 0, "phalcon/mvc/model.zep", 721); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&key); + if (_2 != NULL) { + ZVAL_STR_COPY(&key, _2); + } else { + ZVAL_LONG(&key, _1); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + if (Z_TYPE_P(&key) != IS_STRING) { continue; } if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attribute); - if (!(zephir_array_isset_fetch(&attribute, columnMap, key, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&attribute); + if (!(zephir_array_isset_fetch(&attribute, columnMap, &key, 0 TSRMLS_CC))) { if (!(ZEPHIR_GLOBAL(orm).ignore_unknown_columns)) { - ZEPHIR_INIT_NVAR(_3$$11); - object_init_ex(_3$$11, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_3$$11); + object_init_ex(&_3$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_4$$11); - ZEPHIR_CONCAT_SVS(_4$$11, "Column '", key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _3$$11, "__construct", &_5, 9, _4$$11); + ZEPHIR_CONCAT_SVS(&_4$$11, "Column '", &key, "' doesn't make part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_3$$11, "__construct", &_5, 4, &_4$$11); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$11, "phalcon/mvc/model.zep", 692 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$11, "phalcon/mvc/model.zep", 692 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } else { continue; } } - if (Z_TYPE_P(attribute) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeName); - zephir_array_fetch_long(&attributeName, attribute, 0, PH_NOISY, "phalcon/mvc/model.zep", 702 TSRMLS_CC); + if (Z_TYPE_P(&attribute) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeName); + zephir_array_fetch_long(&attributeName, &attribute, 0, PH_NOISY, "phalcon/mvc/model.zep", 702 TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(attributeName, attribute); + ZEPHIR_CPY_WRT(&attributeName, &attribute); } if (hydrationMode == 1) { - zephir_array_update_zval(&hydrateArray, attributeName, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&hydrateArray, &attributeName, &value, PH_COPY | PH_SEPARATE); } else { - zephir_update_property_zval_zval(hydrateObject, attributeName, value TSRMLS_CC); + zephir_update_property_zval_zval(&hydrateObject, &attributeName, &value TSRMLS_CC); } } else { if (hydrationMode == 1) { - zephir_array_update_zval(&hydrateArray, key, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&hydrateArray, &key, &value, PH_COPY | PH_SEPARATE); } else { - zephir_update_property_zval_zval(hydrateObject, key, value TSRMLS_CC); + zephir_update_property_zval_zval(&hydrateObject, &key, &value TSRMLS_CC); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); if (hydrationMode == 1) { - RETURN_CCTOR(hydrateArray); + RETURN_CCTOR(&hydrateArray); } - RETURN_CCTOR(hydrateObject); + RETURN_CCTOR(&hydrateObject); } @@ -1064,16 +1207,25 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResultMapHydrate) { */ PHP_METHOD(Phalcon_Mvc_Model, cloneResult) { - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zend_long dirtyState, ZEPHIR_LAST_CALL_STATUS; - zval *data = NULL; - zval *base, *data_param = NULL, *dirtyState_param = NULL, *instance = NULL, *key = NULL, *value = NULL, *_0 = NULL, **_3; + zval data; + zval *base, base_sub, *data_param = NULL, *dirtyState_param = NULL, instance, key, value, _0, *_1, _4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&base_sub); + ZVAL_UNDEF(&instance); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&data); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &base, &data_param, &dirtyState_param); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); if (!dirtyState_param) { dirtyState = 0; } else { @@ -1081,33 +1233,37 @@ PHP_METHOD(Phalcon_Mvc_Model, cloneResult) { } - ZEPHIR_INIT_VAR(instance); - if (zephir_clone(instance, base TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&instance); + if (zephir_clone(&instance, base TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, dirtyState); - ZEPHIR_CALL_METHOD(NULL, instance, "setdirtystate", NULL, 0, _0); - zephir_check_call_status(); - zephir_is_iterable(data, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 771); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(key, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); - if (Z_TYPE_P(key) != IS_STRING) { + ZVAL_LONG(&_0, dirtyState); + ZEPHIR_CALL_METHOD(NULL, &instance, "setdirtystate", NULL, 0, &_0); + zephir_check_call_status(); + zephir_is_iterable(&data, 0, "phalcon/mvc/model.zep", 771); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&key); + if (_3 != NULL) { + ZVAL_STR_COPY(&key, _3); + } else { + ZVAL_LONG(&key, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + if (Z_TYPE_P(&key) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid key in array data provided to dumpResult()", "phalcon/mvc/model.zep", 763); return; } - zephir_update_property_zval_zval(instance, key, value TSRMLS_CC); - } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "afterFetch", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, instance, "fireevent", NULL, 0, _0); - zephir_check_temp_parameter(_0); + zephir_update_property_zval_zval(&instance, &key, &value TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "afterFetch"); + ZEPHIR_CALL_METHOD(NULL, &instance, "fireevent", NULL, 0, &_4); zephir_check_call_status(); - RETURN_CCTOR(instance); + RETURN_CCTOR(&instance); } @@ -1212,37 +1368,46 @@ PHP_METHOD(Phalcon_Mvc_Model, find) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters = NULL, *params = NULL, *query = NULL, *resultset = NULL, *hydration = NULL; + zval *parameters = NULL, parameters_sub, __$null, params, query, resultset, hydration; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&resultset); + ZVAL_UNDEF(&hydration); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - array_init(params); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); if (Z_TYPE_P(parameters) != IS_NULL) { zephir_array_append(¶ms, parameters, PH_SEPARATE, "phalcon/mvc/model.zep", 880); } } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_0, 331, params); + ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_0, 291, ¶ms); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&resultset, query, "execute", NULL, 0); + ZEPHIR_CALL_METHOD(&resultset, &query, "execute", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(resultset) == IS_OBJECT) { - ZEPHIR_OBS_VAR(hydration); - if (zephir_array_isset_string_fetch(&hydration, params, SS("hydration"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, resultset, "sethydratemode", NULL, 0, hydration); + if (Z_TYPE_P(&resultset) == IS_OBJECT) { + ZEPHIR_OBS_VAR(&hydration); + if (zephir_array_isset_string_fetch(&hydration, ¶ms, SL("hydration"), 0)) { + ZEPHIR_CALL_METHOD(NULL, &resultset, "sethydratemode", NULL, 0, &hydration); zephir_check_call_status(); } } - RETURN_CCTOR(resultset); + RETURN_CCTOR(&resultset); } @@ -1293,34 +1458,40 @@ PHP_METHOD(Phalcon_Mvc_Model, findFirst) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters = NULL, *params = NULL, *query = NULL, *_1 = NULL; + zval *parameters = NULL, parameters_sub, __$null, params, query, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - array_init(params); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); if (Z_TYPE_P(parameters) != IS_NULL) { zephir_array_append(¶ms, parameters, PH_SEPARATE, "phalcon/mvc/model.zep", 955); } } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 1); - ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_0, 331, params, _1); + ZVAL_LONG(&_1, 1); + ZEPHIR_CALL_STATIC(&query, "getpreparedquery", &_0, 291, ¶ms, &_1); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_1); - ZVAL_BOOL(_1, 1); - ZEPHIR_CALL_METHOD(NULL, query, "setuniquerow", NULL, 0, _1); + ZVAL_BOOL(&_1, 1); + ZEPHIR_CALL_METHOD(NULL, &query, "setuniquerow", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(query, "execute", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&query, "execute", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -1333,67 +1504,82 @@ PHP_METHOD(Phalcon_Mvc_Model, getPreparedQuery) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *params, *limit = NULL, *builder = NULL, *bindParams = NULL, *bindTypes = NULL, *transaction = NULL, *cache = NULL, *manager = NULL, *query = NULL, *dependencyInjector = NULL, *_1 = NULL, *_2 = NULL, *_3$$5, *_4$$7; + zval *params, params_sub, *limit = NULL, limit_sub, __$null, builder, bindParams, bindTypes, transaction, cache, manager, query, dependencyInjector, _1, _2, _3$$5, _4$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶ms_sub); + ZVAL_UNDEF(&limit_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&builder); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(&transaction); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, ¶ms, &limit); if (!limit) { - limit = ZEPHIR_GLOBAL(global_null); + limit = &limit_sub; + limit = &__$null; } - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "modelsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "getshared", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "modelsManager"); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "getshared", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_CPY_WRT(manager, _1); - ZEPHIR_CALL_METHOD(&builder, manager, "createbuilder", NULL, 0, params); + ZEPHIR_CPY_WRT(&manager, &_1); + ZEPHIR_CALL_METHOD(&builder, &manager, "createbuilder", NULL, 0, params); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_2); - zephir_get_called_class(_2 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, builder, "from", NULL, 0, _2); + ZEPHIR_INIT_NVAR(&_2); + zephir_get_called_class(&_2 TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &builder, "from", NULL, 0, &_2); zephir_check_call_status(); if (Z_TYPE_P(limit) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, builder, "limit", NULL, 0, limit); + ZEPHIR_CALL_METHOD(NULL, &builder, "limit", NULL, 0, limit); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&query, builder, "getquery", NULL, 0); + ZEPHIR_CALL_METHOD(&query, &builder, "getquery", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(bindParams); - if (zephir_array_isset_string_fetch(&bindParams, params, SS("bind"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(bindParams) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_3$$5); - ZVAL_BOOL(_3$$5, 1); - ZEPHIR_CALL_METHOD(NULL, query, "setbindparams", NULL, 0, bindParams, _3$$5); + ZEPHIR_OBS_VAR(&bindParams); + if (zephir_array_isset_string_fetch(&bindParams, params, SL("bind"), 0)) { + if (Z_TYPE_P(&bindParams) == IS_ARRAY) { + ZVAL_BOOL(&_3$$5, 1); + ZEPHIR_CALL_METHOD(NULL, &query, "setbindparams", NULL, 0, &bindParams, &_3$$5); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(bindTypes); - if (zephir_array_isset_string_fetch(&bindTypes, params, SS("bindTypes"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(bindTypes) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_4$$7); - ZVAL_BOOL(_4$$7, 1); - ZEPHIR_CALL_METHOD(NULL, query, "setbindtypes", NULL, 0, bindTypes, _4$$7); + ZEPHIR_OBS_VAR(&bindTypes); + if (zephir_array_isset_string_fetch(&bindTypes, params, SL("bindTypes"), 0)) { + if (Z_TYPE_P(&bindTypes) == IS_ARRAY) { + ZVAL_BOOL(&_4$$7, 1); + ZEPHIR_CALL_METHOD(NULL, &query, "setbindtypes", NULL, 0, &bindTypes, &_4$$7); zephir_check_call_status(); } } } - ZEPHIR_OBS_VAR(transaction); - if (zephir_array_isset_string_fetch(&transaction, params, SS("transaction"), 0 TSRMLS_CC)) { - if (zephir_instance_of_ev(transaction, phalcon_mvc_model_transactioninterface_ce TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, query, "settransaction", NULL, 0, transaction); + ZEPHIR_OBS_VAR(&transaction); + if (zephir_array_isset_string_fetch(&transaction, params, SL("transaction"), 0)) { + if (zephir_instance_of_ev(&transaction, phalcon_mvc_model_transactioninterface_ce TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &query, "settransaction", NULL, 0, &transaction); zephir_check_call_status(); } } - ZEPHIR_OBS_VAR(cache); - if (zephir_array_isset_string_fetch(&cache, params, SS("cache"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, query, "cache", NULL, 0, cache); + ZEPHIR_OBS_VAR(&cache); + if (zephir_array_isset_string_fetch(&cache, params, SL("cache"), 0)) { + ZEPHIR_CALL_METHOD(NULL, &query, "cache", NULL, 0, &cache); zephir_check_call_status(); } - RETURN_CCTOR(query); + RETURN_CCTOR(&query); } @@ -1404,44 +1590,52 @@ PHP_METHOD(Phalcon_Mvc_Model, query) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *dependencyInjector = NULL, *criteria = NULL, *_3, *_1$$4 = NULL, *_2$$4; + zval *dependencyInjector = NULL, dependencyInjector_sub, __$null, criteria, _3, _1$$4, _2$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&criteria); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &dependencyInjector); if (!dependencyInjector) { - ZEPHIR_CPY_WRT(dependencyInjector, ZEPHIR_GLOBAL(global_null)); + dependencyInjector = &dependencyInjector_sub; + ZEPHIR_CPY_WRT(dependencyInjector, &__$null); } else { ZEPHIR_SEPARATE_PARAM(dependencyInjector); } if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_CALL_CE_STATIC(dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(criteria); + ZEPHIR_INIT_VAR(&criteria); if (zephir_instance_of_ev(dependencyInjector, phalcon_diinterface_ce TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_STRING(_2$$4, "Phalcon\\Mvc\\Model\\Criteria", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$4, dependencyInjector, "get", NULL, 0, _2$$4); - zephir_check_temp_parameter(_2$$4); + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, "Phalcon\\Mvc\\Model\\Criteria"); + ZEPHIR_CALL_METHOD(&_1$$4, dependencyInjector, "get", NULL, 0, &_2$$4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(criteria, _1$$4); + ZEPHIR_CPY_WRT(&criteria, &_1$$4); } else { - object_init_ex(criteria, phalcon_mvc_model_criteria_ce); - if (zephir_has_constructor(criteria TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, criteria, "__construct", NULL, 0); + object_init_ex(&criteria, phalcon_mvc_model_criteria_ce); + if (zephir_has_constructor(&criteria TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &criteria, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, criteria, "setdi", NULL, 332, dependencyInjector); + ZEPHIR_CALL_METHOD(NULL, &criteria, "setdi", NULL, 292, dependencyInjector); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_3); - zephir_get_called_class(_3 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, criteria, "setmodelname", NULL, 333, _3); + ZEPHIR_INIT_VAR(&_3); + zephir_get_called_class(&_3 TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &criteria, "setmodelname", NULL, 293, &_3); zephir_check_call_status(); - RETURN_CCTOR(criteria); + RETURN_CCTOR(&criteria); } @@ -1455,35 +1649,68 @@ PHP_METHOD(Phalcon_Mvc_Model, query) { */ PHP_METHOD(Phalcon_Mvc_Model, _exists) { - zend_bool _6$$11; - HashTable *_1$$3; - HashPosition _0$$3; - zephir_fcall_cache_entry *_5 = NULL, *_10 = NULL; + zend_bool _4$$11; + zephir_fcall_cache_entry *_3 = NULL, *_8 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, numberEmpty = 0, numberPrimary = 0; - zval *metaData, *connection, *table = NULL, *uniqueParams = NULL, *uniqueTypes = NULL, *uniqueKey = NULL, *columnMap = NULL, *primaryKeys = NULL, *wherePk = NULL, *field = NULL, *attributeField = NULL, *value = NULL, *bindDataTypes = NULL, *joinWhere = NULL, *num = NULL, *type = NULL, *schema = NULL, *source = NULL, *_12, *_13 = NULL, *_14, *_15, *_16, **_2$$3, *_3$$9 = NULL, *_4$$9 = NULL, *_7$$14 = NULL, *_8$$14 = NULL, *_9$$7 = NULL, *_11$$7 = NULL, *_17$$22, *_18$$23; + zval *metaData, metaData_sub, *connection, connection_sub, *table = NULL, table_sub, __$null, uniqueParams, uniqueTypes, uniqueKey, columnMap, primaryKeys, wherePk, field, attributeField, value, bindDataTypes, joinWhere, num, type, schema, source, _10, _11, _12, _13, _14, *_0$$3, _1$$9, _2$$9, _5$$14, _6$$14, _7$$7, _9$$7, _15$$22, _16$$23; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&metaData_sub); + ZVAL_UNDEF(&connection_sub); + ZVAL_UNDEF(&table_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&uniqueParams); + ZVAL_UNDEF(&uniqueTypes); + ZVAL_UNDEF(&uniqueKey); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&primaryKeys); + ZVAL_UNDEF(&wherePk); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&attributeField); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&bindDataTypes); + ZVAL_UNDEF(&joinWhere); + ZVAL_UNDEF(&num); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_1$$9); + ZVAL_UNDEF(&_2$$9); + ZVAL_UNDEF(&_5$$14); + ZVAL_UNDEF(&_6$$14); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_15$$22); + ZVAL_UNDEF(&_16$$23); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &metaData, &connection, &table); if (!table) { - ZEPHIR_CPY_WRT(table, ZEPHIR_GLOBAL(global_null)); + table = &table_sub; + ZEPHIR_CPY_WRT(table, &__$null); } else { ZEPHIR_SEPARATE_PARAM(table); } - ZEPHIR_INIT_VAR(uniqueParams); - ZVAL_NULL(uniqueParams); - ZEPHIR_INIT_VAR(uniqueTypes); - ZVAL_NULL(uniqueTypes); - ZEPHIR_OBS_VAR(uniqueKey); - zephir_read_property_this(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); - if (Z_TYPE_P(uniqueKey) == IS_NULL) { + ZEPHIR_INIT_VAR(&uniqueParams); + ZVAL_NULL(&uniqueParams); + ZEPHIR_INIT_VAR(&uniqueTypes); + ZVAL_NULL(&uniqueTypes); + ZEPHIR_OBS_VAR(&uniqueKey); + zephir_read_property(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); + if (Z_TYPE_P(&uniqueKey) == IS_NULL) { ZEPHIR_CALL_METHOD(&primaryKeys, metaData, "getprimarykeyattributes", NULL, 0, this_ptr); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&bindDataTypes, metaData, "getbindtypes", NULL, 0, this_ptr); zephir_check_call_status(); - numberPrimary = zephir_fast_count_int(primaryKeys TSRMLS_CC); + numberPrimary = zephir_fast_count_int(&primaryKeys TSRMLS_CC); if (!(numberPrimary)) { RETURN_MM_BOOL(0); } @@ -1491,129 +1718,128 @@ PHP_METHOD(Phalcon_Mvc_Model, _exists) { ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, this_ptr); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } numberEmpty = 0; - ZEPHIR_INIT_VAR(wherePk); - array_init(wherePk); - ZEPHIR_INIT_NVAR(uniqueParams); - array_init(uniqueParams); - ZEPHIR_INIT_NVAR(uniqueTypes); - array_init(uniqueTypes); - zephir_is_iterable(primaryKeys, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model.zep", 1144); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(field, _2$$3); - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_3$$9); - object_init_ex(_3$$9, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_4$$9); - ZEPHIR_CONCAT_SVS(_4$$9, "Column '", field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _3$$9, "__construct", &_5, 9, _4$$9); + ZEPHIR_INIT_VAR(&wherePk); + array_init(&wherePk); + ZEPHIR_INIT_NVAR(&uniqueParams); + array_init(&uniqueParams); + ZEPHIR_INIT_NVAR(&uniqueTypes); + array_init(&uniqueTypes); + zephir_is_iterable(&primaryKeys, 0, "phalcon/mvc/model.zep", 1144); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&primaryKeys), _0$$3) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _0$$3); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_1$$9); + object_init_ex(&_1$$9, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_2$$9); + ZEPHIR_CONCAT_SVS(&_2$$9, "Column '", &field, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_1$$9, "__construct", &_3, 4, &_2$$9); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$9, "phalcon/mvc/model.zep", 1108 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$9, "phalcon/mvc/model.zep", 1108 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeField, field); + ZEPHIR_CPY_WRT(&attributeField, &field); } - ZEPHIR_INIT_NVAR(value); - ZVAL_NULL(value); - ZEPHIR_OBS_NVAR(value); - if (zephir_fetch_property_zval(&value, this_ptr, attributeField, PH_SILENT_CC)) { - _6$$11 = Z_TYPE_P(value) == IS_NULL; - if (!(_6$$11)) { - _6$$11 = ZEPHIR_IS_STRING_IDENTICAL(value, ""); + ZEPHIR_INIT_NVAR(&value); + ZVAL_NULL(&value); + ZEPHIR_OBS_NVAR(&value); + if (zephir_fetch_property_zval(&value, this_ptr, &attributeField, PH_SILENT_CC)) { + _4$$11 = Z_TYPE_P(&value) == IS_NULL; + if (!(_4$$11)) { + _4$$11 = ZEPHIR_IS_STRING_IDENTICAL(&value, ""); } - if (_6$$11) { + if (_4$$11) { numberEmpty++; } - zephir_array_append(&uniqueParams, value, PH_SEPARATE, "phalcon/mvc/model.zep", 1126); + zephir_array_append(&uniqueParams, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 1126); } else { - zephir_array_append(&uniqueParams, ZEPHIR_GLOBAL(global_null), PH_SEPARATE, "phalcon/mvc/model.zep", 1129); + zephir_array_append(&uniqueParams, &__$null, PH_SEPARATE, "phalcon/mvc/model.zep", 1129); numberEmpty++; } - ZEPHIR_OBS_NVAR(type); - if (!(zephir_array_isset_fetch(&type, bindDataTypes, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_7$$14); - object_init_ex(_7$$14, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_8$$14); - ZEPHIR_CONCAT_SVS(_8$$14, "Column '", field, "' isn't part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, _7$$14, "__construct", &_5, 9, _8$$14); + ZEPHIR_OBS_NVAR(&type); + if (!(zephir_array_isset_fetch(&type, &bindDataTypes, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_5$$14); + object_init_ex(&_5$$14, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_6$$14); + ZEPHIR_CONCAT_SVS(&_6$$14, "Column '", &field, "' isn't part of the table columns"); + ZEPHIR_CALL_METHOD(NULL, &_5$$14, "__construct", &_3, 4, &_6$$14); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$14, "phalcon/mvc/model.zep", 1134 TSRMLS_CC); + zephir_throw_exception_debug(&_5$$14, "phalcon/mvc/model.zep", 1134 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&uniqueTypes, type, PH_SEPARATE, "phalcon/mvc/model.zep", 1137); - ZEPHIR_CALL_METHOD(&_9$$7, connection, "escapeidentifier", &_10, 0, field); + zephir_array_append(&uniqueTypes, &type, PH_SEPARATE, "phalcon/mvc/model.zep", 1137); + ZEPHIR_CALL_METHOD(&_7$$7, connection, "escapeidentifier", &_8, 0, &field); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_11$$7); - ZEPHIR_CONCAT_VS(_11$$7, _9$$7, " = ?"); - zephir_array_append(&wherePk, _11$$7, PH_SEPARATE, "phalcon/mvc/model.zep", 1138); - } + ZEPHIR_INIT_LNVAR(_9$$7); + ZEPHIR_CONCAT_VS(&_9$$7, &_7$$7, " = ?"); + zephir_array_append(&wherePk, &_9$$7, PH_SEPARATE, "phalcon/mvc/model.zep", 1138); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); if (numberPrimary == numberEmpty) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(joinWhere); - zephir_fast_join_str(joinWhere, SL(" AND "), wherePk TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_uniqueKey"), joinWhere TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_uniqueParams"), uniqueParams TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_uniqueTypes"), uniqueTypes TSRMLS_CC); - ZEPHIR_CPY_WRT(uniqueKey, joinWhere); - } - _12 = zephir_fetch_nproperty_this(this_ptr, SL("_dirtyState"), PH_NOISY_CC); - if (!(zephir_is_true(_12))) { + ZEPHIR_INIT_VAR(&joinWhere); + zephir_fast_join_str(&joinWhere, SL(" AND "), &wherePk TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_uniqueKey"), &joinWhere); + zephir_update_property_zval(this_ptr, SL("_uniqueParams"), &uniqueParams); + zephir_update_property_zval(this_ptr, SL("_uniqueTypes"), &uniqueTypes); + ZEPHIR_CPY_WRT(&uniqueKey, &joinWhere); + } + zephir_read_property(&_10, this_ptr, SL("_dirtyState"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_10))) { RETURN_MM_BOOL(1); } - if (Z_TYPE_P(uniqueKey) == IS_NULL) { - ZEPHIR_OBS_NVAR(uniqueKey); - zephir_read_property_this(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); + if (Z_TYPE_P(&uniqueKey) == IS_NULL) { + ZEPHIR_OBS_NVAR(&uniqueKey); + zephir_read_property(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); } - if (Z_TYPE_P(uniqueParams) == IS_NULL) { - ZEPHIR_OBS_NVAR(uniqueParams); - zephir_read_property_this(&uniqueParams, this_ptr, SL("_uniqueParams"), PH_NOISY_CC); + if (Z_TYPE_P(&uniqueParams) == IS_NULL) { + ZEPHIR_OBS_NVAR(&uniqueParams); + zephir_read_property(&uniqueParams, this_ptr, SL("_uniqueParams"), PH_NOISY_CC); } - if (Z_TYPE_P(uniqueTypes) == IS_NULL) { - ZEPHIR_OBS_NVAR(uniqueTypes); - zephir_read_property_this(&uniqueTypes, this_ptr, SL("_uniqueTypes"), PH_NOISY_CC); + if (Z_TYPE_P(&uniqueTypes) == IS_NULL) { + ZEPHIR_OBS_NVAR(&uniqueTypes); + zephir_read_property(&uniqueTypes, this_ptr, SL("_uniqueTypes"), PH_NOISY_CC); } ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(schema)) { + if (zephir_is_true(&schema)) { ZEPHIR_INIT_NVAR(table); zephir_create_array(table, 2, 0 TSRMLS_CC); - zephir_array_fast_append(table, schema); - zephir_array_fast_append(table, source); + zephir_array_fast_append(table, &schema); + zephir_array_fast_append(table, &source); } else { - ZEPHIR_CPY_WRT(table, source); + ZEPHIR_CPY_WRT(table, &source); } - ZEPHIR_CALL_METHOD(&_13, connection, "escapeidentifier", NULL, 0, table); + ZEPHIR_CALL_METHOD(&_11, connection, "escapeidentifier", NULL, 0, table); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_14); - ZEPHIR_CONCAT_SVSV(_14, "SELECT COUNT(*) \"rowcount\" FROM ", _13, " WHERE ", uniqueKey); - ZEPHIR_INIT_VAR(_15); - ZVAL_NULL(_15); - ZEPHIR_CALL_METHOD(&num, connection, "fetchone", NULL, 0, _14, _15, uniqueParams, uniqueTypes); + ZEPHIR_INIT_VAR(&_12); + ZEPHIR_CONCAT_SVSV(&_12, "SELECT COUNT(*) \"rowcount\" FROM ", &_11, " WHERE ", &uniqueKey); + ZVAL_NULL(&_13); + ZEPHIR_CALL_METHOD(&num, connection, "fetchone", NULL, 0, &_12, &_13, &uniqueParams, &uniqueTypes); zephir_check_call_status(); - zephir_array_fetch_string(&_16, num, SL("rowcount"), PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 1194 TSRMLS_CC); - if (zephir_is_true(_16)) { - ZEPHIR_INIT_ZVAL_NREF(_17$$22); - ZVAL_LONG(_17$$22, 0); - zephir_update_property_this(getThis(), SL("_dirtyState"), _17$$22 TSRMLS_CC); + zephir_array_fetch_string(&_14, &num, SL("rowcount"), PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 1194 TSRMLS_CC); + if (zephir_is_true(&_14)) { + ZEPHIR_INIT_ZVAL_NREF(_15$$22); + ZVAL_LONG(&_15$$22, 0); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_15$$22); RETURN_MM_BOOL(1); } else { - ZEPHIR_INIT_ZVAL_NREF(_18$$23); - ZVAL_LONG(_18$$23, 1); - zephir_update_property_this(getThis(), SL("_dirtyState"), _18$$23 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_16$$23); + ZVAL_LONG(&_16$$23, 1); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_16$$23); } RETURN_MM_BOOL(0); @@ -1631,103 +1857,124 @@ PHP_METHOD(Phalcon_Mvc_Model, _groupResult) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *functionName_param = NULL, *alias_param = NULL, *parameters, *params = NULL, *distinctColumn = NULL, *groupColumn = NULL, *columns = NULL, *bindParams = NULL, *bindTypes = NULL, *resultset = NULL, *cache = NULL, *firstRow = NULL, *groupColumns = NULL, *builder = NULL, *query = NULL, *dependencyInjector = NULL, *manager = NULL, *_1 = NULL, *_2 = NULL, *_3; - zval *functionName = NULL, *alias = NULL; + zval *functionName_param = NULL, *alias_param = NULL, *parameters, parameters_sub, params, distinctColumn, groupColumn, columns, bindParams, bindTypes, resultset, cache, firstRow, groupColumns, builder, query, dependencyInjector, manager, _1, _2, _3; + zval functionName, alias; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&functionName); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&distinctColumn); + ZVAL_UNDEF(&groupColumn); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(&resultset); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&firstRow); + ZVAL_UNDEF(&groupColumns); + ZVAL_UNDEF(&builder); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &functionName_param, &alias_param, ¶meters); if (UNEXPECTED(Z_TYPE_P(functionName_param) != IS_STRING && Z_TYPE_P(functionName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'functionName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'functionName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(functionName_param) == IS_STRING)) { - zephir_get_strval(functionName, functionName_param); + zephir_get_strval(&functionName, functionName_param); } else { - ZEPHIR_INIT_VAR(functionName); - ZVAL_EMPTY_STRING(functionName); + ZEPHIR_INIT_VAR(&functionName); + ZVAL_EMPTY_STRING(&functionName); } if (UNEXPECTED(Z_TYPE_P(alias_param) != IS_STRING && Z_TYPE_P(alias_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'alias' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'alias' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(alias_param) == IS_STRING)) { - zephir_get_strval(alias, alias_param); + zephir_get_strval(&alias, alias_param); } else { - ZEPHIR_INIT_VAR(alias); - ZVAL_EMPTY_STRING(alias); + ZEPHIR_INIT_VAR(&alias); + ZVAL_EMPTY_STRING(&alias); } - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "modelsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "getshared", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "modelsManager"); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "getshared", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_CPY_WRT(manager, _1); + ZEPHIR_CPY_WRT(&manager, &_1); if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - array_init(params); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); if (Z_TYPE_P(parameters) != IS_NULL) { zephir_array_append(¶ms, parameters, PH_SEPARATE, "phalcon/mvc/model.zep", 1224); } } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_OBS_VAR(groupColumn); - if (!(zephir_array_isset_string_fetch(&groupColumn, params, SS("column"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(groupColumn); - ZVAL_STRING(groupColumn, "*", 1); + ZEPHIR_OBS_VAR(&groupColumn); + if (!(zephir_array_isset_string_fetch(&groupColumn, ¶ms, SL("column"), 0))) { + ZEPHIR_INIT_NVAR(&groupColumn); + ZVAL_STRING(&groupColumn, "*"); } - ZEPHIR_OBS_VAR(distinctColumn); - if (zephir_array_isset_string_fetch(&distinctColumn, params, SS("distinct"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(columns); - ZEPHIR_CONCAT_VSVSV(columns, functionName, "(DISTINCT ", distinctColumn, ") AS ", alias); + ZEPHIR_OBS_VAR(&distinctColumn); + if (zephir_array_isset_string_fetch(&distinctColumn, ¶ms, SL("distinct"), 0)) { + ZEPHIR_INIT_VAR(&columns); + ZEPHIR_CONCAT_VSVSV(&columns, &functionName, "(DISTINCT ", &distinctColumn, ") AS ", &alias); } else { - ZEPHIR_OBS_VAR(groupColumns); - ZEPHIR_INIT_NVAR(columns); - if (zephir_array_isset_string_fetch(&groupColumns, params, SS("group"), 0 TSRMLS_CC)) { - ZEPHIR_CONCAT_VSVSVSV(columns, groupColumns, ", ", functionName, "(", groupColumn, ") AS ", alias); + ZEPHIR_OBS_VAR(&groupColumns); + ZEPHIR_INIT_NVAR(&columns); + if (zephir_array_isset_string_fetch(&groupColumns, ¶ms, SL("group"), 0)) { + ZEPHIR_CONCAT_VSVSVSV(&columns, &groupColumns, ", ", &functionName, "(", &groupColumn, ") AS ", &alias); } else { - ZEPHIR_CONCAT_VSVSV(columns, functionName, "(", groupColumn, ") AS ", alias); + ZEPHIR_CONCAT_VSVSV(&columns, &functionName, "(", &groupColumn, ") AS ", &alias); } } - ZEPHIR_CALL_METHOD(&builder, manager, "createbuilder", NULL, 0, params); + ZEPHIR_CALL_METHOD(&builder, &manager, "createbuilder", NULL, 0, ¶ms); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, builder, "columns", NULL, 0, columns); + ZEPHIR_CALL_METHOD(NULL, &builder, "columns", NULL, 0, &columns); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_2); - zephir_get_called_class(_2 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, builder, "from", NULL, 0, _2); + ZEPHIR_INIT_NVAR(&_2); + zephir_get_called_class(&_2 TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &builder, "from", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&query, builder, "getquery", NULL, 0); + ZEPHIR_CALL_METHOD(&query, &builder, "getquery", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(bindParams); - ZVAL_NULL(bindParams); - ZEPHIR_INIT_VAR(bindTypes); - ZVAL_NULL(bindTypes); - ZEPHIR_OBS_NVAR(bindParams); - if (zephir_array_isset_string_fetch(&bindParams, params, SS("bind"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_NVAR(bindTypes); - zephir_array_isset_string_fetch(&bindTypes, params, SS("bindTypes"), 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&bindParams); + ZVAL_NULL(&bindParams); + ZEPHIR_INIT_VAR(&bindTypes); + ZVAL_NULL(&bindTypes); + ZEPHIR_OBS_NVAR(&bindParams); + if (zephir_array_isset_string_fetch(&bindParams, ¶ms, SL("bind"), 0)) { + ZEPHIR_OBS_NVAR(&bindTypes); + zephir_array_isset_string_fetch(&bindTypes, ¶ms, SL("bindTypes"), 0); } - ZEPHIR_OBS_VAR(cache); - if (zephir_array_isset_string_fetch(&cache, params, SS("cache"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, query, "cache", NULL, 0, cache); + ZEPHIR_OBS_VAR(&cache); + if (zephir_array_isset_string_fetch(&cache, ¶ms, SL("cache"), 0)) { + ZEPHIR_CALL_METHOD(NULL, &query, "cache", NULL, 0, &cache); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&resultset, query, "execute", NULL, 0, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(&resultset, &query, "execute", NULL, 0, &bindParams, &bindTypes); zephir_check_call_status(); - if (zephir_array_isset_string(params, SS("group"))) { - RETURN_CCTOR(resultset); + if (zephir_array_isset_string(¶ms, SL("group"))) { + RETURN_CCTOR(&resultset); } - ZEPHIR_CALL_METHOD(&firstRow, resultset, "getfirst", NULL, 0); + ZEPHIR_CALL_METHOD(&firstRow, &resultset, "getfirst", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(_3); - zephir_read_property_zval(&_3, firstRow, alias, PH_NOISY_CC); - RETURN_CCTOR(_3); + ZEPHIR_OBS_VAR(&_3); + zephir_read_property_zval(&_3, &firstRow, &alias, PH_NOISY_CC); + RETURN_CCTOR(&_3); } @@ -1752,28 +1999,34 @@ PHP_METHOD(Phalcon_Mvc_Model, _groupResult) { PHP_METHOD(Phalcon_Mvc_Model, count) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters = NULL, *result = NULL, *_0, *_1; + zval *parameters = NULL, parameters_sub, __$null, result, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "COUNT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "rowcount", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_SELF(&result, "_groupresult", NULL, 0, _0, _1, parameters); - zephir_check_temp_parameter(_0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "COUNT"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "rowcount"); + ZEPHIR_CALL_SELF(&result, "_groupresult", NULL, 0, &_0, &_1, parameters); zephir_check_call_status(); - if (Z_TYPE_P(result) == IS_STRING) { - RETURN_MM_LONG(zephir_get_intval(result)); + if (Z_TYPE_P(&result) == IS_STRING) { + RETURN_MM_LONG(zephir_get_intval(&result)); } - RETURN_CCTOR(result); + RETURN_CCTOR(&result); } @@ -1807,23 +2060,28 @@ PHP_METHOD(Phalcon_Mvc_Model, count) { PHP_METHOD(Phalcon_Mvc_Model, sum) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters = NULL, *_0, *_1; + zval *parameters = NULL, parameters_sub, __$null, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "SUM", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "sumatory", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_groupresult", NULL, 0, _0, _1, parameters); - zephir_check_temp_parameter(_0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "SUM"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "sumatory"); + ZEPHIR_RETURN_CALL_SELF("_groupresult", NULL, 0, &_0, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1859,23 +2117,28 @@ PHP_METHOD(Phalcon_Mvc_Model, sum) { PHP_METHOD(Phalcon_Mvc_Model, maximum) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters = NULL, *_0, *_1; + zval *parameters = NULL, parameters_sub, __$null, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "MAX", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "maximum", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_groupresult", NULL, 0, _0, _1, parameters); - zephir_check_temp_parameter(_0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "MAX"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "maximum"); + ZEPHIR_RETURN_CALL_SELF("_groupresult", NULL, 0, &_0, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1911,23 +2174,28 @@ PHP_METHOD(Phalcon_Mvc_Model, maximum) { PHP_METHOD(Phalcon_Mvc_Model, minimum) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters = NULL, *_0, *_1; + zval *parameters = NULL, parameters_sub, __$null, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "MIN", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "minimum", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_groupresult", NULL, 0, _0, _1, parameters); - zephir_check_temp_parameter(_0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "MIN"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "minimum"); + ZEPHIR_RETURN_CALL_SELF("_groupresult", NULL, 0, &_0, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1963,23 +2231,28 @@ PHP_METHOD(Phalcon_Mvc_Model, minimum) { PHP_METHOD(Phalcon_Mvc_Model, average) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters = NULL, *_0, *_1; + zval *parameters = NULL, parameters_sub, __$null, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "AVG", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "average", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_groupresult", NULL, 0, _0, _1, parameters); - zephir_check_temp_parameter(_0); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "AVG"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "average"); + ZEPHIR_RETURN_CALL_SELF("_groupresult", NULL, 0, &_0, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1991,30 +2264,34 @@ PHP_METHOD(Phalcon_Mvc_Model, average) { PHP_METHOD(Phalcon_Mvc_Model, fireEvent) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventName_param = NULL, *_0; - zval *eventName = NULL; + zval *eventName_param = NULL, _0; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &eventName_param); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } - if ((zephir_method_exists(this_ptr, eventName TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, eventName, NULL, 0); + if ((zephir_method_exists(this_ptr, &eventName TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &eventName, NULL, 0); zephir_check_call_status(); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "notifyevent", NULL, 0, eventName, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "notifyevent", NULL, 0, &eventName, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -2027,35 +2304,41 @@ PHP_METHOD(Phalcon_Mvc_Model, fireEvent) { PHP_METHOD(Phalcon_Mvc_Model, fireEventCancel) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventName_param = NULL, *_0$$3 = NULL, *_1, *_2 = NULL; - zval *eventName = NULL; + zval *eventName_param = NULL, _0$$3, _1, _2; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &eventName_param); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } - if ((zephir_method_exists(this_ptr, eventName TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(&_0$$3, this_ptr, eventName, NULL, 0); + if ((zephir_method_exists(this_ptr, &eventName TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD_ZVAL(&_0$$3, this_ptr, &eventName, NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0$$3)) { RETURN_MM_BOOL(0); } } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "notifyevent", NULL, 0, eventName, this_ptr); + zephir_read_property(&_1, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "notifyevent", NULL, 0, &eventName, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_2)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_2)) { RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1); @@ -2067,23 +2350,26 @@ PHP_METHOD(Phalcon_Mvc_Model, fireEventCancel) { */ PHP_METHOD(Phalcon_Mvc_Model, _cancelOperation) { - zval *_0, *_1$$3, *_2$$4; + zval _0, _1$$3, _2$$4; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_operationMade"), PH_NOISY_CC); - if (ZEPHIR_IS_LONG(_0, 3)) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "notDeleted", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _1$$3); - zephir_check_temp_parameter(_1$$3); + zephir_read_property(&_0, this_ptr, SL("_operationMade"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_LONG(&_0, 3)) { + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "notDeleted"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_1$$3); zephir_check_call_status(); } else { - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_STRING(_2$$4, "notSaved", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _2$$4); - zephir_check_temp_parameter(_2$$4); + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, "notSaved"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_2$$4); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -2114,7 +2400,10 @@ PHP_METHOD(Phalcon_Mvc_Model, _cancelOperation) { */ PHP_METHOD(Phalcon_Mvc_Model, appendMessage) { - zval *message; + zval *message, message_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message_sub); zephir_fetch_params(0, 1, 0, &message); @@ -2161,47 +2450,55 @@ PHP_METHOD(Phalcon_Mvc_Model, validate) { zend_object_iterator *_1; zephir_fcall_cache_entry *_8 = NULL, *_9 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *validator, *messages = NULL, *message = NULL, *_0, *_2$$4 = NULL, *_3$$4 = NULL, *_4$$4 = NULL, *_5$$4 = NULL, *_6$$4 = NULL, *_7$$4 = NULL; + zval *validator, validator_sub, messages, message, _0, _2$$4, _3$$4, _4$$4, _5$$4, _6$$4, _7$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&validator_sub); + ZVAL_UNDEF(&messages); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &validator); - ZEPHIR_INIT_VAR(_0); - ZVAL_NULL(_0); - ZEPHIR_CALL_METHOD(&messages, validator, "validate", NULL, 0, _0, this_ptr); + ZVAL_NULL(&_0); + ZEPHIR_CALL_METHOD(&messages, validator, "validate", NULL, 0, &_0, this_ptr); zephir_check_call_status(); - if (Z_TYPE_P(messages) == IS_BOOL) { - RETURN_CCTOR(messages); + if (((Z_TYPE_P(&messages) == IS_TRUE || Z_TYPE_P(&messages) == IS_FALSE) == 1)) { + RETURN_CCTOR(&messages); } - _1 = zephir_get_iterator(messages TSRMLS_CC); + _1 = zephir_get_iterator(&messages TSRMLS_CC); _1->funcs->rewind(_1 TSRMLS_CC); for (;_1->funcs->valid(_1 TSRMLS_CC) == SUCCESS && !EG(exception); _1->funcs->move_forward(_1 TSRMLS_CC)) { { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _1->funcs->get_current_data(_1, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(message, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&message, _1); } - ZEPHIR_INIT_NVAR(_2$$4); - object_init_ex(_2$$4, phalcon_mvc_model_message_ce); - ZEPHIR_CALL_METHOD(&_3$$4, message, "getmessage", NULL, 0); + ZEPHIR_INIT_NVAR(&_2$$4); + object_init_ex(&_2$$4, phalcon_mvc_model_message_ce); + ZEPHIR_CALL_METHOD(&_3$$4, &message, "getmessage", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4$$4, message, "getfield", NULL, 0); + ZEPHIR_CALL_METHOD(&_4$$4, &message, "getfield", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5$$4, message, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(&_5$$4, &message, "gettype", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6$$4, message, "getcode", NULL, 0); + ZEPHIR_CALL_METHOD(&_6$$4, &message, "getcode", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_7$$4); - ZVAL_NULL(_7$$4); - ZEPHIR_CALL_METHOD(NULL, _2$$4, "__construct", &_8, 8, _3$$4, _4$$4, _5$$4, _7$$4, _6$$4); + ZVAL_NULL(&_7$$4); + ZEPHIR_CALL_METHOD(NULL, &_2$$4, "__construct", &_8, 3, &_3$$4, &_4$$4, &_5$$4, &_7$$4, &_6$$4); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_9, 0, _2$$4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_9, 0, &_2$$4); zephir_check_call_status(); } - _1->funcs->dtor(_1 TSRMLS_CC); - RETURN_MM_BOOL(!(zephir_fast_count_int(messages TSRMLS_CC))); + zend_iterator_dtor(_1); + RETURN_MM_BOOL(!(zephir_fast_count_int(&messages TSRMLS_CC))); } @@ -2238,14 +2535,17 @@ PHP_METHOD(Phalcon_Mvc_Model, validate) { */ PHP_METHOD(Phalcon_Mvc_Model, validationHasFailed) { - zval *errorMessages = NULL; + zval errorMessages; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&errorMessages); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(errorMessages); - zephir_read_property_this(&errorMessages, this_ptr, SL("_errorMessages"), PH_NOISY_CC); - if (Z_TYPE_P(errorMessages) == IS_ARRAY) { - RETURN_MM_BOOL(zephir_fast_count_int(errorMessages TSRMLS_CC) > 0); + ZEPHIR_OBS_VAR(&errorMessages); + zephir_read_property(&errorMessages, this_ptr, SL("_errorMessages"), PH_NOISY_CC); + if (Z_TYPE_P(&errorMessages) == IS_ARRAY) { + RETURN_MM_BOOL(zephir_fast_count_int(&errorMessages TSRMLS_CC) > 0); } RETURN_MM_BOOL(0); @@ -2276,17 +2576,24 @@ PHP_METHOD(Phalcon_Mvc_Model, validationHasFailed) { */ PHP_METHOD(Phalcon_Mvc_Model, getMessages) { - HashTable *_3$$3; - HashPosition _2$$3; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *filter = NULL, *filtered = NULL, *message = NULL, *_1$$3, **_4$$3, *_5$$4 = NULL; + zval *filter = NULL, filter_sub, __$null, filtered, message, _1$$3, *_2$$3, _3$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filter_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&filtered); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &filter); if (!filter) { - filter = ZEPHIR_GLOBAL(global_null); + filter = &filter_sub; + filter = &__$null; } @@ -2295,22 +2602,22 @@ PHP_METHOD(Phalcon_Mvc_Model, getMessages) { _0 = !(ZEPHIR_IS_EMPTY(filter)); } if (_0) { - ZEPHIR_INIT_VAR(filtered); - array_init(filtered); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_errorMessages"), PH_NOISY_CC); - zephir_is_iterable(_1$$3, &_3$$3, &_2$$3, 0, 0, "phalcon/mvc/model.zep", 1664); - for ( - ; zend_hash_get_current_data_ex(_3$$3, (void**) &_4$$3, &_2$$3) == SUCCESS - ; zend_hash_move_forward_ex(_3$$3, &_2$$3) - ) { - ZEPHIR_GET_HVALUE(message, _4$$3); - ZEPHIR_CALL_METHOD(&_5$$4, message, "getfield", NULL, 0); + ZEPHIR_INIT_VAR(&filtered); + array_init(&filtered); + zephir_read_property(&_1$$3, this_ptr, SL("_errorMessages"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_1$$3, 0, "phalcon/mvc/model.zep", 1664); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_1$$3), _2$$3) + { + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _2$$3); + ZEPHIR_CALL_METHOD(&_3$$4, &message, "getfield", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_EQUAL(_5$$4, filter)) { - zephir_array_append(&filtered, message, PH_SEPARATE, "phalcon/mvc/model.zep", 1661); + if (ZEPHIR_IS_EQUAL(&_3$$4, filter)) { + zephir_array_append(&filtered, &message, PH_SEPARATE, "phalcon/mvc/model.zep", 1661); } - } - RETURN_CCTOR(filtered); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); + RETURN_CCTOR(&filtered); } RETURN_MM_MEMBER(getThis(), "_errorMessages"); @@ -2322,143 +2629,177 @@ PHP_METHOD(Phalcon_Mvc_Model, getMessages) { */ PHP_METHOD(Phalcon_Mvc_Model, _checkForeignKeysRestrict) { - zval *_15$$3 = NULL; - HashTable *_2, *_8$$8; - HashPosition _1, _7$$8; - zend_bool error = 0, validateWithNulls = 0, _13$$3; - zval *manager = NULL, *belongsTo = NULL, *foreignKey = NULL, *relation = NULL, *conditions = NULL, *position = NULL, *bindParams = NULL, *extraConditions = NULL, *message = NULL, *fields = NULL, *referencedFields = NULL, *field = NULL, *referencedModel = NULL, *value = NULL, *allowNulls = NULL, *_0, **_3, *_4$$6 = NULL, *_5$$3 = NULL, *_14$$3 = NULL, *_16$$3 = NULL, **_9$$8, *_10$$9, *_11$$9 = NULL, *_12$$11 = NULL, *_17$$19 = NULL, *_18$$17 = NULL, *_19$$17 = NULL, *_22$$22; - zephir_fcall_cache_entry *_6 = NULL, *_20 = NULL, *_21 = NULL; + zend_string *_7$$8; + zend_ulong _6$$8; + zval _13$$3; + zend_bool error = 0, validateWithNulls = 0, _11$$3; + zval manager, belongsTo, foreignKey, relation, conditions, position, bindParams, extraConditions, message, fields, referencedFields, field, referencedModel, value, allowNulls, _0, *_1, _2$$6, _3$$3, _12$$3, _14$$3, *_5$$8, _8$$9, _9$$9, _10$$11, _15$$19, _16$$17, _17$$17, _20$$22; + zephir_fcall_cache_entry *_4 = NULL, *_18 = NULL, *_19 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, action = 0, numberNull = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&belongsTo); + ZVAL_UNDEF(&foreignKey); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&extraConditions); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&referencedFields); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&referencedModel); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&allowNulls); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_14$$3); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_10$$11); + ZVAL_UNDEF(&_15$$19); + ZVAL_UNDEF(&_16$$17); + ZVAL_UNDEF(&_17$$17); + ZVAL_UNDEF(&_20$$22); + ZVAL_UNDEF(&_13$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(manager, _0); - ZEPHIR_CALL_METHOD(&belongsTo, manager, "getbelongsto", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&manager, &_0); + ZEPHIR_CALL_METHOD(&belongsTo, &manager, "getbelongsto", NULL, 0, this_ptr); zephir_check_call_status(); error = 0; - zephir_is_iterable(belongsTo, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 1809); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(relation, _3); + zephir_is_iterable(&belongsTo, 0, "phalcon/mvc/model.zep", 1809); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&belongsTo), _1) + { + ZEPHIR_INIT_NVAR(&relation); + ZVAL_COPY(&relation, _1); validateWithNulls = 0; - ZEPHIR_CALL_METHOD(&foreignKey, relation, "getforeignkey", NULL, 0); + ZEPHIR_CALL_METHOD(&foreignKey, &relation, "getforeignkey", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(foreignKey)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&foreignKey)) { continue; } action = 1; - if (Z_TYPE_P(foreignKey) == IS_ARRAY) { - if (zephir_array_isset_string(foreignKey, SS("action"))) { - ZEPHIR_OBS_NVAR(_4$$6); - zephir_array_fetch_string(&_4$$6, foreignKey, SL("action"), PH_NOISY, "phalcon/mvc/model.zep", 1711 TSRMLS_CC); - action = zephir_get_intval(_4$$6); + if (Z_TYPE_P(&foreignKey) == IS_ARRAY) { + if (zephir_array_isset_string(&foreignKey, SL("action"))) { + ZEPHIR_OBS_NVAR(&_2$$6); + zephir_array_fetch_string(&_2$$6, &foreignKey, SL("action"), PH_NOISY, "phalcon/mvc/model.zep", 1711 TSRMLS_CC); + action = zephir_get_intval(&_2$$6); } } if (action != 1) { continue; } - ZEPHIR_CALL_METHOD(&_5$$3, relation, "getreferencedmodel", NULL, 0); + ZEPHIR_CALL_METHOD(&_3$$3, &relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedModel, manager, "load", &_6, 0, _5$$3); + ZEPHIR_CALL_METHOD(&referencedModel, &manager, "load", &_4, 0, &_3$$3); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(conditions); - array_init(conditions); - ZEPHIR_INIT_NVAR(bindParams); - array_init(bindParams); + ZEPHIR_INIT_NVAR(&conditions); + array_init(&conditions); + ZEPHIR_INIT_NVAR(&bindParams); + array_init(&bindParams); numberNull = 0; - ZEPHIR_CALL_METHOD(&fields, relation, "getfields", NULL, 0); + ZEPHIR_CALL_METHOD(&fields, &relation, "getfields", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedFields, relation, "getreferencedfields", NULL, 0); + ZEPHIR_CALL_METHOD(&referencedFields, &relation, "getreferencedfields", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(fields) == IS_ARRAY) { - zephir_is_iterable(fields, &_8$$8, &_7$$8, 0, 0, "phalcon/mvc/model.zep", 1749); - for ( - ; zend_hash_get_current_data_ex(_8$$8, (void**) &_9$$8, &_7$$8) == SUCCESS - ; zend_hash_move_forward_ex(_8$$8, &_7$$8) - ) { - ZEPHIR_GET_HMKEY(position, _8$$8, _7$$8); - ZEPHIR_GET_HVALUE(field, _9$$8); - ZEPHIR_OBS_NVAR(value); - zephir_fetch_property_zval(&value, this_ptr, field, PH_SILENT_CC); - zephir_array_fetch(&_10$$9, referencedFields, position, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 1742 TSRMLS_CC); - ZEPHIR_INIT_LNVAR(_11$$9); - ZEPHIR_CONCAT_SVSV(_11$$9, "[", _10$$9, "] = ?", position); - zephir_array_append(&conditions, _11$$9, PH_SEPARATE, "phalcon/mvc/model.zep", 1742); - zephir_array_append(&bindParams, value, PH_SEPARATE, "phalcon/mvc/model.zep", 1743); - if (Z_TYPE_P(value) == IS_NULL) { + if (Z_TYPE_P(&fields) == IS_ARRAY) { + zephir_is_iterable(&fields, 0, "phalcon/mvc/model.zep", 1749); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _6$$8, _7$$8, _5$$8) + { + ZEPHIR_INIT_NVAR(&position); + if (_7$$8 != NULL) { + ZVAL_STR_COPY(&position, _7$$8); + } else { + ZVAL_LONG(&position, _6$$8); + } + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _5$$8); + ZEPHIR_OBS_NVAR(&value); + zephir_fetch_property_zval(&value, this_ptr, &field, PH_SILENT_CC); + zephir_array_fetch(&_8$$9, &referencedFields, &position, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 1742 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_9$$9); + ZEPHIR_CONCAT_SVSV(&_9$$9, "[", &_8$$9, "] = ?", &position); + zephir_array_append(&conditions, &_9$$9, PH_SEPARATE, "phalcon/mvc/model.zep", 1742); + zephir_array_append(&bindParams, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 1743); + if (Z_TYPE_P(&value) == IS_NULL) { numberNull++; } - } - validateWithNulls = numberNull == zephir_fast_count_int(fields TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_INIT_NVAR(&position); + validateWithNulls = numberNull == zephir_fast_count_int(&fields TSRMLS_CC); } else { - ZEPHIR_OBS_NVAR(value); - zephir_fetch_property_zval(&value, this_ptr, fields, PH_SILENT_CC); - ZEPHIR_INIT_LNVAR(_12$$11); - ZEPHIR_CONCAT_SVS(_12$$11, "[", referencedFields, "] = ?0"); - zephir_array_append(&conditions, _12$$11, PH_SEPARATE, "phalcon/mvc/model.zep", 1754); - zephir_array_append(&bindParams, value, PH_SEPARATE, "phalcon/mvc/model.zep", 1755); - if (Z_TYPE_P(value) == IS_NULL) { + ZEPHIR_OBS_NVAR(&value); + zephir_fetch_property_zval(&value, this_ptr, &fields, PH_SILENT_CC); + ZEPHIR_INIT_LNVAR(_10$$11); + ZEPHIR_CONCAT_SVS(&_10$$11, "[", &referencedFields, "] = ?0"); + zephir_array_append(&conditions, &_10$$11, PH_SEPARATE, "phalcon/mvc/model.zep", 1754); + zephir_array_append(&bindParams, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 1755); + if (Z_TYPE_P(&value) == IS_NULL) { validateWithNulls = 1; } } - ZEPHIR_OBS_NVAR(extraConditions); - if (zephir_array_isset_string_fetch(&extraConditions, foreignKey, SS("conditions"), 0 TSRMLS_CC)) { - zephir_array_append(&conditions, extraConditions, PH_SEPARATE, "phalcon/mvc/model.zep", 1766); + ZEPHIR_OBS_NVAR(&extraConditions); + if (zephir_array_isset_string_fetch(&extraConditions, &foreignKey, SL("conditions"), 0)) { + zephir_array_append(&conditions, &extraConditions, PH_SEPARATE, "phalcon/mvc/model.zep", 1766); } if (validateWithNulls) { - ZEPHIR_OBS_NVAR(allowNulls); - if (zephir_array_isset_string_fetch(&allowNulls, foreignKey, SS("allowNulls"), 0 TSRMLS_CC)) { - validateWithNulls = zephir_get_boolval(allowNulls); + ZEPHIR_OBS_NVAR(&allowNulls); + if (zephir_array_isset_string_fetch(&allowNulls, &foreignKey, SL("allowNulls"), 0)) { + validateWithNulls = zephir_get_boolval(&allowNulls); } else { validateWithNulls = 0; } } - _13$$3 = !validateWithNulls; - if (_13$$3) { - ZEPHIR_INIT_NVAR(_15$$3); - zephir_create_array(_15$$3, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_16$$3); - zephir_fast_join_str(_16$$3, SL(" AND "), conditions TSRMLS_CC); - zephir_array_fast_append(_15$$3, _16$$3); - zephir_array_update_string(&_15$$3, SL("bind"), &bindParams, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_14$$3, referencedModel, "count", NULL, 0, _15$$3); + _11$$3 = !validateWithNulls; + if (_11$$3) { + ZEPHIR_INIT_NVAR(&_13$$3); + zephir_create_array(&_13$$3, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_14$$3); + zephir_fast_join_str(&_14$$3, SL(" AND "), &conditions TSRMLS_CC); + zephir_array_fast_append(&_13$$3, &_14$$3); + zephir_array_update_string(&_13$$3, SL("bind"), &bindParams, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&_12$$3, &referencedModel, "count", NULL, 0, &_13$$3); zephir_check_call_status(); - _13$$3 = !zephir_is_true(_14$$3); + _11$$3 = !zephir_is_true(&_12$$3); } - if (_13$$3) { - ZEPHIR_OBS_NVAR(message); - if (!(zephir_array_isset_string_fetch(&message, foreignKey, SS("message"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(message); - if (Z_TYPE_P(fields) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_17$$19); - zephir_fast_join_str(_17$$19, SL(", "), fields TSRMLS_CC); - ZEPHIR_CONCAT_SVS(message, "Value of fields \"", _17$$19, "\" does not exist on referenced table"); + if (_11$$3) { + ZEPHIR_OBS_NVAR(&message); + if (!(zephir_array_isset_string_fetch(&message, &foreignKey, SL("message"), 0))) { + ZEPHIR_INIT_NVAR(&message); + if (Z_TYPE_P(&fields) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_15$$19); + zephir_fast_join_str(&_15$$19, SL(", "), &fields TSRMLS_CC); + ZEPHIR_CONCAT_SVS(&message, "Value of fields \"", &_15$$19, "\" does not exist on referenced table"); } else { - ZEPHIR_CONCAT_SVS(message, "Value of field \"", fields, "\" does not exist on referenced table"); + ZEPHIR_CONCAT_SVS(&message, "Value of field \"", &fields, "\" does not exist on referenced table"); } } - ZEPHIR_INIT_NVAR(_18$$17); - object_init_ex(_18$$17, phalcon_mvc_model_message_ce); - ZEPHIR_INIT_NVAR(_19$$17); - ZVAL_STRING(_19$$17, "ConstraintViolation", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _18$$17, "__construct", &_20, 8, message, fields, _19$$17); - zephir_check_temp_parameter(_19$$17); + ZEPHIR_INIT_NVAR(&_16$$17); + object_init_ex(&_16$$17, phalcon_mvc_model_message_ce); + ZEPHIR_INIT_NVAR(&_17$$17); + ZVAL_STRING(&_17$$17, "ConstraintViolation"); + ZEPHIR_CALL_METHOD(NULL, &_16$$17, "__construct", &_18, 3, &message, &fields, &_17$$17); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_21, 0, _18$$17); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_19, 0, &_16$$17); zephir_check_call_status(); error = 1; break; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&relation); if (error == 1) { if (ZEPHIR_GLOBAL(orm).events) { - ZEPHIR_INIT_VAR(_22$$22); - ZVAL_STRING(_22$$22, "onValidationFails", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _22$$22); - zephir_check_temp_parameter(_22$$22); + ZEPHIR_INIT_VAR(&_20$$22); + ZVAL_STRING(&_20$$22, "onValidationFails"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_20$$22); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "_canceloperation", NULL, 0); zephir_check_call_status(); @@ -2474,95 +2815,126 @@ PHP_METHOD(Phalcon_Mvc_Model, _checkForeignKeysRestrict) { */ PHP_METHOD(Phalcon_Mvc_Model, _checkForeignKeysReverseCascade) { - zval *_13$$3 = NULL; - HashTable *_2, *_8$$8; - HashPosition _1, _7$$8; - zval *manager = NULL, *relations = NULL, *relation = NULL, *foreignKey = NULL, *resultset = NULL, *conditions = NULL, *bindParams = NULL, *referencedModel = NULL, *referencedFields = NULL, *fields = NULL, *field = NULL, *position = NULL, *value = NULL, *extraConditions = NULL, *_0, **_3, *_4$$6 = NULL, *_5$$3 = NULL, *_14$$3 = NULL, *_15$$3 = NULL, **_9$$8, *_10$$9, *_11$$9 = NULL, *_12$$10 = NULL; - zephir_fcall_cache_entry *_6 = NULL; + zend_string *_7$$8; + zend_ulong _6$$8; + zval _11$$3; + zval manager, relations, relation, foreignKey, resultset, conditions, bindParams, referencedModel, referencedFields, fields, field, position, value, extraConditions, _0, *_1, _2$$6, _3$$3, _12$$3, _13$$3, *_5$$8, _8$$9, _9$$9, _10$$10; + zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, action = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&foreignKey); + ZVAL_UNDEF(&resultset); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&referencedModel); + ZVAL_UNDEF(&referencedFields); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&extraConditions); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_13$$3); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_10$$10); + ZVAL_UNDEF(&_11$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(manager, _0); - ZEPHIR_CALL_METHOD(&relations, manager, "gethasoneandhasmany", NULL, 0, this_ptr); - zephir_check_call_status(); - zephir_is_iterable(relations, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 1922); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(relation, _3); - ZEPHIR_CALL_METHOD(&foreignKey, relation, "getforeignkey", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&manager, &_0); + ZEPHIR_CALL_METHOD(&relations, &manager, "gethasoneandhasmany", NULL, 0, this_ptr); + zephir_check_call_status(); + zephir_is_iterable(&relations, 0, "phalcon/mvc/model.zep", 1922); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&relations), _1) + { + ZEPHIR_INIT_NVAR(&relation); + ZVAL_COPY(&relation, _1); + ZEPHIR_CALL_METHOD(&foreignKey, &relation, "getforeignkey", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(foreignKey)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&foreignKey)) { continue; } action = 0; - if (Z_TYPE_P(foreignKey) == IS_ARRAY) { - if (zephir_array_isset_string(foreignKey, SS("action"))) { - ZEPHIR_OBS_NVAR(_4$$6); - zephir_array_fetch_string(&_4$$6, foreignKey, SL("action"), PH_NOISY, "phalcon/mvc/model.zep", 1861 TSRMLS_CC); - action = zephir_get_intval(_4$$6); + if (Z_TYPE_P(&foreignKey) == IS_ARRAY) { + if (zephir_array_isset_string(&foreignKey, SL("action"))) { + ZEPHIR_OBS_NVAR(&_2$$6); + zephir_array_fetch_string(&_2$$6, &foreignKey, SL("action"), PH_NOISY, "phalcon/mvc/model.zep", 1861 TSRMLS_CC); + action = zephir_get_intval(&_2$$6); } } if (action != 2) { continue; } - ZEPHIR_CALL_METHOD(&_5$$3, relation, "getreferencedmodel", NULL, 0); + ZEPHIR_CALL_METHOD(&_3$$3, &relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedModel, manager, "load", &_6, 0, _5$$3); + ZEPHIR_CALL_METHOD(&referencedModel, &manager, "load", &_4, 0, &_3$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&fields, relation, "getfields", NULL, 0); + ZEPHIR_CALL_METHOD(&fields, &relation, "getfields", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedFields, relation, "getreferencedfields", NULL, 0); + ZEPHIR_CALL_METHOD(&referencedFields, &relation, "getreferencedfields", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(conditions); - array_init(conditions); - ZEPHIR_INIT_NVAR(bindParams); - array_init(bindParams); - if (Z_TYPE_P(fields) == IS_ARRAY) { - zephir_is_iterable(fields, &_8$$8, &_7$$8, 0, 0, "phalcon/mvc/model.zep", 1891); - for ( - ; zend_hash_get_current_data_ex(_8$$8, (void**) &_9$$8, &_7$$8) == SUCCESS - ; zend_hash_move_forward_ex(_8$$8, &_7$$8) - ) { - ZEPHIR_GET_HMKEY(position, _8$$8, _7$$8); - ZEPHIR_GET_HVALUE(field, _9$$8); - ZEPHIR_OBS_NVAR(value); - zephir_fetch_property_zval(&value, this_ptr, field, PH_SILENT_CC); - zephir_array_fetch(&_10$$9, referencedFields, position, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 1888 TSRMLS_CC); - ZEPHIR_INIT_LNVAR(_11$$9); - ZEPHIR_CONCAT_SVSV(_11$$9, "[", _10$$9, "] = ?", position); - zephir_array_append(&conditions, _11$$9, PH_SEPARATE, "phalcon/mvc/model.zep", 1888); - zephir_array_append(&bindParams, value, PH_SEPARATE, "phalcon/mvc/model.zep", 1889); - } + ZEPHIR_INIT_NVAR(&conditions); + array_init(&conditions); + ZEPHIR_INIT_NVAR(&bindParams); + array_init(&bindParams); + if (Z_TYPE_P(&fields) == IS_ARRAY) { + zephir_is_iterable(&fields, 0, "phalcon/mvc/model.zep", 1891); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _6$$8, _7$$8, _5$$8) + { + ZEPHIR_INIT_NVAR(&position); + if (_7$$8 != NULL) { + ZVAL_STR_COPY(&position, _7$$8); + } else { + ZVAL_LONG(&position, _6$$8); + } + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _5$$8); + ZEPHIR_OBS_NVAR(&value); + zephir_fetch_property_zval(&value, this_ptr, &field, PH_SILENT_CC); + zephir_array_fetch(&_8$$9, &referencedFields, &position, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 1888 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_9$$9); + ZEPHIR_CONCAT_SVSV(&_9$$9, "[", &_8$$9, "] = ?", &position); + zephir_array_append(&conditions, &_9$$9, PH_SEPARATE, "phalcon/mvc/model.zep", 1888); + zephir_array_append(&bindParams, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 1889); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_INIT_NVAR(&position); } else { - ZEPHIR_OBS_NVAR(value); - zephir_fetch_property_zval(&value, this_ptr, fields, PH_SILENT_CC); - ZEPHIR_INIT_LNVAR(_12$$10); - ZEPHIR_CONCAT_SVS(_12$$10, "[", referencedFields, "] = ?0"); - zephir_array_append(&conditions, _12$$10, PH_SEPARATE, "phalcon/mvc/model.zep", 1893); - zephir_array_append(&bindParams, value, PH_SEPARATE, "phalcon/mvc/model.zep", 1894); + ZEPHIR_OBS_NVAR(&value); + zephir_fetch_property_zval(&value, this_ptr, &fields, PH_SILENT_CC); + ZEPHIR_INIT_LNVAR(_10$$10); + ZEPHIR_CONCAT_SVS(&_10$$10, "[", &referencedFields, "] = ?0"); + zephir_array_append(&conditions, &_10$$10, PH_SEPARATE, "phalcon/mvc/model.zep", 1893); + zephir_array_append(&bindParams, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 1894); } - ZEPHIR_OBS_NVAR(extraConditions); - if (zephir_array_isset_string_fetch(&extraConditions, foreignKey, SS("conditions"), 0 TSRMLS_CC)) { - zephir_array_append(&conditions, extraConditions, PH_SEPARATE, "phalcon/mvc/model.zep", 1901); + ZEPHIR_OBS_NVAR(&extraConditions); + if (zephir_array_isset_string_fetch(&extraConditions, &foreignKey, SL("conditions"), 0)) { + zephir_array_append(&conditions, &extraConditions, PH_SEPARATE, "phalcon/mvc/model.zep", 1901); } - ZEPHIR_INIT_NVAR(_13$$3); - zephir_create_array(_13$$3, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_14$$3); - zephir_fast_join_str(_14$$3, SL(" AND "), conditions TSRMLS_CC); - zephir_array_fast_append(_13$$3, _14$$3); - zephir_array_update_string(&_13$$3, SL("bind"), &bindParams, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&resultset, referencedModel, "find", NULL, 0, _13$$3); + ZEPHIR_INIT_NVAR(&_11$$3); + zephir_create_array(&_11$$3, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_12$$3); + zephir_fast_join_str(&_12$$3, SL(" AND "), &conditions TSRMLS_CC); + zephir_array_fast_append(&_11$$3, &_12$$3); + zephir_array_update_string(&_11$$3, SL("bind"), &bindParams, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&resultset, &referencedModel, "find", NULL, 0, &_11$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_15$$3, resultset, "delete", NULL, 0); + ZEPHIR_CALL_METHOD(&_13$$3, &resultset, "delete", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_15$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_13$$3)) { RETURN_MM_BOOL(0); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&relation); RETURN_MM_BOOL(1); } @@ -2572,116 +2944,148 @@ PHP_METHOD(Phalcon_Mvc_Model, _checkForeignKeysReverseCascade) { */ PHP_METHOD(Phalcon_Mvc_Model, _checkForeignKeysReverseRestrict) { - zval *_13$$3 = NULL; - HashTable *_2, *_7$$8; - HashPosition _1, _6$$8; - zval *manager = NULL, *relations = NULL, *foreignKey = NULL, *relation = NULL, *relationClass = NULL, *referencedModel = NULL, *fields = NULL, *referencedFields = NULL, *conditions = NULL, *bindParams = NULL, *position = NULL, *field = NULL, *value = NULL, *extraConditions = NULL, *message = NULL, *_0, **_3, *_4$$6 = NULL, **_8$$8, *_9$$9, *_10$$9 = NULL, *_11$$10 = NULL, *_12$$3 = NULL, *_14$$3 = NULL, *_15$$12 = NULL, *_16$$12 = NULL, *_19$$15; + zval _11$$3; + zend_string *_6$$8; + zend_ulong _5$$8; + zval manager, relations, foreignKey, relation, relationClass, referencedModel, fields, referencedFields, conditions, bindParams, position, field, value, extraConditions, message, _0, *_1, _2$$6, *_4$$8, _7$$9, _8$$9, _9$$10, _10$$3, _12$$3, _13$$12, _14$$12, _17$$15; zend_bool error = 0; - zephir_fcall_cache_entry *_5 = NULL, *_17 = NULL, *_18 = NULL; + zephir_fcall_cache_entry *_3 = NULL, *_15 = NULL, *_16 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, action = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&foreignKey); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&relationClass); + ZVAL_UNDEF(&referencedModel); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&referencedFields); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&extraConditions); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_10$$3); + ZVAL_UNDEF(&_12$$3); + ZVAL_UNDEF(&_13$$12); + ZVAL_UNDEF(&_14$$12); + ZVAL_UNDEF(&_17$$15); + ZVAL_UNDEF(&_11$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(manager, _0); - ZEPHIR_CALL_METHOD(&relations, manager, "gethasoneandhasmany", NULL, 0, this_ptr); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&manager, &_0); + ZEPHIR_CALL_METHOD(&relations, &manager, "gethasoneandhasmany", NULL, 0, this_ptr); zephir_check_call_status(); error = 0; - zephir_is_iterable(relations, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 2040); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(relation, _3); - ZEPHIR_CALL_METHOD(&foreignKey, relation, "getforeignkey", NULL, 0); + zephir_is_iterable(&relations, 0, "phalcon/mvc/model.zep", 2040); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&relations), _1) + { + ZEPHIR_INIT_NVAR(&relation); + ZVAL_COPY(&relation, _1); + ZEPHIR_CALL_METHOD(&foreignKey, &relation, "getforeignkey", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(foreignKey)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&foreignKey)) { continue; } action = 1; - if (Z_TYPE_P(foreignKey) == IS_ARRAY) { - if (zephir_array_isset_string(foreignKey, SS("action"))) { - ZEPHIR_OBS_NVAR(_4$$6); - zephir_array_fetch_string(&_4$$6, foreignKey, SL("action"), PH_NOISY, "phalcon/mvc/model.zep", 1968 TSRMLS_CC); - action = zephir_get_intval(_4$$6); + if (Z_TYPE_P(&foreignKey) == IS_ARRAY) { + if (zephir_array_isset_string(&foreignKey, SL("action"))) { + ZEPHIR_OBS_NVAR(&_2$$6); + zephir_array_fetch_string(&_2$$6, &foreignKey, SL("action"), PH_NOISY, "phalcon/mvc/model.zep", 1968 TSRMLS_CC); + action = zephir_get_intval(&_2$$6); } } if (action != 1) { continue; } - ZEPHIR_CALL_METHOD(&relationClass, relation, "getreferencedmodel", NULL, 0); + ZEPHIR_CALL_METHOD(&relationClass, &relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedModel, manager, "load", &_5, 0, relationClass); + ZEPHIR_CALL_METHOD(&referencedModel, &manager, "load", &_3, 0, &relationClass); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&fields, relation, "getfields", NULL, 0); + ZEPHIR_CALL_METHOD(&fields, &relation, "getfields", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedFields, relation, "getreferencedfields", NULL, 0); + ZEPHIR_CALL_METHOD(&referencedFields, &relation, "getreferencedfields", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(conditions); - array_init(conditions); - ZEPHIR_INIT_NVAR(bindParams); - array_init(bindParams); - if (Z_TYPE_P(fields) == IS_ARRAY) { - zephir_is_iterable(fields, &_7$$8, &_6$$8, 0, 0, "phalcon/mvc/model.zep", 2002); - for ( - ; zend_hash_get_current_data_ex(_7$$8, (void**) &_8$$8, &_6$$8) == SUCCESS - ; zend_hash_move_forward_ex(_7$$8, &_6$$8) - ) { - ZEPHIR_GET_HMKEY(position, _7$$8, _6$$8); - ZEPHIR_GET_HVALUE(field, _8$$8); - ZEPHIR_OBS_NVAR(value); - zephir_fetch_property_zval(&value, this_ptr, field, PH_SILENT_CC); - zephir_array_fetch(&_9$$9, referencedFields, position, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 1998 TSRMLS_CC); - ZEPHIR_INIT_LNVAR(_10$$9); - ZEPHIR_CONCAT_SVSV(_10$$9, "[", _9$$9, "] = ?", position); - zephir_array_append(&conditions, _10$$9, PH_SEPARATE, "phalcon/mvc/model.zep", 1998); - zephir_array_append(&bindParams, value, PH_SEPARATE, "phalcon/mvc/model.zep", 1999); - } + ZEPHIR_INIT_NVAR(&conditions); + array_init(&conditions); + ZEPHIR_INIT_NVAR(&bindParams); + array_init(&bindParams); + if (Z_TYPE_P(&fields) == IS_ARRAY) { + zephir_is_iterable(&fields, 0, "phalcon/mvc/model.zep", 2002); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _5$$8, _6$$8, _4$$8) + { + ZEPHIR_INIT_NVAR(&position); + if (_6$$8 != NULL) { + ZVAL_STR_COPY(&position, _6$$8); + } else { + ZVAL_LONG(&position, _5$$8); + } + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _4$$8); + ZEPHIR_OBS_NVAR(&value); + zephir_fetch_property_zval(&value, this_ptr, &field, PH_SILENT_CC); + zephir_array_fetch(&_7$$9, &referencedFields, &position, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 1998 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_8$$9); + ZEPHIR_CONCAT_SVSV(&_8$$9, "[", &_7$$9, "] = ?", &position); + zephir_array_append(&conditions, &_8$$9, PH_SEPARATE, "phalcon/mvc/model.zep", 1998); + zephir_array_append(&bindParams, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 1999); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_INIT_NVAR(&position); } else { - ZEPHIR_OBS_NVAR(value); - zephir_fetch_property_zval(&value, this_ptr, fields, PH_SILENT_CC); - ZEPHIR_INIT_LNVAR(_11$$10); - ZEPHIR_CONCAT_SVS(_11$$10, "[", referencedFields, "] = ?0"); - zephir_array_append(&conditions, _11$$10, PH_SEPARATE, "phalcon/mvc/model.zep", 2004); - zephir_array_append(&bindParams, value, PH_SEPARATE, "phalcon/mvc/model.zep", 2005); + ZEPHIR_OBS_NVAR(&value); + zephir_fetch_property_zval(&value, this_ptr, &fields, PH_SILENT_CC); + ZEPHIR_INIT_LNVAR(_9$$10); + ZEPHIR_CONCAT_SVS(&_9$$10, "[", &referencedFields, "] = ?0"); + zephir_array_append(&conditions, &_9$$10, PH_SEPARATE, "phalcon/mvc/model.zep", 2004); + zephir_array_append(&bindParams, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 2005); } - ZEPHIR_OBS_NVAR(extraConditions); - if (zephir_array_isset_string_fetch(&extraConditions, foreignKey, SS("conditions"), 0 TSRMLS_CC)) { - zephir_array_append(&conditions, extraConditions, PH_SEPARATE, "phalcon/mvc/model.zep", 2012); + ZEPHIR_OBS_NVAR(&extraConditions); + if (zephir_array_isset_string_fetch(&extraConditions, &foreignKey, SL("conditions"), 0)) { + zephir_array_append(&conditions, &extraConditions, PH_SEPARATE, "phalcon/mvc/model.zep", 2012); } - ZEPHIR_INIT_NVAR(_13$$3); - zephir_create_array(_13$$3, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_14$$3); - zephir_fast_join_str(_14$$3, SL(" AND "), conditions TSRMLS_CC); - zephir_array_fast_append(_13$$3, _14$$3); - zephir_array_update_string(&_13$$3, SL("bind"), &bindParams, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_12$$3, referencedModel, "count", NULL, 0, _13$$3); + ZEPHIR_INIT_NVAR(&_11$$3); + zephir_create_array(&_11$$3, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_12$$3); + zephir_fast_join_str(&_12$$3, SL(" AND "), &conditions TSRMLS_CC); + zephir_array_fast_append(&_11$$3, &_12$$3); + zephir_array_update_string(&_11$$3, SL("bind"), &bindParams, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&_10$$3, &referencedModel, "count", NULL, 0, &_11$$3); zephir_check_call_status(); - if (zephir_is_true(_12$$3)) { - ZEPHIR_OBS_NVAR(message); - if (!(zephir_array_isset_string_fetch(&message, foreignKey, SS("message"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(message); - ZEPHIR_CONCAT_SV(message, "Record is referenced by model ", relationClass); + if (zephir_is_true(&_10$$3)) { + ZEPHIR_OBS_NVAR(&message); + if (!(zephir_array_isset_string_fetch(&message, &foreignKey, SL("message"), 0))) { + ZEPHIR_INIT_NVAR(&message); + ZEPHIR_CONCAT_SV(&message, "Record is referenced by model ", &relationClass); } - ZEPHIR_INIT_NVAR(_15$$12); - object_init_ex(_15$$12, phalcon_mvc_model_message_ce); - ZEPHIR_INIT_NVAR(_16$$12); - ZVAL_STRING(_16$$12, "ConstraintViolation", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _15$$12, "__construct", &_17, 8, message, fields, _16$$12); - zephir_check_temp_parameter(_16$$12); + ZEPHIR_INIT_NVAR(&_13$$12); + object_init_ex(&_13$$12, phalcon_mvc_model_message_ce); + ZEPHIR_INIT_NVAR(&_14$$12); + ZVAL_STRING(&_14$$12, "ConstraintViolation"); + ZEPHIR_CALL_METHOD(NULL, &_13$$12, "__construct", &_15, 3, &message, &fields, &_14$$12); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_18, 0, _15$$12); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_16, 0, &_13$$12); zephir_check_call_status(); error = 1; break; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&relation); if (error == 1) { if (ZEPHIR_GLOBAL(orm).events) { - ZEPHIR_INIT_VAR(_19$$15); - ZVAL_STRING(_19$$15, "onValidationFails", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _19$$15); - zephir_check_temp_parameter(_19$$15); + ZEPHIR_INIT_VAR(&_17$$15); + ZVAL_STRING(&_17$$15, "onValidationFails"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_17$$15); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "_canceloperation", NULL, 0); zephir_check_call_status(); @@ -2697,12 +3101,54 @@ PHP_METHOD(Phalcon_Mvc_Model, _checkForeignKeysReverseRestrict) { */ PHP_METHOD(Phalcon_Mvc_Model, _preSave) { - HashTable *_8$$12; - HashPosition _7$$12; - zephir_fcall_cache_entry *_12 = NULL, *_20 = NULL; + zephir_fcall_cache_entry *_10 = NULL, *_18 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zend_bool exists, error = 0, isNull = 0, _13$$27, _14$$27, _15$$27; - zval *metaData, *exists_param = NULL, *identityField, *notNull = NULL, *columnMap = NULL, *dataTypeNumeric = NULL, *automaticAttributes = NULL, *defaultValues = NULL, *field = NULL, *attributeField = NULL, *value = NULL, *emptyStringValues = NULL, *_22 = NULL, *_23, *_0$$3 = NULL, *_1$$3, *_2$$5 = NULL, *_3$$5, *_4$$7 = NULL, *_5$$7, *_6$$9 = NULL, **_9$$12, *_10$$20 = NULL, *_11$$20 = NULL, *_16$$27, *_17$$32 = NULL, *_18$$32 = NULL, *_19$$32 = NULL, *_21$$37, *_24$$39, *_25$$41 = NULL, *_26$$41, *_27$$43 = NULL, *_28$$43, *_29$$40 = NULL, *_30$$40 = NULL, *_31$$40 = NULL, *_36$$40, *_32$$47 = NULL, *_33$$47, *_34$$49 = NULL, *_35$$49; + zend_bool exists, error = 0, isNull = 0, _11$$27, _12$$27, _13$$27; + zval *metaData, metaData_sub, *exists_param = NULL, *identityField, identityField_sub, __$true, __$false, notNull, columnMap, dataTypeNumeric, automaticAttributes, defaultValues, field, attributeField, value, emptyStringValues, _20, _21, _0$$3, _1$$3, _2$$5, _3$$5, _4$$7, _5$$7, _6$$9, *_7$$12, _8$$20, _9$$20, _14$$27, _15$$32, _16$$32, _17$$32, _19$$37, _22$$39, _23$$41, _24$$41, _25$$43, _26$$43, _27$$40, _28$$40, _29$$40, _34$$40, _30$$47, _31$$47, _32$$49, _33$$49; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&metaData_sub); + ZVAL_UNDEF(&identityField_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(¬Null); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&dataTypeNumeric); + ZVAL_UNDEF(&automaticAttributes); + ZVAL_UNDEF(&defaultValues); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&attributeField); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&emptyStringValues); + ZVAL_UNDEF(&_20); + ZVAL_UNDEF(&_21); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$9); + ZVAL_UNDEF(&_8$$20); + ZVAL_UNDEF(&_9$$20); + ZVAL_UNDEF(&_14$$27); + ZVAL_UNDEF(&_15$$32); + ZVAL_UNDEF(&_16$$32); + ZVAL_UNDEF(&_17$$32); + ZVAL_UNDEF(&_19$$37); + ZVAL_UNDEF(&_22$$39); + ZVAL_UNDEF(&_23$$41); + ZVAL_UNDEF(&_24$$41); + ZVAL_UNDEF(&_25$$43); + ZVAL_UNDEF(&_26$$43); + ZVAL_UNDEF(&_27$$40); + ZVAL_UNDEF(&_28$$40); + ZVAL_UNDEF(&_29$$40); + ZVAL_UNDEF(&_34$$40); + ZVAL_UNDEF(&_30$$47); + ZVAL_UNDEF(&_31$$47); + ZVAL_UNDEF(&_32$$49); + ZVAL_UNDEF(&_33$$49); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &metaData, &exists_param, &identityField); @@ -2711,53 +3157,50 @@ PHP_METHOD(Phalcon_Mvc_Model, _preSave) { if (ZEPHIR_GLOBAL(orm).events) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "beforeValidation", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "fireeventcancel", NULL, 0, _1$$3); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "beforeValidation"); + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "fireeventcancel", NULL, 0, &_1$$3); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0$$3)) { RETURN_MM_BOOL(0); } if (!(exists)) { - ZEPHIR_INIT_VAR(_3$$5); - ZVAL_STRING(_3$$5, "beforeValidationOnCreate", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2$$5, this_ptr, "fireeventcancel", NULL, 0, _3$$5); - zephir_check_temp_parameter(_3$$5); + ZEPHIR_INIT_VAR(&_3$$5); + ZVAL_STRING(&_3$$5, "beforeValidationOnCreate"); + ZEPHIR_CALL_METHOD(&_2$$5, this_ptr, "fireeventcancel", NULL, 0, &_3$$5); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_2$$5)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_2$$5)) { RETURN_MM_BOOL(0); } } else { - ZEPHIR_INIT_VAR(_5$$7); - ZVAL_STRING(_5$$7, "beforeValidationOnUpdate", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_4$$7, this_ptr, "fireeventcancel", NULL, 0, _5$$7); - zephir_check_temp_parameter(_5$$7); + ZEPHIR_INIT_VAR(&_5$$7); + ZVAL_STRING(&_5$$7, "beforeValidationOnUpdate"); + ZEPHIR_CALL_METHOD(&_4$$7, this_ptr, "fireeventcancel", NULL, 0, &_5$$7); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_4$$7)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_4$$7)) { RETURN_MM_BOOL(0); } } } if (ZEPHIR_GLOBAL(orm).virtual_foreign_keys) { - ZEPHIR_CALL_METHOD(&_6$$9, this_ptr, "_checkforeignkeysrestrict", NULL, 334); + ZEPHIR_CALL_METHOD(&_6$$9, this_ptr, "_checkforeignkeysrestrict", NULL, 294); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_6$$9)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$9)) { RETURN_MM_BOOL(0); } } if (ZEPHIR_GLOBAL(orm).not_null_validations) { ZEPHIR_CALL_METHOD(¬Null, metaData, "getnotnullattributes", NULL, 0, this_ptr); zephir_check_call_status(); - if (Z_TYPE_P(notNull) == IS_ARRAY) { + if (Z_TYPE_P(¬Null) == IS_ARRAY) { ZEPHIR_CALL_METHOD(&dataTypeNumeric, metaData, "getdatatypesnumeric", NULL, 0, this_ptr); zephir_check_call_status(); if (ZEPHIR_GLOBAL(orm).column_renaming) { ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, this_ptr); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } if (exists) { ZEPHIR_CALL_METHOD(&automaticAttributes, metaData, "getautomaticupdateattributes", NULL, 0, this_ptr); @@ -2771,58 +3214,57 @@ PHP_METHOD(Phalcon_Mvc_Model, _preSave) { ZEPHIR_CALL_METHOD(&emptyStringValues, metaData, "getemptystringattributes", NULL, 0, this_ptr); zephir_check_call_status(); error = 0; - zephir_is_iterable(notNull, &_8$$12, &_7$$12, 0, 0, "phalcon/mvc/model.zep", 2207); - for ( - ; zend_hash_get_current_data_ex(_8$$12, (void**) &_9$$12, &_7$$12) == SUCCESS - ; zend_hash_move_forward_ex(_8$$12, &_7$$12) - ) { - ZEPHIR_GET_HVALUE(field, _9$$12); - if (!(zephir_array_isset(automaticAttributes, field))) { + zephir_is_iterable(¬Null, 0, "phalcon/mvc/model.zep", 2207); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(¬Null), _7$$12) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _7$$12); + if (!(zephir_array_isset(&automaticAttributes, &field))) { isNull = 0; - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_10$$20); - object_init_ex(_10$$20, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_11$$20); - ZEPHIR_CONCAT_SVS(_11$$20, "Column '", field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _10$$20, "__construct", &_12, 9, _11$$20); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_8$$20); + object_init_ex(&_8$$20, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_9$$20); + ZEPHIR_CONCAT_SVS(&_9$$20, "Column '", &field, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_8$$20, "__construct", &_10, 4, &_9$$20); zephir_check_call_status(); - zephir_throw_exception_debug(_10$$20, "phalcon/mvc/model.zep", 2142 TSRMLS_CC); + zephir_throw_exception_debug(&_8$$20, "phalcon/mvc/model.zep", 2142 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeField, field); + ZEPHIR_CPY_WRT(&attributeField, &field); } - ZEPHIR_OBS_NVAR(value); - if (zephir_fetch_property_zval(&value, this_ptr, attributeField, PH_SILENT_CC)) { - if (Z_TYPE_P(value) != IS_OBJECT) { - if (!(zephir_array_isset(dataTypeNumeric, field))) { - if (zephir_array_isset(emptyStringValues, field)) { - if (Z_TYPE_P(value) == IS_NULL) { + ZEPHIR_OBS_NVAR(&value); + if (zephir_fetch_property_zval(&value, this_ptr, &attributeField, PH_SILENT_CC)) { + if (Z_TYPE_P(&value) != IS_OBJECT) { + if (!(zephir_array_isset(&dataTypeNumeric, &field))) { + if (zephir_array_isset(&emptyStringValues, &field)) { + if (Z_TYPE_P(&value) == IS_NULL) { isNull = 1; } } else { - _13$$27 = Z_TYPE_P(value) == IS_NULL; - if (!(_13$$27)) { - _14$$27 = ZEPHIR_IS_STRING_IDENTICAL(value, ""); - if (_14$$27) { - _15$$27 = !(zephir_array_isset(defaultValues, field)); - if (!(_15$$27)) { - zephir_array_fetch(&_16$$27, defaultValues, field, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 2165 TSRMLS_CC); - _15$$27 = !ZEPHIR_IS_IDENTICAL(value, _16$$27); + _11$$27 = Z_TYPE_P(&value) == IS_NULL; + if (!(_11$$27)) { + _12$$27 = ZEPHIR_IS_STRING_IDENTICAL(&value, ""); + if (_12$$27) { + _13$$27 = !(zephir_array_isset(&defaultValues, &field)); + if (!(_13$$27)) { + zephir_array_fetch(&_14$$27, &defaultValues, &field, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 2165 TSRMLS_CC); + _13$$27 = !ZEPHIR_IS_IDENTICAL(&value, &_14$$27); } - _14$$27 = _15$$27; + _12$$27 = _13$$27; } - _13$$27 = _14$$27; + _11$$27 = _12$$27; } - if (_13$$27) { + if (_11$$27) { isNull = 1; } } } else { - if (!(zephir_is_numeric(value))) { + if (!(zephir_is_numeric(&value))) { isNull = 1; } } @@ -2832,33 +3274,32 @@ PHP_METHOD(Phalcon_Mvc_Model, _preSave) { } if (isNull == 1) { if (!(exists)) { - if (ZEPHIR_IS_EQUAL(field, identityField)) { + if (ZEPHIR_IS_EQUAL(&field, identityField)) { continue; } - if (zephir_array_isset(defaultValues, field)) { + if (zephir_array_isset(&defaultValues, &field)) { continue; } } - ZEPHIR_INIT_NVAR(_17$$32); - object_init_ex(_17$$32, phalcon_mvc_model_message_ce); - ZEPHIR_INIT_LNVAR(_18$$32); - ZEPHIR_CONCAT_VS(_18$$32, attributeField, " is required"); - ZEPHIR_INIT_NVAR(_19$$32); - ZVAL_STRING(_19$$32, "PresenceOf", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _17$$32, "__construct", &_20, 8, _18$$32, attributeField, _19$$32); - zephir_check_temp_parameter(_19$$32); + ZEPHIR_INIT_NVAR(&_15$$32); + object_init_ex(&_15$$32, phalcon_mvc_model_message_ce); + ZEPHIR_INIT_LNVAR(_16$$32); + ZEPHIR_CONCAT_VS(&_16$$32, &attributeField, " is required"); + ZEPHIR_INIT_NVAR(&_17$$32); + ZVAL_STRING(&_17$$32, "PresenceOf"); + ZEPHIR_CALL_METHOD(NULL, &_15$$32, "__construct", &_18, 3, &_16$$32, &attributeField, &_17$$32); zephir_check_call_status(); - zephir_update_property_array_append(this_ptr, SL("_errorMessages"), _17$$32 TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_errorMessages"), &_15$$32 TSRMLS_CC); error = 1; } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); if (error == 1) { if (ZEPHIR_GLOBAL(orm).events) { - ZEPHIR_INIT_VAR(_21$$37); - ZVAL_STRING(_21$$37, "onValidationFails", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _21$$37); - zephir_check_temp_parameter(_21$$37); + ZEPHIR_INIT_VAR(&_19$$37); + ZVAL_STRING(&_19$$37, "onValidationFails"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_19$$37); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "_canceloperation", NULL, 0); zephir_check_call_status(); @@ -2867,83 +3308,75 @@ PHP_METHOD(Phalcon_Mvc_Model, _preSave) { } } } - ZEPHIR_INIT_VAR(_23); - ZVAL_STRING(_23, "validation", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_22, this_ptr, "fireeventcancel", NULL, 0, _23); - zephir_check_temp_parameter(_23); + ZEPHIR_INIT_VAR(&_21); + ZVAL_STRING(&_21, "validation"); + ZEPHIR_CALL_METHOD(&_20, this_ptr, "fireeventcancel", NULL, 0, &_21); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_22)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_20)) { if (ZEPHIR_GLOBAL(orm).events) { - ZEPHIR_INIT_VAR(_24$$39); - ZVAL_STRING(_24$$39, "onValidationFails", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _24$$39); - zephir_check_temp_parameter(_24$$39); + ZEPHIR_INIT_VAR(&_22$$39); + ZVAL_STRING(&_22$$39, "onValidationFails"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_22$$39); zephir_check_call_status(); } RETURN_MM_BOOL(0); } if (ZEPHIR_GLOBAL(orm).events) { if (!(exists)) { - ZEPHIR_INIT_VAR(_26$$41); - ZVAL_STRING(_26$$41, "afterValidationOnCreate", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_25$$41, this_ptr, "fireeventcancel", NULL, 0, _26$$41); - zephir_check_temp_parameter(_26$$41); + ZEPHIR_INIT_VAR(&_24$$41); + ZVAL_STRING(&_24$$41, "afterValidationOnCreate"); + ZEPHIR_CALL_METHOD(&_23$$41, this_ptr, "fireeventcancel", NULL, 0, &_24$$41); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_25$$41)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_23$$41)) { RETURN_MM_BOOL(0); } } else { - ZEPHIR_INIT_VAR(_28$$43); - ZVAL_STRING(_28$$43, "afterValidationOnUpdate", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_27$$43, this_ptr, "fireeventcancel", NULL, 0, _28$$43); - zephir_check_temp_parameter(_28$$43); + ZEPHIR_INIT_VAR(&_26$$43); + ZVAL_STRING(&_26$$43, "afterValidationOnUpdate"); + ZEPHIR_CALL_METHOD(&_25$$43, this_ptr, "fireeventcancel", NULL, 0, &_26$$43); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_27$$43)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_25$$43)) { RETURN_MM_BOOL(0); } } - ZEPHIR_INIT_VAR(_30$$40); - ZVAL_STRING(_30$$40, "afterValidation", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_29$$40, this_ptr, "fireeventcancel", NULL, 0, _30$$40); - zephir_check_temp_parameter(_30$$40); + ZEPHIR_INIT_VAR(&_28$$40); + ZVAL_STRING(&_28$$40, "afterValidation"); + ZEPHIR_CALL_METHOD(&_27$$40, this_ptr, "fireeventcancel", NULL, 0, &_28$$40); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_29$$40)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_27$$40)) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_NVAR(_30$$40); - ZVAL_STRING(_30$$40, "beforeSave", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_31$$40, this_ptr, "fireeventcancel", NULL, 0, _30$$40); - zephir_check_temp_parameter(_30$$40); + ZEPHIR_INIT_NVAR(&_28$$40); + ZVAL_STRING(&_28$$40, "beforeSave"); + ZEPHIR_CALL_METHOD(&_29$$40, this_ptr, "fireeventcancel", NULL, 0, &_28$$40); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_31$$40)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_29$$40)) { RETURN_MM_BOOL(0); } if (0) { - zephir_update_property_this(getThis(), SL("_skipped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_skipped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_skipped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_skipped"), &__$false); } if (exists) { - ZEPHIR_INIT_VAR(_33$$47); - ZVAL_STRING(_33$$47, "beforeUpdate", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_32$$47, this_ptr, "fireeventcancel", NULL, 0, _33$$47); - zephir_check_temp_parameter(_33$$47); + ZEPHIR_INIT_VAR(&_31$$47); + ZVAL_STRING(&_31$$47, "beforeUpdate"); + ZEPHIR_CALL_METHOD(&_30$$47, this_ptr, "fireeventcancel", NULL, 0, &_31$$47); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_32$$47)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_30$$47)) { RETURN_MM_BOOL(0); } } else { - ZEPHIR_INIT_VAR(_35$$49); - ZVAL_STRING(_35$$49, "beforeCreate", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_34$$49, this_ptr, "fireeventcancel", NULL, 0, _35$$49); - zephir_check_temp_parameter(_35$$49); + ZEPHIR_INIT_VAR(&_33$$49); + ZVAL_STRING(&_33$$49, "beforeCreate"); + ZEPHIR_CALL_METHOD(&_32$$49, this_ptr, "fireeventcancel", NULL, 0, &_33$$49); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_34$$49)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_32$$49)) { RETURN_MM_BOOL(0); } } - _36$$40 = zephir_fetch_nproperty_this(this_ptr, SL("_skipped"), PH_NOISY_CC); - if (ZEPHIR_IS_TRUE_IDENTICAL(_36$$40)) { + zephir_read_property(&_34$$40, this_ptr, SL("_skipped"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_34$$40)) { RETURN_MM_BOOL(1); } } @@ -2957,8 +3390,12 @@ PHP_METHOD(Phalcon_Mvc_Model, _preSave) { PHP_METHOD(Phalcon_Mvc_Model, _postSave) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *success_param = NULL, *exists_param = NULL, *_0$$4, *_1$$5; + zval *success_param = NULL, *exists_param = NULL, _0$$4, _1$$5; zend_bool success, exists; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &success_param, &exists_param); @@ -2969,16 +3406,14 @@ PHP_METHOD(Phalcon_Mvc_Model, _postSave) { if (success == 1) { if (exists) { - ZEPHIR_INIT_VAR(_0$$4); - ZVAL_STRING(_0$$4, "afterUpdate", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _0$$4); - zephir_check_temp_parameter(_0$$4); + ZEPHIR_INIT_VAR(&_0$$4); + ZVAL_STRING(&_0$$4, "afterUpdate"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_0$$4); zephir_check_call_status(); } else { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_STRING(_1$$5, "afterCreate", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _1$$5); - zephir_check_temp_parameter(_1$$5); + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_STRING(&_1$$5, "afterCreate"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_1$$5); zephir_check_call_status(); } } @@ -2997,30 +3432,69 @@ PHP_METHOD(Phalcon_Mvc_Model, _postSave) { */ PHP_METHOD(Phalcon_Mvc_Model, _doLowInsert) { - HashTable *_2; - HashPosition _1; - zend_bool useExplicitIdentity = 0, _19, _21, _23, _7$$11, _16$$23; - zephir_fcall_cache_entry *_6 = NULL, *_8 = NULL, *_12 = NULL; + zend_bool useExplicitIdentity = 0, _17, _19, _21, _5$$11, _14$$23; + zephir_fcall_cache_entry *_4 = NULL, *_6 = NULL, *_10 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *metaData, *connection, *table, *identityField, *bindSkip = NULL, *fields = NULL, *values = NULL, *bindTypes = NULL, *attributes = NULL, *bindDataTypes = NULL, *automaticAttributes = NULL, *field = NULL, *columnMap = NULL, *value = NULL, *attributeField = NULL, *success = NULL, *bindType = NULL, *defaultValue = NULL, *sequenceName = NULL, *defaultValues = NULL, *source = NULL, *schema = NULL, *snapshot = NULL, *lastInsertedId = NULL, *manager = NULL, *_0, **_3, *_22 = NULL, *_4$$8 = NULL, *_5$$8 = NULL, *_9$$14 = NULL, *_10$$14 = NULL, *_11$$16 = NULL, *_13$$18 = NULL, *_14$$21, *_15$$21, *_17$$28, *_18$$28, *_20$$31 = NULL; + zval *metaData, metaData_sub, *connection, connection_sub, *table, table_sub, *identityField, identityField_sub, __$null, bindSkip, fields, values, bindTypes, attributes, bindDataTypes, automaticAttributes, field, columnMap, value, attributeField, success, bindType, defaultValue, sequenceName, defaultValues, source, schema, snapshot, lastInsertedId, manager, _0, *_1, _20, _2$$8, _3$$8, _7$$14, _8$$14, _9$$16, _11$$18, _12$$21, _13$$21, _15$$28, _16$$28, _18$$31; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&metaData_sub); + ZVAL_UNDEF(&connection_sub); + ZVAL_UNDEF(&table_sub); + ZVAL_UNDEF(&identityField_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&bindSkip); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&bindDataTypes); + ZVAL_UNDEF(&automaticAttributes); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&attributeField); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&bindType); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&sequenceName); + ZVAL_UNDEF(&defaultValues); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&lastInsertedId); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_20); + ZVAL_UNDEF(&_2$$8); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_7$$14); + ZVAL_UNDEF(&_8$$14); + ZVAL_UNDEF(&_9$$16); + ZVAL_UNDEF(&_11$$18); + ZVAL_UNDEF(&_12$$21); + ZVAL_UNDEF(&_13$$21); + ZVAL_UNDEF(&_15$$28); + ZVAL_UNDEF(&_16$$28); + ZVAL_UNDEF(&_18$$31); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &metaData, &connection, &table, &identityField); - ZEPHIR_INIT_VAR(bindSkip); - ZVAL_LONG(bindSkip, 1024); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(manager, _0); - ZEPHIR_INIT_VAR(fields); - array_init(fields); - ZEPHIR_INIT_VAR(values); - array_init(values); - ZEPHIR_INIT_VAR(snapshot); - array_init(snapshot); - ZEPHIR_INIT_VAR(bindTypes); - array_init(bindTypes); + ZEPHIR_INIT_VAR(&bindSkip); + ZVAL_LONG(&bindSkip, 1024); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&manager, &_0); + ZEPHIR_INIT_VAR(&fields); + array_init(&fields); + ZEPHIR_INIT_VAR(&values); + array_init(&values); + ZEPHIR_INIT_VAR(&snapshot); + array_init(&snapshot); + ZEPHIR_INIT_VAR(&bindTypes); + array_init(&bindTypes); ZEPHIR_CALL_METHOD(&attributes, metaData, "getattributes", NULL, 0, this_ptr); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&bindDataTypes, metaData, "getbindtypes", NULL, 0, this_ptr); @@ -3033,152 +3507,152 @@ PHP_METHOD(Phalcon_Mvc_Model, _doLowInsert) { ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, this_ptr); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); - } - zephir_is_iterable(attributes, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 2400); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(field, _3); - if (!(zephir_array_isset(automaticAttributes, field))) { - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_4$$8); - object_init_ex(_4$$8, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_5$$8); - ZEPHIR_CONCAT_SVS(_5$$8, "Column '", field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _4$$8, "__construct", &_6, 9, _5$$8); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); + } + zephir_is_iterable(&attributes, 0, "phalcon/mvc/model.zep", 2400); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _1) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _1); + if (!(zephir_array_isset(&automaticAttributes, &field))) { + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_2$$8); + object_init_ex(&_2$$8, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_3$$8); + ZEPHIR_CONCAT_SVS(&_3$$8, "Column '", &field, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_2$$8, "__construct", &_4, 4, &_3$$8); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$8, "phalcon/mvc/model.zep", 2347 TSRMLS_CC); + zephir_throw_exception_debug(&_2$$8, "phalcon/mvc/model.zep", 2347 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeField, field); + ZEPHIR_CPY_WRT(&attributeField, &field); } - if (!ZEPHIR_IS_EQUAL(field, identityField)) { - ZEPHIR_OBS_NVAR(value); - if (zephir_fetch_property_zval(&value, this_ptr, attributeField, PH_SILENT_CC)) { - _7$$11 = Z_TYPE_P(value) == IS_NULL; - if (_7$$11) { - _7$$11 = zephir_array_isset(defaultValues, field); + if (!ZEPHIR_IS_EQUAL(&field, identityField)) { + ZEPHIR_OBS_NVAR(&value); + if (zephir_fetch_property_zval(&value, this_ptr, &attributeField, PH_SILENT_CC)) { + _5$$11 = Z_TYPE_P(&value) == IS_NULL; + if (_5$$11) { + _5$$11 = zephir_array_isset(&defaultValues, &field); } - if (_7$$11) { - zephir_array_update_zval(&snapshot, attributeField, &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&value, connection, "getdefaultvalue", &_8, 0); + if (_5$$11) { + zephir_array_update_zval(&snapshot, &attributeField, &__$null, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&value, connection, "getdefaultvalue", &_6, 0); zephir_check_call_status(); } else { - zephir_array_update_zval(&snapshot, attributeField, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&snapshot, &attributeField, &value, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_NVAR(bindType); - if (!(zephir_array_isset_fetch(&bindType, bindDataTypes, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_9$$14); - object_init_ex(_9$$14, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_10$$14); - ZEPHIR_CONCAT_SVS(_10$$14, "Column '", field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, _9$$14, "__construct", &_6, 9, _10$$14); + ZEPHIR_OBS_NVAR(&bindType); + if (!(zephir_array_isset_fetch(&bindType, &bindDataTypes, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_7$$14); + object_init_ex(&_7$$14, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_8$$14); + ZEPHIR_CONCAT_SVS(&_8$$14, "Column '", &field, "' have not defined a bind data type"); + ZEPHIR_CALL_METHOD(NULL, &_7$$14, "__construct", &_4, 4, &_8$$14); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$14, "phalcon/mvc/model.zep", 2374 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$14, "phalcon/mvc/model.zep", 2374 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&fields, field, PH_SEPARATE, "phalcon/mvc/model.zep", 2377); - zephir_array_append(&values, value, PH_SEPARATE, "phalcon/mvc/model.zep", 2377); - zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 2377); + zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/mvc/model.zep", 2377); + zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 2377); + zephir_array_append(&bindTypes, &bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 2377); } else { - if (zephir_array_isset(defaultValues, field)) { - ZEPHIR_CALL_METHOD(&_11$$16, connection, "getdefaultvalue", &_12, 0); + if (zephir_array_isset(&defaultValues, &field)) { + ZEPHIR_CALL_METHOD(&_9$$16, connection, "getdefaultvalue", &_10, 0); zephir_check_call_status(); - zephir_array_append(&values, _11$$16, PH_SEPARATE, "phalcon/mvc/model.zep", 2381); - zephir_array_update_zval(&snapshot, attributeField, &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); + zephir_array_append(&values, &_9$$16, PH_SEPARATE, "phalcon/mvc/model.zep", 2381); + zephir_array_update_zval(&snapshot, &attributeField, &__$null, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&values, value, PH_SEPARATE, "phalcon/mvc/model.zep", 2387); - zephir_array_update_zval(&snapshot, attributeField, &value, PH_COPY | PH_SEPARATE); + zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 2387); + zephir_array_update_zval(&snapshot, &attributeField, &value, PH_COPY | PH_SEPARATE); } - zephir_array_append(&fields, field, PH_SEPARATE, "phalcon/mvc/model.zep", 2391); - zephir_array_append(&bindTypes, bindSkip, PH_SEPARATE, "phalcon/mvc/model.zep", 2391); + zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/mvc/model.zep", 2391); + zephir_array_append(&bindTypes, &bindSkip, PH_SEPARATE, "phalcon/mvc/model.zep", 2391); } } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); if (!ZEPHIR_IS_FALSE_IDENTICAL(identityField)) { ZEPHIR_CALL_METHOD(&defaultValue, connection, "getdefaultidvalue", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_13$$18, connection, "useexplicitidvalue", NULL, 0); + ZEPHIR_CALL_METHOD(&_11$$18, connection, "useexplicitidvalue", NULL, 0); zephir_check_call_status(); - useExplicitIdentity = zephir_get_boolval(_13$$18); + useExplicitIdentity = zephir_get_boolval(&_11$$18); if (useExplicitIdentity) { zephir_array_append(&fields, identityField, PH_SEPARATE, "phalcon/mvc/model.zep", 2409); } - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, identityField, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_14$$21); - object_init_ex(_14$$21, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_15$$21); - ZEPHIR_CONCAT_SVS(_15$$21, "Identity column '", identityField, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _14$$21, "__construct", &_6, 9, _15$$21); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, identityField, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_12$$21); + object_init_ex(&_12$$21, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_13$$21); + ZEPHIR_CONCAT_SVS(&_13$$21, "Identity column '", identityField, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_12$$21, "__construct", &_4, 4, &_13$$21); zephir_check_call_status(); - zephir_throw_exception_debug(_14$$21, "phalcon/mvc/model.zep", 2417 TSRMLS_CC); + zephir_throw_exception_debug(&_12$$21, "phalcon/mvc/model.zep", 2417 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeField, identityField); + ZEPHIR_CPY_WRT(&attributeField, identityField); } - ZEPHIR_OBS_NVAR(value); - if (zephir_fetch_property_zval(&value, this_ptr, attributeField, PH_SILENT_CC)) { - _16$$23 = Z_TYPE_P(value) == IS_NULL; - if (!(_16$$23)) { - _16$$23 = ZEPHIR_IS_STRING_IDENTICAL(value, ""); + ZEPHIR_OBS_NVAR(&value); + if (zephir_fetch_property_zval(&value, this_ptr, &attributeField, PH_SILENT_CC)) { + _14$$23 = Z_TYPE_P(&value) == IS_NULL; + if (!(_14$$23)) { + _14$$23 = ZEPHIR_IS_STRING_IDENTICAL(&value, ""); } - if (_16$$23) { + if (_14$$23) { if (useExplicitIdentity) { - zephir_array_append(&values, defaultValue, PH_SEPARATE, "phalcon/mvc/model.zep", 2430); - zephir_array_append(&bindTypes, bindSkip, PH_SEPARATE, "phalcon/mvc/model.zep", 2430); + zephir_array_append(&values, &defaultValue, PH_SEPARATE, "phalcon/mvc/model.zep", 2430); + zephir_array_append(&bindTypes, &bindSkip, PH_SEPARATE, "phalcon/mvc/model.zep", 2430); } } else { if (!(useExplicitIdentity)) { zephir_array_append(&fields, identityField, PH_SEPARATE, "phalcon/mvc/model.zep", 2438); } - ZEPHIR_OBS_NVAR(bindType); - if (!(zephir_array_isset_fetch(&bindType, bindDataTypes, identityField, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_17$$28); - object_init_ex(_17$$28, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_18$$28); - ZEPHIR_CONCAT_SVS(_18$$28, "Identity column '", identityField, "' isn\\'t part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, _17$$28, "__construct", &_6, 9, _18$$28); + ZEPHIR_OBS_NVAR(&bindType); + if (!(zephir_array_isset_fetch(&bindType, &bindDataTypes, identityField, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_15$$28); + object_init_ex(&_15$$28, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_16$$28); + ZEPHIR_CONCAT_SVS(&_16$$28, "Identity column '", identityField, "' isn\\'t part of the table columns"); + ZEPHIR_CALL_METHOD(NULL, &_15$$28, "__construct", &_4, 4, &_16$$28); zephir_check_call_status(); - zephir_throw_exception_debug(_17$$28, "phalcon/mvc/model.zep", 2445 TSRMLS_CC); + zephir_throw_exception_debug(&_15$$28, "phalcon/mvc/model.zep", 2445 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&values, value, PH_SEPARATE, "phalcon/mvc/model.zep", 2448); - zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 2448); + zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 2448); + zephir_array_append(&bindTypes, &bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 2448); } } else { if (useExplicitIdentity) { - zephir_array_append(&values, defaultValue, PH_SEPARATE, "phalcon/mvc/model.zep", 2452); - zephir_array_append(&bindTypes, bindSkip, PH_SEPARATE, "phalcon/mvc/model.zep", 2452); + zephir_array_append(&values, &defaultValue, PH_SEPARATE, "phalcon/mvc/model.zep", 2452); + zephir_array_append(&bindTypes, &bindSkip, PH_SEPARATE, "phalcon/mvc/model.zep", 2452); } } } - ZEPHIR_CALL_METHOD(&success, connection, "insert", NULL, 0, table, values, fields, bindTypes); + ZEPHIR_CALL_METHOD(&success, connection, "insert", NULL, 0, table, &values, &fields, &bindTypes); zephir_check_call_status(); - _19 = zephir_is_true(success); - if (_19) { - _19 = !ZEPHIR_IS_FALSE_IDENTICAL(identityField); + _17 = zephir_is_true(&success); + if (_17) { + _17 = !ZEPHIR_IS_FALSE_IDENTICAL(identityField); } - if (_19) { - ZEPHIR_INIT_VAR(sequenceName); - ZVAL_NULL(sequenceName); - ZEPHIR_CALL_METHOD(&_20$$31, connection, "supportsequences", NULL, 0); + if (_17) { + ZEPHIR_INIT_VAR(&sequenceName); + ZVAL_NULL(&sequenceName); + ZEPHIR_CALL_METHOD(&_18$$31, connection, "supportsequences", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(_20$$31)) { - if ((zephir_method_exists_ex(this_ptr, SS("getsequencename") TSRMLS_CC) == SUCCESS)) { + if (ZEPHIR_IS_TRUE_IDENTICAL(&_18$$31)) { + if ((zephir_method_exists_ex(this_ptr, SL("getsequencename") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(&sequenceName, this_ptr, "getsequencename", NULL, 0); zephir_check_call_status(); } else { @@ -3186,34 +3660,34 @@ PHP_METHOD(Phalcon_Mvc_Model, _doLowInsert) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(sequenceName); - if (ZEPHIR_IS_EMPTY(schema)) { - ZEPHIR_CONCAT_VSVS(sequenceName, source, "_", identityField, "_seq"); + ZEPHIR_INIT_NVAR(&sequenceName); + if (ZEPHIR_IS_EMPTY(&schema)) { + ZEPHIR_CONCAT_VSVS(&sequenceName, &source, "_", identityField, "_seq"); } else { - ZEPHIR_CONCAT_VSVSVS(sequenceName, schema, ".", source, "_", identityField, "_seq"); + ZEPHIR_CONCAT_VSVSVS(&sequenceName, &schema, ".", &source, "_", identityField, "_seq"); } } } - ZEPHIR_CALL_METHOD(&lastInsertedId, connection, "lastinsertid", NULL, 0, sequenceName); + ZEPHIR_CALL_METHOD(&lastInsertedId, connection, "lastinsertid", NULL, 0, &sequenceName); zephir_check_call_status(); - zephir_update_property_zval_zval(getThis(), attributeField, lastInsertedId TSRMLS_CC); - zephir_array_update_zval(&snapshot, attributeField, &lastInsertedId, PH_COPY | PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_uniqueParams"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, &attributeField, &lastInsertedId TSRMLS_CC); + zephir_array_update_zval(&snapshot, &attributeField, &lastInsertedId, PH_COPY | PH_SEPARATE); + zephir_update_property_zval(this_ptr, SL("_uniqueParams"), &__$null); } - _21 = zephir_is_true(success); - if (_21) { - ZEPHIR_CALL_METHOD(&_22, manager, "iskeepingsnapshots", NULL, 0, this_ptr); + _19 = zephir_is_true(&success); + if (_19) { + ZEPHIR_CALL_METHOD(&_20, &manager, "iskeepingsnapshots", NULL, 0, this_ptr); zephir_check_call_status(); - _21 = zephir_is_true(_22); + _19 = zephir_is_true(&_20); } - _23 = _21; - if (_23) { - _23 = ZEPHIR_GLOBAL(orm).update_snapshot_on_save; + _21 = _19; + if (_21) { + _21 = ZEPHIR_GLOBAL(orm).update_snapshot_on_save; } - if (_23) { - zephir_update_property_this(getThis(), SL("_snapshot"), snapshot TSRMLS_CC); + if (_21) { + zephir_update_property_zval(this_ptr, SL("_snapshot"), &snapshot); } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -3227,39 +3701,83 @@ PHP_METHOD(Phalcon_Mvc_Model, _doLowInsert) { */ PHP_METHOD(Phalcon_Mvc_Model, _doLowUpdate) { - zval *_15$$25 = NULL, *_16$$25 = NULL; - zval *_22; - HashTable *_3, *_18$$31; - HashPosition _2, _17$$31; - zend_bool useDynamicUpdate = 0, changed = 0, _23, _24; - zephir_fcall_cache_entry *_7 = NULL, *_13 = NULL; + zval _13$$25, _14$$25; + zval _18; + zend_bool useDynamicUpdate = 0, changed = 0, _19, _20; + zephir_fcall_cache_entry *_5 = NULL, *_11 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *metaData, *connection, *table, *bindSkip = NULL, *fields = NULL, *values = NULL, *dataType = NULL, *dataTypes = NULL, *bindTypes = NULL, *manager = NULL, *bindDataTypes = NULL, *field = NULL, *automaticAttributes = NULL, *snapshotValue = NULL, *uniqueKey = NULL, *uniqueParams = NULL, *uniqueTypes = NULL, *snapshot = NULL, *nonPrimary = NULL, *columnMap = NULL, *attributeField = NULL, *value = NULL, *primaryKeys = NULL, *bindType = NULL, *newSnapshot = NULL, *success = NULL, *_0, *_1 = NULL, **_4, *_5$$9 = NULL, *_6$$9 = NULL, *_8$$11 = NULL, *_9$$11 = NULL, *_10$$22 = NULL, *_11$$22 = NULL, *_12$$24 = NULL, *_14$$24 = NULL, **_19$$31, *_20$$35 = NULL, *_21$$35 = NULL, *_25$$40, *_26$$41; + zval *metaData, metaData_sub, *connection, connection_sub, *table, table_sub, __$null, bindSkip, fields, values, dataType, dataTypes, bindTypes, manager, bindDataTypes, field, automaticAttributes, snapshotValue, uniqueKey, uniqueParams, uniqueTypes, snapshot, nonPrimary, columnMap, attributeField, value, primaryKeys, bindType, newSnapshot, success, _0, _1, *_2, _3$$9, _4$$9, _6$$11, _7$$11, _8$$22, _9$$22, _10$$24, _12$$24, *_15$$31, _16$$35, _17$$35, _21$$40, _22$$41; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&metaData_sub); + ZVAL_UNDEF(&connection_sub); + ZVAL_UNDEF(&table_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&bindSkip); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&dataType); + ZVAL_UNDEF(&dataTypes); + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&bindDataTypes); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&automaticAttributes); + ZVAL_UNDEF(&snapshotValue); + ZVAL_UNDEF(&uniqueKey); + ZVAL_UNDEF(&uniqueParams); + ZVAL_UNDEF(&uniqueTypes); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&nonPrimary); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&attributeField); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&primaryKeys); + ZVAL_UNDEF(&bindType); + ZVAL_UNDEF(&newSnapshot); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&_6$$11); + ZVAL_UNDEF(&_7$$11); + ZVAL_UNDEF(&_8$$22); + ZVAL_UNDEF(&_9$$22); + ZVAL_UNDEF(&_10$$24); + ZVAL_UNDEF(&_12$$24); + ZVAL_UNDEF(&_16$$35); + ZVAL_UNDEF(&_17$$35); + ZVAL_UNDEF(&_21$$40); + ZVAL_UNDEF(&_22$$41); + ZVAL_UNDEF(&_18); + ZVAL_UNDEF(&_13$$25); + ZVAL_UNDEF(&_14$$25); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &metaData, &connection, &table); - ZEPHIR_INIT_VAR(bindSkip); - ZVAL_LONG(bindSkip, 1024); - ZEPHIR_INIT_VAR(fields); - array_init(fields); - ZEPHIR_INIT_VAR(values); - array_init(values); - ZEPHIR_INIT_VAR(bindTypes); - array_init(bindTypes); - ZEPHIR_INIT_VAR(newSnapshot); - array_init(newSnapshot); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(manager, _0); - ZEPHIR_CALL_METHOD(&_1, manager, "isusingdynamicupdate", NULL, 0, this_ptr); - zephir_check_call_status(); - useDynamicUpdate = zephir_get_boolval(_1); - ZEPHIR_OBS_VAR(snapshot); - zephir_read_property_this(&snapshot, this_ptr, SL("_snapshot"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&bindSkip); + ZVAL_LONG(&bindSkip, 1024); + ZEPHIR_INIT_VAR(&fields); + array_init(&fields); + ZEPHIR_INIT_VAR(&values); + array_init(&values); + ZEPHIR_INIT_VAR(&bindTypes); + array_init(&bindTypes); + ZEPHIR_INIT_VAR(&newSnapshot); + array_init(&newSnapshot); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&manager, &_0); + ZEPHIR_CALL_METHOD(&_1, &manager, "isusingdynamicupdate", NULL, 0, this_ptr); + zephir_check_call_status(); + useDynamicUpdate = zephir_get_boolval(&_1); + ZEPHIR_OBS_VAR(&snapshot); + zephir_read_property(&snapshot, this_ptr, SL("_snapshot"), PH_NOISY_CC); if (useDynamicUpdate) { - if (Z_TYPE_P(snapshot) != IS_ARRAY) { + if (Z_TYPE_P(&snapshot) != IS_ARRAY) { useDynamicUpdate = 0; } } @@ -3275,197 +3793,197 @@ PHP_METHOD(Phalcon_Mvc_Model, _doLowUpdate) { ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, this_ptr); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); - } - zephir_is_iterable(nonPrimary, &_3, &_2, 0, 0, "phalcon/mvc/model.zep", 2668); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HVALUE(field, _4); - if (!(zephir_array_isset(automaticAttributes, field))) { - ZEPHIR_OBS_NVAR(bindType); - if (!(zephir_array_isset_fetch(&bindType, bindDataTypes, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_5$$9); - object_init_ex(_5$$9, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_6$$9); - ZEPHIR_CONCAT_SVS(_6$$9, "Column '", field, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, _5$$9, "__construct", &_7, 9, _6$$9); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); + } + zephir_is_iterable(&nonPrimary, 0, "phalcon/mvc/model.zep", 2668); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&nonPrimary), _2) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _2); + if (!(zephir_array_isset(&automaticAttributes, &field))) { + ZEPHIR_OBS_NVAR(&bindType); + if (!(zephir_array_isset_fetch(&bindType, &bindDataTypes, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_3$$9); + object_init_ex(&_3$$9, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_4$$9); + ZEPHIR_CONCAT_SVS(&_4$$9, "Column '", &field, "' have not defined a bind data type"); + ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", &_5, 4, &_4$$9); zephir_check_call_status(); - zephir_throw_exception_debug(_5$$9, "phalcon/mvc/model.zep", 2563 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$9, "phalcon/mvc/model.zep", 2563 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_8$$11); - object_init_ex(_8$$11, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_9$$11); - ZEPHIR_CONCAT_SVS(_9$$11, "Column '", field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _8$$11, "__construct", &_7, 9, _9$$11); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_6$$11); + object_init_ex(&_6$$11, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_7$$11); + ZEPHIR_CONCAT_SVS(&_7$$11, "Column '", &field, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_6$$11, "__construct", &_5, 4, &_7$$11); zephir_check_call_status(); - zephir_throw_exception_debug(_8$$11, "phalcon/mvc/model.zep", 2571 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$11, "phalcon/mvc/model.zep", 2571 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeField, field); + ZEPHIR_CPY_WRT(&attributeField, &field); } - ZEPHIR_OBS_NVAR(value); - if (zephir_fetch_property_zval(&value, this_ptr, attributeField, PH_SILENT_CC)) { + ZEPHIR_OBS_NVAR(&value); + if (zephir_fetch_property_zval(&value, this_ptr, &attributeField, PH_SILENT_CC)) { if (!(useDynamicUpdate)) { - zephir_array_append(&fields, field, PH_SEPARATE, "phalcon/mvc/model.zep", 2587); - zephir_array_append(&values, value, PH_SEPARATE, "phalcon/mvc/model.zep", 2587); - zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 2588); + zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/mvc/model.zep", 2587); + zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 2587); + zephir_array_append(&bindTypes, &bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 2588); } else { - ZEPHIR_OBS_NVAR(snapshotValue); - if (!(zephir_array_isset_fetch(&snapshotValue, snapshot, attributeField, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&snapshotValue); + if (!(zephir_array_isset_fetch(&snapshotValue, &snapshot, &attributeField, 0 TSRMLS_CC))) { changed = 1; } else { - if (Z_TYPE_P(value) == IS_NULL) { - changed = Z_TYPE_P(snapshotValue) != IS_NULL; + if (Z_TYPE_P(&value) == IS_NULL) { + changed = Z_TYPE_P(&snapshotValue) != IS_NULL; } else { - if (Z_TYPE_P(snapshotValue) == IS_NULL) { + if (Z_TYPE_P(&snapshotValue) == IS_NULL) { changed = 1; } else { - ZEPHIR_OBS_NVAR(dataType); - if (!(zephir_array_isset_fetch(&dataType, dataTypes, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_10$$22); - object_init_ex(_10$$22, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_11$$22); - ZEPHIR_CONCAT_SVS(_11$$22, "Column '", field, "' have not defined a data type"); - ZEPHIR_CALL_METHOD(NULL, _10$$22, "__construct", &_7, 9, _11$$22); + ZEPHIR_OBS_NVAR(&dataType); + if (!(zephir_array_isset_fetch(&dataType, &dataTypes, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_8$$22); + object_init_ex(&_8$$22, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_9$$22); + ZEPHIR_CONCAT_SVS(&_9$$22, "Column '", &field, "' have not defined a data type"); + ZEPHIR_CALL_METHOD(NULL, &_8$$22, "__construct", &_5, 4, &_9$$22); zephir_check_call_status(); - zephir_throw_exception_debug(_10$$22, "phalcon/mvc/model.zep", 2613 TSRMLS_CC); + zephir_throw_exception_debug(&_8$$22, "phalcon/mvc/model.zep", 2613 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } do { - if (ZEPHIR_IS_LONG(dataType, 8)) { - changed = zephir_get_boolval(snapshotValue) != zephir_get_boolval(value); + if (ZEPHIR_IS_LONG(&dataType, 8)) { + changed = zephir_get_boolval(&snapshotValue) != zephir_get_boolval(&value); break; } - if (ZEPHIR_IS_LONG(dataType, 3) || ZEPHIR_IS_LONG(dataType, 7)) { - ZEPHIR_CALL_FUNCTION(&_12$$24, "floatval", &_13, 335, snapshotValue); + if (ZEPHIR_IS_LONG(&dataType, 3) || ZEPHIR_IS_LONG(&dataType, 7)) { + ZEPHIR_CALL_FUNCTION(&_10$$24, "floatval", &_11, 295, &snapshotValue); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_14$$24, "floatval", &_13, 335, value); + ZEPHIR_CALL_FUNCTION(&_12$$24, "floatval", &_11, 295, &value); zephir_check_call_status(); - changed = !ZEPHIR_IS_IDENTICAL(_12$$24, _14$$24); + changed = !ZEPHIR_IS_IDENTICAL(&_10$$24, &_12$$24); break; } - if (ZEPHIR_IS_LONG(dataType, 0) || ZEPHIR_IS_LONG(dataType, 1) || ZEPHIR_IS_LONG(dataType, 2) || ZEPHIR_IS_LONG(dataType, 4) || ZEPHIR_IS_LONG(dataType, 5) || ZEPHIR_IS_LONG(dataType, 6) || ZEPHIR_IS_LONG(dataType, 2) || ZEPHIR_IS_LONG(dataType, 14)) { - zephir_get_strval(_15$$25, snapshotValue); - zephir_get_strval(_16$$25, value); - changed = !ZEPHIR_IS_IDENTICAL(_15$$25, _16$$25); + if (ZEPHIR_IS_LONG(&dataType, 0) || ZEPHIR_IS_LONG(&dataType, 1) || ZEPHIR_IS_LONG(&dataType, 2) || ZEPHIR_IS_LONG(&dataType, 4) || ZEPHIR_IS_LONG(&dataType, 5) || ZEPHIR_IS_LONG(&dataType, 6) || ZEPHIR_IS_LONG(&dataType, 2) || ZEPHIR_IS_LONG(&dataType, 14)) { + zephir_get_strval(&_13$$25, &snapshotValue); + zephir_get_strval(&_14$$25, &value); + changed = !ZEPHIR_IS_IDENTICAL(&_13$$25, &_14$$25); break; } - changed = !ZEPHIR_IS_EQUAL(value, snapshotValue); + changed = !ZEPHIR_IS_EQUAL(&value, &snapshotValue); } while(0); } } } if (changed) { - zephir_array_append(&fields, field, PH_SEPARATE, "phalcon/mvc/model.zep", 2652); - zephir_array_append(&values, value, PH_SEPARATE, "phalcon/mvc/model.zep", 2652); - zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 2653); + zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/mvc/model.zep", 2652); + zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 2652); + zephir_array_append(&bindTypes, &bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 2653); } } - zephir_array_update_zval(&newSnapshot, attributeField, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&newSnapshot, &attributeField, &value, PH_COPY | PH_SEPARATE); } else { - zephir_array_update_zval(&newSnapshot, attributeField, &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_append(&fields, field, PH_SEPARATE, "phalcon/mvc/model.zep", 2660); - zephir_array_append(&values, ZEPHIR_GLOBAL(global_null), PH_SEPARATE, "phalcon/mvc/model.zep", 2660); - zephir_array_append(&bindTypes, bindSkip, PH_SEPARATE, "phalcon/mvc/model.zep", 2660); + zephir_array_update_zval(&newSnapshot, &attributeField, &__$null, PH_COPY | PH_SEPARATE); + zephir_array_append(&fields, &field, PH_SEPARATE, "phalcon/mvc/model.zep", 2660); + zephir_array_append(&values, &__$null, PH_SEPARATE, "phalcon/mvc/model.zep", 2660); + zephir_array_append(&bindTypes, &bindSkip, PH_SEPARATE, "phalcon/mvc/model.zep", 2660); } } - } - if (!(zephir_fast_count_int(fields TSRMLS_CC))) { + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + if (!(zephir_fast_count_int(&fields TSRMLS_CC))) { if (useDynamicUpdate) { - zephir_update_property_this(getThis(), SL("_oldSnapshot"), snapshot TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_oldSnapshot"), &snapshot); } RETURN_MM_BOOL(1); } - ZEPHIR_OBS_VAR(uniqueKey); - zephir_read_property_this(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(uniqueParams); - zephir_read_property_this(&uniqueParams, this_ptr, SL("_uniqueParams"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(uniqueTypes); - zephir_read_property_this(&uniqueTypes, this_ptr, SL("_uniqueTypes"), PH_NOISY_CC); - if (Z_TYPE_P(uniqueParams) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&uniqueKey); + zephir_read_property(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&uniqueParams); + zephir_read_property(&uniqueParams, this_ptr, SL("_uniqueParams"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&uniqueTypes); + zephir_read_property(&uniqueTypes, this_ptr, SL("_uniqueTypes"), PH_NOISY_CC); + if (Z_TYPE_P(&uniqueParams) != IS_ARRAY) { ZEPHIR_CALL_METHOD(&primaryKeys, metaData, "getprimarykeyattributes", NULL, 0, this_ptr); zephir_check_call_status(); - if (!(zephir_fast_count_int(primaryKeys TSRMLS_CC))) { + if (!(zephir_fast_count_int(&primaryKeys TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A primary key must be defined in the model in order to perform the operation", "phalcon/mvc/model.zep", 2690); return; } - ZEPHIR_INIT_NVAR(uniqueParams); - array_init(uniqueParams); - zephir_is_iterable(primaryKeys, &_18$$31, &_17$$31, 0, 0, "phalcon/mvc/model.zep", 2715); - for ( - ; zend_hash_get_current_data_ex(_18$$31, (void**) &_19$$31, &_17$$31) == SUCCESS - ; zend_hash_move_forward_ex(_18$$31, &_17$$31) - ) { - ZEPHIR_GET_HVALUE(field, _19$$31); - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_20$$35); - object_init_ex(_20$$35, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_21$$35); - ZEPHIR_CONCAT_SVS(_21$$35, "Column '", field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _20$$35, "__construct", &_7, 9, _21$$35); + ZEPHIR_INIT_NVAR(&uniqueParams); + array_init(&uniqueParams); + zephir_is_iterable(&primaryKeys, 0, "phalcon/mvc/model.zep", 2715); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&primaryKeys), _15$$31) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _15$$31); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_16$$35); + object_init_ex(&_16$$35, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_17$$35); + ZEPHIR_CONCAT_SVS(&_17$$35, "Column '", &field, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_16$$35, "__construct", &_5, 4, &_17$$35); zephir_check_call_status(); - zephir_throw_exception_debug(_20$$35, "phalcon/mvc/model.zep", 2701 TSRMLS_CC); + zephir_throw_exception_debug(&_16$$35, "phalcon/mvc/model.zep", 2701 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeField, field); + ZEPHIR_CPY_WRT(&attributeField, &field); } - ZEPHIR_OBS_NVAR(value); - if (zephir_fetch_property_zval(&value, this_ptr, attributeField, PH_SILENT_CC)) { - zephir_array_update_zval(&newSnapshot, attributeField, &value, PH_COPY | PH_SEPARATE); - zephir_array_append(&uniqueParams, value, PH_SEPARATE, "phalcon/mvc/model.zep", 2709); + ZEPHIR_OBS_NVAR(&value); + if (zephir_fetch_property_zval(&value, this_ptr, &attributeField, PH_SILENT_CC)) { + zephir_array_update_zval(&newSnapshot, &attributeField, &value, PH_COPY | PH_SEPARATE); + zephir_array_append(&uniqueParams, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 2709); } else { - zephir_array_update_zval(&newSnapshot, attributeField, &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_append(&uniqueParams, ZEPHIR_GLOBAL(global_null), PH_SEPARATE, "phalcon/mvc/model.zep", 2712); + zephir_array_update_zval(&newSnapshot, &attributeField, &__$null, PH_COPY | PH_SEPARATE); + zephir_array_append(&uniqueParams, &__$null, PH_SEPARATE, "phalcon/mvc/model.zep", 2712); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); } - ZEPHIR_INIT_VAR(_22); - zephir_create_array(_22, 3, 0 TSRMLS_CC); - zephir_array_update_string(&_22, SL("conditions"), &uniqueKey, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_22, SL("bind"), &uniqueParams, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_22, SL("bindTypes"), &uniqueTypes, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&success, connection, "update", NULL, 0, table, fields, values, _22, bindTypes); + ZEPHIR_INIT_VAR(&_18); + zephir_create_array(&_18, 3, 0 TSRMLS_CC); + zephir_array_update_string(&_18, SL("conditions"), &uniqueKey, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_18, SL("bind"), &uniqueParams, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_18, SL("bindTypes"), &uniqueTypes, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&success, connection, "update", NULL, 0, table, &fields, &values, &_18, &bindTypes); zephir_check_call_status(); - _23 = zephir_is_true(success); - if (_23) { - ZEPHIR_CALL_METHOD(&_1, manager, "iskeepingsnapshots", NULL, 0, this_ptr); + _19 = zephir_is_true(&success); + if (_19) { + ZEPHIR_CALL_METHOD(&_1, &manager, "iskeepingsnapshots", NULL, 0, this_ptr); zephir_check_call_status(); - _23 = zephir_is_true(_1); - } - _24 = _23; - if (_24) { - _24 = ZEPHIR_GLOBAL(orm).update_snapshot_on_save; - } - if (_24) { - if (Z_TYPE_P(snapshot) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_oldSnapshot"), snapshot TSRMLS_CC); - ZEPHIR_INIT_VAR(_25$$40); - zephir_fast_array_merge(_25$$40, &(snapshot), &(newSnapshot) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_snapshot"), _25$$40 TSRMLS_CC); + _19 = zephir_is_true(&_1); + } + _20 = _19; + if (_20) { + _20 = ZEPHIR_GLOBAL(orm).update_snapshot_on_save; + } + if (_20) { + if (Z_TYPE_P(&snapshot) == IS_ARRAY) { + zephir_update_property_zval(this_ptr, SL("_oldSnapshot"), &snapshot); + ZEPHIR_INIT_VAR(&_21$$40); + zephir_fast_array_merge(&_21$$40, &snapshot, &newSnapshot TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_snapshot"), &_21$$40); } else { - ZEPHIR_INIT_VAR(_26$$41); - array_init(_26$$41); - zephir_update_property_this(getThis(), SL("_oldSnapshot"), _26$$41 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_snapshot"), newSnapshot TSRMLS_CC); + ZEPHIR_INIT_VAR(&_22$$41); + array_init(&_22$$41); + zephir_update_property_zval(this_ptr, SL("_oldSnapshot"), &_22$$41); + zephir_update_property_zval(this_ptr, SL("_snapshot"), &newSnapshot); } } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -3478,12 +3996,35 @@ PHP_METHOD(Phalcon_Mvc_Model, _doLowUpdate) { */ PHP_METHOD(Phalcon_Mvc_Model, _preSaveRelatedRecords) { - HashTable *_3, *_14$$8; - HashPosition _2, _13$$8; + zend_string *_4; + zend_ulong _3; zend_bool nesting = 0; - zephir_fcall_cache_entry *_6 = NULL, *_8 = NULL, *_10 = NULL, *_16 = NULL, *_18 = NULL; + zephir_fcall_cache_entry *_6 = NULL, *_8 = NULL, *_10 = NULL, *_14 = NULL, *_16 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *connection, *related, *className = NULL, *manager = NULL, *type = NULL, *relation = NULL, *columns = NULL, *referencedFields = NULL, *referencedModel = NULL, *message = NULL, *name = NULL, *record = NULL, *_0, *_1 = NULL, **_4, *_5$$3 = NULL, *_7$$6 = NULL, *_9$$7 = NULL, *_11$$5 = NULL, *_19$$5 = NULL, *_12$$8 = NULL, **_15$$8, *_17$$8 = NULL; + zval *connection, connection_sub, *related, related_sub, className, manager, type, relation, columns, referencedFields, referencedModel, message, name, record, _0, _1, *_2, _5$$3, _7$$6, _9$$7, _11$$5, _17$$5, _12$$8, *_13$$8, _15$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&connection_sub); + ZVAL_UNDEF(&related_sub); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&referencedFields); + ZVAL_UNDEF(&referencedModel); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&record); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_17$$5); + ZVAL_UNDEF(&_12$$8); + ZVAL_UNDEF(&_15$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &connection, &related); @@ -3491,97 +4032,99 @@ PHP_METHOD(Phalcon_Mvc_Model, _preSaveRelatedRecords) { nesting = 0; - ZEPHIR_INIT_VAR(_0); if (nesting) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "begin", NULL, 0, _0); + ZEPHIR_CALL_METHOD(NULL, connection, "begin", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, this_ptr, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, this_ptr, 0 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getmodelsmanager", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(manager, _1); - zephir_is_iterable(related, &_3, &_2, 0, 0, "phalcon/mvc/model.zep", 2833); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HMKEY(name, _3, _2); - ZEPHIR_GET_HVALUE(record, _4); - ZEPHIR_CALL_METHOD(&_5$$3, manager, "getrelationbyalias", &_6, 0, className, name); + ZEPHIR_CPY_WRT(&manager, &_1); + zephir_is_iterable(related, 0, "phalcon/mvc/model.zep", 2833); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(related), _3, _4, _2) + { + ZEPHIR_INIT_NVAR(&name); + if (_4 != NULL) { + ZVAL_STR_COPY(&name, _4); + } else { + ZVAL_LONG(&name, _3); + } + ZEPHIR_INIT_NVAR(&record); + ZVAL_COPY(&record, _2); + ZEPHIR_CALL_METHOD(&_5$$3, &manager, "getrelationbyalias", &_6, 0, &className, &name); zephir_check_call_status(); - ZEPHIR_CPY_WRT(relation, _5$$3); - if (Z_TYPE_P(relation) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&type, relation, "gettype", NULL, 0); + ZEPHIR_CPY_WRT(&relation, &_5$$3); + if (Z_TYPE_P(&relation) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&type, &relation, "gettype", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(type, 0)) { - if (Z_TYPE_P(record) != IS_OBJECT) { - ZEPHIR_INIT_NVAR(_7$$6); + if (ZEPHIR_IS_LONG(&type, 0)) { + if (Z_TYPE_P(&record) != IS_OBJECT) { if (nesting) { - ZVAL_BOOL(_7$$6, 1); + ZVAL_BOOL(&_7$$6, 1); } else { - ZVAL_BOOL(_7$$6, 0); + ZVAL_BOOL(&_7$$6, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_8, 0, _7$$6); + ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_8, 0, &_7$$6); zephir_check_call_status(); ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Only objects can be stored as part of belongs-to relations", "phalcon/mvc/model.zep", 2782); return; } - ZEPHIR_CALL_METHOD(&columns, relation, "getfields", NULL, 0); + ZEPHIR_CALL_METHOD(&columns, &relation, "getfields", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedModel, relation, "getreferencedmodel", NULL, 0); + ZEPHIR_CALL_METHOD(&referencedModel, &relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedFields, relation, "getreferencedfields", NULL, 0); + ZEPHIR_CALL_METHOD(&referencedFields, &relation, "getreferencedfields", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(columns) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_9$$7); + if (Z_TYPE_P(&columns) == IS_ARRAY) { if (nesting) { - ZVAL_BOOL(_9$$7, 1); + ZVAL_BOOL(&_9$$7, 1); } else { - ZVAL_BOOL(_9$$7, 0); + ZVAL_BOOL(&_9$$7, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_10, 0, _9$$7); + ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_10, 0, &_9$$7); zephir_check_call_status(); ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not implemented", "phalcon/mvc/model.zep", 2791); return; } - ZEPHIR_CALL_METHOD(&_11$$5, record, "save", NULL, 0); + ZEPHIR_CALL_METHOD(&_11$$5, &record, "save", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_11$$5))) { - ZEPHIR_CALL_METHOD(&_12$$8, record, "getmessages", NULL, 0); + if (!(zephir_is_true(&_11$$5))) { + ZEPHIR_CALL_METHOD(&_12$$8, &record, "getmessages", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_12$$8, &_14$$8, &_13$$8, 0, 0, "phalcon/mvc/model.zep", 2820); - for ( - ; zend_hash_get_current_data_ex(_14$$8, (void**) &_15$$8, &_13$$8) == SUCCESS - ; zend_hash_move_forward_ex(_14$$8, &_13$$8) - ) { - ZEPHIR_GET_HVALUE(message, _15$$8); - if (Z_TYPE_P(message) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(NULL, message, "setmodel", NULL, 0, record); + zephir_is_iterable(&_12$$8, 0, "phalcon/mvc/model.zep", 2820); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_12$$8), _13$$8) + { + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _13$$8); + if (Z_TYPE_P(&message) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(NULL, &message, "setmodel", NULL, 0, &record); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_16, 0, message); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_14, 0, &message); zephir_check_call_status(); - } - ZEPHIR_INIT_NVAR(_17$$8); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); if (nesting) { - ZVAL_BOOL(_17$$8, 1); + ZVAL_BOOL(&_15$$8, 1); } else { - ZVAL_BOOL(_17$$8, 0); + ZVAL_BOOL(&_15$$8, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_18, 0, _17$$8); + ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_16, 0, &_15$$8); zephir_check_call_status(); RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&_19$$5, record, "readattribute", NULL, 0, referencedFields); + ZEPHIR_CALL_METHOD(&_17$$5, &record, "readattribute", NULL, 0, &referencedFields); zephir_check_call_status(); - zephir_update_property_zval_zval(getThis(), columns, _19$$5 TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, &columns, &_17$$5 TSRMLS_CC); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&record); + ZEPHIR_INIT_NVAR(&name); RETURN_MM_BOOL(1); } @@ -3595,12 +4138,53 @@ PHP_METHOD(Phalcon_Mvc_Model, _preSaveRelatedRecords) { */ PHP_METHOD(Phalcon_Mvc_Model, _postSaveRelatedRecords) { - HashTable *_2, *_19$$4, *_24$$14, *_34$$18; - HashPosition _1, _18$$4, _23$$14, _33$$18; + zend_string *_3; + zend_ulong _2; zend_bool nesting = 0, isThrough = 0, _7$$4; - zephir_fcall_cache_entry *_5 = NULL, *_9 = NULL, *_11 = NULL, *_13 = NULL, *_16 = NULL, *_26 = NULL, *_28 = NULL, *_30 = NULL, *_37 = NULL, *_39 = NULL; + zephir_fcall_cache_entry *_5 = NULL, *_9 = NULL, *_11 = NULL, *_13 = NULL, *_16 = NULL, *_22 = NULL, *_24 = NULL, *_26 = NULL, *_31 = NULL, *_33 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *connection, *related, *className = NULL, *manager = NULL, *relation = NULL, *name = NULL, *record = NULL, *message = NULL, *columns = NULL, *referencedModel = NULL, *referencedFields = NULL, *relatedRecords = NULL, *value = NULL, *recordAfter = NULL, *intermediateModel = NULL, *intermediateFields = NULL, *intermediateValue = NULL, *intermediateModelName = NULL, *intermediateReferencedFields = NULL, *_0 = NULL, **_3, *_42, *_4$$3 = NULL, *_6$$4 = NULL, *_17$$4 = NULL, **_20$$4, *_8$$6 = NULL, *_10$$7 = NULL, *_12$$10 = NULL, *_14$$10 = NULL, *_15$$10 = NULL, *_21$$12 = NULL, *_22$$14 = NULL, **_25$$14, *_27$$14 = NULL, *_29$$17 = NULL, *_31$$17 = NULL, *_32$$18 = NULL, **_35$$18, *_36$$18 = NULL, *_38$$22 = NULL, *_40$$22 = NULL, *_41$$22 = NULL; + zval *connection, connection_sub, *related, related_sub, className, manager, relation, name, record, message, columns, referencedModel, referencedFields, relatedRecords, value, recordAfter, intermediateModel, intermediateFields, intermediateValue, intermediateModelName, intermediateReferencedFields, _0, *_1, _36, _4$$3, _6$$4, _17$$4, *_18$$4, _8$$6, _10$$7, _12$$10, _14$$10, _15$$10, _19$$12, _20$$14, *_21$$14, _23$$14, _25$$17, _27$$17, _28$$18, *_29$$18, _30$$18, _32$$22, _34$$22, _35$$22; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&connection_sub); + ZVAL_UNDEF(&related_sub); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&record); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&referencedModel); + ZVAL_UNDEF(&referencedFields); + ZVAL_UNDEF(&relatedRecords); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&recordAfter); + ZVAL_UNDEF(&intermediateModel); + ZVAL_UNDEF(&intermediateFields); + ZVAL_UNDEF(&intermediateValue); + ZVAL_UNDEF(&intermediateModelName); + ZVAL_UNDEF(&intermediateReferencedFields); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_36); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_17$$4); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_12$$10); + ZVAL_UNDEF(&_14$$10); + ZVAL_UNDEF(&_15$$10); + ZVAL_UNDEF(&_19$$12); + ZVAL_UNDEF(&_20$$14); + ZVAL_UNDEF(&_23$$14); + ZVAL_UNDEF(&_25$$17); + ZVAL_UNDEF(&_27$$17); + ZVAL_UNDEF(&_28$$18); + ZVAL_UNDEF(&_30$$18); + ZVAL_UNDEF(&_32$$22); + ZVAL_UNDEF(&_34$$22); + ZVAL_UNDEF(&_35$$22); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &connection, &related); @@ -3608,207 +4192,205 @@ PHP_METHOD(Phalcon_Mvc_Model, _postSaveRelatedRecords) { nesting = 0; - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, this_ptr, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, this_ptr, 0 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmodelsmanager", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(manager, _0); - zephir_is_iterable(related, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 3024); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(name, _2, _1); - ZEPHIR_GET_HVALUE(record, _3); - ZEPHIR_CALL_METHOD(&_4$$3, manager, "getrelationbyalias", &_5, 0, className, name); + ZEPHIR_CPY_WRT(&manager, &_0); + zephir_is_iterable(related, 0, "phalcon/mvc/model.zep", 3024); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(related), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&name); + if (_3 != NULL) { + ZVAL_STR_COPY(&name, _3); + } else { + ZVAL_LONG(&name, _2); + } + ZEPHIR_INIT_NVAR(&record); + ZVAL_COPY(&record, _1); + ZEPHIR_CALL_METHOD(&_4$$3, &manager, "getrelationbyalias", &_5, 0, &className, &name); zephir_check_call_status(); - ZEPHIR_CPY_WRT(relation, _4$$3); - if (Z_TYPE_P(relation) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_6$$4, relation, "gettype", NULL, 0); + ZEPHIR_CPY_WRT(&relation, &_4$$3); + if (Z_TYPE_P(&relation) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&_6$$4, &relation, "gettype", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_6$$4, 0)) { + if (ZEPHIR_IS_LONG(&_6$$4, 0)) { continue; } - _7$$4 = Z_TYPE_P(record) != IS_OBJECT; + _7$$4 = Z_TYPE_P(&record) != IS_OBJECT; if (_7$$4) { - _7$$4 = Z_TYPE_P(record) != IS_ARRAY; + _7$$4 = Z_TYPE_P(&record) != IS_ARRAY; } if (_7$$4) { - ZEPHIR_INIT_NVAR(_8$$6); if (nesting) { - ZVAL_BOOL(_8$$6, 1); + ZVAL_BOOL(&_8$$6, 1); } else { - ZVAL_BOOL(_8$$6, 0); + ZVAL_BOOL(&_8$$6, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_9, 0, _8$$6); + ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_9, 0, &_8$$6); zephir_check_call_status(); ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Only objects/arrays can be stored as part of has-many/has-one/has-many-to-many relations", "phalcon/mvc/model.zep", 2872); return; } - ZEPHIR_CALL_METHOD(&columns, relation, "getfields", NULL, 0); + ZEPHIR_CALL_METHOD(&columns, &relation, "getfields", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedModel, relation, "getreferencedmodel", NULL, 0); + ZEPHIR_CALL_METHOD(&referencedModel, &relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedFields, relation, "getreferencedfields", NULL, 0); + ZEPHIR_CALL_METHOD(&referencedFields, &relation, "getreferencedfields", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(columns) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_10$$7); + if (Z_TYPE_P(&columns) == IS_ARRAY) { if (nesting) { - ZVAL_BOOL(_10$$7, 1); + ZVAL_BOOL(&_10$$7, 1); } else { - ZVAL_BOOL(_10$$7, 0); + ZVAL_BOOL(&_10$$7, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_11, 0, _10$$7); + ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_11, 0, &_10$$7); zephir_check_call_status(); ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not implemented", "phalcon/mvc/model.zep", 2881); return; } - if (Z_TYPE_P(record) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(relatedRecords); - zephir_create_array(relatedRecords, 1, 0 TSRMLS_CC); - zephir_array_fast_append(relatedRecords, record); + if (Z_TYPE_P(&record) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&relatedRecords); + zephir_create_array(&relatedRecords, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&relatedRecords, &record); } else { - ZEPHIR_CPY_WRT(relatedRecords, record); + ZEPHIR_CPY_WRT(&relatedRecords, &record); } - ZEPHIR_OBS_NVAR(value); - if (!(zephir_fetch_property_zval(&value, this_ptr, columns, PH_SILENT_CC))) { - ZEPHIR_INIT_NVAR(_12$$10); + ZEPHIR_OBS_NVAR(&value); + if (!(zephir_fetch_property_zval(&value, this_ptr, &columns, PH_SILENT_CC))) { if (nesting) { - ZVAL_BOOL(_12$$10, 1); + ZVAL_BOOL(&_12$$10, 1); } else { - ZVAL_BOOL(_12$$10, 0); + ZVAL_BOOL(&_12$$10, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_13, 0, _12$$10); + ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_13, 0, &_12$$10); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_14$$10); - object_init_ex(_14$$10, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_14$$10); + object_init_ex(&_14$$10, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_15$$10); - ZEPHIR_CONCAT_SVS(_15$$10, "The column '", columns, "' needs to be present in the model"); - ZEPHIR_CALL_METHOD(NULL, _14$$10, "__construct", &_16, 9, _15$$10); + ZEPHIR_CONCAT_SVS(&_15$$10, "The column '", &columns, "' needs to be present in the model"); + ZEPHIR_CALL_METHOD(NULL, &_14$$10, "__construct", &_16, 4, &_15$$10); zephir_check_call_status(); - zephir_throw_exception_debug(_14$$10, "phalcon/mvc/model.zep", 2895 TSRMLS_CC); + zephir_throw_exception_debug(&_14$$10, "phalcon/mvc/model.zep", 2895 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_17$$4, relation, "isthrough", NULL, 0); + ZEPHIR_CALL_METHOD(&_17$$4, &relation, "isthrough", NULL, 0); zephir_check_call_status(); - isThrough = zephir_get_boolval(_17$$4); + isThrough = zephir_get_boolval(&_17$$4); if (isThrough) { - ZEPHIR_CALL_METHOD(&intermediateModelName, relation, "getintermediatemodel", NULL, 0); + ZEPHIR_CALL_METHOD(&intermediateModelName, &relation, "getintermediatemodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&intermediateFields, relation, "getintermediatefields", NULL, 0); + ZEPHIR_CALL_METHOD(&intermediateFields, &relation, "getintermediatefields", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&intermediateReferencedFields, relation, "getintermediatereferencedfields", NULL, 0); + ZEPHIR_CALL_METHOD(&intermediateReferencedFields, &relation, "getintermediatereferencedfields", NULL, 0); zephir_check_call_status(); } - zephir_is_iterable(relatedRecords, &_19$$4, &_18$$4, 0, 0, "phalcon/mvc/model.zep", 3010); - for ( - ; zend_hash_get_current_data_ex(_19$$4, (void**) &_20$$4, &_18$$4) == SUCCESS - ; zend_hash_move_forward_ex(_19$$4, &_18$$4) - ) { - ZEPHIR_GET_HVALUE(recordAfter, _20$$4); + zephir_is_iterable(&relatedRecords, 0, "phalcon/mvc/model.zep", 3010); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&relatedRecords), _18$$4) + { + ZEPHIR_INIT_NVAR(&recordAfter); + ZVAL_COPY(&recordAfter, _18$$4); if (!(isThrough)) { - ZEPHIR_CALL_METHOD(NULL, recordAfter, "writeattribute", NULL, 0, referencedFields, value); + ZEPHIR_CALL_METHOD(NULL, &recordAfter, "writeattribute", NULL, 0, &referencedFields, &value); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&_21$$12, recordAfter, "save", NULL, 0); + ZEPHIR_CALL_METHOD(&_19$$12, &recordAfter, "save", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_21$$12))) { - ZEPHIR_CALL_METHOD(&_22$$14, recordAfter, "getmessages", NULL, 0); + if (!(zephir_is_true(&_19$$12))) { + ZEPHIR_CALL_METHOD(&_20$$14, &recordAfter, "getmessages", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_22$$14, &_24$$14, &_23$$14, 0, 0, "phalcon/mvc/model.zep", 2952); - for ( - ; zend_hash_get_current_data_ex(_24$$14, (void**) &_25$$14, &_23$$14) == SUCCESS - ; zend_hash_move_forward_ex(_24$$14, &_23$$14) - ) { - ZEPHIR_GET_HVALUE(message, _25$$14); - if (Z_TYPE_P(message) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(NULL, message, "setmodel", NULL, 0, record); + zephir_is_iterable(&_20$$14, 0, "phalcon/mvc/model.zep", 2952); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_20$$14), _21$$14) + { + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _21$$14); + if (Z_TYPE_P(&message) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(NULL, &message, "setmodel", NULL, 0, &record); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_26, 0, message); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_22, 0, &message); zephir_check_call_status(); - } - ZEPHIR_INIT_NVAR(_27$$14); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); if (nesting) { - ZVAL_BOOL(_27$$14, 1); + ZVAL_BOOL(&_23$$14, 1); } else { - ZVAL_BOOL(_27$$14, 0); + ZVAL_BOOL(&_23$$14, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_28, 0, _27$$14); + ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_24, 0, &_23$$14); zephir_check_call_status(); RETURN_MM_BOOL(0); } if (isThrough) { - ZEPHIR_INIT_NVAR(_29$$17); - ZVAL_BOOL(_29$$17, 1); - ZEPHIR_CALL_METHOD(&intermediateModel, manager, "load", &_30, 0, intermediateModelName, _29$$17); + ZVAL_BOOL(&_25$$17, 1); + ZEPHIR_CALL_METHOD(&intermediateModel, &manager, "load", &_26, 0, &intermediateModelName, &_25$$17); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, intermediateModel, "writeattribute", NULL, 0, intermediateFields, value); + ZEPHIR_CALL_METHOD(NULL, &intermediateModel, "writeattribute", NULL, 0, &intermediateFields, &value); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&intermediateValue, recordAfter, "readattribute", NULL, 0, referencedFields); + ZEPHIR_CALL_METHOD(&intermediateValue, &recordAfter, "readattribute", NULL, 0, &referencedFields); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, intermediateModel, "writeattribute", NULL, 0, intermediateReferencedFields, intermediateValue); + ZEPHIR_CALL_METHOD(NULL, &intermediateModel, "writeattribute", NULL, 0, &intermediateReferencedFields, &intermediateValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_31$$17, intermediateModel, "save", NULL, 0); + ZEPHIR_CALL_METHOD(&_27$$17, &intermediateModel, "save", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_31$$17))) { - ZEPHIR_CALL_METHOD(&_32$$18, intermediateModel, "getmessages", NULL, 0); + if (!(zephir_is_true(&_27$$17))) { + ZEPHIR_CALL_METHOD(&_28$$18, &intermediateModel, "getmessages", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_32$$18, &_34$$18, &_33$$18, 0, 0, "phalcon/mvc/model.zep", 3004); - for ( - ; zend_hash_get_current_data_ex(_34$$18, (void**) &_35$$18, &_33$$18) == SUCCESS - ; zend_hash_move_forward_ex(_34$$18, &_33$$18) - ) { - ZEPHIR_GET_HVALUE(message, _35$$18); - if (Z_TYPE_P(message) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(NULL, message, "setmodel", NULL, 0, record); + zephir_is_iterable(&_28$$18, 0, "phalcon/mvc/model.zep", 3004); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_28$$18), _29$$18) + { + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _29$$18); + if (Z_TYPE_P(&message) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(NULL, &message, "setmodel", NULL, 0, &record); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_26, 0, message); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", &_22, 0, &message); zephir_check_call_status(); - } - ZEPHIR_INIT_NVAR(_36$$18); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); if (nesting) { - ZVAL_BOOL(_36$$18, 1); + ZVAL_BOOL(&_30$$18, 1); } else { - ZVAL_BOOL(_36$$18, 0); + ZVAL_BOOL(&_30$$18, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_37, 0, _36$$18); + ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_31, 0, &_30$$18); zephir_check_call_status(); RETURN_MM_BOOL(0); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&recordAfter); } else { - if (Z_TYPE_P(record) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(_38$$22); + if (Z_TYPE_P(&record) != IS_ARRAY) { if (nesting) { - ZVAL_BOOL(_38$$22, 1); + ZVAL_BOOL(&_32$$22, 1); } else { - ZVAL_BOOL(_38$$22, 0); + ZVAL_BOOL(&_32$$22, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_39, 0, _38$$22); + ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_33, 0, &_32$$22); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_40$$22); - object_init_ex(_40$$22, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_41$$22); - ZEPHIR_CONCAT_SVSVS(_41$$22, "There are no defined relations for the model '", className, "' using alias '", name, "'"); - ZEPHIR_CALL_METHOD(NULL, _40$$22, "__construct", &_16, 9, _41$$22); + ZEPHIR_INIT_NVAR(&_34$$22); + object_init_ex(&_34$$22, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_35$$22); + ZEPHIR_CONCAT_SVSVS(&_35$$22, "There are no defined relations for the model '", &className, "' using alias '", &name, "'"); + ZEPHIR_CALL_METHOD(NULL, &_34$$22, "__construct", &_16, 4, &_35$$22); zephir_check_call_status(); - zephir_throw_exception_debug(_40$$22, "phalcon/mvc/model.zep", 3016 TSRMLS_CC); + zephir_throw_exception_debug(&_34$$22, "phalcon/mvc/model.zep", 3016 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - } - ZEPHIR_INIT_VAR(_42); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&record); + ZEPHIR_INIT_NVAR(&name); if (nesting) { - ZVAL_BOOL(_42, 1); + ZVAL_BOOL(&_36, 1); } else { - ZVAL_BOOL(_42, 0); + ZVAL_BOOL(&_36, 0); } - ZEPHIR_CALL_METHOD(NULL, connection, "commit", NULL, 0, _42); + ZEPHIR_CALL_METHOD(NULL, connection, "commit", NULL, 0, &_36); zephir_check_call_status(); RETURN_MM_BOOL(1); @@ -3843,16 +4425,46 @@ PHP_METHOD(Phalcon_Mvc_Model, save) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data = NULL, *whiteList = NULL, *metaData = NULL, *related = NULL, *schema = NULL, *writeConnection = NULL, *readConnection = NULL, *source = NULL, *table = NULL, *identityField = NULL, *exists = NULL, *success = NULL, *_2 = NULL, *_6 = NULL, *_1$$3, *_3$$4 = NULL, *_4$$8, *_5$$9, *_7$$11, *_8$$12, *_9$$12 = NULL, *_10$$15, *_11$$17, *_12$$19 = NULL, *_13$$21; + zval *data = NULL, data_sub, *whiteList = NULL, whiteList_sub, __$null, metaData, related, schema, writeConnection, readConnection, source, table, identityField, exists, success, _2, _6, _1$$3, _3$$4, _4$$8, _5$$9, _7$$11, _8$$12, _9$$12, _10$$15, _11$$17, _12$$19, _13$$21; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&whiteList_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&related); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&writeConnection); + ZVAL_UNDEF(&readConnection); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&identityField); + ZVAL_UNDEF(&exists); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$8); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_7$$11); + ZVAL_UNDEF(&_8$$12); + ZVAL_UNDEF(&_9$$12); + ZVAL_UNDEF(&_10$$15); + ZVAL_UNDEF(&_11$$17); + ZVAL_UNDEF(&_12$$19); + ZVAL_UNDEF(&_13$$21); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &data, &whiteList); if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } if (!whiteList) { - whiteList = ZEPHIR_GLOBAL(global_null); + whiteList = &whiteList_sub; + whiteList = &__$null; } @@ -3863,24 +4475,22 @@ PHP_METHOD(Phalcon_Mvc_Model, save) { _0 = zephir_fast_count_int(data TSRMLS_CC) > 0; } if (_0) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_NULL(_1$$3); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "assign", NULL, 0, data, _1$$3, whiteList); + ZVAL_NULL(&_1$$3); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "assign", NULL, 0, data, &_1$$3, whiteList); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "prepareSave", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "prepareSave"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_OBS_VAR(related); - zephir_read_property_this(&related, this_ptr, SL("_related"), PH_NOISY_CC); - if (Z_TYPE_P(related) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_presaverelatedrecords", NULL, 0, writeConnection, related); + ZEPHIR_OBS_VAR(&related); + zephir_read_property(&related, this_ptr, SL("_related"), PH_NOISY_CC); + if (Z_TYPE_P(&related) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_presaverelatedrecords", NULL, 0, &writeConnection, &related); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_3$$4)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_3$$4)) { RETURN_MM_BOOL(0); } } @@ -3888,93 +4498,90 @@ PHP_METHOD(Phalcon_Mvc_Model, save) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(schema)) { - ZEPHIR_INIT_VAR(table); - zephir_create_array(table, 2, 0 TSRMLS_CC); - zephir_array_fast_append(table, schema); - zephir_array_fast_append(table, source); + if (zephir_is_true(&schema)) { + ZEPHIR_INIT_VAR(&table); + zephir_create_array(&table, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&table, &schema); + zephir_array_fast_append(&table, &source); } else { - ZEPHIR_CPY_WRT(table, source); + ZEPHIR_CPY_WRT(&table, &source); } ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&exists, this_ptr, "_exists", NULL, 0, metaData, readConnection, table); + ZEPHIR_CALL_METHOD(&exists, this_ptr, "_exists", NULL, 0, &metaData, &readConnection, &table); zephir_check_call_status(); - if (zephir_is_true(exists)) { + if (zephir_is_true(&exists)) { ZEPHIR_INIT_ZVAL_NREF(_4$$8); - ZVAL_LONG(_4$$8, 2); - zephir_update_property_this(getThis(), SL("_operationMade"), _4$$8 TSRMLS_CC); + ZVAL_LONG(&_4$$8, 2); + zephir_update_property_zval(this_ptr, SL("_operationMade"), &_4$$8); } else { ZEPHIR_INIT_ZVAL_NREF(_5$$9); - ZVAL_LONG(_5$$9, 1); - zephir_update_property_this(getThis(), SL("_operationMade"), _5$$9 TSRMLS_CC); + ZVAL_LONG(&_5$$9, 1); + zephir_update_property_zval(this_ptr, SL("_operationMade"), &_5$$9); } - ZEPHIR_INIT_NVAR(_2); - array_init(_2); - zephir_update_property_this(getThis(), SL("_errorMessages"), _2 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&identityField, metaData, "getidentityfield", NULL, 0, this_ptr); + ZEPHIR_INIT_NVAR(&_2); + array_init(&_2); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_2); + ZEPHIR_CALL_METHOD(&identityField, &metaData, "getidentityfield", NULL, 0, this_ptr); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_6, this_ptr, "_presave", NULL, 0, metaData, exists, identityField); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "_presave", NULL, 0, &metaData, &exists, &identityField); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_6)) { - if (Z_TYPE_P(related) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_7$$11); - ZVAL_BOOL(_7$$11, 0); - ZEPHIR_CALL_METHOD(NULL, writeConnection, "rollback", NULL, 0, _7$$11); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_6)) { + if (Z_TYPE_P(&related) == IS_ARRAY) { + ZVAL_BOOL(&_7$$11, 0); + ZEPHIR_CALL_METHOD(NULL, &writeConnection, "rollback", NULL, 0, &_7$$11); zephir_check_call_status(); } if (ZEPHIR_GLOBAL(orm).exception_on_failed_save) { - ZEPHIR_INIT_VAR(_8$$12); - object_init_ex(_8$$12, phalcon_mvc_model_validationfailed_ce); + ZEPHIR_INIT_VAR(&_8$$12); + object_init_ex(&_8$$12, phalcon_mvc_model_validationfailed_ce); ZEPHIR_CALL_METHOD(&_9$$12, this_ptr, "getmessages", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _8$$12, "__construct", NULL, 336, this_ptr, _9$$12); + ZEPHIR_CALL_METHOD(NULL, &_8$$12, "__construct", NULL, 296, this_ptr, &_9$$12); zephir_check_call_status(); - zephir_throw_exception_debug(_8$$12, "phalcon/mvc/model.zep", 3138 TSRMLS_CC); + zephir_throw_exception_debug(&_8$$12, "phalcon/mvc/model.zep", 3138 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } RETURN_MM_BOOL(0); } - if (zephir_is_true(exists)) { - ZEPHIR_CALL_METHOD(&success, this_ptr, "_dolowupdate", NULL, 0, metaData, writeConnection, table); + if (zephir_is_true(&exists)) { + ZEPHIR_CALL_METHOD(&success, this_ptr, "_dolowupdate", NULL, 0, &metaData, &writeConnection, &table); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&success, this_ptr, "_dolowinsert", NULL, 0, metaData, writeConnection, table, identityField); + ZEPHIR_CALL_METHOD(&success, this_ptr, "_dolowinsert", NULL, 0, &metaData, &writeConnection, &table, &identityField); zephir_check_call_status(); } - if (zephir_is_true(success)) { + if (zephir_is_true(&success)) { ZEPHIR_INIT_ZVAL_NREF(_10$$15); - ZVAL_LONG(_10$$15, 0); - zephir_update_property_this(getThis(), SL("_dirtyState"), _10$$15 TSRMLS_CC); - } - if (Z_TYPE_P(related) == IS_ARRAY) { - if (ZEPHIR_IS_FALSE_IDENTICAL(success)) { - ZEPHIR_INIT_VAR(_11$$17); - ZVAL_BOOL(_11$$17, 0); - ZEPHIR_CALL_METHOD(NULL, writeConnection, "rollback", NULL, 0, _11$$17); + ZVAL_LONG(&_10$$15, 0); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_10$$15); + } + if (Z_TYPE_P(&related) == IS_ARRAY) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&success)) { + ZVAL_BOOL(&_11$$17, 0); + ZEPHIR_CALL_METHOD(NULL, &writeConnection, "rollback", NULL, 0, &_11$$17); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&success, this_ptr, "_postsaverelatedrecords", NULL, 0, writeConnection, related); + ZEPHIR_CALL_METHOD(&success, this_ptr, "_postsaverelatedrecords", NULL, 0, &writeConnection, &related); zephir_check_call_status(); } } if (ZEPHIR_GLOBAL(orm).events) { - ZEPHIR_CALL_METHOD(&_12$$19, this_ptr, "_postsave", NULL, 0, success, exists); + ZEPHIR_CALL_METHOD(&_12$$19, this_ptr, "_postsave", NULL, 0, &success, &exists); zephir_check_call_status(); - ZEPHIR_CPY_WRT(success, _12$$19); + ZEPHIR_CPY_WRT(&success, &_12$$19); } - if (ZEPHIR_IS_FALSE_IDENTICAL(success)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&success)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "_canceloperation", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_INIT_VAR(_13$$21); - ZVAL_STRING(_13$$21, "afterSave", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _13$$21); - zephir_check_temp_parameter(_13$$21); + ZEPHIR_INIT_VAR(&_13$$21); + ZVAL_STRING(&_13$$21, "afterSave"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_13$$21); zephir_check_call_status(); } - RETURN_CCTOR(success); + RETURN_CCTOR(&success); } @@ -4006,18 +4613,33 @@ PHP_METHOD(Phalcon_Mvc_Model, save) { */ PHP_METHOD(Phalcon_Mvc_Model, create) { - zval *_2$$3; + zval _2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data = NULL, *whiteList = NULL, *metaData = NULL, *_0 = NULL, *_1 = NULL, *_3$$3, *_4$$3, *_5$$3, *_6$$3; + zval *data = NULL, data_sub, *whiteList = NULL, whiteList_sub, __$null, metaData, _0, _1, _3$$3, _4$$3, _5$$3, _6$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&whiteList_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &data, &whiteList); if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } if (!whiteList) { - whiteList = ZEPHIR_GLOBAL(global_null); + whiteList = &whiteList_sub; + whiteList = &__$null; } @@ -4025,25 +4647,22 @@ PHP_METHOD(Phalcon_Mvc_Model, create) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getreadconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "_exists", NULL, 0, metaData, _1); - zephir_check_call_status(); - if (zephir_is_true(_0)) { - ZEPHIR_INIT_VAR(_2$$3); - zephir_create_array(_2$$3, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3$$3); - object_init_ex(_3$$3, phalcon_mvc_model_message_ce); - ZEPHIR_INIT_VAR(_4$$3); - ZVAL_STRING(_4$$3, "Record cannot be created because it already exists", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_5$$3); - ZVAL_NULL(_5$$3); - ZEPHIR_INIT_VAR(_6$$3); - ZVAL_STRING(_6$$3, "InvalidCreateAttempt", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _3$$3, "__construct", NULL, 8, _4$$3, _5$$3, _6$$3); - zephir_check_temp_parameter(_4$$3); - zephir_check_temp_parameter(_6$$3); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "_exists", NULL, 0, &metaData, &_1); + zephir_check_call_status(); + if (zephir_is_true(&_0)) { + ZEPHIR_INIT_VAR(&_2$$3); + zephir_create_array(&_2$$3, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$3); + object_init_ex(&_3$$3, phalcon_mvc_model_message_ce); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "Record cannot be created because it already exists"); + ZVAL_NULL(&_5$$3); + ZEPHIR_INIT_VAR(&_6$$3); + ZVAL_STRING(&_6$$3, "InvalidCreateAttempt"); + ZEPHIR_CALL_METHOD(NULL, &_3$$3, "__construct", NULL, 3, &_4$$3, &_5$$3, &_6$$3); zephir_check_call_status(); - zephir_array_fast_append(_2$$3, _3$$3); - zephir_update_property_this(getThis(), SL("_errorMessages"), _2$$3 TSRMLS_CC); + zephir_array_fast_append(&_2$$3, &_3$$3); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_2$$3); RETURN_MM_BOOL(0); } ZEPHIR_RETURN_CALL_METHOD(this_ptr, "save", NULL, 0, data, whiteList); @@ -4067,46 +4686,59 @@ PHP_METHOD(Phalcon_Mvc_Model, create) { */ PHP_METHOD(Phalcon_Mvc_Model, update) { - zval *_3$$4; + zval _3$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data = NULL, *whiteList = NULL, *metaData = NULL, *_0, *_1$$3 = NULL, *_2$$3 = NULL, *_4$$4, *_5$$4, *_6$$4, *_7$$4; + zval *data = NULL, data_sub, *whiteList = NULL, whiteList_sub, __$null, metaData, _0, _1$$3, _2$$3, _4$$4, _5$$4, _6$$4, _7$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&whiteList_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &data, &whiteList); if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } if (!whiteList) { - whiteList = ZEPHIR_GLOBAL(global_null); + whiteList = &whiteList_sub; + whiteList = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dirtyState"), PH_NOISY_CC); - if (zephir_is_true(_0)) { + zephir_read_property(&_0, this_ptr, SL("_dirtyState"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "getreadconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "_exists", NULL, 0, metaData, _2$$3); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "_exists", NULL, 0, &metaData, &_2$$3); zephir_check_call_status(); - if (!(zephir_is_true(_1$$3))) { - ZEPHIR_INIT_VAR(_3$$4); - zephir_create_array(_3$$4, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_4$$4); - object_init_ex(_4$$4, phalcon_mvc_model_message_ce); - ZEPHIR_INIT_VAR(_5$$4); - ZVAL_STRING(_5$$4, "Record cannot be updated because it does not exist", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_6$$4); - ZVAL_NULL(_6$$4); - ZEPHIR_INIT_VAR(_7$$4); - ZVAL_STRING(_7$$4, "InvalidUpdateAttempt", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _4$$4, "__construct", NULL, 8, _5$$4, _6$$4, _7$$4); - zephir_check_temp_parameter(_5$$4); - zephir_check_temp_parameter(_7$$4); + if (!(zephir_is_true(&_1$$3))) { + ZEPHIR_INIT_VAR(&_3$$4); + zephir_create_array(&_3$$4, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$4); + object_init_ex(&_4$$4, phalcon_mvc_model_message_ce); + ZEPHIR_INIT_VAR(&_5$$4); + ZVAL_STRING(&_5$$4, "Record cannot be updated because it does not exist"); + ZVAL_NULL(&_6$$4); + ZEPHIR_INIT_VAR(&_7$$4); + ZVAL_STRING(&_7$$4, "InvalidUpdateAttempt"); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 3, &_5$$4, &_6$$4, &_7$$4); zephir_check_call_status(); - zephir_array_fast_append(_3$$4, _4$$4); - zephir_update_property_this(getThis(), SL("_errorMessages"), _3$$4 TSRMLS_CC); + zephir_array_fast_append(&_3$$4, &_4$$4); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_3$$4); RETURN_MM_BOOL(0); } } @@ -4133,11 +4765,46 @@ PHP_METHOD(Phalcon_Mvc_Model, update) { */ PHP_METHOD(Phalcon_Mvc_Model, delete) { - HashTable *_4; - HashPosition _3; - zval *metaData = NULL, *writeConnection = NULL, *values = NULL, *bindTypes = NULL, *primaryKeys = NULL, *bindDataTypes = NULL, *columnMap = NULL, *attributeField = NULL, *conditions = NULL, *primaryKey = NULL, *bindType = NULL, *value = NULL, *schema = NULL, *source = NULL, *table = NULL, *success = NULL, *_0, *_1, **_5, *_19, *_2$$3 = NULL, *_6$$9 = NULL, *_7$$9 = NULL, *_9$$11 = NULL, *_10$$11 = NULL, *_11$$13 = NULL, *_12$$13 = NULL, *_13$$8 = NULL, *_15$$8 = NULL, *_16$$14 = NULL, *_17$$14, *_18$$16, *_20$$20 = NULL, *_21$$23; - zephir_fcall_cache_entry *_8 = NULL, *_14 = NULL; + zval __$true, __$false, metaData, writeConnection, values, bindTypes, primaryKeys, bindDataTypes, columnMap, attributeField, conditions, primaryKey, bindType, value, schema, source, table, success, _0, _1, *_3, _17, _2$$3, _4$$9, _5$$9, _7$$11, _8$$11, _9$$13, _10$$13, _11$$8, _13$$8, _14$$14, _15$$14, _16$$16, _18$$20, _19$$23; + zephir_fcall_cache_entry *_6 = NULL, *_12 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&writeConnection); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(&primaryKeys); + ZVAL_UNDEF(&bindDataTypes); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&attributeField); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&primaryKey); + ZVAL_UNDEF(&bindType); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&success); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_17); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_7$$11); + ZVAL_UNDEF(&_8$$11); + ZVAL_UNDEF(&_9$$13); + ZVAL_UNDEF(&_10$$13); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_13$$8); + ZVAL_UNDEF(&_14$$14); + ZVAL_UNDEF(&_15$$14); + ZVAL_UNDEF(&_16$$16); + ZVAL_UNDEF(&_18$$20); + ZVAL_UNDEF(&_19$$23); ZEPHIR_MM_GROW(); @@ -4146,109 +4813,108 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) { ZEPHIR_CALL_METHOD(&writeConnection, this_ptr, "getwriteconnection", NULL, 0); zephir_check_call_status(); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 3); - zephir_update_property_this(getThis(), SL("_operationMade"), _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - array_init(_1); - zephir_update_property_this(getThis(), SL("_errorMessages"), _1 TSRMLS_CC); + ZVAL_LONG(&_0, 3); + zephir_update_property_zval(this_ptr, SL("_operationMade"), &_0); + ZEPHIR_INIT_VAR(&_1); + array_init(&_1); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_1); if (ZEPHIR_GLOBAL(orm).virtual_foreign_keys) { - ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "_checkforeignkeysreverserestrict", NULL, 337); + ZEPHIR_CALL_METHOD(&_2$$3, this_ptr, "_checkforeignkeysreverserestrict", NULL, 297); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_2$$3)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_2$$3)) { RETURN_MM_BOOL(0); } } - ZEPHIR_INIT_VAR(values); - array_init(values); - ZEPHIR_INIT_VAR(bindTypes); - array_init(bindTypes); - ZEPHIR_INIT_VAR(conditions); - array_init(conditions); - ZEPHIR_CALL_METHOD(&primaryKeys, metaData, "getprimarykeyattributes", NULL, 0, this_ptr); + ZEPHIR_INIT_VAR(&values); + array_init(&values); + ZEPHIR_INIT_VAR(&bindTypes); + array_init(&bindTypes); + ZEPHIR_INIT_VAR(&conditions); + array_init(&conditions); + ZEPHIR_CALL_METHOD(&primaryKeys, &metaData, "getprimarykeyattributes", NULL, 0, this_ptr); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&bindDataTypes, metaData, "getbindtypes", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(&bindDataTypes, &metaData, "getbindtypes", NULL, 0, this_ptr); zephir_check_call_status(); if (ZEPHIR_GLOBAL(orm).column_renaming) { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getcolumnmap", NULL, 0, this_ptr); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } - if (!(zephir_fast_count_int(primaryKeys TSRMLS_CC))) { + if (!(zephir_fast_count_int(&primaryKeys TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A primary key must be defined in the model in order to perform the operation", "phalcon/mvc/model.zep", 3339); return; } - zephir_is_iterable(primaryKeys, &_4, &_3, 0, 0, "phalcon/mvc/model.zep", 3382); - for ( - ; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS - ; zend_hash_move_forward_ex(_4, &_3) - ) { - ZEPHIR_GET_HVALUE(primaryKey, _5); - ZEPHIR_OBS_NVAR(bindType); - if (!(zephir_array_isset_fetch(&bindType, bindDataTypes, primaryKey, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_6$$9); - object_init_ex(_6$$9, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_7$$9); - ZEPHIR_CONCAT_SVS(_7$$9, "Column '", primaryKey, "' have not defined a bind data type"); - ZEPHIR_CALL_METHOD(NULL, _6$$9, "__construct", &_8, 9, _7$$9); + zephir_is_iterable(&primaryKeys, 0, "phalcon/mvc/model.zep", 3382); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&primaryKeys), _3) + { + ZEPHIR_INIT_NVAR(&primaryKey); + ZVAL_COPY(&primaryKey, _3); + ZEPHIR_OBS_NVAR(&bindType); + if (!(zephir_array_isset_fetch(&bindType, &bindDataTypes, &primaryKey, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_4$$9); + object_init_ex(&_4$$9, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_5$$9); + ZEPHIR_CONCAT_SVS(&_5$$9, "Column '", &primaryKey, "' have not defined a bind data type"); + ZEPHIR_CALL_METHOD(NULL, &_4$$9, "__construct", &_6, 4, &_5$$9); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$9, "phalcon/mvc/model.zep", 3351 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$9, "phalcon/mvc/model.zep", 3351 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, primaryKey, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_9$$11); - object_init_ex(_9$$11, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_10$$11); - ZEPHIR_CONCAT_SVS(_10$$11, "Column '", primaryKey, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _9$$11, "__construct", &_8, 9, _10$$11); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &primaryKey, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_7$$11); + object_init_ex(&_7$$11, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_8$$11); + ZEPHIR_CONCAT_SVS(&_8$$11, "Column '", &primaryKey, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_7$$11, "__construct", &_6, 4, &_8$$11); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$11, "phalcon/mvc/model.zep", 3359 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$11, "phalcon/mvc/model.zep", 3359 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeField, primaryKey); + ZEPHIR_CPY_WRT(&attributeField, &primaryKey); } - ZEPHIR_OBS_NVAR(value); - if (!(zephir_fetch_property_zval(&value, this_ptr, attributeField, PH_SILENT_CC))) { - ZEPHIR_INIT_NVAR(_11$$13); - object_init_ex(_11$$13, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_12$$13); - ZEPHIR_CONCAT_SVS(_12$$13, "Cannot delete the record because the primary key attribute: '", attributeField, "' wasn't set"); - ZEPHIR_CALL_METHOD(NULL, _11$$13, "__construct", &_8, 9, _12$$13); + ZEPHIR_OBS_NVAR(&value); + if (!(zephir_fetch_property_zval(&value, this_ptr, &attributeField, PH_SILENT_CC))) { + ZEPHIR_INIT_NVAR(&_9$$13); + object_init_ex(&_9$$13, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_10$$13); + ZEPHIR_CONCAT_SVS(&_10$$13, "Cannot delete the record because the primary key attribute: '", &attributeField, "' wasn't set"); + ZEPHIR_CALL_METHOD(NULL, &_9$$13, "__construct", &_6, 4, &_10$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_11$$13, "phalcon/mvc/model.zep", 3371 TSRMLS_CC); + zephir_throw_exception_debug(&_9$$13, "phalcon/mvc/model.zep", 3371 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&values, value, PH_SEPARATE, "phalcon/mvc/model.zep", 3377); - ZEPHIR_CALL_METHOD(&_13$$8, writeConnection, "escapeidentifier", &_14, 0, primaryKey); + zephir_array_append(&values, &value, PH_SEPARATE, "phalcon/mvc/model.zep", 3377); + ZEPHIR_CALL_METHOD(&_11$$8, &writeConnection, "escapeidentifier", &_12, 0, &primaryKey); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_15$$8); - ZEPHIR_CONCAT_VS(_15$$8, _13$$8, " = ?"); - zephir_array_append(&conditions, _15$$8, PH_SEPARATE, "phalcon/mvc/model.zep", 3378); - zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 3379); - } + ZEPHIR_INIT_LNVAR(_13$$8); + ZEPHIR_CONCAT_VS(&_13$$8, &_11$$8, " = ?"); + zephir_array_append(&conditions, &_13$$8, PH_SEPARATE, "phalcon/mvc/model.zep", 3378); + zephir_array_append(&bindTypes, &bindType, PH_SEPARATE, "phalcon/mvc/model.zep", 3379); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&primaryKey); if (ZEPHIR_GLOBAL(orm).events) { if (0) { - zephir_update_property_this(getThis(), SL("_skipped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_skipped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_skipped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_skipped"), &__$false); } - ZEPHIR_INIT_VAR(_17$$14); - ZVAL_STRING(_17$$14, "beforeDelete", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_16$$14, this_ptr, "fireeventcancel", NULL, 0, _17$$14); - zephir_check_temp_parameter(_17$$14); + ZEPHIR_INIT_VAR(&_15$$14); + ZVAL_STRING(&_15$$14, "beforeDelete"); + ZEPHIR_CALL_METHOD(&_14$$14, this_ptr, "fireeventcancel", NULL, 0, &_15$$14); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_16$$14)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_14$$14)) { RETURN_MM_BOOL(0); } else { - _18$$16 = zephir_fetch_nproperty_this(this_ptr, SL("_skipped"), PH_NOISY_CC); - if (ZEPHIR_IS_TRUE_IDENTICAL(_18$$16)) { + zephir_read_property(&_16$$16, this_ptr, SL("_skipped"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_16$$16)) { RETURN_MM_BOOL(1); } } @@ -4257,38 +4923,37 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(schema)) { - ZEPHIR_INIT_VAR(table); - zephir_create_array(table, 2, 0 TSRMLS_CC); - zephir_array_fast_append(table, schema); - zephir_array_fast_append(table, source); + if (zephir_is_true(&schema)) { + ZEPHIR_INIT_VAR(&table); + zephir_create_array(&table, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&table, &schema); + zephir_array_fast_append(&table, &source); } else { - ZEPHIR_CPY_WRT(table, source); + ZEPHIR_CPY_WRT(&table, &source); } - ZEPHIR_INIT_VAR(_19); - zephir_fast_join_str(_19, SL(" AND "), conditions TSRMLS_CC); - ZEPHIR_CALL_METHOD(&success, writeConnection, "delete", NULL, 0, table, _19, values, bindTypes); + ZEPHIR_INIT_VAR(&_17); + zephir_fast_join_str(&_17, SL(" AND "), &conditions TSRMLS_CC); + ZEPHIR_CALL_METHOD(&success, &writeConnection, "delete", NULL, 0, &table, &_17, &values, &bindTypes); zephir_check_call_status(); if (ZEPHIR_GLOBAL(orm).virtual_foreign_keys) { - ZEPHIR_CALL_METHOD(&_20$$20, this_ptr, "_checkforeignkeysreversecascade", NULL, 338); + ZEPHIR_CALL_METHOD(&_18$$20, this_ptr, "_checkforeignkeysreversecascade", NULL, 298); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_20$$20)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_18$$20)) { RETURN_MM_BOOL(0); } } if (ZEPHIR_GLOBAL(orm).events) { - if (zephir_is_true(success)) { - ZEPHIR_INIT_VAR(_21$$23); - ZVAL_STRING(_21$$23, "afterDelete", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _21$$23); - zephir_check_temp_parameter(_21$$23); + if (zephir_is_true(&success)) { + ZEPHIR_INIT_VAR(&_19$$23); + ZVAL_STRING(&_19$$23, "afterDelete"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_19$$23); zephir_check_call_status(); } } ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 2); - zephir_update_property_this(getThis(), SL("_dirtyState"), _0 TSRMLS_CC); - RETURN_CCTOR(success); + ZVAL_LONG(&_0, 2); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_0); + RETURN_CCTOR(&success); } @@ -4298,7 +4963,8 @@ PHP_METHOD(Phalcon_Mvc_Model, delete) { */ PHP_METHOD(Phalcon_Mvc_Model, getOperationMade) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_operationMade"); @@ -4309,16 +4975,40 @@ PHP_METHOD(Phalcon_Mvc_Model, getOperationMade) { */ PHP_METHOD(Phalcon_Mvc_Model, refresh) { - zval *_8, *_7$$9 = NULL; - HashTable *_5; - HashPosition _4; - zval *metaData = NULL, *readConnection = NULL, *schema = NULL, *source = NULL, *table = NULL, *uniqueKey = NULL, *tables = NULL, *uniqueParams = NULL, *dialect = NULL, *row = NULL, *fields = NULL, *attribute = NULL, *manager = NULL, *columnMap = NULL, *_0, *_1, *_3 = NULL, **_6, *_9 = NULL, *_10 = NULL, *_2$$6 = NULL, *_11$$10 = NULL; + zval _6, _5$$9; + zval metaData, readConnection, schema, source, table, uniqueKey, tables, uniqueParams, dialect, row, fields, attribute, manager, columnMap, _0, _1, _3, *_4, _7, _8, _10, _2$$6, _9$$10; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&readConnection); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&uniqueKey); + ZVAL_UNDEF(&tables); + ZVAL_UNDEF(&uniqueParams); + ZVAL_UNDEF(&dialect); + ZVAL_UNDEF(&row); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_5$$9); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dirtyState"), PH_NOISY_CC); - if (!ZEPHIR_IS_LONG(_0, 0)) { + zephir_read_property(&_0, this_ptr, SL("_dirtyState"), PH_NOISY_CC | PH_READONLY); + if (!ZEPHIR_IS_LONG(&_0, 0)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The record cannot be refreshed because it does not exist or is deleted", "phalcon/mvc/model.zep", 3457); return; } @@ -4326,87 +5016,85 @@ PHP_METHOD(Phalcon_Mvc_Model, refresh) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&readConnection, this_ptr, "getreadconnection", NULL, 0); zephir_check_call_status(); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(manager, _1); + zephir_read_property(&_1, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&manager, &_1); ZEPHIR_CALL_METHOD(&schema, this_ptr, "getschema", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&source, this_ptr, "getsource", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(schema)) { - ZEPHIR_INIT_VAR(table); - zephir_create_array(table, 2, 0 TSRMLS_CC); - zephir_array_fast_append(table, schema); - zephir_array_fast_append(table, source); + if (zephir_is_true(&schema)) { + ZEPHIR_INIT_VAR(&table); + zephir_create_array(&table, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&table, &schema); + zephir_array_fast_append(&table, &source); } else { - ZEPHIR_CPY_WRT(table, source); + ZEPHIR_CPY_WRT(&table, &source); } - ZEPHIR_OBS_VAR(uniqueKey); - zephir_read_property_this(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); - if (!(zephir_is_true(uniqueKey))) { - ZEPHIR_CALL_METHOD(&_2$$6, this_ptr, "_exists", NULL, 0, metaData, readConnection, table); + ZEPHIR_OBS_VAR(&uniqueKey); + zephir_read_property(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); + if (!(zephir_is_true(&uniqueKey))) { + ZEPHIR_CALL_METHOD(&_2$$6, this_ptr, "_exists", NULL, 0, &metaData, &readConnection, &table); zephir_check_call_status(); - if (!(zephir_is_true(_2$$6))) { + if (!(zephir_is_true(&_2$$6))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The record cannot be refreshed because it does not exist or is deleted", "phalcon/mvc/model.zep", 3480); return; } - ZEPHIR_OBS_NVAR(uniqueKey); - zephir_read_property_this(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&uniqueKey); + zephir_read_property(&uniqueKey, this_ptr, SL("_uniqueKey"), PH_NOISY_CC); } - ZEPHIR_OBS_VAR(uniqueParams); - zephir_read_property_this(&uniqueParams, this_ptr, SL("_uniqueParams"), PH_NOISY_CC); - if (Z_TYPE_P(uniqueParams) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&uniqueParams); + zephir_read_property(&uniqueParams, this_ptr, SL("_uniqueParams"), PH_NOISY_CC); + if (Z_TYPE_P(&uniqueParams) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The record cannot be refreshed because it does not exist or is deleted", "phalcon/mvc/model.zep", 3488); return; } - ZEPHIR_INIT_VAR(fields); - array_init(fields); - ZEPHIR_CALL_METHOD(&_3, metaData, "getattributes", NULL, 0, this_ptr); - zephir_check_call_status(); - zephir_is_iterable(_3, &_5, &_4, 0, 0, "phalcon/mvc/model.zep", 3502); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HVALUE(attribute, _6); - ZEPHIR_INIT_NVAR(_7$$9); - zephir_create_array(_7$$9, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_7$$9, attribute); - zephir_array_append(&fields, _7$$9, PH_SEPARATE, "phalcon/mvc/model.zep", 3496); - } - ZEPHIR_CALL_METHOD(&dialect, readConnection, "getdialect", NULL, 0); - zephir_check_call_status(); - ZEPHIR_INIT_VAR(_8); - zephir_create_array(_8, 3, 0 TSRMLS_CC); - zephir_array_update_string(&_8, SL("columns"), &fields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_9, readConnection, "escapeidentifier", NULL, 0, table); - zephir_check_call_status(); - zephir_array_update_string(&_8, SL("tables"), &_9, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_8, SL("where"), &uniqueKey, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&tables, dialect, "select", NULL, 0, _8); - zephir_check_call_status(); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_uniqueTypes"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_10); - ZVAL_LONG(_10, 2); - ZEPHIR_CALL_METHOD(&row, readConnection, "fetchone", NULL, 0, tables, _10, uniqueParams, _1); - zephir_check_call_status(); - if (Z_TYPE_P(row) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, this_ptr); + ZEPHIR_INIT_VAR(&fields); + array_init(&fields); + ZEPHIR_CALL_METHOD(&_3, &metaData, "getattributes", NULL, 0, this_ptr); + zephir_check_call_status(); + zephir_is_iterable(&_3, 0, "phalcon/mvc/model.zep", 3502); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3), _4) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _4); + ZEPHIR_INIT_NVAR(&_5$$9); + zephir_create_array(&_5$$9, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_5$$9, &attribute); + zephir_array_append(&fields, &_5$$9, PH_SEPARATE, "phalcon/mvc/model.zep", 3496); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); + ZEPHIR_CALL_METHOD(&dialect, &readConnection, "getdialect", NULL, 0); + zephir_check_call_status(); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 3, 0 TSRMLS_CC); + zephir_array_update_string(&_6, SL("columns"), &fields, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&_7, &readConnection, "escapeidentifier", NULL, 0, &table); + zephir_check_call_status(); + zephir_array_update_string(&_6, SL("tables"), &_7, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_6, SL("where"), &uniqueKey, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&tables, &dialect, "select", NULL, 0, &_6); + zephir_check_call_status(); + zephir_read_property(&_1, this_ptr, SL("_uniqueTypes"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_8, 2); + ZEPHIR_CALL_METHOD(&row, &readConnection, "fetchone", NULL, 0, &tables, &_8, &uniqueParams, &_1); + zephir_check_call_status(); + if (Z_TYPE_P(&row) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getcolumnmap", NULL, 0, this_ptr); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "assign", NULL, 0, row, columnMap); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "assign", NULL, 0, &row, &columnMap); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$10, manager, "iskeepingsnapshots", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(&_9$$10, &manager, "iskeepingsnapshots", NULL, 0, this_ptr); zephir_check_call_status(); - if (zephir_is_true(_11$$10)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setsnapshotdata", NULL, 0, row, columnMap); + if (zephir_is_true(&_9$$10)) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setsnapshotdata", NULL, 0, &row, &columnMap); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setoldsnapshotdata", NULL, 0, row, columnMap); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setoldsnapshotdata", NULL, 0, &row, &columnMap); zephir_check_call_status(); } } - ZEPHIR_INIT_NVAR(_10); - ZVAL_STRING(_10, "afterFetch", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, _10); - zephir_check_temp_parameter(_10); + ZEPHIR_INIT_VAR(&_10); + ZVAL_STRING(&_10, "afterFetch"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "fireevent", NULL, 0, &_10); zephir_check_call_status(); RETURN_THIS(); @@ -4417,8 +5105,12 @@ PHP_METHOD(Phalcon_Mvc_Model, refresh) { */ PHP_METHOD(Phalcon_Mvc_Model, skipOperation) { - zval *skip_param = NULL; + zval *skip_param = NULL, __$true, __$false; zend_bool skip; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &skip_param); @@ -4426,9 +5118,9 @@ PHP_METHOD(Phalcon_Mvc_Model, skipOperation) { if (skip) { - zephir_update_property_this(getThis(), SL("_skipped"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_skipped"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_skipped"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_skipped"), &__$false); } } @@ -4442,30 +5134,34 @@ PHP_METHOD(Phalcon_Mvc_Model, skipOperation) { */ PHP_METHOD(Phalcon_Mvc_Model, readAttribute) { - zval *attribute_param = NULL, *_0; - zval *attribute = NULL; + zval *attribute_param = NULL, _0; + zval attribute; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attribute_param); if (UNEXPECTED(Z_TYPE_P(attribute_param) != IS_STRING && Z_TYPE_P(attribute_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(attribute_param) == IS_STRING)) { - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); } else { - ZEPHIR_INIT_VAR(attribute); - ZVAL_EMPTY_STRING(attribute); + ZEPHIR_INIT_VAR(&attribute); + ZVAL_EMPTY_STRING(&attribute); } - if (!(zephir_isset_property_zval(this_ptr, attribute TSRMLS_CC))) { + if (!(zephir_isset_property_zval(this_ptr, &attribute TSRMLS_CC))) { RETURN_MM_NULL(); } - ZEPHIR_OBS_VAR(_0); - zephir_read_property_zval(&_0, this_ptr, attribute, PH_NOISY_CC); - RETURN_CCTOR(_0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property_zval(&_0, this_ptr, &attribute, PH_NOISY_CC); + RETURN_CCTOR(&_0); } @@ -4478,25 +5174,29 @@ PHP_METHOD(Phalcon_Mvc_Model, readAttribute) { */ PHP_METHOD(Phalcon_Mvc_Model, writeAttribute) { - zval *attribute_param = NULL, *value; - zval *attribute = NULL; + zval *attribute_param = NULL, *value, value_sub; + zval attribute; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &attribute_param, &value); if (UNEXPECTED(Z_TYPE_P(attribute_param) != IS_STRING && Z_TYPE_P(attribute_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(attribute_param) == IS_STRING)) { - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); } else { - ZEPHIR_INIT_VAR(attribute); - ZVAL_EMPTY_STRING(attribute); + ZEPHIR_INIT_VAR(&attribute); + ZVAL_EMPTY_STRING(&attribute); } - zephir_update_property_zval_zval(getThis(), attribute, value TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, &attribute, value TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -4524,17 +5224,20 @@ PHP_METHOD(Phalcon_Mvc_Model, skipAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *attributes_param = NULL; - zval *attributes = NULL; + zval attributes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attributes_param); - attributes = attributes_param; + ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "skipattributesoncreate", NULL, 0, attributes); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "skipattributesoncreate", NULL, 0, &attributes); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "skipattributesonupdate", NULL, 0, attributes); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "skipattributesonupdate", NULL, 0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -4561,31 +5264,36 @@ PHP_METHOD(Phalcon_Mvc_Model, skipAttributes) { */ PHP_METHOD(Phalcon_Mvc_Model, skipAttributesOnCreate) { - HashTable *_1; - HashPosition _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes_param = NULL, *keysAttributes = NULL, *attribute = NULL, **_2, *_3 = NULL; - zval *attributes = NULL; + zval *attributes_param = NULL, __$null, keysAttributes, attribute, *_0, _1; + zval attributes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&keysAttributes); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attributes_param); - attributes = attributes_param; + ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param); - ZEPHIR_INIT_VAR(keysAttributes); - array_init(keysAttributes); - zephir_is_iterable(attributes, &_1, &_0, 0, 0, "phalcon/mvc/model.zep", 3617); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(attribute, _2); - zephir_array_update_zval(&keysAttributes, attribute, &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getmodelsmetadata", NULL, 0); + ZEPHIR_INIT_VAR(&keysAttributes); + array_init(&keysAttributes); + zephir_is_iterable(&attributes, 0, "phalcon/mvc/model.zep", 3617); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _0) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _0); + zephir_array_update_zval(&keysAttributes, &attribute, &__$null, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _3, "setautomaticcreateattributes", NULL, 0, this_ptr, keysAttributes); + ZEPHIR_CALL_METHOD(NULL, &_1, "setautomaticcreateattributes", NULL, 0, this_ptr, &keysAttributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -4612,31 +5320,36 @@ PHP_METHOD(Phalcon_Mvc_Model, skipAttributesOnCreate) { */ PHP_METHOD(Phalcon_Mvc_Model, skipAttributesOnUpdate) { - HashTable *_1; - HashPosition _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes_param = NULL, *keysAttributes = NULL, *attribute = NULL, **_2, *_3 = NULL; - zval *attributes = NULL; + zval *attributes_param = NULL, __$null, keysAttributes, attribute, *_0, _1; + zval attributes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&keysAttributes); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attributes_param); - attributes = attributes_param; + ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param); - ZEPHIR_INIT_VAR(keysAttributes); - array_init(keysAttributes); - zephir_is_iterable(attributes, &_1, &_0, 0, 0, "phalcon/mvc/model.zep", 3648); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(attribute, _2); - zephir_array_update_zval(&keysAttributes, attribute, &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getmodelsmetadata", NULL, 0); + ZEPHIR_INIT_VAR(&keysAttributes); + array_init(&keysAttributes); + zephir_is_iterable(&attributes, 0, "phalcon/mvc/model.zep", 3648); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _0) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _0); + zephir_array_update_zval(&keysAttributes, &attribute, &__$null, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _3, "setautomaticupdateattributes", NULL, 0, this_ptr, keysAttributes); + ZEPHIR_CALL_METHOD(NULL, &_1, "setautomaticupdateattributes", NULL, 0, this_ptr, &keysAttributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -4663,31 +5376,36 @@ PHP_METHOD(Phalcon_Mvc_Model, skipAttributesOnUpdate) { */ PHP_METHOD(Phalcon_Mvc_Model, allowEmptyStringValues) { - HashTable *_1; - HashPosition _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes_param = NULL, *keysAttributes = NULL, *attribute = NULL, **_2, *_3 = NULL; - zval *attributes = NULL; + zval *attributes_param = NULL, __$true, keysAttributes, attribute, *_0, _1; + zval attributes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&keysAttributes); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attributes_param); - attributes = attributes_param; + ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param); - ZEPHIR_INIT_VAR(keysAttributes); - array_init(keysAttributes); - zephir_is_iterable(attributes, &_1, &_0, 0, 0, "phalcon/mvc/model.zep", 3679); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(attribute, _2); - zephir_array_update_zval(&keysAttributes, attribute, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getmodelsmetadata", NULL, 0); + ZEPHIR_INIT_VAR(&keysAttributes); + array_init(&keysAttributes); + zephir_is_iterable(&attributes, 0, "phalcon/mvc/model.zep", 3679); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _0) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _0); + zephir_array_update_zval(&keysAttributes, &attribute, &__$true, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _3, "setemptystringattributes", NULL, 0, this_ptr, keysAttributes); + ZEPHIR_CALL_METHOD(NULL, &_1, "setemptystringattributes", NULL, 0, this_ptr, &keysAttributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -4710,29 +5428,38 @@ PHP_METHOD(Phalcon_Mvc_Model, allowEmptyStringValues) { PHP_METHOD(Phalcon_Mvc_Model, hasOne) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *referenceModel = NULL; - zval *fields, *referenceModel_param = NULL, *referencedFields, *options = NULL, *_0; + zval referenceModel; + zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&referencedFields_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&referenceModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options); if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referenceModel_param) == IS_STRING)) { - zephir_get_strval(referenceModel, referenceModel_param); + zephir_get_strval(&referenceModel, referenceModel_param); } else { - ZEPHIR_INIT_VAR(referenceModel); - ZVAL_EMPTY_STRING(referenceModel); + ZEPHIR_INIT_VAR(&referenceModel); + ZVAL_EMPTY_STRING(&referenceModel); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "addhasone", NULL, 0, this_ptr, fields, referenceModel, referencedFields, options); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasone", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, options); zephir_check_call_status(); RETURN_MM(); @@ -4755,29 +5482,38 @@ PHP_METHOD(Phalcon_Mvc_Model, hasOne) { PHP_METHOD(Phalcon_Mvc_Model, belongsTo) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *referenceModel = NULL; - zval *fields, *referenceModel_param = NULL, *referencedFields, *options = NULL, *_0; + zval referenceModel; + zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&referencedFields_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&referenceModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options); if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referenceModel_param) == IS_STRING)) { - zephir_get_strval(referenceModel, referenceModel_param); + zephir_get_strval(&referenceModel, referenceModel_param); } else { - ZEPHIR_INIT_VAR(referenceModel); - ZVAL_EMPTY_STRING(referenceModel); + ZEPHIR_INIT_VAR(&referenceModel); + ZVAL_EMPTY_STRING(&referenceModel); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "addbelongsto", NULL, 0, this_ptr, fields, referenceModel, referencedFields, options); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addbelongsto", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, options); zephir_check_call_status(); RETURN_MM(); @@ -4800,29 +5536,38 @@ PHP_METHOD(Phalcon_Mvc_Model, belongsTo) { PHP_METHOD(Phalcon_Mvc_Model, hasMany) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *referenceModel = NULL; - zval *fields, *referenceModel_param = NULL, *referencedFields, *options = NULL, *_0; + zval referenceModel; + zval *fields, fields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&referencedFields_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&referenceModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &fields, &referenceModel_param, &referencedFields, &options); if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referenceModel_param) == IS_STRING)) { - zephir_get_strval(referenceModel, referenceModel_param); + zephir_get_strval(&referenceModel, referenceModel_param); } else { - ZEPHIR_INIT_VAR(referenceModel); - ZVAL_EMPTY_STRING(referenceModel); + ZEPHIR_INIT_VAR(&referenceModel); + ZVAL_EMPTY_STRING(&referenceModel); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "addhasmany", NULL, 0, this_ptr, fields, referenceModel, referencedFields, options); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmany", NULL, 0, this_ptr, fields, &referenceModel, referencedFields, options); zephir_check_call_status(); RETURN_MM(); @@ -4862,39 +5607,51 @@ PHP_METHOD(Phalcon_Mvc_Model, hasMany) { PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *intermediateModel = NULL, *referenceModel = NULL; - zval *fields, *intermediateModel_param = NULL, *intermediateFields, *intermediateReferencedFields, *referenceModel_param = NULL, *referencedFields, *options = NULL, *_0; + zval intermediateModel, referenceModel; + zval *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referenceModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&intermediateFields_sub); + ZVAL_UNDEF(&intermediateReferencedFields_sub); + ZVAL_UNDEF(&referencedFields_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&intermediateModel); + ZVAL_UNDEF(&referenceModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 6, 1, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referenceModel_param, &referencedFields, &options); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(intermediateModel_param) == IS_STRING)) { - zephir_get_strval(intermediateModel, intermediateModel_param); + zephir_get_strval(&intermediateModel, intermediateModel_param); } else { - ZEPHIR_INIT_VAR(intermediateModel); - ZVAL_EMPTY_STRING(intermediateModel); + ZEPHIR_INIT_VAR(&intermediateModel); + ZVAL_EMPTY_STRING(&intermediateModel); } if (UNEXPECTED(Z_TYPE_P(referenceModel_param) != IS_STRING && Z_TYPE_P(referenceModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referenceModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referenceModel_param) == IS_STRING)) { - zephir_get_strval(referenceModel, referenceModel_param); + zephir_get_strval(&referenceModel, referenceModel_param); } else { - ZEPHIR_INIT_VAR(referenceModel); - ZVAL_EMPTY_STRING(referenceModel); + ZEPHIR_INIT_VAR(&referenceModel); + ZVAL_EMPTY_STRING(&referenceModel); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "addhasmanytomany", NULL, 0, this_ptr, fields, intermediateModel, intermediateFields, intermediateReferencedFields, referenceModel, referencedFields, options); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "addhasmanytomany", NULL, 0, this_ptr, fields, &intermediateModel, intermediateFields, intermediateReferencedFields, &referenceModel, referencedFields, options); zephir_check_call_status(); RETURN_MM(); @@ -4929,15 +5686,19 @@ PHP_METHOD(Phalcon_Mvc_Model, hasManyToMany) { PHP_METHOD(Phalcon_Mvc_Model, addBehavior) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *behavior, *_0; + zval *behavior, behavior_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&behavior_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &behavior); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "addbehavior", NULL, 0, this_ptr, behavior); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "addbehavior", NULL, 0, this_ptr, behavior); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -4962,8 +5723,12 @@ PHP_METHOD(Phalcon_Mvc_Model, addBehavior) { PHP_METHOD(Phalcon_Mvc_Model, keepSnapshots) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *keepSnapshot_param = NULL, *_0, *_1; + zval *keepSnapshot_param = NULL, _0, _1; zend_bool keepSnapshot; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &keepSnapshot_param); @@ -4971,14 +5736,13 @@ PHP_METHOD(Phalcon_Mvc_Model, keepSnapshots) { keepSnapshot = zephir_get_boolval(keepSnapshot_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); if (keepSnapshot) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, _0, "keepsnapshots", NULL, 0, this_ptr, _1); + ZEPHIR_CALL_METHOD(NULL, &_0, "keepsnapshots", NULL, 0, this_ptr, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -4993,62 +5757,82 @@ PHP_METHOD(Phalcon_Mvc_Model, keepSnapshots) { */ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) { - HashTable *_1$$3; - HashPosition _0$$3; + zend_string *_2$$3; + zend_ulong _1$$3; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *columnMap = NULL, *key = NULL, *value = NULL, *snapshot = NULL, *attribute = NULL, *_8, **_2$$3, *_3$$7 = NULL, *_4$$7 = NULL, *_6$$11 = NULL, *_7$$11 = NULL, *_9$$14; - zval *data = NULL; + zval *data_param = NULL, *columnMap = NULL, columnMap_sub, __$null, key, value, snapshot, attribute, _8, *_0$$3, _3$$7, _4$$7, _6$$11, _7$$11, _9$$14; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&columnMap_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_6$$11); + ZVAL_UNDEF(&_7$$11); + ZVAL_UNDEF(&_9$$14); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &data_param, &columnMap); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); if (!columnMap) { - columnMap = ZEPHIR_GLOBAL(global_null); + columnMap = &columnMap_sub; + columnMap = &__$null; } if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_INIT_VAR(snapshot); - array_init(snapshot); - zephir_is_iterable(data, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model.zep", 3898); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(value, _2$$3); - if (Z_TYPE_P(key) != IS_STRING) { + ZEPHIR_INIT_VAR(&snapshot); + array_init(&snapshot); + zephir_is_iterable(&data, 0, "phalcon/mvc/model.zep", 3898); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&key, _2$$3); + } else { + ZVAL_LONG(&key, _1$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0$$3); + if (Z_TYPE_P(&key) != IS_STRING) { continue; } - ZEPHIR_OBS_NVAR(attribute); - if (!(zephir_array_isset_fetch(&attribute, columnMap, key, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&attribute); + if (!(zephir_array_isset_fetch(&attribute, columnMap, &key, 0 TSRMLS_CC))) { if (!(ZEPHIR_GLOBAL(orm).ignore_unknown_columns)) { - ZEPHIR_INIT_NVAR(_3$$7); - object_init_ex(_3$$7, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_3$$7); + object_init_ex(&_3$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_4$$7); - ZEPHIR_CONCAT_SVS(_4$$7, "Column '", key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _3$$7, "__construct", &_5, 9, _4$$7); + ZEPHIR_CONCAT_SVS(&_4$$7, "Column '", &key, "' doesn't make part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", &_5, 4, &_4$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$7, "phalcon/mvc/model.zep", 3880 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$7, "phalcon/mvc/model.zep", 3880 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } else { continue; } } - if (Z_TYPE_P(attribute) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attribute); - if (!(zephir_array_isset_long_fetch(&attribute, attribute, 0, 0 TSRMLS_CC))) { + if (Z_TYPE_P(&attribute) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attribute); + if (!(zephir_array_isset_long_fetch(&attribute, &attribute, 0, 0 TSRMLS_CC))) { if (!(ZEPHIR_GLOBAL(orm).ignore_unknown_columns)) { - ZEPHIR_INIT_NVAR(_6$$11); - object_init_ex(_6$$11, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_6$$11); + object_init_ex(&_6$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_7$$11); - ZEPHIR_CONCAT_SVS(_7$$11, "Column '", key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _6$$11, "__construct", &_5, 9, _7$$11); + ZEPHIR_CONCAT_SVS(&_7$$11, "Column '", &key, "' doesn't make part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_6$$11, "__construct", &_5, 4, &_7$$11); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$11, "phalcon/mvc/model.zep", 3889 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$11, "phalcon/mvc/model.zep", 3889 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } else { @@ -5056,18 +5840,20 @@ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) { } } } - zephir_array_update_zval(&snapshot, attribute, &value, PH_COPY | PH_SEPARATE); - } + zephir_array_update_zval(&snapshot, &attribute, &value, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } else { - ZEPHIR_CPY_WRT(snapshot, data); + ZEPHIR_CPY_WRT(&snapshot, &data); } - ZEPHIR_OBS_VAR(_8); - zephir_read_property_this(&_8, this_ptr, SL("_snapshot"), PH_NOISY_CC); - if (Z_TYPE_P(_8) == IS_ARRAY) { - _9$$14 = zephir_fetch_nproperty_this(this_ptr, SL("_snapshot"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_oldSnapshot"), _9$$14 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_8); + zephir_read_property(&_8, this_ptr, SL("_snapshot"), PH_NOISY_CC); + if (Z_TYPE_P(&_8) == IS_ARRAY) { + zephir_read_property(&_9$$14, this_ptr, SL("_snapshot"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_oldSnapshot"), &_9$$14); } - zephir_update_property_this(getThis(), SL("_snapshot"), snapshot TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_snapshot"), &snapshot); ZEPHIR_MM_RESTORE(); } @@ -5081,62 +5867,80 @@ PHP_METHOD(Phalcon_Mvc_Model, setSnapshotData) { */ PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) { - HashTable *_1$$3; - HashPosition _0$$3; + zend_string *_2$$3; + zend_ulong _1$$3; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *columnMap = NULL, *key = NULL, *value = NULL, *snapshot = NULL, *attribute = NULL, **_2$$3, *_3$$7 = NULL, *_4$$7 = NULL, *_6$$11 = NULL, *_7$$11 = NULL; - zval *data = NULL; + zval *data_param = NULL, *columnMap = NULL, columnMap_sub, __$null, key, value, snapshot, attribute, *_0$$3, _3$$7, _4$$7, _6$$11, _7$$11; + zval data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&columnMap_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_6$$11); + ZVAL_UNDEF(&_7$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &data_param, &columnMap); - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); if (!columnMap) { - columnMap = ZEPHIR_GLOBAL(global_null); + columnMap = &columnMap_sub; + columnMap = &__$null; } if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_INIT_VAR(snapshot); - array_init(snapshot); - zephir_is_iterable(data, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model.zep", 3952); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(value, _2$$3); - if (Z_TYPE_P(key) != IS_STRING) { + ZEPHIR_INIT_VAR(&snapshot); + array_init(&snapshot); + zephir_is_iterable(&data, 0, "phalcon/mvc/model.zep", 3952); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&key, _2$$3); + } else { + ZVAL_LONG(&key, _1$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0$$3); + if (Z_TYPE_P(&key) != IS_STRING) { continue; } - ZEPHIR_OBS_NVAR(attribute); - if (!(zephir_array_isset_fetch(&attribute, columnMap, key, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&attribute); + if (!(zephir_array_isset_fetch(&attribute, columnMap, &key, 0 TSRMLS_CC))) { if (!(ZEPHIR_GLOBAL(orm).ignore_unknown_columns)) { - ZEPHIR_INIT_NVAR(_3$$7); - object_init_ex(_3$$7, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_3$$7); + object_init_ex(&_3$$7, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_4$$7); - ZEPHIR_CONCAT_SVS(_4$$7, "Column '", key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _3$$7, "__construct", &_5, 9, _4$$7); + ZEPHIR_CONCAT_SVS(&_4$$7, "Column '", &key, "' doesn't make part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", &_5, 4, &_4$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$7, "phalcon/mvc/model.zep", 3936 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$7, "phalcon/mvc/model.zep", 3936 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } else { continue; } } - if (Z_TYPE_P(attribute) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attribute); - if (!(zephir_array_isset_long_fetch(&attribute, attribute, 0, 0 TSRMLS_CC))) { + if (Z_TYPE_P(&attribute) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attribute); + if (!(zephir_array_isset_long_fetch(&attribute, &attribute, 0, 0 TSRMLS_CC))) { if (!(ZEPHIR_GLOBAL(orm).ignore_unknown_columns)) { - ZEPHIR_INIT_NVAR(_6$$11); - object_init_ex(_6$$11, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_6$$11); + object_init_ex(&_6$$11, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_7$$11); - ZEPHIR_CONCAT_SVS(_7$$11, "Column '", key, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _6$$11, "__construct", &_5, 9, _7$$11); + ZEPHIR_CONCAT_SVS(&_7$$11, "Column '", &key, "' doesn't make part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_6$$11, "__construct", &_5, 4, &_7$$11); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$11, "phalcon/mvc/model.zep", 3944 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$11, "phalcon/mvc/model.zep", 3944 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } else { @@ -5144,12 +5948,14 @@ PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) { } } } - zephir_array_update_zval(&snapshot, attribute, &value, PH_COPY | PH_SEPARATE); - } + zephir_array_update_zval(&snapshot, &attribute, &value, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } else { - ZEPHIR_CPY_WRT(snapshot, data); + ZEPHIR_CPY_WRT(&snapshot, &data); } - zephir_update_property_this(getThis(), SL("_oldSnapshot"), snapshot TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_oldSnapshot"), &snapshot); ZEPHIR_MM_RESTORE(); } @@ -5159,11 +5965,14 @@ PHP_METHOD(Phalcon_Mvc_Model, setOldSnapshotData) { */ PHP_METHOD(Phalcon_Mvc_Model, hasSnapshotData) { - zval *snapshot = NULL; + zval snapshot; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&snapshot); - snapshot = zephir_fetch_nproperty_this(this_ptr, SL("_snapshot"), PH_NOISY_CC); - RETURN_BOOL(Z_TYPE_P(snapshot) == IS_ARRAY); + + zephir_read_property(&snapshot, this_ptr, SL("_snapshot"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(Z_TYPE_P(&snapshot) == IS_ARRAY); } @@ -5172,7 +5981,8 @@ PHP_METHOD(Phalcon_Mvc_Model, hasSnapshotData) { */ PHP_METHOD(Phalcon_Mvc_Model, getSnapshotData) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_snapshot"); @@ -5183,7 +5993,8 @@ PHP_METHOD(Phalcon_Mvc_Model, getSnapshotData) { */ PHP_METHOD(Phalcon_Mvc_Model, getOldSnapshotData) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_oldSnapshot"); @@ -5214,13 +6025,21 @@ PHP_METHOD(Phalcon_Mvc_Model, hasChanged) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool allFields; - zval *fieldName = NULL, *allFields_param = NULL, *changedFields = NULL, *_0$$5 = NULL, *_1$$4 = NULL; + zval *fieldName = NULL, fieldName_sub, *allFields_param = NULL, __$null, changedFields, _0$$5, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&fieldName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&changedFields); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &fieldName, &allFields_param); if (!fieldName) { - fieldName = ZEPHIR_GLOBAL(global_null); + fieldName = &fieldName_sub; + fieldName = &__$null; } if (!allFields_param) { allFields = 0; @@ -5232,18 +6051,18 @@ PHP_METHOD(Phalcon_Mvc_Model, hasChanged) { ZEPHIR_CALL_METHOD(&changedFields, this_ptr, "getchangedfields", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(fieldName) == IS_STRING) { - RETURN_MM_BOOL(zephir_fast_in_array(fieldName, changedFields TSRMLS_CC)); + RETURN_MM_BOOL(zephir_fast_in_array(fieldName, &changedFields TSRMLS_CC)); } else if (Z_TYPE_P(fieldName) == IS_ARRAY) { if (allFields) { - ZEPHIR_CALL_FUNCTION(&_0$$5, "array_intersect", NULL, 339, fieldName, changedFields); + ZEPHIR_CALL_FUNCTION(&_0$$5, "array_intersect", NULL, 299, fieldName, &changedFields); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(_0$$5, fieldName)); + RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(&_0$$5, fieldName)); } - ZEPHIR_CALL_FUNCTION(&_1$$4, "array_intersect", NULL, 339, fieldName, changedFields); + ZEPHIR_CALL_FUNCTION(&_1$$4, "array_intersect", NULL, 299, fieldName, &changedFields); zephir_check_call_status(); - RETURN_MM_BOOL(zephir_fast_count_int(_1$$4 TSRMLS_CC) > 0); + RETURN_MM_BOOL(zephir_fast_count_int(&_1$$4 TSRMLS_CC) > 0); } - RETURN_MM_BOOL(zephir_fast_count_int(changedFields TSRMLS_CC) > 0); + RETURN_MM_BOOL(zephir_fast_count_int(&changedFields TSRMLS_CC) > 0); } @@ -5257,13 +6076,21 @@ PHP_METHOD(Phalcon_Mvc_Model, hasUpdated) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool allFields; - zval *fieldName = NULL, *allFields_param = NULL, *updatedFields = NULL, *_0$$5 = NULL, *_1$$4 = NULL; + zval *fieldName = NULL, fieldName_sub, *allFields_param = NULL, __$null, updatedFields, _0$$5, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&fieldName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&updatedFields); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &fieldName, &allFields_param); if (!fieldName) { - fieldName = ZEPHIR_GLOBAL(global_null); + fieldName = &fieldName_sub; + fieldName = &__$null; } if (!allFields_param) { allFields = 0; @@ -5275,18 +6102,18 @@ PHP_METHOD(Phalcon_Mvc_Model, hasUpdated) { ZEPHIR_CALL_METHOD(&updatedFields, this_ptr, "getupdatedfields", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(fieldName) == IS_STRING) { - RETURN_MM_BOOL(zephir_fast_in_array(fieldName, updatedFields TSRMLS_CC)); + RETURN_MM_BOOL(zephir_fast_in_array(fieldName, &updatedFields TSRMLS_CC)); } else if (Z_TYPE_P(fieldName) == IS_ARRAY) { if (allFields) { - ZEPHIR_CALL_FUNCTION(&_0$$5, "array_intersect", NULL, 339, fieldName, updatedFields); + ZEPHIR_CALL_FUNCTION(&_0$$5, "array_intersect", NULL, 299, fieldName, &updatedFields); zephir_check_call_status(); - RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(_0$$5, fieldName)); + RETURN_MM_BOOL(ZEPHIR_IS_EQUAL(&_0$$5, fieldName)); } - ZEPHIR_CALL_FUNCTION(&_1$$4, "array_intersect", NULL, 339, fieldName, updatedFields); + ZEPHIR_CALL_FUNCTION(&_1$$4, "array_intersect", NULL, 299, fieldName, &updatedFields); zephir_check_call_status(); - RETURN_MM_BOOL(zephir_fast_count_int(_1$$4 TSRMLS_CC) > 0); + RETURN_MM_BOOL(zephir_fast_count_int(&_1$$4 TSRMLS_CC) > 0); } - RETURN_MM_BOOL(zephir_fast_count_int(updatedFields TSRMLS_CC) > 0); + RETURN_MM_BOOL(zephir_fast_count_int(&updatedFields TSRMLS_CC) > 0); } @@ -5305,55 +6132,72 @@ PHP_METHOD(Phalcon_Mvc_Model, hasUpdated) { */ PHP_METHOD(Phalcon_Mvc_Model, getChangedFields) { - HashTable *_2; - HashPosition _1; - zval *metaData = NULL, *changed = NULL, *name = NULL, *snapshot = NULL, *columnMap = NULL, *allAttributes = NULL, *value = NULL, *_0 = NULL, **_3, *_4$$6; + zend_string *_3; + zend_ulong _2; + zval metaData, changed, name, snapshot, columnMap, allAttributes, value, _0, *_1, _4$$6; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&changed); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&allAttributes); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(snapshot); - zephir_read_property_this(&snapshot, this_ptr, SL("_snapshot"), PH_NOISY_CC); - if (Z_TYPE_P(snapshot) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&snapshot); + zephir_read_property(&snapshot, this_ptr, SL("_snapshot"), PH_NOISY_CC); + if (Z_TYPE_P(&snapshot) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The record doesn't have a valid data snapshot", "phalcon/mvc/model.zep", 4077); return; } ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getreversecolumnmap", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getreversecolumnmap", NULL, 0, this_ptr); zephir_check_call_status(); - if (Z_TYPE_P(columnMap) != IS_ARRAY) { - ZEPHIR_CALL_METHOD(&allAttributes, metaData, "getdatatypes", NULL, 0, this_ptr); + if (Z_TYPE_P(&columnMap) != IS_ARRAY) { + ZEPHIR_CALL_METHOD(&allAttributes, &metaData, "getdatatypes", NULL, 0, this_ptr); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(allAttributes, columnMap); - } - ZEPHIR_INIT_VAR(changed); - array_init(changed); - ZEPHIR_INIT_VAR(_0); - zephir_is_iterable(allAttributes, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 4130); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(name, _2, _1); - ZEPHIR_GET_HVALUE(_0, _3); - if (!(zephir_array_isset(snapshot, name))) { - zephir_array_append(&changed, name, PH_SEPARATE, "phalcon/mvc/model.zep", 4109); + ZEPHIR_CPY_WRT(&allAttributes, &columnMap); + } + ZEPHIR_INIT_VAR(&changed); + array_init(&changed); + ZEPHIR_INIT_VAR(&_0); + zephir_is_iterable(&allAttributes, 0, "phalcon/mvc/model.zep", 4130); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&allAttributes), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&name); + if (_3 != NULL) { + ZVAL_STR_COPY(&name, _3); + } else { + ZVAL_LONG(&name, _2); + } + ZEPHIR_INIT_NVAR(&_0); + ZVAL_COPY(&_0, _1); + if (!(zephir_array_isset(&snapshot, &name))) { + zephir_array_append(&changed, &name, PH_SEPARATE, "phalcon/mvc/model.zep", 4109); continue; } - ZEPHIR_OBS_NVAR(value); - if (!(zephir_fetch_property_zval(&value, this_ptr, name, PH_SILENT_CC))) { - zephir_array_append(&changed, name, PH_SEPARATE, "phalcon/mvc/model.zep", 4117); + ZEPHIR_OBS_NVAR(&value); + if (!(zephir_fetch_property_zval(&value, this_ptr, &name, PH_SILENT_CC))) { + zephir_array_append(&changed, &name, PH_SEPARATE, "phalcon/mvc/model.zep", 4117); continue; } - zephir_array_fetch(&_4$$6, snapshot, name, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 4124 TSRMLS_CC); - if (!ZEPHIR_IS_IDENTICAL(value, _4$$6)) { - zephir_array_append(&changed, name, PH_SEPARATE, "phalcon/mvc/model.zep", 4125); + zephir_array_fetch(&_4$$6, &snapshot, &name, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 4124 TSRMLS_CC); + if (!ZEPHIR_IS_IDENTICAL(&value, &_4$$6)) { + zephir_array_append(&changed, &name, PH_SEPARATE, "phalcon/mvc/model.zep", 4125); continue; } - } - RETURN_CCTOR(changed); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_0); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&changed); } @@ -5375,49 +6219,64 @@ PHP_METHOD(Phalcon_Mvc_Model, getChangedFields) { */ PHP_METHOD(Phalcon_Mvc_Model, getUpdatedFields) { - HashTable *_2; - HashPosition _1; - zval *updated = NULL, *name = NULL, *snapshot = NULL, *oldSnapshot = NULL, *value = NULL, *_0, **_3, *_4$$6; + zend_string *_3; + zend_ulong _2; + zval updated, name, snapshot, oldSnapshot, value, _0, *_1, _4$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&updated); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&oldSnapshot); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(snapshot); - zephir_read_property_this(&snapshot, this_ptr, SL("_snapshot"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(oldSnapshot); - zephir_read_property_this(&oldSnapshot, this_ptr, SL("_oldSnapshot"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&snapshot); + zephir_read_property(&snapshot, this_ptr, SL("_snapshot"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&oldSnapshot); + zephir_read_property(&oldSnapshot, this_ptr, SL("_oldSnapshot"), PH_NOISY_CC); if (!(ZEPHIR_GLOBAL(orm).update_snapshot_on_save)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Update snapshot on save must be enabled for this method to work properly", "phalcon/mvc/model.zep", 4158); return; } - if (Z_TYPE_P(snapshot) != IS_ARRAY) { + if (Z_TYPE_P(&snapshot) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The record doesn't have a valid data snapshot", "phalcon/mvc/model.zep", 4162); return; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dirtyState"), PH_NOISY_CC); - if (!ZEPHIR_IS_LONG(_0, 0)) { + zephir_read_property(&_0, this_ptr, SL("_dirtyState"), PH_NOISY_CC | PH_READONLY); + if (!ZEPHIR_IS_LONG(&_0, 0)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Change checking cannot be performed because the object has not been persisted or is deleted", "phalcon/mvc/model.zep", 4169); return; } - ZEPHIR_INIT_VAR(updated); - array_init(updated); - zephir_is_iterable(snapshot, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 4189); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(name, _2, _1); - ZEPHIR_GET_HVALUE(value, _3); - if (!(zephir_array_isset(oldSnapshot, name))) { - zephir_array_append(&updated, name, PH_SEPARATE, "phalcon/mvc/model.zep", 4179); + ZEPHIR_INIT_VAR(&updated); + array_init(&updated); + zephir_is_iterable(&snapshot, 0, "phalcon/mvc/model.zep", 4189); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&snapshot), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&name); + if (_3 != NULL) { + ZVAL_STR_COPY(&name, _3); + } else { + ZVAL_LONG(&name, _2); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + if (!(zephir_array_isset(&oldSnapshot, &name))) { + zephir_array_append(&updated, &name, PH_SEPARATE, "phalcon/mvc/model.zep", 4179); continue; } - zephir_array_fetch(&_4$$6, oldSnapshot, name, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 4183 TSRMLS_CC); - if (!ZEPHIR_IS_IDENTICAL(value, _4$$6)) { - zephir_array_append(&updated, name, PH_SEPARATE, "phalcon/mvc/model.zep", 4184); + zephir_array_fetch(&_4$$6, &oldSnapshot, &name, PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 4183 TSRMLS_CC); + if (!ZEPHIR_IS_IDENTICAL(&value, &_4$$6)) { + zephir_array_append(&updated, &name, PH_SEPARATE, "phalcon/mvc/model.zep", 4184); continue; } - } - RETURN_CCTOR(updated); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&updated); } @@ -5440,8 +6299,12 @@ PHP_METHOD(Phalcon_Mvc_Model, getUpdatedFields) { PHP_METHOD(Phalcon_Mvc_Model, useDynamicUpdate) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *dynamicUpdate_param = NULL, *_0, *_1; + zval *dynamicUpdate_param = NULL, _0, _1; zend_bool dynamicUpdate; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &dynamicUpdate_param); @@ -5449,14 +6312,13 @@ PHP_METHOD(Phalcon_Mvc_Model, useDynamicUpdate) { dynamicUpdate = zephir_get_boolval(dynamicUpdate_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); if (dynamicUpdate) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(NULL, _0, "usedynamicupdate", NULL, 0, this_ptr, _1); + ZEPHIR_CALL_METHOD(NULL, &_0, "usedynamicupdate", NULL, 0, this_ptr, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -5472,39 +6334,51 @@ PHP_METHOD(Phalcon_Mvc_Model, useDynamicUpdate) { PHP_METHOD(Phalcon_Mvc_Model, getRelated) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias_param = NULL, *arguments = NULL, *relation = NULL, *className = NULL, *manager = NULL, *_0, *_1 = NULL, *_4, *_2$$3, *_3$$3; - zval *alias = NULL; + zval *alias_param = NULL, *arguments = NULL, arguments_sub, __$null, relation, className, manager, _0, _1, _2$$3, _3$$3; + zval alias; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&arguments_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &alias_param, &arguments); - zephir_get_strval(alias, alias_param); + zephir_get_strval(&alias, alias_param); if (!arguments) { - arguments = ZEPHIR_GLOBAL(global_null); + arguments = &arguments_sub; + arguments = &__$null; } - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, this_ptr, 0 TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(manager, _0); - ZEPHIR_CALL_METHOD(&_1, manager, "getrelationbyalias", NULL, 0, className, alias); + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, this_ptr, 0 TSRMLS_CC); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&manager, &_0); + ZEPHIR_CALL_METHOD(&_1, &manager, "getrelationbyalias", NULL, 0, &className, &alias); zephir_check_call_status(); - ZEPHIR_CPY_WRT(relation, _1); - if (Z_TYPE_P(relation) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$3); - object_init_ex(_2$$3, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_3$$3); - ZEPHIR_CONCAT_SVSVS(_3$$3, "There is no defined relations for the model '", className, "' using alias '", alias, "'"); - ZEPHIR_CALL_METHOD(NULL, _2$$3, "__construct", NULL, 9, _3$$3); + ZEPHIR_CPY_WRT(&relation, &_1); + if (Z_TYPE_P(&relation) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$3); + object_init_ex(&_2$$3, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_3$$3); + ZEPHIR_CONCAT_SVSVS(&_3$$3, "There is no defined relations for the model '", &className, "' using alias '", &alias, "'"); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 4, &_3$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_2$$3, "phalcon/mvc/model.zep", 4231 TSRMLS_CC); + zephir_throw_exception_debug(&_2$$3, "phalcon/mvc/model.zep", 4231 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(_4); - ZVAL_NULL(_4); - ZEPHIR_RETURN_CALL_METHOD(manager, "getrelationrecords", NULL, 0, relation, _4, this_ptr, arguments); + ZVAL_NULL(&_0); + ZEPHIR_RETURN_CALL_METHOD(&manager, "getrelationrecords", NULL, 0, &relation, &_0, this_ptr, arguments); zephir_check_call_status(); RETURN_MM(); @@ -5521,65 +6395,79 @@ PHP_METHOD(Phalcon_Mvc_Model, getRelated) { PHP_METHOD(Phalcon_Mvc_Model, _getRelatedRecords) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *modelName_param = NULL, *method_param = NULL, *arguments, *manager = NULL, *relation = NULL, *queryMethod = NULL, *extraArgs = NULL, *_0, *_1$$3 = NULL, _2$$3, *_3$$3, *_4$$4 = NULL, _5$$4, *_6$$4; - zval *modelName = NULL, *method = NULL; + zval *modelName_param = NULL, *method_param = NULL, *arguments, arguments_sub, manager, relation, queryMethod, extraArgs, _0, _1$$3, _2$$3, _3$$3, _4$$4, _5$$4, _6$$4; + zval modelName, method; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&arguments_sub); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&queryMethod); + ZVAL_UNDEF(&extraArgs); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &modelName_param, &method_param, &arguments); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); } else { - ZEPHIR_INIT_VAR(method); - ZVAL_EMPTY_STRING(method); + ZEPHIR_INIT_VAR(&method); + ZVAL_EMPTY_STRING(&method); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(manager, _0); - ZEPHIR_INIT_VAR(relation); - ZVAL_BOOL(relation, 0); - ZEPHIR_INIT_VAR(queryMethod); - ZVAL_NULL(queryMethod); - if (zephir_start_with_str(method, SL("get"))) { - ZEPHIR_SINIT_VAR(_2$$3); + zephir_read_property(&_0, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&manager, &_0); + ZEPHIR_INIT_VAR(&relation); + ZVAL_BOOL(&relation, 0); + ZEPHIR_INIT_VAR(&queryMethod); + ZVAL_NULL(&queryMethod); + if (zephir_start_with_str(&method, SL("get"))) { ZVAL_LONG(&_2$$3, 3); - ZEPHIR_INIT_VAR(_3$$3); - zephir_substr(_3$$3, method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_METHOD(&_1$$3, manager, "getrelationbyalias", NULL, 0, modelName, _3$$3); + ZEPHIR_INIT_VAR(&_3$$3); + zephir_substr(&_3$$3, &method, 3 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_CALL_METHOD(&_1$$3, &manager, "getrelationbyalias", NULL, 0, &modelName, &_3$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(relation, _1$$3); - } else if (zephir_start_with_str(method, SL("count"))) { - ZEPHIR_INIT_NVAR(queryMethod); - ZVAL_STRING(queryMethod, "count", 1); - ZEPHIR_SINIT_VAR(_5$$4); + ZEPHIR_CPY_WRT(&relation, &_1$$3); + } else if (zephir_start_with_str(&method, SL("count"))) { + ZEPHIR_INIT_NVAR(&queryMethod); + ZVAL_STRING(&queryMethod, "count"); ZVAL_LONG(&_5$$4, 5); - ZEPHIR_INIT_VAR(_6$$4); - zephir_substr(_6$$4, method, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_CALL_METHOD(&_4$$4, manager, "getrelationbyalias", NULL, 0, modelName, _6$$4); + ZEPHIR_INIT_VAR(&_6$$4); + zephir_substr(&_6$$4, &method, 5 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_CALL_METHOD(&_4$$4, &manager, "getrelationbyalias", NULL, 0, &modelName, &_6$$4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(relation, _4$$4); + ZEPHIR_CPY_WRT(&relation, &_4$$4); } - if (Z_TYPE_P(relation) != IS_OBJECT) { + if (Z_TYPE_P(&relation) != IS_OBJECT) { RETURN_MM_NULL(); } - ZEPHIR_OBS_VAR(extraArgs); + ZEPHIR_OBS_VAR(&extraArgs); zephir_array_isset_long_fetch(&extraArgs, arguments, 0, 0 TSRMLS_CC); - ZEPHIR_RETURN_CALL_METHOD(manager, "getrelationrecords", NULL, 0, relation, queryMethod, this_ptr, extraArgs); + ZEPHIR_RETURN_CALL_METHOD(&manager, "getrelationrecords", NULL, 0, &relation, &queryMethod, this_ptr, &extraArgs); zephir_check_call_status(); RETURN_MM(); @@ -5594,107 +6482,128 @@ PHP_METHOD(Phalcon_Mvc_Model, _getRelatedRecords) { */ PHP_METHOD(Phalcon_Mvc_Model, _invokeFinder) { - zval *_9, *_11; + zval _9, _11; zend_class_entry *_6, *_12; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method, *arguments, *extraMethod = NULL, *type = NULL, *modelName = NULL, *value = NULL, *model = NULL, *attributes = NULL, *field = NULL, *extraMethodFirst = NULL, *metaData = NULL, *_5 = NULL, *_10, _0$$3, _1$$4, _2$$5, *_3$$7, *_4$$7, *_7$$13, *_8$$13; + zval *method, method_sub, *arguments, arguments_sub, extraMethod, type, modelName, value, model, attributes, field, extraMethodFirst, metaData, _5, _10, _0$$3, _1$$4, _2$$5, _3$$7, _4$$7, _7$$13, _8$$13; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method_sub); + ZVAL_UNDEF(&arguments_sub); + ZVAL_UNDEF(&extraMethod); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&extraMethodFirst); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_7$$13); + ZVAL_UNDEF(&_8$$13); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &method, &arguments); - ZEPHIR_INIT_VAR(extraMethod); - ZVAL_NULL(extraMethod); + ZEPHIR_INIT_VAR(&extraMethod); + ZVAL_NULL(&extraMethod); if (zephir_start_with_str(method, SL("findFirstBy"))) { - ZEPHIR_INIT_VAR(type); - ZVAL_STRING(type, "findFirst", 1); - ZEPHIR_SINIT_VAR(_0$$3); + ZEPHIR_INIT_VAR(&type); + ZVAL_STRING(&type, "findFirst"); ZVAL_LONG(&_0$$3, 11); - ZEPHIR_INIT_NVAR(extraMethod); - zephir_substr(extraMethod, method, 11 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_INIT_NVAR(&extraMethod); + zephir_substr(&extraMethod, method, 11 , 0, ZEPHIR_SUBSTR_NO_LENGTH); } else if (zephir_start_with_str(method, SL("findBy"))) { - ZEPHIR_INIT_NVAR(type); - ZVAL_STRING(type, "find", 1); - ZEPHIR_SINIT_VAR(_1$$4); + ZEPHIR_INIT_NVAR(&type); + ZVAL_STRING(&type, "find"); ZVAL_LONG(&_1$$4, 6); - ZEPHIR_INIT_NVAR(extraMethod); - zephir_substr(extraMethod, method, 6 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_INIT_NVAR(&extraMethod); + zephir_substr(&extraMethod, method, 6 , 0, ZEPHIR_SUBSTR_NO_LENGTH); } else if (zephir_start_with_str(method, SL("countBy"))) { - ZEPHIR_INIT_NVAR(type); - ZVAL_STRING(type, "count", 1); - ZEPHIR_SINIT_VAR(_2$$5); + ZEPHIR_INIT_NVAR(&type); + ZVAL_STRING(&type, "count"); ZVAL_LONG(&_2$$5, 7); - ZEPHIR_INIT_NVAR(extraMethod); - zephir_substr(extraMethod, method, 7 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + ZEPHIR_INIT_NVAR(&extraMethod); + zephir_substr(&extraMethod, method, 7 , 0, ZEPHIR_SUBSTR_NO_LENGTH); } - ZEPHIR_INIT_VAR(modelName); - zephir_get_called_class(modelName TSRMLS_CC); - if (!(zephir_is_true(extraMethod))) { + ZEPHIR_INIT_VAR(&modelName); + zephir_get_called_class(&modelName TSRMLS_CC); + if (!(zephir_is_true(&extraMethod))) { RETURN_MM_NULL(); } - ZEPHIR_OBS_VAR(value); + ZEPHIR_OBS_VAR(&value); if (!(zephir_array_isset_long_fetch(&value, arguments, 0, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_3$$7); - object_init_ex(_3$$7, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_4$$7); - ZEPHIR_CONCAT_SVS(_4$$7, "The static method '", method, "' requires one argument"); - ZEPHIR_CALL_METHOD(NULL, _3$$7, "__construct", NULL, 9, _4$$7); + ZEPHIR_INIT_VAR(&_3$$7); + object_init_ex(&_3$$7, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_4$$7); + ZEPHIR_CONCAT_SVS(&_4$$7, "The static method '", method, "' requires one argument"); + ZEPHIR_CALL_METHOD(NULL, &_3$$7, "__construct", NULL, 4, &_4$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$7, "phalcon/mvc/model.zep", 4337 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$7, "phalcon/mvc/model.zep", 4337 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(model); - zephir_fetch_safe_class(_5, modelName); - _6 = zend_fetch_class(Z_STRVAL_P(_5), Z_STRLEN_P(_5), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(model, _6); - if (zephir_has_constructor(model TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, model, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&model); + zephir_fetch_safe_class(&_5, &modelName); + _6 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_5), Z_STRLEN_P(&_5), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&model, _6); + if (zephir_has_constructor(&model TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &model, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&metaData, model, "getmodelsmetadata", NULL, 0); + ZEPHIR_CALL_METHOD(&metaData, &model, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&attributes, metaData, "getreversecolumnmap", NULL, 0, model); + ZEPHIR_CALL_METHOD(&attributes, &metaData, "getreversecolumnmap", NULL, 0, &model); zephir_check_call_status(); - if (Z_TYPE_P(attributes) != IS_ARRAY) { - ZEPHIR_CALL_METHOD(&attributes, metaData, "getdatatypes", NULL, 0, model); + if (Z_TYPE_P(&attributes) != IS_ARRAY) { + ZEPHIR_CALL_METHOD(&attributes, &metaData, "getdatatypes", NULL, 0, &model); zephir_check_call_status(); } - if (zephir_array_isset(attributes, extraMethod)) { - ZEPHIR_CPY_WRT(field, extraMethod); + if (zephir_array_isset(&attributes, &extraMethod)) { + ZEPHIR_CPY_WRT(&field, &extraMethod); } else { - ZEPHIR_CALL_FUNCTION(&extraMethodFirst, "lcfirst", NULL, 71, extraMethod); + ZEPHIR_CALL_FUNCTION(&extraMethodFirst, "lcfirst", NULL, 64, &extraMethod); zephir_check_call_status(); - if (zephir_array_isset(attributes, extraMethodFirst)) { - ZEPHIR_CPY_WRT(field, extraMethodFirst); + if (zephir_array_isset(&attributes, &extraMethodFirst)) { + ZEPHIR_CPY_WRT(&field, &extraMethodFirst); } else { - ZEPHIR_INIT_NVAR(field); - zephir_uncamelize(field, extraMethod, NULL ); - if (!(zephir_array_isset(attributes, field))) { - ZEPHIR_INIT_VAR(_7$$13); - object_init_ex(_7$$13, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_8$$13); - ZEPHIR_CONCAT_SVS(_8$$13, "Cannot resolve attribute '", extraMethod, "' in the model"); - ZEPHIR_CALL_METHOD(NULL, _7$$13, "__construct", NULL, 9, _8$$13); + ZEPHIR_INIT_NVAR(&field); + zephir_uncamelize(&field, &extraMethod, NULL ); + if (!(zephir_array_isset(&attributes, &field))) { + ZEPHIR_INIT_VAR(&_7$$13); + object_init_ex(&_7$$13, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_8$$13); + ZEPHIR_CONCAT_SVS(&_8$$13, "Cannot resolve attribute '", &extraMethod, "' in the model"); + ZEPHIR_CALL_METHOD(NULL, &_7$$13, "__construct", NULL, 4, &_8$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$13, "phalcon/mvc/model.zep", 4371 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$13, "phalcon/mvc/model.zep", 4371 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } } - ZEPHIR_INIT_VAR(_9); - zephir_create_array(_9, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_10); - ZEPHIR_CONCAT_SVS(_10, "[", field, "] = ?0"); + ZEPHIR_INIT_VAR(&_9); + zephir_create_array(&_9, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_10); + ZEPHIR_CONCAT_SVS(&_10, "[", &field, "] = ?0"); zephir_array_update_string(&_9, SL("conditions"), &_10, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_11); - zephir_create_array(_11, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_11, value); + ZEPHIR_INIT_VAR(&_11); + zephir_create_array(&_11, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_11, &value); zephir_array_update_string(&_9, SL("bind"), &_11, PH_COPY | PH_SEPARATE); - _12 = zephir_fetch_class(modelName TSRMLS_CC); - ZEPHIR_RETURN_CALL_CE_STATIC_ZVAL(_12, type, NULL, 0, _9); + _12 = zephir_fetch_class(&modelName TSRMLS_CC); + ZEPHIR_RETURN_CALL_CE_STATIC_ZVAL(_12, type, NULL, 0, &_9); zephir_check_call_status(); RETURN_MM(); @@ -5711,40 +6620,50 @@ PHP_METHOD(Phalcon_Mvc_Model, __call) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *method_param = NULL, *arguments, *modelName = NULL, *status = NULL, *records = NULL, *_1, *_2, *_3; - zval *method = NULL; + zval *method_param = NULL, *arguments, arguments_sub, modelName, status, records, _1, _2, _3; + zval method; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&arguments_sub); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &method_param, &arguments); - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); - ZEPHIR_CALL_SELF(&records, "_invokefinder", &_0, 340, method, arguments); + ZEPHIR_CALL_SELF(&records, "_invokefinder", &_0, 300, &method, arguments); zephir_check_call_status(); - if (Z_TYPE_P(records) != IS_NULL) { - RETURN_CCTOR(records); + if (Z_TYPE_P(&records) != IS_NULL) { + RETURN_CCTOR(&records); } - ZEPHIR_INIT_VAR(modelName); - zephir_get_class(modelName, this_ptr, 0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&records, this_ptr, "_getrelatedrecords", NULL, 0, modelName, method, arguments); + ZEPHIR_INIT_VAR(&modelName); + zephir_get_class(&modelName, this_ptr, 0 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&records, this_ptr, "_getrelatedrecords", NULL, 0, &modelName, &method, arguments); zephir_check_call_status(); - if (Z_TYPE_P(records) != IS_NULL) { - RETURN_CCTOR(records); + if (Z_TYPE_P(&records) != IS_NULL) { + RETURN_CCTOR(&records); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsManager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&status, _1, "missingmethod", NULL, 0, this_ptr, method, arguments); + zephir_read_property(&_1, this_ptr, SL("_modelsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&status, &_1, "missingmethod", NULL, 0, this_ptr, &method, arguments); zephir_check_call_status(); - if (Z_TYPE_P(status) != IS_NULL) { - RETURN_CCTOR(status); + if (Z_TYPE_P(&status) != IS_NULL) { + RETURN_CCTOR(&status); } - ZEPHIR_INIT_VAR(_2); - object_init_ex(_2, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SVSVS(_3, "The method '", method, "' doesn't exist on model '", modelName, "'"); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 9, _3); + ZEPHIR_INIT_VAR(&_2); + object_init_ex(&_2, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SVSVS(&_3, "The method '", &method, "' doesn't exist on model '", &modelName, "'"); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 4, &_3); zephir_check_call_status(); - zephir_throw_exception_debug(_2, "phalcon/mvc/model.zep", 4422 TSRMLS_CC); + zephir_throw_exception_debug(&_2, "phalcon/mvc/model.zep", 4422 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -5761,29 +6680,36 @@ PHP_METHOD(Phalcon_Mvc_Model, __callStatic) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *method_param = NULL, *arguments, *records = NULL, *_1$$3; - zval *method = NULL, *_2$$3; + zval *method_param = NULL, *arguments, arguments_sub, records, _1$$3; + zval method, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&arguments_sub); + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &method_param, &arguments); - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); - ZEPHIR_CALL_SELF(&records, "_invokefinder", &_0, 340, method, arguments); + ZEPHIR_CALL_SELF(&records, "_invokefinder", &_0, 300, &method, arguments); zephir_check_call_status(); - if (Z_TYPE_P(records) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SVS(_2$$3, "The static method '", method, "' doesn't exist"); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _2$$3); + if (Z_TYPE_P(&records) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SVS(&_2$$3, "The static method '", &method, "' doesn't exist"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/mvc/model.zep", 4438 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/mvc/model.zep", 4438 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - RETURN_CCTOR(records); + RETURN_CCTOR(&records); } @@ -5795,110 +6721,139 @@ PHP_METHOD(Phalcon_Mvc_Model, __callStatic) { */ PHP_METHOD(Phalcon_Mvc_Model, __set) { - HashTable *_2$$6; - HashPosition _1$$6; + zend_string *_3$$6; + zend_ulong _2$$6; zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property_param = NULL, *value, *lowerProperty = NULL, *related = NULL, *modelName = NULL, *manager = NULL, *lowerKey = NULL, *relation = NULL, *referencedModel = NULL, *key = NULL, *item = NULL, *dirtyState = NULL, *_9 = NULL, *_10 = NULL, *_0$$4 = NULL, **_3$$6, *_4$$10 = NULL, *_6$$11 = NULL, *_8$$12, *_11$$14 = NULL, *_12$$15; - zval *property = NULL, *_13$$15; + zval *property_param = NULL, *value, value_sub, lowerProperty, related, modelName, manager, lowerKey, relation, referencedModel, key, item, dirtyState, _9, _10, _0$$4, *_1$$6, _4$$10, _6$$11, _8$$12, _11$$14, _12$$15; + zval property, _13$$15; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&_13$$15); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&lowerProperty); + ZVAL_UNDEF(&related); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&lowerKey); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&referencedModel); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&dirtyState); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_4$$10); + ZVAL_UNDEF(&_6$$11); + ZVAL_UNDEF(&_8$$12); + ZVAL_UNDEF(&_11$$14); + ZVAL_UNDEF(&_12$$15); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &property_param, &value); - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); if (Z_TYPE_P(value) == IS_OBJECT) { if (zephir_instance_of_ev(value, phalcon_mvc_modelinterface_ce TSRMLS_CC)) { - ZEPHIR_OBS_VAR(dirtyState); - zephir_read_property_this(&dirtyState, this_ptr, SL("_dirtyState"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&dirtyState); + zephir_read_property(&dirtyState, this_ptr, SL("_dirtyState"), PH_NOISY_CC); ZEPHIR_CALL_METHOD(&_0$$4, value, "getdirtystate", NULL, 0); zephir_check_call_status(); - if (!ZEPHIR_IS_EQUAL(_0$$4, dirtyState)) { - ZEPHIR_INIT_NVAR(dirtyState); - ZVAL_LONG(dirtyState, 1); + if (!ZEPHIR_IS_EQUAL(&_0$$4, &dirtyState)) { + ZEPHIR_INIT_NVAR(&dirtyState); + ZVAL_LONG(&dirtyState, 1); } - ZEPHIR_INIT_VAR(lowerProperty); - zephir_fast_strtolower(lowerProperty, property); - zephir_update_property_zval_zval(getThis(), lowerProperty, value TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_related"), lowerProperty, value TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_dirtyState"), dirtyState TSRMLS_CC); + ZEPHIR_INIT_VAR(&lowerProperty); + zephir_fast_strtolower(&lowerProperty, &property); + zephir_update_property_zval_zval(this_ptr, &lowerProperty, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_related"), &lowerProperty, value TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &dirtyState); RETVAL_ZVAL(value, 1, 0); RETURN_MM(); } } if (Z_TYPE_P(value) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(lowerProperty); - zephir_fast_strtolower(lowerProperty, property); - ZEPHIR_INIT_VAR(modelName); - zephir_get_class(modelName, this_ptr, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&lowerProperty); + zephir_fast_strtolower(&lowerProperty, &property); + ZEPHIR_INIT_VAR(&modelName); + zephir_get_class(&modelName, this_ptr, 0 TSRMLS_CC); ZEPHIR_CALL_METHOD(&manager, this_ptr, "getmodelsmanager", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(related); - array_init(related); - zephir_is_iterable(value, &_2$$6, &_1$$6, 0, 0, "phalcon/mvc/model.zep", 4498); - for ( - ; zend_hash_get_current_data_ex(_2$$6, (void**) &_3$$6, &_1$$6) == SUCCESS - ; zend_hash_move_forward_ex(_2$$6, &_1$$6) - ) { - ZEPHIR_GET_HMKEY(key, _2$$6, _1$$6); - ZEPHIR_GET_HVALUE(item, _3$$6); - if (Z_TYPE_P(item) == IS_OBJECT) { - if (zephir_instance_of_ev(item, phalcon_mvc_modelinterface_ce TSRMLS_CC)) { - zephir_array_append(&related, item, PH_SEPARATE, "phalcon/mvc/model.zep", 4485); + ZEPHIR_INIT_VAR(&related); + array_init(&related); + zephir_is_iterable(value, 0, "phalcon/mvc/model.zep", 4498); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(value), _2$$6, _3$$6, _1$$6) + { + ZEPHIR_INIT_NVAR(&key); + if (_3$$6 != NULL) { + ZVAL_STR_COPY(&key, _3$$6); + } else { + ZVAL_LONG(&key, _2$$6); + } + ZEPHIR_INIT_NVAR(&item); + ZVAL_COPY(&item, _1$$6); + if (Z_TYPE_P(&item) == IS_OBJECT) { + if (zephir_instance_of_ev(&item, phalcon_mvc_modelinterface_ce TSRMLS_CC)) { + zephir_array_append(&related, &item, PH_SEPARATE, "phalcon/mvc/model.zep", 4485); } } else { - ZEPHIR_INIT_NVAR(lowerKey); - zephir_fast_strtolower(lowerKey, key); - zephir_update_property_zval_zval(getThis(), lowerKey, item TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_4$$10, manager, "getrelationbyalias", &_5, 0, modelName, lowerProperty); + ZEPHIR_INIT_NVAR(&lowerKey); + zephir_fast_strtolower(&lowerKey, &key); + zephir_update_property_zval_zval(this_ptr, &lowerKey, &item TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_4$$10, &manager, "getrelationbyalias", &_5, 0, &modelName, &lowerProperty); zephir_check_call_status(); - ZEPHIR_CPY_WRT(relation, _4$$10); - if (Z_TYPE_P(relation) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_6$$11, relation, "getreferencedmodel", NULL, 0); + ZEPHIR_CPY_WRT(&relation, &_4$$10); + if (Z_TYPE_P(&relation) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&_6$$11, &relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&referencedModel, manager, "load", &_7, 0, _6$$11); + ZEPHIR_CALL_METHOD(&referencedModel, &manager, "load", &_7, 0, &_6$$11); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, referencedModel, "writeattribute", NULL, 0, lowerKey, item); + ZEPHIR_CALL_METHOD(NULL, &referencedModel, "writeattribute", NULL, 0, &lowerKey, &item); zephir_check_call_status(); } } - } - if (zephir_fast_count_int(related TSRMLS_CC) > 0) { - zephir_update_property_array(this_ptr, SL("_related"), lowerProperty, related TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&item); + ZEPHIR_INIT_NVAR(&key); + if (zephir_fast_count_int(&related TSRMLS_CC) > 0) { + zephir_update_property_array(this_ptr, SL("_related"), &lowerProperty, &related TSRMLS_CC); ZEPHIR_INIT_ZVAL_NREF(_8$$12); - ZVAL_LONG(_8$$12, 1); - zephir_update_property_this(getThis(), SL("_dirtyState"), _8$$12 TSRMLS_CC); + ZVAL_LONG(&_8$$12, 1); + zephir_update_property_zval(this_ptr, SL("_dirtyState"), &_8$$12); } RETVAL_ZVAL(value, 1, 0); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&_9, this_ptr, "_possiblesetter", NULL, 330, property, value); + ZEPHIR_CALL_METHOD(&_9, this_ptr, "_possiblesetter", NULL, 290, &property, value); zephir_check_call_status(); - if (zephir_is_true(_9)) { + if (zephir_is_true(&_9)) { RETVAL_ZVAL(value, 1, 0); RETURN_MM(); } - ZEPHIR_CALL_FUNCTION(&_10, "property_exists", NULL, 341, this_ptr, property); + ZEPHIR_CALL_FUNCTION(&_10, "property_exists", NULL, 301, this_ptr, &property); zephir_check_call_status(); - if (zephir_is_true(_10)) { + if (zephir_is_true(&_10)) { ZEPHIR_CALL_METHOD(&manager, this_ptr, "getmodelsmanager", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$14, manager, "isvisiblemodelproperty", NULL, 0, this_ptr, property); + ZEPHIR_CALL_METHOD(&_11$$14, &manager, "isvisiblemodelproperty", NULL, 0, this_ptr, &property); zephir_check_call_status(); - if (!(zephir_is_true(_11$$14))) { - ZEPHIR_INIT_VAR(_12$$15); - object_init_ex(_12$$15, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_13$$15); - ZEPHIR_CONCAT_SVS(_13$$15, "Property '", property, "' does not have a setter."); - ZEPHIR_CALL_METHOD(NULL, _12$$15, "__construct", NULL, 9, _13$$15); + if (!(zephir_is_true(&_11$$14))) { + ZEPHIR_INIT_VAR(&_12$$15); + object_init_ex(&_12$$15, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_13$$15); + ZEPHIR_CONCAT_SVS(&_13$$15, "Property '", &property, "' does not have a setter."); + ZEPHIR_CALL_METHOD(NULL, &_12$$15, "__construct", NULL, 4, &_13$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_12$$15, "phalcon/mvc/model.zep", 4515 TSRMLS_CC); + zephir_throw_exception_debug(&_12$$15, "phalcon/mvc/model.zep", 4515 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - zephir_update_property_zval_zval(getThis(), property, value TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, &property, value TSRMLS_CC); RETVAL_ZVAL(value, 1, 0); RETURN_MM(); @@ -5914,21 +6869,27 @@ PHP_METHOD(Phalcon_Mvc_Model, __set) { PHP_METHOD(Phalcon_Mvc_Model, _possibleSetter) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property_param = NULL, *value, *possibleSetter = NULL, *_0; - zval *property = NULL; + zval *property_param = NULL, *value, value_sub, possibleSetter, _0; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&possibleSetter); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &property_param, &value); - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); - ZEPHIR_INIT_VAR(_0); - zephir_camelize(_0, property, NULL ); - ZEPHIR_INIT_VAR(possibleSetter); - ZEPHIR_CONCAT_SV(possibleSetter, "set", _0); - if ((zephir_method_exists(this_ptr, possibleSetter TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, possibleSetter, NULL, 0, value); + ZEPHIR_INIT_VAR(&_0); + zephir_camelize(&_0, &property, NULL ); + ZEPHIR_INIT_VAR(&possibleSetter); + ZEPHIR_CONCAT_SV(&possibleSetter, "set", &_0); + if ((zephir_method_exists(this_ptr, &possibleSetter TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &possibleSetter, NULL, 0, value); zephir_check_call_status(); RETURN_MM_BOOL(1); } @@ -5946,71 +6907,85 @@ PHP_METHOD(Phalcon_Mvc_Model, __get) { zend_bool _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property_param = NULL, *modelName = NULL, *manager = NULL, *lowerProperty = NULL, *relation = NULL, *result = NULL, *method = NULL, *_0 = NULL, *_6, *_7, *_2$$3, *_4$$3, *_5$$3, *_3$$4; - zval *property = NULL; + zval *property_param = NULL, modelName, manager, lowerProperty, relation, result, method, _0, _6, _7, _2$$3, _4$$3, _5$$3, _3$$4; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&lowerProperty); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property_param); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } - ZEPHIR_INIT_VAR(modelName); - zephir_get_class(modelName, this_ptr, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&modelName); + zephir_get_class(&modelName, this_ptr, 0 TSRMLS_CC); ZEPHIR_CALL_METHOD(&manager, this_ptr, "getmodelsmanager", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(lowerProperty); - zephir_fast_strtolower(lowerProperty, property); - ZEPHIR_CALL_METHOD(&_0, manager, "getrelationbyalias", NULL, 0, modelName, lowerProperty); + ZEPHIR_INIT_VAR(&lowerProperty); + zephir_fast_strtolower(&lowerProperty, &property); + ZEPHIR_CALL_METHOD(&_0, &manager, "getrelationbyalias", NULL, 0, &modelName, &lowerProperty); zephir_check_call_status(); - ZEPHIR_CPY_WRT(relation, _0); - if (Z_TYPE_P(relation) == IS_OBJECT) { - _1$$3 = zephir_isset_property_zval(this_ptr, lowerProperty TSRMLS_CC); + ZEPHIR_CPY_WRT(&relation, &_0); + if (Z_TYPE_P(&relation) == IS_OBJECT) { + _1$$3 = zephir_isset_property_zval(this_ptr, &lowerProperty TSRMLS_CC); if (_1$$3) { - ZEPHIR_OBS_VAR(_2$$3); - zephir_read_property_zval(&_2$$3, this_ptr, lowerProperty, PH_NOISY_CC); - _1$$3 = Z_TYPE_P(_2$$3) == IS_OBJECT; + ZEPHIR_OBS_VAR(&_2$$3); + zephir_read_property_zval(&_2$$3, this_ptr, &lowerProperty, PH_NOISY_CC); + _1$$3 = Z_TYPE_P(&_2$$3) == IS_OBJECT; } if (_1$$3) { - ZEPHIR_OBS_VAR(_3$$4); - zephir_read_property_zval(&_3$$4, this_ptr, lowerProperty, PH_NOISY_CC); - RETURN_CCTOR(_3$$4); + ZEPHIR_OBS_VAR(&_3$$4); + zephir_read_property_zval(&_3$$4, this_ptr, &lowerProperty, PH_NOISY_CC); + RETURN_CCTOR(&_3$$4); } - ZEPHIR_INIT_VAR(_4$$3); - ZVAL_NULL(_4$$3); - ZEPHIR_INIT_VAR(_5$$3); - ZVAL_NULL(_5$$3); - ZEPHIR_CALL_METHOD(&result, manager, "getrelationrecords", NULL, 0, relation, _4$$3, this_ptr, _5$$3); + ZVAL_NULL(&_4$$3); + ZVAL_NULL(&_5$$3); + ZEPHIR_CALL_METHOD(&result, &manager, "getrelationrecords", NULL, 0, &relation, &_4$$3, this_ptr, &_5$$3); zephir_check_call_status(); - if (Z_TYPE_P(result) == IS_OBJECT) { - zephir_update_property_zval_zval(getThis(), lowerProperty, result TSRMLS_CC); - if (zephir_instance_of_ev(result, phalcon_mvc_modelinterface_ce TSRMLS_CC)) { - zephir_update_property_array(this_ptr, SL("_related"), lowerProperty, result TSRMLS_CC); + if (Z_TYPE_P(&result) == IS_OBJECT) { + zephir_update_property_zval_zval(this_ptr, &lowerProperty, &result TSRMLS_CC); + if (zephir_instance_of_ev(&result, phalcon_mvc_modelinterface_ce TSRMLS_CC)) { + zephir_update_property_array(this_ptr, SL("_related"), &lowerProperty, &result TSRMLS_CC); } } - RETURN_CCTOR(result); - } - ZEPHIR_INIT_VAR(_6); - zephir_camelize(_6, property, NULL ); - ZEPHIR_INIT_VAR(method); - ZEPHIR_CONCAT_SV(method, "get", _6); - if ((zephir_method_exists(this_ptr, method TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, method, NULL, 0); + RETURN_CCTOR(&result); + } + ZEPHIR_INIT_VAR(&_6); + zephir_camelize(&_6, &property, NULL ); + ZEPHIR_INIT_VAR(&method); + ZEPHIR_CONCAT_SV(&method, "get", &_6); + if ((zephir_method_exists(this_ptr, &method TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_METHOD_ZVAL(this_ptr, &method, NULL, 0); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(_7); - ZEPHIR_CONCAT_SVSV(_7, "Access to undefined property ", modelName, "::", property); - ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 2, _7); + ZEPHIR_INIT_VAR(&_7); + ZEPHIR_CONCAT_SVSV(&_7, "Access to undefined property ", &modelName, "::", &property); + ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 1, &_7); zephir_check_call_status(); RETURN_MM_NULL(); @@ -6022,33 +6997,40 @@ PHP_METHOD(Phalcon_Mvc_Model, __get) { PHP_METHOD(Phalcon_Mvc_Model, __isset) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property_param = NULL, *modelName = NULL, *manager = NULL, *relation = NULL, *_0 = NULL; - zval *property = NULL; + zval *property_param = NULL, modelName, manager, relation, _0; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property_param); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } - ZEPHIR_INIT_VAR(modelName); - zephir_get_class(modelName, this_ptr, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&modelName); + zephir_get_class(&modelName, this_ptr, 0 TSRMLS_CC); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmodelsmanager", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(manager, _0); - ZEPHIR_CALL_METHOD(&_0, manager, "getrelationbyalias", NULL, 0, modelName, property); + ZEPHIR_CPY_WRT(&manager, &_0); + ZEPHIR_CALL_METHOD(&_0, &manager, "getrelationbyalias", NULL, 0, &modelName, &property); zephir_check_call_status(); - ZEPHIR_CPY_WRT(relation, _0); - RETURN_MM_BOOL(Z_TYPE_P(relation) == IS_OBJECT); + ZEPHIR_CPY_WRT(&relation, &_0); + RETURN_MM_BOOL(Z_TYPE_P(&relation) == IS_OBJECT); } @@ -6057,10 +7039,17 @@ PHP_METHOD(Phalcon_Mvc_Model, __isset) { */ PHP_METHOD(Phalcon_Mvc_Model, serialize) { - zval *_2$$4; + zval _2$$4; zend_bool _1$$3; - zval *attributes = NULL, *snapshot = NULL, *manager = NULL, *_0 = NULL; + zval attributes, snapshot, manager, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); @@ -6068,27 +7057,27 @@ PHP_METHOD(Phalcon_Mvc_Model, serialize) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getmodelsmanager", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(manager, _0); - ZEPHIR_CALL_METHOD(&_0, manager, "iskeepingsnapshots", NULL, 0, this_ptr); + ZEPHIR_CPY_WRT(&manager, &_0); + ZEPHIR_CALL_METHOD(&_0, &manager, "iskeepingsnapshots", NULL, 0, this_ptr); zephir_check_call_status(); - if (zephir_is_true(_0)) { - ZEPHIR_OBS_VAR(snapshot); - zephir_read_property_this(&snapshot, this_ptr, SL("_snapshot"), PH_NOISY_CC); - _1$$3 = Z_TYPE_P(snapshot) != IS_NULL; + if (zephir_is_true(&_0)) { + ZEPHIR_OBS_VAR(&snapshot); + zephir_read_property(&snapshot, this_ptr, SL("_snapshot"), PH_NOISY_CC); + _1$$3 = Z_TYPE_P(&snapshot) != IS_NULL; if (_1$$3) { - _1$$3 = !ZEPHIR_IS_EQUAL(attributes, snapshot); + _1$$3 = !ZEPHIR_IS_EQUAL(&attributes, &snapshot); } if (_1$$3) { - ZEPHIR_INIT_VAR(_2$$4); - zephir_create_array(_2$$4, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$4); + zephir_create_array(&_2$$4, 2, 0 TSRMLS_CC); zephir_array_update_string(&_2$$4, SL("_attributes"), &attributes, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_2$$4, SL("_snapshot"), &snapshot, PH_COPY | PH_SEPARATE); - ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 68, _2$$4); + ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 61, &_2$$4); zephir_check_call_status(); RETURN_MM(); } } - ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 68, attributes); + ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 61, &attributes); zephir_check_call_status(); RETURN_MM(); @@ -6099,60 +7088,77 @@ PHP_METHOD(Phalcon_Mvc_Model, serialize) { */ PHP_METHOD(Phalcon_Mvc_Model, unserialize) { - HashTable *_5$$3; - HashPosition _4$$3; + zend_string *_6$$3; + zend_ulong _5$$3; zephir_fcall_cache_entry *_0 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, *attributes = NULL, *dependencyInjector = NULL, *manager = NULL, *key = NULL, *value = NULL, *snapshot = NULL, *_1$$3 = NULL, *_2$$3, **_6$$3, *_3$$7; + zval *data, data_sub, attributes, dependencyInjector, manager, key, value, snapshot, _1$$3, _2$$3, *_4$$3, _3$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&snapshot); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_FUNCTION(&attributes, "unserialize", NULL, 69, data); + ZEPHIR_CALL_FUNCTION(&attributes, "unserialize", NULL, 62, data); zephir_check_call_status(); - if (Z_TYPE_P(attributes) == IS_ARRAY) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + if (Z_TYPE_P(&attributes) == IS_ARRAY) { + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A dependency injector container is required to obtain the services related to the ORM", "phalcon/mvc/model.zep", 4669); return; } - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "modelsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1$$3, dependencyInjector, "getshared", NULL, 0, _2$$3); - zephir_check_temp_parameter(_2$$3); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), &dependencyInjector); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "modelsManager"); + ZEPHIR_CALL_METHOD(&_1$$3, &dependencyInjector, "getshared", NULL, 0, &_2$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(manager, _1$$3); - if (Z_TYPE_P(manager) != IS_OBJECT) { + ZEPHIR_CPY_WRT(&manager, &_1$$3); + if (Z_TYPE_P(&manager) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The injected service 'modelsManager' is not valid", "phalcon/mvc/model.zep", 4682); return; } - zephir_update_property_this(getThis(), SL("_modelsManager"), manager TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, manager, "initialize", NULL, 0, this_ptr); + zephir_update_property_zval(this_ptr, SL("_modelsManager"), &manager); + ZEPHIR_CALL_METHOD(NULL, &manager, "initialize", NULL, 0, this_ptr); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, manager, "iskeepingsnapshots", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(&_1$$3, &manager, "iskeepingsnapshots", NULL, 0, this_ptr); zephir_check_call_status(); - if (zephir_is_true(_1$$3)) { - if (zephir_array_isset_string_fetch(&snapshot, attributes, SS("_snapshot"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_snapshot"), snapshot TSRMLS_CC); - zephir_array_fetch_string(&_3$$7, attributes, SL("_attributes"), PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 4697 TSRMLS_CC); - ZEPHIR_CPY_WRT(attributes, _3$$7); + if (zephir_is_true(&_1$$3)) { + if (zephir_array_isset_string_fetch(&snapshot, &attributes, SL("_snapshot"), 1)) { + zephir_update_property_zval(this_ptr, SL("_snapshot"), &snapshot); + zephir_array_fetch_string(&_3$$7, &attributes, SL("_attributes"), PH_NOISY | PH_READONLY, "phalcon/mvc/model.zep", 4697 TSRMLS_CC); + ZEPHIR_CPY_WRT(&attributes, &_3$$7); } else { - zephir_update_property_this(getThis(), SL("_snapshot"), attributes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_snapshot"), &attributes); } } - zephir_is_iterable(attributes, &_5$$3, &_4$$3, 0, 0, "phalcon/mvc/model.zep", 4710); - for ( - ; zend_hash_get_current_data_ex(_5$$3, (void**) &_6$$3, &_4$$3) == SUCCESS - ; zend_hash_move_forward_ex(_5$$3, &_4$$3) - ) { - ZEPHIR_GET_HMKEY(key, _5$$3, _4$$3); - ZEPHIR_GET_HVALUE(value, _6$$3); - zephir_update_property_zval_zval(getThis(), key, value TSRMLS_CC); - } + zephir_is_iterable(&attributes, 0, "phalcon/mvc/model.zep", 4710); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attributes), _5$$3, _6$$3, _4$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_6$$3 != NULL) { + ZVAL_STR_COPY(&key, _6$$3); + } else { + ZVAL_LONG(&key, _5$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _4$$3); + zephir_update_property_zval_zval(this_ptr, &key, &value TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } ZEPHIR_MM_RESTORE(); @@ -6170,10 +7176,12 @@ PHP_METHOD(Phalcon_Mvc_Model, unserialize) { PHP_METHOD(Phalcon_Mvc_Model, dump) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 22, this_ptr); + ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 17, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -6193,45 +7201,56 @@ PHP_METHOD(Phalcon_Mvc_Model, dump) { */ PHP_METHOD(Phalcon_Mvc_Model, toArray) { - HashTable *_2; - HashPosition _1; - zephir_fcall_cache_entry *_6 = NULL; + zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *columns = NULL, *data = NULL, *metaData = NULL, *columnMap = NULL, *attribute = NULL, *attributeField = NULL, *value = NULL, *_0 = NULL, **_3, *_4$$6 = NULL, *_5$$6 = NULL; + zval *columns = NULL, columns_sub, __$null, data, metaData, columnMap, attribute, attributeField, value, _0, *_1, _2$$6, _3$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&columns_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&attributeField); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &columns); if (!columns) { - columns = ZEPHIR_GLOBAL(global_null); + columns = &columns_sub; + columns = &__$null; } - ZEPHIR_INIT_VAR(data); - array_init(data); + ZEPHIR_INIT_VAR(&data); + array_init(&data); ZEPHIR_CALL_METHOD(&metaData, this_ptr, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getcolumnmap", NULL, 0, this_ptr); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, metaData, "getattributes", NULL, 0, this_ptr); + ZEPHIR_CALL_METHOD(&_0, &metaData, "getattributes", NULL, 0, this_ptr); zephir_check_call_status(); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/mvc/model.zep", 4778); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(attribute, _3); - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, attribute, 0 TSRMLS_CC))) { + zephir_is_iterable(&_0, 0, "phalcon/mvc/model.zep", 4778); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _1); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &attribute, 0 TSRMLS_CC))) { if (!(ZEPHIR_GLOBAL(orm).ignore_unknown_columns)) { - ZEPHIR_INIT_NVAR(_4$$6); - object_init_ex(_4$$6, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_5$$6); - ZEPHIR_CONCAT_SVS(_5$$6, "Column '", attribute, "' doesn't make part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _4$$6, "__construct", &_6, 9, _5$$6); + ZEPHIR_INIT_NVAR(&_2$$6); + object_init_ex(&_2$$6, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_3$$6); + ZEPHIR_CONCAT_SVS(&_3$$6, "Column '", &attribute, "' doesn't make part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_2$$6, "__construct", &_4, 4, &_3$$6); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$6, "phalcon/mvc/model.zep", 4756 TSRMLS_CC); + zephir_throw_exception_debug(&_2$$6, "phalcon/mvc/model.zep", 4756 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } else { @@ -6239,21 +7258,22 @@ PHP_METHOD(Phalcon_Mvc_Model, toArray) { } } } else { - ZEPHIR_CPY_WRT(attributeField, attribute); + ZEPHIR_CPY_WRT(&attributeField, &attribute); } if (Z_TYPE_P(columns) == IS_ARRAY) { - if (!(zephir_fast_in_array(attributeField, columns TSRMLS_CC))) { + if (!(zephir_fast_in_array(&attributeField, columns TSRMLS_CC))) { continue; } } - ZEPHIR_OBS_NVAR(value); - if (zephir_fetch_property_zval(&value, this_ptr, attributeField, PH_SILENT_CC)) { - zephir_array_update_zval(&data, attributeField, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&value); + if (zephir_fetch_property_zval(&value, this_ptr, &attributeField, PH_SILENT_CC)) { + zephir_array_update_zval(&data, &attributeField, &value, PH_COPY | PH_SEPARATE); } else { - zephir_array_update_zval(&data, attributeField, &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&data, &attributeField, &__$null, PH_COPY | PH_SEPARATE); } - } - RETURN_CCTOR(data); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); + RETURN_CCTOR(&data); } @@ -6269,6 +7289,8 @@ PHP_METHOD(Phalcon_Mvc_Model, toArray) { PHP_METHOD(Phalcon_Mvc_Model, jsonSerialize) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -6283,58 +7305,72 @@ PHP_METHOD(Phalcon_Mvc_Model, jsonSerialize) { */ PHP_METHOD(Phalcon_Mvc_Model, setup) { - zval *options_param = NULL, *disableEvents = NULL, *columnRenaming = NULL, *notNullValidations = NULL, *exceptionOnFailedSave = NULL, *phqlLiterals = NULL, *virtualForeignKeys = NULL, *lateStateBinding = NULL, *castOnHydrate = NULL, *ignoreUnknownColumns = NULL, *updateSnapshotOnSave = NULL, *disableAssignSetters = NULL; - zval *options = NULL; + zval *options_param = NULL, disableEvents, columnRenaming, notNullValidations, exceptionOnFailedSave, phqlLiterals, virtualForeignKeys, lateStateBinding, castOnHydrate, ignoreUnknownColumns, updateSnapshotOnSave, disableAssignSetters; + zval options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&disableEvents); + ZVAL_UNDEF(&columnRenaming); + ZVAL_UNDEF(¬NullValidations); + ZVAL_UNDEF(&exceptionOnFailedSave); + ZVAL_UNDEF(&phqlLiterals); + ZVAL_UNDEF(&virtualForeignKeys); + ZVAL_UNDEF(&lateStateBinding); + ZVAL_UNDEF(&castOnHydrate); + ZVAL_UNDEF(&ignoreUnknownColumns); + ZVAL_UNDEF(&updateSnapshotOnSave); + ZVAL_UNDEF(&disableAssignSetters); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &options_param); - options = options_param; + ZEPHIR_OBS_COPY_OR_DUP(&options, options_param); - ZEPHIR_OBS_VAR(disableEvents); - if (zephir_array_isset_string_fetch(&disableEvents, options, SS("events"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).events = zend_is_true(disableEvents); + ZEPHIR_OBS_VAR(&disableEvents); + if (zephir_array_isset_string_fetch(&disableEvents, &options, SL("events"), 0)) { + ZEPHIR_GLOBAL(orm).events = zend_is_true(&disableEvents); } - ZEPHIR_OBS_VAR(virtualForeignKeys); - if (zephir_array_isset_string_fetch(&virtualForeignKeys, options, SS("virtualForeignKeys"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).virtual_foreign_keys = zend_is_true(virtualForeignKeys); + ZEPHIR_OBS_VAR(&virtualForeignKeys); + if (zephir_array_isset_string_fetch(&virtualForeignKeys, &options, SL("virtualForeignKeys"), 0)) { + ZEPHIR_GLOBAL(orm).virtual_foreign_keys = zend_is_true(&virtualForeignKeys); } - ZEPHIR_OBS_VAR(columnRenaming); - if (zephir_array_isset_string_fetch(&columnRenaming, options, SS("columnRenaming"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).column_renaming = zend_is_true(columnRenaming); + ZEPHIR_OBS_VAR(&columnRenaming); + if (zephir_array_isset_string_fetch(&columnRenaming, &options, SL("columnRenaming"), 0)) { + ZEPHIR_GLOBAL(orm).column_renaming = zend_is_true(&columnRenaming); } - ZEPHIR_OBS_VAR(notNullValidations); - if (zephir_array_isset_string_fetch(¬NullValidations, options, SS("notNullValidations"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).not_null_validations = zend_is_true(notNullValidations); + ZEPHIR_OBS_VAR(¬NullValidations); + if (zephir_array_isset_string_fetch(¬NullValidations, &options, SL("notNullValidations"), 0)) { + ZEPHIR_GLOBAL(orm).not_null_validations = zend_is_true(¬NullValidations); } - ZEPHIR_OBS_VAR(exceptionOnFailedSave); - if (zephir_array_isset_string_fetch(&exceptionOnFailedSave, options, SS("exceptionOnFailedSave"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).exception_on_failed_save = zend_is_true(exceptionOnFailedSave); + ZEPHIR_OBS_VAR(&exceptionOnFailedSave); + if (zephir_array_isset_string_fetch(&exceptionOnFailedSave, &options, SL("exceptionOnFailedSave"), 0)) { + ZEPHIR_GLOBAL(orm).exception_on_failed_save = zend_is_true(&exceptionOnFailedSave); } - ZEPHIR_OBS_VAR(phqlLiterals); - if (zephir_array_isset_string_fetch(&phqlLiterals, options, SS("phqlLiterals"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).enable_literals = zend_is_true(phqlLiterals); + ZEPHIR_OBS_VAR(&phqlLiterals); + if (zephir_array_isset_string_fetch(&phqlLiterals, &options, SL("phqlLiterals"), 0)) { + ZEPHIR_GLOBAL(orm).enable_literals = zend_is_true(&phqlLiterals); } - ZEPHIR_OBS_VAR(lateStateBinding); - if (zephir_array_isset_string_fetch(&lateStateBinding, options, SS("lateStateBinding"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).late_state_binding = zend_is_true(lateStateBinding); + ZEPHIR_OBS_VAR(&lateStateBinding); + if (zephir_array_isset_string_fetch(&lateStateBinding, &options, SL("lateStateBinding"), 0)) { + ZEPHIR_GLOBAL(orm).late_state_binding = zend_is_true(&lateStateBinding); } - ZEPHIR_OBS_VAR(castOnHydrate); - if (zephir_array_isset_string_fetch(&castOnHydrate, options, SS("castOnHydrate"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).cast_on_hydrate = zend_is_true(castOnHydrate); + ZEPHIR_OBS_VAR(&castOnHydrate); + if (zephir_array_isset_string_fetch(&castOnHydrate, &options, SL("castOnHydrate"), 0)) { + ZEPHIR_GLOBAL(orm).cast_on_hydrate = zend_is_true(&castOnHydrate); } - ZEPHIR_OBS_VAR(ignoreUnknownColumns); - if (zephir_array_isset_string_fetch(&ignoreUnknownColumns, options, SS("ignoreUnknownColumns"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).ignore_unknown_columns = zend_is_true(ignoreUnknownColumns); + ZEPHIR_OBS_VAR(&ignoreUnknownColumns); + if (zephir_array_isset_string_fetch(&ignoreUnknownColumns, &options, SL("ignoreUnknownColumns"), 0)) { + ZEPHIR_GLOBAL(orm).ignore_unknown_columns = zend_is_true(&ignoreUnknownColumns); } - ZEPHIR_OBS_VAR(updateSnapshotOnSave); - if (zephir_array_isset_string_fetch(&updateSnapshotOnSave, options, SS("updateSnapshotOnSave"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).update_snapshot_on_save = zend_is_true(updateSnapshotOnSave); + ZEPHIR_OBS_VAR(&updateSnapshotOnSave); + if (zephir_array_isset_string_fetch(&updateSnapshotOnSave, &options, SL("updateSnapshotOnSave"), 0)) { + ZEPHIR_GLOBAL(orm).update_snapshot_on_save = zend_is_true(&updateSnapshotOnSave); } - ZEPHIR_OBS_VAR(disableAssignSetters); - if (zephir_array_isset_string_fetch(&disableAssignSetters, options, SS("disableAssignSetters"), 0 TSRMLS_CC)) { - ZEPHIR_GLOBAL(orm).disable_assign_setters = zend_is_true(disableAssignSetters); + ZEPHIR_OBS_VAR(&disableAssignSetters); + if (zephir_array_isset_string_fetch(&disableAssignSetters, &options, SL("disableAssignSetters"), 0)) { + ZEPHIR_GLOBAL(orm).disable_assign_setters = zend_is_true(&disableAssignSetters); } ZEPHIR_MM_RESTORE(); @@ -6345,10 +7381,14 @@ PHP_METHOD(Phalcon_Mvc_Model, setup) { */ PHP_METHOD(Phalcon_Mvc_Model, reset) { - + zval __$null; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + - zephir_update_property_this(getThis(), SL("_uniqueParams"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_snapshot"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_uniqueParams"), &__$null); + zephir_update_property_zval(this_ptr, SL("_snapshot"), &__$null); } diff --git a/ext/phalcon/mvc/model.zep.h b/ext/phalcon/mvc/model.zep.h index a041f1e0ca2..1bc12f4aad9 100644 --- a/ext/phalcon/mvc/model.zep.h +++ b/ext/phalcon/mvc/model.zep.h @@ -112,90 +112,275 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_seteventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_settransaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getmodelsmetadata, 0, 0, Phalcon\\Mvc\\Model\\MetaDataInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getmodelsmetadata, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\MetaDataInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getmodelsmanager, 0, 0, Phalcon\\Mvc\\Model\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getmodelsmanager, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_settransaction, 0, 1, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_settransaction, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, transaction, Phalcon\\Mvc\\Model\\TransactionInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setsource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_setsource, 0, 1, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_setsource, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) +#else ZEND_ARG_INFO(0, source) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getsource, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getsource, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setschema, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_setschema, 0, 1, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_setschema, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getschema, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getschema, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_setconnectionservice, 0, 1, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_setconnectionservice, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setreadconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_setreadconnectionservice, 0, 1, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_setreadconnectionservice, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setwriteconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_setwriteconnectionservice, 0, 1, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_setwriteconnectionservice, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setdirtystate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getreadconnectionservice, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getreadconnectionservice, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getwriteconnectionservice, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getwriteconnectionservice, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_setdirtystate, 0, 1, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_setdirtystate, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getdirtystate, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getdirtystate, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getreadconnection, 0, 0, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getreadconnection, 0, 0, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getwriteconnection, 0, 0, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getwriteconnection, 0, 0, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_assign, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_assign, 0, 1, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_assign, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_ARG_INFO(0, dataColumnMap) ZEND_ARG_INFO(0, whiteList) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_cloneresultmap, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_cloneresultmap, 0, 3, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_cloneresultmap, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif ZEND_ARG_INFO(0, base) ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_ARG_INFO(0, columnMap) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keepSnapshots, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, keepSnapshots) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_cloneresultmaphydrate, 0, 0, 3) ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_ARG_INFO(0, columnMap) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, hydrationMode, IS_LONG, 0) +#else ZEND_ARG_INFO(0, hydrationMode) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_cloneresult, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, base, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_ARRAY_INFO(0, data, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_find, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_find, 0, 0, Phalcon\\Mvc\\Model\\ResultsetInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_find, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\ResultsetInterface", 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_findfirst, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_findfirst, 0, 0, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_findfirst, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_getpreparedquery, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getpreparedquery, 0, 1, Phalcon\\Mvc\\Model\\Query, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getpreparedquery, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query", 0) +#endif ZEND_ARG_INFO(0, params) ZEND_ARG_INFO(0, limit) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query, 0, 0, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__exists, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__exists, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__exists, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, metaData, Phalcon\\Mvc\\Model\\MetaDataInterface, 0) ZEND_ARG_OBJ_INFO(0, connection, Phalcon\\Db\\AdapterInterface, 0) ZEND_ARG_INFO(0, table) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__groupresult, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model__groupresult, 0, 3, Phalcon\\Mvc\\Model\\ResultsetInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__groupresult, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\ResultsetInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, functionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, functionName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) +#else ZEND_ARG_INFO(0, alias) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() @@ -219,85 +404,222 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_average, 0, 0, 0) ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_fireevent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_fireevent, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_fireevent, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_fireeventcancel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_fireeventcancel, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_fireeventcancel, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_appendmessage, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_appendmessage, 0, 1, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_appendmessage, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif ZEND_ARG_OBJ_INFO(0, message, Phalcon\\Mvc\\Model\\MessageInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, validator, Phalcon\\ValidationInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_getmessages, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validationhasfailed, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validationhasfailed, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getmessages, 0, 0, Phalcon\\Mvc\\Model\\MessageInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\MessageInterface", 0) +#endif ZEND_ARG_INFO(0, filter) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__presave, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__checkforeignkeysrestrict, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__checkforeignkeysrestrict, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__checkforeignkeysreversecascade, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__checkforeignkeysreversecascade, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__checkforeignkeysreverserestrict, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__checkforeignkeysreverserestrict, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__presave, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__presave, 0, 3, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, metaData, Phalcon\\Mvc\\Model\\MetaDataInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, exists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, exists) +#endif ZEND_ARG_INFO(0, identityField) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__postsave, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__postsave, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__postsave, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, success, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, success) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, exists, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, exists) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__dolowinsert, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__dolowinsert, 0, 4, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__dolowinsert, 0, 4, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, metaData, Phalcon\\Mvc\\Model\\MetaDataInterface, 0) ZEND_ARG_OBJ_INFO(0, connection, Phalcon\\Db\\AdapterInterface, 0) ZEND_ARG_INFO(0, table) ZEND_ARG_INFO(0, identityField) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__dolowupdate, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__dolowupdate, 0, 3, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__dolowupdate, 0, 3, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, metaData, Phalcon\\Mvc\\Model\\MetaDataInterface, 0) ZEND_ARG_OBJ_INFO(0, connection, Phalcon\\Db\\AdapterInterface, 0) ZEND_ARG_INFO(0, table) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__presaverelatedrecords, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__presaverelatedrecords, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__presaverelatedrecords, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, connection, Phalcon\\Db\\AdapterInterface, 0) ZEND_ARG_INFO(0, related) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__postsaverelatedrecords, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__postsaverelatedrecords, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model__postsaverelatedrecords, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, connection, Phalcon\\Db\\AdapterInterface, 0) ZEND_ARG_INFO(0, related) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_save, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_save, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_save, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_ARG_INFO(0, whiteList) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_create, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_create, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_create, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_ARG_INFO(0, whiteList) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_update, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_update, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_update, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_ARG_INFO(0, whiteList) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_delete, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_delete, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getoperationmade, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getoperationmade, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_refresh, 0, 0, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_refresh, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_skipoperation, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, skip, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, skip) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_readattribute, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_writeattribute, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() @@ -317,33 +639,69 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_allowemptystringvalues, 0, 0, 1 ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_hasone, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasone, 0, 3, Phalcon\\Mvc\\Model\\Relation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_hasone, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Relation", 0) +#endif ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_belongsto, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_belongsto, 0, 3, Phalcon\\Mvc\\Model\\Relation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_belongsto, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Relation", 0) +#endif ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_hasmany, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasmany, 0, 3, Phalcon\\Mvc\\Model\\Relation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_hasmany, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Relation", 0) +#endif ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_hasmanytomany, 0, 0, 6) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_hasmanytomany, 0, 6, Phalcon\\Mvc\\Model\\Relation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_hasmanytomany, 0, 6, IS_OBJECT, "Phalcon\\Mvc\\Model\\Relation", 0) +#endif ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, intermediateModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, intermediateModel) +#endif ZEND_ARG_INFO(0, intermediateFields) ZEND_ARG_INFO(0, intermediateReferencedFields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referenceModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referenceModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() @@ -353,7 +711,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_addbehavior, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_keepsnapshots, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keepSnapshot, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, keepSnapshot) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setsnapshotdata, 0, 0, 1) @@ -366,28 +728,92 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setoldsnapshotdata, 0, 0, 1) ZEND_ARG_INFO(0, columnMap) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_haschanged, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_hassnapshotdata, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_hassnapshotdata, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getsnapshotdata, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getsnapshotdata, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getoldsnapshotdata, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getoldsnapshotdata, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_haschanged, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_haschanged, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, fieldName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, allFields, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, allFields) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_hasupdated, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_hasupdated, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_hasupdated, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, fieldName) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, allFields, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, allFields) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getchangedfields, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getchangedfields, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_usedynamicupdate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dynamicUpdate, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, dynamicUpdate) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_getrelated, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_getrelated, 0, 1, Phalcon\\Mvc\\Model\\ResultsetInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_getrelated, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\ResultsetInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) +#else ZEND_ARG_INFO(0, alias) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__getrelatedrecords, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() @@ -397,41 +823,94 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__invokefinder, 0, 0, 2) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model___call, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model___callstatic, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model___set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model__possiblesetter, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model___get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model___isset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model___isset, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model___isset, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_serialize, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_serialize, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_unserialize, 0, 0, 1) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_toarray, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_dump, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_dump, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_toarray, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_toarray, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, columns) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_jsonserialize, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_jsonserialize, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_setup, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() @@ -440,25 +919,25 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_method_entry) { PHP_ME(Phalcon_Mvc_Model, getTransaction, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, __construct, arginfo_phalcon_mvc_model___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model, setDI, arginfo_phalcon_mvc_model_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getDI, arginfo_phalcon_mvc_model_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setEventsManager, arginfo_phalcon_mvc_model_seteventsmanager, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Model, getEventsManager, NULL, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Model, getModelsMetaData, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getModelsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getEventsManager, arginfo_phalcon_mvc_model_geteventsmanager, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_Model, getModelsMetaData, arginfo_phalcon_mvc_model_getmodelsmetadata, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getModelsManager, arginfo_phalcon_mvc_model_getmodelsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setTransaction, arginfo_phalcon_mvc_model_settransaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setSource, arginfo_phalcon_mvc_model_setsource, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Model, getSource, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getSource, arginfo_phalcon_mvc_model_getsource, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setSchema, arginfo_phalcon_mvc_model_setschema, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Model, getSchema, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getSchema, arginfo_phalcon_mvc_model_getschema, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setConnectionService, arginfo_phalcon_mvc_model_setconnectionservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setReadConnectionService, arginfo_phalcon_mvc_model_setreadconnectionservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setWriteConnectionService, arginfo_phalcon_mvc_model_setwriteconnectionservice, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getReadConnectionService, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getWriteConnectionService, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getReadConnectionService, arginfo_phalcon_mvc_model_getreadconnectionservice, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getWriteConnectionService, arginfo_phalcon_mvc_model_getwriteconnectionservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setDirtyState, arginfo_phalcon_mvc_model_setdirtystate, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getDirtyState, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getReadConnection, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getWriteConnection, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getDirtyState, arginfo_phalcon_mvc_model_getdirtystate, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getReadConnection, arginfo_phalcon_mvc_model_getreadconnection, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getWriteConnection, arginfo_phalcon_mvc_model_getwriteconnection, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, assign, arginfo_phalcon_mvc_model_assign, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, cloneResultMap, arginfo_phalcon_mvc_model_cloneresultmap, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Mvc_Model, cloneResultMapHydrate, arginfo_phalcon_mvc_model_cloneresultmaphydrate, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) @@ -479,11 +958,11 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_method_entry) { PHP_ME(Phalcon_Mvc_Model, _cancelOperation, NULL, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model, appendMessage, arginfo_phalcon_mvc_model_appendmessage, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, validate, arginfo_phalcon_mvc_model_validate, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Model, validationHasFailed, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, validationHasFailed, arginfo_phalcon_mvc_model_validationhasfailed, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, getMessages, arginfo_phalcon_mvc_model_getmessages, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, _checkForeignKeysRestrict, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Mvc_Model, _checkForeignKeysReverseCascade, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Mvc_Model, _checkForeignKeysReverseRestrict, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Mvc_Model, _checkForeignKeysRestrict, arginfo_phalcon_mvc_model__checkforeignkeysrestrict, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Mvc_Model, _checkForeignKeysReverseCascade, arginfo_phalcon_mvc_model__checkforeignkeysreversecascade, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Mvc_Model, _checkForeignKeysReverseRestrict, arginfo_phalcon_mvc_model__checkforeignkeysreverserestrict, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model, _preSave, arginfo_phalcon_mvc_model__presave, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model, _postSave, arginfo_phalcon_mvc_model__postsave, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model, _doLowInsert, arginfo_phalcon_mvc_model__dolowinsert, ZEND_ACC_PROTECTED) @@ -493,9 +972,9 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_method_entry) { PHP_ME(Phalcon_Mvc_Model, save, arginfo_phalcon_mvc_model_save, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, create, arginfo_phalcon_mvc_model_create, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, update, arginfo_phalcon_mvc_model_update, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, delete, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getOperationMade, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, refresh, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, delete, arginfo_phalcon_mvc_model_delete, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getOperationMade, arginfo_phalcon_mvc_model_getoperationmade, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, refresh, arginfo_phalcon_mvc_model_refresh, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, skipOperation, arginfo_phalcon_mvc_model_skipoperation, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, readAttribute, arginfo_phalcon_mvc_model_readattribute, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, writeAttribute, arginfo_phalcon_mvc_model_writeattribute, ZEND_ACC_PUBLIC) @@ -511,12 +990,12 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_method_entry) { PHP_ME(Phalcon_Mvc_Model, keepSnapshots, arginfo_phalcon_mvc_model_keepsnapshots, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model, setSnapshotData, arginfo_phalcon_mvc_model_setsnapshotdata, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setOldSnapshotData, arginfo_phalcon_mvc_model_setoldsnapshotdata, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, hasSnapshotData, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getSnapshotData, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getOldSnapshotData, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, hasSnapshotData, arginfo_phalcon_mvc_model_hassnapshotdata, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getSnapshotData, arginfo_phalcon_mvc_model_getsnapshotdata, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getOldSnapshotData, arginfo_phalcon_mvc_model_getoldsnapshotdata, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, hasChanged, arginfo_phalcon_mvc_model_haschanged, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, hasUpdated, arginfo_phalcon_mvc_model_hasupdated, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, getChangedFields, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, getChangedFields, arginfo_phalcon_mvc_model_getchangedfields, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, getUpdatedFields, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, useDynamicUpdate, arginfo_phalcon_mvc_model_usedynamicupdate, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model, getRelated, arginfo_phalcon_mvc_model_getrelated, ZEND_ACC_PUBLIC) @@ -528,11 +1007,11 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_method_entry) { PHP_ME(Phalcon_Mvc_Model, _possibleSetter, arginfo_phalcon_mvc_model__possiblesetter, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model, __get, arginfo_phalcon_mvc_model___get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, __isset, arginfo_phalcon_mvc_model___isset, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, serialize, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, serialize, arginfo_phalcon_mvc_model_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, unserialize, arginfo_phalcon_mvc_model_unserialize, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, dump, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, dump, arginfo_phalcon_mvc_model_dump, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, toArray, arginfo_phalcon_mvc_model_toarray, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model, jsonSerialize, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model, jsonSerialize, arginfo_phalcon_mvc_model_jsonserialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model, setup, arginfo_phalcon_mvc_model_setup, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Mvc_Model, reset, NULL, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/mvc/model/behavior.zep.c b/ext/phalcon/mvc/model/behavior.zep.c index a9f72fba979..2ec3dc94da1 100644 --- a/ext/phalcon/mvc/model/behavior.zep.c +++ b/ext/phalcon/mvc/model/behavior.zep.c @@ -43,16 +43,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Behavior) { */ PHP_METHOD(Phalcon_Mvc_Model_Behavior, __construct) { - zval *options = NULL; + zval *options = NULL, options_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), options); } @@ -61,26 +66,30 @@ PHP_METHOD(Phalcon_Mvc_Model_Behavior, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Behavior, mustTakeAction) { - zval *eventName_param = NULL, *_0; - zval *eventName = NULL; + zval *eventName_param = NULL, _0; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &eventName_param); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, eventName)); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &eventName)); } @@ -92,37 +101,42 @@ PHP_METHOD(Phalcon_Mvc_Model_Behavior, mustTakeAction) { */ PHP_METHOD(Phalcon_Mvc_Model_Behavior, getOptions) { - zval *eventName_param = NULL, *options = NULL, *eventOptions = NULL; - zval *eventName = NULL; + zval *eventName_param = NULL, options, eventOptions; + zval eventName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&eventOptions); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &eventName_param); if (!eventName_param) { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_STRING(&eventName, ""); } else { if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); } } - options = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (!ZEPHIR_IS_STRING_IDENTICAL(eventName, "")) { - if (zephir_array_isset_fetch(&eventOptions, options, eventName, 1 TSRMLS_CC)) { - RETURN_CTOR(eventOptions); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (!ZEPHIR_IS_STRING_IDENTICAL(&eventName, "")) { + if (zephir_array_isset_fetch(&eventOptions, &options, &eventName, 1 TSRMLS_CC)) { + RETURN_CTOR(&eventOptions); } RETURN_MM_NULL(); } - RETURN_CTOR(options); + RETURN_CTOR(&options); } @@ -131,13 +145,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Behavior, getOptions) { */ PHP_METHOD(Phalcon_Mvc_Model_Behavior, notify) { - zval *type_param = NULL, *model; - zval *type = NULL; + zval *type_param = NULL, *model, model_sub; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&model_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &model); - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); RETURN_MM_NULL(); @@ -153,15 +171,22 @@ PHP_METHOD(Phalcon_Mvc_Model_Behavior, notify) { */ PHP_METHOD(Phalcon_Mvc_Model_Behavior, missingMethod) { - zval *method = NULL; - zval *model, *method_param = NULL, *arguments = NULL; + zval method; + zval *model, model_sub, *method_param = NULL, *arguments = NULL, arguments_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&arguments_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&method); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &model, &method_param, &arguments); - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); if (!arguments) { - arguments = ZEPHIR_GLOBAL(global_null); + arguments = &arguments_sub; + arguments = &__$null; } diff --git a/ext/phalcon/mvc/model/behavior.zep.h b/ext/phalcon/mvc/model/behavior.zep.h index 96f0bde7eb2..4b6da4601a4 100644 --- a/ext/phalcon/mvc/model/behavior.zep.h +++ b/ext/phalcon/mvc/model/behavior.zep.h @@ -13,22 +13,42 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_musttakeaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_behavior_musttakeaction, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_behavior_musttakeaction, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_getoptions, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 1) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_missingmethod, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/behavior/softdelete.zep.c b/ext/phalcon/mvc/model/behavior/softdelete.zep.c index d985504c557..4e2f9f79b66 100644 --- a/ext/phalcon/mvc/model/behavior/softdelete.zep.c +++ b/ext/phalcon/mvc/model/behavior/softdelete.zep.c @@ -40,91 +40,106 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Behavior_SoftDelete) { */ PHP_METHOD(Phalcon_Mvc_Model_Behavior_SoftDelete, notify) { - HashTable *_5$$7; - HashPosition _4$$7; - zend_bool _9$$6; - zephir_fcall_cache_entry *_7 = NULL; + zend_bool _7$$6; + zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *model, *options = NULL, *value = NULL, *field = NULL, *updateModel = NULL, *message = NULL, *modelsManager = NULL, *metaData = NULL, *_0$$3, *_1$$3 = NULL, *_2$$6 = NULL, *_8$$6 = NULL, *_3$$7 = NULL, **_6$$7, *_10$$9 = NULL, *_11$$9 = NULL; - zval *type = NULL; + zval *type_param = NULL, *model, model_sub, options, value, field, updateModel, message, modelsManager, metaData, _0$$3, _1$$3, _2$$6, _6$$6, _3$$7, *_4$$7, _8$$9, _9$$9; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&updateModel); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&modelsManager); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &model); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - if (ZEPHIR_IS_STRING(type, "beforeDelete")) { + if (ZEPHIR_IS_STRING(&type, "beforeDelete")) { ZEPHIR_CALL_METHOD(&options, this_ptr, "getoptions", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(value); - if (!(zephir_array_isset_string_fetch(&value, options, SS("value"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&value); + if (!(zephir_array_isset_string_fetch(&value, &options, SL("value"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'value' is required", "phalcon/mvc/model/behavior/softdelete.zep", 50); return; } - ZEPHIR_OBS_VAR(field); - if (!(zephir_array_isset_string_fetch(&field, options, SS("field"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&field); + if (!(zephir_array_isset_string_fetch(&field, &options, SL("field"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'field' is required", "phalcon/mvc/model/behavior/softdelete.zep", 57); return; } - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_BOOL(_0$$3, 1); - ZEPHIR_CALL_METHOD(NULL, model, "skipoperation", NULL, 0, _0$$3); + ZVAL_BOOL(&_0$$3, 1); + ZEPHIR_CALL_METHOD(NULL, model, "skipoperation", NULL, 0, &_0$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1$$3, model, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&_1$$3, model, "readattribute", NULL, 0, &field); zephir_check_call_status(); - if (!ZEPHIR_IS_EQUAL(_1$$3, value)) { + if (!ZEPHIR_IS_EQUAL(&_1$$3, &value)) { ZEPHIR_CALL_METHOD(&modelsManager, model, "getmodelsmanager", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(updateModel); - if (zephir_clone(updateModel, model TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&updateModel); + if (zephir_clone(&updateModel, model TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_CALL_METHOD(NULL, updateModel, "writeattribute", NULL, 0, field, value); + ZEPHIR_CALL_METHOD(NULL, &updateModel, "writeattribute", NULL, 0, &field, &value); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2$$6, updateModel, "save", NULL, 0); + ZEPHIR_CALL_METHOD(&_2$$6, &updateModel, "save", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_2$$6))) { - ZEPHIR_CALL_METHOD(&_3$$7, updateModel, "getmessages", NULL, 0); + if (!(zephir_is_true(&_2$$6))) { + ZEPHIR_CALL_METHOD(&_3$$7, &updateModel, "getmessages", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_3$$7, &_5$$7, &_4$$7, 0, 0, "phalcon/mvc/model/behavior/softdelete.zep", 91); - for ( - ; zend_hash_get_current_data_ex(_5$$7, (void**) &_6$$7, &_4$$7) == SUCCESS - ; zend_hash_move_forward_ex(_5$$7, &_4$$7) - ) { - ZEPHIR_GET_HVALUE(message, _6$$7); - ZEPHIR_CALL_METHOD(NULL, model, "appendmessage", &_7, 0, message); + zephir_is_iterable(&_3$$7, 0, "phalcon/mvc/model/behavior/softdelete.zep", 91); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_3$$7), _4$$7) + { + ZEPHIR_INIT_NVAR(&message); + ZVAL_COPY(&message, _4$$7); + ZEPHIR_CALL_METHOD(NULL, model, "appendmessage", &_5, 0, &message); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&message); RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, field, value); + ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, &field, &value); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_8$$6, modelsManager, "iskeepingsnapshots", NULL, 0, model); + ZEPHIR_CALL_METHOD(&_6$$6, &modelsManager, "iskeepingsnapshots", NULL, 0, model); zephir_check_call_status(); - _9$$6 = zephir_is_true(_8$$6); - if (_9$$6) { - _9$$6 = ZEPHIR_GLOBAL(orm).update_snapshot_on_save; + _7$$6 = zephir_is_true(&_6$$6); + if (_7$$6) { + _7$$6 = ZEPHIR_GLOBAL(orm).update_snapshot_on_save; } - if (_9$$6) { + if (_7$$6) { ZEPHIR_CALL_METHOD(&metaData, model, "getmodelsmetadata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_10$$9, updateModel, "getsnapshotdata", NULL, 0); + ZEPHIR_CALL_METHOD(&_8$$9, &updateModel, "getsnapshotdata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, model, "setsnapshotdata", NULL, 0, _10$$9); + ZEPHIR_CALL_METHOD(NULL, model, "setsnapshotdata", NULL, 0, &_8$$9); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_11$$9, updateModel, "getoldsnapshotdata", NULL, 0); + ZEPHIR_CALL_METHOD(&_9$$9, &updateModel, "getoldsnapshotdata", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, model, "setoldsnapshotdata", NULL, 0, _11$$9); + ZEPHIR_CALL_METHOD(NULL, model, "setoldsnapshotdata", NULL, 0, &_9$$9); zephir_check_call_status(); } } diff --git a/ext/phalcon/mvc/model/behavior/softdelete.zep.h b/ext/phalcon/mvc/model/behavior/softdelete.zep.h index 10432292249..fb510755a4d 100644 --- a/ext/phalcon/mvc/model/behavior/softdelete.zep.h +++ b/ext/phalcon/mvc/model/behavior/softdelete.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Behavior_SoftDelete); PHP_METHOD(Phalcon_Mvc_Model_Behavior_SoftDelete, notify); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_softdelete_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/behavior/timestampable.zep.c b/ext/phalcon/mvc/model/behavior/timestampable.zep.c index bbfd2a6d7d6..e573e8b2549 100644 --- a/ext/phalcon/mvc/model/behavior/timestampable.zep.c +++ b/ext/phalcon/mvc/model/behavior/timestampable.zep.c @@ -42,75 +42,84 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Behavior_Timestampable) { */ PHP_METHOD(Phalcon_Mvc_Model_Behavior_Timestampable, notify) { - HashTable *_2$$12; - HashPosition _1$$12; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *model, *options = NULL, *timestamp = NULL, *singleField = NULL, *field = NULL, *generator = NULL, *format = NULL, *_0 = NULL, **_3$$12; - zval *type = NULL; + zval *type_param = NULL, *model, model_sub, options, timestamp, singleField, field, generator, format, _0, *_1$$12; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(×tamp); + ZVAL_UNDEF(&singleField); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&generator); + ZVAL_UNDEF(&format); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, &model); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "musttakeaction", NULL, 0, type); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "musttakeaction", NULL, 0, &type); zephir_check_call_status(); - if (!ZEPHIR_IS_TRUE_IDENTICAL(_0)) { + if (!ZEPHIR_IS_TRUE_IDENTICAL(&_0)) { RETURN_MM_NULL(); } - ZEPHIR_CALL_METHOD(&options, this_ptr, "getoptions", NULL, 0, type); + ZEPHIR_CALL_METHOD(&options, this_ptr, "getoptions", NULL, 0, &type); zephir_check_call_status(); - if (Z_TYPE_P(options) == IS_ARRAY) { - ZEPHIR_OBS_VAR(field); - if (!(zephir_array_isset_string_fetch(&field, options, SS("field"), 0 TSRMLS_CC))) { + if (Z_TYPE_P(&options) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&field); + if (!(zephir_array_isset_string_fetch(&field, &options, SL("field"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'field' is required", "phalcon/mvc/model/behavior/timestampable.zep", 56); return; } - ZEPHIR_INIT_VAR(timestamp); - ZVAL_NULL(timestamp); - ZEPHIR_OBS_VAR(format); - if (zephir_array_isset_string_fetch(&format, options, SS("format"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_FUNCTION(×tamp, "date", NULL, 317, format); + ZEPHIR_INIT_VAR(×tamp); + ZVAL_NULL(×tamp); + ZEPHIR_OBS_VAR(&format); + if (zephir_array_isset_string_fetch(&format, &options, SL("format"), 0)) { + ZEPHIR_CALL_FUNCTION(×tamp, "date", NULL, 277, &format); zephir_check_call_status(); } else { - ZEPHIR_OBS_VAR(generator); - if (zephir_array_isset_string_fetch(&generator, options, SS("generator"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(generator) == IS_OBJECT) { - if (zephir_instance_of_ev(generator, zend_ce_closure TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(timestamp); - ZEPHIR_CALL_USER_FUNC(timestamp, generator); + ZEPHIR_OBS_VAR(&generator); + if (zephir_array_isset_string_fetch(&generator, &options, SL("generator"), 0)) { + if (Z_TYPE_P(&generator) == IS_OBJECT) { + if (zephir_instance_of_ev(&generator, zend_ce_closure TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(×tamp); + ZEPHIR_CALL_USER_FUNC(×tamp, &generator); zephir_check_call_status(); } } } } - if (Z_TYPE_P(timestamp) == IS_NULL) { - ZEPHIR_INIT_NVAR(timestamp); - zephir_time(timestamp); + if (Z_TYPE_P(×tamp) == IS_NULL) { + ZEPHIR_INIT_NVAR(×tamp); + zephir_time(×tamp); } - if (Z_TYPE_P(field) == IS_ARRAY) { - zephir_is_iterable(field, &_2$$12, &_1$$12, 0, 0, "phalcon/mvc/model/behavior/timestampable.zep", 94); - for ( - ; zend_hash_get_current_data_ex(_2$$12, (void**) &_3$$12, &_1$$12) == SUCCESS - ; zend_hash_move_forward_ex(_2$$12, &_1$$12) - ) { - ZEPHIR_GET_HVALUE(singleField, _3$$12); - ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", &_4, 0, singleField, timestamp); + if (Z_TYPE_P(&field) == IS_ARRAY) { + zephir_is_iterable(&field, 0, "phalcon/mvc/model/behavior/timestampable.zep", 94); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&field), _1$$12) + { + ZEPHIR_INIT_NVAR(&singleField); + ZVAL_COPY(&singleField, _1$$12); + ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", &_2, 0, &singleField, ×tamp); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&singleField); } else { - ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, field, timestamp); + ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, &field, ×tamp); zephir_check_call_status(); } } diff --git a/ext/phalcon/mvc/model/behavior/timestampable.zep.h b/ext/phalcon/mvc/model/behavior/timestampable.zep.h index 588d4ac33d4..16f825b6696 100644 --- a/ext/phalcon/mvc/model/behavior/timestampable.zep.h +++ b/ext/phalcon/mvc/model/behavior/timestampable.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Behavior_Timestampable); PHP_METHOD(Phalcon_Mvc_Model_Behavior_Timestampable, notify); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behavior_timestampable_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/behaviorinterface.zep.h b/ext/phalcon/mvc/model/behaviorinterface.zep.h index 9222674d6ec..de26c260e24 100644 --- a/ext/phalcon/mvc/model/behaviorinterface.zep.h +++ b/ext/phalcon/mvc/model/behaviorinterface.zep.h @@ -4,13 +4,21 @@ extern zend_class_entry *phalcon_mvc_model_behaviorinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_BehaviorInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behaviorinterface_notify, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_behaviorinterface_missingmethod, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/binder.zep.c b/ext/phalcon/mvc/model/binder.zep.c index 93191425c8f..008771f5ce7 100644 --- a/ext/phalcon/mvc/model/binder.zep.c +++ b/ext/phalcon/mvc/model/binder.zep.c @@ -65,7 +65,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Binder) { */ PHP_METHOD(Phalcon_Mvc_Model_Binder, getBoundModels) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "boundModels"); @@ -76,7 +77,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getBoundModels) { */ PHP_METHOD(Phalcon_Mvc_Model_Binder, getOriginalValues) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "originalValues"); @@ -87,16 +89,21 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getOriginalValues) { */ PHP_METHOD(Phalcon_Mvc_Model_Binder, __construct) { - zval *cache = NULL; + zval *cache = NULL, cache_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cache_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &cache); if (!cache) { - cache = ZEPHIR_GLOBAL(global_null); + cache = &cache_sub; + cache = &__$null; } - zephir_update_property_this(getThis(), SL("cache"), cache TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("cache"), cache); } @@ -105,13 +112,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Binder, setCache) { - zval *cache; + zval *cache, cache_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cache_sub); zephir_fetch_params(0, 1, 0, &cache); - zephir_update_property_this(getThis(), SL("cache"), cache TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("cache"), cache); RETURN_THISW(); } @@ -121,7 +131,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, setCache) { */ PHP_METHOD(Phalcon_Mvc_Model_Binder, getCache) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "cache"); @@ -132,57 +143,78 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getCache) { */ PHP_METHOD(Phalcon_Mvc_Model_Binder, bindToHandler) { - HashTable *_4$$4; - HashPosition _3$$4; + zend_string *_5$$4; + zend_ulong _4$$4; zend_bool _1; zephir_fcall_cache_entry *_6 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *cacheKey = NULL; - zval *params = NULL; - zval *handler, *params_param = NULL, *cacheKey_param = NULL, *methodName = NULL, *paramKey = NULL, *className = NULL, *boundModel = NULL, *paramsCache = NULL, *paramValue = NULL, *_0, *_2$$3, **_5$$4; + zval cacheKey; + zval params; + zval *handler, handler_sub, *params_param = NULL, *cacheKey_param = NULL, *methodName = NULL, methodName_sub, __$null, paramKey, className, boundModel, paramsCache, paramValue, _0, _2$$3, *_3$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&methodName_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶mKey); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&boundModel); + ZVAL_UNDEF(¶msCache); + ZVAL_UNDEF(¶mValue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&cacheKey); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &handler, ¶ms_param, &cacheKey_param, &methodName); - zephir_get_arrval(params, params_param); - zephir_get_strval(cacheKey, cacheKey_param); + zephir_get_arrval(¶ms, params_param); + zephir_get_strval(&cacheKey, cacheKey_param); if (!methodName) { - methodName = ZEPHIR_GLOBAL(global_null); + methodName = &methodName_sub; + methodName = &__$null; } - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("originalValues"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("originalValues"), &_0); _1 = zephir_instance_of_ev(handler, zend_ce_closure TSRMLS_CC); if (!(_1)) { _1 = Z_TYPE_P(methodName) != IS_NULL; } if (_1) { - ZEPHIR_INIT_VAR(_2$$3); - array_init(_2$$3); - zephir_update_property_this(getThis(), SL("boundModels"), _2$$3 TSRMLS_CC); - ZEPHIR_CALL_METHOD(¶msCache, this_ptr, "getparamsfromcache", NULL, 0, cacheKey); + ZEPHIR_INIT_VAR(&_2$$3); + array_init(&_2$$3); + zephir_update_property_zval(this_ptr, SL("boundModels"), &_2$$3); + ZEPHIR_CALL_METHOD(¶msCache, this_ptr, "getparamsfromcache", NULL, 0, &cacheKey); zephir_check_call_status(); - if (Z_TYPE_P(paramsCache) == IS_ARRAY) { - zephir_is_iterable(paramsCache, &_4$$4, &_3$$4, 0, 0, "phalcon/mvc/model/binder.zep", 103); - for ( - ; zend_hash_get_current_data_ex(_4$$4, (void**) &_5$$4, &_3$$4) == SUCCESS - ; zend_hash_move_forward_ex(_4$$4, &_3$$4) - ) { - ZEPHIR_GET_HMKEY(paramKey, _4$$4, _3$$4); - ZEPHIR_GET_HVALUE(className, _5$$4); - ZEPHIR_OBS_NVAR(paramValue); - zephir_array_fetch(¶mValue, params, paramKey, PH_NOISY, "phalcon/mvc/model/binder.zep", 96 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_6, 0, paramValue, className); + if (Z_TYPE_P(¶msCache) == IS_ARRAY) { + zephir_is_iterable(¶msCache, 0, "phalcon/mvc/model/binder.zep", 103); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶msCache), _4$$4, _5$$4, _3$$4) + { + ZEPHIR_INIT_NVAR(¶mKey); + if (_5$$4 != NULL) { + ZVAL_STR_COPY(¶mKey, _5$$4); + } else { + ZVAL_LONG(¶mKey, _4$$4); + } + ZEPHIR_INIT_NVAR(&className); + ZVAL_COPY(&className, _3$$4); + ZEPHIR_OBS_NVAR(¶mValue); + zephir_array_fetch(¶mValue, ¶ms, ¶mKey, PH_NOISY, "phalcon/mvc/model/binder.zep", 96 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_6, 0, ¶mValue, &className); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("originalValues"), paramKey, paramValue TSRMLS_CC); - zephir_array_update_zval(¶ms, paramKey, &boundModel, PH_COPY | PH_SEPARATE); - zephir_update_property_array(this_ptr, SL("boundModels"), paramKey, boundModel TSRMLS_CC); - } - RETURN_CTOR(params); + zephir_update_property_array(this_ptr, SL("originalValues"), ¶mKey, ¶mValue TSRMLS_CC); + zephir_array_update_zval(¶ms, ¶mKey, &boundModel, PH_COPY | PH_SEPARATE); + zephir_update_property_array(this_ptr, SL("boundModels"), ¶mKey, &boundModel TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&className); + ZEPHIR_INIT_NVAR(¶mKey); + RETURN_CTOR(¶ms); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getparamsfromreflection", NULL, 0, handler, params, cacheKey, methodName); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getparamsfromreflection", NULL, 0, handler, ¶ms, &cacheKey, methodName); zephir_check_call_status(); RETURN_MM(); } @@ -198,16 +230,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, findBoundModel) { zend_class_entry *_0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *className = NULL; - zval *paramValue, *className_param = NULL; + zval className; + zval *paramValue, paramValue_sub, *className_param = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶mValue_sub); + ZVAL_UNDEF(&className); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, ¶mValue, &className_param); - zephir_get_strval(className, className_param); + zephir_get_strval(&className, className_param); - _0 = zephir_fetch_class(className TSRMLS_CC); + _0 = zephir_fetch_class(&className TSRMLS_CC); ZEPHIR_RETURN_CALL_CE_STATIC(_0, "findfirst", NULL, 0, paramValue); zephir_check_call_status(); RETURN_MM(); @@ -221,33 +257,41 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromCache) { zend_bool _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *cacheKey_param = NULL, *cache = NULL, *internalParams = NULL, *_0, *_1, *_3 = NULL; - zval *cacheKey = NULL; + zval *cacheKey_param = NULL, cache, internalParams, _0, _1, _3; + zval cacheKey; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cacheKey); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&internalParams); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &cacheKey_param); - zephir_get_strval(cacheKey, cacheKey_param); + zephir_get_strval(&cacheKey, cacheKey_param); - ZEPHIR_OBS_VAR(internalParams); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("internalCache"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&internalParams, _0, cacheKey, 0 TSRMLS_CC)) { - RETURN_CCTOR(internalParams); + ZEPHIR_OBS_VAR(&internalParams); + zephir_read_property(&_0, this_ptr, SL("internalCache"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&internalParams, &_0, &cacheKey, 0 TSRMLS_CC)) { + RETURN_CCTOR(&internalParams); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("cache"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(cache, _1); - _2 = Z_TYPE_P(cache) != IS_NULL; + zephir_read_property(&_1, this_ptr, SL("cache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&cache, &_1); + _2 = Z_TYPE_P(&cache) != IS_NULL; if (_2) { - ZEPHIR_CALL_METHOD(&_3, cache, "exists", NULL, 0, cacheKey); + ZEPHIR_CALL_METHOD(&_3, &cache, "exists", NULL, 0, &cacheKey); zephir_check_call_status(); - _2 = zephir_is_true(_3); + _2 = zephir_is_true(&_3); } if (_2) { - ZEPHIR_CALL_METHOD(&internalParams, cache, "get", NULL, 0, cacheKey); + ZEPHIR_CALL_METHOD(&internalParams, &cache, "get", NULL, 0, &cacheKey); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("internalCache"), cacheKey, internalParams TSRMLS_CC); - RETURN_CCTOR(internalParams); + zephir_update_property_array(this_ptr, SL("internalCache"), &cacheKey, &internalParams TSRMLS_CC); + RETURN_CCTOR(&internalParams); } RETURN_MM_NULL(); @@ -259,73 +303,102 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromCache) { PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromReflection) { zend_class_entry *_8$$10; - HashTable *_2; - HashPosition _1; + zend_string *_3; + zend_ulong _2; zephir_fcall_cache_entry *_7 = NULL, *_9 = NULL, *_12 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *cacheKey = NULL; - zval *params = NULL; - zval *handler, *params_param = NULL, *cacheKey_param = NULL, *methodName, *methodParams = NULL, *reflection = NULL, *paramKey = NULL, *methodParam = NULL, *paramsCache = NULL, *className = NULL, *realClasses = NULL, *boundModel = NULL, *cache = NULL, *handlerClass = NULL, *reflectionClass = NULL, *paramsKeys = NULL, *paramValue = NULL, *_0, **_3, *_4$$7, _5$$5 = zval_used_for_init, *_6$$5 = NULL, *_10$$15 = NULL, *_11$$15 = NULL; + zval cacheKey; + zval params; + zval *handler, handler_sub, *params_param = NULL, *cacheKey_param = NULL, *methodName, methodName_sub, methodParams, reflection, paramKey, methodParam, paramsCache, className, realClasses, boundModel, cache, handlerClass, reflectionClass, paramsKeys, paramValue, _0, *_1, _4$$7, _5$$5, _6$$5, _10$$15, _11$$15; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler_sub); + ZVAL_UNDEF(&methodName_sub); + ZVAL_UNDEF(&methodParams); + ZVAL_UNDEF(&reflection); + ZVAL_UNDEF(¶mKey); + ZVAL_UNDEF(&methodParam); + ZVAL_UNDEF(¶msCache); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&realClasses); + ZVAL_UNDEF(&boundModel); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&handlerClass); + ZVAL_UNDEF(&reflectionClass); + ZVAL_UNDEF(¶msKeys); + ZVAL_UNDEF(¶mValue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_10$$15); + ZVAL_UNDEF(&_11$$15); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&cacheKey); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &handler, ¶ms_param, &cacheKey_param, &methodName); - zephir_get_arrval(params, params_param); - zephir_get_strval(cacheKey, cacheKey_param); + zephir_get_arrval(¶ms, params_param); + zephir_get_strval(&cacheKey, cacheKey_param); - ZEPHIR_INIT_VAR(realClasses); - ZVAL_NULL(realClasses); - ZEPHIR_INIT_VAR(paramsCache); - array_init(paramsCache); - ZEPHIR_INIT_VAR(reflection); + ZEPHIR_INIT_VAR(&realClasses); + ZVAL_NULL(&realClasses); + ZEPHIR_INIT_VAR(¶msCache); + array_init(¶msCache); + ZEPHIR_INIT_VAR(&reflection); if (Z_TYPE_P(methodName) != IS_NULL) { - object_init_ex(reflection, zephir_get_internal_ce(SS("reflectionmethod") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, reflection, "__construct", NULL, 342, handler, methodName); + object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionmethod"))); + ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 302, handler, methodName); zephir_check_call_status(); } else { - object_init_ex(reflection, zephir_get_internal_ce(SS("reflectionfunction") TSRMLS_CC)); - ZEPHIR_CALL_METHOD(NULL, reflection, "__construct", NULL, 87, handler); + object_init_ex(&reflection, zephir_get_internal_ce(SL("reflectionfunction"))); + ZEPHIR_CALL_METHOD(NULL, &reflection, "__construct", NULL, 78, handler); zephir_check_call_status(); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("cache"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(cache, _0); - ZEPHIR_CALL_METHOD(&methodParams, reflection, "getparameters", NULL, 88); + zephir_read_property(&_0, this_ptr, SL("cache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&cache, &_0); + ZEPHIR_CALL_METHOD(&methodParams, &reflection, "getparameters", NULL, 79); zephir_check_call_status(); - ZEPHIR_INIT_VAR(paramsKeys); - zephir_array_keys(paramsKeys, params TSRMLS_CC); - zephir_is_iterable(methodParams, &_2, &_1, 0, 0, "phalcon/mvc/model/binder.zep", 209); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(paramKey, _2, _1); - ZEPHIR_GET_HVALUE(methodParam, _3); - ZEPHIR_CALL_METHOD(&reflectionClass, methodParam, "getclass", NULL, 0); + ZEPHIR_INIT_VAR(¶msKeys); + zephir_array_keys(¶msKeys, ¶ms TSRMLS_CC); + zephir_is_iterable(&methodParams, 0, "phalcon/mvc/model/binder.zep", 209); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methodParams), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(¶mKey); + if (_3 != NULL) { + ZVAL_STR_COPY(¶mKey, _3); + } else { + ZVAL_LONG(¶mKey, _2); + } + ZEPHIR_INIT_NVAR(&methodParam); + ZVAL_COPY(&methodParam, _1); + ZEPHIR_CALL_METHOD(&reflectionClass, &methodParam, "getclass", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(reflectionClass))) { + if (!(zephir_is_true(&reflectionClass))) { continue; } - ZEPHIR_CALL_METHOD(&className, reflectionClass, "getname", NULL, 0); + ZEPHIR_CALL_METHOD(&className, &reflectionClass, "getname", NULL, 0); zephir_check_call_status(); - if (!(zephir_array_isset(params, paramKey))) { - zephir_array_fetch(&_4$$7, paramsKeys, paramKey, PH_NOISY | PH_READONLY, "phalcon/mvc/model/binder.zep", 169 TSRMLS_CC); - ZEPHIR_CPY_WRT(paramKey, _4$$7); + if (!(zephir_array_isset(¶ms, ¶mKey))) { + zephir_array_fetch(&_4$$7, ¶msKeys, ¶mKey, PH_NOISY | PH_READONLY, "phalcon/mvc/model/binder.zep", 169 TSRMLS_CC); + ZEPHIR_CPY_WRT(¶mKey, &_4$$7); } - ZEPHIR_INIT_NVAR(boundModel); - ZVAL_NULL(boundModel); - ZEPHIR_OBS_NVAR(paramValue); - zephir_array_fetch(¶mValue, params, paramKey, PH_NOISY, "phalcon/mvc/model/binder.zep", 172 TSRMLS_CC); - ZEPHIR_SINIT_NVAR(_5$$5); - ZVAL_STRING(&_5$$5, "Phalcon\\Mvc\\Model", 0); - ZEPHIR_CALL_FUNCTION(&_6$$5, "is_subclass_of", &_7, 343, className, &_5$$5); + ZEPHIR_INIT_NVAR(&boundModel); + ZVAL_NULL(&boundModel); + ZEPHIR_OBS_NVAR(¶mValue); + zephir_array_fetch(¶mValue, ¶ms, ¶mKey, PH_NOISY, "phalcon/mvc/model/binder.zep", 172 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_5$$5); + ZVAL_STRING(&_5$$5, "Phalcon\\Mvc\\Model"); + ZEPHIR_CALL_FUNCTION(&_6$$5, "is_subclass_of", &_7, 303, &className, &_5$$5); zephir_check_call_status(); - if (ZEPHIR_IS_STRING(className, "Phalcon\\Mvc\\Model")) { - if (Z_TYPE_P(realClasses) == IS_NULL) { + if (ZEPHIR_IS_STRING(&className, "Phalcon\\Mvc\\Model")) { + if (Z_TYPE_P(&realClasses) == IS_NULL) { if (zephir_instance_of_ev(handler, phalcon_mvc_controller_bindmodelinterface_ce TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(handlerClass); - zephir_get_class(handlerClass, handler, 0 TSRMLS_CC); - _8$$10 = zephir_fetch_class(handlerClass TSRMLS_CC); + ZEPHIR_INIT_NVAR(&handlerClass); + zephir_get_class(&handlerClass, handler, 0 TSRMLS_CC); + _8$$10 = zephir_fetch_class(&handlerClass TSRMLS_CC); ZEPHIR_CALL_CE_STATIC(&realClasses, _8$$10, "getmodelname", NULL, 0); zephir_check_call_status(); } else if (zephir_instance_of_ev(handler, phalcon_mvc_model_binder_bindableinterface_ce TSRMLS_CC)) { @@ -336,90 +409,87 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromReflection) { return; } } - if (Z_TYPE_P(realClasses) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(className); - if (zephir_array_isset_fetch(&className, realClasses, paramKey, 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_9, 0, paramValue, className); + if (Z_TYPE_P(&realClasses) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&className); + if (zephir_array_isset_fetch(&className, &realClasses, ¶mKey, 0 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_9, 0, ¶mValue, &className); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(_10$$15); - object_init_ex(_10$$15, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_10$$15); + object_init_ex(&_10$$15, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_11$$15); - ZEPHIR_CONCAT_SVS(_11$$15, "You should provide model class name for ", paramKey, " parameter"); - ZEPHIR_CALL_METHOD(NULL, _10$$15, "__construct", &_12, 9, _11$$15); + ZEPHIR_CONCAT_SVS(&_11$$15, "You should provide model class name for ", ¶mKey, " parameter"); + ZEPHIR_CALL_METHOD(NULL, &_10$$15, "__construct", &_12, 4, &_11$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_10$$15, "phalcon/mvc/model/binder.zep", 189 TSRMLS_CC); + zephir_throw_exception_debug(&_10$$15, "phalcon/mvc/model/binder.zep", 189 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - } else if (Z_TYPE_P(realClasses) == IS_STRING) { - ZEPHIR_CPY_WRT(className, realClasses); - ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_9, 0, paramValue, className); + } else if (Z_TYPE_P(&realClasses) == IS_STRING) { + ZEPHIR_CPY_WRT(&className, &realClasses); + ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_9, 0, ¶mValue, &className); zephir_check_call_status(); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "getModelName should return array or string", "phalcon/mvc/model/binder.zep", 195); return; } - } else if (zephir_is_true(_6$$5)) { - ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_9, 0, paramValue, className); + } else if (zephir_is_true(&_6$$5)) { + ZEPHIR_CALL_METHOD(&boundModel, this_ptr, "findboundmodel", &_9, 0, ¶mValue, &className); zephir_check_call_status(); } - if (Z_TYPE_P(boundModel) != IS_NULL) { - zephir_update_property_array(this_ptr, SL("originalValues"), paramKey, paramValue TSRMLS_CC); - zephir_array_update_zval(¶ms, paramKey, &boundModel, PH_COPY | PH_SEPARATE); - zephir_update_property_array(this_ptr, SL("boundModels"), paramKey, boundModel TSRMLS_CC); - zephir_array_update_zval(¶msCache, paramKey, &className, PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&boundModel) != IS_NULL) { + zephir_update_property_array(this_ptr, SL("originalValues"), ¶mKey, ¶mValue TSRMLS_CC); + zephir_array_update_zval(¶ms, ¶mKey, &boundModel, PH_COPY | PH_SEPARATE); + zephir_update_property_array(this_ptr, SL("boundModels"), ¶mKey, &boundModel TSRMLS_CC); + zephir_array_update_zval(¶msCache, ¶mKey, &className, PH_COPY | PH_SEPARATE); } - } - if (Z_TYPE_P(cache) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, cache, "save", NULL, 0, cacheKey, paramsCache); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&methodParam); + ZEPHIR_INIT_NVAR(¶mKey); + if (Z_TYPE_P(&cache) != IS_NULL) { + ZEPHIR_CALL_METHOD(NULL, &cache, "save", NULL, 0, &cacheKey, ¶msCache); zephir_check_call_status(); } - zephir_update_property_array(this_ptr, SL("internalCache"), cacheKey, paramsCache TSRMLS_CC); - RETURN_CTOR(params); + zephir_update_property_array(this_ptr, SL("internalCache"), &cacheKey, ¶msCache TSRMLS_CC); + RETURN_CTOR(¶ms); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_Binder(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_Binder(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_2, *_4, *_1$$3, *_3$$4, *_5$$5; + zval _0, _2, _4, _1$$3, _3$$4, _5$$5; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$5); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("originalValues"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("originalValues"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("originalValues"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("originalValues"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("internalCache"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("internalCache"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("internalCache"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("internalCache"), &_3$$4); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("boundModels"), PH_NOISY_CC); - if (Z_TYPE_P(_4) == IS_NULL) { - ZEPHIR_INIT_VAR(_5$$5); - array_init(_5$$5); - zephir_update_property_this(getThis(), SL("boundModels"), _5$$5 TSRMLS_CC); + zephir_read_property(&_4, this_ptr, SL("boundModels"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_4) == IS_NULL) { + ZEPHIR_INIT_VAR(&_5$$5); + array_init(&_5$$5); + zephir_update_property_zval(this_ptr, SL("boundModels"), &_5$$5); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/binder.zep.h b/ext/phalcon/mvc/model/binder.zep.h index 47d3dbd17b2..987588a337b 100644 --- a/ext/phalcon/mvc/model/binder.zep.h +++ b/ext/phalcon/mvc/model/binder.zep.h @@ -12,45 +12,91 @@ PHP_METHOD(Phalcon_Mvc_Model_Binder, bindToHandler); PHP_METHOD(Phalcon_Mvc_Model_Binder, findBoundModel); PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromCache); PHP_METHOD(Phalcon_Mvc_Model_Binder, getParamsFromReflection); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_Binder(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_Binder(zend_class_entry *class_type TSRMLS_DC); + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_getboundmodels, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_getboundmodels, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_binder___construct, 0, 0, 0) ZEND_ARG_OBJ_INFO(0, cache, Phalcon\\Cache\\BackendInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_binder_setcache, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_binder_setcache, 0, 1, Phalcon\\Mvc\\Model\\BinderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_setcache, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\BinderInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, cache, Phalcon\\Cache\\BackendInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_binder_bindtohandler, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_binder_getcache, 0, 0, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_getcache, 0, 0, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_bindtohandler, 0, 3, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_bindtohandler, 0, 3, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_ARRAY_INFO(0, params, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cacheKey, IS_STRING, 0) +#else ZEND_ARG_INFO(0, cacheKey) +#endif ZEND_ARG_INFO(0, methodName) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_binder_findboundmodel, 0, 0, 2) ZEND_ARG_INFO(0, paramValue) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, className, IS_STRING, 0) +#else ZEND_ARG_INFO(0, className) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_binder_getparamsfromcache, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_getparamsfromcache, 0, 1, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_getparamsfromcache, 0, 1, IS_ARRAY, NULL, 1) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cacheKey, IS_STRING, 0) +#else ZEND_ARG_INFO(0, cacheKey) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_binder_getparamsfromreflection, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_getparamsfromreflection, 0, 4, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binder_getparamsfromreflection, 0, 4, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_ARRAY_INFO(0, params, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cacheKey, IS_STRING, 0) +#else ZEND_ARG_INFO(0, cacheKey) +#endif ZEND_ARG_INFO(0, methodName) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_binder_method_entry) { - PHP_ME(Phalcon_Mvc_Model_Binder, getBoundModels, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Binder, getBoundModels, arginfo_phalcon_mvc_model_binder_getboundmodels, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Binder, getOriginalValues, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Binder, __construct, arginfo_phalcon_mvc_model_binder___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Binder, setCache, arginfo_phalcon_mvc_model_binder_setcache, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Binder, getCache, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Binder, getCache, arginfo_phalcon_mvc_model_binder_getcache, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Binder, bindToHandler, arginfo_phalcon_mvc_model_binder_bindtohandler, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Binder, findBoundModel, arginfo_phalcon_mvc_model_binder_findboundmodel, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model_Binder, getParamsFromCache, arginfo_phalcon_mvc_model_binder_getparamsfromcache, ZEND_ACC_PROTECTED) diff --git a/ext/phalcon/mvc/model/binderinterface.zep.h b/ext/phalcon/mvc/model/binderinterface.zep.h index 29c78be0994..cdaef6b5b00 100644 --- a/ext/phalcon/mvc/model/binderinterface.zep.h +++ b/ext/phalcon/mvc/model/binderinterface.zep.h @@ -3,20 +3,46 @@ extern zend_class_entry *phalcon_mvc_model_binderinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_BinderInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_setcache, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_getboundmodels, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_getboundmodels, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_getcache, 0, 0, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_getcache, 0, 0, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_setcache, 0, 1, Phalcon\\Mvc\\Model\\BinderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_setcache, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\BinderInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, cache, Phalcon\\Cache\\BackendInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_bindtohandler, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_bindtohandler, 0, 3, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_binderinterface_bindtohandler, 0, 3, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, handler) ZEND_ARG_ARRAY_INFO(0, params, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, cacheKey, IS_STRING, 0) +#else ZEND_ARG_INFO(0, cacheKey) +#endif ZEND_ARG_INFO(0, methodName) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_binderinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BinderInterface, getBoundModels, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BinderInterface, getCache, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BinderInterface, getBoundModels, arginfo_phalcon_mvc_model_binderinterface_getboundmodels) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BinderInterface, getCache, arginfo_phalcon_mvc_model_binderinterface_getcache) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BinderInterface, setCache, arginfo_phalcon_mvc_model_binderinterface_setcache) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_BinderInterface, bindToHandler, arginfo_phalcon_mvc_model_binderinterface_bindtohandler) PHP_FE_END diff --git a/ext/phalcon/mvc/model/criteria.zep.c b/ext/phalcon/mvc/model/criteria.zep.c index 529f791d542..431ddd29bfb 100644 --- a/ext/phalcon/mvc/model/criteria.zep.c +++ b/ext/phalcon/mvc/model/criteria.zep.c @@ -65,16 +65,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Criteria) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, setDI) { - zval *dependencyInjector, *_0; + zval *dependencyInjector, dependencyInjector_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &dependencyInjector); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "di", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, dependencyInjector TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "di"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, dependencyInjector TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -84,12 +88,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, setDI) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getDI) { - zval *dependencyInjector = NULL, *_0; + zval dependencyInjector, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&dependencyInjector, _0, SS("di"), 1 TSRMLS_CC)) { - RETURN_CTORW(dependencyInjector); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&dependencyInjector, &_0, SL("di"), 1)) { + RETURN_CTORW(&dependencyInjector); } RETURN_NULL(); @@ -101,24 +109,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getDI) { PHP_METHOD(Phalcon_Mvc_Model_Criteria, setModelName) { zval *modelName_param = NULL; - zval *modelName = NULL; + zval modelName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &modelName_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } - zephir_update_property_this(getThis(), SL("_model"), modelName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_model"), &modelName); RETURN_THIS(); } @@ -128,7 +139,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, setModelName) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getModelName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_model"); @@ -141,13 +153,23 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getModelName) { PHP_METHOD(Phalcon_Mvc_Model_Criteria, bind) { zend_bool merge; - zval *bindParams_param = NULL, *merge_param = NULL, *bind = NULL, *_0$$3, *_1$$4, *_2$$6, *_3$$6, *_4$$7, *_5$$8; - zval *bindParams = NULL; + zval *bindParams_param = NULL, *merge_param = NULL, bind, _0$$3, _1$$4, _2$$6, _3$$6, _4$$7, _5$$8; + zval bindParams; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&bind); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &bindParams_param, &merge_param); - bindParams = bindParams_param; + ZEPHIR_OBS_COPY_OR_DUP(&bindParams, bindParams_param); if (!merge_param) { merge = 0; } else { @@ -156,30 +178,30 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, bind) { if (merge) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string(_0$$3, SS("bind"))) { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(bind); - zephir_array_fetch_string(&bind, _1$$4, SL("bind"), PH_NOISY, "phalcon/mvc/model/criteria.zep", 108 TSRMLS_CC); + zephir_read_property(&_0$$3, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string(&_0$$3, SL("bind"))) { + zephir_read_property(&_1$$4, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_OBS_VAR(&bind); + zephir_array_fetch_string(&bind, &_1$$4, SL("bind"), PH_NOISY, "phalcon/mvc/model/criteria.zep", 108 TSRMLS_CC); } else { - ZEPHIR_INIT_NVAR(bind); - ZVAL_NULL(bind); + ZEPHIR_INIT_NVAR(&bind); + ZVAL_NULL(&bind); } - if (Z_TYPE_P(bind) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_2$$6); - zephir_add_function(_2$$6, bind, bindParams); - ZEPHIR_INIT_VAR(_3$$6); - ZVAL_STRING(_3$$6, "bind", 1); - zephir_update_property_array(this_ptr, SL("_params"), _3$$6, _2$$6 TSRMLS_CC); + if (Z_TYPE_P(&bind) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_2$$6); + zephir_add_function(&_2$$6, &bind, &bindParams); + ZEPHIR_INIT_VAR(&_3$$6); + ZVAL_STRING(&_3$$6, "bind"); + zephir_update_property_array(this_ptr, SL("_params"), &_3$$6, &_2$$6 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_4$$7); - ZVAL_STRING(_4$$7, "bind", 1); - zephir_update_property_array(this_ptr, SL("_params"), _4$$7, bindParams TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$7); + ZVAL_STRING(&_4$$7, "bind"); + zephir_update_property_array(this_ptr, SL("_params"), &_4$$7, &bindParams TSRMLS_CC); } } else { - ZEPHIR_INIT_VAR(_5$$8); - ZVAL_STRING(_5$$8, "bind", 1); - zephir_update_property_array(this_ptr, SL("_params"), _5$$8, bindParams TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$8); + ZVAL_STRING(&_5$$8, "bind"); + zephir_update_property_array(this_ptr, SL("_params"), &_5$$8, &bindParams TSRMLS_CC); } RETURN_THIS(); @@ -191,18 +213,22 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, bind) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, bindTypes) { - zval *bindTypes_param = NULL, *_0; - zval *bindTypes = NULL; + zval *bindTypes_param = NULL, _0; + zval bindTypes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &bindTypes_param); - bindTypes = bindTypes_param; + ZEPHIR_OBS_COPY_OR_DUP(&bindTypes, bindTypes_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "bindTypes", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, bindTypes TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "bindTypes"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, &bindTypes TSRMLS_CC); RETURN_THIS(); } @@ -212,16 +238,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, bindTypes) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, distinct) { - zval *distinct, *_0; + zval *distinct, distinct_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&distinct_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &distinct); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "distinct", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, distinct TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "distinct"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, distinct TSRMLS_CC); RETURN_THIS(); } @@ -243,16 +273,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, distinct) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, columns) { - zval *columns, *_0; + zval *columns, columns_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&columns_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &columns); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "columns", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, columns TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "columns"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, columns TSRMLS_CC); RETURN_THIS(); } @@ -269,62 +303,78 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, columns) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, join) { - zval *_1$$4; - zval *model_param = NULL, *conditions = NULL, *alias = NULL, *type = NULL, *join = NULL, *mergedJoins = NULL, *currentJoins = NULL, *_0, *_2; - zval *model = NULL; + zval _1$$4; + zval *model_param = NULL, *conditions = NULL, conditions_sub, *alias = NULL, alias_sub, *type = NULL, type_sub, __$null, join, mergedJoins, currentJoins, _0, _2; + zval model; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&alias_sub); + ZVAL_UNDEF(&type_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&join); + ZVAL_UNDEF(&mergedJoins); + ZVAL_UNDEF(¤tJoins); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &model_param, &conditions, &alias, &type); if (UNEXPECTED(Z_TYPE_P(model_param) != IS_STRING && Z_TYPE_P(model_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(model_param) == IS_STRING)) { - zephir_get_strval(model, model_param); + zephir_get_strval(&model, model_param); } else { - ZEPHIR_INIT_VAR(model); - ZVAL_EMPTY_STRING(model); + ZEPHIR_INIT_VAR(&model); + ZVAL_EMPTY_STRING(&model); } if (!conditions) { - conditions = ZEPHIR_GLOBAL(global_null); + conditions = &conditions_sub; + conditions = &__$null; } if (!alias) { - alias = ZEPHIR_GLOBAL(global_null); + alias = &alias_sub; + alias = &__$null; } if (!type) { - type = ZEPHIR_GLOBAL(global_null); - } - - - ZEPHIR_INIT_VAR(join); - zephir_create_array(join, 4, 0 TSRMLS_CC); - zephir_array_fast_append(join, model); - zephir_array_fast_append(join, conditions); - zephir_array_fast_append(join, alias); - zephir_array_fast_append(join, type); - ZEPHIR_OBS_VAR(currentJoins); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(¤tJoins, _0, SS("joins"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(currentJoins) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_1$$4); - zephir_create_array(_1$$4, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_1$$4, join); - ZEPHIR_INIT_VAR(mergedJoins); - zephir_fast_array_merge(mergedJoins, &(currentJoins), &(_1$$4) TSRMLS_CC); + type = &type_sub; + type = &__$null; + } + + + ZEPHIR_INIT_VAR(&join); + zephir_create_array(&join, 4, 0 TSRMLS_CC); + zephir_array_fast_append(&join, &model); + zephir_array_fast_append(&join, conditions); + zephir_array_fast_append(&join, alias); + zephir_array_fast_append(&join, type); + ZEPHIR_OBS_VAR(¤tJoins); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(¤tJoins, &_0, SL("joins"), 0)) { + if (Z_TYPE_P(¤tJoins) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_1$$4); + zephir_create_array(&_1$$4, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_1$$4, &join); + ZEPHIR_INIT_VAR(&mergedJoins); + zephir_fast_array_merge(&mergedJoins, ¤tJoins, &_1$$4 TSRMLS_CC); } else { - ZEPHIR_INIT_NVAR(mergedJoins); - zephir_create_array(mergedJoins, 1, 0 TSRMLS_CC); - zephir_array_fast_append(mergedJoins, join); + ZEPHIR_INIT_NVAR(&mergedJoins); + zephir_create_array(&mergedJoins, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&mergedJoins, &join); } } else { - ZEPHIR_INIT_NVAR(mergedJoins); - zephir_create_array(mergedJoins, 1, 0 TSRMLS_CC); - zephir_array_fast_append(mergedJoins, join); + ZEPHIR_INIT_NVAR(&mergedJoins); + zephir_create_array(&mergedJoins, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&mergedJoins, &join); } - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "joins", 1); - zephir_update_property_array(this_ptr, SL("_params"), _2, mergedJoins TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "joins"); + zephir_update_property_array(this_ptr, SL("_params"), &_2, &mergedJoins TSRMLS_CC); RETURN_THIS(); } @@ -341,34 +391,42 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, join) { PHP_METHOD(Phalcon_Mvc_Model_Criteria, innerJoin) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model_param = NULL, *conditions = NULL, *alias = NULL, *_0; - zval *model = NULL; + zval *model_param = NULL, *conditions = NULL, conditions_sub, *alias = NULL, alias_sub, __$null, _0; + zval model; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&alias_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &model_param, &conditions, &alias); if (UNEXPECTED(Z_TYPE_P(model_param) != IS_STRING && Z_TYPE_P(model_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(model_param) == IS_STRING)) { - zephir_get_strval(model, model_param); + zephir_get_strval(&model, model_param); } else { - ZEPHIR_INIT_VAR(model); - ZVAL_EMPTY_STRING(model); + ZEPHIR_INIT_VAR(&model); + ZVAL_EMPTY_STRING(&model); } if (!conditions) { - conditions = ZEPHIR_GLOBAL(global_null); + conditions = &conditions_sub; + conditions = &__$null; } if (!alias) { - alias = ZEPHIR_GLOBAL(global_null); + alias = &alias_sub; + alias = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "INNER", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "join", NULL, 0, model, conditions, alias, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "INNER"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "join", NULL, 0, &model, conditions, alias, &_0); zephir_check_call_status(); RETURN_MM(); @@ -384,34 +442,42 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, innerJoin) { PHP_METHOD(Phalcon_Mvc_Model_Criteria, leftJoin) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model_param = NULL, *conditions = NULL, *alias = NULL, *_0; - zval *model = NULL; + zval *model_param = NULL, *conditions = NULL, conditions_sub, *alias = NULL, alias_sub, __$null, _0; + zval model; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&alias_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &model_param, &conditions, &alias); if (UNEXPECTED(Z_TYPE_P(model_param) != IS_STRING && Z_TYPE_P(model_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(model_param) == IS_STRING)) { - zephir_get_strval(model, model_param); + zephir_get_strval(&model, model_param); } else { - ZEPHIR_INIT_VAR(model); - ZVAL_EMPTY_STRING(model); + ZEPHIR_INIT_VAR(&model); + ZVAL_EMPTY_STRING(&model); } if (!conditions) { - conditions = ZEPHIR_GLOBAL(global_null); + conditions = &conditions_sub; + conditions = &__$null; } if (!alias) { - alias = ZEPHIR_GLOBAL(global_null); + alias = &alias_sub; + alias = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "LEFT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "join", NULL, 0, model, conditions, alias, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "LEFT"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "join", NULL, 0, &model, conditions, alias, &_0); zephir_check_call_status(); RETURN_MM(); @@ -427,34 +493,42 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, leftJoin) { PHP_METHOD(Phalcon_Mvc_Model_Criteria, rightJoin) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model_param = NULL, *conditions = NULL, *alias = NULL, *_0; - zval *model = NULL; + zval *model_param = NULL, *conditions = NULL, conditions_sub, *alias = NULL, alias_sub, __$null, _0; + zval model; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&alias_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &model_param, &conditions, &alias); if (UNEXPECTED(Z_TYPE_P(model_param) != IS_STRING && Z_TYPE_P(model_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(model_param) == IS_STRING)) { - zephir_get_strval(model, model_param); + zephir_get_strval(&model, model_param); } else { - ZEPHIR_INIT_VAR(model); - ZVAL_EMPTY_STRING(model); + ZEPHIR_INIT_VAR(&model); + ZVAL_EMPTY_STRING(&model); } if (!conditions) { - conditions = ZEPHIR_GLOBAL(global_null); + conditions = &conditions_sub; + conditions = &__$null; } if (!alias) { - alias = ZEPHIR_GLOBAL(global_null); + alias = &alias_sub; + alias = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "RIGHT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "join", NULL, 0, model, conditions, alias, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "RIGHT"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "join", NULL, 0, &model, conditions, alias, &_0); zephir_check_call_status(); RETURN_MM(); @@ -465,61 +539,80 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, rightJoin) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, where) { - zval *conditions_param = NULL, *bindParams = NULL, *bindTypes = NULL, *currentBindParams = NULL, *currentBindTypes = NULL, *_0, *_1$$3, *_2$$4, *_3$$4, *_4$$5, *_5$$6, *_6$$7, *_7$$7, *_8$$8; - zval *conditions = NULL; + zval *conditions_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, currentBindParams, currentBindTypes, _0, _1$$3, _2$$4, _3$$4, _4$$5, _5$$6, _6$$7, _7$$7, _8$$8; + zval conditions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¤tBindParams); + ZVAL_UNDEF(¤tBindTypes); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(conditions_param) != IS_STRING && Z_TYPE_P(conditions_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(conditions_param) == IS_STRING)) { - zephir_get_strval(conditions, conditions_param); + zephir_get_strval(&conditions, conditions_param); } else { - ZEPHIR_INIT_VAR(conditions); - ZVAL_EMPTY_STRING(conditions); + ZEPHIR_INIT_VAR(&conditions); + ZVAL_EMPTY_STRING(&conditions); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "conditions", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, conditions TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "conditions"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, &conditions TSRMLS_CC); if (Z_TYPE_P(bindParams) == IS_ARRAY) { - ZEPHIR_OBS_VAR(currentBindParams); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(¤tBindParams, _1$$3, SS("bind"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_2$$4); - zephir_fast_array_merge(_2$$4, &(currentBindParams), &(bindParams) TSRMLS_CC); - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_STRING(_3$$4, "bind", 1); - zephir_update_property_array(this_ptr, SL("_params"), _3$$4, _2$$4 TSRMLS_CC); + ZEPHIR_OBS_VAR(¤tBindParams); + zephir_read_property(&_1$$3, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(¤tBindParams, &_1$$3, SL("bind"), 0)) { + ZEPHIR_INIT_VAR(&_2$$4); + zephir_fast_array_merge(&_2$$4, ¤tBindParams, bindParams TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$4); + ZVAL_STRING(&_3$$4, "bind"); + zephir_update_property_array(this_ptr, SL("_params"), &_3$$4, &_2$$4 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_4$$5); - ZVAL_STRING(_4$$5, "bind", 1); - zephir_update_property_array(this_ptr, SL("_params"), _4$$5, bindParams TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$5); + ZVAL_STRING(&_4$$5, "bind"); + zephir_update_property_array(this_ptr, SL("_params"), &_4$$5, bindParams TSRMLS_CC); } } if (Z_TYPE_P(bindTypes) == IS_ARRAY) { - ZEPHIR_OBS_VAR(currentBindTypes); - _5$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(¤tBindTypes, _5$$6, SS("bindTypes"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_6$$7); - zephir_fast_array_merge(_6$$7, &(currentBindTypes), &(bindTypes) TSRMLS_CC); - ZEPHIR_INIT_VAR(_7$$7); - ZVAL_STRING(_7$$7, "bindTypes", 1); - zephir_update_property_array(this_ptr, SL("_params"), _7$$7, _6$$7 TSRMLS_CC); + ZEPHIR_OBS_VAR(¤tBindTypes); + zephir_read_property(&_5$$6, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(¤tBindTypes, &_5$$6, SL("bindTypes"), 0)) { + ZEPHIR_INIT_VAR(&_6$$7); + zephir_fast_array_merge(&_6$$7, ¤tBindTypes, bindTypes TSRMLS_CC); + ZEPHIR_INIT_VAR(&_7$$7); + ZVAL_STRING(&_7$$7, "bindTypes"); + zephir_update_property_array(this_ptr, SL("_params"), &_7$$7, &_6$$7 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_8$$8); - ZVAL_STRING(_8$$8, "bindTypes", 1); - zephir_update_property_array(this_ptr, SL("_params"), _8$$8, bindTypes TSRMLS_CC); + ZEPHIR_INIT_VAR(&_8$$8); + ZVAL_STRING(&_8$$8, "bindTypes"); + zephir_update_property_array(this_ptr, SL("_params"), &_8$$8, bindTypes TSRMLS_CC); } } RETURN_THIS(); @@ -535,31 +628,39 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, where) { PHP_METHOD(Phalcon_Mvc_Model_Criteria, addWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *conditions_param = NULL, *bindParams = NULL, *bindTypes = NULL; - zval *conditions = NULL; + zval *conditions_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null; + zval conditions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(conditions_param) != IS_STRING && Z_TYPE_P(conditions_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(conditions_param) == IS_STRING)) { - zephir_get_strval(conditions, conditions_param); + zephir_get_strval(&conditions, conditions_param); } else { - ZEPHIR_INIT_VAR(conditions); - ZVAL_EMPTY_STRING(conditions); + ZEPHIR_INIT_VAR(&conditions); + ZVAL_EMPTY_STRING(&conditions); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "andwhere", NULL, 0, conditions, bindParams, bindTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "andwhere", NULL, 0, &conditions, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); @@ -571,38 +672,49 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, addWhere) { PHP_METHOD(Phalcon_Mvc_Model_Criteria, andWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *conditions_param = NULL, *bindParams = NULL, *bindTypes = NULL, *currentConditions = NULL, *_0, *_1$$3; - zval *conditions = NULL; + zval *conditions_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, currentConditions, _0, _1$$3; + zval conditions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¤tConditions); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(conditions_param) != IS_STRING && Z_TYPE_P(conditions_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(conditions_param) == IS_STRING)) { - zephir_get_strval(conditions, conditions_param); + zephir_get_strval(&conditions, conditions_param); } else { - ZEPHIR_INIT_VAR(conditions); - ZVAL_EMPTY_STRING(conditions); + ZEPHIR_INIT_VAR(&conditions); + ZVAL_EMPTY_STRING(&conditions); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_OBS_VAR(currentConditions); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(¤tConditions, _0, SS("conditions"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_CONCAT_SVSVS(_1$$3, "(", currentConditions, ") AND (", conditions, ")"); - zephir_get_strval(conditions, _1$$3); + ZEPHIR_OBS_VAR(¤tConditions); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(¤tConditions, &_0, SL("conditions"), 0)) { + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_CONCAT_SVSVS(&_1$$3, "(", ¤tConditions, ") AND (", &conditions, ")"); + zephir_get_strval(&conditions, &_1$$3); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "where", NULL, 0, conditions, bindParams, bindTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "where", NULL, 0, &conditions, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); @@ -614,38 +726,49 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, andWhere) { PHP_METHOD(Phalcon_Mvc_Model_Criteria, orWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *conditions_param = NULL, *bindParams = NULL, *bindTypes = NULL, *currentConditions = NULL, *_0, *_1$$3; - zval *conditions = NULL; + zval *conditions_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, currentConditions, _0, _1$$3; + zval conditions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¤tConditions); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(conditions_param) != IS_STRING && Z_TYPE_P(conditions_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(conditions_param) == IS_STRING)) { - zephir_get_strval(conditions, conditions_param); + zephir_get_strval(&conditions, conditions_param); } else { - ZEPHIR_INIT_VAR(conditions); - ZVAL_EMPTY_STRING(conditions); + ZEPHIR_INIT_VAR(&conditions); + ZVAL_EMPTY_STRING(&conditions); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_OBS_VAR(currentConditions); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(¤tConditions, _0, SS("conditions"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_CONCAT_SVSVS(_1$$3, "(", currentConditions, ") OR (", conditions, ")"); - zephir_get_strval(conditions, _1$$3); + ZEPHIR_OBS_VAR(¤tConditions); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(¤tConditions, &_0, SL("conditions"), 0)) { + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_CONCAT_SVSVS(&_1$$3, "(", ¤tConditions, ") OR (", &conditions, ")"); + zephir_get_strval(&conditions, &_1$$3); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "where", NULL, 0, conditions, bindParams, bindTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "where", NULL, 0, &conditions, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); @@ -660,45 +783,56 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, orWhere) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, betweenWhere) { - zval *_1; + zval _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *minimum, *maximum, *hiddenParam = NULL, *minimumKey = NULL, *nextHiddenParam = NULL, *maximumKey = NULL, *_0; - zval *expr = NULL; + zval *expr_param = NULL, *minimum, minimum_sub, *maximum, maximum_sub, hiddenParam, minimumKey, nextHiddenParam, maximumKey, _0; + zval expr; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&minimum_sub); + ZVAL_UNDEF(&maximum_sub); + ZVAL_UNDEF(&hiddenParam); + ZVAL_UNDEF(&minimumKey); + ZVAL_UNDEF(&nextHiddenParam); + ZVAL_UNDEF(&maximumKey); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &expr_param, &minimum, &maximum); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); - } - - - ZEPHIR_OBS_VAR(hiddenParam); - zephir_read_property_this(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(nextHiddenParam); - ZVAL_LONG(nextHiddenParam, (zephir_get_numberval(hiddenParam) + 1)); - ZEPHIR_INIT_VAR(minimumKey); - ZEPHIR_CONCAT_SV(minimumKey, "ACP", hiddenParam); - ZEPHIR_INIT_VAR(maximumKey); - ZEPHIR_CONCAT_SV(maximumKey, "ACP", nextHiddenParam); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_VSVSVS(_0, expr, " BETWEEN :", minimumKey, ": AND :", maximumKey, ":"); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 2, 0 TSRMLS_CC); - zephir_array_update_zval(&_1, minimumKey, &minimum, PH_COPY); - zephir_array_update_zval(&_1, maximumKey, &maximum, PH_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, _0, _1); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); + } + + + ZEPHIR_OBS_VAR(&hiddenParam); + zephir_read_property(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&nextHiddenParam); + ZVAL_LONG(&nextHiddenParam, (zephir_get_numberval(&hiddenParam) + 1)); + ZEPHIR_INIT_VAR(&minimumKey); + ZEPHIR_CONCAT_SV(&minimumKey, "ACP", &hiddenParam); + ZEPHIR_INIT_VAR(&maximumKey); + ZEPHIR_CONCAT_SV(&maximumKey, "ACP", &nextHiddenParam); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_VSVSVS(&_0, &expr, " BETWEEN :", &minimumKey, ": AND :", &maximumKey, ":"); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 2, 0 TSRMLS_CC); + zephir_array_update_zval(&_1, &minimumKey, minimum, PH_COPY); + zephir_array_update_zval(&_1, &maximumKey, maximum, PH_COPY); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, &_0, &_1); zephir_check_call_status(); - ZEPHIR_SEPARATE(nextHiddenParam); - zephir_increment(nextHiddenParam); - zephir_update_property_this(getThis(), SL("_hiddenParamNumber"), nextHiddenParam TSRMLS_CC); + ZEPHIR_SEPARATE(&nextHiddenParam); + zephir_increment(&nextHiddenParam); + zephir_update_property_zval(this_ptr, SL("_hiddenParamNumber"), &nextHiddenParam); RETURN_THIS(); } @@ -712,45 +846,56 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, betweenWhere) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, notBetweenWhere) { - zval *_1; + zval _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *minimum, *maximum, *hiddenParam = NULL, *nextHiddenParam = NULL, *minimumKey = NULL, *maximumKey = NULL, *_0; - zval *expr = NULL; + zval *expr_param = NULL, *minimum, minimum_sub, *maximum, maximum_sub, hiddenParam, nextHiddenParam, minimumKey, maximumKey, _0; + zval expr; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&minimum_sub); + ZVAL_UNDEF(&maximum_sub); + ZVAL_UNDEF(&hiddenParam); + ZVAL_UNDEF(&nextHiddenParam); + ZVAL_UNDEF(&minimumKey); + ZVAL_UNDEF(&maximumKey); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &expr_param, &minimum, &maximum); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); - } - - - ZEPHIR_OBS_VAR(hiddenParam); - zephir_read_property_this(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(nextHiddenParam); - ZVAL_LONG(nextHiddenParam, (zephir_get_numberval(hiddenParam) + 1)); - ZEPHIR_INIT_VAR(minimumKey); - ZEPHIR_CONCAT_SV(minimumKey, "ACP", hiddenParam); - ZEPHIR_INIT_VAR(maximumKey); - ZEPHIR_CONCAT_SV(maximumKey, "ACP", nextHiddenParam); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_VSVSVS(_0, expr, " NOT BETWEEN :", minimumKey, ": AND :", maximumKey, ":"); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 2, 0 TSRMLS_CC); - zephir_array_update_zval(&_1, minimumKey, &minimum, PH_COPY); - zephir_array_update_zval(&_1, maximumKey, &maximum, PH_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, _0, _1); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); + } + + + ZEPHIR_OBS_VAR(&hiddenParam); + zephir_read_property(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&nextHiddenParam); + ZVAL_LONG(&nextHiddenParam, (zephir_get_numberval(&hiddenParam) + 1)); + ZEPHIR_INIT_VAR(&minimumKey); + ZEPHIR_CONCAT_SV(&minimumKey, "ACP", &hiddenParam); + ZEPHIR_INIT_VAR(&maximumKey); + ZEPHIR_CONCAT_SV(&maximumKey, "ACP", &nextHiddenParam); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_VSVSVS(&_0, &expr, " NOT BETWEEN :", &minimumKey, ": AND :", &maximumKey, ":"); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 2, 0 TSRMLS_CC); + zephir_array_update_zval(&_1, &minimumKey, minimum, PH_COPY); + zephir_array_update_zval(&_1, &maximumKey, maximum, PH_COPY); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, &_0, &_1); zephir_check_call_status(); - ZEPHIR_SEPARATE(nextHiddenParam); - zephir_increment(nextHiddenParam); - zephir_update_property_this(getThis(), SL("_hiddenParamNumber"), nextHiddenParam TSRMLS_CC); + ZEPHIR_SEPARATE(&nextHiddenParam); + zephir_increment(&nextHiddenParam); + zephir_update_property_zval(this_ptr, SL("_hiddenParamNumber"), &nextHiddenParam); RETURN_THIS(); } @@ -764,64 +909,75 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, notBetweenWhere) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, inWhere) { - HashTable *_2; - HashPosition _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *values = NULL; - zval *expr_param = NULL, *values_param = NULL, *hiddenParam = NULL, *bindParams = NULL, *bindKeys = NULL, *value = NULL, *key = NULL, *queryKey = NULL, **_3, *_4, *_5; - zval *expr = NULL, *_0$$3; + zval values; + zval *expr_param = NULL, *values_param = NULL, hiddenParam, bindParams, bindKeys, value, key, queryKey, *_1, _2, _3; + zval expr, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&hiddenParam); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&bindKeys); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&queryKey); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&values); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &expr_param, &values_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } - values = values_param; + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); - if (!(zephir_fast_count_int(values TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_VSV(_0$$3, expr, " != ", expr); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, _0$$3); + if (!(zephir_fast_count_int(&values TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_VSV(&_0$$3, &expr, " != ", &expr); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, &_0$$3); zephir_check_call_status(); RETURN_THIS(); } - ZEPHIR_OBS_VAR(hiddenParam); - zephir_read_property_this(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(bindParams); - array_init(bindParams); - ZEPHIR_INIT_VAR(bindKeys); - array_init(bindKeys); - zephir_is_iterable(values, &_2, &_1, 0, 0, "phalcon/mvc/model/criteria.zep", 420); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(value, _3); - ZEPHIR_INIT_NVAR(key); - ZEPHIR_CONCAT_SV(key, "ACP", hiddenParam); - ZEPHIR_INIT_NVAR(queryKey); - ZEPHIR_CONCAT_SVS(queryKey, ":", key, ":"); - zephir_array_append(&bindKeys, queryKey, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 411); - zephir_array_update_zval(&bindParams, key, &value, PH_COPY | PH_SEPARATE); - ZEPHIR_SEPARATE(hiddenParam); - zephir_increment(hiddenParam); - } - ZEPHIR_INIT_VAR(_4); - zephir_fast_join_str(_4, SL(", "), bindKeys TSRMLS_CC); - ZEPHIR_INIT_VAR(_5); - ZEPHIR_CONCAT_VSVS(_5, expr, " IN (", _4, ")"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, _5, bindParams); + ZEPHIR_OBS_VAR(&hiddenParam); + zephir_read_property(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&bindParams); + array_init(&bindParams); + ZEPHIR_INIT_VAR(&bindKeys); + array_init(&bindKeys); + zephir_is_iterable(&values, 0, "phalcon/mvc/model/criteria.zep", 420); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&values), _1) + { + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _1); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_CONCAT_SV(&key, "ACP", &hiddenParam); + ZEPHIR_INIT_NVAR(&queryKey); + ZEPHIR_CONCAT_SVS(&queryKey, ":", &key, ":"); + zephir_array_append(&bindKeys, &queryKey, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 411); + zephir_array_update_zval(&bindParams, &key, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_SEPARATE(&hiddenParam); + zephir_increment(&hiddenParam); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_VAR(&_2); + zephir_fast_join_str(&_2, SL(", "), &bindKeys TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_VSVS(&_3, &expr, " IN (", &_2, ")"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, &_3, &bindParams); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_hiddenParamNumber"), hiddenParam TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_hiddenParamNumber"), &hiddenParam); RETURN_THIS(); } @@ -835,57 +991,67 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, inWhere) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, notInWhere) { - HashTable *_1; - HashPosition _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *values = NULL; - zval *expr_param = NULL, *values_param = NULL, *hiddenParam = NULL, *bindParams = NULL, *bindKeys = NULL, *value = NULL, *key = NULL, **_2, *_4, *_5, *_3$$3 = NULL; - zval *expr = NULL; + zval values; + zval *expr_param = NULL, *values_param = NULL, hiddenParam, bindParams, bindKeys, value, key, *_0, _2, _3, _1$$3; + zval expr; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&hiddenParam); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&bindKeys); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&values); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &expr_param, &values_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); - } - values = values_param; - - - ZEPHIR_OBS_VAR(hiddenParam); - zephir_read_property_this(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(bindParams); - array_init(bindParams); - ZEPHIR_INIT_VAR(bindKeys); - array_init(bindKeys); - zephir_is_iterable(values, &_1, &_0, 0, 0, "phalcon/mvc/model/criteria.zep", 457); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(value, _2); - ZEPHIR_INIT_NVAR(key); - ZEPHIR_CONCAT_SV(key, "ACP", hiddenParam); - ZEPHIR_INIT_LNVAR(_3$$3); - ZEPHIR_CONCAT_SVS(_3$$3, ":", key, ":"); - zephir_array_append(&bindKeys, _3$$3, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 447); - zephir_array_update_zval(&bindParams, key, &value, PH_COPY | PH_SEPARATE); - ZEPHIR_SEPARATE(hiddenParam); - zephir_increment(hiddenParam); - } - ZEPHIR_INIT_VAR(_4); - zephir_fast_join_str(_4, SL(", "), bindKeys TSRMLS_CC); - ZEPHIR_INIT_VAR(_5); - ZEPHIR_CONCAT_VSVS(_5, expr, " NOT IN (", _4, ")"); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, _5, bindParams); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); + } + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); + + + ZEPHIR_OBS_VAR(&hiddenParam); + zephir_read_property(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&bindParams); + array_init(&bindParams); + ZEPHIR_INIT_VAR(&bindKeys); + array_init(&bindKeys); + zephir_is_iterable(&values, 0, "phalcon/mvc/model/criteria.zep", 457); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&values), _0) + { + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_CONCAT_SV(&key, "ACP", &hiddenParam); + ZEPHIR_INIT_LNVAR(_1$$3); + ZEPHIR_CONCAT_SVS(&_1$$3, ":", &key, ":"); + zephir_array_append(&bindKeys, &_1$$3, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 447); + zephir_array_update_zval(&bindParams, &key, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_SEPARATE(&hiddenParam); + zephir_increment(&hiddenParam); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_VAR(&_2); + zephir_fast_join_str(&_2, SL(", "), &bindKeys TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_VSVS(&_3, &expr, " NOT IN (", &_2, ")"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "andwhere", NULL, 0, &_3, &bindParams); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_hiddenParamNumber"), hiddenParam TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_hiddenParamNumber"), &hiddenParam); RETURN_THIS(); } @@ -895,27 +1061,31 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, notInWhere) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, conditions) { - zval *conditions_param = NULL, *_0; - zval *conditions = NULL; + zval *conditions_param = NULL, _0; + zval conditions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &conditions_param); if (UNEXPECTED(Z_TYPE_P(conditions_param) != IS_STRING && Z_TYPE_P(conditions_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(conditions_param) == IS_STRING)) { - zephir_get_strval(conditions, conditions_param); + zephir_get_strval(&conditions, conditions_param); } else { - ZEPHIR_INIT_VAR(conditions); - ZVAL_EMPTY_STRING(conditions); + ZEPHIR_INIT_VAR(&conditions); + ZVAL_EMPTY_STRING(&conditions); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "conditions", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, conditions TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "conditions"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, &conditions TSRMLS_CC); RETURN_THIS(); } @@ -927,27 +1097,31 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, conditions) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, order) { - zval *orderColumns_param = NULL, *_0; - zval *orderColumns = NULL; + zval *orderColumns_param = NULL, _0; + zval orderColumns; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&orderColumns); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &orderColumns_param); if (UNEXPECTED(Z_TYPE_P(orderColumns_param) != IS_STRING && Z_TYPE_P(orderColumns_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'orderColumns' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'orderColumns' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(orderColumns_param) == IS_STRING)) { - zephir_get_strval(orderColumns, orderColumns_param); + zephir_get_strval(&orderColumns, orderColumns_param); } else { - ZEPHIR_INIT_VAR(orderColumns); - ZVAL_EMPTY_STRING(orderColumns); + ZEPHIR_INIT_VAR(&orderColumns); + ZVAL_EMPTY_STRING(&orderColumns); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "order", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, orderColumns TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "order"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, &orderColumns TSRMLS_CC); RETURN_THIS(); } @@ -957,27 +1131,31 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, order) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, orderBy) { - zval *orderColumns_param = NULL, *_0; - zval *orderColumns = NULL; + zval *orderColumns_param = NULL, _0; + zval orderColumns; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&orderColumns); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &orderColumns_param); if (UNEXPECTED(Z_TYPE_P(orderColumns_param) != IS_STRING && Z_TYPE_P(orderColumns_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'orderColumns' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'orderColumns' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(orderColumns_param) == IS_STRING)) { - zephir_get_strval(orderColumns, orderColumns_param); + zephir_get_strval(&orderColumns, orderColumns_param); } else { - ZEPHIR_INIT_VAR(orderColumns); - ZVAL_EMPTY_STRING(orderColumns); + ZEPHIR_INIT_VAR(&orderColumns); + ZVAL_EMPTY_STRING(&orderColumns); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "order", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, orderColumns TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "order"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, &orderColumns TSRMLS_CC); RETURN_THIS(); } @@ -987,16 +1165,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, orderBy) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, groupBy) { - zval *group, *_0; + zval *group, group_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&group_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &group); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "group", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, group TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "group"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, group TSRMLS_CC); RETURN_THIS(); } @@ -1006,16 +1188,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, groupBy) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, having) { - zval *having, *_0; + zval *having, having_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&having_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &having); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "having", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, having TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "having"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, having TSRMLS_CC); RETURN_THIS(); } @@ -1031,49 +1217,59 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, having) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, limit) { - zval *_3$$4; - zval *limit_param = NULL, *offset = NULL, _0, *_1 = NULL, _2$$4, *_4$$4 = NULL, *_5$$5, *_6$$5; + zval _3$$4; + zval *limit_param = NULL, *offset = NULL, offset_sub, __$null, _0, _1, _2$$4, _4$$4, _5$$5, _6$$5; zend_long limit, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&offset_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &limit_param, &offset); limit = zephir_get_intval(limit_param); if (!offset) { - ZEPHIR_CPY_WRT(offset, ZEPHIR_GLOBAL(global_null)); + offset = &offset_sub; + ZEPHIR_CPY_WRT(offset, &__$null); } else { ZEPHIR_SEPARATE_PARAM(offset); } - ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, limit); - ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 213, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 189, &_0); zephir_check_call_status(); - limit = zephir_get_numberval(_1); + limit = zephir_get_numberval(&_1); if (UNEXPECTED(limit == 0)) { RETURN_THIS(); } if (zephir_is_numeric(offset)) { - ZEPHIR_SINIT_VAR(_2$$4); ZVAL_LONG(&_2$$4, zephir_get_intval(offset)); - ZEPHIR_CALL_FUNCTION(&offset, "abs", NULL, 213, &_2$$4); + ZEPHIR_CALL_FUNCTION(offset, "abs", NULL, 189, &_2$$4); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3$$4); - zephir_create_array(_3$$4, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_4$$4); - ZVAL_LONG(_4$$4, limit); + ZEPHIR_INIT_VAR(&_3$$4); + zephir_create_array(&_3$$4, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$4); + ZVAL_LONG(&_4$$4, limit); zephir_array_update_string(&_3$$4, SL("number"), &_4$$4, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_3$$4, SL("offset"), &offset, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_4$$4); - ZVAL_STRING(_4$$4, "limit", 1); - zephir_update_property_array(this_ptr, SL("_params"), _4$$4, _3$$4 TSRMLS_CC); + zephir_array_update_string(&_3$$4, SL("offset"), offset, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_4$$4); + ZVAL_STRING(&_4$$4, "limit"); + zephir_update_property_array(this_ptr, SL("_params"), &_4$$4, &_3$$4 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_5$$5); - ZVAL_STRING(_5$$5, "limit", 1); - ZEPHIR_INIT_VAR(_6$$5); - ZVAL_LONG(_6$$5, limit); - zephir_update_property_array(this_ptr, SL("_params"), _5$$5, _6$$5 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$5); + ZVAL_STRING(&_5$$5, "limit"); + ZEPHIR_INIT_VAR(&_6$$5); + ZVAL_LONG(&_6$$5, limit); + zephir_update_property_array(this_ptr, SL("_params"), &_5$$5, &_6$$5 TSRMLS_CC); } RETURN_THIS(); @@ -1084,8 +1280,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, limit) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, forUpdate) { - zval *forUpdate_param = NULL, *_0, *_1; + zval *forUpdate_param = NULL, _0, _1; zend_bool forUpdate; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &forUpdate_param); @@ -1097,11 +1297,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, forUpdate) { } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "for_update", 1); - ZEPHIR_INIT_VAR(_1); - ZVAL_BOOL(_1, forUpdate); - zephir_update_property_array(this_ptr, SL("_params"), _0, _1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "for_update"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_BOOL(&_1, forUpdate); + zephir_update_property_array(this_ptr, SL("_params"), &_0, &_1 TSRMLS_CC); RETURN_THIS(); } @@ -1111,8 +1311,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, forUpdate) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, sharedLock) { - zval *sharedLock_param = NULL, *_0, *_1; + zval *sharedLock_param = NULL, _0, _1; zend_bool sharedLock; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &sharedLock_param); @@ -1124,11 +1328,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, sharedLock) { } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "shared_lock", 1); - ZEPHIR_INIT_VAR(_1); - ZVAL_BOOL(_1, sharedLock); - zephir_update_property_array(this_ptr, SL("_params"), _0, _1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "shared_lock"); + ZEPHIR_INIT_VAR(&_1); + ZVAL_BOOL(&_1, sharedLock); + zephir_update_property_array(this_ptr, SL("_params"), &_0, &_1 TSRMLS_CC); RETURN_THIS(); } @@ -1139,18 +1343,22 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, sharedLock) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, cache) { - zval *cache_param = NULL, *_0; - zval *cache = NULL; + zval *cache_param = NULL, _0; + zval cache; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &cache_param); - cache = cache_param; + ZEPHIR_OBS_COPY_OR_DUP(&cache, cache_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "cache", 1); - zephir_update_property_array(this_ptr, SL("_params"), _0, cache TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "cache"); + zephir_update_property_array(this_ptr, SL("_params"), &_0, &cache TSRMLS_CC); RETURN_THIS(); } @@ -1160,12 +1368,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, cache) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getWhere) { - zval *conditions = NULL, *_0; + zval conditions, _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&conditions, _0, SS("conditions"), 1 TSRMLS_CC)) { - RETURN_CTORW(conditions); + + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&conditions, &_0, SL("conditions"), 1)) { + RETURN_CTORW(&conditions); } RETURN_NULL(); @@ -1178,12 +1390,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getWhere) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getColumns) { - zval *columns = NULL, *_0; + zval columns, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&columns, _0, SS("columns"), 1 TSRMLS_CC)) { - RETURN_CTORW(columns); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&columns, &_0, SL("columns"), 1)) { + RETURN_CTORW(&columns); } RETURN_NULL(); @@ -1194,12 +1410,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getColumns) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getConditions) { - zval *conditions = NULL, *_0; + zval conditions, _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&conditions, _0, SS("conditions"), 1 TSRMLS_CC)) { - RETURN_CTORW(conditions); + + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&conditions, &_0, SL("conditions"), 1)) { + RETURN_CTORW(&conditions); } RETURN_NULL(); @@ -1215,12 +1435,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getConditions) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getLimit) { - zval *limit = NULL, *_0; + zval limit, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&limit, _0, SS("limit"), 1 TSRMLS_CC)) { - RETURN_CTORW(limit); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&limit, &_0, SL("limit"), 1)) { + RETURN_CTORW(&limit); } RETURN_NULL(); @@ -1231,12 +1455,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getLimit) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getOrderBy) { - zval *order = NULL, *_0; + zval order, _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&order); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&order, _0, SS("order"), 1 TSRMLS_CC)) { - RETURN_CTORW(order); + + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&order, &_0, SL("order"), 1)) { + RETURN_CTORW(&order); } RETURN_NULL(); @@ -1247,12 +1475,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getOrderBy) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getGroupBy) { - zval *group = NULL, *_0; + zval group, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&group); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&group, _0, SS("group"), 1 TSRMLS_CC)) { - RETURN_CTORW(group); + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&group, &_0, SL("group"), 1)) { + RETURN_CTORW(&group); } RETURN_NULL(); @@ -1263,12 +1495,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getGroupBy) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getHaving) { - zval *having = NULL, *_0; + zval having, _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&having); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (zephir_array_isset_string_fetch(&having, _0, SS("having"), 1 TSRMLS_CC)) { - RETURN_CTORW(having); + + zephir_read_property(&_0, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_string_fetch(&having, &_0, SL("having"), 1)) { + RETURN_CTORW(&having); } RETURN_NULL(); @@ -1281,7 +1517,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getHaving) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getParams) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_params"); @@ -1292,130 +1529,159 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, getParams) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, fromInput) { - zend_bool _6$$4, _7$$7; - HashTable *_4$$3; - HashPosition _3$$3; + zend_bool _7$$4, _8$$7; + zend_string *_6$$3; + zend_ulong _5$$3; zend_class_entry *_2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data = NULL; - zval *modelName = NULL, *operator = NULL, *_12$$10; - zval *dependencyInjector, *modelName_param = NULL, *data_param = NULL, *operator_param = NULL, *attribute = NULL, *conditions = NULL, *field = NULL, *value = NULL, *type = NULL, *metaData = NULL, *model = NULL, *dataTypes = NULL, *bind = NULL, *criteria = NULL, *columnMap = NULL, *_0$$3 = NULL, *_1$$3 = NULL, **_5$$3, *_8$$9 = NULL, *_9$$9 = NULL, *_10$$8 = NULL, *_11$$10; + zval data; + zval modelName, operator, _13$$10; + zval *dependencyInjector, dependencyInjector_sub, *modelName_param = NULL, *data_param = NULL, *operator_param = NULL, attribute, conditions, field, value, type, metaData, model, dataTypes, bind, criteria, columnMap, _0$$3, _1$$3, _3$$3, *_4$$3, _9$$9, _10$$9, _11$$8, _12$$10; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&dataTypes); + ZVAL_UNDEF(&bind); + ZVAL_UNDEF(&criteria); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_10$$9); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_12$$10); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&_13$$10); + ZVAL_UNDEF(&data); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &dependencyInjector, &modelName_param, &data_param, &operator_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } - data = data_param; + ZEPHIR_OBS_COPY_OR_DUP(&data, data_param); if (!operator_param) { - ZEPHIR_INIT_VAR(operator); - ZVAL_STRING(operator, "AND", 1); + ZEPHIR_INIT_VAR(&operator); + ZVAL_STRING(&operator, "AND"); } else { if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } } - ZEPHIR_INIT_VAR(conditions); - array_init(conditions); - if (zephir_fast_count_int(data TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_STRING(_0$$3, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&metaData, dependencyInjector, "getshared", NULL, 0, _0$$3); - zephir_check_temp_parameter(_0$$3); + ZEPHIR_INIT_VAR(&conditions); + array_init(&conditions); + if (zephir_fast_count_int(&data TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "modelsMetadata"); + ZEPHIR_CALL_METHOD(&metaData, dependencyInjector, "getshared", NULL, 0, &_0$$3); zephir_check_call_status(); - ZEPHIR_INIT_VAR(model); - zephir_fetch_safe_class(_1$$3, modelName); - _2$$3 = zend_fetch_class(Z_STRVAL_P(_1$$3), Z_STRLEN_P(_1$$3), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(model, _2$$3); - if (zephir_has_constructor(model TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_0$$3); - ZVAL_NULL(_0$$3); - ZEPHIR_CALL_METHOD(NULL, model, "__construct", NULL, 0, _0$$3, dependencyInjector); + ZEPHIR_INIT_VAR(&model); + zephir_fetch_safe_class(&_1$$3, &modelName); + _2$$3 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_1$$3), Z_STRLEN_P(&_1$$3), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&model, _2$$3); + if (zephir_has_constructor(&model TSRMLS_CC)) { + ZVAL_NULL(&_3$$3); + ZEPHIR_CALL_METHOD(NULL, &model, "__construct", NULL, 0, &_3$$3, dependencyInjector); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&dataTypes, metaData, "getdatatypes", NULL, 0, model); + ZEPHIR_CALL_METHOD(&dataTypes, &metaData, "getdatatypes", NULL, 0, &model); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getreversecolumnmap", NULL, 0, model); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getreversecolumnmap", NULL, 0, &model); zephir_check_call_status(); - ZEPHIR_INIT_VAR(bind); - array_init(bind); - zephir_is_iterable(data, &_4$$3, &_3$$3, 0, 0, "phalcon/mvc/model/criteria.zep", 713); - for ( - ; zend_hash_get_current_data_ex(_4$$3, (void**) &_5$$3, &_3$$3) == SUCCESS - ; zend_hash_move_forward_ex(_4$$3, &_3$$3) - ) { - ZEPHIR_GET_HMKEY(field, _4$$3, _3$$3); - ZEPHIR_GET_HVALUE(value, _5$$3); - _6$$4 = Z_TYPE_P(columnMap) == IS_ARRAY; - if (_6$$4) { - _6$$4 = ((zephir_fast_count_int(columnMap TSRMLS_CC)) ? 1 : 0); + ZEPHIR_INIT_VAR(&bind); + array_init(&bind); + zephir_is_iterable(&data, 0, "phalcon/mvc/model/criteria.zep", 713); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&data), _5$$3, _6$$3, _4$$3) + { + ZEPHIR_INIT_NVAR(&field); + if (_6$$3 != NULL) { + ZVAL_STR_COPY(&field, _6$$3); + } else { + ZVAL_LONG(&field, _5$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _4$$3); + _7$$4 = Z_TYPE_P(&columnMap) == IS_ARRAY; + if (_7$$4) { + _7$$4 = ((zephir_fast_count_int(&columnMap TSRMLS_CC)) ? 1 : 0); } - if (_6$$4) { - ZEPHIR_OBS_NVAR(attribute); - zephir_array_fetch(&attribute, columnMap, field, PH_NOISY, "phalcon/mvc/model/criteria.zep", 690 TSRMLS_CC); + if (_7$$4) { + ZEPHIR_OBS_NVAR(&attribute); + zephir_array_fetch(&attribute, &columnMap, &field, PH_NOISY, "phalcon/mvc/model/criteria.zep", 690 TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(attribute, field); + ZEPHIR_CPY_WRT(&attribute, &field); } - ZEPHIR_OBS_NVAR(type); - if (zephir_array_isset_fetch(&type, dataTypes, attribute, 0 TSRMLS_CC)) { - _7$$7 = Z_TYPE_P(value) != IS_NULL; - if (_7$$7) { - _7$$7 = !ZEPHIR_IS_STRING_IDENTICAL(value, ""); + ZEPHIR_OBS_NVAR(&type); + if (zephir_array_isset_fetch(&type, &dataTypes, &attribute, 0 TSRMLS_CC)) { + _8$$7 = Z_TYPE_P(&value) != IS_NULL; + if (_8$$7) { + _8$$7 = !ZEPHIR_IS_STRING_IDENTICAL(&value, ""); } - if (_7$$7) { - if (ZEPHIR_IS_LONG(type, 2)) { - ZEPHIR_INIT_LNVAR(_8$$9); - ZEPHIR_CONCAT_SVSVS(_8$$9, "[", field, "] LIKE :", field, ":"); - zephir_array_append(&conditions, _8$$9, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 702); + if (_8$$7) { + if (ZEPHIR_IS_LONG(&type, 2)) { ZEPHIR_INIT_LNVAR(_9$$9); - ZEPHIR_CONCAT_SVS(_9$$9, "%", value, "%"); - zephir_array_update_zval(&bind, field, &_9$$9, PH_COPY | PH_SEPARATE); + ZEPHIR_CONCAT_SVSVS(&_9$$9, "[", &field, "] LIKE :", &field, ":"); + zephir_array_append(&conditions, &_9$$9, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 702); + ZEPHIR_INIT_LNVAR(_10$$9); + ZEPHIR_CONCAT_SVS(&_10$$9, "%", &value, "%"); + zephir_array_update_zval(&bind, &field, &_10$$9, PH_COPY | PH_SEPARATE); continue; } - ZEPHIR_INIT_LNVAR(_10$$8); - ZEPHIR_CONCAT_SVSVS(_10$$8, "[", field, "] = :", field, ":"); - zephir_array_append(&conditions, _10$$8, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 709); - zephir_array_update_zval(&bind, field, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_LNVAR(_11$$8); + ZEPHIR_CONCAT_SVSVS(&_11$$8, "[", &field, "] = :", &field, ":"); + zephir_array_append(&conditions, &_11$$8, PH_SEPARATE, "phalcon/mvc/model/criteria.zep", 709); + zephir_array_update_zval(&bind, &field, &value, PH_COPY | PH_SEPARATE); } } - } - } - ZEPHIR_INIT_VAR(criteria); - object_init_ex(criteria, phalcon_mvc_model_criteria_ce); - if (zephir_has_constructor(criteria TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, criteria, "__construct", NULL, 0); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&field); + } + ZEPHIR_INIT_VAR(&criteria); + object_init_ex(&criteria, phalcon_mvc_model_criteria_ce); + if (zephir_has_constructor(&criteria TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &criteria, "__construct", NULL, 0); zephir_check_call_status(); } - if (zephir_fast_count_int(conditions TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_11$$10); - ZEPHIR_INIT_VAR(_12$$10); - ZEPHIR_CONCAT_SVS(_12$$10, " ", operator, " "); - zephir_fast_join(_11$$10, _12$$10, conditions TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, criteria, "where", NULL, 344, _11$$10); + if (zephir_fast_count_int(&conditions TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_12$$10); + ZEPHIR_INIT_VAR(&_13$$10); + ZEPHIR_CONCAT_SVS(&_13$$10, " ", &operator, " "); + zephir_fast_join(&_12$$10, &_13$$10, &conditions TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &criteria, "where", NULL, 304, &_12$$10); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, criteria, "bind", NULL, 345, bind); + ZEPHIR_CALL_METHOD(NULL, &criteria, "bind", NULL, 305, &bind); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, criteria, "setmodelname", NULL, 333, modelName); + ZEPHIR_CALL_METHOD(NULL, &criteria, "setmodelname", NULL, 293, &modelName); zephir_check_call_status(); - RETURN_CCTOR(criteria); + RETURN_CCTOR(&criteria); } @@ -1431,33 +1697,41 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, fromInput) { */ PHP_METHOD(Phalcon_Mvc_Model_Criteria, createBuilder) { - zval *dependencyInjector = NULL, *manager = NULL, *builder = NULL, *_1 = NULL, *_2, *_3, *_4; + zval dependencyInjector, manager, builder, _1, _2, _3, _4; zephir_fcall_cache_entry *_0 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&builder); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&dependencyInjector, this_ptr, "getdi", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdi", NULL, 0, dependencyInjector); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdi", NULL, 0, &dependencyInjector); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "modelsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "getshared", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "modelsManager"); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "getshared", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_CPY_WRT(manager, _1); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&builder, manager, "createbuilder", NULL, 0, _3); + ZEPHIR_CPY_WRT(&manager, &_1); + zephir_read_property(&_3, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&builder, &manager, "createbuilder", NULL, 0, &_3); zephir_check_call_status(); - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_model"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, builder, "from", NULL, 0, _4); + zephir_read_property(&_4, this_ptr, SL("_model"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &builder, "from", NULL, 0, &_4); zephir_check_call_status(); - RETURN_CCTOR(builder); + RETURN_CCTOR(&builder); } @@ -1467,21 +1741,25 @@ PHP_METHOD(Phalcon_Mvc_Model_Criteria, createBuilder) { PHP_METHOD(Phalcon_Mvc_Model_Criteria, execute) { zend_class_entry *_1; - zval *model = NULL, *_0 = NULL; + zval model, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&model, this_ptr, "getmodelname", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(model) != IS_STRING) { + if (Z_TYPE_P(&model) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Model name must be string", "phalcon/mvc/model/criteria.zep", 767); return; } ZEPHIR_CALL_METHOD(&_0, this_ptr, "getparams", NULL, 0); zephir_check_call_status(); - _1 = zephir_fetch_class(model TSRMLS_CC); - ZEPHIR_RETURN_CALL_CE_STATIC(_1, "find", NULL, 0, _0); + _1 = zephir_fetch_class(&model TSRMLS_CC); + ZEPHIR_RETURN_CALL_CE_STATIC(_1, "find", NULL, 0, &_0); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/mvc/model/criteria.zep.h b/ext/phalcon/mvc/model/criteria.zep.h index 16d4737a876..76fb8aff344 100644 --- a/ext/phalcon/mvc/model/criteria.zep.h +++ b/ext/phalcon/mvc/model/criteria.zep.h @@ -48,147 +48,406 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_setmodelname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_getdi, 0, 0, Phalcon\\DiInterface, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_setmodelname, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_setmodelname, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_bind, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getmodelname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getmodelname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_bind, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_bind, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, bindParams, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_bindtypes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_bindtypes, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_bindtypes, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, bindTypes, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_distinct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_distinct, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_distinct, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif ZEND_ARG_INFO(0, distinct) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_columns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_columns, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_columns, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif ZEND_ARG_INFO(0, columns) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_join, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_join, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_join, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_innerjoin, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_innerjoin, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_innerjoin, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_leftjoin, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_leftjoin, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_leftjoin, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_rightjoin, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_rightjoin, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_rightjoin, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_where, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_where, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_where, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_addwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_addwhere, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_addwhere, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_andwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_andwhere, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_andwhere, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_orwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_orwhere, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_orwhere, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_betweenwhere, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_betweenwhere, 0, 3, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_betweenwhere, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_notbetweenwhere, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_notbetweenwhere, 0, 3, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_notbetweenwhere, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_inwhere, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_inwhere, 0, 2, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_inwhere, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_notinwhere, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_notinwhere, 0, 2, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_notinwhere, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_conditions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_conditions, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_conditions, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_order, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_order, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_order, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, orderColumns, IS_STRING, 0) +#else ZEND_ARG_INFO(0, orderColumns) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_orderby, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_orderby, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_orderby, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, orderColumns, IS_STRING, 0) +#else ZEND_ARG_INFO(0, orderColumns) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_groupby, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_groupby, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_groupby, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif ZEND_ARG_INFO(0, group) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_having, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_having, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_having, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif ZEND_ARG_INFO(0, having) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_limit, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_limit, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_limit, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, limit, IS_LONG, 0) +#else ZEND_ARG_INFO(0, limit) +#endif ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_forupdate, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_forupdate, 0, 0, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_forupdate, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, forUpdate, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, forUpdate) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_sharedlock, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_sharedlock, 0, 0, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_sharedlock, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sharedLock, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, sharedLock) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_cache, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_cache, 0, 1, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_cache, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif ZEND_ARG_ARRAY_INFO(0, cache, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteria_frominput, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getwhere, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getwhere, 0, 0, IS_STRING, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getcolumns, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getcolumns, 0, 0, IS_STRING, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getconditions, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getconditions, 0, 0, IS_STRING, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getlimit, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getlimit, 0, 0, IS_STRING, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getorderby, 0, 0, IS_STRING, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_getorderby, 0, 0, IS_STRING, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_frominput, 0, 3, Phalcon\\Mvc\\Model\\Criteria, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_frominput, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Criteria", 0) +#endif ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_ARG_ARRAY_INFO(0, data, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_createbuilder, 0, 0, Phalcon\\Mvc\\Model\\Query\\BuilderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_createbuilder, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\BuilderInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteria_execute, 0, 0, Phalcon\\Mvc\\Model\\ResultsetInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteria_execute, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\ResultsetInterface", 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_criteria_method_entry) { PHP_ME(Phalcon_Mvc_Model_Criteria, setDI, arginfo_phalcon_mvc_model_criteria_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Criteria, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Criteria, getDI, arginfo_phalcon_mvc_model_criteria_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, setModelName, arginfo_phalcon_mvc_model_criteria_setmodelname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Criteria, getModelName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Criteria, getModelName, arginfo_phalcon_mvc_model_criteria_getmodelname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, bind, arginfo_phalcon_mvc_model_criteria_bind, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, bindTypes, arginfo_phalcon_mvc_model_criteria_bindtypes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, distinct, arginfo_phalcon_mvc_model_criteria_distinct, ZEND_ACC_PUBLIC) @@ -214,16 +473,16 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_criteria_method_entry) { PHP_ME(Phalcon_Mvc_Model_Criteria, forUpdate, arginfo_phalcon_mvc_model_criteria_forupdate, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, sharedLock, arginfo_phalcon_mvc_model_criteria_sharedlock, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, cache, arginfo_phalcon_mvc_model_criteria_cache, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Criteria, getWhere, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Criteria, getColumns, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Criteria, getConditions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Criteria, getLimit, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Criteria, getOrderBy, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Criteria, getWhere, arginfo_phalcon_mvc_model_criteria_getwhere, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Criteria, getColumns, arginfo_phalcon_mvc_model_criteria_getcolumns, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Criteria, getConditions, arginfo_phalcon_mvc_model_criteria_getconditions, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Criteria, getLimit, arginfo_phalcon_mvc_model_criteria_getlimit, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Criteria, getOrderBy, arginfo_phalcon_mvc_model_criteria_getorderby, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, getGroupBy, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, getHaving, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, getParams, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Criteria, fromInput, arginfo_phalcon_mvc_model_criteria_frominput, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Mvc_Model_Criteria, createBuilder, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Criteria, execute, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Criteria, createBuilder, arginfo_phalcon_mvc_model_criteria_createbuilder, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Criteria, execute, arginfo_phalcon_mvc_model_criteria_execute, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/criteriainterface.zep.h b/ext/phalcon/mvc/model/criteriainterface.zep.h index d659551d503..c8a2cd97f79 100644 --- a/ext/phalcon/mvc/model/criteriainterface.zep.h +++ b/ext/phalcon/mvc/model/criteriainterface.zep.h @@ -3,83 +3,213 @@ extern zend_class_entry *phalcon_mvc_model_criteriainterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_CriteriaInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_setmodelname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_setmodelname, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_setmodelname, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_bind, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_getmodelname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_getmodelname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_bind, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_bind, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, bindParams, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_bindtypes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_bindtypes, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_bindtypes, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, bindTypes, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_where, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_where, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_where, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_conditions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_conditions, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_conditions, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_orderby, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_orderby, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_orderby, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, orderColumns, IS_STRING, 0) +#else ZEND_ARG_INFO(0, orderColumns) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_limit, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_limit, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_limit, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, limit, IS_LONG, 0) +#else ZEND_ARG_INFO(0, limit) +#endif ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_forupdate, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_forupdate, 0, 0, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_forupdate, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, forUpdate, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, forUpdate) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_sharedlock, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_sharedlock, 0, 0, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_sharedlock, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sharedLock, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, sharedLock) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_andwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_andwhere, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_andwhere, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_orwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_orwhere, 0, 1, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_orwhere, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_betweenwhere, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_betweenwhere, 0, 3, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_betweenwhere, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_notbetweenwhere, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_notbetweenwhere, 0, 3, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_notbetweenwhere, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_inwhere, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_inwhere, 0, 2, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_inwhere, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_notinwhere, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_notinwhere, 0, 2, Phalcon\\Mvc\\Model\\CriteriaInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_notinwhere, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\CriteriaInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_execute, 0, 0, Phalcon\\Mvc\\Model\\ResultsetInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_criteriainterface_execute, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\ResultsetInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_criteriainterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, setModelName, arginfo_phalcon_mvc_model_criteriainterface_setmodelname) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, getModelName, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, getModelName, arginfo_phalcon_mvc_model_criteriainterface_getmodelname) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, bind, arginfo_phalcon_mvc_model_criteriainterface_bind) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, bindTypes, arginfo_phalcon_mvc_model_criteriainterface_bindtypes) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, where, arginfo_phalcon_mvc_model_criteriainterface_where) @@ -99,6 +229,6 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_criteriainterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, getLimit, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, getOrderBy, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, getParams, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, execute, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_CriteriaInterface, execute, arginfo_phalcon_mvc_model_criteriainterface_execute) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/manager.zep.c b/ext/phalcon/mvc/model/manager.zep.c index a4a8d2a80d7..0754f3ef0ad 100644 --- a/ext/phalcon/mvc/model/manager.zep.c +++ b/ext/phalcon/mvc/model/manager.zep.c @@ -160,13 +160,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Manager) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -175,7 +178,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setDI) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -186,13 +190,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getDI) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, setEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); RETURN_THISW(); } @@ -202,7 +209,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -213,16 +221,21 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, setCustomEventsManager) { - zval *model, *eventsManager, *_0; + zval *model, model_sub, *eventsManager, eventsManager_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&eventsManager_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &eventsManager); - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 1 TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_customEventsManager"), _0, eventsManager TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 1 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_customEventsManager"), &_0, eventsManager TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -232,20 +245,26 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setCustomEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getCustomEventsManager) { - zval *model, *eventsManager = NULL, *_0, *_1; + zval *model, model_sub, eventsManager, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_customEventsManager"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_get_class(_1, model, 1 TSRMLS_CC); - if (!(zephir_array_isset_fetch(&eventsManager, _0, _1, 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_customEventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_get_class(&_1, model, 1 TSRMLS_CC); + if (!(zephir_array_isset_fetch(&eventsManager, &_0, &_1, 1 TSRMLS_CC))) { RETURN_MM_BOOL(0); } - RETURN_CTOR(eventsManager); + RETURN_CTOR(&eventsManager); } @@ -255,32 +274,39 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getCustomEventsManager) { PHP_METHOD(Phalcon_Mvc_Model_Manager, initialize) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *className = NULL, *eventsManager = NULL, *_0, *_1, *_2$$5; + zval *model, model_sub, className, eventsManager, _0, _1, _2$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, model, 1 TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (zephir_array_isset(_0, className)) { + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, model, 1 TSRMLS_CC); + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_0, &className)) { RETURN_MM_BOOL(0); } - zephir_update_property_array(this_ptr, SL("_initialized"), className, model TSRMLS_CC); - if ((zephir_method_exists_ex(model, SS("initialize") TSRMLS_CC) == SUCCESS)) { + zephir_update_property_array(this_ptr, SL("_initialized"), &className, model TSRMLS_CC); + if ((zephir_method_exists_ex(model, SL("initialize") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, model, "initialize", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_lastInitialized"), model TSRMLS_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _1); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_2$$5); - ZVAL_STRING(_2$$5, "modelsManager:afterInitialize", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _2$$5, this_ptr, model); - zephir_check_temp_parameter(_2$$5); + zephir_update_property_zval(this_ptr, SL("_lastInitialized"), model); + zephir_read_property(&_1, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_1); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_2$$5); + ZVAL_STRING(&_2$$5, "modelsManager:afterInitialize"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_2$$5, this_ptr, model); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -292,28 +318,33 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, initialize) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, isInitialized) { - zval *modelName_param = NULL, *_0, *_1; - zval *modelName = NULL; + zval *modelName_param = NULL, _0, _1; + zval modelName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &modelName_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_fast_strtolower(_1, modelName); - RETURN_MM_BOOL(zephir_array_isset(_0, _1)); + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_fast_strtolower(&_1, &modelName); + RETURN_MM_BOOL(zephir_array_isset(&_0, &_1)); } @@ -322,7 +353,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, isInitialized) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getLastInitialized) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lastInitialized"); @@ -336,21 +368,40 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, load) { zend_class_entry *_9; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool newInstance; - zval *modelName_param = NULL, *newInstance_param = NULL, *model = NULL, *colonPos = NULL, *namespaceName = NULL, *namespaceAlias = NULL, *className = NULL, _0, *_8 = NULL, *_10, *_11, _1$$3, _2$$3, *_3$$3, *_4$$4, *_6$$5, *_7$$5; - zval *modelName = NULL, *_5$$4; + zval *modelName_param = NULL, *newInstance_param = NULL, model, colonPos, namespaceName, namespaceAlias, className, _0, _8, _10, _11, _1$$3, _2$$3, _3$$3, _4$$4, _6$$5, _7$$5; + zval modelName, _5$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&colonPos); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&namespaceAlias); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &modelName_param, &newInstance_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (!newInstance_param) { newInstance = 0; @@ -359,55 +410,52 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, load) { } - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, ":", 0); - ZEPHIR_INIT_VAR(colonPos); - zephir_fast_strpos(colonPos, modelName, &_0, 0 ); - if (!ZEPHIR_IS_FALSE_IDENTICAL(colonPos)) { - ZEPHIR_SINIT_VAR(_1$$3); - ZVAL_LONG(&_1$$3, (zephir_get_numberval(colonPos) + 1)); - ZEPHIR_INIT_VAR(className); - zephir_substr(className, modelName, zephir_get_intval(&_1$$3), 0, ZEPHIR_SUBSTR_NO_LENGTH); - ZEPHIR_SINIT_VAR(_2$$3); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, ":"); + ZEPHIR_INIT_VAR(&colonPos); + zephir_fast_strpos(&colonPos, &modelName, &_0, 0 ); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&colonPos)) { + ZVAL_LONG(&_1$$3, (zephir_get_numberval(&colonPos) + 1)); + ZEPHIR_INIT_VAR(&className); + zephir_substr(&className, &modelName, zephir_get_intval(&_1$$3), 0, ZEPHIR_SUBSTR_NO_LENGTH); ZVAL_LONG(&_2$$3, 0); - ZEPHIR_INIT_VAR(namespaceAlias); - zephir_substr(namespaceAlias, modelName, 0 , zephir_get_intval(colonPos), 0); - ZEPHIR_CALL_METHOD(&namespaceName, this_ptr, "getnamespacealias", NULL, 0, namespaceAlias); + ZEPHIR_INIT_VAR(&namespaceAlias); + zephir_substr(&namespaceAlias, &modelName, 0 , zephir_get_intval(&colonPos), 0); + ZEPHIR_CALL_METHOD(&namespaceName, this_ptr, "getnamespacealias", NULL, 0, &namespaceAlias); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_3$$3); - ZEPHIR_CONCAT_VSV(_3$$3, namespaceName, "\\", className); - zephir_get_strval(modelName, _3$$3); - } - if (!(zephir_class_exists(modelName, 1 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_4$$4); - object_init_ex(_4$$4, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_5$$4); - ZEPHIR_CONCAT_SVS(_5$$4, "Model '", modelName, "' could not be loaded"); - ZEPHIR_CALL_METHOD(NULL, _4$$4, "__construct", NULL, 9, _5$$4); + ZEPHIR_INIT_VAR(&_3$$3); + ZEPHIR_CONCAT_VSV(&_3$$3, &namespaceName, "\\", &className); + zephir_get_strval(&modelName, &_3$$3); + } + if (!(zephir_class_exists(&modelName, 1 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_4$$4); + object_init_ex(&_4$$4, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_5$$4); + ZEPHIR_CONCAT_SVS(&_5$$4, "Model '", &modelName, "' could not be loaded"); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "__construct", NULL, 4, &_5$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$4, "phalcon/mvc/model/manager.zep", 298 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$4, "phalcon/mvc/model/manager.zep", 298 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } if (!(newInstance)) { - ZEPHIR_OBS_VAR(model); - _6$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_7$$5); - zephir_fast_strtolower(_7$$5, modelName); - if (zephir_array_isset_fetch(&model, _6$$5, _7$$5, 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, model, "reset", NULL, 0); + ZEPHIR_OBS_VAR(&model); + zephir_read_property(&_6$$5, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_7$$5); + zephir_fast_strtolower(&_7$$5, &modelName); + if (zephir_array_isset_fetch(&model, &_6$$5, &_7$$5, 0 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &model, "reset", NULL, 0); zephir_check_call_status(); - RETURN_CCTOR(model); + RETURN_CCTOR(&model); } } - zephir_fetch_safe_class(_8, modelName); - _9 = zend_fetch_class(Z_STRVAL_P(_8), Z_STRLEN_P(_8), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + zephir_fetch_safe_class(&_8, &modelName); + _9 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_8), Z_STRLEN_P(&_8), ZEND_FETCH_CLASS_AUTO); object_init_ex(return_value, _9); if (zephir_has_constructor(return_value TSRMLS_CC)) { - _10 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_11); - ZVAL_NULL(_11); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, _11, _10, this_ptr); + zephir_read_property(&_10, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZVAL_NULL(&_11); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &_11, &_10, this_ptr); zephir_check_call_status(); } RETURN_MM(); @@ -434,24 +482,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, load) { PHP_METHOD(Phalcon_Mvc_Model_Manager, setModelPrefix) { zval *prefix_param = NULL; - zval *prefix = NULL; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &prefix_param); if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } else { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_EMPTY_STRING(&prefix); } - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); ZEPHIR_MM_RESTORE(); } @@ -475,7 +526,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setModelPrefix) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getModelPrefix) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_prefix"); @@ -486,27 +538,32 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getModelPrefix) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, setModelSource) { - zval *source = NULL; - zval *model, *source_param = NULL, *_0; + zval source; + zval *model, model_sub, *source_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&source); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &source_param); if (UNEXPECTED(Z_TYPE_P(source_param) != IS_STRING && Z_TYPE_P(source_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'source' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'source' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(source_param) == IS_STRING)) { - zephir_get_strval(source, source_param); + zephir_get_strval(&source, source_param); } else { - ZEPHIR_INIT_VAR(source); - ZVAL_EMPTY_STRING(source); + ZEPHIR_INIT_VAR(&source); + ZVAL_EMPTY_STRING(&source); } - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 1 TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_sources"), _0, source TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 1 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_sources"), &_0, &source TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -524,27 +581,36 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setModelSource) { PHP_METHOD(Phalcon_Mvc_Model_Manager, isVisibleModelProperty) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property = NULL; - zval *model, *property_param = NULL, *properties = NULL, *className = NULL, *_0, *_2, *_1$$3 = NULL; + zval property; + zval *model, model_sub, *property_param = NULL, properties, className, _0, _2, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&properties); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&property); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &property_param); - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, model, 0 TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelVisibility"), PH_NOISY_CC); - if (!(zephir_array_isset(_0, className))) { - ZEPHIR_CALL_FUNCTION(&_1$$3, "get_object_vars", NULL, 22, model); + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, model, 0 TSRMLS_CC); + zephir_read_property(&_0, this_ptr, SL("_modelVisibility"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_0, &className))) { + ZEPHIR_CALL_FUNCTION(&_1$$3, "get_object_vars", NULL, 17, model); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_modelVisibility"), className, _1$$3 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_modelVisibility"), &className, &_1$$3 TSRMLS_CC); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_modelVisibility"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(properties); - zephir_array_fetch(&properties, _2, className, PH_NOISY, "phalcon/mvc/model/manager.zep", 389 TSRMLS_CC); - RETURN_MM_BOOL(zephir_array_key_exists(properties, property TSRMLS_CC)); + zephir_read_property(&_2, this_ptr, SL("_modelVisibility"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_OBS_VAR(&properties); + zephir_array_fetch(&properties, &_2, &className, PH_NOISY, "phalcon/mvc/model/manager.zep", 389 TSRMLS_CC); + RETURN_MM_BOOL(zephir_array_key_exists(&properties, &property TSRMLS_CC)); } @@ -553,27 +619,37 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, isVisibleModelProperty) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getModelSource) { - zval *model, *entityName = NULL, *_0, *_3, *_4, *_5, *_1$$3, *_2$$3; + zval *model, model_sub, entityName, _0, _3, _4, _5, _1$$3, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 1 TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_sources"), PH_NOISY_CC); - if (!(zephir_array_isset(_0, entityName))) { - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_INIT_VAR(_2$$3); - zephir_get_class_ns(_2$$3, model, 0 TSRMLS_CC); - zephir_uncamelize(_1$$3, _2$$3, NULL ); - zephir_update_property_array(this_ptr, SL("_sources"), entityName, _1$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 1 TSRMLS_CC); + zephir_read_property(&_0, this_ptr, SL("_sources"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_0, &entityName))) { + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_INIT_VAR(&_2$$3); + zephir_get_class_ns(&_2$$3, model, 0 TSRMLS_CC); + zephir_uncamelize(&_1$$3, &_2$$3, NULL ); + zephir_update_property_array(this_ptr, SL("_sources"), &entityName, &_1$$3 TSRMLS_CC); } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_sources"), PH_NOISY_CC); - zephir_array_fetch(&_5, _4, entityName, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 407 TSRMLS_CC); - ZEPHIR_CONCAT_VV(return_value, _3, _5); + zephir_read_property(&_3, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_4, this_ptr, SL("_sources"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_5, &_4, &entityName, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 407 TSRMLS_CC); + ZEPHIR_CONCAT_VV(return_value, &_3, &_5); RETURN_MM(); } @@ -583,27 +659,32 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getModelSource) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, setModelSchema) { - zval *schema = NULL; - zval *model, *schema_param = NULL, *_0; + zval schema; + zval *model, model_sub, *schema_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&schema); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &schema_param); if (UNEXPECTED(Z_TYPE_P(schema_param) != IS_STRING && Z_TYPE_P(schema_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'schema' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(schema_param) == IS_STRING)) { - zephir_get_strval(schema, schema_param); + zephir_get_strval(&schema, schema_param); } else { - ZEPHIR_INIT_VAR(schema); - ZVAL_EMPTY_STRING(schema); + ZEPHIR_INIT_VAR(&schema); + ZVAL_EMPTY_STRING(&schema); } - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 1 TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_schemas"), _0, schema TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 1 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_schemas"), &_0, &schema TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -613,20 +694,26 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setModelSchema) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getModelSchema) { - zval *model, *schema = NULL, *_0, *_1; + zval *model, model_sub, schema, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_schemas"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_get_class(_1, model, 1 TSRMLS_CC); - if (!(zephir_array_isset_fetch(&schema, _0, _1, 1 TSRMLS_CC))) { - RETURN_MM_STRING("", 1); + zephir_read_property(&_0, this_ptr, SL("_schemas"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_get_class(&_1, model, 1 TSRMLS_CC); + if (!(zephir_array_isset_fetch(&schema, &_0, &_1, 1 TSRMLS_CC))) { + RETURN_MM_STRING(""); } - RETURN_CTOR(schema); + RETURN_CTOR(&schema); } @@ -636,27 +723,31 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getModelSchema) { PHP_METHOD(Phalcon_Mvc_Model_Manager, setConnectionService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *connectionService = NULL; - zval *model, *connectionService_param = NULL; + zval connectionService; + zval *model, model_sub, *connectionService_param = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&connectionService); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &connectionService_param); if (UNEXPECTED(Z_TYPE_P(connectionService_param) != IS_STRING && Z_TYPE_P(connectionService_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(connectionService_param) == IS_STRING)) { - zephir_get_strval(connectionService, connectionService_param); + zephir_get_strval(&connectionService, connectionService_param); } else { - ZEPHIR_INIT_VAR(connectionService); - ZVAL_EMPTY_STRING(connectionService); + ZEPHIR_INIT_VAR(&connectionService); + ZVAL_EMPTY_STRING(&connectionService); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setreadconnectionservice", NULL, 0, model, connectionService); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setreadconnectionservice", NULL, 0, model, &connectionService); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setwriteconnectionservice", NULL, 0, model, connectionService); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setwriteconnectionservice", NULL, 0, model, &connectionService); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -667,27 +758,32 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, setWriteConnectionService) { - zval *connectionService = NULL; - zval *model, *connectionService_param = NULL, *_0; + zval connectionService; + zval *model, model_sub, *connectionService_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&connectionService); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &connectionService_param); if (UNEXPECTED(Z_TYPE_P(connectionService_param) != IS_STRING && Z_TYPE_P(connectionService_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(connectionService_param) == IS_STRING)) { - zephir_get_strval(connectionService, connectionService_param); + zephir_get_strval(&connectionService, connectionService_param); } else { - ZEPHIR_INIT_VAR(connectionService); - ZVAL_EMPTY_STRING(connectionService); + ZEPHIR_INIT_VAR(&connectionService); + ZVAL_EMPTY_STRING(&connectionService); } - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 1 TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_writeConnectionServices"), _0, connectionService TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 1 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_writeConnectionServices"), &_0, &connectionService TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -697,27 +793,32 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setWriteConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, setReadConnectionService) { - zval *connectionService = NULL; - zval *model, *connectionService_param = NULL, *_0; + zval connectionService; + zval *model, model_sub, *connectionService_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&connectionService); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &connectionService_param); if (UNEXPECTED(Z_TYPE_P(connectionService_param) != IS_STRING && Z_TYPE_P(connectionService_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'connectionService' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(connectionService_param) == IS_STRING)) { - zephir_get_strval(connectionService, connectionService_param); + zephir_get_strval(&connectionService, connectionService_param); } else { - ZEPHIR_INIT_VAR(connectionService); - ZVAL_EMPTY_STRING(connectionService); + ZEPHIR_INIT_VAR(&connectionService); + ZVAL_EMPTY_STRING(&connectionService); } - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 1 TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_readConnectionServices"), _0, connectionService TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 1 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_readConnectionServices"), &_0, &connectionService TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -728,15 +829,19 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setReadConnectionService) { PHP_METHOD(Phalcon_Mvc_Model_Manager, getReadConnection) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *_0; + zval *model, model_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_readConnectionServices"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getconnection", NULL, 0, model, _0); + zephir_read_property(&_0, this_ptr, SL("_readConnectionServices"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getconnection", NULL, 0, model, &_0); zephir_check_call_status(); RETURN_MM(); @@ -748,15 +853,19 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getReadConnection) { PHP_METHOD(Phalcon_Mvc_Model_Manager, getWriteConnection) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *_0; + zval *model, model_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_writeConnectionServices"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getconnection", NULL, 0, model, _0); + zephir_read_property(&_0, this_ptr, SL("_writeConnectionServices"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getconnection", NULL, 0, model, &_0); zephir_check_call_status(); RETURN_MM(); @@ -768,7 +877,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getWriteConnection) { PHP_METHOD(Phalcon_Mvc_Model_Manager, _getConnection) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *connectionServices, *dependencyInjector = NULL, *service = NULL, *connection = NULL, *_0, *_1 = NULL; + zval *model, model_sub, *connectionServices, connectionServices_sub, dependencyInjector, service, connection, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&connectionServices_sub); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&service); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &connectionServices); @@ -777,20 +895,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, _getConnection) { ZEPHIR_CALL_METHOD(&service, this_ptr, "_getconnectionservice", NULL, 0, model, connectionServices); zephir_check_call_status(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A dependency injector container is required to obtain the services related to the ORM", "phalcon/mvc/model/manager.zep", 484); return; } - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "getshared", NULL, 0, service); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "getshared", NULL, 0, &service); zephir_check_call_status(); - ZEPHIR_CPY_WRT(connection, _1); - if (Z_TYPE_P(connection) != IS_OBJECT) { + ZEPHIR_CPY_WRT(&connection, &_1); + if (Z_TYPE_P(&connection) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid injected connection service", "phalcon/mvc/model/manager.zep", 493); return; } - RETURN_CCTOR(connection); + RETURN_CCTOR(&connection); } @@ -800,15 +918,19 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, _getConnection) { PHP_METHOD(Phalcon_Mvc_Model_Manager, getReadConnectionService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *_0; + zval *model, model_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_readConnectionServices"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getconnectionservice", NULL, 0, model, _0); + zephir_read_property(&_0, this_ptr, SL("_readConnectionServices"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getconnectionservice", NULL, 0, model, &_0); zephir_check_call_status(); RETURN_MM(); @@ -820,15 +942,19 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getReadConnectionService) { PHP_METHOD(Phalcon_Mvc_Model_Manager, getWriteConnectionService) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *_0; + zval *model, model_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_writeConnectionServices"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getconnectionservice", NULL, 0, model, _0); + zephir_read_property(&_0, this_ptr, SL("_writeConnectionServices"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getconnectionservice", NULL, 0, model, &_0); zephir_check_call_status(); RETURN_MM(); @@ -840,19 +966,25 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getWriteConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, _getConnectionService) { - zval *model, *connectionServices, *connection = NULL, *_0; + zval *model, model_sub, *connectionServices, connectionServices_sub, connection, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&connectionServices_sub); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &connectionServices); - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 1 TSRMLS_CC); - if (!(zephir_array_isset_fetch(&connection, connectionServices, _0, 1 TSRMLS_CC))) { - RETURN_MM_STRING("db", 1); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 1 TSRMLS_CC); + if (!(zephir_array_isset_fetch(&connection, connectionServices, &_0, 1 TSRMLS_CC))) { + RETURN_MM_STRING("db"); } - RETURN_CTOR(connection); + RETURN_CTOR(&connection); } @@ -862,72 +994,85 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, _getConnectionService) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, notifyEvent) { - HashTable *_3$$3; - HashPosition _2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventName_param = NULL, *model, *status = NULL, *behavior = NULL, *modelsBehaviors = NULL, *eventsManager = NULL, *customEventsManager = NULL, *_0, *_1, *_6, *_7, **_4$$3; - zval *eventName = NULL, *_5$$6, *_8$$8; + zval *eventName_param = NULL, *model, model_sub, status, behavior, modelsBehaviors, eventsManager, customEventsManager, _0, _1, _4, _5, *_2$$3; + zval eventName, _3$$6, _6$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&behavior); + ZVAL_UNDEF(&modelsBehaviors); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&customEventsManager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &eventName_param, &model); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); - } - - - ZEPHIR_INIT_VAR(status); - ZVAL_NULL(status); - ZEPHIR_OBS_VAR(modelsBehaviors); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_behaviors"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_get_class(_1, model, 1 TSRMLS_CC); - if (zephir_array_isset_fetch(&modelsBehaviors, _0, _1, 0 TSRMLS_CC)) { - zephir_is_iterable(modelsBehaviors, &_3$$3, &_2$$3, 0, 0, "phalcon/mvc/model/manager.zep", 554); - for ( - ; zend_hash_get_current_data_ex(_3$$3, (void**) &_4$$3, &_2$$3) == SUCCESS - ; zend_hash_move_forward_ex(_3$$3, &_2$$3) - ) { - ZEPHIR_GET_HVALUE(behavior, _4$$3); - ZEPHIR_CALL_METHOD(&status, behavior, "notify", NULL, 0, eventName, model); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); + } + + + ZEPHIR_INIT_VAR(&status); + ZVAL_NULL(&status); + ZEPHIR_OBS_VAR(&modelsBehaviors); + zephir_read_property(&_0, this_ptr, SL("_behaviors"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_get_class(&_1, model, 1 TSRMLS_CC); + if (zephir_array_isset_fetch(&modelsBehaviors, &_0, &_1, 0 TSRMLS_CC)) { + zephir_is_iterable(&modelsBehaviors, 0, "phalcon/mvc/model/manager.zep", 554); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&modelsBehaviors), _2$$3) + { + ZEPHIR_INIT_NVAR(&behavior); + ZVAL_COPY(&behavior, _2$$3); + ZEPHIR_CALL_METHOD(&status, &behavior, "notify", NULL, 0, &eventName, model); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(status)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&status)) { RETURN_MM_BOOL(0); } - } - } - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_5$$6); - ZEPHIR_CONCAT_SV(_5$$6, "model:", eventName); - ZEPHIR_CALL_METHOD(&status, eventsManager, "fire", NULL, 0, _5$$6, model); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&behavior); + } + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_3$$6); + ZEPHIR_CONCAT_SV(&_3$$6, "model:", &eventName); + ZEPHIR_CALL_METHOD(&status, &eventsManager, "fire", NULL, 0, &_3$$6, model); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(status)) { - RETURN_CCTOR(status); + if (ZEPHIR_IS_FALSE_IDENTICAL(&status)) { + RETURN_CCTOR(&status); } } - ZEPHIR_OBS_VAR(customEventsManager); - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_customEventsManager"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_7); - zephir_get_class(_7, model, 1 TSRMLS_CC); - if (zephir_array_isset_fetch(&customEventsManager, _6, _7, 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_8$$8); - ZEPHIR_CONCAT_SV(_8$$8, "model:", eventName); - ZEPHIR_CALL_METHOD(&status, customEventsManager, "fire", NULL, 0, _8$$8, model); + ZEPHIR_OBS_VAR(&customEventsManager); + zephir_read_property(&_4, this_ptr, SL("_customEventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_5); + zephir_get_class(&_5, model, 1 TSRMLS_CC); + if (zephir_array_isset_fetch(&customEventsManager, &_4, &_5, 0 TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_6$$8); + ZEPHIR_CONCAT_SV(&_6$$8, "model:", &eventName); + ZEPHIR_CALL_METHOD(&status, &customEventsManager, "fire", NULL, 0, &_6$$8, model); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(status)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&status)) { RETURN_MM_BOOL(0); } } - RETURN_CCTOR(status); + RETURN_CCTOR(&status); } @@ -938,51 +1083,61 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, notifyEvent) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, missingMethod) { - HashTable *_3$$3; - HashPosition _2$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *eventName = NULL, *_5$$6; - zval *model, *eventName_param = NULL, *data, *modelsBehaviors = NULL, *result = NULL, *eventsManager = NULL, *behavior = NULL, *_0, *_1, **_4$$3; + zval eventName, _3$$6; + zval *model, model_sub, *eventName_param = NULL, *data, data_sub, modelsBehaviors, result, eventsManager, behavior, _0, _1, *_2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&modelsBehaviors); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&behavior); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&eventName); + ZVAL_UNDEF(&_3$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &model, &eventName_param, &data); if (UNEXPECTED(Z_TYPE_P(eventName_param) != IS_STRING && Z_TYPE_P(eventName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'eventName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(eventName_param) == IS_STRING)) { - zephir_get_strval(eventName, eventName_param); + zephir_get_strval(&eventName, eventName_param); } else { - ZEPHIR_INIT_VAR(eventName); - ZVAL_EMPTY_STRING(eventName); - } - - - ZEPHIR_OBS_VAR(modelsBehaviors); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_behaviors"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_get_class(_1, model, 1 TSRMLS_CC); - if (zephir_array_isset_fetch(&modelsBehaviors, _0, _1, 0 TSRMLS_CC)) { - zephir_is_iterable(modelsBehaviors, &_3$$3, &_2$$3, 0, 0, "phalcon/mvc/model/manager.zep", 603); - for ( - ; zend_hash_get_current_data_ex(_3$$3, (void**) &_4$$3, &_2$$3) == SUCCESS - ; zend_hash_move_forward_ex(_3$$3, &_2$$3) - ) { - ZEPHIR_GET_HVALUE(behavior, _4$$3); - ZEPHIR_CALL_METHOD(&result, behavior, "missingmethod", NULL, 0, model, eventName, data); + ZEPHIR_INIT_VAR(&eventName); + ZVAL_EMPTY_STRING(&eventName); + } + + + ZEPHIR_OBS_VAR(&modelsBehaviors); + zephir_read_property(&_0, this_ptr, SL("_behaviors"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_get_class(&_1, model, 1 TSRMLS_CC); + if (zephir_array_isset_fetch(&modelsBehaviors, &_0, &_1, 0 TSRMLS_CC)) { + zephir_is_iterable(&modelsBehaviors, 0, "phalcon/mvc/model/manager.zep", 603); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&modelsBehaviors), _2$$3) + { + ZEPHIR_INIT_NVAR(&behavior); + ZVAL_COPY(&behavior, _2$$3); + ZEPHIR_CALL_METHOD(&result, &behavior, "missingmethod", NULL, 0, model, &eventName, data); zephir_check_call_status(); - if (Z_TYPE_P(result) != IS_NULL) { - RETURN_CCTOR(result); + if (Z_TYPE_P(&result) != IS_NULL) { + RETURN_CCTOR(&result); } - } - } - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_5$$6); - ZEPHIR_CONCAT_SV(_5$$6, "model:", eventName); - ZEPHIR_RETURN_CALL_METHOD(eventsManager, "fire", NULL, 0, _5$$6, model, data); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&behavior); + } + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_3$$6); + ZEPHIR_CONCAT_SV(&_3$$6, "model:", &eventName); + ZEPHIR_RETURN_CALL_METHOD(&eventsManager, "fire", NULL, 0, &_3$$6, model, data); zephir_check_call_status(); RETURN_MM(); } @@ -995,23 +1150,30 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, missingMethod) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, addBehavior) { - zval *model, *behavior, *entityName = NULL, *modelsBehaviors = NULL, *_0; + zval *model, model_sub, *behavior, behavior_sub, entityName, modelsBehaviors, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&behavior_sub); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&modelsBehaviors); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &behavior); - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 1 TSRMLS_CC); - ZEPHIR_OBS_VAR(modelsBehaviors); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_behaviors"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&modelsBehaviors, _0, entityName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(modelsBehaviors); - array_init(modelsBehaviors); + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 1 TSRMLS_CC); + ZEPHIR_OBS_VAR(&modelsBehaviors); + zephir_read_property(&_0, this_ptr, SL("_behaviors"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&modelsBehaviors, &_0, &entityName, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&modelsBehaviors); + array_init(&modelsBehaviors); } zephir_array_append(&modelsBehaviors, behavior, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 635); - zephir_update_property_array(this_ptr, SL("_behaviors"), entityName, modelsBehaviors TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_behaviors"), &entityName, &modelsBehaviors TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -1022,7 +1184,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addBehavior) { PHP_METHOD(Phalcon_Mvc_Model_Manager, keepSnapshots) { zend_bool keepSnapshots; - zval *model, *keepSnapshots_param = NULL, *_0, *_1; + zval *model, model_sub, *keepSnapshots_param = NULL, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &keepSnapshots_param); @@ -1030,11 +1197,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, keepSnapshots) { keepSnapshots = zephir_get_boolval(keepSnapshots_param); - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 1 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_BOOL(_1, keepSnapshots); - zephir_update_property_array(this_ptr, SL("_keepSnapshots"), _0, _1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + ZVAL_BOOL(&_1, keepSnapshots); + zephir_update_property_array(this_ptr, SL("_keepSnapshots"), &_0, &_1 TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -1044,19 +1211,25 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, keepSnapshots) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, isKeepingSnapshots) { - zval *model, *keepSnapshots = NULL, *isKeeping = NULL, *_0$$3; + zval *model, model_sub, keepSnapshots, isKeeping, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&keepSnapshots); + ZVAL_UNDEF(&isKeeping); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - keepSnapshots = zephir_fetch_nproperty_this(this_ptr, SL("_keepSnapshots"), PH_NOISY_CC); - if (Z_TYPE_P(keepSnapshots) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_get_class(_0$$3, model, 1 TSRMLS_CC); - if (zephir_array_isset_fetch(&isKeeping, keepSnapshots, _0$$3, 1 TSRMLS_CC)) { - RETURN_CTOR(isKeeping); + zephir_read_property(&keepSnapshots, this_ptr, SL("_keepSnapshots"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&keepSnapshots) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_get_class(&_0$$3, model, 1 TSRMLS_CC); + if (zephir_array_isset_fetch(&isKeeping, &keepSnapshots, &_0$$3, 1 TSRMLS_CC)) { + RETURN_CTOR(&isKeeping); } } RETURN_MM_BOOL(0); @@ -1069,7 +1242,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, isKeepingSnapshots) { PHP_METHOD(Phalcon_Mvc_Model_Manager, useDynamicUpdate) { zend_bool dynamicUpdate; - zval *model, *dynamicUpdate_param = NULL, *entityName = NULL, *_0, *_1; + zval *model, model_sub, *dynamicUpdate_param = NULL, entityName, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &dynamicUpdate_param); @@ -1077,14 +1256,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, useDynamicUpdate) { dynamicUpdate = zephir_get_boolval(dynamicUpdate_param); - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 1 TSRMLS_CC); - ZEPHIR_INIT_VAR(_0); - ZVAL_BOOL(_0, dynamicUpdate); - zephir_update_property_array(this_ptr, SL("_dynamicUpdate"), entityName, _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_BOOL(_1, dynamicUpdate); - zephir_update_property_array(this_ptr, SL("_keepSnapshots"), entityName, _1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_BOOL(&_0, dynamicUpdate); + zephir_update_property_array(this_ptr, SL("_dynamicUpdate"), &entityName, &_0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + ZVAL_BOOL(&_1, dynamicUpdate); + zephir_update_property_array(this_ptr, SL("_keepSnapshots"), &entityName, &_1 TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -1094,19 +1273,25 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, useDynamicUpdate) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, isUsingDynamicUpdate) { - zval *model, *dynamicUpdate = NULL, *isUsing = NULL, *_0$$3; + zval *model, model_sub, dynamicUpdate, isUsing, _0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&dynamicUpdate); + ZVAL_UNDEF(&isUsing); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - dynamicUpdate = zephir_fetch_nproperty_this(this_ptr, SL("_dynamicUpdate"), PH_NOISY_CC); - if (Z_TYPE_P(dynamicUpdate) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_get_class(_0$$3, model, 1 TSRMLS_CC); - if (zephir_array_isset_fetch(&isUsing, dynamicUpdate, _0$$3, 1 TSRMLS_CC)) { - RETURN_CTOR(isUsing); + zephir_read_property(&dynamicUpdate, this_ptr, SL("_dynamicUpdate"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&dynamicUpdate) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_get_class(&_0$$3, model, 1 TSRMLS_CC); + if (zephir_array_isset_fetch(&isUsing, &dynamicUpdate, &_0$$3, 1 TSRMLS_CC)) { + RETURN_CTOR(&isUsing); } } RETURN_MM_BOOL(0); @@ -1126,38 +1311,58 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, isUsingDynamicUpdate) { PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *referencedModel = NULL; - zval *model, *fields, *referencedModel_param = NULL, *referencedFields, *options = NULL, *entityName = NULL, *referencedEntity = NULL, *relation = NULL, *keyRelation = NULL, *relations = NULL, *alias = NULL, *lowerAlias = NULL, *singleRelations = NULL, *_0, *_1, *_2, *_3; + zval referencedModel; + zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, relation, keyRelation, relations, alias, lowerAlias, singleRelations, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&referencedFields_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&referencedEntity); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&lowerAlias); + ZVAL_UNDEF(&singleRelations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&referencedModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referencedModel_param) == IS_STRING)) { - zephir_get_strval(referencedModel, referencedModel_param); + zephir_get_strval(&referencedModel, referencedModel_param); } else { - ZEPHIR_INIT_VAR(referencedModel); - ZVAL_EMPTY_STRING(referencedModel); + ZEPHIR_INIT_VAR(&referencedModel); + ZVAL_EMPTY_STRING(&referencedModel); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 1 TSRMLS_CC); - ZEPHIR_INIT_VAR(referencedEntity); - zephir_fast_strtolower(referencedEntity, referencedModel); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, entityName, "$", referencedEntity); - ZEPHIR_OBS_VAR(relations); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_hasOne"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&relations, _0, keyRelation, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(relations); - array_init(relations); + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&referencedEntity); + zephir_fast_strtolower(&referencedEntity, &referencedModel); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &entityName, "$", &referencedEntity); + ZEPHIR_OBS_VAR(&relations); + zephir_read_property(&_0, this_ptr, SL("_hasOne"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&relations, &_0, &keyRelation, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&relations); + array_init(&relations); } if (Z_TYPE_P(referencedFields) == IS_ARRAY) { if (zephir_fast_count_int(fields TSRMLS_CC) != zephir_fast_count_int(referencedFields TSRMLS_CC)) { @@ -1165,37 +1370,36 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) { return; } } - ZEPHIR_INIT_VAR(relation); - object_init_ex(relation, phalcon_mvc_model_relation_ce); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 1); - ZEPHIR_CALL_METHOD(NULL, relation, "__construct", NULL, 346, _1, referencedModel, fields, referencedFields, options); + ZEPHIR_INIT_VAR(&relation); + object_init_ex(&relation, phalcon_mvc_model_relation_ce); + ZVAL_LONG(&_1, 1); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 306, &_1, &referencedModel, fields, referencedFields, options); zephir_check_call_status(); - ZEPHIR_OBS_VAR(alias); - if (zephir_array_isset_string_fetch(&alias, options, SS("alias"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(alias) != IS_STRING) { + ZEPHIR_OBS_VAR(&alias); + if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (Z_TYPE_P(&alias) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/mvc/model/manager.zep", 742); return; } - ZEPHIR_INIT_VAR(lowerAlias); - zephir_fast_strtolower(lowerAlias, alias); + ZEPHIR_INIT_VAR(&lowerAlias); + zephir_fast_strtolower(&lowerAlias, &alias); } else { - ZEPHIR_CPY_WRT(lowerAlias, referencedEntity); + ZEPHIR_CPY_WRT(&lowerAlias, &referencedEntity); } - zephir_array_append(&relations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 754); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_VSV(_2, entityName, "$", lowerAlias); - zephir_update_property_array(this_ptr, SL("_aliases"), _2, relation TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_hasOne"), keyRelation, relations TSRMLS_CC); - ZEPHIR_OBS_VAR(singleRelations); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_hasOneSingle"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&singleRelations, _3, entityName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(singleRelations); - array_init(singleRelations); + zephir_array_append(&relations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 754); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_VSV(&_2, &entityName, "$", &lowerAlias); + zephir_update_property_array(this_ptr, SL("_aliases"), &_2, &relation TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_hasOne"), &keyRelation, &relations TSRMLS_CC); + ZEPHIR_OBS_VAR(&singleRelations); + zephir_read_property(&_1, this_ptr, SL("_hasOneSingle"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&singleRelations, &_1, &entityName, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&singleRelations); + array_init(&singleRelations); } - zephir_array_append(&singleRelations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 768); - zephir_update_property_array(this_ptr, SL("_hasOneSingle"), entityName, singleRelations TSRMLS_CC); - RETURN_CCTOR(relation); + zephir_array_append(&singleRelations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 768); + zephir_update_property_array(this_ptr, SL("_hasOneSingle"), &entityName, &singleRelations TSRMLS_CC); + RETURN_CCTOR(&relation); } @@ -1212,38 +1416,58 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasOne) { PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *referencedModel = NULL; - zval *model, *fields, *referencedModel_param = NULL, *referencedFields, *options = NULL, *entityName = NULL, *referencedEntity = NULL, *relation = NULL, *keyRelation = NULL, *relations = NULL, *alias = NULL, *lowerAlias = NULL, *singleRelations = NULL, *_0, *_1, *_2, *_3; + zval referencedModel; + zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, relation, keyRelation, relations, alias, lowerAlias, singleRelations, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&referencedFields_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&referencedEntity); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&lowerAlias); + ZVAL_UNDEF(&singleRelations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&referencedModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referencedModel_param) == IS_STRING)) { - zephir_get_strval(referencedModel, referencedModel_param); + zephir_get_strval(&referencedModel, referencedModel_param); } else { - ZEPHIR_INIT_VAR(referencedModel); - ZVAL_EMPTY_STRING(referencedModel); + ZEPHIR_INIT_VAR(&referencedModel); + ZVAL_EMPTY_STRING(&referencedModel); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 1 TSRMLS_CC); - ZEPHIR_INIT_VAR(referencedEntity); - zephir_fast_strtolower(referencedEntity, referencedModel); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, entityName, "$", referencedEntity); - ZEPHIR_OBS_VAR(relations); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_belongsTo"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&relations, _0, keyRelation, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(relations); - array_init(relations); + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&referencedEntity); + zephir_fast_strtolower(&referencedEntity, &referencedModel); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &entityName, "$", &referencedEntity); + ZEPHIR_OBS_VAR(&relations); + zephir_read_property(&_0, this_ptr, SL("_belongsTo"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&relations, &_0, &keyRelation, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&relations); + array_init(&relations); } if (Z_TYPE_P(referencedFields) == IS_ARRAY) { if (zephir_fast_count_int(fields TSRMLS_CC) != zephir_fast_count_int(referencedFields TSRMLS_CC)) { @@ -1251,37 +1475,36 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) { return; } } - ZEPHIR_INIT_VAR(relation); - object_init_ex(relation, phalcon_mvc_model_relation_ce); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_CALL_METHOD(NULL, relation, "__construct", NULL, 346, _1, referencedModel, fields, referencedFields, options); + ZEPHIR_INIT_VAR(&relation); + object_init_ex(&relation, phalcon_mvc_model_relation_ce); + ZVAL_LONG(&_1, 0); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 306, &_1, &referencedModel, fields, referencedFields, options); zephir_check_call_status(); - ZEPHIR_OBS_VAR(alias); - if (zephir_array_isset_string_fetch(&alias, options, SS("alias"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(alias) != IS_STRING) { + ZEPHIR_OBS_VAR(&alias); + if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (Z_TYPE_P(&alias) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/mvc/model/manager.zep", 827); return; } - ZEPHIR_INIT_VAR(lowerAlias); - zephir_fast_strtolower(lowerAlias, alias); + ZEPHIR_INIT_VAR(&lowerAlias); + zephir_fast_strtolower(&lowerAlias, &alias); } else { - ZEPHIR_CPY_WRT(lowerAlias, referencedEntity); + ZEPHIR_CPY_WRT(&lowerAlias, &referencedEntity); } - zephir_array_append(&relations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 839); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_VSV(_2, entityName, "$", lowerAlias); - zephir_update_property_array(this_ptr, SL("_aliases"), _2, relation TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_belongsTo"), keyRelation, relations TSRMLS_CC); - ZEPHIR_OBS_VAR(singleRelations); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_belongsToSingle"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&singleRelations, _3, entityName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(singleRelations); - array_init(singleRelations); + zephir_array_append(&relations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 839); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_VSV(&_2, &entityName, "$", &lowerAlias); + zephir_update_property_array(this_ptr, SL("_aliases"), &_2, &relation TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_belongsTo"), &keyRelation, &relations TSRMLS_CC); + ZEPHIR_OBS_VAR(&singleRelations); + zephir_read_property(&_1, this_ptr, SL("_belongsToSingle"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&singleRelations, &_1, &entityName, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&singleRelations); + array_init(&singleRelations); } - zephir_array_append(&singleRelations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 853); - zephir_update_property_array(this_ptr, SL("_belongsToSingle"), entityName, singleRelations TSRMLS_CC); - RETURN_CCTOR(relation); + zephir_array_append(&singleRelations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 853); + zephir_update_property_array(this_ptr, SL("_belongsToSingle"), &entityName, &singleRelations TSRMLS_CC); + RETURN_CCTOR(&relation); } @@ -1297,39 +1520,59 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addBelongsTo) { PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *referencedModel = NULL; - zval *model, *fields, *referencedModel_param = NULL, *referencedFields, *options = NULL, *entityName = NULL, *referencedEntity = NULL, *hasMany = NULL, *relation = NULL, *keyRelation = NULL, *relations = NULL, *alias = NULL, *lowerAlias = NULL, *singleRelations = NULL, *_0, *_1, *_2; + zval referencedModel; + zval *model, model_sub, *fields, fields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, hasMany, relation, keyRelation, relations, alias, lowerAlias, singleRelations, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&referencedFields_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&referencedEntity); + ZVAL_UNDEF(&hasMany); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&lowerAlias); + ZVAL_UNDEF(&singleRelations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&referencedModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &model, &fields, &referencedModel_param, &referencedFields, &options); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referencedModel_param) == IS_STRING)) { - zephir_get_strval(referencedModel, referencedModel_param); + zephir_get_strval(&referencedModel, referencedModel_param); } else { - ZEPHIR_INIT_VAR(referencedModel); - ZVAL_EMPTY_STRING(referencedModel); + ZEPHIR_INIT_VAR(&referencedModel); + ZVAL_EMPTY_STRING(&referencedModel); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 1 TSRMLS_CC); - ZEPHIR_INIT_VAR(referencedEntity); - zephir_fast_strtolower(referencedEntity, referencedModel); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, entityName, "$", referencedEntity); - ZEPHIR_OBS_VAR(hasMany); - zephir_read_property_this(&hasMany, this_ptr, SL("_hasMany"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(relations); - if (!(zephir_array_isset_fetch(&relations, hasMany, keyRelation, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(relations); - array_init(relations); + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&referencedEntity); + zephir_fast_strtolower(&referencedEntity, &referencedModel); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &entityName, "$", &referencedEntity); + ZEPHIR_OBS_VAR(&hasMany); + zephir_read_property(&hasMany, this_ptr, SL("_hasMany"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&relations); + if (!(zephir_array_isset_fetch(&relations, &hasMany, &keyRelation, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&relations); + array_init(&relations); } if (Z_TYPE_P(referencedFields) == IS_ARRAY) { if (zephir_fast_count_int(fields TSRMLS_CC) != zephir_fast_count_int(referencedFields TSRMLS_CC)) { @@ -1337,37 +1580,36 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) { return; } } - ZEPHIR_INIT_VAR(relation); - object_init_ex(relation, phalcon_mvc_model_relation_ce); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 2); - ZEPHIR_CALL_METHOD(NULL, relation, "__construct", NULL, 346, _0, referencedModel, fields, referencedFields, options); + ZEPHIR_INIT_VAR(&relation); + object_init_ex(&relation, phalcon_mvc_model_relation_ce); + ZVAL_LONG(&_0, 2); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 306, &_0, &referencedModel, fields, referencedFields, options); zephir_check_call_status(); - ZEPHIR_OBS_VAR(alias); - if (zephir_array_isset_string_fetch(&alias, options, SS("alias"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(alias) != IS_STRING) { + ZEPHIR_OBS_VAR(&alias); + if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (Z_TYPE_P(&alias) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/mvc/model/manager.zep", 912); return; } - ZEPHIR_INIT_VAR(lowerAlias); - zephir_fast_strtolower(lowerAlias, alias); + ZEPHIR_INIT_VAR(&lowerAlias); + zephir_fast_strtolower(&lowerAlias, &alias); } else { - ZEPHIR_CPY_WRT(lowerAlias, referencedEntity); + ZEPHIR_CPY_WRT(&lowerAlias, &referencedEntity); } - zephir_array_append(&relations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 924); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_VSV(_1, entityName, "$", lowerAlias); - zephir_update_property_array(this_ptr, SL("_aliases"), _1, relation TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_hasMany"), keyRelation, relations TSRMLS_CC); - ZEPHIR_OBS_VAR(singleRelations); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_hasManySingle"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&singleRelations, _2, entityName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(singleRelations); - array_init(singleRelations); + zephir_array_append(&relations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 924); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_VSV(&_1, &entityName, "$", &lowerAlias); + zephir_update_property_array(this_ptr, SL("_aliases"), &_1, &relation TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_hasMany"), &keyRelation, &relations TSRMLS_CC); + ZEPHIR_OBS_VAR(&singleRelations); + zephir_read_property(&_0, this_ptr, SL("_hasManySingle"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&singleRelations, &_0, &entityName, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&singleRelations); + array_init(&singleRelations); } - zephir_array_append(&singleRelations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 938); - zephir_update_property_array(this_ptr, SL("_hasManySingle"), entityName, singleRelations TSRMLS_CC); - RETURN_CCTOR(relation); + zephir_array_append(&singleRelations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 938); + zephir_update_property_array(this_ptr, SL("_hasManySingle"), &entityName, &singleRelations TSRMLS_CC); + RETURN_CCTOR(&relation); } @@ -1387,51 +1629,75 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasMany) { PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *intermediateModel = NULL, *referencedModel = NULL; - zval *model, *fields, *intermediateModel_param = NULL, *intermediateFields, *intermediateReferencedFields, *referencedModel_param = NULL, *referencedFields, *options = NULL, *entityName = NULL, *referencedEntity = NULL, *hasManyToMany = NULL, *relation = NULL, *keyRelation = NULL, *relations = NULL, *alias = NULL, *lowerAlias = NULL, *singleRelations = NULL, *intermediateEntity = NULL, *_0, *_1, *_2; + zval intermediateModel, referencedModel; + zval *model, model_sub, *fields, fields_sub, *intermediateModel_param = NULL, *intermediateFields, intermediateFields_sub, *intermediateReferencedFields, intermediateReferencedFields_sub, *referencedModel_param = NULL, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null, entityName, referencedEntity, hasManyToMany, relation, keyRelation, relations, alias, lowerAlias, singleRelations, intermediateEntity, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&intermediateFields_sub); + ZVAL_UNDEF(&intermediateReferencedFields_sub); + ZVAL_UNDEF(&referencedFields_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&referencedEntity); + ZVAL_UNDEF(&hasManyToMany); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&lowerAlias); + ZVAL_UNDEF(&singleRelations); + ZVAL_UNDEF(&intermediateEntity); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&intermediateModel); + ZVAL_UNDEF(&referencedModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 7, 1, &model, &fields, &intermediateModel_param, &intermediateFields, &intermediateReferencedFields, &referencedModel_param, &referencedFields, &options); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(intermediateModel_param) == IS_STRING)) { - zephir_get_strval(intermediateModel, intermediateModel_param); + zephir_get_strval(&intermediateModel, intermediateModel_param); } else { - ZEPHIR_INIT_VAR(intermediateModel); - ZVAL_EMPTY_STRING(intermediateModel); + ZEPHIR_INIT_VAR(&intermediateModel); + ZVAL_EMPTY_STRING(&intermediateModel); } if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referencedModel_param) == IS_STRING)) { - zephir_get_strval(referencedModel, referencedModel_param); + zephir_get_strval(&referencedModel, referencedModel_param); } else { - ZEPHIR_INIT_VAR(referencedModel); - ZVAL_EMPTY_STRING(referencedModel); + ZEPHIR_INIT_VAR(&referencedModel); + ZVAL_EMPTY_STRING(&referencedModel); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); - } - - - ZEPHIR_INIT_VAR(entityName); - zephir_get_class(entityName, model, 1 TSRMLS_CC); - ZEPHIR_INIT_VAR(intermediateEntity); - zephir_fast_strtolower(intermediateEntity, intermediateModel); - ZEPHIR_INIT_VAR(referencedEntity); - zephir_fast_strtolower(referencedEntity, referencedModel); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, entityName, "$", referencedEntity); - ZEPHIR_OBS_VAR(hasManyToMany); - zephir_read_property_this(&hasManyToMany, this_ptr, SL("_hasManyToMany"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(relations); - if (!(zephir_array_isset_fetch(&relations, hasManyToMany, keyRelation, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(relations); - array_init(relations); + options = &options_sub; + options = &__$null; + } + + + ZEPHIR_INIT_VAR(&entityName); + zephir_get_class(&entityName, model, 1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&intermediateEntity); + zephir_fast_strtolower(&intermediateEntity, &intermediateModel); + ZEPHIR_INIT_VAR(&referencedEntity); + zephir_fast_strtolower(&referencedEntity, &referencedModel); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &entityName, "$", &referencedEntity); + ZEPHIR_OBS_VAR(&hasManyToMany); + zephir_read_property(&hasManyToMany, this_ptr, SL("_hasManyToMany"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&relations); + if (!(zephir_array_isset_fetch(&relations, &hasManyToMany, &keyRelation, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&relations); + array_init(&relations); } if (Z_TYPE_P(intermediateFields) == IS_ARRAY) { if (zephir_fast_count_int(fields TSRMLS_CC) != zephir_fast_count_int(intermediateFields TSRMLS_CC)) { @@ -1445,39 +1711,38 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) { return; } } - ZEPHIR_INIT_VAR(relation); - object_init_ex(relation, phalcon_mvc_model_relation_ce); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 4); - ZEPHIR_CALL_METHOD(NULL, relation, "__construct", NULL, 346, _0, referencedModel, fields, referencedFields, options); + ZEPHIR_INIT_VAR(&relation); + object_init_ex(&relation, phalcon_mvc_model_relation_ce); + ZVAL_LONG(&_0, 4); + ZEPHIR_CALL_METHOD(NULL, &relation, "__construct", NULL, 306, &_0, &referencedModel, fields, referencedFields, options); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, relation, "setintermediaterelation", NULL, 347, intermediateFields, intermediateModel, intermediateReferencedFields); + ZEPHIR_CALL_METHOD(NULL, &relation, "setintermediaterelation", NULL, 307, intermediateFields, &intermediateModel, intermediateReferencedFields); zephir_check_call_status(); - ZEPHIR_OBS_VAR(alias); - if (zephir_array_isset_string_fetch(&alias, options, SS("alias"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(alias) != IS_STRING) { + ZEPHIR_OBS_VAR(&alias); + if (zephir_array_isset_string_fetch(&alias, options, SL("alias"), 0)) { + if (Z_TYPE_P(&alias) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Relation alias must be a string", "phalcon/mvc/model/manager.zep", 1016); return; } - ZEPHIR_INIT_VAR(lowerAlias); - zephir_fast_strtolower(lowerAlias, alias); + ZEPHIR_INIT_VAR(&lowerAlias); + zephir_fast_strtolower(&lowerAlias, &alias); } else { - ZEPHIR_CPY_WRT(lowerAlias, referencedEntity); + ZEPHIR_CPY_WRT(&lowerAlias, &referencedEntity); } - zephir_array_append(&relations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1026); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_VSV(_1, entityName, "$", lowerAlias); - zephir_update_property_array(this_ptr, SL("_aliases"), _1, relation TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_hasManyToMany"), keyRelation, relations TSRMLS_CC); - ZEPHIR_OBS_VAR(singleRelations); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_hasManyToManySingle"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&singleRelations, _2, entityName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(singleRelations); - array_init(singleRelations); + zephir_array_append(&relations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1026); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_VSV(&_1, &entityName, "$", &lowerAlias); + zephir_update_property_array(this_ptr, SL("_aliases"), &_1, &relation TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_hasManyToMany"), &keyRelation, &relations TSRMLS_CC); + ZEPHIR_OBS_VAR(&singleRelations); + zephir_read_property(&_0, this_ptr, SL("_hasManyToManySingle"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&singleRelations, &_0, &entityName, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&singleRelations); + array_init(&singleRelations); } - zephir_array_append(&singleRelations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1048); - zephir_update_property_array(this_ptr, SL("_hasManyToManySingle"), entityName, singleRelations TSRMLS_CC); - RETURN_CCTOR(relation); + zephir_array_append(&singleRelations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1048); + zephir_update_property_array(this_ptr, SL("_hasManyToManySingle"), &entityName, &singleRelations TSRMLS_CC); + RETURN_CCTOR(&relation); } @@ -1487,47 +1752,56 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, addHasManyToMany) { PHP_METHOD(Phalcon_Mvc_Model_Manager, existsBelongsTo) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *modelName_param = NULL, *modelRelation_param = NULL, *entityName = NULL, *keyRelation = NULL, *_0, *_1, *_2; - zval *modelName = NULL, *modelRelation = NULL; + zval *modelName_param = NULL, *modelRelation_param = NULL, entityName, keyRelation, _0, _1, _2; + zval modelName, modelRelation; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&modelRelation); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &modelName_param, &modelRelation_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (UNEXPECTED(Z_TYPE_P(modelRelation_param) != IS_STRING && Z_TYPE_P(modelRelation_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelRelation' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelRelation' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelRelation_param) == IS_STRING)) { - zephir_get_strval(modelRelation, modelRelation_param); + zephir_get_strval(&modelRelation, modelRelation_param); } else { - ZEPHIR_INIT_VAR(modelRelation); - ZVAL_EMPTY_STRING(modelRelation); + ZEPHIR_INIT_VAR(&modelRelation); + ZVAL_EMPTY_STRING(&modelRelation); } - ZEPHIR_INIT_VAR(entityName); - zephir_fast_strtolower(entityName, modelName); - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtolower(_0, modelRelation); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, entityName, "$", _0); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (!(zephir_array_isset(_1, entityName))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, modelName); + ZEPHIR_INIT_VAR(&entityName); + zephir_fast_strtolower(&entityName, &modelName); + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtolower(&_0, &modelRelation); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &entityName, "$", &_0); + zephir_read_property(&_1, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_1, &entityName))) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, &modelName); zephir_check_call_status(); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_belongsTo"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_2, keyRelation)); + zephir_read_property(&_2, this_ptr, SL("_belongsTo"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_2, &keyRelation)); } @@ -1537,47 +1811,56 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, existsBelongsTo) { PHP_METHOD(Phalcon_Mvc_Model_Manager, existsHasMany) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *modelName_param = NULL, *modelRelation_param = NULL, *entityName = NULL, *keyRelation = NULL, *_0, *_1, *_2; - zval *modelName = NULL, *modelRelation = NULL; + zval *modelName_param = NULL, *modelRelation_param = NULL, entityName, keyRelation, _0, _1, _2; + zval modelName, modelRelation; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&modelRelation); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &modelName_param, &modelRelation_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (UNEXPECTED(Z_TYPE_P(modelRelation_param) != IS_STRING && Z_TYPE_P(modelRelation_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelRelation' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelRelation' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelRelation_param) == IS_STRING)) { - zephir_get_strval(modelRelation, modelRelation_param); + zephir_get_strval(&modelRelation, modelRelation_param); } else { - ZEPHIR_INIT_VAR(modelRelation); - ZVAL_EMPTY_STRING(modelRelation); + ZEPHIR_INIT_VAR(&modelRelation); + ZVAL_EMPTY_STRING(&modelRelation); } - ZEPHIR_INIT_VAR(entityName); - zephir_fast_strtolower(entityName, modelName); - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtolower(_0, modelRelation); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, entityName, "$", _0); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (!(zephir_array_isset(_1, entityName))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, modelName); + ZEPHIR_INIT_VAR(&entityName); + zephir_fast_strtolower(&entityName, &modelName); + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtolower(&_0, &modelRelation); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &entityName, "$", &_0); + zephir_read_property(&_1, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_1, &entityName))) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, &modelName); zephir_check_call_status(); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_hasMany"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_2, keyRelation)); + zephir_read_property(&_2, this_ptr, SL("_hasMany"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_2, &keyRelation)); } @@ -1587,47 +1870,56 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, existsHasMany) { PHP_METHOD(Phalcon_Mvc_Model_Manager, existsHasOne) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *modelName_param = NULL, *modelRelation_param = NULL, *entityName = NULL, *keyRelation = NULL, *_0, *_1, *_2; - zval *modelName = NULL, *modelRelation = NULL; + zval *modelName_param = NULL, *modelRelation_param = NULL, entityName, keyRelation, _0, _1, _2; + zval modelName, modelRelation; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&modelRelation); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &modelName_param, &modelRelation_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (UNEXPECTED(Z_TYPE_P(modelRelation_param) != IS_STRING && Z_TYPE_P(modelRelation_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelRelation' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelRelation' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelRelation_param) == IS_STRING)) { - zephir_get_strval(modelRelation, modelRelation_param); + zephir_get_strval(&modelRelation, modelRelation_param); } else { - ZEPHIR_INIT_VAR(modelRelation); - ZVAL_EMPTY_STRING(modelRelation); + ZEPHIR_INIT_VAR(&modelRelation); + ZVAL_EMPTY_STRING(&modelRelation); } - ZEPHIR_INIT_VAR(entityName); - zephir_fast_strtolower(entityName, modelName); - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtolower(_0, modelRelation); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, entityName, "$", _0); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (!(zephir_array_isset(_1, entityName))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, modelName); + ZEPHIR_INIT_VAR(&entityName); + zephir_fast_strtolower(&entityName, &modelName); + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtolower(&_0, &modelRelation); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &entityName, "$", &_0); + zephir_read_property(&_1, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_1, &entityName))) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, &modelName); zephir_check_call_status(); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_hasOne"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_2, keyRelation)); + zephir_read_property(&_2, this_ptr, SL("_hasOne"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_2, &keyRelation)); } @@ -1637,47 +1929,56 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, existsHasOne) { PHP_METHOD(Phalcon_Mvc_Model_Manager, existsHasManyToMany) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *modelName_param = NULL, *modelRelation_param = NULL, *entityName = NULL, *keyRelation = NULL, *_0, *_1, *_2; - zval *modelName = NULL, *modelRelation = NULL; + zval *modelName_param = NULL, *modelRelation_param = NULL, entityName, keyRelation, _0, _1, _2; + zval modelName, modelRelation; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&modelRelation); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &modelName_param, &modelRelation_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (UNEXPECTED(Z_TYPE_P(modelRelation_param) != IS_STRING && Z_TYPE_P(modelRelation_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelRelation' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelRelation' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelRelation_param) == IS_STRING)) { - zephir_get_strval(modelRelation, modelRelation_param); + zephir_get_strval(&modelRelation, modelRelation_param); } else { - ZEPHIR_INIT_VAR(modelRelation); - ZVAL_EMPTY_STRING(modelRelation); + ZEPHIR_INIT_VAR(&modelRelation); + ZVAL_EMPTY_STRING(&modelRelation); } - ZEPHIR_INIT_VAR(entityName); - zephir_fast_strtolower(entityName, modelName); - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtolower(_0, modelRelation); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, entityName, "$", _0); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (!(zephir_array_isset(_1, entityName))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, modelName); + ZEPHIR_INIT_VAR(&entityName); + zephir_fast_strtolower(&entityName, &modelName); + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtolower(&_0, &modelRelation); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &entityName, "$", &_0); + zephir_read_property(&_1, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_1, &entityName))) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "load", NULL, 0, &modelName); zephir_check_call_status(); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_hasManyToMany"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_2, keyRelation)); + zephir_read_property(&_2, this_ptr, SL("_hasManyToMany"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_2, &keyRelation)); } @@ -1686,43 +1987,51 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, existsHasManyToMany) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationByAlias) { - zval *modelName_param = NULL, *alias_param = NULL, *relation = NULL, *_0, *_1; - zval *modelName = NULL, *alias = NULL, *_2; + zval *modelName_param = NULL, *alias_param = NULL, relation, _0, _1; + zval modelName, alias, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &modelName_param, &alias_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (UNEXPECTED(Z_TYPE_P(alias_param) != IS_STRING && Z_TYPE_P(alias_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'alias' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'alias' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(alias_param) == IS_STRING)) { - zephir_get_strval(alias, alias_param); + zephir_get_strval(&alias, alias_param); } else { - ZEPHIR_INIT_VAR(alias); - ZVAL_EMPTY_STRING(alias); + ZEPHIR_INIT_VAR(&alias); + ZVAL_EMPTY_STRING(&alias); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_aliases"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_VSV(_2, modelName, "$", alias); - zephir_fast_strtolower(_1, _2); - if (!(zephir_array_isset_fetch(&relation, _0, _1, 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_aliases"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_VSV(&_2, &modelName, "$", &alias); + zephir_fast_strtolower(&_1, &_2); + if (!(zephir_array_isset_fetch(&relation, &_0, &_1, 1 TSRMLS_CC))) { RETURN_MM_BOOL(0); } - RETURN_CTOR(relation); + RETURN_CTOR(&relation); } @@ -1731,10 +2040,26 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationByAlias) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, _mergeFindParameters) { - HashTable *_3$$4, *_9$$11; - HashPosition _2$$4, _8$$11; + zend_string *_4$$4, *_10$$11; + zend_ulong _3$$4, _9$$11; zend_bool _0, _5$$5, _11$$12, _14$$12; - zval *findParamsOne, *findParamsTwo, *key = NULL, *value = NULL, *findParams = NULL, *_1$$3, **_4$$4, *_6$$8, *_7$$8 = NULL, **_10$$11, *_12$$15, *_13$$15 = NULL, *_15$$20 = NULL, *_16$$20, *_17$$24, *_18$$24; + zval *findParamsOne, findParamsOne_sub, *findParamsTwo, findParamsTwo_sub, key, value, findParams, _1$$3, *_2$$4, _6$$8, _7$$8, *_8$$11, _12$$15, _13$$15, _15$$20, _16$$20, _17$$24, _18$$24; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&findParamsOne_sub); + ZVAL_UNDEF(&findParamsTwo_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&findParams); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_12$$15); + ZVAL_UNDEF(&_13$$15); + ZVAL_UNDEF(&_15$$20); + ZVAL_UNDEF(&_16$$20); + ZVAL_UNDEF(&_17$$24); + ZVAL_UNDEF(&_18$$24); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &findParamsOne, &findParamsTwo); @@ -1747,102 +2072,114 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, _mergeFindParameters) { } if (_0) { zephir_create_array(return_value, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_CONCAT_SVSVS(_1$$3, "(", findParamsOne, ") AND (", findParamsTwo, ")"); - zephir_array_fast_append(return_value, _1$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_CONCAT_SVSVS(&_1$$3, "(", findParamsOne, ") AND (", findParamsTwo, ")"); + zephir_array_fast_append(return_value, &_1$$3); RETURN_MM(); } - ZEPHIR_INIT_VAR(findParams); - array_init(findParams); + ZEPHIR_INIT_VAR(&findParams); + array_init(&findParams); if (Z_TYPE_P(findParamsOne) == IS_ARRAY) { - zephir_is_iterable(findParamsOne, &_3$$4, &_2$$4, 0, 0, "phalcon/mvc/model/manager.zep", 1195); - for ( - ; zend_hash_get_current_data_ex(_3$$4, (void**) &_4$$4, &_2$$4) == SUCCESS - ; zend_hash_move_forward_ex(_3$$4, &_2$$4) - ) { - ZEPHIR_GET_HMKEY(key, _3$$4, _2$$4); - ZEPHIR_GET_HVALUE(value, _4$$4); - _5$$5 = ZEPHIR_IS_LONG_IDENTICAL(key, 0); + zephir_is_iterable(findParamsOne, 0, "phalcon/mvc/model/manager.zep", 1195); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(findParamsOne), _3$$4, _4$$4, _2$$4) + { + ZEPHIR_INIT_NVAR(&key); + if (_4$$4 != NULL) { + ZVAL_STR_COPY(&key, _4$$4); + } else { + ZVAL_LONG(&key, _3$$4); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _2$$4); + _5$$5 = ZEPHIR_IS_LONG_IDENTICAL(&key, 0); if (!(_5$$5)) { - _5$$5 = ZEPHIR_IS_STRING_IDENTICAL(key, "conditions"); + _5$$5 = ZEPHIR_IS_STRING_IDENTICAL(&key, "conditions"); } if (_5$$5) { - if (!(zephir_array_isset_long(findParams, 0))) { + if (!(zephir_array_isset_long(&findParams, 0))) { zephir_array_update_long(&findParams, 0, &value, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } else { - zephir_array_fetch_long(&_6$$8, findParams, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1188 TSRMLS_CC); + zephir_array_fetch_long(&_6$$8, &findParams, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1188 TSRMLS_CC); ZEPHIR_INIT_LNVAR(_7$$8); - ZEPHIR_CONCAT_SVSVS(_7$$8, "(", _6$$8, ") AND (", value, ")"); + ZEPHIR_CONCAT_SVSVS(&_7$$8, "(", &_6$$8, ") AND (", &value, ")"); zephir_array_update_long(&findParams, 0, &_7$$8, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } continue; } - zephir_array_update_zval(&findParams, key, &value, PH_COPY | PH_SEPARATE); - } + zephir_array_update_zval(&findParams, &key, &value, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } else { if (Z_TYPE_P(findParamsOne) == IS_STRING) { - ZEPHIR_INIT_NVAR(findParams); - zephir_create_array(findParams, 1, 0 TSRMLS_CC); - zephir_array_update_string(&findParams, SL("conditions"), &findParamsOne, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&findParams); + zephir_create_array(&findParams, 1, 0 TSRMLS_CC); + zephir_array_update_string(&findParams, SL("conditions"), findParamsOne, PH_COPY | PH_SEPARATE); } } if (Z_TYPE_P(findParamsTwo) == IS_ARRAY) { - zephir_is_iterable(findParamsTwo, &_9$$11, &_8$$11, 0, 0, "phalcon/mvc/model/manager.zep", 1229); - for ( - ; zend_hash_get_current_data_ex(_9$$11, (void**) &_10$$11, &_8$$11) == SUCCESS - ; zend_hash_move_forward_ex(_9$$11, &_8$$11) - ) { - ZEPHIR_GET_HMKEY(key, _9$$11, _8$$11); - ZEPHIR_GET_HVALUE(value, _10$$11); - _11$$12 = ZEPHIR_IS_LONG_IDENTICAL(key, 0); + zephir_is_iterable(findParamsTwo, 0, "phalcon/mvc/model/manager.zep", 1229); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(findParamsTwo), _9$$11, _10$$11, _8$$11) + { + ZEPHIR_INIT_NVAR(&key); + if (_10$$11 != NULL) { + ZVAL_STR_COPY(&key, _10$$11); + } else { + ZVAL_LONG(&key, _9$$11); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _8$$11); + _11$$12 = ZEPHIR_IS_LONG_IDENTICAL(&key, 0); if (!(_11$$12)) { - _11$$12 = ZEPHIR_IS_STRING_IDENTICAL(key, "conditions"); + _11$$12 = ZEPHIR_IS_STRING_IDENTICAL(&key, "conditions"); } if (_11$$12) { - if (!(zephir_array_isset_long(findParams, 0))) { + if (!(zephir_array_isset_long(&findParams, 0))) { zephir_array_update_long(&findParams, 0, &value, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } else { - zephir_array_fetch_long(&_12$$15, findParams, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1209 TSRMLS_CC); + zephir_array_fetch_long(&_12$$15, &findParams, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1209 TSRMLS_CC); ZEPHIR_INIT_LNVAR(_13$$15); - ZEPHIR_CONCAT_SVSVS(_13$$15, "(", _12$$15, ") AND (", value, ")"); + ZEPHIR_CONCAT_SVSVS(&_13$$15, "(", &_12$$15, ") AND (", &value, ")"); zephir_array_update_long(&findParams, 0, &_13$$15, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } continue; } - _14$$12 = ZEPHIR_IS_STRING_IDENTICAL(key, "bind"); + _14$$12 = ZEPHIR_IS_STRING_IDENTICAL(&key, "bind"); if (!(_14$$12)) { - _14$$12 = ZEPHIR_IS_STRING_IDENTICAL(key, "bindTypes"); + _14$$12 = ZEPHIR_IS_STRING_IDENTICAL(&key, "bindTypes"); } if (_14$$12) { - if (!(zephir_array_isset(findParams, key))) { - if (Z_TYPE_P(value) == IS_ARRAY) { - zephir_array_update_zval(&findParams, key, &value, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset(&findParams, &key))) { + if (Z_TYPE_P(&value) == IS_ARRAY) { + zephir_array_update_zval(&findParams, &key, &value, PH_COPY | PH_SEPARATE); } } else { - if (Z_TYPE_P(value) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_15$$20); - zephir_array_fetch(&_16$$20, findParams, key, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1221 TSRMLS_CC); - zephir_fast_array_merge(_15$$20, &(_16$$20), &(value) TSRMLS_CC); - zephir_array_update_zval(&findParams, key, &_15$$20, PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&value) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_15$$20); + zephir_array_fetch(&_16$$20, &findParams, &key, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1221 TSRMLS_CC); + zephir_fast_array_merge(&_15$$20, &_16$$20, &value TSRMLS_CC); + zephir_array_update_zval(&findParams, &key, &_15$$20, PH_COPY | PH_SEPARATE); } } continue; } - zephir_array_update_zval(&findParams, key, &value, PH_COPY | PH_SEPARATE); - } + zephir_array_update_zval(&findParams, &key, &value, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } else { if (Z_TYPE_P(findParamsTwo) == IS_STRING) { - if (!(zephir_array_isset_long(findParams, 0))) { - zephir_array_update_long(&findParams, 0, &findParamsTwo, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + if (!(zephir_array_isset_long(&findParams, 0))) { + zephir_array_update_long(&findParams, 0, findParamsTwo, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } else { - zephir_array_fetch_long(&_17$$24, findParams, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1234 TSRMLS_CC); - ZEPHIR_INIT_VAR(_18$$24); - ZEPHIR_CONCAT_SVSVS(_18$$24, "(", _17$$24, ") AND (", findParamsTwo, ")"); + zephir_array_fetch_long(&_17$$24, &findParams, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1234 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_18$$24); + ZEPHIR_CONCAT_SVSVS(&_18$$24, "(", &_17$$24, ") AND (", findParamsTwo, ")"); zephir_array_update_long(&findParams, 0, &_18$$24, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } } } - RETURN_CCTOR(findParams); + RETURN_CCTOR(&findParams); } @@ -1853,125 +2190,175 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, _mergeFindParameters) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationRecords) { - HashTable *_17$$10; - HashPosition _16$$10; - zval *_28; + zend_string *_18$$10; + zend_ulong _17$$10; + zval _28; zend_bool reusable = 0, _27$$19; zephir_fcall_cache_entry *_22 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method = NULL; - zval *relation, *method_param = NULL, *record, *parameters = NULL, *placeholders = NULL, *referencedModel = NULL, *intermediateModel = NULL, *intermediateFields = NULL, *joinConditions = NULL, *fields = NULL, *builder = NULL, *extraParameters = NULL, *conditions = NULL, *refPosition = NULL, *field = NULL, *referencedFields = NULL, *findParams = NULL, *findArguments = NULL, *retrieveMethod = NULL, *uniqueKey = NULL, *records = NULL, *arguments = NULL, *rows = NULL, *firstRow = NULL, *_0 = NULL, *_24, *_25 = NULL, *_1$$4, *_2$$4 = NULL, *_3$$6 = NULL, *_4$$6, *_5$$3 = NULL, *_6$$3, *_7$$3, *_11$$3 = NULL, *_8$$8 = NULL, *_9$$8 = NULL, *_10$$8 = NULL, *_12$$9 = NULL, *_13$$9, *_14$$9 = NULL, *_15$$10 = NULL, **_18$$10, *_19$$11, *_20$$11 = NULL, *_21$$11 = NULL, *_23$$11 = NULL, *_26$$14 = NULL; + zval method; + zval *relation, relation_sub, *method_param = NULL, *record, record_sub, *parameters = NULL, parameters_sub, __$null, placeholders, referencedModel, intermediateModel, intermediateFields, joinConditions, fields, builder, extraParameters, conditions, refPosition, field, referencedFields, findParams, findArguments, retrieveMethod, uniqueKey, records, arguments, rows, firstRow, _0, _24, _25, _1$$4, _2$$4, _3$$6, _4$$6, _5$$3, _6$$3, _7$$3, _11$$3, _8$$8, _9$$8, _10$$8, _12$$9, _13$$9, _14$$9, _15$$10, *_16$$10, _19$$11, _20$$11, _21$$11, _23$$11, _26$$14; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&relation_sub); + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&placeholders); + ZVAL_UNDEF(&referencedModel); + ZVAL_UNDEF(&intermediateModel); + ZVAL_UNDEF(&intermediateFields); + ZVAL_UNDEF(&joinConditions); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&builder); + ZVAL_UNDEF(&extraParameters); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&refPosition); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&referencedFields); + ZVAL_UNDEF(&findParams); + ZVAL_UNDEF(&findArguments); + ZVAL_UNDEF(&retrieveMethod); + ZVAL_UNDEF(&uniqueKey); + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&rows); + ZVAL_UNDEF(&firstRow); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_24); + ZVAL_UNDEF(&_25); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$8); + ZVAL_UNDEF(&_10$$8); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_14$$9); + ZVAL_UNDEF(&_15$$10); + ZVAL_UNDEF(&_19$$11); + ZVAL_UNDEF(&_20$$11); + ZVAL_UNDEF(&_21$$11); + ZVAL_UNDEF(&_23$$11); + ZVAL_UNDEF(&_26$$14); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&_28); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &relation, &method_param, &record, ¶meters); if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); } else { - ZEPHIR_INIT_VAR(method); - ZVAL_EMPTY_STRING(method); + ZEPHIR_INIT_VAR(&method); + ZVAL_EMPTY_STRING(&method); } if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(placeholders); - array_init(placeholders); + ZEPHIR_INIT_VAR(&placeholders); + array_init(&placeholders); ZEPHIR_CALL_METHOD(&extraParameters, relation, "getparams", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&referencedModel, relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_0, relation, "isthrough", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_0)) { - ZEPHIR_INIT_VAR(conditions); - array_init(conditions); + if (zephir_is_true(&_0)) { + ZEPHIR_INIT_VAR(&conditions); + array_init(&conditions); ZEPHIR_CALL_METHOD(&intermediateModel, relation, "getintermediatemodel", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&intermediateFields, relation, "getintermediatefields", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&fields, relation, "getfields", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(fields) != IS_ARRAY) { - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_SVSVS(_1$$4, "[", intermediateModel, "].[", intermediateFields, "] = :APR0:"); - zephir_array_append(&conditions, _1$$4, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1285); - ZEPHIR_CALL_METHOD(&_2$$4, record, "readattribute", NULL, 0, fields); + if (Z_TYPE_P(&fields) != IS_ARRAY) { + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_SVSVS(&_1$$4, "[", &intermediateModel, "].[", &intermediateFields, "] = :APR0:"); + zephir_array_append(&conditions, &_1$$4, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1285); + ZEPHIR_CALL_METHOD(&_2$$4, record, "readattribute", NULL, 0, &fields); zephir_check_call_status(); zephir_array_update_string(&placeholders, SL("APR0"), &_2$$4, PH_COPY | PH_SEPARATE); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/mvc/model/manager.zep", 1288); return; } - ZEPHIR_INIT_VAR(joinConditions); - array_init(joinConditions); + ZEPHIR_INIT_VAR(&joinConditions); + array_init(&joinConditions); ZEPHIR_CALL_METHOD(&intermediateFields, relation, "getintermediatereferencedfields", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(intermediateFields) != IS_ARRAY) { + if (Z_TYPE_P(&intermediateFields) != IS_ARRAY) { ZEPHIR_CALL_METHOD(&_3$$6, relation, "getreferencedfields", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_4$$6); - ZEPHIR_CONCAT_SVSVSVSVS(_4$$6, "[", intermediateModel, "].[", intermediateFields, "] = [", referencedModel, "].[", _3$$6, "]"); - zephir_array_append(&joinConditions, _4$$6, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1298); + ZEPHIR_INIT_VAR(&_4$$6); + ZEPHIR_CONCAT_SVSVSVSVS(&_4$$6, "[", &intermediateModel, "].[", &intermediateFields, "] = [", &referencedModel, "].[", &_3$$6, "]"); + zephir_array_append(&joinConditions, &_4$$6, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1298); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/mvc/model/manager.zep", 1300); return; } - ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "_mergefindparameters", NULL, 348, extraParameters, parameters); + ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "_mergefindparameters", NULL, 308, &extraParameters, parameters); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&builder, this_ptr, "createbuilder", NULL, 0, _5$$3); + ZEPHIR_CALL_METHOD(&builder, this_ptr, "createbuilder", NULL, 0, &_5$$3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, builder, "from", NULL, 0, referencedModel); + ZEPHIR_CALL_METHOD(NULL, &builder, "from", NULL, 0, &referencedModel); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_6$$3); - zephir_fast_join_str(_6$$3, SL(" AND "), joinConditions TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, builder, "innerjoin", NULL, 0, intermediateModel, _6$$3); + ZEPHIR_INIT_VAR(&_6$$3); + zephir_fast_join_str(&_6$$3, SL(" AND "), &joinConditions TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &builder, "innerjoin", NULL, 0, &intermediateModel, &_6$$3); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_7$$3); - zephir_fast_join_str(_7$$3, SL(" AND "), conditions TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, builder, "andwhere", NULL, 0, _7$$3, placeholders); + ZEPHIR_INIT_VAR(&_7$$3); + zephir_fast_join_str(&_7$$3, SL(" AND "), &conditions TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &builder, "andwhere", NULL, 0, &_7$$3, &placeholders); zephir_check_call_status(); - if (ZEPHIR_IS_STRING(method, "count")) { - ZEPHIR_INIT_VAR(_8$$8); - ZVAL_STRING(_8$$8, "COUNT(*) AS rowcount", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, builder, "columns", NULL, 0, _8$$8); - zephir_check_temp_parameter(_8$$8); + if (ZEPHIR_IS_STRING(&method, "count")) { + ZEPHIR_INIT_VAR(&_8$$8); + ZVAL_STRING(&_8$$8, "COUNT(*) AS rowcount"); + ZEPHIR_CALL_METHOD(NULL, &builder, "columns", NULL, 0, &_8$$8); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_9$$8, builder, "getquery", NULL, 0); + ZEPHIR_CALL_METHOD(&_9$$8, &builder, "getquery", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&rows, _9$$8, "execute", NULL, 0); + ZEPHIR_CALL_METHOD(&rows, &_9$$8, "execute", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&firstRow, rows, "getfirst", NULL, 0); + ZEPHIR_CALL_METHOD(&firstRow, &rows, "getfirst", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_8$$8); - ZVAL_STRING(_8$$8, "rowcount", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_10$$8, firstRow, "readattribute", NULL, 0, _8$$8); - zephir_check_temp_parameter(_8$$8); + ZEPHIR_INIT_NVAR(&_8$$8); + ZVAL_STRING(&_8$$8, "rowcount"); + ZEPHIR_CALL_METHOD(&_10$$8, &firstRow, "readattribute", NULL, 0, &_8$$8); zephir_check_call_status(); - RETURN_MM_LONG(zephir_get_intval(_10$$8)); + RETURN_MM_LONG(zephir_get_intval(&_10$$8)); } - ZEPHIR_CALL_METHOD(&_11$$3, builder, "getquery", NULL, 0); + ZEPHIR_CALL_METHOD(&_11$$3, &builder, "getquery", NULL, 0); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(_11$$3, "execute", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&_11$$3, "execute", NULL, 0); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_NVAR(conditions); - array_init(conditions); + ZEPHIR_INIT_NVAR(&conditions); + array_init(&conditions); ZEPHIR_CALL_METHOD(&fields, relation, "getfields", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(fields) != IS_ARRAY) { + if (Z_TYPE_P(&fields) != IS_ARRAY) { ZEPHIR_CALL_METHOD(&_12$$9, relation, "getreferencedfields", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_13$$9); - ZEPHIR_CONCAT_SVS(_13$$9, "[", _12$$9, "] = :APR0:"); - zephir_array_append(&conditions, _13$$9, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1337); - ZEPHIR_CALL_METHOD(&_14$$9, record, "readattribute", NULL, 0, fields); + ZEPHIR_INIT_VAR(&_13$$9); + ZEPHIR_CONCAT_SVS(&_13$$9, "[", &_12$$9, "] = :APR0:"); + zephir_array_append(&conditions, &_13$$9, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1337); + ZEPHIR_CALL_METHOD(&_14$$9, record, "readattribute", NULL, 0, &fields); zephir_check_call_status(); zephir_array_update_string(&placeholders, SL("APR0"), &_14$$9, PH_COPY | PH_SEPARATE); } else { @@ -1979,53 +2366,59 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationRecords) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_15$$10, relation, "getfields", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_15$$10, &_17$$10, &_16$$10, 0, 0, "phalcon/mvc/model/manager.zep", 1349); - for ( - ; zend_hash_get_current_data_ex(_17$$10, (void**) &_18$$10, &_16$$10) == SUCCESS - ; zend_hash_move_forward_ex(_17$$10, &_16$$10) - ) { - ZEPHIR_GET_HMKEY(refPosition, _17$$10, _16$$10); - ZEPHIR_GET_HVALUE(field, _18$$10); - zephir_array_fetch(&_19$$11, referencedFields, refPosition, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1346 TSRMLS_CC); + zephir_is_iterable(&_15$$10, 0, "phalcon/mvc/model/manager.zep", 1349); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_15$$10), _17$$10, _18$$10, _16$$10) + { + ZEPHIR_INIT_NVAR(&refPosition); + if (_18$$10 != NULL) { + ZVAL_STR_COPY(&refPosition, _18$$10); + } else { + ZVAL_LONG(&refPosition, _17$$10); + } + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _16$$10); + zephir_array_fetch(&_19$$11, &referencedFields, &refPosition, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1346 TSRMLS_CC); ZEPHIR_INIT_LNVAR(_20$$11); - ZEPHIR_CONCAT_SVSVS(_20$$11, "[", _19$$11, "] = :APR", refPosition, ":"); - zephir_array_append(&conditions, _20$$11, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1346); - ZEPHIR_CALL_METHOD(&_21$$11, record, "readattribute", &_22, 0, field); + ZEPHIR_CONCAT_SVSVS(&_20$$11, "[", &_19$$11, "] = :APR", &refPosition, ":"); + zephir_array_append(&conditions, &_20$$11, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1346); + ZEPHIR_CALL_METHOD(&_21$$11, record, "readattribute", &_22, 0, &field); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_23$$11); - ZEPHIR_CONCAT_SV(_23$$11, "APR", refPosition); - zephir_array_update_zval(&placeholders, _23$$11, &_21$$11, PH_COPY | PH_SEPARATE); - } - } - ZEPHIR_INIT_VAR(findParams); - zephir_create_array(findParams, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_24); - zephir_fast_join_str(_24, SL(" AND "), conditions TSRMLS_CC); - zephir_array_fast_append(findParams, _24); + ZEPHIR_CONCAT_SV(&_23$$11, "APR", &refPosition); + zephir_array_update_zval(&placeholders, &_23$$11, &_21$$11, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_INIT_NVAR(&refPosition); + } + ZEPHIR_INIT_VAR(&findParams); + zephir_create_array(&findParams, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_24); + zephir_fast_join_str(&_24, SL(" AND "), &conditions TSRMLS_CC); + zephir_array_fast_append(&findParams, &_24); zephir_array_update_string(&findParams, SL("bind"), &placeholders, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(&_25, record, "getdi", NULL, 0); zephir_check_call_status(); zephir_array_update_string(&findParams, SL("di"), &_25, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&findArguments, this_ptr, "_mergefindparameters", NULL, 348, findParams, parameters); + ZEPHIR_CALL_METHOD(&findArguments, this_ptr, "_mergefindparameters", NULL, 308, &findParams, parameters); zephir_check_call_status(); - if (Z_TYPE_P(extraParameters) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&findParams, this_ptr, "_mergefindparameters", NULL, 348, extraParameters, findArguments); + if (Z_TYPE_P(&extraParameters) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(&findParams, this_ptr, "_mergefindparameters", NULL, 308, &extraParameters, &findArguments); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(findParams, findArguments); + ZEPHIR_CPY_WRT(&findParams, &findArguments); } - if (ZEPHIR_IS_STRING_IDENTICAL(method, "")) { + if (ZEPHIR_IS_STRING_IDENTICAL(&method, "")) { ZEPHIR_CALL_METHOD(&_26$$14, relation, "gettype", NULL, 0); zephir_check_call_status(); do { - if (ZEPHIR_IS_LONG(_26$$14, 0) || ZEPHIR_IS_LONG(_26$$14, 1)) { - ZEPHIR_INIT_VAR(retrieveMethod); - ZVAL_STRING(retrieveMethod, "findFirst", 1); + if (ZEPHIR_IS_LONG(&_26$$14, 0) || ZEPHIR_IS_LONG(&_26$$14, 1)) { + ZEPHIR_INIT_VAR(&retrieveMethod); + ZVAL_STRING(&retrieveMethod, "findFirst"); break; } - if (ZEPHIR_IS_LONG(_26$$14, 2)) { - ZEPHIR_INIT_NVAR(retrieveMethod); - ZVAL_STRING(retrieveMethod, "find", 1); + if (ZEPHIR_IS_LONG(&_26$$14, 2)) { + ZEPHIR_INIT_NVAR(&retrieveMethod); + ZVAL_STRING(&retrieveMethod, "find"); break; } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Unknown relation type", "phalcon/mvc/model/manager.zep", 1385); @@ -2033,41 +2426,41 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationRecords) { } while(0); } else { - ZEPHIR_CPY_WRT(retrieveMethod, method); + ZEPHIR_CPY_WRT(&retrieveMethod, &method); } - ZEPHIR_INIT_VAR(arguments); - zephir_create_array(arguments, 1, 0 TSRMLS_CC); - zephir_array_fast_append(arguments, findParams); + ZEPHIR_INIT_VAR(&arguments); + zephir_create_array(&arguments, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&arguments, &findParams); ZEPHIR_CALL_METHOD(&_25, relation, "isreusable", NULL, 0); zephir_check_call_status(); - reusable = zephir_get_boolval(_25); + reusable = zephir_get_boolval(&_25); if (reusable) { - ZEPHIR_INIT_VAR(uniqueKey); - zephir_unique_key(uniqueKey, referencedModel, arguments TSRMLS_CC); - ZEPHIR_CALL_METHOD(&records, this_ptr, "getreusablerecords", NULL, 0, referencedModel, uniqueKey); + ZEPHIR_INIT_VAR(&uniqueKey); + zephir_unique_key(&uniqueKey, &referencedModel, &arguments TSRMLS_CC); + ZEPHIR_CALL_METHOD(&records, this_ptr, "getreusablerecords", NULL, 0, &referencedModel, &uniqueKey); zephir_check_call_status(); - _27$$19 = Z_TYPE_P(records) == IS_ARRAY; + _27$$19 = Z_TYPE_P(&records) == IS_ARRAY; if (!(_27$$19)) { - _27$$19 = Z_TYPE_P(records) == IS_OBJECT; + _27$$19 = Z_TYPE_P(&records) == IS_OBJECT; } if (_27$$19) { - RETURN_CCTOR(records); + RETURN_CCTOR(&records); } } - ZEPHIR_INIT_VAR(_28); - zephir_create_array(_28, 2, 0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_25, this_ptr, "load", NULL, 0, referencedModel); + ZEPHIR_INIT_VAR(&_28); + zephir_create_array(&_28, 2, 0 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_25, this_ptr, "load", NULL, 0, &referencedModel); zephir_check_call_status(); - zephir_array_fast_append(_28, _25); - zephir_array_fast_append(_28, retrieveMethod); - ZEPHIR_INIT_NVAR(records); - ZEPHIR_CALL_USER_FUNC_ARRAY(records, _28, arguments); + zephir_array_fast_append(&_28, &_25); + zephir_array_fast_append(&_28, &retrieveMethod); + ZEPHIR_INIT_NVAR(&records); + ZEPHIR_CALL_USER_FUNC_ARRAY(&records, &_28, &arguments); zephir_check_call_status(); if (reusable) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setreusablerecords", NULL, 0, referencedModel, uniqueKey, records); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setreusablerecords", NULL, 0, &referencedModel, &uniqueKey, &records); zephir_check_call_status(); } - RETURN_CCTOR(records); + RETURN_CCTOR(&records); } @@ -2076,37 +2469,43 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationRecords) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getReusableRecords) { - zval *modelName_param = NULL, *key_param = NULL, *records = NULL, *_0; - zval *modelName = NULL, *key = NULL; + zval *modelName_param = NULL, *key_param = NULL, records, _0; + zval modelName, key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &modelName_param, &key_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_reusable"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&records, _0, key, 1 TSRMLS_CC)) { - RETURN_CTOR(records); + zephir_read_property(&_0, this_ptr, SL("_reusable"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&records, &_0, &key, 1 TSRMLS_CC)) { + RETURN_CTOR(&records); } RETURN_MM_NULL(); @@ -2117,35 +2516,40 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getReusableRecords) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, setReusableRecords) { - zval *modelName_param = NULL, *key_param = NULL, *records; - zval *modelName = NULL, *key = NULL; + zval *modelName_param = NULL, *key_param = NULL, *records, records_sub; + zval modelName, key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&records_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &modelName_param, &key_param, &records); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - zephir_update_property_array(this_ptr, SL("_reusable"), key, records TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_reusable"), &key, records TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -2155,9 +2559,13 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, setReusableRecords) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, clearReusableObjects) { - + zval __$null; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); - zephir_update_property_this(getThis(), SL("_reusable"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + + zephir_update_property_zval(this_ptr, SL("_reusable"), &__$null); } @@ -2167,50 +2575,65 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, clearReusableObjects) { PHP_METHOD(Phalcon_Mvc_Model_Manager, getBelongsToRecords) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *modelName_param = NULL, *modelRelation, *record, *parameters = NULL, *keyRelation = NULL, *relations = NULL, *_0, *_1, *_2, *_3; - zval *method = NULL, *modelName = NULL; + zval *method_param = NULL, *modelName_param = NULL, *modelRelation, modelRelation_sub, *record, record_sub, *parameters = NULL, parameters_sub, __$null, keyRelation, relations, _0, _1, _2, _3; + zval method, modelName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&modelRelation_sub); + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &method_param, &modelName_param, &modelRelation, &record, ¶meters); if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); } else { - ZEPHIR_INIT_VAR(method); - ZVAL_EMPTY_STRING(method); + ZEPHIR_INIT_VAR(&method); + ZVAL_EMPTY_STRING(&method); } if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtolower(_0, modelName); - ZEPHIR_INIT_VAR(_1); - zephir_fast_strtolower(_1, modelRelation); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, _0, "$", _1); - ZEPHIR_OBS_VAR(relations); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_hasMany"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&relations, _2, keyRelation, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtolower(&_0, &modelName); + ZEPHIR_INIT_VAR(&_1); + zephir_fast_strtolower(&_1, modelRelation); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &_0, "$", &_1); + ZEPHIR_OBS_VAR(&relations); + zephir_read_property(&_2, this_ptr, SL("_hasMany"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&relations, &_2, &keyRelation, 0 TSRMLS_CC))) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_3, relations, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1469 TSRMLS_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getrelationrecords", NULL, 0, _3, method, record, parameters); + zephir_array_fetch_long(&_3, &relations, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1469 TSRMLS_CC); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getrelationrecords", NULL, 0, &_3, &method, record, parameters); zephir_check_call_status(); RETURN_MM(); @@ -2222,50 +2645,65 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getBelongsToRecords) { PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasManyRecords) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *modelName_param = NULL, *modelRelation, *record, *parameters = NULL, *keyRelation = NULL, *relations = NULL, *_0, *_1, *_2, *_3; - zval *method = NULL, *modelName = NULL; + zval *method_param = NULL, *modelName_param = NULL, *modelRelation, modelRelation_sub, *record, record_sub, *parameters = NULL, parameters_sub, __$null, keyRelation, relations, _0, _1, _2, _3; + zval method, modelName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&modelRelation_sub); + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &method_param, &modelName_param, &modelRelation, &record, ¶meters); if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); } else { - ZEPHIR_INIT_VAR(method); - ZVAL_EMPTY_STRING(method); + ZEPHIR_INIT_VAR(&method); + ZVAL_EMPTY_STRING(&method); } if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtolower(_0, modelName); - ZEPHIR_INIT_VAR(_1); - zephir_fast_strtolower(_1, modelRelation); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, _0, "$", _1); - ZEPHIR_OBS_VAR(relations); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_hasMany"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&relations, _2, keyRelation, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtolower(&_0, &modelName); + ZEPHIR_INIT_VAR(&_1); + zephir_fast_strtolower(&_1, modelRelation); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &_0, "$", &_1); + ZEPHIR_OBS_VAR(&relations); + zephir_read_property(&_2, this_ptr, SL("_hasMany"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&relations, &_2, &keyRelation, 0 TSRMLS_CC))) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_3, relations, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1492 TSRMLS_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getrelationrecords", NULL, 0, _3, method, record, parameters); + zephir_array_fetch_long(&_3, &relations, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1492 TSRMLS_CC); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getrelationrecords", NULL, 0, &_3, &method, record, parameters); zephir_check_call_status(); RETURN_MM(); @@ -2277,50 +2715,65 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasManyRecords) { PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasOneRecords) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *method_param = NULL, *modelName_param = NULL, *modelRelation, *record, *parameters = NULL, *keyRelation = NULL, *relations = NULL, *_0, *_1, *_2, *_3; - zval *method = NULL, *modelName = NULL; + zval *method_param = NULL, *modelName_param = NULL, *modelRelation, modelRelation_sub, *record, record_sub, *parameters = NULL, parameters_sub, __$null, keyRelation, relations, _0, _1, _2, _3; + zval method, modelName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&modelRelation_sub); + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &method_param, &modelName_param, &modelRelation, &record, ¶meters); if (UNEXPECTED(Z_TYPE_P(method_param) != IS_STRING && Z_TYPE_P(method_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'method' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(method_param) == IS_STRING)) { - zephir_get_strval(method, method_param); + zephir_get_strval(&method, method_param); } else { - ZEPHIR_INIT_VAR(method); - ZVAL_EMPTY_STRING(method); + ZEPHIR_INIT_VAR(&method); + ZVAL_EMPTY_STRING(&method); } if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); } if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtolower(_0, modelName); - ZEPHIR_INIT_VAR(_1); - zephir_fast_strtolower(_1, modelRelation); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, _0, "$", _1); - ZEPHIR_OBS_VAR(relations); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_hasOne"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&relations, _2, keyRelation, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtolower(&_0, &modelName); + ZEPHIR_INIT_VAR(&_1); + zephir_fast_strtolower(&_1, modelRelation); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &_0, "$", &_1); + ZEPHIR_OBS_VAR(&relations); + zephir_read_property(&_2, this_ptr, SL("_hasOne"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&relations, &_2, &keyRelation, 0 TSRMLS_CC))) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_3, relations, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1515 TSRMLS_CC); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getrelationrecords", NULL, 0, _3, method, record, parameters); + zephir_array_fetch_long(&_3, &relations, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/manager.zep", 1515 TSRMLS_CC); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getrelationrecords", NULL, 0, &_3, &method, record, parameters); zephir_check_call_status(); RETURN_MM(); @@ -2337,21 +2790,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasOneRecords) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getBelongsTo) { - zval *model, *relations = NULL, *_0, *_1; + zval *model, model_sub, relations, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_belongsToSingle"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_get_class(_1, model, 1 TSRMLS_CC); - if (!(zephir_array_isset_fetch(&relations, _0, _1, 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_belongsToSingle"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_get_class(&_1, model, 1 TSRMLS_CC); + if (!(zephir_array_isset_fetch(&relations, &_0, &_1, 1 TSRMLS_CC))) { array_init(return_value); RETURN_MM(); } - RETURN_CTOR(relations); + RETURN_CTOR(&relations); } @@ -2360,21 +2819,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getBelongsTo) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasMany) { - zval *model, *relations = NULL, *_0, *_1; + zval *model, model_sub, relations, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_hasManySingle"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_get_class(_1, model, 1 TSRMLS_CC); - if (!(zephir_array_isset_fetch(&relations, _0, _1, 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_hasManySingle"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_get_class(&_1, model, 1 TSRMLS_CC); + if (!(zephir_array_isset_fetch(&relations, &_0, &_1, 1 TSRMLS_CC))) { array_init(return_value); RETURN_MM(); } - RETURN_CTOR(relations); + RETURN_CTOR(&relations); } @@ -2383,21 +2848,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasMany) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasOne) { - zval *model, *relations = NULL, *_0, *_1; + zval *model, model_sub, relations, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_hasOneSingle"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_get_class(_1, model, 1 TSRMLS_CC); - if (!(zephir_array_isset_fetch(&relations, _0, _1, 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_hasOneSingle"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_get_class(&_1, model, 1 TSRMLS_CC); + if (!(zephir_array_isset_fetch(&relations, &_0, &_1, 1 TSRMLS_CC))) { array_init(return_value); RETURN_MM(); } - RETURN_CTOR(relations); + RETURN_CTOR(&relations); } @@ -2406,21 +2877,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasOne) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasManyToMany) { - zval *model, *relations = NULL, *_0, *_1; + zval *model, model_sub, relations, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_hasManyToManySingle"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - zephir_get_class(_1, model, 1 TSRMLS_CC); - if (!(zephir_array_isset_fetch(&relations, _0, _1, 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_hasManyToManySingle"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + zephir_get_class(&_1, model, 1 TSRMLS_CC); + if (!(zephir_array_isset_fetch(&relations, &_0, &_1, 1 TSRMLS_CC))) { array_init(return_value); RETURN_MM(); } - RETURN_CTOR(relations); + RETURN_CTOR(&relations); } @@ -2430,7 +2907,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasManyToMany) { PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasOneAndHasMany) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *_0 = NULL, *_1 = NULL; + zval *model, model_sub, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); @@ -2441,7 +2923,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasOneAndHasMany) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&_1, this_ptr, "gethasmany", NULL, 0, model); zephir_check_call_status(); - zephir_fast_array_merge(return_value, &(_0), &(_1) TSRMLS_CC); + zephir_fast_array_merge(return_value, &_0, &_1 TSRMLS_CC); RETURN_MM(); } @@ -2451,67 +2933,75 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getHasOneAndHasMany) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelations) { - HashTable *_2$$3, *_6$$5, *_10$$7; - HashPosition _1$$3, _5$$5, _9$$7; - zval *modelName_param = NULL, *entityName = NULL, *allRelations = NULL, *relations = NULL, *relation = NULL, *_0, *_4, *_8, **_3$$3, **_7$$5, **_11$$7; - zval *modelName = NULL; + zval *modelName_param = NULL, entityName, allRelations, relations, relation, _0, _2, _4, *_1$$3, *_3$$5, *_5$$7; + zval modelName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&entityName); + ZVAL_UNDEF(&allRelations); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &modelName_param); if (UNEXPECTED(Z_TYPE_P(modelName_param) != IS_STRING && Z_TYPE_P(modelName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'modelName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(modelName_param) == IS_STRING)) { - zephir_get_strval(modelName, modelName_param); + zephir_get_strval(&modelName, modelName_param); } else { - ZEPHIR_INIT_VAR(modelName); - ZVAL_EMPTY_STRING(modelName); - } - - - ZEPHIR_INIT_VAR(entityName); - zephir_fast_strtolower(entityName, modelName); - ZEPHIR_INIT_VAR(allRelations); - array_init(allRelations); - ZEPHIR_OBS_VAR(relations); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_belongsToSingle"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&relations, _0, entityName, 0 TSRMLS_CC)) { - zephir_is_iterable(relations, &_2$$3, &_1$$3, 0, 0, "phalcon/mvc/model/manager.zep", 1605); - for ( - ; zend_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS - ; zend_hash_move_forward_ex(_2$$3, &_1$$3) - ) { - ZEPHIR_GET_HVALUE(relation, _3$$3); - zephir_array_append(&allRelations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1603); - } - } - ZEPHIR_OBS_NVAR(relations); - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_hasManySingle"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&relations, _4, entityName, 0 TSRMLS_CC)) { - zephir_is_iterable(relations, &_6$$5, &_5$$5, 0, 0, "phalcon/mvc/model/manager.zep", 1614); - for ( - ; zend_hash_get_current_data_ex(_6$$5, (void**) &_7$$5, &_5$$5) == SUCCESS - ; zend_hash_move_forward_ex(_6$$5, &_5$$5) - ) { - ZEPHIR_GET_HVALUE(relation, _7$$5); - zephir_array_append(&allRelations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1612); - } - } - ZEPHIR_OBS_NVAR(relations); - _8 = zephir_fetch_nproperty_this(this_ptr, SL("_hasOneSingle"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&relations, _8, entityName, 0 TSRMLS_CC)) { - zephir_is_iterable(relations, &_10$$7, &_9$$7, 0, 0, "phalcon/mvc/model/manager.zep", 1623); - for ( - ; zend_hash_get_current_data_ex(_10$$7, (void**) &_11$$7, &_9$$7) == SUCCESS - ; zend_hash_move_forward_ex(_10$$7, &_9$$7) - ) { - ZEPHIR_GET_HVALUE(relation, _11$$7); - zephir_array_append(&allRelations, relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1621); - } - } - RETURN_CCTOR(allRelations); + ZEPHIR_INIT_VAR(&modelName); + ZVAL_EMPTY_STRING(&modelName); + } + + + ZEPHIR_INIT_VAR(&entityName); + zephir_fast_strtolower(&entityName, &modelName); + ZEPHIR_INIT_VAR(&allRelations); + array_init(&allRelations); + ZEPHIR_OBS_VAR(&relations); + zephir_read_property(&_0, this_ptr, SL("_belongsToSingle"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&relations, &_0, &entityName, 0 TSRMLS_CC)) { + zephir_is_iterable(&relations, 0, "phalcon/mvc/model/manager.zep", 1605); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&relations), _1$$3) + { + ZEPHIR_INIT_NVAR(&relation); + ZVAL_COPY(&relation, _1$$3); + zephir_array_append(&allRelations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1603); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&relation); + } + ZEPHIR_OBS_NVAR(&relations); + zephir_read_property(&_2, this_ptr, SL("_hasManySingle"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&relations, &_2, &entityName, 0 TSRMLS_CC)) { + zephir_is_iterable(&relations, 0, "phalcon/mvc/model/manager.zep", 1614); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&relations), _3$$5) + { + ZEPHIR_INIT_NVAR(&relation); + ZVAL_COPY(&relation, _3$$5); + zephir_array_append(&allRelations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1612); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&relation); + } + ZEPHIR_OBS_NVAR(&relations); + zephir_read_property(&_4, this_ptr, SL("_hasOneSingle"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&relations, &_4, &entityName, 0 TSRMLS_CC)) { + zephir_is_iterable(&relations, 0, "phalcon/mvc/model/manager.zep", 1623); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&relations), _5$$7) + { + ZEPHIR_INIT_NVAR(&relation); + ZVAL_COPY(&relation, _5$$7); + zephir_array_append(&allRelations, &relation, PH_SEPARATE, "phalcon/mvc/model/manager.zep", 1621); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&relation); + } + RETURN_CCTOR(&allRelations); } @@ -2520,54 +3010,65 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelations) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationsBetween) { - zval *first_param = NULL, *second_param = NULL, *keyRelation = NULL, *relations = NULL, *_0, *_1, *_2, *_3, *_4; - zval *first = NULL, *second = NULL; + zval *first_param = NULL, *second_param = NULL, keyRelation, relations, _0, _1, _2, _3, _4; + zval first, second; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&first); + ZVAL_UNDEF(&second); + ZVAL_UNDEF(&keyRelation); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &first_param, &second_param); if (UNEXPECTED(Z_TYPE_P(first_param) != IS_STRING && Z_TYPE_P(first_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'first' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'first' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(first_param) == IS_STRING)) { - zephir_get_strval(first, first_param); + zephir_get_strval(&first, first_param); } else { - ZEPHIR_INIT_VAR(first); - ZVAL_EMPTY_STRING(first); + ZEPHIR_INIT_VAR(&first); + ZVAL_EMPTY_STRING(&first); } if (UNEXPECTED(Z_TYPE_P(second_param) != IS_STRING && Z_TYPE_P(second_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'second' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'second' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(second_param) == IS_STRING)) { - zephir_get_strval(second, second_param); + zephir_get_strval(&second, second_param); } else { - ZEPHIR_INIT_VAR(second); - ZVAL_EMPTY_STRING(second); + ZEPHIR_INIT_VAR(&second); + ZVAL_EMPTY_STRING(&second); } - ZEPHIR_INIT_VAR(_0); - zephir_fast_strtolower(_0, first); - ZEPHIR_INIT_VAR(_1); - zephir_fast_strtolower(_1, second); - ZEPHIR_INIT_VAR(keyRelation); - ZEPHIR_CONCAT_VSV(keyRelation, _0, "$", _1); - ZEPHIR_OBS_VAR(relations); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_belongsTo"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&relations, _2, keyRelation, 0 TSRMLS_CC)) { - RETURN_CCTOR(relations); + ZEPHIR_INIT_VAR(&_0); + zephir_fast_strtolower(&_0, &first); + ZEPHIR_INIT_VAR(&_1); + zephir_fast_strtolower(&_1, &second); + ZEPHIR_INIT_VAR(&keyRelation); + ZEPHIR_CONCAT_VSV(&keyRelation, &_0, "$", &_1); + ZEPHIR_OBS_VAR(&relations); + zephir_read_property(&_2, this_ptr, SL("_belongsTo"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&relations, &_2, &keyRelation, 0 TSRMLS_CC)) { + RETURN_CCTOR(&relations); } - ZEPHIR_OBS_NVAR(relations); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_hasMany"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&relations, _3, keyRelation, 0 TSRMLS_CC)) { - RETURN_CCTOR(relations); + ZEPHIR_OBS_NVAR(&relations); + zephir_read_property(&_3, this_ptr, SL("_hasMany"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&relations, &_3, &keyRelation, 0 TSRMLS_CC)) { + RETURN_CCTOR(&relations); } - ZEPHIR_OBS_NVAR(relations); - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_hasOne"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&relations, _4, keyRelation, 0 TSRMLS_CC)) { - RETURN_CCTOR(relations); + ZEPHIR_OBS_NVAR(&relations); + zephir_read_property(&_4, this_ptr, SL("_hasOne"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&relations, &_4, &keyRelation, 0 TSRMLS_CC)) { + RETURN_CCTOR(&relations); } RETURN_MM_BOOL(0); @@ -2578,44 +3079,51 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getRelationsBetween) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, createQuery) { - zval *_1; + zval _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *phql_param = NULL, *dependencyInjector = NULL, *query = NULL, *_0 = NULL, *_2; - zval *phql = NULL; + zval *phql_param = NULL, dependencyInjector, query, _0, _2; + zval phql; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&phql); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &phql_param); if (UNEXPECTED(Z_TYPE_P(phql_param) != IS_STRING && Z_TYPE_P(phql_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'phql' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'phql' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(phql_param) == IS_STRING)) { - zephir_get_strval(phql, phql_param); + zephir_get_strval(&phql, phql_param); } else { - ZEPHIR_INIT_VAR(phql); - ZVAL_EMPTY_STRING(phql); + ZEPHIR_INIT_VAR(&phql); + ZVAL_EMPTY_STRING(&phql); } - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A dependency injection object is required to access ORM services", "phalcon/mvc/model/manager.zep", 1670); return; } - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_1, phql); - zephir_array_fast_append(_1, dependencyInjector); - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "Phalcon\\Mvc\\Model\\Query", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0, dependencyInjector, "get", NULL, 0, _2, _1); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_1, &phql); + zephir_array_fast_append(&_1, &dependencyInjector); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "Phalcon\\Mvc\\Model\\Query"); + ZEPHIR_CALL_METHOD(&_0, &dependencyInjector, "get", NULL, 0, &_2, &_1); zephir_check_call_status(); - ZEPHIR_CPY_WRT(query, _0); - zephir_update_property_this(getThis(), SL("_lastQuery"), query TSRMLS_CC); - RETURN_CCTOR(query); + ZEPHIR_CPY_WRT(&query, &_0); + zephir_update_property_zval(this_ptr, SL("_lastQuery"), &query); + RETURN_CCTOR(&query); } @@ -2625,41 +3133,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, createQuery) { PHP_METHOD(Phalcon_Mvc_Model_Manager, executeQuery) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *phql_param = NULL, *placeholders = NULL, *types = NULL, *query = NULL; - zval *phql = NULL; + zval *phql_param = NULL, *placeholders = NULL, placeholders_sub, *types = NULL, types_sub, __$null, query; + zval phql; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&phql); + ZVAL_UNDEF(&placeholders_sub); + ZVAL_UNDEF(&types_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&query); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &phql_param, &placeholders, &types); if (UNEXPECTED(Z_TYPE_P(phql_param) != IS_STRING && Z_TYPE_P(phql_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'phql' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'phql' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(phql_param) == IS_STRING)) { - zephir_get_strval(phql, phql_param); + zephir_get_strval(&phql, phql_param); } else { - ZEPHIR_INIT_VAR(phql); - ZVAL_EMPTY_STRING(phql); + ZEPHIR_INIT_VAR(&phql); + ZVAL_EMPTY_STRING(&phql); } if (!placeholders) { - placeholders = ZEPHIR_GLOBAL(global_null); + placeholders = &placeholders_sub; + placeholders = &__$null; } if (!types) { - types = ZEPHIR_GLOBAL(global_null); + types = &types_sub; + types = &__$null; } - ZEPHIR_CALL_METHOD(&query, this_ptr, "createquery", NULL, 0, phql); + ZEPHIR_CALL_METHOD(&query, this_ptr, "createquery", NULL, 0, &phql); zephir_check_call_status(); if (Z_TYPE_P(placeholders) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, query, "setbindparams", NULL, 0, placeholders); + ZEPHIR_CALL_METHOD(NULL, &query, "setbindparams", NULL, 0, placeholders); zephir_check_call_status(); } if (Z_TYPE_P(types) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, query, "setbindtypes", NULL, 0, types); + ZEPHIR_CALL_METHOD(NULL, &query, "setbindtypes", NULL, 0, types); zephir_check_call_status(); } - ZEPHIR_RETURN_CALL_METHOD(query, "execute", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&query, "execute", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -2670,34 +3187,43 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, executeQuery) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, createBuilder) { - zval *_2; + zval _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *params = NULL, *dependencyInjector = NULL, *_0, *_1 = NULL, *_3; + zval *params = NULL, params_sub, __$null, dependencyInjector, _0, _1, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶ms_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶ms); if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A dependency injection object is required to access ORM services", "phalcon/mvc/model/manager.zep", 1713); return; } - ZEPHIR_INIT_VAR(_2); - zephir_create_array(_2, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_2, params); - zephir_array_fast_append(_2, dependencyInjector); - ZEPHIR_INIT_VAR(_3); - ZVAL_STRING(_3, "Phalcon\\Mvc\\Model\\Query\\Builder", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "get", NULL, 0, _3, _2); - zephir_check_temp_parameter(_3); + ZEPHIR_INIT_VAR(&_2); + zephir_create_array(&_2, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_2, params); + zephir_array_fast_append(&_2, &dependencyInjector); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Query\\Builder"); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "get", NULL, 0, &_3, &_2); zephir_check_call_status(); - RETURN_CCTOR(_1); + RETURN_CCTOR(&_1); } @@ -2706,7 +3232,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, createBuilder) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getLastQuery) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lastQuery"); @@ -2718,16 +3245,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getLastQuery) { PHP_METHOD(Phalcon_Mvc_Model_Manager, registerNamespaceAlias) { zval *alias_param = NULL, *namespaceName_param = NULL; - zval *alias = NULL, *namespaceName = NULL; + zval alias, namespaceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&namespaceName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &alias_param, &namespaceName_param); - zephir_get_strval(alias, alias_param); - zephir_get_strval(namespaceName, namespaceName_param); + zephir_get_strval(&alias, alias_param); + zephir_get_strval(&namespaceName, namespaceName_param); - zephir_update_property_array(this_ptr, SL("_namespaceAliases"), alias, namespaceName TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_namespaceAliases"), &alias, &namespaceName TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -2738,36 +3269,43 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, registerNamespaceAlias) { PHP_METHOD(Phalcon_Mvc_Model_Manager, getNamespaceAlias) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *alias_param = NULL, *namespaceName = NULL, *_0, *_1; - zval *alias = NULL, *_2; + zval *alias_param = NULL, namespaceName, _0, _1; + zval alias, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &alias_param); if (UNEXPECTED(Z_TYPE_P(alias_param) != IS_STRING && Z_TYPE_P(alias_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'alias' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'alias' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(alias_param) == IS_STRING)) { - zephir_get_strval(alias, alias_param); + zephir_get_strval(&alias, alias_param); } else { - ZEPHIR_INIT_VAR(alias); - ZVAL_EMPTY_STRING(alias); + ZEPHIR_INIT_VAR(&alias); + ZVAL_EMPTY_STRING(&alias); } - ZEPHIR_OBS_VAR(namespaceName); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_namespaceAliases"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&namespaceName, _0, alias, 0 TSRMLS_CC)) { - RETURN_CCTOR(namespaceName); + ZEPHIR_OBS_VAR(&namespaceName); + zephir_read_property(&_0, this_ptr, SL("_namespaceAliases"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&namespaceName, &_0, &alias, 0 TSRMLS_CC)) { + RETURN_CCTOR(&namespaceName); } - ZEPHIR_INIT_VAR(_1); - object_init_ex(_1, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVS(_2, "Namespace alias '", alias, "' is not registered"); - ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 9, _2); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVS(&_2, "Namespace alias '", &alias, "' is not registered"); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 4, &_2); zephir_check_call_status(); - zephir_throw_exception_debug(_1, "phalcon/mvc/model/manager.zep", 1754 TSRMLS_CC); + zephir_throw_exception_debug(&_1, "phalcon/mvc/model/manager.zep", 1754 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -2778,7 +3316,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, getNamespaceAlias) { */ PHP_METHOD(Phalcon_Mvc_Model_Manager, getNamespaceAliases) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_namespaceAliases"); @@ -2791,44 +3330,37 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, __destruct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); phalcon_orm_destroy_cache(TSRMLS_C); - ZEPHIR_CALL_CE_STATIC(NULL, phalcon_mvc_model_query_ce, "clean", &_0, 349); + ZEPHIR_CALL_CE_STATIC(NULL, phalcon_mvc_model_query_ce, "clean", &_0, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_Manager(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_Manager(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelVisibility"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_modelVisibility"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_modelVisibility"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_modelVisibility"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/manager.zep.h b/ext/phalcon/mvc/model/manager.zep.h index 7d3c6d3ecdb..a1d6c1bc925 100644 --- a/ext/phalcon/mvc/model/manager.zep.h +++ b/ext/phalcon/mvc/model/manager.zep.h @@ -68,16 +68,34 @@ PHP_METHOD(Phalcon_Mvc_Model_Manager, registerNamespaceAlias); PHP_METHOD(Phalcon_Mvc_Model_Manager, getNamespaceAlias); PHP_METHOD(Phalcon_Mvc_Model_Manager, getNamespaceAliases); PHP_METHOD(Phalcon_Mvc_Model_Manager, __destruct); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_Manager(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_Manager(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_seteventsmanager, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_seteventsmanager, 0, 1, Phalcon\\Mvc\\Model\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_seteventsmanager, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Manager", 0) +#endif ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_setcustomeventsmanager, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) @@ -87,95 +105,205 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getcustomeventsmanager, ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_initialize, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_initialize, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_initialize, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_isinitialized, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_isinitialized, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_isinitialized, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_getlastinitialized, 0, 0, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getlastinitialized, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_load, 0, 1, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_load, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, newInstance, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, newInstance) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_setmodelprefix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, prefix) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getmodelprefix, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getmodelprefix, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_setmodelsource, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) +#else ZEND_ARG_INFO(0, source) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_isvisiblemodelproperty, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_isvisiblemodelproperty, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_isvisiblemodelproperty, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getmodelsource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getmodelsource, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getmodelsource, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_setmodelschema, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getmodelschema, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getmodelschema, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getmodelschema, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_setconnectionservice, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_setwriteconnectionservice, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_setreadconnectionservice, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getreadconnection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_getreadconnection, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getreadconnection, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getwriteconnection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_getwriteconnection, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getwriteconnection, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager__getconnection, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager__getconnection, 0, 2, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager__getconnection, 0, 2, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, connectionServices) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getreadconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getreadconnectionservice, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getreadconnectionservice, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getwriteconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getwriteconnectionservice, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getwriteconnectionservice, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager__getconnectionservice, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager__getconnectionservice, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager__getconnectionservice, 0, 2, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, connectionServices) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_notifyevent, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_missingmethod, 0, 0, 3) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -186,124 +314,280 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_keepsnapshots, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keepSnapshots, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, keepSnapshots) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_iskeepingsnapshots, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_iskeepingsnapshots, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_iskeepingsnapshots, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_usedynamicupdate, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dynamicUpdate, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, dynamicUpdate) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_isusingdynamicupdate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_isusingdynamicupdate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_isusingdynamicupdate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasone, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasone, 0, 4, Phalcon\\Mvc\\Model\\Relation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasone, 0, 4, IS_OBJECT, "Phalcon\\Mvc\\Model\\Relation", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referencedModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_addbelongsto, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addbelongsto, 0, 4, Phalcon\\Mvc\\Model\\Relation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_addbelongsto, 0, 4, IS_OBJECT, "Phalcon\\Mvc\\Model\\Relation", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referencedModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmany, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmany, 0, 4, Phalcon\\Mvc\\Model\\Relation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmany, 0, 4, IS_OBJECT, "Phalcon\\Mvc\\Model\\Relation", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referencedModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmanytomany, 0, 0, 7) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmanytomany, 0, 7, Phalcon\\Mvc\\Model\\Relation, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_addhasmanytomany, 0, 7, IS_OBJECT, "Phalcon\\Mvc\\Model\\Relation", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, intermediateModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, intermediateModel) +#endif ZEND_ARG_INFO(0, intermediateFields) ZEND_ARG_INFO(0, intermediateReferencedFields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referencedModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_existsbelongsto, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existsbelongsto, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existsbelongsto, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelRelation, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelRelation) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_existshasmany, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existshasmany, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existshasmany, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelRelation, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelRelation) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_existshasone, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existshasone, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existshasone, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelRelation, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelRelation) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_existshasmanytomany, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existshasmanytomany, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_existshasmanytomany, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelRelation, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelRelation) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getrelationbyalias, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) +#else ZEND_ARG_INFO(0, alias) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager__mergefindparameters, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager__mergefindparameters, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager__mergefindparameters, 0, 2, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, findParamsOne) ZEND_ARG_INFO(0, findParamsTwo) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getrelationrecords, 0, 0, 3) ZEND_ARG_OBJ_INFO(0, relation, Phalcon\\Mvc\\Model\\RelationInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getreusablerecords, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_setreusablerecords, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, records) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getbelongstorecords, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_ARG_INFO(0, modelRelation) ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasmanyrecords, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_ARG_INFO(0, modelRelation) ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasonerecords, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_ARG_INFO(0, modelRelation) ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, parameters) @@ -317,7 +601,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasmany, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasone, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasone, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasone, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() @@ -325,55 +613,125 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasmanytomany, 0, 0, ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasoneandhasmany, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasoneandhasmany, 0, 1, Phalcon\\Mvc\\Model\\RelationInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_gethasoneandhasmany, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\RelationInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getrelations, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_getrelations, 0, 1, Phalcon\\Mvc\\Model\\RelationInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getrelations, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\RelationInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getrelationsbetween, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, first, IS_STRING, 0) +#else ZEND_ARG_INFO(0, first) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, second, IS_STRING, 0) +#else ZEND_ARG_INFO(0, second) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_createquery, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_createquery, 0, 1, Phalcon\\Mvc\\Model\\QueryInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_createquery, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\QueryInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, phql, IS_STRING, 0) +#else ZEND_ARG_INFO(0, phql) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_executequery, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_executequery, 0, 1, Phalcon\\Mvc\\Model\\QueryInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_executequery, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\QueryInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, phql, IS_STRING, 0) +#else ZEND_ARG_INFO(0, phql) +#endif ZEND_ARG_INFO(0, placeholders) ZEND_ARG_INFO(0, types) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_createbuilder, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_createbuilder, 0, 0, Phalcon\\Mvc\\Model\\Query\\BuilderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_createbuilder, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\BuilderInterface", 0) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_manager_getlastquery, 0, 0, Phalcon\\Mvc\\Model\\QueryInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getlastquery, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\QueryInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_registernamespacealias, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) +#else ZEND_ARG_INFO(0, alias) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespaceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespaceName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_manager_getnamespacealias, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getnamespacealias, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getnamespacealias, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) +#else ZEND_ARG_INFO(0, alias) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getnamespacealiases, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_manager_getnamespacealiases, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_manager_method_entry) { PHP_ME(Phalcon_Mvc_Model_Manager, setDI, arginfo_phalcon_mvc_model_manager_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Manager, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Manager, getDI, arginfo_phalcon_mvc_model_manager_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, setEventsManager, arginfo_phalcon_mvc_model_manager_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Manager, getEventsManager, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Manager, getEventsManager, arginfo_phalcon_mvc_model_manager_geteventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, setCustomEventsManager, arginfo_phalcon_mvc_model_manager_setcustomeventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, getCustomEventsManager, arginfo_phalcon_mvc_model_manager_getcustomeventsmanager, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, initialize, arginfo_phalcon_mvc_model_manager_initialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, isInitialized, arginfo_phalcon_mvc_model_manager_isinitialized, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Manager, getLastInitialized, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Manager, getLastInitialized, arginfo_phalcon_mvc_model_manager_getlastinitialized, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, load, arginfo_phalcon_mvc_model_manager_load, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, setModelPrefix, arginfo_phalcon_mvc_model_manager_setmodelprefix, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Manager, getModelPrefix, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Manager, getModelPrefix, arginfo_phalcon_mvc_model_manager_getmodelprefix, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, setModelSource, arginfo_phalcon_mvc_model_manager_setmodelsource, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, isVisibleModelProperty, arginfo_phalcon_mvc_model_manager_isvisiblemodelproperty, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Manager, getModelSource, arginfo_phalcon_mvc_model_manager_getmodelsource, ZEND_ACC_PUBLIC) @@ -422,10 +780,10 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_manager_method_entry) { PHP_ME(Phalcon_Mvc_Model_Manager, createQuery, arginfo_phalcon_mvc_model_manager_createquery, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, executeQuery, arginfo_phalcon_mvc_model_manager_executequery, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, createBuilder, arginfo_phalcon_mvc_model_manager_createbuilder, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Manager, getLastQuery, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Manager, getLastQuery, arginfo_phalcon_mvc_model_manager_getlastquery, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, registerNamespaceAlias, arginfo_phalcon_mvc_model_manager_registernamespacealias, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, getNamespaceAlias, arginfo_phalcon_mvc_model_manager_getnamespacealias, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Manager, getNamespaceAliases, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Manager, getNamespaceAliases, arginfo_phalcon_mvc_model_manager_getnamespacealiases, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Manager, __destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/managerinterface.zep.h b/ext/phalcon/mvc/model/managerinterface.zep.h index 1edd269c262..ea945c83c8d 100644 --- a/ext/phalcon/mvc/model/managerinterface.zep.h +++ b/ext/phalcon/mvc/model/managerinterface.zep.h @@ -9,66 +9,141 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_setmodelsource, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) +#else ZEND_ARG_INFO(0, source) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getmodelsource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getmodelsource, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getmodelsource, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_setmodelschema, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, schema, IS_STRING, 0) +#else ZEND_ARG_INFO(0, schema) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getmodelschema, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getmodelschema, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getmodelschema, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_setconnectionservice, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_setreadconnectionservice, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getreadconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getreadconnectionservice, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getreadconnectionservice, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_setwriteconnectionservice, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getwriteconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getwriteconnectionservice, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getwriteconnectionservice, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getreadconnection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getreadconnection, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getreadconnection, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getwriteconnection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getwriteconnection, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getwriteconnection, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_isinitialized, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_isinitialized, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_isinitialized, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getlastinitialized, 0, 0, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getlastinitialized, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_load, 0, 1, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_load, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, newInstance, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, newInstance) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasone, 0, 0, 4) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referencedModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() @@ -76,7 +151,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addbelongsto, 0, 0, 4) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referencedModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() @@ -84,45 +163,97 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addhasmany, 0, 0, 4) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, fields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referencedModel) +#endif ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_existsbelongsto, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelRelation, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelRelation) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_existshasmany, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelRelation, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelRelation) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_existshasone, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelRelation, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelRelation) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getbelongstorecords, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_ARG_INFO(0, modelRelation) ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_gethasmanyrecords, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_ARG_INFO(0, modelRelation) ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_gethasonerecords, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) +#else ZEND_ARG_INFO(0, method) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_ARG_INFO(0, modelRelation) ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, parameters) @@ -145,20 +276,40 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_gethasoneandha ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getrelations, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getrelationsbetween, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, first, IS_STRING, 0) +#else ZEND_ARG_INFO(0, first) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, second, IS_STRING, 0) +#else ZEND_ARG_INFO(0, second) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_createquery, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, phql, IS_STRING, 0) +#else ZEND_ARG_INFO(0, phql) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_executequery, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, phql, IS_STRING, 0) +#else ZEND_ARG_INFO(0, phql) +#endif ZEND_ARG_INFO(0, placeholders) ZEND_ARG_INFO(0, types) ZEND_END_ARG_INFO() @@ -173,19 +324,35 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_addbehavior, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_notifyevent, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_missingmethod, 0, 0, 3) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_managerinterface_getrelationbyalias, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, modelName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, modelName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) +#else ZEND_ARG_INFO(0, alias) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_managerinterface_method_entry) { @@ -202,7 +369,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_managerinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ManagerInterface, getReadConnection, arginfo_phalcon_mvc_model_managerinterface_getreadconnection) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ManagerInterface, getWriteConnection, arginfo_phalcon_mvc_model_managerinterface_getwriteconnection) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ManagerInterface, isInitialized, arginfo_phalcon_mvc_model_managerinterface_isinitialized) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ManagerInterface, getLastInitialized, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ManagerInterface, getLastInitialized, arginfo_phalcon_mvc_model_managerinterface_getlastinitialized) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ManagerInterface, load, arginfo_phalcon_mvc_model_managerinterface_load) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ManagerInterface, addHasOne, arginfo_phalcon_mvc_model_managerinterface_addhasone) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ManagerInterface, addBelongsTo, arginfo_phalcon_mvc_model_managerinterface_addbelongsto) diff --git a/ext/phalcon/mvc/model/message.zep.c b/ext/phalcon/mvc/model/message.zep.c index 2b777f4875c..907092acb09 100644 --- a/ext/phalcon/mvc/model/message.zep.c +++ b/ext/phalcon/mvc/model/message.zep.c @@ -76,7 +76,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Message) { */ PHP_METHOD(Phalcon_Mvc_Model_Message, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -86,7 +87,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, getType) { */ PHP_METHOD(Phalcon_Mvc_Model_Message, getMessage) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_message"); @@ -104,30 +106,41 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, getMessage) { PHP_METHOD(Phalcon_Mvc_Model_Message, __construct) { zend_long code; - zval *message_param = NULL, *field = NULL, *type = NULL, *model = NULL, *code_param = NULL, *_0; - zval *message = NULL; + zval *message_param = NULL, *field = NULL, field_sub, *type = NULL, type_sub, *model = NULL, model_sub, *code_param = NULL, __$null, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&field_sub); + ZVAL_UNDEF(&type_sub); + ZVAL_UNDEF(&model_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 4, &message_param, &field, &type, &model, &code_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!field) { - field = ZEPHIR_GLOBAL(global_null); + field = &field_sub; + field = &__$null; } if (!type) { - type = ZEPHIR_GLOBAL(global_null); + type = &type_sub; + type = &__$null; } if (!model) { - model = ZEPHIR_GLOBAL(global_null); + model = &model_sub; + model = &__$null; } if (!code_param) { code = 0; @@ -136,14 +149,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, __construct) { } - zephir_update_property_this(getThis(), SL("_message"), message TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_field"), field TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_message"), &message); + zephir_update_property_zval(this_ptr, SL("_field"), field); + zephir_update_property_zval(this_ptr, SL("_type"), type); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, code); - zephir_update_property_this(getThis(), SL("_code"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, code); + zephir_update_property_zval(this_ptr, SL("_code"), &_0); if (Z_TYPE_P(model) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_model"), model TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_model"), model); } ZEPHIR_MM_RESTORE(); @@ -155,24 +168,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, __construct) { PHP_METHOD(Phalcon_Mvc_Model_Message, setType) { zval *type_param = NULL; - zval *type = NULL; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &type_param); if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) { - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); } else { - ZEPHIR_INIT_VAR(type); - ZVAL_EMPTY_STRING(type); + ZEPHIR_INIT_VAR(&type); + ZVAL_EMPTY_STRING(&type); } - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), &type); RETURN_THIS(); } @@ -183,24 +199,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, setType) { PHP_METHOD(Phalcon_Mvc_Model_Message, setMessage) { zval *message_param = NULL; - zval *message = NULL; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &message_param); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } - zephir_update_property_this(getThis(), SL("_message"), message TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_message"), &message); RETURN_THIS(); } @@ -210,13 +229,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, setMessage) { */ PHP_METHOD(Phalcon_Mvc_Model_Message, setField) { - zval *field; + zval *field, field_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&field_sub); zephir_fetch_params(0, 1, 0, &field); - zephir_update_property_this(getThis(), SL("_field"), field TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_field"), field); RETURN_THISW(); } @@ -226,7 +248,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, setField) { */ PHP_METHOD(Phalcon_Mvc_Model_Message, getField) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_field"); @@ -237,13 +260,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, getField) { */ PHP_METHOD(Phalcon_Mvc_Model_Message, setModel) { - zval *model; + zval *model, model_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); zephir_fetch_params(0, 1, 0, &model); - zephir_update_property_this(getThis(), SL("_model"), model TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_model"), model); RETURN_THISW(); } @@ -253,8 +279,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, setModel) { */ PHP_METHOD(Phalcon_Mvc_Model_Message, setCode) { - zval *code_param = NULL, *_0; + zval *code_param = NULL, _0; zend_long code; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &code_param); @@ -262,8 +291,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, setCode) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, code); - zephir_update_property_this(getThis(), SL("_code"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, code); + zephir_update_property_zval(this_ptr, SL("_code"), &_0); RETURN_THISW(); } @@ -273,7 +302,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, setCode) { */ PHP_METHOD(Phalcon_Mvc_Model_Message, getModel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_model"); @@ -284,7 +314,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, getModel) { */ PHP_METHOD(Phalcon_Mvc_Model_Message, getCode) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_code"); @@ -295,7 +326,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, getCode) { */ PHP_METHOD(Phalcon_Mvc_Model_Message, __toString) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_message"); @@ -307,21 +339,28 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, __toString) { PHP_METHOD(Phalcon_Mvc_Model_Message, __set_state) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *_0, *_1, *_2, *_3; - zval *message = NULL; + zval *message_param = NULL, _0, _1, _2, _3; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &message_param); - message = message_param; + ZEPHIR_OBS_COPY_OR_DUP(&message, message_param); object_init_ex(return_value, phalcon_mvc_model_message_ce); - zephir_array_fetch_string(&_0, message, SL("_message"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC); - zephir_array_fetch_string(&_1, message, SL("_field"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC); - zephir_array_fetch_string(&_2, message, SL("_type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC); - zephir_array_fetch_string(&_3, message, SL("_code"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 8, _0, _1, _2, _3); + zephir_array_fetch_string(&_0, &message, SL("_message"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC); + zephir_array_fetch_string(&_1, &message, SL("_field"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC); + zephir_array_fetch_string(&_2, &message, SL("_type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC); + zephir_array_fetch_string(&_3, &message, SL("_code"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/message.zep", 172 TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 3, &_0, &_1, &_2, &_3); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/mvc/model/message.zep.h b/ext/phalcon/mvc/model/message.zep.h index 676f1643e15..dfe14e145f0 100644 --- a/ext/phalcon/mvc/model/message.zep.h +++ b/ext/phalcon/mvc/model/message.zep.h @@ -17,41 +17,120 @@ PHP_METHOD(Phalcon_Mvc_Model_Message, getCode); PHP_METHOD(Phalcon_Mvc_Model_Message, __toString); PHP_METHOD(Phalcon_Mvc_Model_Message, __set_state); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_gettype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_gettype, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_getmessage, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_getmessage, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_message___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_INFO(0, field) ZEND_ARG_INFO(0, type) ZEND_ARG_INFO(0, model) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 1) +#else ZEND_ARG_INFO(0, code) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_message_settype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_message_settype, 0, 1, Phalcon\\Mvc\\Model\\Message, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_settype, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Message", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_message_setmessage, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_message_setmessage, 0, 1, Phalcon\\Mvc\\Model\\Message, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_setmessage, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Message", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_message_setfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_message_setfield, 0, 1, Phalcon\\Mvc\\Model\\Message, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_setfield, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Message", 0) +#endif ZEND_ARG_INFO(0, field) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_message_setmodel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_message_setmodel, 0, 1, Phalcon\\Mvc\\Model\\Message, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_setmodel, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Message", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_message_setcode, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_message_setcode, 0, 1, Phalcon\\Mvc\\Model\\Message, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_setcode, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Message", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) +#else ZEND_ARG_INFO(0, code) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_message_getmodel, 0, 0, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_getmodel, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_getcode, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message_getcode, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message___tostring, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message___tostring, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_message___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_message___set_state, 0, 1, Phalcon\\Mvc\\Model\\MessageInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_message___set_state, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\MessageInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, message, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_message_method_entry) { - PHP_ME(Phalcon_Mvc_Model_Message, getType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Message, getMessage, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Message, getType, arginfo_phalcon_mvc_model_message_gettype, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Message, getMessage, arginfo_phalcon_mvc_model_message_getmessage, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Message, __construct, arginfo_phalcon_mvc_model_message___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Message, setType, arginfo_phalcon_mvc_model_message_settype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Message, setMessage, arginfo_phalcon_mvc_model_message_setmessage, ZEND_ACC_PUBLIC) @@ -59,9 +138,9 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_message_method_entry) { PHP_ME(Phalcon_Mvc_Model_Message, getField, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Message, setModel, arginfo_phalcon_mvc_model_message_setmodel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Message, setCode, arginfo_phalcon_mvc_model_message_setcode, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Message, getModel, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Message, getCode, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Message, __toString, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Message, getModel, arginfo_phalcon_mvc_model_message_getmodel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Message, getCode, arginfo_phalcon_mvc_model_message_getcode, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Message, __toString, arginfo_phalcon_mvc_model_message___tostring, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Message, __set_state, arginfo_phalcon_mvc_model_message___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/messageinterface.zep.h b/ext/phalcon/mvc/model/messageinterface.zep.h index c93f765d27f..90657f7c325 100644 --- a/ext/phalcon/mvc/model/messageinterface.zep.h +++ b/ext/phalcon/mvc/model/messageinterface.zep.h @@ -4,18 +4,37 @@ extern zend_class_entry *phalcon_mvc_model_messageinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MessageInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface_settype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface_setmessage, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface_setfield, 0, 0, 1) ZEND_ARG_INFO(0, field) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___set_state, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___tostring, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___tostring, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___set_state, 0, 1, Phalcon\\Mvc\\Model\\MessageInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_messageinterface___set_state, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\MessageInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, message, 0) ZEND_END_ARG_INFO() @@ -26,7 +45,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_messageinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Model_MessageInterface, getMessage, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_MessageInterface, setField, arginfo_phalcon_mvc_model_messageinterface_setfield) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_MessageInterface, getField, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_MessageInterface, __toString, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_MessageInterface, __toString, arginfo_phalcon_mvc_model_messageinterface___tostring) ZEND_FENTRY(__set_state, NULL, arginfo_phalcon_mvc_model_messageinterface___set_state, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/metadata.zep.c b/ext/phalcon/mvc/model/metadata.zep.c index 5db7426b7da..aaa1df0e260 100644 --- a/ext/phalcon/mvc/model/metadata.zep.c +++ b/ext/phalcon/mvc/model/metadata.zep.c @@ -53,37 +53,37 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData) { zend_declare_property_null(phalcon_mvc_model_metadata_ce, SL("_columnMap"), ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_ATTRIBUTES"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_ATTRIBUTES"), 0); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_PRIMARY_KEY"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_PRIMARY_KEY"), 1); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_NON_PRIMARY_KEY"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_NON_PRIMARY_KEY"), 2); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_NOT_NULL"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_NOT_NULL"), 3); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATA_TYPES"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATA_TYPES"), 4); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATA_TYPES_NUMERIC"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATA_TYPES_NUMERIC"), 5); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATE_AT"), 6 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATE_AT"), 6); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATE_IN"), 7 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATE_IN"), 7); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_IDENTITY_COLUMN"), 8 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_IDENTITY_COLUMN"), 8); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATA_TYPES_BIND"), 9 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DATA_TYPES_BIND"), 9); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_AUTOMATIC_DEFAULT_INSERT"), 10 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_AUTOMATIC_DEFAULT_INSERT"), 10); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_AUTOMATIC_DEFAULT_UPDATE"), 11 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_AUTOMATIC_DEFAULT_UPDATE"), 11); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DEFAULT_VALUES"), 12 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_DEFAULT_VALUES"), 12); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_EMPTY_STRING_VALUES"), 13 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_EMPTY_STRING_VALUES"), 13); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_COLUMN_MAP"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_COLUMN_MAP"), 0); - zend_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_REVERSE_COLUMN_MAP"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_metadata_ce, SL("MODELS_REVERSE_COLUMN_MAP"), 1); zend_class_implements(phalcon_mvc_model_metadata_ce TSRMLS_CC, 1, phalcon_di_injectionawareinterface_ce); zend_class_implements(phalcon_mvc_model_metadata_ce TSRMLS_CC, 1, phalcon_mvc_model_metadatainterface_ce); @@ -97,52 +97,70 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, _initialize) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *key, *table, *schema, *strategy = NULL, *className = NULL, *metaData = NULL, *data = NULL, *modelMetadata = NULL, *modelColumnMap = NULL, *dependencyInjector = NULL, *keyName = NULL, *prefixKey = NULL, *_2, *_0$$8, *_1$$8; + zval *model, model_sub, *key, key_sub, *table, table_sub, *schema, schema_sub, strategy, className, metaData, data, modelMetadata, modelColumnMap, dependencyInjector, keyName, prefixKey, _2, _0$$8, _1$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&key_sub); + ZVAL_UNDEF(&table_sub); + ZVAL_UNDEF(&schema_sub); + ZVAL_UNDEF(&strategy); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&modelMetadata); + ZVAL_UNDEF(&modelColumnMap); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&prefixKey); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$8); + ZVAL_UNDEF(&_1$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &model, &key, &table, &schema); - ZEPHIR_INIT_VAR(strategy); - ZVAL_NULL(strategy); - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, model, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&strategy); + ZVAL_NULL(&strategy); + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, model, 0 TSRMLS_CC); if (Z_TYPE_P(key) != IS_NULL) { - ZEPHIR_OBS_VAR(metaData); - zephir_read_property_this(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); - if (!(zephir_array_isset(metaData, key))) { - ZEPHIR_INIT_VAR(prefixKey); - ZEPHIR_CONCAT_SV(prefixKey, "meta-", key); - ZEPHIR_CALL_METHOD(&data, this_ptr, "read", NULL, 0, prefixKey); + ZEPHIR_OBS_VAR(&metaData); + zephir_read_property(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); + if (!(zephir_array_isset(&metaData, key))) { + ZEPHIR_INIT_VAR(&prefixKey); + ZEPHIR_CONCAT_SV(&prefixKey, "meta-", key); + ZEPHIR_CALL_METHOD(&data, this_ptr, "read", NULL, 0, &prefixKey); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_NULL) { - zephir_update_property_array(this_ptr, SL("_metaData"), key, data TSRMLS_CC); + if (Z_TYPE_P(&data) != IS_NULL) { + zephir_update_property_array(this_ptr, SL("_metaData"), key, &data TSRMLS_CC); } else { - if ((zephir_method_exists_ex(model, SS("metadata") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(model, SL("metadata") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(&modelMetadata, model, "metadata", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(modelMetadata) != IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$8); - object_init_ex(_0$$8, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_1$$8); - ZEPHIR_CONCAT_SV(_1$$8, "Invalid meta-data for model ", className); - ZEPHIR_CALL_METHOD(NULL, _0$$8, "__construct", NULL, 9, _1$$8); + if (Z_TYPE_P(&modelMetadata) != IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$8); + object_init_ex(&_0$$8, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_1$$8); + ZEPHIR_CONCAT_SV(&_1$$8, "Invalid meta-data for model ", &className); + ZEPHIR_CALL_METHOD(NULL, &_0$$8, "__construct", NULL, 4, &_1$$8); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$8, "phalcon/mvc/model/metadata.zep", 122 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$8, "phalcon/mvc/model/metadata.zep", 122 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); ZEPHIR_CALL_METHOD(&strategy, this_ptr, "getstrategy", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&modelMetadata, strategy, "getmetadata", NULL, 0, model, dependencyInjector); + ZEPHIR_CALL_METHOD(&modelMetadata, &strategy, "getmetadata", NULL, 0, model, &dependencyInjector); zephir_check_call_status(); } - zephir_update_property_array(this_ptr, SL("_metaData"), key, modelMetadata TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, prefixKey, modelMetadata); + zephir_update_property_array(this_ptr, SL("_metaData"), key, &modelMetadata TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &prefixKey, &modelMetadata); zephir_check_call_status(); } } @@ -150,30 +168,30 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, _initialize) { if (!(ZEPHIR_GLOBAL(orm).column_renaming)) { RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(keyName); - zephir_fast_strtolower(keyName, className); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_columnMap"), PH_NOISY_CC); - if (zephir_array_isset(_2, keyName)) { + ZEPHIR_INIT_VAR(&keyName); + zephir_fast_strtolower(&keyName, &className); + zephir_read_property(&_2, this_ptr, SL("_columnMap"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_2, &keyName)) { RETURN_MM_NULL(); } - ZEPHIR_INIT_NVAR(prefixKey); - ZEPHIR_CONCAT_SV(prefixKey, "map-", keyName); - ZEPHIR_CALL_METHOD(&data, this_ptr, "read", NULL, 0, prefixKey); + ZEPHIR_INIT_NVAR(&prefixKey); + ZEPHIR_CONCAT_SV(&prefixKey, "map-", &keyName); + ZEPHIR_CALL_METHOD(&data, this_ptr, "read", NULL, 0, &prefixKey); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_NULL) { - zephir_update_property_array(this_ptr, SL("_columnMap"), keyName, data TSRMLS_CC); + if (Z_TYPE_P(&data) != IS_NULL) { + zephir_update_property_array(this_ptr, SL("_columnMap"), &keyName, &data TSRMLS_CC); RETURN_MM_NULL(); } - if (Z_TYPE_P(strategy) != IS_OBJECT) { - ZEPHIR_OBS_NVAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&strategy) != IS_OBJECT) { + ZEPHIR_OBS_NVAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); ZEPHIR_CALL_METHOD(&strategy, this_ptr, "getstrategy", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&modelColumnMap, strategy, "getcolumnmaps", NULL, 0, model, dependencyInjector); + ZEPHIR_CALL_METHOD(&modelColumnMap, &strategy, "getcolumnmaps", NULL, 0, model, &dependencyInjector); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_columnMap"), keyName, modelColumnMap TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, prefixKey, modelColumnMap); + zephir_update_property_array(this_ptr, SL("_columnMap"), &keyName, &modelColumnMap TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &prefixKey, &modelColumnMap); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -184,13 +202,16 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, _initialize) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -199,7 +220,8 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setDI) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -210,13 +232,16 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDI) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setStrategy) { - zval *strategy; + zval *strategy, strategy_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&strategy_sub); zephir_fetch_params(0, 1, 0, &strategy); - zephir_update_property_this(getThis(), SL("_strategy"), strategy TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_strategy"), strategy); } @@ -225,21 +250,25 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setStrategy) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getStrategy) { - zval *_0, *_1$$3; + zval _0, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_strategy"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_mvc_model_metadata_strategy_introspection_ce); - if (zephir_has_constructor(_1$$3 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 0); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_strategy"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_mvc_model_metadata_strategy_introspection_ce); + if (zephir_has_constructor(&_1$$3 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_strategy"), _1$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_strategy"), &_1$$3); } RETURN_MM_MEMBER(getThis(), "_strategy"); @@ -259,7 +288,17 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getStrategy) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, readMetaData) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *source = NULL, *schema = NULL, *key = NULL, *_0, *_1, *_2, *_3; + zval *model, model_sub, source, schema, key, _0, _1, _2, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); @@ -270,18 +309,18 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readMetaData) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&schema, model, "getschema", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 1 TSRMLS_CC); - ZEPHIR_INIT_VAR(key); - ZEPHIR_CONCAT_VSVV(key, _0, "-", schema, source); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - if (!(zephir_array_isset(_1, key))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 10, model, key, source, schema); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&key); + ZEPHIR_CONCAT_VSVV(&key, &_0, "-", &schema, &source); + zephir_read_property(&_1, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_1, &key))) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 5, model, &key, &source, &schema); zephir_check_call_status(); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - zephir_array_fetch(&_3, _2, key, PH_NOISY | PH_READONLY, "phalcon/mvc/model/metadata.zep", 254 TSRMLS_CC); - RETURN_CTOR(_3); + zephir_read_property(&_2, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_3, &_2, &key, PH_NOISY | PH_READONLY, "phalcon/mvc/model/metadata.zep", 254 TSRMLS_CC); + RETURN_CTOR(&_3); } @@ -300,7 +339,19 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readMetaData) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, readMetaDataIndex) { zend_long index, ZEPHIR_LAST_CALL_STATUS; - zval *model, *index_param = NULL, *source = NULL, *schema = NULL, *key = NULL, *_0, *_1, *_2, *_3, *_4, *_5; + zval *model, model_sub, *index_param = NULL, source, schema, key, _0, _1, _2, _3, _4, _5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &index_param); @@ -312,20 +363,20 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readMetaDataIndex) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&schema, model, "getschema", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_0); - zephir_get_class(_0, model, 1 TSRMLS_CC); - ZEPHIR_INIT_VAR(key); - ZEPHIR_CONCAT_VSVV(key, _0, "-", schema, source); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - zephir_array_fetch(&_2, _1, key, PH_READONLY, "phalcon/mvc/model/metadata.zep", 281 TSRMLS_CC); - if (!(zephir_array_isset_long(_2, index))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 10, model, key, source, schema); + ZEPHIR_INIT_VAR(&_0); + zephir_get_class(&_0, model, 1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&key); + ZEPHIR_CONCAT_VSVV(&key, &_0, "-", &schema, &source); + zephir_read_property(&_1, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_2, &_1, &key, PH_READONLY, "phalcon/mvc/model/metadata.zep", 281 TSRMLS_CC); + if (!(zephir_array_isset_long(&_2, index))) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 5, model, &key, &source, &schema); zephir_check_call_status(); } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - zephir_array_fetch(&_4, _3, key, PH_NOISY | PH_READONLY, "phalcon/mvc/model/metadata.zep", 285 TSRMLS_CC); - zephir_array_fetch_long(&_5, _4, index, PH_NOISY | PH_READONLY, "phalcon/mvc/model/metadata.zep", 285 TSRMLS_CC); - RETURN_CTOR(_5); + zephir_read_property(&_3, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_4, &_3, &key, PH_NOISY | PH_READONLY, "phalcon/mvc/model/metadata.zep", 285 TSRMLS_CC); + zephir_array_fetch_long(&_5, &_4, index, PH_NOISY | PH_READONLY, "phalcon/mvc/model/metadata.zep", 285 TSRMLS_CC); + RETURN_CTOR(&_5); } @@ -348,7 +399,16 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, writeMetaDataIndex) { zend_bool _0, _1; zend_long index, ZEPHIR_LAST_CALL_STATUS; - zval *model, *index_param = NULL, *data, *source = NULL, *schema = NULL, *key = NULL, *_2, *_3; + zval *model, model_sub, *index_param = NULL, *data, data_sub, source, schema, key, _2, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &model, &index_param, &data); @@ -362,7 +422,7 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, writeMetaDataIndex) { } _1 = _0; if (_1) { - _1 = Z_TYPE_P(data) != IS_BOOL; + _1 = ((Z_TYPE_P(data) == IS_TRUE || Z_TYPE_P(data) == IS_FALSE) != 1); } if (_1) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid data for index", "phalcon/mvc/model/metadata.zep", 308); @@ -372,16 +432,16 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, writeMetaDataIndex) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&schema, model, "getschema", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2); - zephir_get_class(_2, model, 1 TSRMLS_CC); - ZEPHIR_INIT_VAR(key); - ZEPHIR_CONCAT_VSVV(key, _2, "-", schema, source); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - if (!(zephir_array_isset(_3, key))) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 10, model, key, source, schema); + ZEPHIR_INIT_VAR(&_2); + zephir_get_class(&_2, model, 1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&key); + ZEPHIR_CONCAT_VSVV(&key, &_2, "-", &schema, &source); + zephir_read_property(&_3, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset(&_3, &key))) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 5, model, &key, &source, &schema); zephir_check_call_status(); } - zephir_update_property_array_multi(this_ptr, SL("_metaData"), &data TSRMLS_CC, SL("zl"), 2, key, index); + zephir_update_property_array_multi(this_ptr, SL("_metaData"), data TSRMLS_CC, SL("zl"), 2, &key, index); ZEPHIR_MM_RESTORE(); } @@ -400,7 +460,16 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, writeMetaDataIndex) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMap) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *keyName = NULL, *data = NULL, *_0, *_1$$4, *_2$$4, *_3$$4, *_4$$4; + zval *model, model_sub, keyName, data, _0, _1$$4, _2$$4, _3$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); @@ -410,24 +479,21 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMap) { if (!(ZEPHIR_GLOBAL(orm).column_renaming)) { RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(keyName); - zephir_get_class(keyName, model, 1 TSRMLS_CC); - ZEPHIR_OBS_VAR(data); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_columnMap"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&data, _0, keyName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_NULL(_1$$4); - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_NULL(_2$$4); - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_NULL(_3$$4); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 10, model, _1$$4, _2$$4, _3$$4); + ZEPHIR_INIT_VAR(&keyName); + zephir_get_class(&keyName, model, 1 TSRMLS_CC); + ZEPHIR_OBS_VAR(&data); + zephir_read_property(&_0, this_ptr, SL("_columnMap"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&data, &_0, &keyName, 0 TSRMLS_CC))) { + ZVAL_NULL(&_1$$4); + ZVAL_NULL(&_2$$4); + ZVAL_NULL(&_3$$4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 5, model, &_1$$4, &_2$$4, &_3$$4); zephir_check_call_status(); - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_columnMap"), PH_NOISY_CC); - ZEPHIR_OBS_NVAR(data); - zephir_array_fetch(&data, _4$$4, keyName, PH_NOISY, "phalcon/mvc/model/metadata.zep", 348 TSRMLS_CC); + zephir_read_property(&_1$$4, this_ptr, SL("_columnMap"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_OBS_NVAR(&data); + zephir_array_fetch(&data, &_1$$4, &keyName, PH_NOISY, "phalcon/mvc/model/metadata.zep", 348 TSRMLS_CC); } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -446,7 +512,17 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMap) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMapIndex) { zend_long index, ZEPHIR_LAST_CALL_STATUS; - zval *model, *index_param = NULL, *keyName = NULL, *columnMapModel = NULL, *map = NULL, *_0, *_1$$4, *_2$$4, *_3$$4, *_4$$4; + zval *model, model_sub, *index_param = NULL, keyName, columnMapModel, map, _0, _1$$4, _2$$4, _3$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&keyName); + ZVAL_UNDEF(&columnMapModel); + ZVAL_UNDEF(&map); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &index_param); @@ -457,25 +533,22 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMapIndex) { if (!(ZEPHIR_GLOBAL(orm).column_renaming)) { RETURN_MM_NULL(); } - ZEPHIR_INIT_VAR(keyName); - zephir_get_class(keyName, model, 1 TSRMLS_CC); - ZEPHIR_OBS_VAR(columnMapModel); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_columnMap"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&columnMapModel, _0, keyName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_NULL(_1$$4); - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_NULL(_2$$4); - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_NULL(_3$$4); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 10, model, _1$$4, _2$$4, _3$$4); + ZEPHIR_INIT_VAR(&keyName); + zephir_get_class(&keyName, model, 1 TSRMLS_CC); + ZEPHIR_OBS_VAR(&columnMapModel); + zephir_read_property(&_0, this_ptr, SL("_columnMap"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&columnMapModel, &_0, &keyName, 0 TSRMLS_CC))) { + ZVAL_NULL(&_1$$4); + ZVAL_NULL(&_2$$4); + ZVAL_NULL(&_3$$4); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_initialize", NULL, 5, model, &_1$$4, &_2$$4, &_3$$4); zephir_check_call_status(); - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_columnMap"), PH_NOISY_CC); - ZEPHIR_OBS_NVAR(columnMapModel); - zephir_array_fetch(&columnMapModel, _4$$4, keyName, PH_NOISY, "phalcon/mvc/model/metadata.zep", 378 TSRMLS_CC); + zephir_read_property(&_1$$4, this_ptr, SL("_columnMap"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_OBS_NVAR(&columnMapModel); + zephir_array_fetch(&columnMapModel, &_1$$4, &keyName, PH_NOISY, "phalcon/mvc/model/metadata.zep", 378 TSRMLS_CC); } - zephir_array_isset_long_fetch(&map, columnMapModel, index, 1 TSRMLS_CC); - RETURN_CTOR(map); + zephir_array_isset_long_fetch(&map, &columnMapModel, index, 1 TSRMLS_CC); + RETURN_CTOR(&map); } @@ -493,22 +566,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, readColumnMapIndex) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 0); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 402); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -526,22 +603,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getPrimaryKeyAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 1); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 1); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 423); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -559,22 +640,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getPrimaryKeyAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getNonPrimaryKeyAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 2); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 2); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 444); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -592,22 +677,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getNonPrimaryKeyAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getNotNullAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 3); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 3); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 465); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -625,22 +714,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getNotNullAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDataTypes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 4); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 4); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 486); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -658,22 +751,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDataTypes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDataTypesNumeric) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 5); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 5); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 507); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -694,16 +791,19 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDataTypesNumeric) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getIdentityField) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *_0; + zval *model, model_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 8); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 8); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); RETURN_MM(); @@ -723,22 +823,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getIdentityField) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getBindTypes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 9); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 9); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 547); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -756,22 +860,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getBindTypes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAutomaticCreateAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 10); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 10); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 568); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -789,22 +897,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAutomaticCreateAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAutomaticUpdateAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 11); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 11); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 589); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -823,18 +935,22 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getAutomaticUpdateAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, setAutomaticCreateAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes = NULL; - zval *model, *attributes_param = NULL, *_0; + zval attributes; + zval *model, model_sub, *attributes_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&attributes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &attributes_param); - zephir_get_arrval(attributes, attributes_param); + zephir_get_arrval(&attributes, attributes_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 10); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 12, model, _0, attributes); + ZVAL_LONG(&_0, 10); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 7, model, &_0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -855,18 +971,22 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setAutomaticCreateAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, setAutomaticUpdateAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes = NULL; - zval *model, *attributes_param = NULL, *_0; + zval attributes; + zval *model, model_sub, *attributes_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&attributes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &attributes_param); - zephir_get_arrval(attributes, attributes_param); + zephir_get_arrval(&attributes, attributes_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 11); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 12, model, _0, attributes); + ZVAL_LONG(&_0, 11); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 7, model, &_0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -887,18 +1007,22 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setAutomaticUpdateAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, setEmptyStringAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes = NULL; - zval *model, *attributes_param = NULL, *_0; + zval attributes; + zval *model, model_sub, *attributes_param = NULL, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&attributes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &attributes_param); - zephir_get_arrval(attributes, attributes_param); + zephir_get_arrval(&attributes, attributes_param); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 13); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 12, model, _0, attributes); + ZVAL_LONG(&_0, 13); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "writemetadataindex", NULL, 7, model, &_0, &attributes); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -918,22 +1042,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, setEmptyStringAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getEmptyStringAttributes) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 13); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 13); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 661); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -951,22 +1079,26 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getEmptyStringAttributes) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, getDefaultValues) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 12); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 11, model, _0); + ZVAL_LONG(&_0, 12); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readmetadataindex", NULL, 6, model, &_0); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { + if (Z_TYPE_P(&data) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 682); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -985,26 +1117,30 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getColumnMap) { zend_bool _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 0); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 13, model, _0); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 8, model, &_0); zephir_check_call_status(); - _1 = Z_TYPE_P(data) != IS_NULL; + _1 = Z_TYPE_P(&data) != IS_NULL; if (_1) { - _1 = Z_TYPE_P(data) != IS_ARRAY; + _1 = Z_TYPE_P(&data) != IS_ARRAY; } if (_1) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 704); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -1023,26 +1159,30 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getReverseColumnMap) { zend_bool _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *data = NULL, *_0; + zval *model, model_sub, data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &model); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 1); - ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 13, model, _0); + ZVAL_LONG(&_0, 1); + ZEPHIR_CALL_METHOD(&data, this_ptr, "readcolumnmapindex", NULL, 8, model, &_0); zephir_check_call_status(); - _1 = Z_TYPE_P(data) != IS_NULL; + _1 = Z_TYPE_P(&data) != IS_NULL; if (_1) { - _1 = Z_TYPE_P(data) != IS_ARRAY; + _1 = Z_TYPE_P(&data) != IS_ARRAY; } if (_1) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The meta-data is invalid or is corrupt", "phalcon/mvc/model/metadata.zep", 726); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -1061,24 +1201,31 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, getReverseColumnMap) { PHP_METHOD(Phalcon_Mvc_Model_MetaData, hasAttribute) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attribute = NULL; - zval *model, *attribute_param = NULL, *columnMap = NULL, *_0$$4 = NULL, *_1$$4; + zval attribute; + zval *model, model_sub, *attribute_param = NULL, columnMap, _0$$4, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&attribute); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &attribute_param); - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); ZEPHIR_CALL_METHOD(&columnMap, this_ptr, "getreversecolumnmap", NULL, 0, model); zephir_check_call_status(); - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - RETURN_MM_BOOL(zephir_array_isset(columnMap, attribute)); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + RETURN_MM_BOOL(zephir_array_isset(&columnMap, &attribute)); } else { - ZEPHIR_CALL_METHOD(&_0$$4, this_ptr, "readmetadata", NULL, 14, model); + ZEPHIR_CALL_METHOD(&_0$$4, this_ptr, "readmetadata", NULL, 9, model); zephir_check_call_status(); - zephir_array_fetch_long(&_1$$4, _0$$4, 4, PH_READONLY, "phalcon/mvc/model/metadata.zep", 751 TSRMLS_CC); - RETURN_MM_BOOL(zephir_array_isset(_1$$4, attribute)); + zephir_array_fetch_long(&_1$$4, &_0$$4, 4, PH_READONLY, "phalcon/mvc/model/metadata.zep", 751 TSRMLS_CC); + RETURN_MM_BOOL(zephir_array_isset(&_1$$4, &attribute)); } } @@ -1094,11 +1241,14 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, hasAttribute) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData, isEmpty) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - RETURN_BOOL(zephir_fast_count_int(_0 TSRMLS_CC) == 0); + zephir_read_property(&_0, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_fast_count_int(&_0 TSRMLS_CC) == 0); } @@ -1111,16 +1261,20 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData, isEmpty) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData, reset) { - zval *_0, *_1; + zval _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_metaData"), _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - array_init(_1); - zephir_update_property_this(getThis(), SL("_columnMap"), _1 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_metaData"), &_0); + ZEPHIR_INIT_VAR(&_1); + array_init(&_1); + zephir_update_property_zval(this_ptr, SL("_columnMap"), &_1); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/mvc/model/metadata.zep.h b/ext/phalcon/mvc/model/metadata.zep.h index 4829bb7dae6..55d4da2855b 100644 --- a/ext/phalcon/mvc/model/metadata.zep.h +++ b/ext/phalcon/mvc/model/metadata.zep.h @@ -45,22 +45,44 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_setstrategy, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, strategy, Phalcon\\Mvc\\Model\\MetaData\\StrategyInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_metadata_getstrategy, 0, 0, Phalcon\\Mvc\\Model\\MetaData\\StrategyInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getstrategy, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\MetaData\\StrategyInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_readmetadata, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_readmetadataindex, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_writemetadataindex, 0, 0, 3) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -70,30 +92,58 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_readcolumnmapindex, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getattributes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getattributes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getprimarykeyattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getprimarykeyattributes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getprimarykeyattributes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getnonprimarykeyattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getnonprimarykeyattributes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getnonprimarykeyattributes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getnotnullattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getnotnullattributes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getnotnullattributes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdatatypes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdatatypes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdatatypes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdatatypesnumeric, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdatatypesnumeric, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdatatypesnumeric, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() @@ -101,15 +151,27 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getidentityfield, 0, 0 ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getbindtypes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getbindtypes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getbindtypes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getautomaticcreateattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getautomaticcreateattributes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getautomaticcreateattributes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getautomaticupdateattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getautomaticupdateattributes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getautomaticupdateattributes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() @@ -128,33 +190,64 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_setemptystringattribut ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getemptystringattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getemptystringattributes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getemptystringattributes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdefaultvalues, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdefaultvalues, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getdefaultvalues, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getcolumnmap, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getcolumnmap, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getcolumnmap, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_getreversecolumnmap, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getreversecolumnmap, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_getreversecolumnmap, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_hasattribute, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_hasattribute, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_hasattribute, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_isempty, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_isempty, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_metadata_method_entry) { PHP_ME(Phalcon_Mvc_Model_MetaData, _initialize, arginfo_phalcon_mvc_model_metadata__initialize, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_MetaData, setDI, arginfo_phalcon_mvc_model_metadata_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_MetaData, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_MetaData, getDI, arginfo_phalcon_mvc_model_metadata_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_MetaData, setStrategy, arginfo_phalcon_mvc_model_metadata_setstrategy, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_MetaData, getStrategy, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_MetaData, getStrategy, arginfo_phalcon_mvc_model_metadata_getstrategy, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_MetaData, readMetaData, arginfo_phalcon_mvc_model_metadata_readmetadata, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_MetaData, readMetaDataIndex, arginfo_phalcon_mvc_model_metadata_readmetadataindex, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_MetaData, writeMetaDataIndex, arginfo_phalcon_mvc_model_metadata_writemetadataindex, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) @@ -178,7 +271,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_metadata_method_entry) { PHP_ME(Phalcon_Mvc_Model_MetaData, getColumnMap, arginfo_phalcon_mvc_model_metadata_getcolumnmap, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_MetaData, getReverseColumnMap, arginfo_phalcon_mvc_model_metadata_getreversecolumnmap, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_MetaData, hasAttribute, arginfo_phalcon_mvc_model_metadata_hasattribute, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_MetaData, isEmpty, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_MetaData, isEmpty, arginfo_phalcon_mvc_model_metadata_isempty, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_MetaData, reset, NULL, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/metadata/apc.zep.c b/ext/phalcon/mvc/model/metadata/apc.zep.c index 42926ae31da..521dd4d103b 100644 --- a/ext/phalcon/mvc/model/metadata/apc.zep.c +++ b/ext/phalcon/mvc/model/metadata/apc.zep.c @@ -65,21 +65,28 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Apc) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apc, __construct) { - zval *options = NULL, *prefix = NULL, *ttl = NULL; + zval *options = NULL, options_sub, __$null, prefix, ttl; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&ttl); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + if (zephir_array_isset_string_fetch(&prefix, options, SL("prefix"), 1)) { + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); } - if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_ttl"), ttl TSRMLS_CC); + if (zephir_array_isset_string_fetch(&ttl, options, SL("lifetime"), 1)) { + zephir_update_property_zval(this_ptr, SL("_ttl"), &ttl); } } @@ -91,31 +98,37 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apc, __construct) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apc, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data = NULL, *_0, *_1; - zval *key = NULL; + zval *key_param = NULL, data, _0, _1; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVV(_1, "$PMM$", _0, key); - ZEPHIR_CALL_FUNCTION(&data, "apc_fetch", NULL, 90, _1); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVV(&_1, "$PMM$", &_0, &key); + ZEPHIR_CALL_FUNCTION(&data, "apc_fetch", NULL, 81, &_1); zephir_check_call_status(); - if (Z_TYPE_P(data) == IS_ARRAY) { - RETURN_CCTOR(data); + if (Z_TYPE_P(&data) == IS_ARRAY) { + RETURN_CCTOR(&data); } RETURN_MM_NULL(); @@ -127,62 +140,60 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apc, read) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apc, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data, *_0, *_1, *_2; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, _0, _1, _2; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVV(_1, "$PMM$", _0, key); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_ttl"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "apc_store", NULL, 91, _1, data, _2); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVV(&_1, "$PMM$", &_0, &key); + zephir_read_property(&_2, this_ptr, SL("_ttl"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "apc_store", NULL, 82, &_1, data, &_2); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Apc(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Apc(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_metaData"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_metaData"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/metadata/apc.zep.h b/ext/phalcon/mvc/model/metadata/apc.zep.h index 338d11b1264..0abd7a6335f 100644 --- a/ext/phalcon/mvc/model/metadata/apc.zep.h +++ b/ext/phalcon/mvc/model/metadata/apc.zep.h @@ -6,18 +6,30 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Apc); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apc, __construct); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apc, read); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apc, write); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Apc(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Apc(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_apc___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_apc_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_apc_read, 0, 1, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_apc_read, 0, 1, IS_ARRAY, NULL, 1) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_apc_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/apcu.zep.c b/ext/phalcon/mvc/model/metadata/apcu.zep.c index 5c6554bf46c..f95c467b4ff 100644 --- a/ext/phalcon/mvc/model/metadata/apcu.zep.c +++ b/ext/phalcon/mvc/model/metadata/apcu.zep.c @@ -62,21 +62,28 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Apcu) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apcu, __construct) { - zval *options = NULL, *prefix = NULL, *ttl = NULL; + zval *options = NULL, options_sub, __$null, prefix, ttl; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&ttl); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + if (zephir_array_isset_string_fetch(&prefix, options, SL("prefix"), 1)) { + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); } - if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_ttl"), ttl TSRMLS_CC); + if (zephir_array_isset_string_fetch(&ttl, options, SL("lifetime"), 1)) { + zephir_update_property_zval(this_ptr, SL("_ttl"), &ttl); } } @@ -88,31 +95,37 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apcu, __construct) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apcu, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data = NULL, *_0, *_1; - zval *key = NULL; + zval *key_param = NULL, data, _0, _1; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVV(_1, "$PMM$", _0, key); - ZEPHIR_CALL_FUNCTION(&data, "apcu_fetch", NULL, 92, _1); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVV(&_1, "$PMM$", &_0, &key); + ZEPHIR_CALL_FUNCTION(&data, "apcu_fetch", NULL, 0, &_1); zephir_check_call_status(); - if (Z_TYPE_P(data) == IS_ARRAY) { - RETURN_CCTOR(data); + if (Z_TYPE_P(&data) == IS_ARRAY) { + RETURN_CCTOR(&data); } RETURN_MM_NULL(); @@ -124,62 +137,60 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apcu, read) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apcu, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data, *_0, *_1, *_2; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, _0, _1, _2; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVV(_1, "$PMM$", _0, key); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_ttl"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "apcu_store", NULL, 93, _1, data, _2); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVV(&_1, "$PMM$", &_0, &key); + zephir_read_property(&_2, this_ptr, SL("_ttl"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "apcu_store", NULL, 0, &_1, data, &_2); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Apcu(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Apcu(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_metaData"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_metaData"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/metadata/apcu.zep.h b/ext/phalcon/mvc/model/metadata/apcu.zep.h index bf547e63b31..1c04ac1ed8d 100644 --- a/ext/phalcon/mvc/model/metadata/apcu.zep.h +++ b/ext/phalcon/mvc/model/metadata/apcu.zep.h @@ -6,18 +6,30 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Apcu); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apcu, __construct); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apcu, read); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Apcu, write); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Apcu(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Apcu(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_apcu___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_apcu_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_apcu_read, 0, 1, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_apcu_read, 0, 1, IS_ARRAY, NULL, 1) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_apcu_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/files.zep.c b/ext/phalcon/mvc/model/metadata/files.zep.c index c7f7d314f60..5a802ec2c57 100644 --- a/ext/phalcon/mvc/model/metadata/files.zep.c +++ b/ext/phalcon/mvc/model/metadata/files.zep.c @@ -57,18 +57,24 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Files) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Files, __construct) { - zval *options = NULL, *metaDataDir = NULL; + zval *options = NULL, options_sub, __$null, metaDataDir; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&metaDataDir); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&metaDataDir, options, SS("metaDataDir"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_metaDataDir"), metaDataDir TSRMLS_CC); + if (zephir_array_isset_string_fetch(&metaDataDir, options, SL("metaDataDir"), 1)) { + zephir_update_property_zval(this_ptr, SL("_metaDataDir"), &metaDataDir); } } @@ -82,37 +88,45 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Files, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Files, read) { - zval *key_param = NULL, *path = NULL, *_0, *_1, _2, *_3$$3 = NULL; - zval *key = NULL; + zval *key_param = NULL, path, _0, _1, _2, _3$$3; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaDataDir"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_SINIT_VAR(_2); - ZVAL_STRING(&_2, "_", 0); - zephir_prepare_virtual_path(_1, key, &_2 TSRMLS_CC); - ZEPHIR_INIT_VAR(path); - ZEPHIR_CONCAT_VVS(path, _0, _1, ".php"); - if ((zephir_file_exists(path TSRMLS_CC) == SUCCESS)) { + zephir_read_property(&_0, this_ptr, SL("_metaDataDir"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "_"); + zephir_prepare_virtual_path(&_1, &key, &_2 TSRMLS_CC); + ZEPHIR_INIT_VAR(&path); + ZEPHIR_CONCAT_VVS(&path, &_0, &_1, ".php"); + if ((zephir_file_exists(&path TSRMLS_CC) == SUCCESS)) { ZEPHIR_OBSERVE_OR_NULLIFY_PPZV(&_3$$3); - if (zephir_require_zval_ret(&_3$$3, path TSRMLS_CC) == FAILURE) { + if (zephir_require_zval_ret(&_3$$3, &path TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } - RETURN_CCTOR(_3$$3); + RETURN_CCTOR(&_3$$3); } RETURN_MM_NULL(); @@ -126,39 +140,50 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Files, read) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Files, write) { - zval *key_param = NULL, *data, *path = NULL, *_0, *_1, _2, *_3, *_4 = NULL, *_5; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, path, _0, _1, _2, _3, _4, _5; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaDataDir"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_SINIT_VAR(_2); - ZVAL_STRING(&_2, "_", 0); - zephir_prepare_virtual_path(_1, key, &_2 TSRMLS_CC); - ZEPHIR_INIT_VAR(path); - ZEPHIR_CONCAT_VVS(path, _0, _1, ".php"); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_INIT_VAR(_4); - ZEPHIR_INIT_NVAR(_4); - zephir_var_export_ex(_4, &data TSRMLS_CC); - ZEPHIR_INIT_VAR(_5); - ZEPHIR_CONCAT_SVS(_5, "= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_files_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/libmemcached.zep.c b/ext/phalcon/mvc/model/metadata/libmemcached.zep.c index a7649db405f..f89461c86cf 100644 --- a/ext/phalcon/mvc/model/metadata/libmemcached.zep.c +++ b/ext/phalcon/mvc/model/metadata/libmemcached.zep.c @@ -71,15 +71,26 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Libmemcached) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, __construct) { - zval *_3; + zval _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *options = NULL, *ttl = NULL, *_1, *_2, *_4, *_0$$6; + zval *options = NULL, options_sub, __$null, ttl, _1, _2, _4, _0$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&ttl); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_0$$6); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options); if (!options) { - ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); + options = &options_sub; + ZEPHIR_CPY_WRT(options, &__$null); } else { ZEPHIR_SEPARATE_PARAM(options); } @@ -89,32 +100,32 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, __construct) { ZEPHIR_INIT_NVAR(options); array_init(options); } - if (!(zephir_array_isset_string(options, SS("servers")))) { + if (!(zephir_array_isset_string(options, SL("servers")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "No servers given in options", "phalcon/mvc/model/metadata/libmemcached.zep", 77); return; } - if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_ttl"), ttl TSRMLS_CC); + if (zephir_array_isset_string_fetch(&ttl, options, SL("lifetime"), 1)) { + zephir_update_property_zval(this_ptr, SL("_ttl"), &ttl); } - if (!(zephir_array_isset_string(options, SS("statsKey")))) { - ZEPHIR_INIT_VAR(_0$$6); - ZVAL_STRING(_0$$6, "_PHCM_MM", 1); - zephir_array_update_string(&options, SL("statsKey"), &_0$$6, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("statsKey")))) { + ZEPHIR_INIT_VAR(&_0$$6); + ZVAL_STRING(&_0$$6, "_PHCM_MM"); + zephir_array_update_string(options, SL("statsKey"), &_0$$6, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(_1); - object_init_ex(_1, phalcon_cache_backend_libmemcached_ce); - ZEPHIR_INIT_VAR(_2); - object_init_ex(_2, phalcon_cache_frontend_data_ce); - ZEPHIR_INIT_VAR(_3); - zephir_create_array(_3, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_4); - zephir_read_property_this(&_4, this_ptr, SL("_ttl"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_1); + object_init_ex(&_1, phalcon_cache_backend_libmemcached_ce); + ZEPHIR_INIT_VAR(&_2); + object_init_ex(&_2, phalcon_cache_frontend_data_ce); + ZEPHIR_INIT_VAR(&_3); + zephir_create_array(&_3, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_4); + zephir_read_property(&_4, this_ptr, SL("_ttl"), PH_NOISY_CC); zephir_array_update_string(&_3, SL("lifetime"), &_4, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 350, _3); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 309, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _1, "__construct", NULL, 351, _2, options); + ZEPHIR_CALL_METHOD(NULL, &_1, "__construct", NULL, 310, &_2, options); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_memcache"), _1 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_memcache"), &_1); ZEPHIR_MM_RESTORE(); } @@ -125,29 +136,34 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, __construct) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data = NULL, *_0; - zval *key = NULL; + zval *key_param = NULL, data, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&data, _0, "get", NULL, 0, key); + zephir_read_property(&_0, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&data, &_0, "get", NULL, 0, &key); zephir_check_call_status(); - if (Z_TYPE_P(data) == IS_ARRAY) { - RETURN_CCTOR(data); + if (Z_TYPE_P(&data) == IS_ARRAY) { + RETURN_CCTOR(&data); } RETURN_MM_NULL(); @@ -159,26 +175,31 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, read) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data, *_0; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "save", NULL, 0, key, data); + zephir_read_property(&_0, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "save", NULL, 0, &key, data); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -189,66 +210,70 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, write) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, reset) { - HashTable *_2$$3; - HashPosition _1$$3; - zval *meta = NULL, *key = NULL, *realKey = NULL, *_0$$3 = NULL, **_3$$3, *_4$$4; + zend_string *_3$$3; + zend_ulong _2$$3; + zval meta, key, realKey, _0$$3, *_1$$3, _4$$4; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&meta); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&realKey); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(meta); - zephir_read_property_this(&meta, this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(meta) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_is_iterable(meta, &_2$$3, &_1$$3, 0, 0, "phalcon/mvc/model/metadata/libmemcached.zep", 132); - for ( - ; zend_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS - ; zend_hash_move_forward_ex(_2$$3, &_1$$3) - ) { - ZEPHIR_GET_HMKEY(key, _2$$3, _1$$3); - ZEPHIR_GET_HVALUE(_0$$3, _3$$3); - ZEPHIR_INIT_NVAR(realKey); - ZEPHIR_CONCAT_SV(realKey, "meta-", key); - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _4$$4, "delete", NULL, 0, realKey); + ZEPHIR_OBS_VAR(&meta); + zephir_read_property(&meta, this_ptr, SL("_metaData"), PH_NOISY_CC); + if (Z_TYPE_P(&meta) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_is_iterable(&meta, 0, "phalcon/mvc/model/metadata/libmemcached.zep", 132); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&meta), _2$$3, _3$$3, _1$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_3$$3 != NULL) { + ZVAL_STR_COPY(&key, _3$$3); + } else { + ZVAL_LONG(&key, _2$$3); + } + ZEPHIR_INIT_NVAR(&_0$$3); + ZVAL_COPY(&_0$$3, _1$$3); + ZEPHIR_INIT_NVAR(&realKey); + ZEPHIR_CONCAT_SV(&realKey, "meta-", &key); + zephir_read_property(&_4$$4, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "delete", NULL, 0, &realKey); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_0$$3); + ZEPHIR_INIT_NVAR(&key); } - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_metadata_libmemcached_ce, getThis(), "reset", &_5, 352); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_metadata_libmemcached_ce, getThis(), "reset", &_5, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Libmemcached(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Libmemcached(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_metaData"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_metaData"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/metadata/libmemcached.zep.h b/ext/phalcon/mvc/model/metadata/libmemcached.zep.h index 2596511c7f3..8dc40d72419 100644 --- a/ext/phalcon/mvc/model/metadata/libmemcached.zep.h +++ b/ext/phalcon/mvc/model/metadata/libmemcached.zep.h @@ -7,18 +7,30 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, __construct); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, read); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, write); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Libmemcached, reset); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Libmemcached(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Libmemcached(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_libmemcached___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_libmemcached_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_libmemcached_read, 0, 1, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_libmemcached_read, 0, 1, IS_ARRAY, NULL, 1) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_libmemcached_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/memcache.zep.c b/ext/phalcon/mvc/model/metadata/memcache.zep.c index ecdad672d06..200853ea44b 100644 --- a/ext/phalcon/mvc/model/metadata/memcache.zep.c +++ b/ext/phalcon/mvc/model/metadata/memcache.zep.c @@ -63,15 +63,29 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Memcache) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, __construct) { - zval *_6; + zval _6; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *options = NULL, *ttl = NULL, *_4, *_5, *_7, *_0$$4, *_1$$5, *_2$$6, *_3$$7; + zval *options = NULL, options_sub, __$null, ttl, _4, _5, _7, _0$$4, _1$$5, _2$$6, _3$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&ttl); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options); if (!options) { - ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); + options = &options_sub; + ZEPHIR_CPY_WRT(options, &__$null); } else { ZEPHIR_SEPARATE_PARAM(options); } @@ -81,43 +95,43 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, __construct) { ZEPHIR_INIT_NVAR(options); array_init(options); } - if (!(zephir_array_isset_string(options, SS("host")))) { - ZEPHIR_INIT_VAR(_0$$4); - ZVAL_STRING(_0$$4, "127.0.0.1", 1); - zephir_array_update_string(&options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("host")))) { + ZEPHIR_INIT_VAR(&_0$$4); + ZVAL_STRING(&_0$$4, "127.0.0.1"); + zephir_array_update_string(options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("port")))) { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_LONG(_1$$5, 11211); - zephir_array_update_string(&options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("port")))) { + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_LONG(&_1$$5, 11211); + zephir_array_update_string(options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("persistent")))) { - ZEPHIR_INIT_VAR(_2$$6); - ZVAL_LONG(_2$$6, 0); - zephir_array_update_string(&options, SL("persistent"), &_2$$6, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("persistent")))) { + ZEPHIR_INIT_VAR(&_2$$6); + ZVAL_LONG(&_2$$6, 0); + zephir_array_update_string(options, SL("persistent"), &_2$$6, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("statsKey")))) { - ZEPHIR_INIT_VAR(_3$$7); - ZVAL_STRING(_3$$7, "_PHCM_MM", 1); - zephir_array_update_string(&options, SL("statsKey"), &_3$$7, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("statsKey")))) { + ZEPHIR_INIT_VAR(&_3$$7); + ZVAL_STRING(&_3$$7, "_PHCM_MM"); + zephir_array_update_string(options, SL("statsKey"), &_3$$7, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_ttl"), ttl TSRMLS_CC); + if (zephir_array_isset_string_fetch(&ttl, options, SL("lifetime"), 1)) { + zephir_update_property_zval(this_ptr, SL("_ttl"), &ttl); } - ZEPHIR_INIT_VAR(_4); - object_init_ex(_4, phalcon_cache_backend_memcache_ce); - ZEPHIR_INIT_VAR(_5); - object_init_ex(_5, phalcon_cache_frontend_data_ce); - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_7); - zephir_read_property_this(&_7, this_ptr, SL("_ttl"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_4); + object_init_ex(&_4, phalcon_cache_backend_memcache_ce); + ZEPHIR_INIT_VAR(&_5); + object_init_ex(&_5, phalcon_cache_frontend_data_ce); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_7); + zephir_read_property(&_7, this_ptr, SL("_ttl"), PH_NOISY_CC); zephir_array_update_string(&_6, SL("lifetime"), &_7, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _5, "__construct", NULL, 350, _6); + ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 309, &_6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 353, _5, options); + ZEPHIR_CALL_METHOD(NULL, &_4, "__construct", NULL, 311, &_5, options); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_memcache"), _4 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_memcache"), &_4); ZEPHIR_MM_RESTORE(); } @@ -128,29 +142,34 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, __construct) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data = NULL, *_0; - zval *key = NULL; + zval *key_param = NULL, data, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&data, _0, "get", NULL, 0, key); + zephir_read_property(&_0, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&data, &_0, "get", NULL, 0, &key); zephir_check_call_status(); - if (Z_TYPE_P(data) == IS_ARRAY) { - RETURN_CCTOR(data); + if (Z_TYPE_P(&data) == IS_ARRAY) { + RETURN_CCTOR(&data); } RETURN_MM_NULL(); @@ -162,26 +181,31 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, read) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data, *_0; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "save", NULL, 0, key, data); + zephir_read_property(&_0, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "save", NULL, 0, &key, data); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -192,66 +216,70 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, write) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, reset) { - HashTable *_2$$3; - HashPosition _1$$3; - zval *meta = NULL, *key = NULL, *realKey = NULL, *_0$$3 = NULL, **_3$$3, *_4$$4; + zend_string *_3$$3; + zend_ulong _2$$3; + zval meta, key, realKey, _0$$3, *_1$$3, _4$$4; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&meta); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&realKey); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(meta); - zephir_read_property_this(&meta, this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(meta) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_is_iterable(meta, &_2$$3, &_1$$3, 0, 0, "phalcon/mvc/model/metadata/memcache.zep", 131); - for ( - ; zend_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS - ; zend_hash_move_forward_ex(_2$$3, &_1$$3) - ) { - ZEPHIR_GET_HMKEY(key, _2$$3, _1$$3); - ZEPHIR_GET_HVALUE(_0$$3, _3$$3); - ZEPHIR_INIT_NVAR(realKey); - ZEPHIR_CONCAT_SV(realKey, "meta-", key); - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _4$$4, "delete", NULL, 0, realKey); + ZEPHIR_OBS_VAR(&meta); + zephir_read_property(&meta, this_ptr, SL("_metaData"), PH_NOISY_CC); + if (Z_TYPE_P(&meta) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_is_iterable(&meta, 0, "phalcon/mvc/model/metadata/memcache.zep", 131); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&meta), _2$$3, _3$$3, _1$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_3$$3 != NULL) { + ZVAL_STR_COPY(&key, _3$$3); + } else { + ZVAL_LONG(&key, _2$$3); + } + ZEPHIR_INIT_NVAR(&_0$$3); + ZVAL_COPY(&_0$$3, _1$$3); + ZEPHIR_INIT_NVAR(&realKey); + ZEPHIR_CONCAT_SV(&realKey, "meta-", &key); + zephir_read_property(&_4$$4, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "delete", NULL, 0, &realKey); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_0$$3); + ZEPHIR_INIT_NVAR(&key); } - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_metadata_memcache_ce, getThis(), "reset", &_5, 352); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_metadata_memcache_ce, getThis(), "reset", &_5, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memcache(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memcache(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_metaData"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_metaData"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/metadata/memcache.zep.h b/ext/phalcon/mvc/model/metadata/memcache.zep.h index 806ba30f0e9..ce96f522293 100644 --- a/ext/phalcon/mvc/model/metadata/memcache.zep.h +++ b/ext/phalcon/mvc/model/metadata/memcache.zep.h @@ -7,18 +7,30 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, __construct); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, read); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, write); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memcache, reset); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memcache(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memcache(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_memcache___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_memcache_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_memcache_read, 0, 1, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_memcache_read, 0, 1, IS_ARRAY, NULL, 1) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_memcache_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/memory.zep.c b/ext/phalcon/mvc/model/metadata/memory.zep.c index 649612224f3..3b11b9d0bb1 100644 --- a/ext/phalcon/mvc/model/metadata/memory.zep.c +++ b/ext/phalcon/mvc/model/metadata/memory.zep.c @@ -43,12 +43,17 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Memory) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memory, __construct) { - zval *options = NULL; + zval *options = NULL, options_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } @@ -64,20 +69,23 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memory, __construct) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memory, read) { zval *key_param = NULL; - zval *key = NULL; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } @@ -93,21 +101,25 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memory, read) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memory, write) { - zval *key_param = NULL, *data; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } @@ -115,34 +127,25 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memory, write) { } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memory(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memory(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_metaData"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_metaData"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/metadata/memory.zep.h b/ext/phalcon/mvc/model/metadata/memory.zep.h index 4ca321d2417..af3051b289b 100644 --- a/ext/phalcon/mvc/model/metadata/memory.zep.h +++ b/ext/phalcon/mvc/model/metadata/memory.zep.h @@ -6,18 +6,26 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Memory); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memory, __construct); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memory, read); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Memory, write); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memory(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Memory(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_memory___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_memory_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_memory_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/redis.zep.c b/ext/phalcon/mvc/model/metadata/redis.zep.c index ca58e071b3b..ad6a71550c5 100644 --- a/ext/phalcon/mvc/model/metadata/redis.zep.c +++ b/ext/phalcon/mvc/model/metadata/redis.zep.c @@ -66,15 +66,29 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Redis) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, __construct) { - zval *_6; + zval _6; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *options = NULL, *ttl = NULL, *_4, *_5, *_7, *_0$$4, *_1$$5, *_2$$6, *_3$$7; + zval *options = NULL, options_sub, __$null, ttl, _4, _5, _7, _0$$4, _1$$5, _2$$6, _3$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&ttl); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options); if (!options) { - ZEPHIR_CPY_WRT(options, ZEPHIR_GLOBAL(global_null)); + options = &options_sub; + ZEPHIR_CPY_WRT(options, &__$null); } else { ZEPHIR_SEPARATE_PARAM(options); } @@ -84,43 +98,43 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, __construct) { ZEPHIR_INIT_NVAR(options); array_init(options); } - if (!(zephir_array_isset_string(options, SS("host")))) { - ZEPHIR_INIT_VAR(_0$$4); - ZVAL_STRING(_0$$4, "127.0.0.1", 1); - zephir_array_update_string(&options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("host")))) { + ZEPHIR_INIT_VAR(&_0$$4); + ZVAL_STRING(&_0$$4, "127.0.0.1"); + zephir_array_update_string(options, SL("host"), &_0$$4, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("port")))) { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_LONG(_1$$5, 6379); - zephir_array_update_string(&options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("port")))) { + ZEPHIR_INIT_VAR(&_1$$5); + ZVAL_LONG(&_1$$5, 6379); + zephir_array_update_string(options, SL("port"), &_1$$5, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("persistent")))) { - ZEPHIR_INIT_VAR(_2$$6); - ZVAL_LONG(_2$$6, 0); - zephir_array_update_string(&options, SL("persistent"), &_2$$6, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("persistent")))) { + ZEPHIR_INIT_VAR(&_2$$6); + ZVAL_LONG(&_2$$6, 0); + zephir_array_update_string(options, SL("persistent"), &_2$$6, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("statsKey")))) { - ZEPHIR_INIT_VAR(_3$$7); - ZVAL_STRING(_3$$7, "_PHCM_MM", 1); - zephir_array_update_string(&options, SL("statsKey"), &_3$$7, PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(options, SL("statsKey")))) { + ZEPHIR_INIT_VAR(&_3$$7); + ZVAL_STRING(&_3$$7, "_PHCM_MM"); + zephir_array_update_string(options, SL("statsKey"), &_3$$7, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_ttl"), ttl TSRMLS_CC); + if (zephir_array_isset_string_fetch(&ttl, options, SL("lifetime"), 1)) { + zephir_update_property_zval(this_ptr, SL("_ttl"), &ttl); } - ZEPHIR_INIT_VAR(_4); - object_init_ex(_4, phalcon_cache_backend_redis_ce); - ZEPHIR_INIT_VAR(_5); - object_init_ex(_5, phalcon_cache_frontend_data_ce); - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_7); - zephir_read_property_this(&_7, this_ptr, SL("_ttl"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_4); + object_init_ex(&_4, phalcon_cache_backend_redis_ce); + ZEPHIR_INIT_VAR(&_5); + object_init_ex(&_5, phalcon_cache_frontend_data_ce); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_7); + zephir_read_property(&_7, this_ptr, SL("_ttl"), PH_NOISY_CC); zephir_array_update_string(&_6, SL("lifetime"), &_7, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _5, "__construct", NULL, 350, _6); + ZEPHIR_CALL_METHOD(NULL, &_5, "__construct", NULL, 309, &_6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 354, _5, options); + ZEPHIR_CALL_METHOD(NULL, &_4, "__construct", NULL, 312, &_5, options); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_redis"), _4 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_redis"), &_4); ZEPHIR_MM_RESTORE(); } @@ -131,29 +145,34 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, __construct) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data = NULL, *_0; - zval *key = NULL; + zval *key_param = NULL, data, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_redis"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&data, _0, "get", NULL, 0, key); + zephir_read_property(&_0, this_ptr, SL("_redis"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&data, &_0, "get", NULL, 0, &key); zephir_check_call_status(); - if (Z_TYPE_P(data) == IS_ARRAY) { - RETURN_CCTOR(data); + if (Z_TYPE_P(&data) == IS_ARRAY) { + RETURN_CCTOR(&data); } RETURN_MM_NULL(); @@ -165,26 +184,31 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, read) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data, *_0; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_redis"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _0, "save", NULL, 0, key, data); + zephir_read_property(&_0, this_ptr, SL("_redis"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_0, "save", NULL, 0, &key, data); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -195,66 +219,70 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, write) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, reset) { - HashTable *_2$$3; - HashPosition _1$$3; - zval *meta = NULL, *key = NULL, *realKey = NULL, *_0$$3 = NULL, **_3$$3, *_4$$4; + zend_string *_3$$3; + zend_ulong _2$$3; + zval meta, key, realKey, _0$$3, *_1$$3, _4$$4; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&meta); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&realKey); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(meta); - zephir_read_property_this(&meta, this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(meta) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_is_iterable(meta, &_2$$3, &_1$$3, 0, 0, "phalcon/mvc/model/metadata/redis.zep", 134); - for ( - ; zend_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS - ; zend_hash_move_forward_ex(_2$$3, &_1$$3) - ) { - ZEPHIR_GET_HMKEY(key, _2$$3, _1$$3); - ZEPHIR_GET_HVALUE(_0$$3, _3$$3); - ZEPHIR_INIT_NVAR(realKey); - ZEPHIR_CONCAT_SV(realKey, "meta-", key); - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_redis"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _4$$4, "delete", NULL, 0, realKey); + ZEPHIR_OBS_VAR(&meta); + zephir_read_property(&meta, this_ptr, SL("_metaData"), PH_NOISY_CC); + if (Z_TYPE_P(&meta) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_is_iterable(&meta, 0, "phalcon/mvc/model/metadata/redis.zep", 134); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&meta), _2$$3, _3$$3, _1$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_3$$3 != NULL) { + ZVAL_STR_COPY(&key, _3$$3); + } else { + ZVAL_LONG(&key, _2$$3); + } + ZEPHIR_INIT_NVAR(&_0$$3); + ZVAL_COPY(&_0$$3, _1$$3); + ZEPHIR_INIT_NVAR(&realKey); + ZEPHIR_CONCAT_SV(&realKey, "meta-", &key); + zephir_read_property(&_4$$4, this_ptr, SL("_redis"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_4$$4, "delete", NULL, 0, &realKey); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_0$$3); + ZEPHIR_INIT_NVAR(&key); } - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_metadata_redis_ce, getThis(), "reset", &_5, 352); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_metadata_redis_ce, getThis(), "reset", &_5, 0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Redis(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Redis(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_metaData"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_metaData"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/metadata/redis.zep.h b/ext/phalcon/mvc/model/metadata/redis.zep.h index eb167aba41b..b27ba918fd6 100644 --- a/ext/phalcon/mvc/model/metadata/redis.zep.h +++ b/ext/phalcon/mvc/model/metadata/redis.zep.h @@ -7,18 +7,30 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, __construct); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, read); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, write); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Redis, reset); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Redis(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Redis(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_redis___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_redis_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_redis_read, 0, 1, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_redis_read, 0, 1, IS_ARRAY, NULL, 1) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_redis_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/session.zep.c b/ext/phalcon/mvc/model/metadata/session.zep.c index b754387e356..ff0824ce1b4 100644 --- a/ext/phalcon/mvc/model/metadata/session.zep.c +++ b/ext/phalcon/mvc/model/metadata/session.zep.c @@ -54,18 +54,24 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Session) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, __construct) { - zval *options = NULL, *prefix = NULL; + zval *options = NULL, options_sub, __$null, prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefix); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + if (zephir_array_isset_string_fetch(&prefix, options, SL("prefix"), 1)) { + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); } } @@ -79,31 +85,38 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, read) { - zval *key_param = NULL, *_SESSION, *metaData = NULL, *_0, *_1, *_2; - zval *key = NULL; + zval *key_param = NULL, *_SESSION, metaData, _0, _1, _2; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC); + zephir_get_global(&_SESSION, SL("_SESSION")); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SV(_2, "$PMM$", _1); - zephir_array_fetch(&_0, _SESSION, _2, PH_READONLY, "phalcon/mvc/model/metadata/session.zep", 71 TSRMLS_CC); - if (zephir_array_isset_fetch(&metaData, _0, key, 1 TSRMLS_CC)) { - RETURN_CTOR(metaData); + zephir_read_property(&_1, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SV(&_2, "$PMM$", &_1); + zephir_array_fetch(&_0, _SESSION, &_2, PH_READONLY, "phalcon/mvc/model/metadata/session.zep", 71 TSRMLS_CC); + if (zephir_array_isset_fetch(&metaData, &_0, &key, 1 TSRMLS_CC)) { + RETURN_CTOR(&metaData); } RETURN_MM_NULL(); @@ -117,29 +130,35 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, read) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Session, write) { - zval *key_param = NULL, *data, *_SESSION, *_0, *_1; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, *_SESSION, _0, _1; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC); + zephir_get_global(&_SESSION, SL("_SESSION")); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, "$PMM$", _0); - zephir_array_update_multi(&_SESSION, &data TSRMLS_CC, SL("zz"), 2, _1, key); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, "$PMM$", &_0); + zephir_array_update_multi(_SESSION, data TSRMLS_CC, SL("zz"), 2, &_1, &key); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/mvc/model/metadata/session.zep.h b/ext/phalcon/mvc/model/metadata/session.zep.h index acf1369b2f4..497cd610f60 100644 --- a/ext/phalcon/mvc/model/metadata/session.zep.h +++ b/ext/phalcon/mvc/model/metadata/session.zep.h @@ -12,11 +12,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_session___construct, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_session_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_session_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.c b/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.c index 0ebfcfe7a97..bd00e293aac 100644 --- a/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.c +++ b/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.c @@ -36,10 +36,85 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Strategy_Annotations) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getMetaData) { zend_bool _50$$6; - HashTable *_6; - HashPosition _5; + zend_string *_7; + zend_ulong _6; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *dependencyInjector, *annotations = NULL, *className = NULL, *reflection = NULL, *propertiesAnnotations = NULL, *property = NULL, *propAnnotations = NULL, *columnAnnotation = NULL, *columnName = NULL, *feature = NULL, *fieldTypes = NULL, *fieldBindTypes = NULL, *numericTyped = NULL, *primaryKeys = NULL, *nonPrimaryKeys = NULL, *identityField = NULL, *notNull = NULL, *attributes = NULL, *defaultValues = NULL, *defaultValue = NULL, *emptyStringValues = NULL, *skipOnInsert = NULL, *skipOnUpdate = NULL, *_0, **_7, *_1$$4, *_2$$4, *_3$$5, *_4$$5, *_8$$6 = NULL, *_9$$6 = NULL, *_44$$6 = NULL, *_45$$6 = NULL, *_46$$6 = NULL, *_47$$6 = NULL, *_48$$6 = NULL, *_49$$6 = NULL, *_51$$6 = NULL, *_10$$9 = NULL, *_11$$9 = NULL, *_12$$10 = NULL, *_13$$10 = NULL, *_14$$11 = NULL, *_15$$11 = NULL, *_16$$12 = NULL, *_17$$12 = NULL, *_18$$13 = NULL, *_19$$13 = NULL, *_20$$14 = NULL, *_21$$14 = NULL, *_22$$15 = NULL, *_23$$15 = NULL, *_24$$16 = NULL, *_25$$16 = NULL, *_26$$17 = NULL, *_27$$17 = NULL, *_28$$18 = NULL, *_29$$18 = NULL, *_30$$19 = NULL, *_31$$19 = NULL, *_32$$20 = NULL, *_33$$20 = NULL, *_34$$21 = NULL, *_35$$21 = NULL, *_36$$22 = NULL, *_37$$22 = NULL, *_38$$23 = NULL, *_39$$23 = NULL, *_40$$24 = NULL, *_41$$24 = NULL, *_42$$25 = NULL, *_43$$25 = NULL; + zval *model, model_sub, *dependencyInjector, dependencyInjector_sub, __$true, annotations, className, reflection, propertiesAnnotations, property, propAnnotations, columnAnnotation, columnName, feature, fieldTypes, fieldBindTypes, numericTyped, primaryKeys, nonPrimaryKeys, identityField, notNull, attributes, defaultValues, defaultValue, emptyStringValues, skipOnInsert, skipOnUpdate, _0, *_5, _1$$4, _2$$4, _3$$5, _4$$5, _8$$6, _9$$6, _44$$6, _45$$6, _46$$6, _47$$6, _48$$6, _49$$6, _51$$6, _10$$9, _11$$9, _12$$10, _13$$10, _14$$11, _15$$11, _16$$12, _17$$12, _18$$13, _19$$13, _20$$14, _21$$14, _22$$15, _23$$15, _24$$16, _25$$16, _26$$17, _27$$17, _28$$18, _29$$18, _30$$19, _31$$19, _32$$20, _33$$20, _34$$21, _35$$21, _36$$22, _37$$22, _38$$23, _39$$23, _40$$24, _41$$24, _42$$25, _43$$25; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&reflection); + ZVAL_UNDEF(&propertiesAnnotations); + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&propAnnotations); + ZVAL_UNDEF(&columnAnnotation); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&feature); + ZVAL_UNDEF(&fieldTypes); + ZVAL_UNDEF(&fieldBindTypes); + ZVAL_UNDEF(&numericTyped); + ZVAL_UNDEF(&primaryKeys); + ZVAL_UNDEF(&nonPrimaryKeys); + ZVAL_UNDEF(&identityField); + ZVAL_UNDEF(¬Null); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&defaultValues); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&emptyStringValues); + ZVAL_UNDEF(&skipOnInsert); + ZVAL_UNDEF(&skipOnUpdate); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_44$$6); + ZVAL_UNDEF(&_45$$6); + ZVAL_UNDEF(&_46$$6); + ZVAL_UNDEF(&_47$$6); + ZVAL_UNDEF(&_48$$6); + ZVAL_UNDEF(&_49$$6); + ZVAL_UNDEF(&_51$$6); + ZVAL_UNDEF(&_10$$9); + ZVAL_UNDEF(&_11$$9); + ZVAL_UNDEF(&_12$$10); + ZVAL_UNDEF(&_13$$10); + ZVAL_UNDEF(&_14$$11); + ZVAL_UNDEF(&_15$$11); + ZVAL_UNDEF(&_16$$12); + ZVAL_UNDEF(&_17$$12); + ZVAL_UNDEF(&_18$$13); + ZVAL_UNDEF(&_19$$13); + ZVAL_UNDEF(&_20$$14); + ZVAL_UNDEF(&_21$$14); + ZVAL_UNDEF(&_22$$15); + ZVAL_UNDEF(&_23$$15); + ZVAL_UNDEF(&_24$$16); + ZVAL_UNDEF(&_25$$16); + ZVAL_UNDEF(&_26$$17); + ZVAL_UNDEF(&_27$$17); + ZVAL_UNDEF(&_28$$18); + ZVAL_UNDEF(&_29$$18); + ZVAL_UNDEF(&_30$$19); + ZVAL_UNDEF(&_31$$19); + ZVAL_UNDEF(&_32$$20); + ZVAL_UNDEF(&_33$$20); + ZVAL_UNDEF(&_34$$21); + ZVAL_UNDEF(&_35$$21); + ZVAL_UNDEF(&_36$$22); + ZVAL_UNDEF(&_37$$22); + ZVAL_UNDEF(&_38$$23); + ZVAL_UNDEF(&_39$$23); + ZVAL_UNDEF(&_40$$24); + ZVAL_UNDEF(&_41$$24); + ZVAL_UNDEF(&_42$$25); + ZVAL_UNDEF(&_43$$25); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &dependencyInjector); @@ -50,336 +125,329 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getMetaData) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector is invalid", "phalcon/mvc/model/metadata/strategy/annotations.zep", 43); return; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "annotations", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&annotations, dependencyInjector, "get", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "annotations"); + ZEPHIR_CALL_METHOD(&annotations, dependencyInjector, "get", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, model, 0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&reflection, annotations, "get", NULL, 0, className); + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, model, 0 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&reflection, &annotations, "get", NULL, 0, &className); zephir_check_call_status(); - if (Z_TYPE_P(reflection) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$4); - object_init_ex(_1$$4, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_2$$4); - ZEPHIR_CONCAT_SV(_2$$4, "No annotations were found in class ", className); - ZEPHIR_CALL_METHOD(NULL, _1$$4, "__construct", NULL, 9, _2$$4); + if (Z_TYPE_P(&reflection) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$4); + object_init_ex(&_1$$4, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_2$$4); + ZEPHIR_CONCAT_SV(&_2$$4, "No annotations were found in class ", &className); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 4, &_2$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$4, "phalcon/mvc/model/metadata/strategy/annotations.zep", 52 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$4, "phalcon/mvc/model/metadata/strategy/annotations.zep", 52 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&propertiesAnnotations, reflection, "getpropertiesannotations", NULL, 0); + ZEPHIR_CALL_METHOD(&propertiesAnnotations, &reflection, "getpropertiesannotations", NULL, 0); zephir_check_call_status(); - if (!(zephir_fast_count_int(propertiesAnnotations TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_3$$5); - object_init_ex(_3$$5, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_4$$5); - ZEPHIR_CONCAT_SV(_4$$5, "No properties with annotations were found in class ", className); - ZEPHIR_CALL_METHOD(NULL, _3$$5, "__construct", NULL, 9, _4$$5); + if (!(zephir_fast_count_int(&propertiesAnnotations TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_3$$5); + object_init_ex(&_3$$5, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_4$$5); + ZEPHIR_CONCAT_SV(&_4$$5, "No properties with annotations were found in class ", &className); + ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 4, &_4$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$5, "phalcon/mvc/model/metadata/strategy/annotations.zep", 61 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$5, "phalcon/mvc/model/metadata/strategy/annotations.zep", 61 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(attributes); - array_init(attributes); - ZEPHIR_INIT_VAR(primaryKeys); - array_init(primaryKeys); - ZEPHIR_INIT_VAR(nonPrimaryKeys); - array_init(nonPrimaryKeys); - ZEPHIR_INIT_VAR(numericTyped); - array_init(numericTyped); - ZEPHIR_INIT_VAR(notNull); - array_init(notNull); - ZEPHIR_INIT_VAR(fieldTypes); - array_init(fieldTypes); - ZEPHIR_INIT_VAR(fieldBindTypes); - array_init(fieldBindTypes); - ZEPHIR_INIT_VAR(identityField); - ZVAL_BOOL(identityField, 0); - ZEPHIR_INIT_VAR(skipOnInsert); - array_init(skipOnInsert); - ZEPHIR_INIT_VAR(skipOnUpdate); - array_init(skipOnUpdate); - ZEPHIR_INIT_VAR(defaultValues); - array_init(defaultValues); - ZEPHIR_INIT_VAR(emptyStringValues); - array_init(emptyStringValues); - zephir_is_iterable(propertiesAnnotations, &_6, &_5, 0, 0, "phalcon/mvc/model/metadata/strategy/annotations.zep", 260); - for ( - ; zend_hash_get_current_data_ex(_6, (void**) &_7, &_5) == SUCCESS - ; zend_hash_move_forward_ex(_6, &_5) - ) { - ZEPHIR_GET_HMKEY(property, _6, _5); - ZEPHIR_GET_HVALUE(propAnnotations, _7); - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "Column", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_8$$6, propAnnotations, "has", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_VAR(&attributes); + array_init(&attributes); + ZEPHIR_INIT_VAR(&primaryKeys); + array_init(&primaryKeys); + ZEPHIR_INIT_VAR(&nonPrimaryKeys); + array_init(&nonPrimaryKeys); + ZEPHIR_INIT_VAR(&numericTyped); + array_init(&numericTyped); + ZEPHIR_INIT_VAR(¬Null); + array_init(¬Null); + ZEPHIR_INIT_VAR(&fieldTypes); + array_init(&fieldTypes); + ZEPHIR_INIT_VAR(&fieldBindTypes); + array_init(&fieldBindTypes); + ZEPHIR_INIT_VAR(&identityField); + ZVAL_BOOL(&identityField, 0); + ZEPHIR_INIT_VAR(&skipOnInsert); + array_init(&skipOnInsert); + ZEPHIR_INIT_VAR(&skipOnUpdate); + array_init(&skipOnUpdate); + ZEPHIR_INIT_VAR(&defaultValues); + array_init(&defaultValues); + ZEPHIR_INIT_VAR(&emptyStringValues); + array_init(&emptyStringValues); + zephir_is_iterable(&propertiesAnnotations, 0, "phalcon/mvc/model/metadata/strategy/annotations.zep", 260); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&propertiesAnnotations), _6, _7, _5) + { + ZEPHIR_INIT_NVAR(&property); + if (_7 != NULL) { + ZVAL_STR_COPY(&property, _7); + } else { + ZVAL_LONG(&property, _6); + } + ZEPHIR_INIT_NVAR(&propAnnotations); + ZVAL_COPY(&propAnnotations, _5); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "Column"); + ZEPHIR_CALL_METHOD(&_8$$6, &propAnnotations, "has", NULL, 0, &_9$$6); zephir_check_call_status(); - if (!(zephir_is_true(_8$$6))) { + if (!(zephir_is_true(&_8$$6))) { continue; } - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "Column", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&columnAnnotation, propAnnotations, "get", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "Column"); + ZEPHIR_CALL_METHOD(&columnAnnotation, &propAnnotations, "get", NULL, 0, &_9$$6); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "column", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&columnName, columnAnnotation, "getnamedparameter", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "column"); + ZEPHIR_CALL_METHOD(&columnName, &columnAnnotation, "getnamedparameter", NULL, 0, &_9$$6); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(columnName)) { - ZEPHIR_CPY_WRT(columnName, property); + if (ZEPHIR_IS_EMPTY(&columnName)) { + ZEPHIR_CPY_WRT(&columnName, &property); } - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "type", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&feature, columnAnnotation, "getnamedparameter", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "type"); + ZEPHIR_CALL_METHOD(&feature, &columnAnnotation, "getnamedparameter", NULL, 0, &_9$$6); zephir_check_call_status(); do { - if (ZEPHIR_IS_STRING(feature, "biginteger")) { - ZEPHIR_INIT_NVAR(_10$$9); - ZVAL_LONG(_10$$9, 14); - zephir_array_update_zval(&fieldTypes, columnName, &_10$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_11$$9); - ZVAL_LONG(_11$$9, 1); - zephir_array_update_zval(&fieldBindTypes, columnName, &_11$$9, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&numericTyped, columnName, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "biginteger")) { + ZEPHIR_INIT_NVAR(&_10$$9); + ZVAL_LONG(&_10$$9, 14); + zephir_array_update_zval(&fieldTypes, &columnName, &_10$$9, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_11$$9); + ZVAL_LONG(&_11$$9, 1); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_11$$9, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&numericTyped, &columnName, &__$true, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "integer")) { - ZEPHIR_INIT_NVAR(_12$$10); - ZVAL_LONG(_12$$10, 0); - zephir_array_update_zval(&fieldTypes, columnName, &_12$$10, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_13$$10); - ZVAL_LONG(_13$$10, 1); - zephir_array_update_zval(&fieldBindTypes, columnName, &_13$$10, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&numericTyped, columnName, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "integer")) { + ZEPHIR_INIT_NVAR(&_12$$10); + ZVAL_LONG(&_12$$10, 0); + zephir_array_update_zval(&fieldTypes, &columnName, &_12$$10, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_13$$10); + ZVAL_LONG(&_13$$10, 1); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_13$$10, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&numericTyped, &columnName, &__$true, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "decimal")) { - ZEPHIR_INIT_NVAR(_14$$11); - ZVAL_LONG(_14$$11, 3); - zephir_array_update_zval(&fieldTypes, columnName, &_14$$11, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_15$$11); - ZVAL_LONG(_15$$11, 32); - zephir_array_update_zval(&fieldBindTypes, columnName, &_15$$11, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&numericTyped, columnName, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "decimal")) { + ZEPHIR_INIT_NVAR(&_14$$11); + ZVAL_LONG(&_14$$11, 3); + zephir_array_update_zval(&fieldTypes, &columnName, &_14$$11, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_15$$11); + ZVAL_LONG(&_15$$11, 32); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_15$$11, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&numericTyped, &columnName, &__$true, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "float")) { - ZEPHIR_INIT_NVAR(_16$$12); - ZVAL_LONG(_16$$12, 7); - zephir_array_update_zval(&fieldTypes, columnName, &_16$$12, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_17$$12); - ZVAL_LONG(_17$$12, 32); - zephir_array_update_zval(&fieldBindTypes, columnName, &_17$$12, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&numericTyped, columnName, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "float")) { + ZEPHIR_INIT_NVAR(&_16$$12); + ZVAL_LONG(&_16$$12, 7); + zephir_array_update_zval(&fieldTypes, &columnName, &_16$$12, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_17$$12); + ZVAL_LONG(&_17$$12, 32); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_17$$12, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&numericTyped, &columnName, &__$true, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "double")) { - ZEPHIR_INIT_NVAR(_18$$13); - ZVAL_LONG(_18$$13, 9); - zephir_array_update_zval(&fieldTypes, columnName, &_18$$13, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_19$$13); - ZVAL_LONG(_19$$13, 32); - zephir_array_update_zval(&fieldBindTypes, columnName, &_19$$13, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&numericTyped, columnName, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "double")) { + ZEPHIR_INIT_NVAR(&_18$$13); + ZVAL_LONG(&_18$$13, 9); + zephir_array_update_zval(&fieldTypes, &columnName, &_18$$13, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_19$$13); + ZVAL_LONG(&_19$$13, 32); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_19$$13, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&numericTyped, &columnName, &__$true, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "boolean")) { - ZEPHIR_INIT_NVAR(_20$$14); - ZVAL_LONG(_20$$14, 8); - zephir_array_update_zval(&fieldTypes, columnName, &_20$$14, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_21$$14); - ZVAL_LONG(_21$$14, 5); - zephir_array_update_zval(&fieldBindTypes, columnName, &_21$$14, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "boolean")) { + ZEPHIR_INIT_NVAR(&_20$$14); + ZVAL_LONG(&_20$$14, 8); + zephir_array_update_zval(&fieldTypes, &columnName, &_20$$14, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_21$$14); + ZVAL_LONG(&_21$$14, 5); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_21$$14, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "date")) { - ZEPHIR_INIT_NVAR(_22$$15); - ZVAL_LONG(_22$$15, 1); - zephir_array_update_zval(&fieldTypes, columnName, &_22$$15, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_23$$15); - ZVAL_LONG(_23$$15, 2); - zephir_array_update_zval(&fieldBindTypes, columnName, &_23$$15, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "date")) { + ZEPHIR_INIT_NVAR(&_22$$15); + ZVAL_LONG(&_22$$15, 1); + zephir_array_update_zval(&fieldTypes, &columnName, &_22$$15, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_23$$15); + ZVAL_LONG(&_23$$15, 2); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_23$$15, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "datetime")) { - ZEPHIR_INIT_NVAR(_24$$16); - ZVAL_LONG(_24$$16, 4); - zephir_array_update_zval(&fieldTypes, columnName, &_24$$16, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_25$$16); - ZVAL_LONG(_25$$16, 2); - zephir_array_update_zval(&fieldBindTypes, columnName, &_25$$16, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "datetime")) { + ZEPHIR_INIT_NVAR(&_24$$16); + ZVAL_LONG(&_24$$16, 4); + zephir_array_update_zval(&fieldTypes, &columnName, &_24$$16, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_25$$16); + ZVAL_LONG(&_25$$16, 2); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_25$$16, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "timestamp")) { - ZEPHIR_INIT_NVAR(_26$$17); - ZVAL_LONG(_26$$17, 17); - zephir_array_update_zval(&fieldTypes, columnName, &_26$$17, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_27$$17); - ZVAL_LONG(_27$$17, 2); - zephir_array_update_zval(&fieldBindTypes, columnName, &_27$$17, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "timestamp")) { + ZEPHIR_INIT_NVAR(&_26$$17); + ZVAL_LONG(&_26$$17, 17); + zephir_array_update_zval(&fieldTypes, &columnName, &_26$$17, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_27$$17); + ZVAL_LONG(&_27$$17, 2); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_27$$17, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "text")) { - ZEPHIR_INIT_NVAR(_28$$18); - ZVAL_LONG(_28$$18, 6); - zephir_array_update_zval(&fieldTypes, columnName, &_28$$18, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_29$$18); - ZVAL_LONG(_29$$18, 2); - zephir_array_update_zval(&fieldBindTypes, columnName, &_29$$18, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "text")) { + ZEPHIR_INIT_NVAR(&_28$$18); + ZVAL_LONG(&_28$$18, 6); + zephir_array_update_zval(&fieldTypes, &columnName, &_28$$18, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_29$$18); + ZVAL_LONG(&_29$$18, 2); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_29$$18, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "char")) { - ZEPHIR_INIT_NVAR(_30$$19); - ZVAL_LONG(_30$$19, 5); - zephir_array_update_zval(&fieldTypes, columnName, &_30$$19, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_31$$19); - ZVAL_LONG(_31$$19, 2); - zephir_array_update_zval(&fieldBindTypes, columnName, &_31$$19, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "char")) { + ZEPHIR_INIT_NVAR(&_30$$19); + ZVAL_LONG(&_30$$19, 5); + zephir_array_update_zval(&fieldTypes, &columnName, &_30$$19, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_31$$19); + ZVAL_LONG(&_31$$19, 2); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_31$$19, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "json")) { - ZEPHIR_INIT_NVAR(_32$$20); - ZVAL_LONG(_32$$20, 15); - zephir_array_update_zval(&fieldTypes, columnName, &_32$$20, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_33$$20); - ZVAL_LONG(_33$$20, 2); - zephir_array_update_zval(&fieldBindTypes, columnName, &_33$$20, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "json")) { + ZEPHIR_INIT_NVAR(&_32$$20); + ZVAL_LONG(&_32$$20, 15); + zephir_array_update_zval(&fieldTypes, &columnName, &_32$$20, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_33$$20); + ZVAL_LONG(&_33$$20, 2); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_33$$20, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "tinyblob")) { - ZEPHIR_INIT_NVAR(_34$$21); - ZVAL_LONG(_34$$21, 10); - zephir_array_update_zval(&fieldTypes, columnName, &_34$$21, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_35$$21); - ZVAL_LONG(_35$$21, 3); - zephir_array_update_zval(&fieldBindTypes, columnName, &_35$$21, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "tinyblob")) { + ZEPHIR_INIT_NVAR(&_34$$21); + ZVAL_LONG(&_34$$21, 10); + zephir_array_update_zval(&fieldTypes, &columnName, &_34$$21, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_35$$21); + ZVAL_LONG(&_35$$21, 3); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_35$$21, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "blob")) { - ZEPHIR_INIT_NVAR(_36$$22); - ZVAL_LONG(_36$$22, 11); - zephir_array_update_zval(&fieldTypes, columnName, &_36$$22, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_37$$22); - ZVAL_LONG(_37$$22, 3); - zephir_array_update_zval(&fieldBindTypes, columnName, &_37$$22, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "blob")) { + ZEPHIR_INIT_NVAR(&_36$$22); + ZVAL_LONG(&_36$$22, 11); + zephir_array_update_zval(&fieldTypes, &columnName, &_36$$22, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_37$$22); + ZVAL_LONG(&_37$$22, 3); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_37$$22, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "mediumblob")) { - ZEPHIR_INIT_NVAR(_38$$23); - ZVAL_LONG(_38$$23, 12); - zephir_array_update_zval(&fieldTypes, columnName, &_38$$23, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_39$$23); - ZVAL_LONG(_39$$23, 3); - zephir_array_update_zval(&fieldBindTypes, columnName, &_39$$23, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "mediumblob")) { + ZEPHIR_INIT_NVAR(&_38$$23); + ZVAL_LONG(&_38$$23, 12); + zephir_array_update_zval(&fieldTypes, &columnName, &_38$$23, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_39$$23); + ZVAL_LONG(&_39$$23, 3); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_39$$23, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(feature, "longblob")) { - ZEPHIR_INIT_NVAR(_40$$24); - ZVAL_LONG(_40$$24, 13); - zephir_array_update_zval(&fieldTypes, columnName, &_40$$24, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_41$$24); - ZVAL_LONG(_41$$24, 3); - zephir_array_update_zval(&fieldBindTypes, columnName, &_41$$24, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_STRING(&feature, "longblob")) { + ZEPHIR_INIT_NVAR(&_40$$24); + ZVAL_LONG(&_40$$24, 13); + zephir_array_update_zval(&fieldTypes, &columnName, &_40$$24, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_41$$24); + ZVAL_LONG(&_41$$24, 3); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_41$$24, PH_COPY | PH_SEPARATE); break; } - ZEPHIR_INIT_NVAR(_42$$25); - ZVAL_LONG(_42$$25, 2); - zephir_array_update_zval(&fieldTypes, columnName, &_42$$25, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_43$$25); - ZVAL_LONG(_43$$25, 2); - zephir_array_update_zval(&fieldBindTypes, columnName, &_43$$25, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_42$$25); + ZVAL_LONG(&_42$$25, 2); + zephir_array_update_zval(&fieldTypes, &columnName, &_42$$25, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_43$$25); + ZVAL_LONG(&_43$$25, 2); + zephir_array_update_zval(&fieldBindTypes, &columnName, &_43$$25, PH_COPY | PH_SEPARATE); } while(0); - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "Primary", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_44$$6, propAnnotations, "has", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "Primary"); + ZEPHIR_CALL_METHOD(&_44$$6, &propAnnotations, "has", NULL, 0, &_9$$6); zephir_check_call_status(); - if (zephir_is_true(_44$$6)) { - zephir_array_append(&primaryKeys, columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 206); + if (zephir_is_true(&_44$$6)) { + zephir_array_append(&primaryKeys, &columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 206); } else { - zephir_array_append(&nonPrimaryKeys, columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 208); + zephir_array_append(&nonPrimaryKeys, &columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 208); } - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "Identity", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_45$$6, propAnnotations, "has", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "Identity"); + ZEPHIR_CALL_METHOD(&_45$$6, &propAnnotations, "has", NULL, 0, &_9$$6); zephir_check_call_status(); - if (zephir_is_true(_45$$6)) { - ZEPHIR_CPY_WRT(identityField, columnName); + if (zephir_is_true(&_45$$6)) { + ZEPHIR_CPY_WRT(&identityField, &columnName); } - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "skip_on_insert", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_46$$6, columnAnnotation, "getnamedparameter", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "skip_on_insert"); + ZEPHIR_CALL_METHOD(&_46$$6, &columnAnnotation, "getnamedparameter", NULL, 0, &_9$$6); zephir_check_call_status(); - if (zephir_is_true(_46$$6)) { - zephir_array_append(&skipOnInsert, columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 222); + if (zephir_is_true(&_46$$6)) { + zephir_array_append(&skipOnInsert, &columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 222); } - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "skip_on_update", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_47$$6, columnAnnotation, "getnamedparameter", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "skip_on_update"); + ZEPHIR_CALL_METHOD(&_47$$6, &columnAnnotation, "getnamedparameter", NULL, 0, &_9$$6); zephir_check_call_status(); - if (zephir_is_true(_47$$6)) { - zephir_array_append(&skipOnUpdate, columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 229); + if (zephir_is_true(&_47$$6)) { + zephir_array_append(&skipOnUpdate, &columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 229); } - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "allow_empty_string", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_48$$6, columnAnnotation, "getnamedparameter", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "allow_empty_string"); + ZEPHIR_CALL_METHOD(&_48$$6, &columnAnnotation, "getnamedparameter", NULL, 0, &_9$$6); zephir_check_call_status(); - if (zephir_is_true(_48$$6)) { - zephir_array_append(&emptyStringValues, columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 236); + if (zephir_is_true(&_48$$6)) { + zephir_array_append(&emptyStringValues, &columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 236); } - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "nullable", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_49$$6, columnAnnotation, "getnamedparameter", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "nullable"); + ZEPHIR_CALL_METHOD(&_49$$6, &columnAnnotation, "getnamedparameter", NULL, 0, &_9$$6); zephir_check_call_status(); - if (!(zephir_is_true(_49$$6))) { - zephir_array_append(¬Null, columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 243); + if (!(zephir_is_true(&_49$$6))) { + zephir_array_append(¬Null, &columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 243); } - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "default", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&defaultValue, columnAnnotation, "getnamedparameter", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "default"); + ZEPHIR_CALL_METHOD(&defaultValue, &columnAnnotation, "getnamedparameter", NULL, 0, &_9$$6); zephir_check_call_status(); - _50$$6 = Z_TYPE_P(defaultValue) != IS_NULL; + _50$$6 = Z_TYPE_P(&defaultValue) != IS_NULL; if (!(_50$$6)) { - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "nullable", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_51$$6, columnAnnotation, "getnamedparameter", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "nullable"); + ZEPHIR_CALL_METHOD(&_51$$6, &columnAnnotation, "getnamedparameter", NULL, 0, &_9$$6); zephir_check_call_status(); - _50$$6 = zephir_is_true(_51$$6); + _50$$6 = zephir_is_true(&_51$$6); } if (_50$$6) { - zephir_array_update_zval(&defaultValues, columnName, &defaultValue, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&defaultValues, &columnName, &defaultValue, PH_COPY | PH_SEPARATE); } - zephir_array_append(&attributes, columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 254); - } + zephir_array_append(&attributes, &columnName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/annotations.zep", 254); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&propAnnotations); + ZEPHIR_INIT_NVAR(&property); zephir_create_array(return_value, 12, 0 TSRMLS_CC); - zephir_array_update_long(&return_value, 0, &attributes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 1, &primaryKeys, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 2, &nonPrimaryKeys, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 3, ¬Null, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 4, &fieldTypes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 5, &numericTyped, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 8, &identityField, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 9, &fieldBindTypes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 10, &skipOnInsert, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 11, &skipOnUpdate, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 12, &defaultValues, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 13, &emptyStringValues, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 0, &attributes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 1, &primaryKeys, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 2, &nonPrimaryKeys, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 3, ¬Null, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 4, &fieldTypes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 5, &numericTyped, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 8, &identityField, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 9, &fieldBindTypes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 10, &skipOnInsert, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 11, &skipOnUpdate, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 12, &defaultValues, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 13, &emptyStringValues, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); RETURN_MM(); } @@ -389,11 +457,33 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getMetaData) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getColumnMaps) { - HashTable *_6; - HashPosition _5; + zend_string *_7; + zend_ulong _6; zend_bool hasReversedColumn = 0, _10$$6; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *dependencyInjector, *annotations = NULL, *className = NULL, *reflection = NULL, *propertiesAnnotations = NULL, *property = NULL, *propAnnotations = NULL, *columnAnnotation = NULL, *columnName = NULL, *orderedColumnMap = NULL, *reversedColumnMap = NULL, *_0, **_7, *_1$$4, *_2$$4, *_3$$5, *_4$$5, *_8$$6 = NULL, *_9$$6 = NULL; + zval *model, model_sub, *dependencyInjector, dependencyInjector_sub, __$null, annotations, className, reflection, propertiesAnnotations, property, propAnnotations, columnAnnotation, columnName, orderedColumnMap, reversedColumnMap, _0, *_5, _1$$4, _2$$4, _3$$5, _4$$5, _8$$6, _9$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&reflection); + ZVAL_UNDEF(&propertiesAnnotations); + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&propAnnotations); + ZVAL_UNDEF(&columnAnnotation); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&orderedColumnMap); + ZVAL_UNDEF(&reversedColumnMap); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_9$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &dependencyInjector); @@ -404,91 +494,93 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getColumnMaps) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The dependency injector is invalid", "phalcon/mvc/model/metadata/strategy/annotations.zep", 286); return; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "annotations", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&annotations, dependencyInjector, "get", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "annotations"); + ZEPHIR_CALL_METHOD(&annotations, dependencyInjector, "get", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, model, 0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&reflection, annotations, "get", NULL, 0, className); + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, model, 0 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&reflection, &annotations, "get", NULL, 0, &className); zephir_check_call_status(); - if (Z_TYPE_P(reflection) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$4); - object_init_ex(_1$$4, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_2$$4); - ZEPHIR_CONCAT_SV(_2$$4, "No annotations were found in class ", className); - ZEPHIR_CALL_METHOD(NULL, _1$$4, "__construct", NULL, 9, _2$$4); + if (Z_TYPE_P(&reflection) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$4); + object_init_ex(&_1$$4, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_2$$4); + ZEPHIR_CONCAT_SV(&_2$$4, "No annotations were found in class ", &className); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 4, &_2$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$4, "phalcon/mvc/model/metadata/strategy/annotations.zep", 293 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$4, "phalcon/mvc/model/metadata/strategy/annotations.zep", 293 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&propertiesAnnotations, reflection, "getpropertiesannotations", NULL, 0); + ZEPHIR_CALL_METHOD(&propertiesAnnotations, &reflection, "getpropertiesannotations", NULL, 0); zephir_check_call_status(); - if (!(zephir_fast_count_int(propertiesAnnotations TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_3$$5); - object_init_ex(_3$$5, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_4$$5); - ZEPHIR_CONCAT_SV(_4$$5, "No properties with annotations were found in class ", className); - ZEPHIR_CALL_METHOD(NULL, _3$$5, "__construct", NULL, 9, _4$$5); + if (!(zephir_fast_count_int(&propertiesAnnotations TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_3$$5); + object_init_ex(&_3$$5, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_4$$5); + ZEPHIR_CONCAT_SV(&_4$$5, "No properties with annotations were found in class ", &className); + ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 4, &_4$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$5, "phalcon/mvc/model/metadata/strategy/annotations.zep", 301 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$5, "phalcon/mvc/model/metadata/strategy/annotations.zep", 301 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(orderedColumnMap); - array_init(orderedColumnMap); - ZEPHIR_INIT_VAR(reversedColumnMap); - array_init(reversedColumnMap); + ZEPHIR_INIT_VAR(&orderedColumnMap); + array_init(&orderedColumnMap); + ZEPHIR_INIT_VAR(&reversedColumnMap); + array_init(&reversedColumnMap); hasReversedColumn = 0; - zephir_is_iterable(propertiesAnnotations, &_6, &_5, 0, 0, "phalcon/mvc/model/metadata/strategy/annotations.zep", 339); - for ( - ; zend_hash_get_current_data_ex(_6, (void**) &_7, &_5) == SUCCESS - ; zend_hash_move_forward_ex(_6, &_5) - ) { - ZEPHIR_GET_HMKEY(property, _6, _5); - ZEPHIR_GET_HVALUE(propAnnotations, _7); - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "Column", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_8$$6, propAnnotations, "has", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + zephir_is_iterable(&propertiesAnnotations, 0, "phalcon/mvc/model/metadata/strategy/annotations.zep", 339); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&propertiesAnnotations), _6, _7, _5) + { + ZEPHIR_INIT_NVAR(&property); + if (_7 != NULL) { + ZVAL_STR_COPY(&property, _7); + } else { + ZVAL_LONG(&property, _6); + } + ZEPHIR_INIT_NVAR(&propAnnotations); + ZVAL_COPY(&propAnnotations, _5); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "Column"); + ZEPHIR_CALL_METHOD(&_8$$6, &propAnnotations, "has", NULL, 0, &_9$$6); zephir_check_call_status(); - if (!(zephir_is_true(_8$$6))) { + if (!(zephir_is_true(&_8$$6))) { continue; } - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "Column", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&columnAnnotation, propAnnotations, "get", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "Column"); + ZEPHIR_CALL_METHOD(&columnAnnotation, &propAnnotations, "get", NULL, 0, &_9$$6); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_9$$6); - ZVAL_STRING(_9$$6, "column", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&columnName, columnAnnotation, "getnamedparameter", NULL, 0, _9$$6); - zephir_check_temp_parameter(_9$$6); + ZEPHIR_INIT_NVAR(&_9$$6); + ZVAL_STRING(&_9$$6, "column"); + ZEPHIR_CALL_METHOD(&columnName, &columnAnnotation, "getnamedparameter", NULL, 0, &_9$$6); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(columnName)) { - ZEPHIR_CPY_WRT(columnName, property); + if (ZEPHIR_IS_EMPTY(&columnName)) { + ZEPHIR_CPY_WRT(&columnName, &property); } - zephir_array_update_zval(&orderedColumnMap, columnName, &property, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&reversedColumnMap, property, &columnName, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&orderedColumnMap, &columnName, &property, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&reversedColumnMap, &property, &columnName, PH_COPY | PH_SEPARATE); _10$$6 = !hasReversedColumn; if (_10$$6) { - _10$$6 = !ZEPHIR_IS_EQUAL(columnName, property); + _10$$6 = !ZEPHIR_IS_EQUAL(&columnName, &property); } if (_10$$6) { hasReversedColumn = 1; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&propAnnotations); + ZEPHIR_INIT_NVAR(&property); if (!(hasReversedColumn)) { zephir_create_array(return_value, 2, 0 TSRMLS_CC); - zephir_array_fast_append(return_value, ZEPHIR_GLOBAL(global_null)); - zephir_array_fast_append(return_value, ZEPHIR_GLOBAL(global_null)); + zephir_array_fast_append(return_value, &__$null); + zephir_array_fast_append(return_value, &__$null); RETURN_MM(); } zephir_create_array(return_value, 2, 0 TSRMLS_CC); - zephir_array_fast_append(return_value, orderedColumnMap); - zephir_array_fast_append(return_value, reversedColumnMap); + zephir_array_fast_append(return_value, &orderedColumnMap); + zephir_array_fast_append(return_value, &reversedColumnMap); RETURN_MM(); } diff --git a/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.h b/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.h index 5d828231e73..942e70e09ba 100644 --- a/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.h +++ b/ext/phalcon/mvc/model/metadata/strategy/annotations.zep.h @@ -6,12 +6,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Strategy_Annotations); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getMetaData); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Annotations, getColumnMaps); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_annotations_getmetadata, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_annotations_getmetadata, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_annotations_getmetadata, 0, 2, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_annotations_getcolumnmaps, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_annotations_getcolumnmaps, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_annotations_getcolumnmaps, 0, 2, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.c b/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.c index d0b8287c853..602ba3745a2 100644 --- a/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.c +++ b/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.c @@ -40,11 +40,48 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Strategy_Introspection) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Introspection, getMetaData) { - zend_bool _16$$9; - HashTable *_8; - HashPosition _7; + zend_bool _14$$9; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *dependencyInjector, *schema = NULL, *table = NULL, *readConnection = NULL, *columns = NULL, *attributes = NULL, *primaryKeys = NULL, *nonPrimaryKeys = NULL, *completeTable = NULL, *numericTyped = NULL, *notNull = NULL, *fieldTypes = NULL, *automaticDefault = NULL, *identityField = NULL, *fieldBindTypes = NULL, *defaultValues = NULL, *column = NULL, *fieldName = NULL, *defaultValue = NULL, *emptyStringValues = NULL, *_0 = NULL, **_9, *_1$$3, *_2$$3, *_3$$3, *_4$$6, *_5$$6, *_6$$6, *_10$$9 = NULL, *_11$$9 = NULL, *_12$$9 = NULL, *_13$$9 = NULL, *_14$$9 = NULL, *_15$$9 = NULL, *_17$$9 = NULL, *_18$$15 = NULL; + zval *model, model_sub, *dependencyInjector, dependencyInjector_sub, __$true, schema, table, readConnection, columns, attributes, primaryKeys, nonPrimaryKeys, completeTable, numericTyped, notNull, fieldTypes, automaticDefault, identityField, fieldBindTypes, defaultValues, column, fieldName, defaultValue, emptyStringValues, _0, *_7, _1$$3, _2$$3, _3$$3, _4$$6, _5$$6, _6$$6, _8$$9, _9$$9, _10$$9, _11$$9, _12$$9, _13$$9, _15$$9, _16$$15; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&readConnection); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&primaryKeys); + ZVAL_UNDEF(&nonPrimaryKeys); + ZVAL_UNDEF(&completeTable); + ZVAL_UNDEF(&numericTyped); + ZVAL_UNDEF(¬Null); + ZVAL_UNDEF(&fieldTypes); + ZVAL_UNDEF(&automaticDefault); + ZVAL_UNDEF(&identityField); + ZVAL_UNDEF(&fieldBindTypes); + ZVAL_UNDEF(&defaultValues); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&fieldName); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(&emptyStringValues); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_10$$9); + ZVAL_UNDEF(&_11$$9); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_15$$9); + ZVAL_UNDEF(&_16$$15); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &dependencyInjector); @@ -57,136 +94,136 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Introspection, getMetaData) { zephir_check_call_status(); ZEPHIR_CALL_METHOD(&readConnection, model, "getreadconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, readConnection, "tableexists", NULL, 0, table, schema); + ZEPHIR_CALL_METHOD(&_0, &readConnection, "tableexists", NULL, 0, &table, &schema); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { - if (zephir_is_true(schema)) { - ZEPHIR_INIT_VAR(completeTable); - ZEPHIR_CONCAT_VSV(completeTable, schema, "'.'", table); + if (!(zephir_is_true(&_0))) { + if (zephir_is_true(&schema)) { + ZEPHIR_INIT_VAR(&completeTable); + ZEPHIR_CONCAT_VSV(&completeTable, &schema, "'.'", &table); } else { - ZEPHIR_CPY_WRT(completeTable, table); + ZEPHIR_CPY_WRT(&completeTable, &table); } - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - zephir_get_class(_2$$3, model, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3$$3); - ZEPHIR_CONCAT_SVSV(_3$$3, "Table '", completeTable, "' doesn't exist in database when dumping meta-data for ", _2$$3); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _3$$3); + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + zephir_get_class(&_2$$3, model, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$3); + ZEPHIR_CONCAT_SVSV(&_3$$3, "Table '", &completeTable, "' doesn't exist in database when dumping meta-data for ", &_2$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_3$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/mvc/model/metadata/strategy/introspection.zep", 68 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/mvc/model/metadata/strategy/introspection.zep", 68 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&columns, readConnection, "describecolumns", NULL, 0, table, schema); + ZEPHIR_CALL_METHOD(&columns, &readConnection, "describecolumns", NULL, 0, &table, &schema); zephir_check_call_status(); - if (!(zephir_fast_count_int(columns TSRMLS_CC))) { - if (zephir_is_true(schema)) { - ZEPHIR_INIT_NVAR(completeTable); - ZEPHIR_CONCAT_VSV(completeTable, schema, "'.'", table); + if (!(zephir_fast_count_int(&columns TSRMLS_CC))) { + if (zephir_is_true(&schema)) { + ZEPHIR_INIT_NVAR(&completeTable); + ZEPHIR_CONCAT_VSV(&completeTable, &schema, "'.'", &table); } else { - ZEPHIR_CPY_WRT(completeTable, table); + ZEPHIR_CPY_WRT(&completeTable, &table); } - ZEPHIR_INIT_VAR(_4$$6); - object_init_ex(_4$$6, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_5$$6); - zephir_get_class(_5$$6, model, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_6$$6); - ZEPHIR_CONCAT_SVSV(_6$$6, "Cannot obtain table columns for the mapped source '", completeTable, "' used in model ", _5$$6); - ZEPHIR_CALL_METHOD(NULL, _4$$6, "__construct", NULL, 9, _6$$6); + ZEPHIR_INIT_VAR(&_4$$6); + object_init_ex(&_4$$6, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_5$$6); + zephir_get_class(&_5$$6, model, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$6); + ZEPHIR_CONCAT_SVSV(&_6$$6, "Cannot obtain table columns for the mapped source '", &completeTable, "' used in model ", &_5$$6); + ZEPHIR_CALL_METHOD(NULL, &_4$$6, "__construct", NULL, 4, &_6$$6); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$6, "phalcon/mvc/model/metadata/strategy/introspection.zep", 88 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$6, "phalcon/mvc/model/metadata/strategy/introspection.zep", 88 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(attributes); - array_init(attributes); - ZEPHIR_INIT_VAR(primaryKeys); - array_init(primaryKeys); - ZEPHIR_INIT_VAR(nonPrimaryKeys); - array_init(nonPrimaryKeys); - ZEPHIR_INIT_VAR(numericTyped); - array_init(numericTyped); - ZEPHIR_INIT_VAR(notNull); - array_init(notNull); - ZEPHIR_INIT_VAR(fieldTypes); - array_init(fieldTypes); - ZEPHIR_INIT_VAR(fieldBindTypes); - array_init(fieldBindTypes); - ZEPHIR_INIT_VAR(automaticDefault); - array_init(automaticDefault); - ZEPHIR_INIT_VAR(identityField); - ZVAL_BOOL(identityField, 0); - ZEPHIR_INIT_VAR(defaultValues); - array_init(defaultValues); - ZEPHIR_INIT_VAR(emptyStringValues); - array_init(emptyStringValues); - zephir_is_iterable(columns, &_8, &_7, 0, 0, "phalcon/mvc/model/metadata/strategy/introspection.zep", 165); - for ( - ; zend_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS - ; zend_hash_move_forward_ex(_8, &_7) - ) { - ZEPHIR_GET_HVALUE(column, _9); - ZEPHIR_CALL_METHOD(&fieldName, column, "getname", NULL, 0); + ZEPHIR_INIT_VAR(&attributes); + array_init(&attributes); + ZEPHIR_INIT_VAR(&primaryKeys); + array_init(&primaryKeys); + ZEPHIR_INIT_VAR(&nonPrimaryKeys); + array_init(&nonPrimaryKeys); + ZEPHIR_INIT_VAR(&numericTyped); + array_init(&numericTyped); + ZEPHIR_INIT_VAR(¬Null); + array_init(¬Null); + ZEPHIR_INIT_VAR(&fieldTypes); + array_init(&fieldTypes); + ZEPHIR_INIT_VAR(&fieldBindTypes); + array_init(&fieldBindTypes); + ZEPHIR_INIT_VAR(&automaticDefault); + array_init(&automaticDefault); + ZEPHIR_INIT_VAR(&identityField); + ZVAL_BOOL(&identityField, 0); + ZEPHIR_INIT_VAR(&defaultValues); + array_init(&defaultValues); + ZEPHIR_INIT_VAR(&emptyStringValues); + array_init(&emptyStringValues); + zephir_is_iterable(&columns, 0, "phalcon/mvc/model/metadata/strategy/introspection.zep", 165); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _7) + { + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _7); + ZEPHIR_CALL_METHOD(&fieldName, &column, "getname", NULL, 0); zephir_check_call_status(); - zephir_array_append(&attributes, fieldName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/introspection.zep", 109); - ZEPHIR_CALL_METHOD(&_10$$9, column, "isprimary", NULL, 0); + zephir_array_append(&attributes, &fieldName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/introspection.zep", 109); + ZEPHIR_CALL_METHOD(&_8$$9, &column, "isprimary", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(_10$$9)) { - zephir_array_append(&primaryKeys, fieldName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/introspection.zep", 115); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_8$$9)) { + zephir_array_append(&primaryKeys, &fieldName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/introspection.zep", 115); } else { - zephir_array_append(&nonPrimaryKeys, fieldName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/introspection.zep", 117); + zephir_array_append(&nonPrimaryKeys, &fieldName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/introspection.zep", 117); } - ZEPHIR_CALL_METHOD(&_11$$9, column, "isnumeric", NULL, 0); + ZEPHIR_CALL_METHOD(&_9$$9, &column, "isnumeric", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(_11$$9)) { - zephir_array_update_zval(&numericTyped, fieldName, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_9$$9)) { + zephir_array_update_zval(&numericTyped, &fieldName, &__$true, PH_COPY | PH_SEPARATE); } - ZEPHIR_CALL_METHOD(&_12$$9, column, "isnotnull", NULL, 0); + ZEPHIR_CALL_METHOD(&_10$$9, &column, "isnotnull", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(_12$$9)) { - zephir_array_append(¬Null, fieldName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/introspection.zep", 131); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_10$$9)) { + zephir_array_append(¬Null, &fieldName, PH_SEPARATE, "phalcon/mvc/model/metadata/strategy/introspection.zep", 131); } - ZEPHIR_CALL_METHOD(&_13$$9, column, "isautoincrement", NULL, 0); + ZEPHIR_CALL_METHOD(&_11$$9, &column, "isautoincrement", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_TRUE_IDENTICAL(_13$$9)) { - ZEPHIR_CPY_WRT(identityField, fieldName); + if (ZEPHIR_IS_TRUE_IDENTICAL(&_11$$9)) { + ZEPHIR_CPY_WRT(&identityField, &fieldName); } - ZEPHIR_CALL_METHOD(&_14$$9, column, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(&_12$$9, &column, "gettype", NULL, 0); zephir_check_call_status(); - zephir_array_update_zval(&fieldTypes, fieldName, &_14$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_15$$9, column, "getbindtype", NULL, 0); + zephir_array_update_zval(&fieldTypes, &fieldName, &_12$$9, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&_13$$9, &column, "getbindtype", NULL, 0); zephir_check_call_status(); - zephir_array_update_zval(&fieldBindTypes, fieldName, &_15$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&defaultValue, column, "getdefault", NULL, 0); + zephir_array_update_zval(&fieldBindTypes, &fieldName, &_13$$9, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(&defaultValue, &column, "getdefault", NULL, 0); zephir_check_call_status(); - _16$$9 = Z_TYPE_P(defaultValue) != IS_NULL; - if (!(_16$$9)) { - ZEPHIR_CALL_METHOD(&_17$$9, column, "isnotnull", NULL, 0); + _14$$9 = Z_TYPE_P(&defaultValue) != IS_NULL; + if (!(_14$$9)) { + ZEPHIR_CALL_METHOD(&_15$$9, &column, "isnotnull", NULL, 0); zephir_check_call_status(); - _16$$9 = ZEPHIR_IS_FALSE_IDENTICAL(_17$$9); + _14$$9 = ZEPHIR_IS_FALSE_IDENTICAL(&_15$$9); } - if (_16$$9) { - ZEPHIR_CALL_METHOD(&_18$$15, column, "isautoincrement", NULL, 0); + if (_14$$9) { + ZEPHIR_CALL_METHOD(&_16$$15, &column, "isautoincrement", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_18$$15))) { - zephir_array_update_zval(&defaultValues, fieldName, &defaultValue, PH_COPY | PH_SEPARATE); + if (!(zephir_is_true(&_16$$15))) { + zephir_array_update_zval(&defaultValues, &fieldName, &defaultValue, PH_COPY | PH_SEPARATE); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); zephir_create_array(return_value, 12, 0 TSRMLS_CC); - zephir_array_update_long(&return_value, 0, &attributes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 1, &primaryKeys, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 2, &nonPrimaryKeys, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 3, ¬Null, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 4, &fieldTypes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 5, &numericTyped, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 8, &identityField, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 9, &fieldBindTypes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 10, &automaticDefault, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 11, &automaticDefault, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 12, &defaultValues, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_update_long(&return_value, 13, &emptyStringValues, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 0, &attributes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 1, &primaryKeys, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 2, &nonPrimaryKeys, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 3, ¬Null, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 4, &fieldTypes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 5, &numericTyped, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 8, &identityField, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 9, &fieldBindTypes, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 10, &automaticDefault, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 11, &automaticDefault, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 12, &defaultValues, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_update_long(return_value, 13, &emptyStringValues, PH_COPY ZEPHIR_DEBUG_PARAMS_DUMMY); RETURN_MM(); } @@ -196,43 +233,58 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Introspection, getMetaData) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Introspection, getColumnMaps) { - HashTable *_1$$3; - HashPosition _0$$3; + zend_string *_2$$3; + zend_ulong _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *dependencyInjector, *orderedColumnMap = NULL, *userColumnMap = NULL, *reversedColumnMap = NULL, *name = NULL, *userName = NULL, **_2$$3; + zval *model, model_sub, *dependencyInjector, dependencyInjector_sub, orderedColumnMap, userColumnMap, reversedColumnMap, name, userName, *_0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&orderedColumnMap); + ZVAL_UNDEF(&userColumnMap); + ZVAL_UNDEF(&reversedColumnMap); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&userName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &dependencyInjector); - ZEPHIR_INIT_VAR(orderedColumnMap); - ZVAL_NULL(orderedColumnMap); - ZEPHIR_INIT_VAR(reversedColumnMap); - ZVAL_NULL(reversedColumnMap); - if ((zephir_method_exists_ex(model, SS("columnmap") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_INIT_VAR(&orderedColumnMap); + ZVAL_NULL(&orderedColumnMap); + ZEPHIR_INIT_VAR(&reversedColumnMap); + ZVAL_NULL(&reversedColumnMap); + if ((zephir_method_exists_ex(model, SL("columnmap") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(&userColumnMap, model, "columnmap", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(userColumnMap) != IS_ARRAY) { + if (Z_TYPE_P(&userColumnMap) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "columnMap() not returned an array", "phalcon/mvc/model/metadata/strategy/introspection.zep", 198); return; } - ZEPHIR_INIT_NVAR(reversedColumnMap); - array_init(reversedColumnMap); - ZEPHIR_CPY_WRT(orderedColumnMap, userColumnMap); - zephir_is_iterable(userColumnMap, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/metadata/strategy/introspection.zep", 205); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(name, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(userName, _2$$3); - zephir_array_update_zval(&reversedColumnMap, userName, &name, PH_COPY | PH_SEPARATE); - } + ZEPHIR_INIT_NVAR(&reversedColumnMap); + array_init(&reversedColumnMap); + ZEPHIR_CPY_WRT(&orderedColumnMap, &userColumnMap); + zephir_is_iterable(&userColumnMap, 0, "phalcon/mvc/model/metadata/strategy/introspection.zep", 205); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&userColumnMap), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&name); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&name, _2$$3); + } else { + ZVAL_LONG(&name, _1$$3); + } + ZEPHIR_INIT_NVAR(&userName); + ZVAL_COPY(&userName, _0$$3); + zephir_array_update_zval(&reversedColumnMap, &userName, &name, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&userName); + ZEPHIR_INIT_NVAR(&name); } zephir_create_array(return_value, 2, 0 TSRMLS_CC); - zephir_array_fast_append(return_value, orderedColumnMap); - zephir_array_fast_append(return_value, reversedColumnMap); + zephir_array_fast_append(return_value, &orderedColumnMap); + zephir_array_fast_append(return_value, &reversedColumnMap); RETURN_MM(); } diff --git a/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.h b/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.h index 6e75b87a384..d000f6a6b4a 100644 --- a/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.h +++ b/ext/phalcon/mvc/model/metadata/strategy/introspection.zep.h @@ -6,12 +6,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Strategy_Introspection); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Introspection, getMetaData); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Strategy_Introspection, getColumnMaps); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_introspection_getmetadata, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_introspection_getmetadata, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_introspection_getmetadata, 0, 2, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_introspection_getcolumnmaps, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_introspection_getcolumnmaps, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadata_strategy_introspection_getcolumnmaps, 0, 2, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadata/xcache.zep.c b/ext/phalcon/mvc/model/metadata/xcache.zep.c index 301e79ef63c..dc5c4d6a66e 100644 --- a/ext/phalcon/mvc/model/metadata/xcache.zep.c +++ b/ext/phalcon/mvc/model/metadata/xcache.zep.c @@ -62,21 +62,28 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Xcache) { */ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, __construct) { - zval *options = NULL, *prefix = NULL, *ttl = NULL; + zval *options = NULL, options_sub, __$null, prefix, ttl; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&ttl); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + if (zephir_array_isset_string_fetch(&prefix, options, SL("prefix"), 1)) { + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); } - if (zephir_array_isset_string_fetch(&ttl, options, SS("lifetime"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_ttl"), ttl TSRMLS_CC); + if (zephir_array_isset_string_fetch(&ttl, options, SL("lifetime"), 1)) { + zephir_update_property_zval(this_ptr, SL("_ttl"), &ttl); } } @@ -91,31 +98,37 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, __construct) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data = NULL, *_0, *_1; - zval *key = NULL; + zval *key_param = NULL, data, _0, _1; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVV(_1, "$PMM$", _0, key); - ZEPHIR_CALL_FUNCTION(&data, "xcache_get", NULL, 94, _1); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVV(&_1, "$PMM$", &_0, &key); + ZEPHIR_CALL_FUNCTION(&data, "xcache_get", NULL, 83, &_1); zephir_check_call_status(); - if (Z_TYPE_P(data) == IS_ARRAY) { - RETURN_CCTOR(data); + if (Z_TYPE_P(&data) == IS_ARRAY) { + RETURN_CCTOR(&data); } RETURN_MM_NULL(); @@ -130,62 +143,60 @@ PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, read) { PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *data, *_0, *_1, *_2; - zval *key = NULL; + zval *key_param = NULL, *data, data_sub, _0, _1, _2; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &data); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVV(_1, "$PMM$", _0, key); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_ttl"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 95, _1, data, _2); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVV(&_1, "$PMM$", &_0, &key); + zephir_read_property(&_2, this_ptr, SL("_ttl"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(NULL, "xcache_set", NULL, 84, &_1, data, &_2); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Xcache(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Xcache(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_metaData"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_metaData"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_metaData"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/metadata/xcache.zep.h b/ext/phalcon/mvc/model/metadata/xcache.zep.h index 80011370105..a14812e7aec 100644 --- a/ext/phalcon/mvc/model/metadata/xcache.zep.h +++ b/ext/phalcon/mvc/model/metadata/xcache.zep.h @@ -6,18 +6,26 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_MetaData_Xcache); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, __construct); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, read); PHP_METHOD(Phalcon_Mvc_Model_MetaData_Xcache, write); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_MetaData_Xcache(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_MetaData_Xcache(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_xcache___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_xcache_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadata_xcache_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/metadatainterface.zep.h b/ext/phalcon/mvc/model/metadatainterface.zep.h index 5a94bf34225..7fcedd0261c 100644 --- a/ext/phalcon/mvc/model/metadatainterface.zep.h +++ b/ext/phalcon/mvc/model/metadatainterface.zep.h @@ -13,12 +13,20 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_readmetadataindex, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_writemetadataindex, 0, 0, 3) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -28,7 +36,11 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_readcolumnmapindex, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getattributes, 0, 0, 1) @@ -67,7 +79,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getautomaticc ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getautomaticupdateattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getautomaticupdateattributes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getautomaticupdateattributes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() @@ -86,33 +102,65 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_setemptystrin ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getemptystringattributes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getemptystringattributes, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getemptystringattributes, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getdefaultvalues, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getdefaultvalues, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getdefaultvalues, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getcolumnmap, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getcolumnmap, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getcolumnmap, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getreversecolumnmap, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getreversecolumnmap, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_getreversecolumnmap, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_hasattribute, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_hasattribute, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_hasattribute, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_metadatainterface_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/query.zep.c b/ext/phalcon/mvc/model/query.zep.c index 54cdd17487f..6ef2c9db7a3 100644 --- a/ext/phalcon/mvc/model/query.zep.c +++ b/ext/phalcon/mvc/model/query.zep.c @@ -132,13 +132,13 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query) { zend_declare_property_null(phalcon_mvc_model_query_ce, SL("_irPhqlCache"), ZEND_ACC_STATIC|ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_class_constant_long(phalcon_mvc_model_query_ce, SL("TYPE_SELECT"), 309 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_query_ce, SL("TYPE_SELECT"), 309); - zend_declare_class_constant_long(phalcon_mvc_model_query_ce, SL("TYPE_INSERT"), 306 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_query_ce, SL("TYPE_INSERT"), 306); - zend_declare_class_constant_long(phalcon_mvc_model_query_ce, SL("TYPE_UPDATE"), 300 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_query_ce, SL("TYPE_UPDATE"), 300); - zend_declare_class_constant_long(phalcon_mvc_model_query_ce, SL("TYPE_DELETE"), 303 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_query_ce, SL("TYPE_DELETE"), 303); zend_class_implements(phalcon_mvc_model_query_ce TSRMLS_CC, 1, phalcon_mvc_model_queryinterface_ce); zend_class_implements(phalcon_mvc_model_query_ce TSRMLS_CC, 1, phalcon_di_injectionawareinterface_ce); @@ -156,7 +156,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getTransaction) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_transaction"); @@ -172,24 +173,36 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, __construct) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *phql = NULL, *dependencyInjector = NULL, *options = NULL, *enableImplicitJoins = NULL; + zval *phql = NULL, phql_sub, *dependencyInjector = NULL, dependencyInjector_sub, *options = NULL, options_sub, __$true, __$false, __$null, enableImplicitJoins; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&phql_sub); + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&enableImplicitJoins); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &phql, &dependencyInjector, &options); if (!phql) { - phql = ZEPHIR_GLOBAL(global_null); + phql = &phql_sub; + phql = &__$null; } if (!dependencyInjector) { - dependencyInjector = ZEPHIR_GLOBAL(global_null); + dependencyInjector = &dependencyInjector_sub; + dependencyInjector = &__$null; } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } if (Z_TYPE_P(phql) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_phql"), phql TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_phql"), phql); } if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "setdi", NULL, 0, dependencyInjector); @@ -197,20 +210,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, __construct) { } _0 = Z_TYPE_P(options) == IS_ARRAY; if (_0) { - ZEPHIR_OBS_VAR(enableImplicitJoins); - _0 = zephir_array_isset_string_fetch(&enableImplicitJoins, options, SS("enable_implicit_joins"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&enableImplicitJoins); + _0 = zephir_array_isset_string_fetch(&enableImplicitJoins, options, SL("enable_implicit_joins"), 0); } if (_0) { - if (ZEPHIR_IS_TRUE(enableImplicitJoins)) { - zephir_update_property_this(getThis(), SL("_enableImplicitJoins"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + if (ZEPHIR_IS_TRUE(&enableImplicitJoins)) { + zephir_update_property_zval(this_ptr, SL("_enableImplicitJoins"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_enableImplicitJoins"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_enableImplicitJoins"), &__$false); } } else { if (ZEPHIR_GLOBAL(orm).enable_implicit_joins) { - zephir_update_property_this(getThis(), SL("_enableImplicitJoins"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_enableImplicitJoins"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_enableImplicitJoins"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_enableImplicitJoins"), &__$false); } } ZEPHIR_MM_RESTORE(); @@ -223,34 +236,38 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, __construct) { PHP_METHOD(Phalcon_Mvc_Model_Query, setDI) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *dependencyInjector, *manager = NULL, *metaData = NULL, *_0 = NULL; + zval *dependencyInjector, dependencyInjector_sub, manager, metaData, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &dependencyInjector); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "modelsManager", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&manager, dependencyInjector, "getshared", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "modelsManager"); + ZEPHIR_CALL_METHOD(&manager, dependencyInjector, "getshared", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(manager) != IS_OBJECT) { + if (Z_TYPE_P(&manager) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsManager' is invalid", "phalcon/mvc/model/query.zep", 192); return; } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&metaData, dependencyInjector, "getshared", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "modelsMetadata"); + ZEPHIR_CALL_METHOD(&metaData, dependencyInjector, "getshared", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(metaData) != IS_OBJECT) { + if (Z_TYPE_P(&metaData) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Injected service 'modelsMetaData' is invalid", "phalcon/mvc/model/query.zep", 197); return; } - zephir_update_property_this(getThis(), SL("_manager"), manager TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_metaData"), metaData TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_manager"), &manager); + zephir_update_property_zval(this_ptr, SL("_metaData"), &metaData); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); ZEPHIR_MM_RESTORE(); } @@ -260,7 +277,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setDI) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -271,8 +289,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getDI) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, setUniqueRow) { - zval *uniqueRow_param = NULL; + zval *uniqueRow_param = NULL, __$true, __$false; zend_bool uniqueRow; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &uniqueRow_param); @@ -280,9 +302,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setUniqueRow) { if (uniqueRow) { - zephir_update_property_this(getThis(), SL("_uniqueRow"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_uniqueRow"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_uniqueRow"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_uniqueRow"), &__$false); } RETURN_THISW(); @@ -293,7 +315,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setUniqueRow) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getUniqueRow) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_uniqueRow"); @@ -304,190 +327,228 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getUniqueRow) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getQualified) { - HashTable *_14$$12; - HashPosition _13$$12; zend_bool _0, _1; - zephir_fcall_cache_entry *_17 = NULL; + zephir_fcall_cache_entry *_15 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, number = 0; - zval *expr_param = NULL, *columnName = NULL, *sqlColumnAliases = NULL, *metaData = NULL, *sqlAliases = NULL, *source = NULL, *sqlAliasesModelsInstances = NULL, *realColumnName = NULL, *columnDomain = NULL, *model = NULL, *models = NULL, *columnMap = NULL, *hasModel = NULL, *className = NULL, *_2, *_3$$5, *_4$$5, *_5$$5, *_6$$7, *_7$$7, *_8$$7, *_9$$10, *_10$$10, *_11$$10, *_12$$12, **_15$$12, *_16$$13 = NULL, *_18$$15 = NULL, *_19$$15, *_20$$15 = NULL, *_21$$16, *_22$$16, *_23$$16, *_24$$18, *_25$$18, *_26$$18, *_27$$22, *_28$$22, *_29$$22; - zval *expr = NULL; + zval *expr_param = NULL, columnName, sqlColumnAliases, metaData, sqlAliases, source, sqlAliasesModelsInstances, realColumnName, columnDomain, model, models, columnMap, hasModel, className, _2, _3$$5, _4$$5, _5$$5, _6$$7, _7$$7, _8$$7, _9$$10, _10$$10, _11$$10, _12$$12, *_13$$12, _14$$13, _16$$15, _17$$15, _18$$15, _19$$16, _20$$16, _21$$16, _22$$18, _23$$18, _24$$18, _25$$22, _26$$22, _27$$22; + zval expr; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&columnName); + ZVAL_UNDEF(&sqlColumnAliases); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&sqlAliases); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&sqlAliasesModelsInstances); + ZVAL_UNDEF(&realColumnName); + ZVAL_UNDEF(&columnDomain); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&hasModel); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_10$$10); + ZVAL_UNDEF(&_11$$10); + ZVAL_UNDEF(&_12$$12); + ZVAL_UNDEF(&_14$$13); + ZVAL_UNDEF(&_16$$15); + ZVAL_UNDEF(&_17$$15); + ZVAL_UNDEF(&_18$$15); + ZVAL_UNDEF(&_19$$16); + ZVAL_UNDEF(&_20$$16); + ZVAL_UNDEF(&_21$$16); + ZVAL_UNDEF(&_22$$18); + ZVAL_UNDEF(&_23$$18); + ZVAL_UNDEF(&_24$$18); + ZVAL_UNDEF(&_25$$22); + ZVAL_UNDEF(&_26$$22); + ZVAL_UNDEF(&_27$$22); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &expr_param); - expr = expr_param; + ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param); - ZEPHIR_OBS_VAR(columnName); - zephir_array_fetch_string(&columnName, expr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 241 TSRMLS_CC); - ZEPHIR_OBS_VAR(sqlColumnAliases); - zephir_read_property_this(&sqlColumnAliases, this_ptr, SL("_sqlColumnAliases"), PH_NOISY_CC); - _0 = zephir_array_isset(sqlColumnAliases, columnName); + ZEPHIR_OBS_VAR(&columnName); + zephir_array_fetch_string(&columnName, &expr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 241 TSRMLS_CC); + ZEPHIR_OBS_VAR(&sqlColumnAliases); + zephir_read_property(&sqlColumnAliases, this_ptr, SL("_sqlColumnAliases"), PH_NOISY_CC); + _0 = zephir_array_isset(&sqlColumnAliases, &columnName); if (_0) { - _1 = !(zephir_array_isset_string(expr, SS("domain"))); + _1 = !(zephir_array_isset_string(&expr, SL("domain"))); if (!(_1)) { - zephir_array_fetch_string(&_2, expr, SL("domain"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 247 TSRMLS_CC); - _1 = ZEPHIR_IS_EMPTY(_2); + zephir_array_fetch_string(&_2, &expr, SL("domain"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 247 TSRMLS_CC); + _1 = ZEPHIR_IS_EMPTY(&_2); } _0 = _1; } if (_0) { zephir_create_array(return_value, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(return_value, SS("type"), SL("qualified"), 1); - zephir_array_update_string(&return_value, SL("name"), &columnName, PH_COPY | PH_SEPARATE); + add_assoc_stringl_ex(return_value, SL("type"), SL("qualified")); + zephir_array_update_string(return_value, SL("name"), &columnName, PH_COPY | PH_SEPARATE); RETURN_MM(); } - ZEPHIR_OBS_VAR(metaData); - zephir_read_property_this(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(columnDomain); - if (zephir_array_isset_string_fetch(&columnDomain, expr, SS("domain"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_VAR(sqlAliases); - zephir_read_property_this(&sqlAliases, this_ptr, SL("_sqlAliases"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(source); - if (!(zephir_array_isset_fetch(&source, sqlAliases, columnDomain, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_3$$5); - object_init_ex(_3$$5, phalcon_mvc_model_exception_ce); - _4$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_5$$5); - ZEPHIR_CONCAT_SVSV(_5$$5, "Unknown model or alias '", columnDomain, "' (11), when preparing: ", _4$$5); - ZEPHIR_CALL_METHOD(NULL, _3$$5, "__construct", NULL, 9, _5$$5); + ZEPHIR_OBS_VAR(&metaData); + zephir_read_property(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&columnDomain); + if (zephir_array_isset_string_fetch(&columnDomain, &expr, SL("domain"), 0)) { + ZEPHIR_OBS_VAR(&sqlAliases); + zephir_read_property(&sqlAliases, this_ptr, SL("_sqlAliases"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&source); + if (!(zephir_array_isset_fetch(&source, &sqlAliases, &columnDomain, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_3$$5); + object_init_ex(&_3$$5, phalcon_mvc_model_exception_ce); + zephir_read_property(&_4$$5, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_5$$5); + ZEPHIR_CONCAT_SVSV(&_5$$5, "Unknown model or alias '", &columnDomain, "' (11), when preparing: ", &_4$$5); + ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", NULL, 4, &_5$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$5, "phalcon/mvc/model/query.zep", 267 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$5, "phalcon/mvc/model/query.zep", 267 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } if (ZEPHIR_GLOBAL(orm).column_renaming) { - ZEPHIR_OBS_VAR(sqlAliasesModelsInstances); - zephir_read_property_this(&sqlAliasesModelsInstances, this_ptr, SL("_sqlAliasesModelsInstances"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(model); - if (!(zephir_array_isset_fetch(&model, sqlAliasesModelsInstances, columnDomain, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_6$$7); - object_init_ex(_6$$7, phalcon_mvc_model_exception_ce); - _7$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_8$$7); - ZEPHIR_CONCAT_SVSV(_8$$7, "There is no model related to model or alias '", columnDomain, "', when executing: ", _7$$7); - ZEPHIR_CALL_METHOD(NULL, _6$$7, "__construct", NULL, 9, _8$$7); + ZEPHIR_OBS_VAR(&sqlAliasesModelsInstances); + zephir_read_property(&sqlAliasesModelsInstances, this_ptr, SL("_sqlAliasesModelsInstances"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&model); + if (!(zephir_array_isset_fetch(&model, &sqlAliasesModelsInstances, &columnDomain, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_6$$7); + object_init_ex(&_6$$7, phalcon_mvc_model_exception_ce); + zephir_read_property(&_7$$7, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_8$$7); + ZEPHIR_CONCAT_SVSV(&_8$$7, "There is no model related to model or alias '", &columnDomain, "', when executing: ", &_7$$7); + ZEPHIR_CALL_METHOD(NULL, &_6$$7, "__construct", NULL, 4, &_8$$7); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$7, "phalcon/mvc/model/query.zep", 286 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$7, "phalcon/mvc/model/query.zep", 286 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getreversecolumnmap", NULL, 0, model); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getreversecolumnmap", NULL, 0, &model); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_VAR(realColumnName); - if (!(zephir_array_isset_fetch(&realColumnName, columnMap, columnName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_9$$10); - object_init_ex(_9$$10, phalcon_mvc_model_exception_ce); - _10$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_11$$10); - ZEPHIR_CONCAT_SVSVSV(_11$$10, "Column '", columnName, "' doesn't belong to the model or alias '", columnDomain, "', when executing: ", _10$$10); - ZEPHIR_CALL_METHOD(NULL, _9$$10, "__construct", NULL, 9, _11$$10); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&realColumnName); + if (!(zephir_array_isset_fetch(&realColumnName, &columnMap, &columnName, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_9$$10); + object_init_ex(&_9$$10, phalcon_mvc_model_exception_ce); + zephir_read_property(&_10$$10, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_11$$10); + ZEPHIR_CONCAT_SVSVSV(&_11$$10, "Column '", &columnName, "' doesn't belong to the model or alias '", &columnDomain, "', when executing: ", &_10$$10); + ZEPHIR_CALL_METHOD(NULL, &_9$$10, "__construct", NULL, 4, &_11$$10); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$10, "phalcon/mvc/model/query.zep", 298 TSRMLS_CC); + zephir_throw_exception_debug(&_9$$10, "phalcon/mvc/model/query.zep", 298 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(realColumnName, columnName); + ZEPHIR_CPY_WRT(&realColumnName, &columnName); } } else { number = 0; - ZEPHIR_INIT_VAR(hasModel); - ZVAL_BOOL(hasModel, 0); - _12$$12 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsInstances"), PH_NOISY_CC); - zephir_is_iterable(_12$$12, &_14$$12, &_13$$12, 0, 0, "phalcon/mvc/model/query.zep", 328); - for ( - ; zend_hash_get_current_data_ex(_14$$12, (void**) &_15$$12, &_13$$12) == SUCCESS - ; zend_hash_move_forward_ex(_14$$12, &_13$$12) - ) { - ZEPHIR_GET_HVALUE(model, _15$$12); - ZEPHIR_CALL_METHOD(&_16$$13, metaData, "hasattribute", &_17, 0, model, columnName); + ZEPHIR_INIT_VAR(&hasModel); + ZVAL_BOOL(&hasModel, 0); + zephir_read_property(&_12$$12, this_ptr, SL("_modelsInstances"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_12$$12, 0, "phalcon/mvc/model/query.zep", 328); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_12$$12), _13$$12) + { + ZEPHIR_INIT_NVAR(&model); + ZVAL_COPY(&model, _13$$12); + ZEPHIR_CALL_METHOD(&_14$$13, &metaData, "hasattribute", &_15, 0, &model, &columnName); zephir_check_call_status(); - if (zephir_is_true(_16$$13)) { + if (zephir_is_true(&_14$$13)) { number++; if (number > 1) { - ZEPHIR_INIT_NVAR(_18$$15); - object_init_ex(_18$$15, phalcon_mvc_model_exception_ce); - _19$$15 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_LNVAR(_20$$15); - ZEPHIR_CONCAT_SVSV(_20$$15, "The column '", columnName, "' is ambiguous, when preparing: ", _19$$15); - ZEPHIR_CALL_METHOD(NULL, _18$$15, "__construct", NULL, 9, _20$$15); + ZEPHIR_INIT_NVAR(&_16$$15); + object_init_ex(&_16$$15, phalcon_mvc_model_exception_ce); + zephir_read_property(&_17$$15, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_LNVAR(_18$$15); + ZEPHIR_CONCAT_SVSV(&_18$$15, "The column '", &columnName, "' is ambiguous, when preparing: ", &_17$$15); + ZEPHIR_CALL_METHOD(NULL, &_16$$15, "__construct", NULL, 4, &_18$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_18$$15, "phalcon/mvc/model/query.zep", 319 TSRMLS_CC); + zephir_throw_exception_debug(&_16$$15, "phalcon/mvc/model/query.zep", 319 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CPY_WRT(hasModel, model); + ZEPHIR_CPY_WRT(&hasModel, &model); } - } - if (ZEPHIR_IS_FALSE_IDENTICAL(hasModel)) { - ZEPHIR_INIT_VAR(_21$$16); - object_init_ex(_21$$16, phalcon_mvc_model_exception_ce); - _22$$16 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_23$$16); - ZEPHIR_CONCAT_SVSV(_23$$16, "Column '", columnName, "' doesn't belong to any of the selected models (1), when preparing: ", _22$$16); - ZEPHIR_CALL_METHOD(NULL, _21$$16, "__construct", NULL, 9, _23$$16); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&model); + if (ZEPHIR_IS_FALSE_IDENTICAL(&hasModel)) { + ZEPHIR_INIT_VAR(&_19$$16); + object_init_ex(&_19$$16, phalcon_mvc_model_exception_ce); + zephir_read_property(&_20$$16, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_21$$16); + ZEPHIR_CONCAT_SVSV(&_21$$16, "Column '", &columnName, "' doesn't belong to any of the selected models (1), when preparing: ", &_20$$16); + ZEPHIR_CALL_METHOD(NULL, &_19$$16, "__construct", NULL, 4, &_21$$16); zephir_check_call_status(); - zephir_throw_exception_debug(_21$$16, "phalcon/mvc/model/query.zep", 331 TSRMLS_CC); + zephir_throw_exception_debug(&_19$$16, "phalcon/mvc/model/query.zep", 331 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_VAR(models); - zephir_read_property_this(&models, this_ptr, SL("_models"), PH_NOISY_CC); - if (Z_TYPE_P(models) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&models); + zephir_read_property(&models, this_ptr, SL("_models"), PH_NOISY_CC); + if (Z_TYPE_P(&models) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The models list was not loaded correctly", "phalcon/mvc/model/query.zep", 339); return; } - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, hasModel, 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(source); - if (!(zephir_array_isset_fetch(&source, models, className, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_24$$18); - object_init_ex(_24$$18, phalcon_mvc_model_exception_ce); - _25$$18 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_26$$18); - ZEPHIR_CONCAT_SVSV(_26$$18, "Can't obtain model's source from models list: '", className, "', when preparing: ", _25$$18); - ZEPHIR_CALL_METHOD(NULL, _24$$18, "__construct", NULL, 9, _26$$18); + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, &hasModel, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&source); + if (!(zephir_array_isset_fetch(&source, &models, &className, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_22$$18); + object_init_ex(&_22$$18, phalcon_mvc_model_exception_ce); + zephir_read_property(&_23$$18, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_24$$18); + ZEPHIR_CONCAT_SVSV(&_24$$18, "Can't obtain model's source from models list: '", &className, "', when preparing: ", &_23$$18); + ZEPHIR_CALL_METHOD(NULL, &_22$$18, "__construct", NULL, 4, &_24$$18); zephir_check_call_status(); - zephir_throw_exception_debug(_24$$18, "phalcon/mvc/model/query.zep", 349 TSRMLS_CC); + zephir_throw_exception_debug(&_22$$18, "phalcon/mvc/model/query.zep", 349 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } if (ZEPHIR_GLOBAL(orm).column_renaming) { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getreversecolumnmap", NULL, 0, hasModel); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getreversecolumnmap", NULL, 0, &hasModel); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(realColumnName); - if (!(zephir_array_isset_fetch(&realColumnName, columnMap, columnName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_27$$22); - object_init_ex(_27$$22, phalcon_mvc_model_exception_ce); - _28$$22 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_29$$22); - ZEPHIR_CONCAT_SVSV(_29$$22, "Column '", columnName, "' doesn't belong to any of the selected models (3), when preparing: ", _28$$22); - ZEPHIR_CALL_METHOD(NULL, _27$$22, "__construct", NULL, 9, _29$$22); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&realColumnName); + if (!(zephir_array_isset_fetch(&realColumnName, &columnMap, &columnName, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_25$$22); + object_init_ex(&_25$$22, phalcon_mvc_model_exception_ce); + zephir_read_property(&_26$$22, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_27$$22); + ZEPHIR_CONCAT_SVSV(&_27$$22, "Column '", &columnName, "' doesn't belong to any of the selected models (3), when preparing: ", &_26$$22); + ZEPHIR_CALL_METHOD(NULL, &_25$$22, "__construct", NULL, 4, &_27$$22); zephir_check_call_status(); - zephir_throw_exception_debug(_27$$22, "phalcon/mvc/model/query.zep", 368 TSRMLS_CC); + zephir_throw_exception_debug(&_25$$22, "phalcon/mvc/model/query.zep", 368 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(realColumnName, columnName); + ZEPHIR_CPY_WRT(&realColumnName, &columnName); } } zephir_create_array(return_value, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(return_value, SS("type"), SL("qualified"), 1); - zephir_array_update_string(&return_value, SL("domain"), &source, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("name"), &realColumnName, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("balias"), &columnName, PH_COPY | PH_SEPARATE); + add_assoc_stringl_ex(return_value, SL("type"), SL("qualified")); + zephir_array_update_string(return_value, SL("domain"), &source, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("name"), &realColumnName, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("balias"), &columnName, PH_COPY | PH_SEPARATE); RETURN_MM(); } @@ -498,22 +559,26 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getQualified) { PHP_METHOD(Phalcon_Mvc_Model_Query, _getCallArgument) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *argument_param = NULL, *_0; - zval *argument = NULL; + zval *argument_param = NULL, _0; + zval argument; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&argument); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &argument_param); - argument = argument_param; + ZEPHIR_OBS_COPY_OR_DUP(&argument, argument_param); - zephir_array_fetch_string(&_0, argument, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 391 TSRMLS_CC); - if (ZEPHIR_IS_LONG(_0, 352)) { + zephir_array_fetch_string(&_0, &argument, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 391 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&_0, 352)) { zephir_create_array(return_value, 1, 0 TSRMLS_CC); - add_assoc_stringl_ex(return_value, SS("type"), SL("all"), 1); + add_assoc_stringl_ex(return_value, SL("type"), SL("all")); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getexpression", NULL, 355, argument); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getexpression", NULL, 313, &argument); zephir_check_call_status(); RETURN_MM(); @@ -524,59 +589,72 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getCallArgument) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getCaseExpression) { - HashTable *_2; - HashPosition _1; - zephir_fcall_cache_entry *_7 = NULL; + zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *whenClauses = NULL, *whenExpr = NULL, *_0, **_3, *_12 = NULL, *_13, *_5$$4 = NULL, *_6$$4, *_8$$4, *_10$$5 = NULL, *_11$$5; - zval *expr = NULL, *_4$$4 = NULL, *_9$$5 = NULL; + zval *expr_param = NULL, whenClauses, whenExpr, _0, *_1, _10, _11, _3$$4, _4$$4, _6$$4, _8$$5, _9$$5; + zval expr, _2$$4, _7$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&whenClauses); + ZVAL_UNDEF(&whenExpr); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&_9$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &expr_param); - expr = expr_param; - - - ZEPHIR_INIT_VAR(whenClauses); - array_init(whenClauses); - zephir_array_fetch_string(&_0, expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 405 TSRMLS_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/mvc/model/query.zep", 420); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(whenExpr, _3); - if (zephir_array_isset_string(whenExpr, SS("right"))) { - ZEPHIR_INIT_NVAR(_4$$4); - zephir_create_array(_4$$4, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(_4$$4, SS("type"), SL("when"), 1); - zephir_array_fetch_string(&_6$$4, whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 409 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "_getexpression", &_7, 355, _6$$4); + ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param); + + + ZEPHIR_INIT_VAR(&whenClauses); + array_init(&whenClauses); + zephir_array_fetch_string(&_0, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 405 TSRMLS_CC); + zephir_is_iterable(&_0, 0, "phalcon/mvc/model/query.zep", 420); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&whenExpr); + ZVAL_COPY(&whenExpr, _1); + if (zephir_array_isset_string(&whenExpr, SL("right"))) { + ZEPHIR_INIT_NVAR(&_2$$4); + zephir_create_array(&_2$$4, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_2$$4, SL("type"), SL("when")); + zephir_array_fetch_string(&_4$$4, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 409 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_getexpression", &_5, 313, &_4$$4); zephir_check_call_status(); - zephir_array_update_string(&_4$$4, SL("expr"), &_5$$4, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_8$$4, whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 410 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_5$$4, this_ptr, "_getexpression", &_7, 355, _8$$4); + zephir_array_update_string(&_2$$4, SL("expr"), &_3$$4, PH_COPY | PH_SEPARATE); + zephir_array_fetch_string(&_6$$4, &whenExpr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 410 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_getexpression", &_5, 313, &_6$$4); zephir_check_call_status(); - zephir_array_update_string(&_4$$4, SL("then"), &_5$$4, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, _4$$4, PH_SEPARATE, "phalcon/mvc/model/query.zep", 411); + zephir_array_update_string(&_2$$4, SL("then"), &_3$$4, PH_COPY | PH_SEPARATE); + zephir_array_append(&whenClauses, &_2$$4, PH_SEPARATE, "phalcon/mvc/model/query.zep", 411); } else { - ZEPHIR_INIT_NVAR(_9$$5); - zephir_create_array(_9$$5, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(_9$$5, SS("type"), SL("else"), 1); - zephir_array_fetch_string(&_11$$5, whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 415 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_10$$5, this_ptr, "_getexpression", &_7, 355, _11$$5); + ZEPHIR_INIT_NVAR(&_7$$5); + zephir_create_array(&_7$$5, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_7$$5, SL("type"), SL("else")); + zephir_array_fetch_string(&_9$$5, &whenExpr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 415 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_8$$5, this_ptr, "_getexpression", &_5, 313, &_9$$5); zephir_check_call_status(); - zephir_array_update_string(&_9$$5, SL("expr"), &_10$$5, PH_COPY | PH_SEPARATE); - zephir_array_append(&whenClauses, _9$$5, PH_SEPARATE, "phalcon/mvc/model/query.zep", 416); + zephir_array_update_string(&_7$$5, SL("expr"), &_8$$5, PH_COPY | PH_SEPARATE); + zephir_array_append(&whenClauses, &_7$$5, PH_SEPARATE, "phalcon/mvc/model/query.zep", 416); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&whenExpr); zephir_create_array(return_value, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(return_value, SS("type"), SL("case"), 1); - zephir_array_fetch_string(&_13, expr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 422 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_12, this_ptr, "_getexpression", &_7, 355, _13); + add_assoc_stringl_ex(return_value, SL("type"), SL("case")); + zephir_array_fetch_string(&_11, &expr, SL("left"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 422 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_10, this_ptr, "_getexpression", &_5, 313, &_11); zephir_check_call_status(); - zephir_array_update_string(&return_value, SL("expr"), &_12, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("when-clauses"), &whenClauses, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("expr"), &_10, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("when-clauses"), &whenClauses, PH_COPY | PH_SEPARATE); RETURN_MM(); } @@ -586,71 +664,81 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getCaseExpression) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getFunctionCall) { - HashTable *_1$$6; - HashPosition _0$$6; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, distinct = 0; - zval *expr_param = NULL, *arguments = NULL, *argument = NULL, *functionArgs = NULL, *_9, **_2$$6, *_3$$7 = NULL, *_5$$8 = NULL, *_6$$9, *_7$$9, *_8$$10; - zval *expr = NULL; + zval *expr_param = NULL, arguments, argument, functionArgs, _7, *_0$$6, _1$$7, _3$$8, _4$$9, _5$$9, _6$$10; + zval expr; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&argument); + ZVAL_UNDEF(&functionArgs); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_1$$7); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_6$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &expr_param); - expr = expr_param; + ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param); - ZEPHIR_OBS_VAR(arguments); - if (zephir_array_isset_string_fetch(&arguments, expr, SS("arguments"), 0 TSRMLS_CC)) { - if (zephir_array_isset_string(expr, SS("distinct"))) { + ZEPHIR_OBS_VAR(&arguments); + if (zephir_array_isset_string_fetch(&arguments, &expr, SL("arguments"), 0)) { + if (zephir_array_isset_string(&expr, SL("distinct"))) { distinct = 1; } else { distinct = 0; } - ZEPHIR_INIT_VAR(functionArgs); - if (zephir_array_isset_long(arguments, 0)) { - array_init(functionArgs); - zephir_is_iterable(arguments, &_1$$6, &_0$$6, 0, 0, "phalcon/mvc/model/query.zep", 448); - for ( - ; zend_hash_get_current_data_ex(_1$$6, (void**) &_2$$6, &_0$$6) == SUCCESS - ; zend_hash_move_forward_ex(_1$$6, &_0$$6) - ) { - ZEPHIR_GET_HVALUE(argument, _2$$6); - ZEPHIR_CALL_METHOD(&_3$$7, this_ptr, "_getcallargument", &_4, 356, argument); + ZEPHIR_INIT_VAR(&functionArgs); + if (zephir_array_isset_long(&arguments, 0)) { + array_init(&functionArgs); + zephir_is_iterable(&arguments, 0, "phalcon/mvc/model/query.zep", 448); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&arguments), _0$$6) + { + ZEPHIR_INIT_NVAR(&argument); + ZVAL_COPY(&argument, _0$$6); + ZEPHIR_CALL_METHOD(&_1$$7, this_ptr, "_getcallargument", &_2, 314, &argument); zephir_check_call_status(); - zephir_array_append(&functionArgs, _3$$7, PH_SEPARATE, "phalcon/mvc/model/query.zep", 446); - } + zephir_array_append(&functionArgs, &_1$$7, PH_SEPARATE, "phalcon/mvc/model/query.zep", 446); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&argument); } else { - zephir_create_array(functionArgs, 1, 0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_5$$8, this_ptr, "_getcallargument", &_4, 356, arguments); + zephir_create_array(&functionArgs, 1, 0 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_3$$8, this_ptr, "_getcallargument", &_2, 314, &arguments); zephir_check_call_status(); - zephir_array_fast_append(functionArgs, _5$$8); + zephir_array_fast_append(&functionArgs, &_3$$8); } if (distinct) { zephir_create_array(return_value, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(return_value, SS("type"), SL("functionCall"), 1); - ZEPHIR_OBS_VAR(_6$$9); - zephir_array_fetch_string(&_6$$9, expr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 456 TSRMLS_CC); - zephir_array_update_string(&return_value, SL("name"), &_6$$9, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("arguments"), &functionArgs, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_7$$9); - ZVAL_LONG(_7$$9, distinct); - zephir_array_update_string(&return_value, SL("distinct"), &_7$$9, PH_COPY | PH_SEPARATE); + add_assoc_stringl_ex(return_value, SL("type"), SL("functionCall")); + ZEPHIR_OBS_VAR(&_4$$9); + zephir_array_fetch_string(&_4$$9, &expr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 456 TSRMLS_CC); + zephir_array_update_string(return_value, SL("name"), &_4$$9, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("arguments"), &functionArgs, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_5$$9); + ZVAL_LONG(&_5$$9, distinct); + zephir_array_update_string(return_value, SL("distinct"), &_5$$9, PH_COPY | PH_SEPARATE); RETURN_MM(); } else { zephir_create_array(return_value, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(return_value, SS("type"), SL("functionCall"), 1); - ZEPHIR_OBS_VAR(_8$$10); - zephir_array_fetch_string(&_8$$10, expr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 463 TSRMLS_CC); - zephir_array_update_string(&return_value, SL("name"), &_8$$10, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("arguments"), &functionArgs, PH_COPY | PH_SEPARATE); + add_assoc_stringl_ex(return_value, SL("type"), SL("functionCall")); + ZEPHIR_OBS_VAR(&_6$$10); + zephir_array_fetch_string(&_6$$10, &expr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 463 TSRMLS_CC); + zephir_array_update_string(return_value, SL("name"), &_6$$10, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("arguments"), &functionArgs, PH_COPY | PH_SEPARATE); RETURN_MM(); } } zephir_create_array(return_value, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(return_value, SS("type"), SL("functionCall"), 1); - ZEPHIR_OBS_VAR(_9); - zephir_array_fetch_string(&_9, expr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 472 TSRMLS_CC); - zephir_array_update_string(&return_value, SL("name"), &_9, PH_COPY | PH_SEPARATE); + add_assoc_stringl_ex(return_value, SL("type"), SL("functionCall")); + ZEPHIR_OBS_VAR(&_7); + zephir_array_fetch_string(&_7, &expr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 472 TSRMLS_CC); + zephir_array_update_string(return_value, SL("name"), &_7, PH_COPY | PH_SEPARATE); RETURN_MM(); } @@ -664,11 +752,65 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getFunctionCall) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getExpression) { - HashTable *_38$$71; - HashPosition _37$$71; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool quoting, tempNotQuoting = 0; - zval *expr, *quoting_param = NULL, *exprType = NULL, *exprLeft = NULL, *exprRight = NULL, *left = NULL, *right = NULL, *listItems = NULL, *exprListItem = NULL, *exprReturn = NULL, *value = NULL, *escapedValue = NULL, *exprValue = NULL, *valueParts = NULL, *name = NULL, *bindType = NULL, *bind = NULL, *_0$$5, *_1$$6, *_2$$25, *_3$$33, *_4$$33, _5$$33, _6$$33, *_7$$34, *_8$$34, *_9$$37, *_10$$37, *_11$$38, *_12$$38, *_13$$39, *_14$$39, *_15$$40, *_16$$40, *_17$$41, *_18$$41, *_19$$42, *_20$$42, *_21$$43, *_28$$43, *_22$$44, *_23$$44, *_24$$45, *_25$$45, *_26$$46, *_27$$46, *_29$$47, *_30$$47, *_31$$48, *_32$$65, *_33$$68 = NULL, *_34$$68, *_35$$69, *_36$$69, **_39$$71, *_40$$72 = NULL; + zval *expr, expr_sub, *quoting_param = NULL, exprType, exprLeft, exprRight, left, right, listItems, exprListItem, exprReturn, value, escapedValue, exprValue, valueParts, name, bindType, bind, _0$$5, _1$$6, _2$$25, _3$$33, _4$$33, _5$$33, _6$$33, _7$$34, _8$$34, _9$$37, _10$$37, _11$$38, _12$$38, _13$$39, _14$$39, _15$$40, _16$$40, _17$$41, _18$$41, _19$$42, _20$$42, _21$$43, _28$$43, _22$$44, _23$$44, _24$$45, _25$$45, _26$$46, _27$$46, _29$$47, _30$$47, _31$$48, _32$$65, _33$$68, _34$$68, _35$$69, _36$$69, *_37$$71, _38$$72; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr_sub); + ZVAL_UNDEF(&exprType); + ZVAL_UNDEF(&exprLeft); + ZVAL_UNDEF(&exprRight); + ZVAL_UNDEF(&left); + ZVAL_UNDEF(&right); + ZVAL_UNDEF(&listItems); + ZVAL_UNDEF(&exprListItem); + ZVAL_UNDEF(&exprReturn); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&escapedValue); + ZVAL_UNDEF(&exprValue); + ZVAL_UNDEF(&valueParts); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&bindType); + ZVAL_UNDEF(&bind); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$6); + ZVAL_UNDEF(&_2$$25); + ZVAL_UNDEF(&_3$$33); + ZVAL_UNDEF(&_4$$33); + ZVAL_UNDEF(&_5$$33); + ZVAL_UNDEF(&_6$$33); + ZVAL_UNDEF(&_7$$34); + ZVAL_UNDEF(&_8$$34); + ZVAL_UNDEF(&_9$$37); + ZVAL_UNDEF(&_10$$37); + ZVAL_UNDEF(&_11$$38); + ZVAL_UNDEF(&_12$$38); + ZVAL_UNDEF(&_13$$39); + ZVAL_UNDEF(&_14$$39); + ZVAL_UNDEF(&_15$$40); + ZVAL_UNDEF(&_16$$40); + ZVAL_UNDEF(&_17$$41); + ZVAL_UNDEF(&_18$$41); + ZVAL_UNDEF(&_19$$42); + ZVAL_UNDEF(&_20$$42); + ZVAL_UNDEF(&_21$$43); + ZVAL_UNDEF(&_28$$43); + ZVAL_UNDEF(&_22$$44); + ZVAL_UNDEF(&_23$$44); + ZVAL_UNDEF(&_24$$45); + ZVAL_UNDEF(&_25$$45); + ZVAL_UNDEF(&_26$$46); + ZVAL_UNDEF(&_27$$46); + ZVAL_UNDEF(&_29$$47); + ZVAL_UNDEF(&_30$$47); + ZVAL_UNDEF(&_31$$48); + ZVAL_UNDEF(&_32$$65); + ZVAL_UNDEF(&_33$$68); + ZVAL_UNDEF(&_34$$68); + ZVAL_UNDEF(&_35$$69); + ZVAL_UNDEF(&_36$$69); + ZVAL_UNDEF(&_38$$72); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &expr, "ing_param); @@ -680,610 +822,607 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getExpression) { } - ZEPHIR_INIT_VAR(left); - ZVAL_NULL(left); - ZEPHIR_INIT_VAR(right); - ZVAL_NULL(right); - ZEPHIR_OBS_VAR(exprType); - if (zephir_array_isset_string_fetch(&exprType, expr, SS("type"), 0 TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&left); + ZVAL_NULL(&left); + ZEPHIR_INIT_VAR(&right); + ZVAL_NULL(&right); + ZEPHIR_OBS_VAR(&exprType); + if (zephir_array_isset_string_fetch(&exprType, expr, SL("type"), 0)) { tempNotQuoting = 1; - if (!ZEPHIR_IS_LONG(exprType, 409)) { - ZEPHIR_OBS_VAR(exprLeft); - if (zephir_array_isset_string_fetch(&exprLeft, expr, SS("left"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_0$$5); + if (!ZEPHIR_IS_LONG(&exprType, 409)) { + ZEPHIR_OBS_VAR(&exprLeft); + if (zephir_array_isset_string_fetch(&exprLeft, expr, SL("left"), 0)) { if (tempNotQuoting) { - ZVAL_BOOL(_0$$5, 1); + ZVAL_BOOL(&_0$$5, 1); } else { - ZVAL_BOOL(_0$$5, 0); + ZVAL_BOOL(&_0$$5, 0); } - ZEPHIR_CALL_METHOD(&left, this_ptr, "_getexpression", NULL, 355, exprLeft, _0$$5); + ZEPHIR_CALL_METHOD(&left, this_ptr, "_getexpression", NULL, 313, &exprLeft, &_0$$5); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(exprRight); - if (zephir_array_isset_string_fetch(&exprRight, expr, SS("right"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_1$$6); + ZEPHIR_OBS_VAR(&exprRight); + if (zephir_array_isset_string_fetch(&exprRight, expr, SL("right"), 0)) { if (tempNotQuoting) { - ZVAL_BOOL(_1$$6, 1); + ZVAL_BOOL(&_1$$6, 1); } else { - ZVAL_BOOL(_1$$6, 0); + ZVAL_BOOL(&_1$$6, 0); } - ZEPHIR_CALL_METHOD(&right, this_ptr, "_getexpression", NULL, 355, exprRight, _1$$6); + ZEPHIR_CALL_METHOD(&right, this_ptr, "_getexpression", NULL, 313, &exprRight, &_1$$6); zephir_check_call_status(); } } do { - if (ZEPHIR_IS_LONG(exprType, '<')) { - ZEPHIR_INIT_VAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("<"), 1); + if (ZEPHIR_IS_LONG(&exprType, '<')) { + ZEPHIR_INIT_VAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("<")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, '=')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("="), 1); + if (ZEPHIR_IS_LONG(&exprType, '=')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("=")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, '>')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL(">"), 1); + if (ZEPHIR_IS_LONG(&exprType, '>')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL(">")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 270)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("<>"), 1); + if (ZEPHIR_IS_LONG(&exprType, 270)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("<>")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 271)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("<="), 1); + if (ZEPHIR_IS_LONG(&exprType, 271)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("<=")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 272)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL(">="), 1); + if (ZEPHIR_IS_LONG(&exprType, 272)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL(">=")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 266)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("AND"), 1); + if (ZEPHIR_IS_LONG(&exprType, 266)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("AND")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 267)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("OR"), 1); + if (ZEPHIR_IS_LONG(&exprType, 267)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("OR")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 355)) { - ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "_getqualified", NULL, 357, expr); + if (ZEPHIR_IS_LONG(&exprType, 355)) { + ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "_getqualified", NULL, 315, expr); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(exprType, '+')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("+"), 1); + if (ZEPHIR_IS_LONG(&exprType, '+')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("+")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, '-')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("-"), 1); + if (ZEPHIR_IS_LONG(&exprType, '-')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("-")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, '*')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("*"), 1); + if (ZEPHIR_IS_LONG(&exprType, '*')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("*")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, '/')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("/"), 1); + if (ZEPHIR_IS_LONG(&exprType, '/')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("/")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, '%')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("%"), 1); + if (ZEPHIR_IS_LONG(&exprType, '%')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("%")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, '&')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("&"), 1); + if (ZEPHIR_IS_LONG(&exprType, '&')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("&")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, '|')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("|"), 1); + if (ZEPHIR_IS_LONG(&exprType, '|')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("|")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 356) || ZEPHIR_IS_LONG(exprType, 407)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("parentheses"), 1); + if (ZEPHIR_IS_LONG(&exprType, 356) || ZEPHIR_IS_LONG(&exprType, 407)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("parentheses")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 367)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("unary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("-"), 1); + if (ZEPHIR_IS_LONG(&exprType, 367)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("unary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("-")); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 258) || ZEPHIR_IS_LONG(exprType, 259) || ZEPHIR_IS_LONG(exprType, 414)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("literal"), 1); - ZEPHIR_OBS_VAR(_2$$25); + if (ZEPHIR_IS_LONG(&exprType, 258) || ZEPHIR_IS_LONG(&exprType, 259) || ZEPHIR_IS_LONG(&exprType, 414)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("literal")); + ZEPHIR_OBS_VAR(&_2$$25); zephir_array_fetch_string(&_2$$25, expr, SL("value"), PH_NOISY, "phalcon/mvc/model/query.zep", 590 TSRMLS_CC); zephir_array_update_string(&exprReturn, SL("value"), &_2$$25, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 333)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("literal"), 1); - add_assoc_stringl_ex(exprReturn, SS("value"), SL("TRUE"), 1); + if (ZEPHIR_IS_LONG(&exprType, 333)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("literal")); + add_assoc_stringl_ex(&exprReturn, SL("value"), SL("TRUE")); break; } - if (ZEPHIR_IS_LONG(exprType, 334)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("literal"), 1); - add_assoc_stringl_ex(exprReturn, SS("value"), SL("FALSE"), 1); + if (ZEPHIR_IS_LONG(&exprType, 334)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("literal")); + add_assoc_stringl_ex(&exprReturn, SL("value"), SL("FALSE")); break; } - if (ZEPHIR_IS_LONG(exprType, 260)) { - ZEPHIR_OBS_VAR(value); + if (ZEPHIR_IS_LONG(&exprType, 260)) { + ZEPHIR_OBS_VAR(&value); zephir_array_fetch_string(&value, expr, SL("value"), PH_NOISY, "phalcon/mvc/model/query.zep", 602 TSRMLS_CC); if (quoting == 1) { - if (zephir_memnstr_str(value, SL("'"), "phalcon/mvc/model/query.zep", 607)) { - ZEPHIR_INIT_VAR(escapedValue); - phalcon_orm_singlequotes(escapedValue, value TSRMLS_CC); + if (zephir_memnstr_str(&value, SL("'"), "phalcon/mvc/model/query.zep", 607)) { + ZEPHIR_INIT_VAR(&escapedValue); + phalcon_orm_singlequotes(&escapedValue, &value TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(escapedValue, value); + ZEPHIR_CPY_WRT(&escapedValue, &value); } - ZEPHIR_INIT_VAR(exprValue); - ZEPHIR_CONCAT_SVS(exprValue, "'", escapedValue, "'"); + ZEPHIR_INIT_VAR(&exprValue); + ZEPHIR_CONCAT_SVS(&exprValue, "'", &escapedValue, "'"); } else { - ZEPHIR_CPY_WRT(exprValue, value); + ZEPHIR_CPY_WRT(&exprValue, &value); } - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("literal"), 1); + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("literal")); zephir_array_update_string(&exprReturn, SL("value"), &exprValue, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 273)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); - ZEPHIR_INIT_VAR(_3$$33); + if (ZEPHIR_IS_LONG(&exprType, 273)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); + ZEPHIR_INIT_VAR(&_3$$33); zephir_array_fetch_string(&_4$$33, expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 620 TSRMLS_CC); - ZEPHIR_SINIT_VAR(_5$$33); - ZVAL_STRING(&_5$$33, "?", 0); - ZEPHIR_SINIT_VAR(_6$$33); - ZVAL_STRING(&_6$$33, ":", 0); - zephir_fast_str_replace(&_3$$33, &_5$$33, &_6$$33, _4$$33 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$33); + ZVAL_STRING(&_5$$33, "?"); + ZEPHIR_INIT_VAR(&_6$$33); + ZVAL_STRING(&_6$$33, ":"); + zephir_fast_str_replace(&_3$$33, &_5$$33, &_6$$33, &_4$$33 TSRMLS_CC); zephir_array_update_string(&exprReturn, SL("value"), &_3$$33, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 274)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); + if (ZEPHIR_IS_LONG(&exprType, 274)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); zephir_array_fetch_string(&_7$$34, expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 624 TSRMLS_CC); - ZEPHIR_INIT_VAR(_8$$34); - ZEPHIR_CONCAT_SV(_8$$34, ":", _7$$34); + ZEPHIR_INIT_VAR(&_8$$34); + ZEPHIR_CONCAT_SV(&_8$$34, ":", &_7$$34); zephir_array_update_string(&exprReturn, SL("value"), &_8$$34, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 277)) { - ZEPHIR_OBS_NVAR(value); + if (ZEPHIR_IS_LONG(&exprType, 277)) { + ZEPHIR_OBS_NVAR(&value); zephir_array_fetch_string(&value, expr, SL("value"), PH_NOISY, "phalcon/mvc/model/query.zep", 628 TSRMLS_CC); - if (zephir_memnstr_str(value, SL(":"), "phalcon/mvc/model/query.zep", 629)) { - ZEPHIR_INIT_VAR(valueParts); - zephir_fast_explode_str(valueParts, SL(":"), value, LONG_MAX TSRMLS_CC); - ZEPHIR_OBS_VAR(name); - zephir_array_fetch_long(&name, valueParts, 0, PH_NOISY, "phalcon/mvc/model/query.zep", 632 TSRMLS_CC); - ZEPHIR_OBS_VAR(bindType); - zephir_array_fetch_long(&bindType, valueParts, 1, PH_NOISY, "phalcon/mvc/model/query.zep", 633 TSRMLS_CC); + if (zephir_memnstr_str(&value, SL(":"), "phalcon/mvc/model/query.zep", 629)) { + ZEPHIR_INIT_VAR(&valueParts); + zephir_fast_explode_str(&valueParts, SL(":"), &value, LONG_MAX TSRMLS_CC); + ZEPHIR_OBS_VAR(&name); + zephir_array_fetch_long(&name, &valueParts, 0, PH_NOISY, "phalcon/mvc/model/query.zep", 632 TSRMLS_CC); + ZEPHIR_OBS_VAR(&bindType); + zephir_array_fetch_long(&bindType, &valueParts, 1, PH_NOISY, "phalcon/mvc/model/query.zep", 633 TSRMLS_CC); do { - if (ZEPHIR_IS_STRING(bindType, "str")) { - ZEPHIR_INIT_VAR(_9$$37); - ZVAL_LONG(_9$$37, 2); - zephir_update_property_array(this_ptr, SL("_bindTypes"), name, _9$$37 TSRMLS_CC); - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); - ZEPHIR_INIT_VAR(_10$$37); - ZEPHIR_CONCAT_SV(_10$$37, ":", name); + if (ZEPHIR_IS_STRING(&bindType, "str")) { + ZEPHIR_INIT_VAR(&_9$$37); + ZVAL_LONG(&_9$$37, 2); + zephir_update_property_array(this_ptr, SL("_bindTypes"), &name, &_9$$37 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); + ZEPHIR_INIT_VAR(&_10$$37); + ZEPHIR_CONCAT_SV(&_10$$37, ":", &name); zephir_array_update_string(&exprReturn, SL("value"), &_10$$37, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(bindType, "int")) { - ZEPHIR_INIT_VAR(_11$$38); - ZVAL_LONG(_11$$38, 1); - zephir_update_property_array(this_ptr, SL("_bindTypes"), name, _11$$38 TSRMLS_CC); - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); - ZEPHIR_INIT_VAR(_12$$38); - ZEPHIR_CONCAT_SV(_12$$38, ":", name); + if (ZEPHIR_IS_STRING(&bindType, "int")) { + ZEPHIR_INIT_VAR(&_11$$38); + ZVAL_LONG(&_11$$38, 1); + zephir_update_property_array(this_ptr, SL("_bindTypes"), &name, &_11$$38 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); + ZEPHIR_INIT_VAR(&_12$$38); + ZEPHIR_CONCAT_SV(&_12$$38, ":", &name); zephir_array_update_string(&exprReturn, SL("value"), &_12$$38, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(bindType, "double")) { - ZEPHIR_INIT_VAR(_13$$39); - ZVAL_LONG(_13$$39, 32); - zephir_update_property_array(this_ptr, SL("_bindTypes"), name, _13$$39 TSRMLS_CC); - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); - ZEPHIR_INIT_VAR(_14$$39); - ZEPHIR_CONCAT_SV(_14$$39, ":", name); + if (ZEPHIR_IS_STRING(&bindType, "double")) { + ZEPHIR_INIT_VAR(&_13$$39); + ZVAL_LONG(&_13$$39, 32); + zephir_update_property_array(this_ptr, SL("_bindTypes"), &name, &_13$$39 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); + ZEPHIR_INIT_VAR(&_14$$39); + ZEPHIR_CONCAT_SV(&_14$$39, ":", &name); zephir_array_update_string(&exprReturn, SL("value"), &_14$$39, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(bindType, "bool")) { - ZEPHIR_INIT_VAR(_15$$40); - ZVAL_LONG(_15$$40, 5); - zephir_update_property_array(this_ptr, SL("_bindTypes"), name, _15$$40 TSRMLS_CC); - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); - ZEPHIR_INIT_VAR(_16$$40); - ZEPHIR_CONCAT_SV(_16$$40, ":", name); + if (ZEPHIR_IS_STRING(&bindType, "bool")) { + ZEPHIR_INIT_VAR(&_15$$40); + ZVAL_LONG(&_15$$40, 5); + zephir_update_property_array(this_ptr, SL("_bindTypes"), &name, &_15$$40 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); + ZEPHIR_INIT_VAR(&_16$$40); + ZEPHIR_CONCAT_SV(&_16$$40, ":", &name); zephir_array_update_string(&exprReturn, SL("value"), &_16$$40, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(bindType, "blob")) { - ZEPHIR_INIT_VAR(_17$$41); - ZVAL_LONG(_17$$41, 3); - zephir_update_property_array(this_ptr, SL("_bindTypes"), name, _17$$41 TSRMLS_CC); - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); - ZEPHIR_INIT_VAR(_18$$41); - ZEPHIR_CONCAT_SV(_18$$41, ":", name); + if (ZEPHIR_IS_STRING(&bindType, "blob")) { + ZEPHIR_INIT_VAR(&_17$$41); + ZVAL_LONG(&_17$$41, 3); + zephir_update_property_array(this_ptr, SL("_bindTypes"), &name, &_17$$41 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); + ZEPHIR_INIT_VAR(&_18$$41); + ZEPHIR_CONCAT_SV(&_18$$41, ":", &name); zephir_array_update_string(&exprReturn, SL("value"), &_18$$41, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(bindType, "null")) { - ZEPHIR_INIT_VAR(_19$$42); - ZVAL_LONG(_19$$42, 0); - zephir_update_property_array(this_ptr, SL("_bindTypes"), name, _19$$42 TSRMLS_CC); - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); - ZEPHIR_INIT_VAR(_20$$42); - ZEPHIR_CONCAT_SV(_20$$42, ":", name); + if (ZEPHIR_IS_STRING(&bindType, "null")) { + ZEPHIR_INIT_VAR(&_19$$42); + ZVAL_LONG(&_19$$42, 0); + zephir_update_property_array(this_ptr, SL("_bindTypes"), &name, &_19$$42 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); + ZEPHIR_INIT_VAR(&_20$$42); + ZEPHIR_CONCAT_SV(&_20$$42, ":", &name); zephir_array_update_string(&exprReturn, SL("value"), &_20$$42, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_STRING(bindType, "array") || ZEPHIR_IS_STRING(bindType, "array-str") || ZEPHIR_IS_STRING(bindType, "array-int")) { - ZEPHIR_OBS_VAR(bind); - _21$$43 = zephir_fetch_nproperty_this(this_ptr, SL("_bindParams"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&bind, _21$$43, name, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_22$$44); - object_init_ex(_22$$44, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_23$$44); - ZEPHIR_CONCAT_SV(_23$$44, "Bind value is required for array type placeholder: ", name); - ZEPHIR_CALL_METHOD(NULL, _22$$44, "__construct", NULL, 9, _23$$44); + if (ZEPHIR_IS_STRING(&bindType, "array") || ZEPHIR_IS_STRING(&bindType, "array-str") || ZEPHIR_IS_STRING(&bindType, "array-int")) { + ZEPHIR_OBS_VAR(&bind); + zephir_read_property(&_21$$43, this_ptr, SL("_bindParams"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&bind, &_21$$43, &name, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_22$$44); + object_init_ex(&_22$$44, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_23$$44); + ZEPHIR_CONCAT_SV(&_23$$44, "Bind value is required for array type placeholder: ", &name); + ZEPHIR_CALL_METHOD(NULL, &_22$$44, "__construct", NULL, 4, &_23$$44); zephir_check_call_status(); - zephir_throw_exception_debug(_22$$44, "phalcon/mvc/model/query.zep", 672 TSRMLS_CC); + zephir_throw_exception_debug(&_22$$44, "phalcon/mvc/model/query.zep", 672 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (Z_TYPE_P(bind) != IS_ARRAY) { - ZEPHIR_INIT_VAR(_24$$45); - object_init_ex(_24$$45, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_25$$45); - ZEPHIR_CONCAT_SV(_25$$45, "Bind type requires an array in placeholder: ", name); - ZEPHIR_CALL_METHOD(NULL, _24$$45, "__construct", NULL, 9, _25$$45); + if (Z_TYPE_P(&bind) != IS_ARRAY) { + ZEPHIR_INIT_VAR(&_24$$45); + object_init_ex(&_24$$45, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_25$$45); + ZEPHIR_CONCAT_SV(&_25$$45, "Bind type requires an array in placeholder: ", &name); + ZEPHIR_CALL_METHOD(NULL, &_24$$45, "__construct", NULL, 4, &_25$$45); zephir_check_call_status(); - zephir_throw_exception_debug(_24$$45, "phalcon/mvc/model/query.zep", 676 TSRMLS_CC); + zephir_throw_exception_debug(&_24$$45, "phalcon/mvc/model/query.zep", 676 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_fast_count_int(bind TSRMLS_CC) < 1) { - ZEPHIR_INIT_VAR(_26$$46); - object_init_ex(_26$$46, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_27$$46); - ZEPHIR_CONCAT_SV(_27$$46, "At least one value must be bound in placeholder: ", name); - ZEPHIR_CALL_METHOD(NULL, _26$$46, "__construct", NULL, 9, _27$$46); + if (zephir_fast_count_int(&bind TSRMLS_CC) < 1) { + ZEPHIR_INIT_VAR(&_26$$46); + object_init_ex(&_26$$46, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_27$$46); + ZEPHIR_CONCAT_SV(&_27$$46, "At least one value must be bound in placeholder: ", &name); + ZEPHIR_CALL_METHOD(NULL, &_26$$46, "__construct", NULL, 4, &_27$$46); zephir_check_call_status(); - zephir_throw_exception_debug(_26$$46, "phalcon/mvc/model/query.zep", 680 TSRMLS_CC); + zephir_throw_exception_debug(&_26$$46, "phalcon/mvc/model/query.zep", 680 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); - ZEPHIR_INIT_VAR(_28$$43); - ZEPHIR_CONCAT_SV(_28$$43, ":", name); + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); + ZEPHIR_INIT_VAR(&_28$$43); + ZEPHIR_CONCAT_SV(&_28$$43, ":", &name); zephir_array_update_string(&exprReturn, SL("value"), &_28$$43, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("rawValue"), &name, PH_COPY | PH_SEPARATE); - add_assoc_long_ex(exprReturn, SS("times"), zephir_fast_count_int(bind TSRMLS_CC)); + add_assoc_long_ex(&exprReturn, SL("times"), zephir_fast_count_int(&bind TSRMLS_CC)); break; } - ZEPHIR_INIT_VAR(_29$$47); - object_init_ex(_29$$47, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_30$$47); - ZEPHIR_CONCAT_SV(_30$$47, "Unknown bind type: ", bindType); - ZEPHIR_CALL_METHOD(NULL, _29$$47, "__construct", NULL, 9, _30$$47); + ZEPHIR_INIT_VAR(&_29$$47); + object_init_ex(&_29$$47, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_30$$47); + ZEPHIR_CONCAT_SV(&_30$$47, "Unknown bind type: ", &bindType); + ZEPHIR_CALL_METHOD(NULL, &_29$$47, "__construct", NULL, 4, &_30$$47); zephir_check_call_status(); - zephir_throw_exception_debug(_29$$47, "phalcon/mvc/model/query.zep", 692 TSRMLS_CC); + zephir_throw_exception_debug(&_29$$47, "phalcon/mvc/model/query.zep", 692 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); } else { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("placeholder"), 1); - ZEPHIR_INIT_VAR(_31$$48); - ZEPHIR_CONCAT_SV(_31$$48, ":", value); + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("placeholder")); + ZEPHIR_INIT_VAR(&_31$$48); + ZEPHIR_CONCAT_SV(&_31$$48, ":", &value); zephir_array_update_string(&exprReturn, SL("value"), &_31$$48, PH_COPY | PH_SEPARATE); } break; } - if (ZEPHIR_IS_LONG(exprType, 322)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("literal"), 1); - add_assoc_stringl_ex(exprReturn, SS("value"), SL("NULL"), 1); + if (ZEPHIR_IS_LONG(&exprType, 322)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("literal")); + add_assoc_stringl_ex(&exprReturn, SL("value"), SL("NULL")); break; } - if (ZEPHIR_IS_LONG(exprType, 268)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("LIKE"), 1); + if (ZEPHIR_IS_LONG(&exprType, 268)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("LIKE")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 351)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("NOT LIKE"), 1); + if (ZEPHIR_IS_LONG(&exprType, 351)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("NOT LIKE")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 275)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("ILIKE"), 1); + if (ZEPHIR_IS_LONG(&exprType, 275)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("ILIKE")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 357)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("NOT ILIKE"), 1); + if (ZEPHIR_IS_LONG(&exprType, 357)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("NOT ILIKE")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, '!')) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("unary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("NOT "), 1); + if (ZEPHIR_IS_LONG(&exprType, '!')) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("unary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("NOT ")); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 365)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("unary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL(" IS NULL"), 1); + if (ZEPHIR_IS_LONG(&exprType, 365)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("unary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL(" IS NULL")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 366)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("unary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL(" IS NOT NULL"), 1); + if (ZEPHIR_IS_LONG(&exprType, 366)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("unary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL(" IS NOT NULL")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 315)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("IN"), 1); + if (ZEPHIR_IS_LONG(&exprType, 315)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("IN")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 323)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("NOT IN"), 1); + if (ZEPHIR_IS_LONG(&exprType, 323)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("NOT IN")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 408)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("unary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("EXISTS"), 1); + if (ZEPHIR_IS_LONG(&exprType, 408)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("unary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("EXISTS")); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 330)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("unary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("DISTINCT "), 1); + if (ZEPHIR_IS_LONG(&exprType, 330)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("unary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("DISTINCT ")); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 331)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("BETWEEN"), 1); + if (ZEPHIR_IS_LONG(&exprType, 331)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("BETWEEN")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 276)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(exprReturn, SS("op"), SL("AGAINST"), 1); + if (ZEPHIR_IS_LONG(&exprType, 276)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&exprReturn, SL("op"), SL("AGAINST")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 332)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("cast"), 1); + if (ZEPHIR_IS_LONG(&exprType, 332)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("cast")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 335)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("convert"), 1); + if (ZEPHIR_IS_LONG(&exprType, 335)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("convert")); zephir_array_update_string(&exprReturn, SL("left"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&exprReturn, SL("right"), &right, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 358)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("literal"), 1); - ZEPHIR_OBS_VAR(_32$$65); + if (ZEPHIR_IS_LONG(&exprType, 358)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("literal")); + ZEPHIR_OBS_VAR(&_32$$65); zephir_array_fetch_string(&_32$$65, expr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 765 TSRMLS_CC); zephir_array_update_string(&exprReturn, SL("value"), &_32$$65, PH_COPY | PH_SEPARATE); break; } - if (ZEPHIR_IS_LONG(exprType, 350)) { - ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "_getfunctioncall", NULL, 358, expr); + if (ZEPHIR_IS_LONG(&exprType, 350)) { + ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "_getfunctioncall", NULL, 316, expr); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(exprType, 409)) { - ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "_getcaseexpression", NULL, 359, expr); + if (ZEPHIR_IS_LONG(&exprType, 409)) { + ZEPHIR_CALL_METHOD(&exprReturn, this_ptr, "_getcaseexpression", NULL, 317, expr); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(exprType, 309)) { - ZEPHIR_INIT_NVAR(exprReturn); - zephir_create_array(exprReturn, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(exprReturn, SS("type"), SL("select"), 1); - ZEPHIR_INIT_VAR(_34$$68); - ZVAL_BOOL(_34$$68, 1); - ZEPHIR_CALL_METHOD(&_33$$68, this_ptr, "_prepareselect", NULL, 360, expr, _34$$68); + if (ZEPHIR_IS_LONG(&exprType, 309)) { + ZEPHIR_INIT_NVAR(&exprReturn); + zephir_create_array(&exprReturn, 2, 0 TSRMLS_CC); + add_assoc_stringl_ex(&exprReturn, SL("type"), SL("select")); + ZVAL_BOOL(&_34$$68, 1); + ZEPHIR_CALL_METHOD(&_33$$68, this_ptr, "_prepareselect", NULL, 318, expr, &_34$$68); zephir_check_call_status(); zephir_array_update_string(&exprReturn, SL("value"), &_33$$68, PH_COPY | PH_SEPARATE); break; } - ZEPHIR_INIT_VAR(_35$$69); - object_init_ex(_35$$69, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_36$$69); - ZEPHIR_CONCAT_SV(_36$$69, "Unknown expression type ", exprType); - ZEPHIR_CALL_METHOD(NULL, _35$$69, "__construct", NULL, 9, _36$$69); + ZEPHIR_INIT_VAR(&_35$$69); + object_init_ex(&_35$$69, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_36$$69); + ZEPHIR_CONCAT_SV(&_36$$69, "Unknown expression type ", &exprType); + ZEPHIR_CALL_METHOD(NULL, &_35$$69, "__construct", NULL, 4, &_36$$69); zephir_check_call_status(); - zephir_throw_exception_debug(_35$$69, "phalcon/mvc/model/query.zep", 781 TSRMLS_CC); + zephir_throw_exception_debug(&_35$$69, "phalcon/mvc/model/query.zep", 781 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); - RETURN_CCTOR(exprReturn); + RETURN_CCTOR(&exprReturn); } - if (zephir_array_isset_string(expr, SS("domain"))) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getqualified", NULL, 357, expr); + if (zephir_array_isset_string(expr, SL("domain"))) { + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_getqualified", NULL, 315, expr); zephir_check_call_status(); RETURN_MM(); } if (zephir_array_isset_long(expr, 0)) { - ZEPHIR_INIT_VAR(listItems); - array_init(listItems); - zephir_is_iterable(expr, &_38$$71, &_37$$71, 0, 0, "phalcon/mvc/model/query.zep", 802); - for ( - ; zend_hash_get_current_data_ex(_38$$71, (void**) &_39$$71, &_37$$71) == SUCCESS - ; zend_hash_move_forward_ex(_38$$71, &_37$$71) - ) { - ZEPHIR_GET_HVALUE(exprListItem, _39$$71); - ZEPHIR_CALL_METHOD(&_40$$72, this_ptr, "_getexpression", NULL, 355, exprListItem); + ZEPHIR_INIT_VAR(&listItems); + array_init(&listItems); + zephir_is_iterable(expr, 0, "phalcon/mvc/model/query.zep", 802); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(expr), _37$$71) + { + ZEPHIR_INIT_NVAR(&exprListItem); + ZVAL_COPY(&exprListItem, _37$$71); + ZEPHIR_CALL_METHOD(&_38$$72, this_ptr, "_getexpression", NULL, 313, &exprListItem); zephir_check_call_status(); - zephir_array_append(&listItems, _40$$72, PH_SEPARATE, "phalcon/mvc/model/query.zep", 800); - } + zephir_array_append(&listItems, &_38$$72, PH_SEPARATE, "phalcon/mvc/model/query.zep", 800); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&exprListItem); zephir_create_array(return_value, 2, 0 TSRMLS_CC); - add_assoc_stringl_ex(return_value, SS("type"), SL("list"), 1); - zephir_array_fast_append(return_value, listItems); + add_assoc_stringl_ex(return_value, SL("type"), SL("list")); + zephir_array_fast_append(return_value, &listItems); RETURN_MM(); } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Unknown expression", "phalcon/mvc/model/query.zep", 805); @@ -1297,134 +1436,167 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getExpression) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getSelectColumn) { - HashTable *_2$$4; - HashPosition _1$$4; + zend_string *_3$$4; + zend_ulong _2$$4; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_5 = NULL; - zval *column_param = NULL, *sqlColumns = NULL, *columnType = NULL, *sqlAliases = NULL, *modelName = NULL, *source = NULL, *columnDomain = NULL, *sqlColumnAlias = NULL, *preparedAlias = NULL, *sqlExprColumn = NULL, *sqlAliasesModels = NULL, *sqlColumn = NULL, *columnData = NULL, *balias = NULL, *eager = NULL, *_12, *_13, *_0$$4, **_3$$4, *_4$$5 = NULL, *_6$$6, *_7$$9, *_8$$9, *_9$$9, *_10$$13, *_11$$16; - zval *column = NULL; + zval *column_param = NULL, sqlColumns, columnType, sqlAliases, modelName, source, columnDomain, sqlColumnAlias, preparedAlias, sqlExprColumn, sqlAliasesModels, sqlColumn, columnData, balias, eager, _12, _13, _0$$4, *_1$$4, _4$$5, _6$$6, _7$$9, _8$$9, _9$$9, _10$$13, _11$$16; + zval column; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&sqlColumns); + ZVAL_UNDEF(&columnType); + ZVAL_UNDEF(&sqlAliases); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&columnDomain); + ZVAL_UNDEF(&sqlColumnAlias); + ZVAL_UNDEF(&preparedAlias); + ZVAL_UNDEF(&sqlExprColumn); + ZVAL_UNDEF(&sqlAliasesModels); + ZVAL_UNDEF(&sqlColumn); + ZVAL_UNDEF(&columnData); + ZVAL_UNDEF(&balias); + ZVAL_UNDEF(&eager); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_10$$13); + ZVAL_UNDEF(&_11$$16); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &column_param); - column = column_param; + ZEPHIR_OBS_COPY_OR_DUP(&column, column_param); - ZEPHIR_OBS_VAR(columnType); - if (!(zephir_array_isset_string_fetch(&columnType, column, SS("type"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&columnType); + if (!(zephir_array_isset_string_fetch(&columnType, &column, SL("type"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/mvc/model/query.zep", 819); return; } - ZEPHIR_INIT_VAR(sqlColumns); - array_init(sqlColumns); - ZEPHIR_OBS_VAR(eager); - zephir_array_isset_string_fetch(&eager, column, SS("eager"), 0 TSRMLS_CC); - if (ZEPHIR_IS_LONG(columnType, 352)) { - _0$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_models"), PH_NOISY_CC); - zephir_is_iterable(_0$$4, &_2$$4, &_1$$4, 0, 0, "phalcon/mvc/model/query.zep", 849); - for ( - ; zend_hash_get_current_data_ex(_2$$4, (void**) &_3$$4, &_1$$4) == SUCCESS - ; zend_hash_move_forward_ex(_2$$4, &_1$$4) - ) { - ZEPHIR_GET_HMKEY(modelName, _2$$4, _1$$4); - ZEPHIR_GET_HVALUE(source, _3$$4); - ZEPHIR_INIT_NVAR(sqlColumn); - zephir_create_array(sqlColumn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(sqlColumn, SS("type"), SL("object"), 1); + ZEPHIR_INIT_VAR(&sqlColumns); + array_init(&sqlColumns); + ZEPHIR_OBS_VAR(&eager); + zephir_array_isset_string_fetch(&eager, &column, SL("eager"), 0); + if (ZEPHIR_IS_LONG(&columnType, 352)) { + zephir_read_property(&_0$$4, this_ptr, SL("_models"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0$$4, 0, "phalcon/mvc/model/query.zep", 849); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0$$4), _2$$4, _3$$4, _1$$4) + { + ZEPHIR_INIT_NVAR(&modelName); + if (_3$$4 != NULL) { + ZVAL_STR_COPY(&modelName, _3$$4); + } else { + ZVAL_LONG(&modelName, _2$$4); + } + ZEPHIR_INIT_NVAR(&source); + ZVAL_COPY(&source, _1$$4); + ZEPHIR_INIT_NVAR(&sqlColumn); + zephir_create_array(&sqlColumn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&sqlColumn, SL("type"), SL("object")); zephir_array_update_string(&sqlColumn, SL("model"), &modelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlColumn, SL("column"), &source, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_4$$5, "lcfirst", &_5, 71, modelName); + ZEPHIR_CALL_FUNCTION(&_4$$5, "lcfirst", &_5, 64, &modelName); zephir_check_call_status(); zephir_array_update_string(&sqlColumn, SL("balias"), &_4$$5, PH_COPY | PH_SEPARATE); - if (Z_TYPE_P(eager) != IS_NULL) { + if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_6$$6, column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 844 TSRMLS_CC); + zephir_array_fetch_string(&_6$$6, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 844 TSRMLS_CC); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_6$$6, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlColumns, sqlColumn, PH_SEPARATE, "phalcon/mvc/model/query.zep", 847); - } - RETURN_CCTOR(sqlColumns); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/mvc/model/query.zep", 847); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&source); + ZEPHIR_INIT_NVAR(&modelName); + RETURN_CCTOR(&sqlColumns); } - if (!(zephir_array_isset_string(column, SS("column")))) { + if (!(zephir_array_isset_string(&column, SL("column")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/mvc/model/query.zep", 853); return; } - if (ZEPHIR_IS_LONG(columnType, 353)) { - ZEPHIR_OBS_VAR(sqlAliases); - zephir_read_property_this(&sqlAliases, this_ptr, SL("_sqlAliases"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(columnDomain); - zephir_array_fetch_string(&columnDomain, column, SL("column"), PH_NOISY, "phalcon/mvc/model/query.zep", 866 TSRMLS_CC); - ZEPHIR_OBS_NVAR(source); - if (!(zephir_array_isset_fetch(&source, sqlAliases, columnDomain, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_7$$9); - object_init_ex(_7$$9, phalcon_mvc_model_exception_ce); - _8$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_9$$9); - ZEPHIR_CONCAT_SVSV(_9$$9, "Unknown model or alias '", columnDomain, "' (2), when preparing: ", _8$$9); - ZEPHIR_CALL_METHOD(NULL, _7$$9, "__construct", NULL, 9, _9$$9); + if (ZEPHIR_IS_LONG(&columnType, 353)) { + ZEPHIR_OBS_VAR(&sqlAliases); + zephir_read_property(&sqlAliases, this_ptr, SL("_sqlAliases"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&columnDomain); + zephir_array_fetch_string(&columnDomain, &column, SL("column"), PH_NOISY, "phalcon/mvc/model/query.zep", 866 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&source); + if (!(zephir_array_isset_fetch(&source, &sqlAliases, &columnDomain, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_7$$9); + object_init_ex(&_7$$9, phalcon_mvc_model_exception_ce); + zephir_read_property(&_8$$9, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_9$$9); + ZEPHIR_CONCAT_SVSV(&_9$$9, "Unknown model or alias '", &columnDomain, "' (2), when preparing: ", &_8$$9); + ZEPHIR_CALL_METHOD(NULL, &_7$$9, "__construct", NULL, 4, &_9$$9); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$9, "phalcon/mvc/model/query.zep", 869 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$9, "phalcon/mvc/model/query.zep", 869 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CPY_WRT(sqlColumnAlias, source); - ZEPHIR_OBS_VAR(preparedAlias); - zephir_array_isset_string_fetch(&preparedAlias, column, SS("balias"), 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(sqlAliasesModels); - zephir_read_property_this(&sqlAliasesModels, this_ptr, SL("_sqlAliasesModels"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(modelName); - zephir_array_fetch(&modelName, sqlAliasesModels, columnDomain, PH_NOISY, "phalcon/mvc/model/query.zep", 883 TSRMLS_CC); - if (Z_TYPE_P(preparedAlias) != IS_STRING) { - if (ZEPHIR_IS_EQUAL(columnDomain, modelName)) { - ZEPHIR_CALL_FUNCTION(&preparedAlias, "lcfirst", &_5, 71, modelName); + ZEPHIR_CPY_WRT(&sqlColumnAlias, &source); + ZEPHIR_OBS_VAR(&preparedAlias); + zephir_array_isset_string_fetch(&preparedAlias, &column, SL("balias"), 0); + ZEPHIR_OBS_VAR(&sqlAliasesModels); + zephir_read_property(&sqlAliasesModels, this_ptr, SL("_sqlAliasesModels"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&modelName); + zephir_array_fetch(&modelName, &sqlAliasesModels, &columnDomain, PH_NOISY, "phalcon/mvc/model/query.zep", 883 TSRMLS_CC); + if (Z_TYPE_P(&preparedAlias) != IS_STRING) { + if (ZEPHIR_IS_EQUAL(&columnDomain, &modelName)) { + ZEPHIR_CALL_FUNCTION(&preparedAlias, "lcfirst", &_5, 64, &modelName); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedAlias, columnDomain); + ZEPHIR_CPY_WRT(&preparedAlias, &columnDomain); } } - ZEPHIR_INIT_NVAR(sqlColumn); - zephir_create_array(sqlColumn, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(sqlColumn, SS("type"), SL("object"), 1); + ZEPHIR_INIT_NVAR(&sqlColumn); + zephir_create_array(&sqlColumn, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&sqlColumn, SL("type"), SL("object")); zephir_array_update_string(&sqlColumn, SL("model"), &modelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlColumn, SL("column"), &sqlColumnAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlColumn, SL("balias"), &preparedAlias, PH_COPY | PH_SEPARATE); - if (Z_TYPE_P(eager) != IS_NULL) { + if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_10$$13, column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 909 TSRMLS_CC); + zephir_array_fetch_string(&_10$$13, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 909 TSRMLS_CC); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_10$$13, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlColumns, sqlColumn, PH_SEPARATE, "phalcon/mvc/model/query.zep", 912); - RETURN_CCTOR(sqlColumns); - } - if (ZEPHIR_IS_LONG(columnType, 354)) { - ZEPHIR_INIT_NVAR(sqlColumn); - zephir_create_array(sqlColumn, 1, 0 TSRMLS_CC); - add_assoc_stringl_ex(sqlColumn, SS("type"), SL("scalar"), 1); - ZEPHIR_OBS_VAR(columnData); - zephir_array_fetch_string(&columnData, column, SL("column"), PH_NOISY, "phalcon/mvc/model/query.zep", 926 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&sqlExprColumn, this_ptr, "_getexpression", NULL, 355, columnData); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/mvc/model/query.zep", 912); + RETURN_CCTOR(&sqlColumns); + } + if (ZEPHIR_IS_LONG(&columnType, 354)) { + ZEPHIR_INIT_NVAR(&sqlColumn); + zephir_create_array(&sqlColumn, 1, 0 TSRMLS_CC); + add_assoc_stringl_ex(&sqlColumn, SL("type"), SL("scalar")); + ZEPHIR_OBS_VAR(&columnData); + zephir_array_fetch_string(&columnData, &column, SL("column"), PH_NOISY, "phalcon/mvc/model/query.zep", 926 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&sqlExprColumn, this_ptr, "_getexpression", NULL, 313, &columnData); zephir_check_call_status(); - ZEPHIR_OBS_VAR(balias); - if (zephir_array_isset_string_fetch(&balias, sqlExprColumn, SS("balias"), 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&balias); + if (zephir_array_isset_string_fetch(&balias, &sqlExprColumn, SL("balias"), 0)) { zephir_array_update_string(&sqlColumn, SL("balias"), &balias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlColumn, SL("sqlAlias"), &balias, PH_COPY | PH_SEPARATE); } - if (Z_TYPE_P(eager) != IS_NULL) { + if (Z_TYPE_P(&eager) != IS_NULL) { zephir_array_update_string(&sqlColumn, SL("eager"), &eager, PH_COPY | PH_SEPARATE); - zephir_array_fetch_string(&_11$$16, column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 939 TSRMLS_CC); + zephir_array_fetch_string(&_11$$16, &column, SL("eagerType"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 939 TSRMLS_CC); zephir_array_update_string(&sqlColumn, SL("eagerType"), &_11$$16, PH_COPY | PH_SEPARATE); } zephir_array_update_string(&sqlColumn, SL("column"), &sqlExprColumn, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlColumns, sqlColumn, PH_SEPARATE, "phalcon/mvc/model/query.zep", 943); - RETURN_CCTOR(sqlColumns); - } - ZEPHIR_INIT_VAR(_12); - object_init_ex(_12, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_13); - ZEPHIR_CONCAT_SV(_13, "Unknown type of column ", columnType); - ZEPHIR_CALL_METHOD(NULL, _12, "__construct", NULL, 9, _13); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/mvc/model/query.zep", 943); + RETURN_CCTOR(&sqlColumns); + } + ZEPHIR_INIT_VAR(&_12); + object_init_ex(&_12, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_13); + ZEPHIR_CONCAT_SV(&_13, "Unknown type of column ", &columnType); + ZEPHIR_CALL_METHOD(NULL, &_12, "__construct", NULL, 4, &_13); zephir_check_call_status(); - zephir_throw_exception_debug(_12, "phalcon/mvc/model/query.zep", 948 TSRMLS_CC); + zephir_throw_exception_debug(&_12, "phalcon/mvc/model/query.zep", 948 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -1440,31 +1612,39 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getSelectColumn) { PHP_METHOD(Phalcon_Mvc_Model_Query, _getTable) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *manager, *qualifiedName, *modelName = NULL, *model = NULL, *source = NULL, *schema = NULL; + zval *manager, manager_sub, *qualifiedName, qualifiedName_sub, modelName, model, source, schema; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&manager_sub); + ZVAL_UNDEF(&qualifiedName_sub); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&schema); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &manager, &qualifiedName); - ZEPHIR_OBS_VAR(modelName); - if (!(zephir_array_isset_string_fetch(&modelName, qualifiedName, SS("name"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&modelName); + if (!(zephir_array_isset_string_fetch(&modelName, qualifiedName, SL("name"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/mvc/model/query.zep", 963); return; } - ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, modelName); + ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, &modelName); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, model, "getsource", NULL, 0); + ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&schema, model, "getschema", NULL, 0); + ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(schema)) { + if (zephir_is_true(&schema)) { zephir_create_array(return_value, 2, 0 TSRMLS_CC); - zephir_array_fast_append(return_value, schema); - zephir_array_fast_append(return_value, source); + zephir_array_fast_append(return_value, &schema); + zephir_array_fast_append(return_value, &source); RETURN_MM(); } - RETURN_CCTOR(source); + RETURN_CCTOR(&source); } @@ -1474,44 +1654,59 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getTable) { PHP_METHOD(Phalcon_Mvc_Model_Query, _getJoin) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *manager, *join, *qualified = NULL, *modelName = NULL, *realModelName = NULL, *nsAlias = NULL, *source = NULL, *model = NULL, *schema = NULL, *_0$$3, *_1$$5 = NULL, *_2$$5, *_3$$5, *_4$$4; + zval *manager, manager_sub, *join, join_sub, qualified, modelName, realModelName, nsAlias, source, model, schema, _0$$3, _1$$5, _2$$5, _3$$5, _4$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&manager_sub); + ZVAL_UNDEF(&join_sub); + ZVAL_UNDEF(&qualified); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&realModelName); + ZVAL_UNDEF(&nsAlias); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &manager, &join); - ZEPHIR_OBS_VAR(qualified); - if (zephir_array_isset_string_fetch(&qualified, join, SS("qualified"), 0 TSRMLS_CC)) { - zephir_array_fetch_string(&_0$$3, qualified, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 987 TSRMLS_CC); - if (ZEPHIR_IS_LONG(_0$$3, 355)) { - ZEPHIR_OBS_VAR(modelName); - zephir_array_fetch_string(&modelName, qualified, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 989 TSRMLS_CC); - if (zephir_memnstr_str(modelName, SL(":"), "phalcon/mvc/model/query.zep", 991)) { - ZEPHIR_INIT_VAR(nsAlias); - zephir_fast_explode_str(nsAlias, SL(":"), modelName, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&_2$$5, nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 993 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_1$$5, manager, "getnamespacealias", NULL, 0, _2$$5); + ZEPHIR_OBS_VAR(&qualified); + if (zephir_array_isset_string_fetch(&qualified, join, SL("qualified"), 0)) { + zephir_array_fetch_string(&_0$$3, &qualified, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 987 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&_0$$3, 355)) { + ZEPHIR_OBS_VAR(&modelName); + zephir_array_fetch_string(&modelName, &qualified, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 989 TSRMLS_CC); + if (zephir_memnstr_str(&modelName, SL(":"), "phalcon/mvc/model/query.zep", 991)) { + ZEPHIR_INIT_VAR(&nsAlias); + zephir_fast_explode_str(&nsAlias, SL(":"), &modelName, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&_2$$5, &nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 993 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_1$$5, manager, "getnamespacealias", NULL, 0, &_2$$5); zephir_check_call_status(); - zephir_array_fetch_long(&_3$$5, nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 993 TSRMLS_CC); - ZEPHIR_INIT_VAR(realModelName); - ZEPHIR_CONCAT_VSV(realModelName, _1$$5, "\\", _3$$5); + zephir_array_fetch_long(&_3$$5, &nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 993 TSRMLS_CC); + ZEPHIR_INIT_VAR(&realModelName); + ZEPHIR_CONCAT_VSV(&realModelName, &_1$$5, "\\", &_3$$5); } else { - ZEPHIR_CPY_WRT(realModelName, modelName); + ZEPHIR_CPY_WRT(&realModelName, &modelName); } - ZEPHIR_INIT_VAR(_4$$4); - ZVAL_BOOL(_4$$4, 1); - ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, realModelName, _4$$4); + ZVAL_BOOL(&_4$$4, 1); + ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, &realModelName, &_4$$4); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, model, "getsource", NULL, 0); + ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&schema, model, "getschema", NULL, 0); + ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); zephir_check_call_status(); zephir_create_array(return_value, 4, 0 TSRMLS_CC); - zephir_array_update_string(&return_value, SL("schema"), &schema, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("source"), &source, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("modelName"), &realModelName, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("model"), &model, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("schema"), &schema, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("source"), &source, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("modelName"), &realModelName, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("model"), &model, PH_COPY | PH_SEPARATE); RETURN_MM(); } } @@ -1529,44 +1724,51 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getJoin) { PHP_METHOD(Phalcon_Mvc_Model_Query, _getJoinType) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *join, *type = NULL, *_0, *_1, *_2; + zval *join, join_sub, type, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&join_sub); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &join); - ZEPHIR_OBS_VAR(type); - if (!(zephir_array_isset_string_fetch(&type, join, SS("type"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&type); + if (!(zephir_array_isset_string_fetch(&type, join, SL("type"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/mvc/model/query.zep", 1025); return; } do { - if (ZEPHIR_IS_LONG(type, 360)) { - RETURN_MM_STRING("INNER", 1); + if (ZEPHIR_IS_LONG(&type, 360)) { + RETURN_MM_STRING("INNER"); } - if (ZEPHIR_IS_LONG(type, 361)) { - RETURN_MM_STRING("LEFT", 1); + if (ZEPHIR_IS_LONG(&type, 361)) { + RETURN_MM_STRING("LEFT"); } - if (ZEPHIR_IS_LONG(type, 362)) { - RETURN_MM_STRING("RIGHT", 1); + if (ZEPHIR_IS_LONG(&type, 362)) { + RETURN_MM_STRING("RIGHT"); } - if (ZEPHIR_IS_LONG(type, 363)) { - RETURN_MM_STRING("CROSS", 1); + if (ZEPHIR_IS_LONG(&type, 363)) { + RETURN_MM_STRING("CROSS"); } - if (ZEPHIR_IS_LONG(type, 364)) { - RETURN_MM_STRING("FULL OUTER", 1); + if (ZEPHIR_IS_LONG(&type, 364)) { + RETURN_MM_STRING("FULL OUTER"); } } while(0); - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_mvc_model_exception_ce); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVSV(_2, "Unknown join type ", type, ", when preparing: ", _1); - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 9, _2); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_mvc_model_exception_ce); + zephir_read_property(&_1, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVSV(&_2, "Unknown join type ", &type, ", when preparing: ", &_1); + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 4, &_2); zephir_check_call_status(); - zephir_throw_exception_debug(_0, "phalcon/mvc/model/query.zep", 1046 TSRMLS_CC); + zephir_throw_exception_debug(&_0, "phalcon/mvc/model/query.zep", 1046 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -1584,109 +1786,140 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getJoinType) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getSingleJoin) { - HashTable *_5$$4; - HashPosition _4$$4; - zval *_0$$3, *_2$$3, *_3$$3, *_11$$5 = NULL, *_13$$5 = NULL, *_14$$5 = NULL; + zend_string *_6$$4; + zend_ulong _5$$4; + zval _0$$3, _2$$3, _3$$3, _11$$5, _13$$5, _14$$5; zephir_fcall_cache_entry *_10 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *joinType_param = NULL, *joinSource, *modelAlias, *joinAlias, *relation, *fields = NULL, *referencedFields = NULL, *sqlJoinConditions = NULL, *sqlJoinPartialConditions = NULL, *position = NULL, *field = NULL, *referencedField = NULL, *_1$$3 = NULL, **_6$$4, *_7$$6 = NULL, *_8$$6, *_9$$6 = NULL, *_12$$5 = NULL; - zval *joinType = NULL; + zval *joinType_param = NULL, *joinSource, joinSource_sub, *modelAlias, modelAlias_sub, *joinAlias, joinAlias_sub, *relation, relation_sub, fields, referencedFields, sqlJoinConditions, sqlJoinPartialConditions, position, field, referencedField, _1$$3, *_4$$4, _7$$6, _8$$6, _9$$6, _12$$5; + zval joinType; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&joinType); + ZVAL_UNDEF(&joinSource_sub); + ZVAL_UNDEF(&modelAlias_sub); + ZVAL_UNDEF(&joinAlias_sub); + ZVAL_UNDEF(&relation_sub); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&referencedFields); + ZVAL_UNDEF(&sqlJoinConditions); + ZVAL_UNDEF(&sqlJoinPartialConditions); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&referencedField); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_12$$5); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_13$$5); + ZVAL_UNDEF(&_14$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 5, 0, &joinType_param, &joinSource, &modelAlias, &joinAlias, &relation); if (UNEXPECTED(Z_TYPE_P(joinType_param) != IS_STRING && Z_TYPE_P(joinType_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'joinType' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'joinType' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(joinType_param) == IS_STRING)) { - zephir_get_strval(joinType, joinType_param); + zephir_get_strval(&joinType, joinType_param); } else { - ZEPHIR_INIT_VAR(joinType); - ZVAL_EMPTY_STRING(joinType); + ZEPHIR_INIT_VAR(&joinType); + ZVAL_EMPTY_STRING(&joinType); } - ZEPHIR_INIT_VAR(sqlJoinConditions); - ZVAL_NULL(sqlJoinConditions); + ZEPHIR_INIT_VAR(&sqlJoinConditions); + ZVAL_NULL(&sqlJoinConditions); ZEPHIR_CALL_METHOD(&fields, relation, "getfields", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&referencedFields, relation, "getreferencedfields", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(fields) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(sqlJoinConditions); - zephir_create_array(sqlJoinConditions, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_0$$3); - zephir_create_array(_0$$3, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(_0$$3, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(_0$$3, SS("op"), SL("="), 1); - ZEPHIR_INIT_VAR(_2$$3); - zephir_create_array(_2$$3, 3, 0 TSRMLS_CC); - add_assoc_long_ex(_2$$3, SS("type"), 355); - zephir_array_update_string(&_2$$3, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&fields) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&sqlJoinConditions); + zephir_create_array(&sqlJoinConditions, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_create_array(&_0$$3, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_0$$3, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&_0$$3, SL("op"), SL("=")); + ZEPHIR_INIT_VAR(&_2$$3); + zephir_create_array(&_2$$3, 3, 0 TSRMLS_CC); + add_assoc_long_ex(&_2$$3, SL("type"), 355); + zephir_array_update_string(&_2$$3, SL("domain"), modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_2$$3, SL("name"), &fields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "_getqualified", NULL, 357, _2$$3); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "_getqualified", NULL, 315, &_2$$3); zephir_check_call_status(); zephir_array_update_string(&_0$$3, SL("left"), &_1$$3, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_3$$3); - zephir_create_array(_3$$3, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(_3$$3, SS("type"), SL("qualified"), 1); - zephir_array_update_string(&_3$$3, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_3$$3); + zephir_create_array(&_3$$3, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_3$$3, SL("type"), SL("qualified")); + zephir_array_update_string(&_3$$3, SL("domain"), joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_3$$3, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "_getqualified", NULL, 357, _3$$3); + ZEPHIR_CALL_METHOD(&_1$$3, this_ptr, "_getqualified", NULL, 315, &_3$$3); zephir_check_call_status(); zephir_array_update_string(&_0$$3, SL("right"), &_1$$3, PH_COPY | PH_SEPARATE); - zephir_array_fast_append(sqlJoinConditions, _0$$3); + zephir_array_fast_append(&sqlJoinConditions, &_0$$3); } else { - ZEPHIR_INIT_VAR(sqlJoinPartialConditions); - array_init(sqlJoinPartialConditions); - zephir_is_iterable(fields, &_5$$4, &_4$$4, 0, 0, "phalcon/mvc/model/query.zep", 1136); - for ( - ; zend_hash_get_current_data_ex(_5$$4, (void**) &_6$$4, &_4$$4) == SUCCESS - ; zend_hash_move_forward_ex(_5$$4, &_4$$4) - ) { - ZEPHIR_GET_HMKEY(position, _5$$4, _4$$4); - ZEPHIR_GET_HVALUE(field, _6$$4); - ZEPHIR_OBS_NVAR(referencedField); - if (!(zephir_array_isset_fetch(&referencedField, referencedFields, position, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_7$$6); - object_init_ex(_7$$6, phalcon_mvc_model_exception_ce); - _8$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&sqlJoinPartialConditions); + array_init(&sqlJoinPartialConditions); + zephir_is_iterable(&fields, 0, "phalcon/mvc/model/query.zep", 1136); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _5$$4, _6$$4, _4$$4) + { + ZEPHIR_INIT_NVAR(&position); + if (_6$$4 != NULL) { + ZVAL_STR_COPY(&position, _6$$4); + } else { + ZVAL_LONG(&position, _5$$4); + } + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _4$$4); + ZEPHIR_OBS_NVAR(&referencedField); + if (!(zephir_array_isset_fetch(&referencedField, &referencedFields, &position, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_7$$6); + object_init_ex(&_7$$6, phalcon_mvc_model_exception_ce); + zephir_read_property(&_8$$6, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_LNVAR(_9$$6); - ZEPHIR_CONCAT_SVSVSV(_9$$6, "The number of fields must be equal to the number of referenced fields in join ", modelAlias, "-", joinAlias, ", when preparing: ", _8$$6); - ZEPHIR_CALL_METHOD(NULL, _7$$6, "__construct", &_10, 9, _9$$6); + ZEPHIR_CONCAT_SVSVSV(&_9$$6, "The number of fields must be equal to the number of referenced fields in join ", modelAlias, "-", joinAlias, ", when preparing: ", &_8$$6); + ZEPHIR_CALL_METHOD(NULL, &_7$$6, "__construct", &_10, 4, &_9$$6); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$6, "phalcon/mvc/model/query.zep", 1112 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$6, "phalcon/mvc/model/query.zep", 1112 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_NVAR(_11$$5); - zephir_create_array(_11$$5, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(_11$$5, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(_11$$5, SS("op"), SL("="), 1); - ZEPHIR_INIT_NVAR(_13$$5); - zephir_create_array(_13$$5, 3, 0 TSRMLS_CC); - add_assoc_long_ex(_13$$5, SS("type"), 355); - zephir_array_update_string(&_13$$5, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_11$$5); + zephir_create_array(&_11$$5, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_11$$5, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&_11$$5, SL("op"), SL("=")); + ZEPHIR_INIT_NVAR(&_13$$5); + zephir_create_array(&_13$$5, 3, 0 TSRMLS_CC); + add_assoc_long_ex(&_13$$5, SL("type"), 355); + zephir_array_update_string(&_13$$5, SL("domain"), modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_13$$5, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "_getqualified", NULL, 357, _13$$5); + ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "_getqualified", NULL, 315, &_13$$5); zephir_check_call_status(); zephir_array_update_string(&_11$$5, SL("left"), &_12$$5, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_14$$5); - zephir_create_array(_14$$5, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(_14$$5, SS("type"), SL("qualified"), 1); - zephir_array_update_string(&_14$$5, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_14$$5); + zephir_create_array(&_14$$5, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_14$$5, SL("type"), SL("qualified")); + zephir_array_update_string(&_14$$5, SL("domain"), joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_14$$5, SL("name"), &referencedField, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "_getqualified", NULL, 357, _14$$5); + ZEPHIR_CALL_METHOD(&_12$$5, this_ptr, "_getqualified", NULL, 315, &_14$$5); zephir_check_call_status(); zephir_array_update_string(&_11$$5, SL("right"), &_12$$5, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoinPartialConditions, _11$$5, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1133); - } + zephir_array_append(&sqlJoinPartialConditions, &_11$$5, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1133); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_INIT_NVAR(&position); } zephir_create_array(return_value, 3, 0 TSRMLS_CC); - zephir_array_update_string(&return_value, SL("type"), &joinType, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("source"), &joinSource, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("conditions"), &sqlJoinConditions, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("type"), &joinType, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("source"), joinSource, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("conditions"), &sqlJoinConditions, PH_COPY | PH_SEPARATE); RETURN_MM(); } @@ -1703,148 +1936,190 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getSingleJoin) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getMultiJoin) { - zval *_8$$4 = NULL, *_10$$4 = NULL, *_11$$6 = NULL, *_12$$6 = NULL, *_13$$6 = NULL, *_15$$6, *_16$$6, *_17$$6, *_18$$6; - HashTable *_1$$3; - HashPosition _0$$3; + zval _8$$4, _10$$4, _11$$6, _12$$6, _13$$6, _15$$6, _16$$6, _17$$6, _18$$6; + zend_string *_2$$3; + zend_ulong _1$$3; zephir_fcall_cache_entry *_6 = NULL, *_9 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *joinType, *joinSource, *modelAlias, *joinAlias, *relation, *sqlJoins = NULL, *fields = NULL, *referencedFields = NULL, *intermediateModelName = NULL, *intermediateModel = NULL, *intermediateSource = NULL, *intermediateSchema = NULL, *intermediateFields = NULL, *intermediateReferencedFields = NULL, *referencedModelName = NULL, *manager = NULL, *field = NULL, *position = NULL, *intermediateField = NULL, *sqlEqualsJoinCondition = NULL, **_2$$3, *_3$$5 = NULL, *_4$$5, *_5$$5 = NULL, *_7$$4 = NULL, *_14$$6 = NULL; + zval *joinType, joinType_sub, *joinSource, joinSource_sub, *modelAlias, modelAlias_sub, *joinAlias, joinAlias_sub, *relation, relation_sub, sqlJoins, fields, referencedFields, intermediateModelName, intermediateModel, intermediateSource, intermediateSchema, intermediateFields, intermediateReferencedFields, referencedModelName, manager, field, position, intermediateField, sqlEqualsJoinCondition, *_0$$3, _3$$5, _4$$5, _5$$5, _7$$4, _14$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&joinType_sub); + ZVAL_UNDEF(&joinSource_sub); + ZVAL_UNDEF(&modelAlias_sub); + ZVAL_UNDEF(&joinAlias_sub); + ZVAL_UNDEF(&relation_sub); + ZVAL_UNDEF(&sqlJoins); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&referencedFields); + ZVAL_UNDEF(&intermediateModelName); + ZVAL_UNDEF(&intermediateModel); + ZVAL_UNDEF(&intermediateSource); + ZVAL_UNDEF(&intermediateSchema); + ZVAL_UNDEF(&intermediateFields); + ZVAL_UNDEF(&intermediateReferencedFields); + ZVAL_UNDEF(&referencedModelName); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&intermediateField); + ZVAL_UNDEF(&sqlEqualsJoinCondition); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_14$$6); + ZVAL_UNDEF(&_8$$4); + ZVAL_UNDEF(&_10$$4); + ZVAL_UNDEF(&_11$$6); + ZVAL_UNDEF(&_12$$6); + ZVAL_UNDEF(&_13$$6); + ZVAL_UNDEF(&_15$$6); + ZVAL_UNDEF(&_16$$6); + ZVAL_UNDEF(&_17$$6); + ZVAL_UNDEF(&_18$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 5, 0, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); - ZEPHIR_INIT_VAR(sqlJoins); - array_init(sqlJoins); + ZEPHIR_INIT_VAR(&sqlJoins); + array_init(&sqlJoins); ZEPHIR_CALL_METHOD(&fields, relation, "getfields", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&referencedFields, relation, "getreferencedfields", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&intermediateModelName, relation, "getintermediatemodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&intermediateModel, manager, "load", NULL, 0, intermediateModelName); + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&intermediateModel, &manager, "load", NULL, 0, &intermediateModelName); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&intermediateSource, intermediateModel, "getsource", NULL, 0); + ZEPHIR_CALL_METHOD(&intermediateSource, &intermediateModel, "getsource", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&intermediateSchema, intermediateModel, "getschema", NULL, 0); + ZEPHIR_CALL_METHOD(&intermediateSchema, &intermediateModel, "getschema", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_sqlAliases"), intermediateModelName, intermediateSource TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_sqlAliasesModelsInstances"), intermediateModelName, intermediateModel TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_sqlAliases"), &intermediateModelName, &intermediateSource TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_sqlAliasesModelsInstances"), &intermediateModelName, &intermediateModel TSRMLS_CC); ZEPHIR_CALL_METHOD(&intermediateFields, relation, "getintermediatefields", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&intermediateReferencedFields, relation, "getintermediatereferencedfields", NULL, 0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&referencedModelName, relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(fields) == IS_ARRAY) { - zephir_is_iterable(fields, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/query.zep", 1263); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(field, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(position, _2$$3); - if (!(zephir_array_isset(referencedFields, position))) { - ZEPHIR_INIT_NVAR(_3$$5); - object_init_ex(_3$$5, phalcon_mvc_model_exception_ce); - _4$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); + if (Z_TYPE_P(&fields) == IS_ARRAY) { + zephir_is_iterable(&fields, 0, "phalcon/mvc/model/query.zep", 1263); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&field); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&field, _2$$3); + } else { + ZVAL_LONG(&field, _1$$3); + } + ZEPHIR_INIT_NVAR(&position); + ZVAL_COPY(&position, _0$$3); + if (!(zephir_array_isset(&referencedFields, &position))) { + ZEPHIR_INIT_NVAR(&_3$$5); + object_init_ex(&_3$$5, phalcon_mvc_model_exception_ce); + zephir_read_property(&_4$$5, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); ZEPHIR_INIT_LNVAR(_5$$5); - ZEPHIR_CONCAT_SVSVSV(_5$$5, "The number of fields must be equal to the number of referenced fields in join ", modelAlias, "-", joinAlias, ", when preparing: ", _4$$5); - ZEPHIR_CALL_METHOD(NULL, _3$$5, "__construct", &_6, 9, _5$$5); + ZEPHIR_CONCAT_SVSVSV(&_5$$5, "The number of fields must be equal to the number of referenced fields in join ", modelAlias, "-", joinAlias, ", when preparing: ", &_4$$5); + ZEPHIR_CALL_METHOD(NULL, &_3$$5, "__construct", &_6, 4, &_5$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$5, "phalcon/mvc/model/query.zep", 1234 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$5, "phalcon/mvc/model/query.zep", 1234 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_NVAR(intermediateField); - zephir_array_fetch(&intermediateField, intermediateFields, position, PH_NOISY, "phalcon/mvc/model/query.zep", 1240 TSRMLS_CC); - ZEPHIR_INIT_NVAR(sqlEqualsJoinCondition); - zephir_create_array(sqlEqualsJoinCondition, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(sqlEqualsJoinCondition, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(sqlEqualsJoinCondition, SS("op"), SL("="), 1); - ZEPHIR_INIT_NVAR(_8$$4); - zephir_create_array(_8$$4, 3, 0 TSRMLS_CC); - add_assoc_long_ex(_8$$4, SS("type"), 355); - zephir_array_update_string(&_8$$4, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&intermediateField); + zephir_array_fetch(&intermediateField, &intermediateFields, &position, PH_NOISY, "phalcon/mvc/model/query.zep", 1240 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&sqlEqualsJoinCondition); + zephir_create_array(&sqlEqualsJoinCondition, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&sqlEqualsJoinCondition, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&sqlEqualsJoinCondition, SL("op"), SL("=")); + ZEPHIR_INIT_NVAR(&_8$$4); + zephir_create_array(&_8$$4, 3, 0 TSRMLS_CC); + add_assoc_long_ex(&_8$$4, SL("type"), 355); + zephir_array_update_string(&_8$$4, SL("domain"), modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_8$$4, SL("name"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "_getqualified", &_9, 357, _8$$4); + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "_getqualified", &_9, 315, &_8$$4); zephir_check_call_status(); zephir_array_update_string(&sqlEqualsJoinCondition, SL("left"), &_7$$4, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_10$$4); - zephir_create_array(_10$$4, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(_10$$4, SS("type"), SL("qualified"), 1); - zephir_array_update_string(&_10$$4, SL("domain"), &joinAlias, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_10$$4); + zephir_create_array(&_10$$4, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_10$$4, SL("type"), SL("qualified")); + zephir_array_update_string(&_10$$4, SL("domain"), joinAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_10$$4, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "_getqualified", &_9, 357, _10$$4); + ZEPHIR_CALL_METHOD(&_7$$4, this_ptr, "_getqualified", &_9, 315, &_10$$4); zephir_check_call_status(); zephir_array_update_string(&sqlEqualsJoinCondition, SL("right"), &_7$$4, PH_COPY | PH_SEPARATE); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&position); + ZEPHIR_INIT_NVAR(&field); } else { - ZEPHIR_INIT_NVAR(sqlJoins); - zephir_create_array(sqlJoins, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_11$$6); - zephir_create_array(_11$$6, 3, 0 TSRMLS_CC); - zephir_array_update_string(&_11$$6, SL("type"), &joinType, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&sqlJoins); + zephir_create_array(&sqlJoins, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_11$$6); + zephir_create_array(&_11$$6, 3, 0 TSRMLS_CC); + zephir_array_update_string(&_11$$6, SL("type"), joinType, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_11$$6, SL("source"), &intermediateSource, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_12$$6); - zephir_create_array(_12$$6, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_13$$6); - zephir_create_array(_13$$6, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(_13$$6, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(_13$$6, SS("op"), SL("="), 1); - ZEPHIR_INIT_VAR(_15$$6); - zephir_create_array(_15$$6, 3, 0 TSRMLS_CC); - add_assoc_long_ex(_15$$6, SS("type"), 355); - zephir_array_update_string(&_15$$6, SL("domain"), &modelAlias, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&_12$$6); + zephir_create_array(&_12$$6, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_13$$6); + zephir_create_array(&_13$$6, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_13$$6, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&_13$$6, SL("op"), SL("=")); + ZEPHIR_INIT_VAR(&_15$$6); + zephir_create_array(&_15$$6, 3, 0 TSRMLS_CC); + add_assoc_long_ex(&_15$$6, SL("type"), 355); + zephir_array_update_string(&_15$$6, SL("domain"), modelAlias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_15$$6, SL("name"), &fields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_14$$6, this_ptr, "_getqualified", &_9, 357, _15$$6); + ZEPHIR_CALL_METHOD(&_14$$6, this_ptr, "_getqualified", &_9, 315, &_15$$6); zephir_check_call_status(); zephir_array_update_string(&_13$$6, SL("left"), &_14$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_16$$6); - zephir_create_array(_16$$6, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(_16$$6, SS("type"), SL("qualified"), 1); + ZEPHIR_INIT_VAR(&_16$$6); + zephir_create_array(&_16$$6, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_16$$6, SL("type"), SL("qualified")); zephir_array_update_string(&_16$$6, SL("domain"), &intermediateModelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_16$$6, SL("name"), &intermediateFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_14$$6, this_ptr, "_getqualified", &_9, 357, _16$$6); + ZEPHIR_CALL_METHOD(&_14$$6, this_ptr, "_getqualified", &_9, 315, &_16$$6); zephir_check_call_status(); zephir_array_update_string(&_13$$6, SL("right"), &_14$$6, PH_COPY | PH_SEPARATE); - zephir_array_fast_append(_12$$6, _13$$6); + zephir_array_fast_append(&_12$$6, &_13$$6); zephir_array_update_string(&_11$$6, SL("conditions"), &_12$$6, PH_COPY | PH_SEPARATE); - zephir_array_fast_append(sqlJoins, _11$$6); - ZEPHIR_INIT_NVAR(_11$$6); - zephir_create_array(_11$$6, 3, 0 TSRMLS_CC); - zephir_array_update_string(&_11$$6, SL("type"), &joinType, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_11$$6, SL("source"), &joinSource, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_12$$6); - zephir_create_array(_12$$6, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_13$$6); - zephir_create_array(_13$$6, 4, 0 TSRMLS_CC); - add_assoc_stringl_ex(_13$$6, SS("type"), SL("binary-op"), 1); - add_assoc_stringl_ex(_13$$6, SS("op"), SL("="), 1); - ZEPHIR_INIT_VAR(_17$$6); - zephir_create_array(_17$$6, 3, 0 TSRMLS_CC); - add_assoc_long_ex(_17$$6, SS("type"), 355); + zephir_array_fast_append(&sqlJoins, &_11$$6); + ZEPHIR_INIT_NVAR(&_11$$6); + zephir_create_array(&_11$$6, 3, 0 TSRMLS_CC); + zephir_array_update_string(&_11$$6, SL("type"), joinType, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_11$$6, SL("source"), joinSource, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_12$$6); + zephir_create_array(&_12$$6, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_13$$6); + zephir_create_array(&_13$$6, 4, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_13$$6, SL("type"), SL("binary-op")); + add_assoc_stringl_ex(&_13$$6, SL("op"), SL("=")); + ZEPHIR_INIT_VAR(&_17$$6); + zephir_create_array(&_17$$6, 3, 0 TSRMLS_CC); + add_assoc_long_ex(&_17$$6, SL("type"), 355); zephir_array_update_string(&_17$$6, SL("domain"), &intermediateModelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_17$$6, SL("name"), &intermediateReferencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_14$$6, this_ptr, "_getqualified", &_9, 357, _17$$6); + ZEPHIR_CALL_METHOD(&_14$$6, this_ptr, "_getqualified", &_9, 315, &_17$$6); zephir_check_call_status(); zephir_array_update_string(&_13$$6, SL("left"), &_14$$6, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_18$$6); - zephir_create_array(_18$$6, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(_18$$6, SS("type"), SL("qualified"), 1); + ZEPHIR_INIT_VAR(&_18$$6); + zephir_create_array(&_18$$6, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_18$$6, SL("type"), SL("qualified")); zephir_array_update_string(&_18$$6, SL("domain"), &referencedModelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_18$$6, SL("name"), &referencedFields, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&_14$$6, this_ptr, "_getqualified", &_9, 357, _18$$6); + ZEPHIR_CALL_METHOD(&_14$$6, this_ptr, "_getqualified", &_9, 315, &_18$$6); zephir_check_call_status(); zephir_array_update_string(&_13$$6, SL("right"), &_14$$6, PH_COPY | PH_SEPARATE); - zephir_array_fast_append(_12$$6, _13$$6); + zephir_array_fast_append(&_12$$6, &_13$$6); zephir_array_update_string(&_11$$6, SL("conditions"), &_12$$6, PH_COPY | PH_SEPARATE); - zephir_array_fast_append(sqlJoins, _11$$6); + zephir_array_fast_append(&sqlJoins, &_11$$6); } - RETURN_CCTOR(sqlJoins); + RETURN_CCTOR(&sqlJoins); } @@ -1856,290 +2131,382 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getMultiJoin) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getJoins) { - zval *_22$$15 = NULL, *_23$$15 = NULL, *_47$$29 = NULL, *_49$$30 = NULL, *_50$$30 = NULL; - HashTable *_1, *_13, *_25, *_31, *_20$$14, *_34$$17, *_45$$26; - HashPosition _0, _12, _24, _30, _19$$14, _33$$17, _44$$26; - zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL, *_8 = NULL, *_16 = NULL, *_36 = NULL, *_37 = NULL, *_42 = NULL, *_43 = NULL; + zval _20$$15, _21$$15, _41$$29, _43$$30, _44$$30; + zend_string *_12, *_28, *_19$$14, *_31$$17; + zend_ulong _11, _27, _18$$14, _30$$17; + zephir_fcall_cache_entry *_1 = NULL, *_2 = NULL, *_6 = NULL, *_14 = NULL, *_32 = NULL, *_33 = NULL, *_38 = NULL, *_39 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *select, *models = NULL, *sqlAliases = NULL, *sqlAliasesModels = NULL, *sqlModelsAliases = NULL, *sqlAliasesModelsInstances = NULL, *modelsInstances = NULL, *fromModels = NULL, *sqlJoins = NULL, *joinModels = NULL, *joinSources = NULL, *joinTypes = NULL, *joinPreCondition = NULL, *joinPrepared = NULL, *manager = NULL, *selectJoins = NULL, *joinItem = NULL, *joins = NULL, *joinData = NULL, *schema = NULL, *source = NULL, *model = NULL, *realModelName = NULL, *completeSource = NULL, *joinType = NULL, *aliasExpr = NULL, *alias = NULL, *joinAliasName = NULL, *joinExpr = NULL, *fromModelName = NULL, *joinAlias = NULL, *joinModel = NULL, *joinSource = NULL, *preCondition = NULL, *modelNameAlias = NULL, *relation = NULL, *relations = NULL, *modelAlias = NULL, *sqlJoin = NULL, *sqlJoinItem = NULL, *selectTables = NULL, *tables = NULL, *tableItem = NULL, **_2, **_14, *_17, **_26, *_29 = NULL, **_32, *_5$$9 = NULL, *_6$$9, *_7$$9 = NULL, *_9$$11 = NULL, *_10$$11, *_11$$11 = NULL, *_15$$13 = NULL, *_18$$14 = NULL, **_21$$14, *_27$$16, *_28$$16 = NULL, **_35$$17, *_38$$22 = NULL, *_39$$22, *_40$$22 = NULL, *_41$$23 = NULL, **_46$$26, *_48$$29 = NULL; + zval *select, select_sub, __$true, models, sqlAliases, sqlAliasesModels, sqlModelsAliases, sqlAliasesModelsInstances, modelsInstances, fromModels, sqlJoins, joinModels, joinSources, joinTypes, joinPreCondition, joinPrepared, manager, selectJoins, joinItem, joins, joinData, schema, source, model, realModelName, completeSource, joinType, aliasExpr, alias, joinAliasName, joinExpr, fromModelName, joinAlias, joinModel, joinSource, preCondition, modelNameAlias, relation, relations, modelAlias, sqlJoin, sqlJoinItem, selectTables, tables, tableItem, *_0, *_10, _15, *_22, _25, *_26, _3$$9, _4$$9, _5$$9, _7$$11, _8$$11, _9$$11, _13$$13, _16$$14, *_17$$14, _23$$16, _24$$16, *_29$$17, _34$$22, _35$$22, _36$$22, _37$$23, *_40$$26, _42$$29; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&select_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(&sqlAliases); + ZVAL_UNDEF(&sqlAliasesModels); + ZVAL_UNDEF(&sqlModelsAliases); + ZVAL_UNDEF(&sqlAliasesModelsInstances); + ZVAL_UNDEF(&modelsInstances); + ZVAL_UNDEF(&fromModels); + ZVAL_UNDEF(&sqlJoins); + ZVAL_UNDEF(&joinModels); + ZVAL_UNDEF(&joinSources); + ZVAL_UNDEF(&joinTypes); + ZVAL_UNDEF(&joinPreCondition); + ZVAL_UNDEF(&joinPrepared); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&selectJoins); + ZVAL_UNDEF(&joinItem); + ZVAL_UNDEF(&joins); + ZVAL_UNDEF(&joinData); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&realModelName); + ZVAL_UNDEF(&completeSource); + ZVAL_UNDEF(&joinType); + ZVAL_UNDEF(&aliasExpr); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&joinAliasName); + ZVAL_UNDEF(&joinExpr); + ZVAL_UNDEF(&fromModelName); + ZVAL_UNDEF(&joinAlias); + ZVAL_UNDEF(&joinModel); + ZVAL_UNDEF(&joinSource); + ZVAL_UNDEF(&preCondition); + ZVAL_UNDEF(&modelNameAlias); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&relations); + ZVAL_UNDEF(&modelAlias); + ZVAL_UNDEF(&sqlJoin); + ZVAL_UNDEF(&sqlJoinItem); + ZVAL_UNDEF(&selectTables); + ZVAL_UNDEF(&tables); + ZVAL_UNDEF(&tableItem); + ZVAL_UNDEF(&_15); + ZVAL_UNDEF(&_25); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_7$$11); + ZVAL_UNDEF(&_8$$11); + ZVAL_UNDEF(&_9$$11); + ZVAL_UNDEF(&_13$$13); + ZVAL_UNDEF(&_16$$14); + ZVAL_UNDEF(&_23$$16); + ZVAL_UNDEF(&_24$$16); + ZVAL_UNDEF(&_34$$22); + ZVAL_UNDEF(&_35$$22); + ZVAL_UNDEF(&_36$$22); + ZVAL_UNDEF(&_37$$23); + ZVAL_UNDEF(&_42$$29); + ZVAL_UNDEF(&_20$$15); + ZVAL_UNDEF(&_21$$15); + ZVAL_UNDEF(&_41$$29); + ZVAL_UNDEF(&_43$$30); + ZVAL_UNDEF(&_44$$30); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &select); - ZEPHIR_OBS_VAR(models); - zephir_read_property_this(&models, this_ptr, SL("_models"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(sqlAliases); - zephir_read_property_this(&sqlAliases, this_ptr, SL("_sqlAliases"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(sqlAliasesModels); - zephir_read_property_this(&sqlAliasesModels, this_ptr, SL("_sqlAliasesModels"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(sqlModelsAliases); - zephir_read_property_this(&sqlModelsAliases, this_ptr, SL("_sqlModelsAliases"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(sqlAliasesModelsInstances); - zephir_read_property_this(&sqlAliasesModelsInstances, this_ptr, SL("_sqlAliasesModelsInstances"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(modelsInstances); - zephir_read_property_this(&modelsInstances, this_ptr, SL("_modelsInstances"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(fromModels, models); - ZEPHIR_INIT_VAR(sqlJoins); - array_init(sqlJoins); - ZEPHIR_INIT_VAR(joinModels); - array_init(joinModels); - ZEPHIR_INIT_VAR(joinSources); - array_init(joinSources); - ZEPHIR_INIT_VAR(joinTypes); - array_init(joinTypes); - ZEPHIR_INIT_VAR(joinPreCondition); - array_init(joinPreCondition); - ZEPHIR_INIT_VAR(joinPrepared); - array_init(joinPrepared); - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(tables); + ZEPHIR_OBS_VAR(&models); + zephir_read_property(&models, this_ptr, SL("_models"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&sqlAliases); + zephir_read_property(&sqlAliases, this_ptr, SL("_sqlAliases"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&sqlAliasesModels); + zephir_read_property(&sqlAliasesModels, this_ptr, SL("_sqlAliasesModels"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&sqlModelsAliases); + zephir_read_property(&sqlModelsAliases, this_ptr, SL("_sqlModelsAliases"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&sqlAliasesModelsInstances); + zephir_read_property(&sqlAliasesModelsInstances, this_ptr, SL("_sqlAliasesModelsInstances"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&modelsInstances); + zephir_read_property(&modelsInstances, this_ptr, SL("_modelsInstances"), PH_NOISY_CC); + ZEPHIR_CPY_WRT(&fromModels, &models); + ZEPHIR_INIT_VAR(&sqlJoins); + array_init(&sqlJoins); + ZEPHIR_INIT_VAR(&joinModels); + array_init(&joinModels); + ZEPHIR_INIT_VAR(&joinSources); + array_init(&joinSources); + ZEPHIR_INIT_VAR(&joinTypes); + array_init(&joinTypes); + ZEPHIR_INIT_VAR(&joinPreCondition); + array_init(&joinPreCondition); + ZEPHIR_INIT_VAR(&joinPrepared); + array_init(&joinPrepared); + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&tables); zephir_array_fetch_string(&tables, select, SL("tables"), PH_NOISY, "phalcon/mvc/model/query.zep", 1354 TSRMLS_CC); - if (!(zephir_array_isset_long(tables, 0))) { - ZEPHIR_INIT_VAR(selectTables); - zephir_create_array(selectTables, 1, 0 TSRMLS_CC); - zephir_array_fast_append(selectTables, tables); + if (!(zephir_array_isset_long(&tables, 0))) { + ZEPHIR_INIT_VAR(&selectTables); + zephir_create_array(&selectTables, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&selectTables, &tables); } else { - ZEPHIR_CPY_WRT(selectTables, tables); + ZEPHIR_CPY_WRT(&selectTables, &tables); } - ZEPHIR_OBS_VAR(joins); + ZEPHIR_OBS_VAR(&joins); zephir_array_fetch_string(&joins, select, SL("joins"), PH_NOISY, "phalcon/mvc/model/query.zep", 1361 TSRMLS_CC); - if (!(zephir_array_isset_long(joins, 0))) { - ZEPHIR_INIT_VAR(selectJoins); - zephir_create_array(selectJoins, 1, 0 TSRMLS_CC); - zephir_array_fast_append(selectJoins, joins); + if (!(zephir_array_isset_long(&joins, 0))) { + ZEPHIR_INIT_VAR(&selectJoins); + zephir_create_array(&selectJoins, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&selectJoins, &joins); } else { - ZEPHIR_CPY_WRT(selectJoins, joins); - } - zephir_is_iterable(selectJoins, &_1, &_0, 0, 0, "phalcon/mvc/model/query.zep", 1514); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(joinItem, _2); - ZEPHIR_CALL_METHOD(&joinData, this_ptr, "_getjoin", &_3, 361, manager, joinItem); + ZEPHIR_CPY_WRT(&selectJoins, &joins); + } + zephir_is_iterable(&selectJoins, 0, "phalcon/mvc/model/query.zep", 1514); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectJoins), _0) + { + ZEPHIR_INIT_NVAR(&joinItem); + ZVAL_COPY(&joinItem, _0); + ZEPHIR_CALL_METHOD(&joinData, this_ptr, "_getjoin", &_1, 319, &manager, &joinItem); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(source); - zephir_array_fetch_string(&source, joinData, SL("source"), PH_NOISY, "phalcon/mvc/model/query.zep", 1374 TSRMLS_CC); - ZEPHIR_OBS_NVAR(schema); - zephir_array_fetch_string(&schema, joinData, SL("schema"), PH_NOISY, "phalcon/mvc/model/query.zep", 1375 TSRMLS_CC); - ZEPHIR_OBS_NVAR(model); - zephir_array_fetch_string(&model, joinData, SL("model"), PH_NOISY, "phalcon/mvc/model/query.zep", 1376 TSRMLS_CC); - ZEPHIR_OBS_NVAR(realModelName); - zephir_array_fetch_string(&realModelName, joinData, SL("modelName"), PH_NOISY, "phalcon/mvc/model/query.zep", 1377 TSRMLS_CC); - ZEPHIR_INIT_NVAR(completeSource); - zephir_create_array(completeSource, 2, 0 TSRMLS_CC); - zephir_array_fast_append(completeSource, source); - zephir_array_fast_append(completeSource, schema); - ZEPHIR_CALL_METHOD(&joinType, this_ptr, "_getjointype", &_4, 362, joinItem); + ZEPHIR_OBS_NVAR(&source); + zephir_array_fetch_string(&source, &joinData, SL("source"), PH_NOISY, "phalcon/mvc/model/query.zep", 1374 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&schema); + zephir_array_fetch_string(&schema, &joinData, SL("schema"), PH_NOISY, "phalcon/mvc/model/query.zep", 1375 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&model); + zephir_array_fetch_string(&model, &joinData, SL("model"), PH_NOISY, "phalcon/mvc/model/query.zep", 1376 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&realModelName); + zephir_array_fetch_string(&realModelName, &joinData, SL("modelName"), PH_NOISY, "phalcon/mvc/model/query.zep", 1377 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&completeSource); + zephir_create_array(&completeSource, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&completeSource, &source); + zephir_array_fast_append(&completeSource, &schema); + ZEPHIR_CALL_METHOD(&joinType, this_ptr, "_getjointype", &_2, 320, &joinItem); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(aliasExpr); - if (zephir_array_isset_string_fetch(&aliasExpr, joinItem, SS("alias"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_NVAR(alias); - zephir_array_fetch_string(&alias, aliasExpr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 1390 TSRMLS_CC); - if (zephir_array_isset(joinModels, alias)) { - ZEPHIR_INIT_NVAR(_5$$9); - object_init_ex(_5$$9, phalcon_mvc_model_exception_ce); - _6$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_LNVAR(_7$$9); - ZEPHIR_CONCAT_SVSV(_7$$9, "Cannot use '", alias, "' as join alias because it was already used, when preparing: ", _6$$9); - ZEPHIR_CALL_METHOD(NULL, _5$$9, "__construct", &_8, 9, _7$$9); + ZEPHIR_OBS_NVAR(&aliasExpr); + if (zephir_array_isset_string_fetch(&aliasExpr, &joinItem, SL("alias"), 0)) { + ZEPHIR_OBS_NVAR(&alias); + zephir_array_fetch_string(&alias, &aliasExpr, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 1390 TSRMLS_CC); + if (zephir_array_isset(&joinModels, &alias)) { + ZEPHIR_INIT_NVAR(&_3$$9); + object_init_ex(&_3$$9, phalcon_mvc_model_exception_ce); + zephir_read_property(&_4$$9, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_LNVAR(_5$$9); + ZEPHIR_CONCAT_SVSV(&_5$$9, "Cannot use '", &alias, "' as join alias because it was already used, when preparing: ", &_4$$9); + ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", &_6, 4, &_5$$9); zephir_check_call_status(); - zephir_throw_exception_debug(_5$$9, "phalcon/mvc/model/query.zep", 1398 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$9, "phalcon/mvc/model/query.zep", 1398 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&completeSource, alias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1404); - zephir_array_update_zval(&joinTypes, alias, &joinType, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliases, alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&joinModels, alias, &realModelName, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlModelsAliases, realModelName, &alias, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModels, alias, &realModelName, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModelsInstances, alias, &model, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&models, realModelName, &alias, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&joinSources, alias, &completeSource, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&joinPrepared, alias, &joinItem, PH_COPY | PH_SEPARATE); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1404); + zephir_array_update_zval(&joinTypes, &alias, &joinType, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&joinModels, &alias, &realModelName, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlModelsAliases, &realModelName, &alias, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModels, &alias, &realModelName, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&models, &realModelName, &alias, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&joinSources, &alias, &completeSource, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&joinPrepared, &alias, &joinItem, PH_COPY | PH_SEPARATE); } else { - if (zephir_array_isset(joinModels, realModelName)) { - ZEPHIR_INIT_NVAR(_9$$11); - object_init_ex(_9$$11, phalcon_mvc_model_exception_ce); - _10$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_LNVAR(_11$$11); - ZEPHIR_CONCAT_SVSV(_11$$11, "Cannot use '", realModelName, "' as join alias because it was already used, when preparing: ", _10$$11); - ZEPHIR_CALL_METHOD(NULL, _9$$11, "__construct", &_8, 9, _11$$11); + if (zephir_array_isset(&joinModels, &realModelName)) { + ZEPHIR_INIT_NVAR(&_7$$11); + object_init_ex(&_7$$11, phalcon_mvc_model_exception_ce); + zephir_read_property(&_8$$11, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_LNVAR(_9$$11); + ZEPHIR_CONCAT_SVSV(&_9$$11, "Cannot use '", &realModelName, "' as join alias because it was already used, when preparing: ", &_8$$11); + ZEPHIR_CALL_METHOD(NULL, &_7$$11, "__construct", &_6, 4, &_9$$11); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$11, "phalcon/mvc/model/query.zep", 1459 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$11, "phalcon/mvc/model/query.zep", 1459 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_array_update_zval(&joinTypes, realModelName, &joinType, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliases, realModelName, &source, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&joinModels, realModelName, &source, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlModelsAliases, realModelName, &realModelName, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModels, realModelName, &realModelName, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModelsInstances, realModelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&models, realModelName, &source, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&joinSources, realModelName, &completeSource, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&joinPrepared, realModelName, &joinItem, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&joinTypes, &realModelName, &joinType, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliases, &realModelName, &source, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&joinModels, &realModelName, &source, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlModelsAliases, &realModelName, &realModelName, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModels, &realModelName, &realModelName, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModelsInstances, &realModelName, &model, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&models, &realModelName, &source, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&joinSources, &realModelName, &completeSource, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&joinPrepared, &realModelName, &joinItem, PH_COPY | PH_SEPARATE); + } + zephir_array_update_zval(&modelsInstances, &realModelName, &model, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&joinItem); + zephir_update_property_zval(this_ptr, SL("_models"), &models); + zephir_update_property_zval(this_ptr, SL("_sqlAliases"), &sqlAliases); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModels"), &sqlAliasesModels); + zephir_update_property_zval(this_ptr, SL("_sqlModelsAliases"), &sqlModelsAliases); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModelsInstances"), &sqlAliasesModelsInstances); + zephir_update_property_zval(this_ptr, SL("_modelsInstances"), &modelsInstances); + zephir_is_iterable(&joinPrepared, 0, "phalcon/mvc/model/query.zep", 1534); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinPrepared), _11, _12, _10) + { + ZEPHIR_INIT_NVAR(&joinAliasName); + if (_12 != NULL) { + ZVAL_STR_COPY(&joinAliasName, _12); + } else { + ZVAL_LONG(&joinAliasName, _11); } - zephir_array_update_zval(&modelsInstances, realModelName, &model, PH_COPY | PH_SEPARATE); - } - zephir_update_property_this(getThis(), SL("_models"), models TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliases"), sqlAliases TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModels"), sqlAliasesModels TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlModelsAliases"), sqlModelsAliases TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModelsInstances"), sqlAliasesModelsInstances TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_modelsInstances"), modelsInstances TSRMLS_CC); - zephir_is_iterable(joinPrepared, &_13, &_12, 0, 0, "phalcon/mvc/model/query.zep", 1534); - for ( - ; zend_hash_get_current_data_ex(_13, (void**) &_14, &_12) == SUCCESS - ; zend_hash_move_forward_ex(_13, &_12) - ) { - ZEPHIR_GET_HMKEY(joinAliasName, _13, _12); - ZEPHIR_GET_HVALUE(joinItem, _14); - ZEPHIR_OBS_NVAR(joinExpr); - if (zephir_array_isset_string_fetch(&joinExpr, joinItem, SS("conditions"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_15$$13, this_ptr, "_getexpression", &_16, 355, joinExpr); + ZEPHIR_INIT_NVAR(&joinItem); + ZVAL_COPY(&joinItem, _10); + ZEPHIR_OBS_NVAR(&joinExpr); + if (zephir_array_isset_string_fetch(&joinExpr, &joinItem, SL("conditions"), 0)) { + ZEPHIR_CALL_METHOD(&_13$$13, this_ptr, "_getexpression", &_14, 313, &joinExpr); zephir_check_call_status(); - zephir_array_update_zval(&joinPreCondition, joinAliasName, &_15$$13, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&joinPreCondition, &joinAliasName, &_13$$13, PH_COPY | PH_SEPARATE); } - } - _17 = zephir_fetch_nproperty_this(this_ptr, SL("_enableImplicitJoins"), PH_NOISY_CC); - if (!(zephir_is_true(_17))) { - ZEPHIR_INIT_VAR(_18$$14); - zephir_is_iterable(joinPrepared, &_20$$14, &_19$$14, 0, 0, "phalcon/mvc/model/query.zep", 1545); - for ( - ; zend_hash_get_current_data_ex(_20$$14, (void**) &_21$$14, &_19$$14) == SUCCESS - ; zend_hash_move_forward_ex(_20$$14, &_19$$14) - ) { - ZEPHIR_GET_HMKEY(joinAliasName, _20$$14, _19$$14); - ZEPHIR_GET_HVALUE(_18$$14, _21$$14); - ZEPHIR_OBS_NVAR(joinType); - zephir_array_fetch(&joinType, joinTypes, joinAliasName, PH_NOISY, "phalcon/mvc/model/query.zep", 1536 TSRMLS_CC); - ZEPHIR_OBS_NVAR(joinSource); - zephir_array_fetch(&joinSource, joinSources, joinAliasName, PH_NOISY, "phalcon/mvc/model/query.zep", 1537 TSRMLS_CC); - ZEPHIR_OBS_NVAR(preCondition); - zephir_array_fetch(&preCondition, joinPreCondition, joinAliasName, PH_NOISY, "phalcon/mvc/model/query.zep", 1538 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_22$$15); - zephir_create_array(_22$$15, 3, 0 TSRMLS_CC); - zephir_array_update_string(&_22$$15, SL("type"), &joinType, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_22$$15, SL("source"), &joinSource, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_23$$15); - zephir_create_array(_23$$15, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_23$$15, preCondition); - zephir_array_update_string(&_22$$15, SL("conditions"), &_23$$15, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, _22$$15, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1543); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&joinItem); + ZEPHIR_INIT_NVAR(&joinAliasName); + zephir_read_property(&_15, this_ptr, SL("_enableImplicitJoins"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_15))) { + ZEPHIR_INIT_VAR(&_16$$14); + zephir_is_iterable(&joinPrepared, 0, "phalcon/mvc/model/query.zep", 1545); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinPrepared), _18$$14, _19$$14, _17$$14) + { + ZEPHIR_INIT_NVAR(&joinAliasName); + if (_19$$14 != NULL) { + ZVAL_STR_COPY(&joinAliasName, _19$$14); + } else { + ZVAL_LONG(&joinAliasName, _18$$14); + } + ZEPHIR_INIT_NVAR(&_16$$14); + ZVAL_COPY(&_16$$14, _17$$14); + ZEPHIR_OBS_NVAR(&joinType); + zephir_array_fetch(&joinType, &joinTypes, &joinAliasName, PH_NOISY, "phalcon/mvc/model/query.zep", 1536 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&joinSource); + zephir_array_fetch(&joinSource, &joinSources, &joinAliasName, PH_NOISY, "phalcon/mvc/model/query.zep", 1537 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&preCondition); + zephir_array_fetch(&preCondition, &joinPreCondition, &joinAliasName, PH_NOISY, "phalcon/mvc/model/query.zep", 1538 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_20$$15); + zephir_create_array(&_20$$15, 3, 0 TSRMLS_CC); + zephir_array_update_string(&_20$$15, SL("type"), &joinType, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_20$$15, SL("source"), &joinSource, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_21$$15); + zephir_create_array(&_21$$15, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_21$$15, &preCondition); + zephir_array_update_string(&_20$$15, SL("conditions"), &_21$$15, PH_COPY | PH_SEPARATE); + zephir_array_append(&sqlJoins, &_20$$15, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1543); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_16$$14); + ZEPHIR_INIT_NVAR(&joinAliasName); + RETURN_CCTOR(&sqlJoins); + } + ZEPHIR_INIT_NVAR(&fromModels); + array_init(&fromModels); + zephir_is_iterable(&selectTables, 0, "phalcon/mvc/model/query.zep", 1559); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectTables), _22) + { + ZEPHIR_INIT_NVAR(&tableItem); + ZVAL_COPY(&tableItem, _22); + zephir_array_fetch_string(&_23$$16, &tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 1553 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_24$$16); + zephir_array_fetch_string(&_24$$16, &_23$$16, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 1553 TSRMLS_CC); + zephir_array_update_zval(&fromModels, &_24$$16, &__$true, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&tableItem); + ZEPHIR_INIT_VAR(&_25); + zephir_is_iterable(&fromModels, 0, "phalcon/mvc/model/query.zep", 1667); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fromModels), _27, _28, _26) + { + ZEPHIR_INIT_NVAR(&fromModelName); + if (_28 != NULL) { + ZVAL_STR_COPY(&fromModelName, _28); + } else { + ZVAL_LONG(&fromModelName, _27); } - RETURN_CCTOR(sqlJoins); - } - ZEPHIR_INIT_NVAR(fromModels); - array_init(fromModels); - zephir_is_iterable(selectTables, &_25, &_24, 0, 0, "phalcon/mvc/model/query.zep", 1559); - for ( - ; zend_hash_get_current_data_ex(_25, (void**) &_26, &_24) == SUCCESS - ; zend_hash_move_forward_ex(_25, &_24) - ) { - ZEPHIR_GET_HVALUE(tableItem, _26); - zephir_array_fetch_string(&_27$$16, tableItem, SL("qualifiedName"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 1553 TSRMLS_CC); - ZEPHIR_OBS_NVAR(_28$$16); - zephir_array_fetch_string(&_28$$16, _27$$16, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 1553 TSRMLS_CC); - zephir_array_update_zval(&fromModels, _28$$16, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - } - ZEPHIR_INIT_VAR(_29); - zephir_is_iterable(fromModels, &_31, &_30, 0, 0, "phalcon/mvc/model/query.zep", 1667); - for ( - ; zend_hash_get_current_data_ex(_31, (void**) &_32, &_30) == SUCCESS - ; zend_hash_move_forward_ex(_31, &_30) - ) { - ZEPHIR_GET_HMKEY(fromModelName, _31, _30); - ZEPHIR_GET_HVALUE(_29, _32); - zephir_is_iterable(joinModels, &_34$$17, &_33$$17, 0, 0, "phalcon/mvc/model/query.zep", 1665); - for ( - ; zend_hash_get_current_data_ex(_34$$17, (void**) &_35$$17, &_33$$17) == SUCCESS - ; zend_hash_move_forward_ex(_34$$17, &_33$$17) - ) { - ZEPHIR_GET_HMKEY(joinAlias, _34$$17, _33$$17); - ZEPHIR_GET_HVALUE(joinModel, _35$$17); - ZEPHIR_OBS_NVAR(joinSource); - zephir_array_fetch(&joinSource, joinSources, joinAlias, PH_NOISY, "phalcon/mvc/model/query.zep", 1566 TSRMLS_CC); - ZEPHIR_OBS_NVAR(joinType); - zephir_array_fetch(&joinType, joinTypes, joinAlias, PH_NOISY, "phalcon/mvc/model/query.zep", 1571 TSRMLS_CC); - ZEPHIR_OBS_NVAR(preCondition); - if (!(zephir_array_isset_fetch(&preCondition, joinPreCondition, joinAlias, 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(modelNameAlias); - zephir_array_fetch(&modelNameAlias, sqlAliasesModels, joinAlias, PH_NOISY, "phalcon/mvc/model/query.zep", 1581 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&relation, manager, "getrelationbyalias", &_36, 0, fromModelName, modelNameAlias); + ZEPHIR_INIT_NVAR(&_25); + ZVAL_COPY(&_25, _26); + zephir_is_iterable(&joinModels, 0, "phalcon/mvc/model/query.zep", 1665); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&joinModels), _30$$17, _31$$17, _29$$17) + { + ZEPHIR_INIT_NVAR(&joinAlias); + if (_31$$17 != NULL) { + ZVAL_STR_COPY(&joinAlias, _31$$17); + } else { + ZVAL_LONG(&joinAlias, _30$$17); + } + ZEPHIR_INIT_NVAR(&joinModel); + ZVAL_COPY(&joinModel, _29$$17); + ZEPHIR_OBS_NVAR(&joinSource); + zephir_array_fetch(&joinSource, &joinSources, &joinAlias, PH_NOISY, "phalcon/mvc/model/query.zep", 1566 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&joinType); + zephir_array_fetch(&joinType, &joinTypes, &joinAlias, PH_NOISY, "phalcon/mvc/model/query.zep", 1571 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&preCondition); + if (!(zephir_array_isset_fetch(&preCondition, &joinPreCondition, &joinAlias, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&modelNameAlias); + zephir_array_fetch(&modelNameAlias, &sqlAliasesModels, &joinAlias, PH_NOISY, "phalcon/mvc/model/query.zep", 1581 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_32, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(relation)) { - ZEPHIR_CALL_METHOD(&relations, manager, "getrelationsbetween", &_37, 0, fromModelName, modelNameAlias); + if (ZEPHIR_IS_FALSE_IDENTICAL(&relation)) { + ZEPHIR_CALL_METHOD(&relations, &manager, "getrelationsbetween", &_33, 0, &fromModelName, &modelNameAlias); zephir_check_call_status(); - if (Z_TYPE_P(relations) == IS_ARRAY) { - if (zephir_fast_count_int(relations TSRMLS_CC) != 1) { - ZEPHIR_INIT_NVAR(_38$$22); - object_init_ex(_38$$22, phalcon_mvc_model_exception_ce); - _39$$22 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_LNVAR(_40$$22); - ZEPHIR_CONCAT_SVSVSV(_40$$22, "There is more than one relation between models '", fromModelName, "' and '", joinModel, "', the join must be done using an alias, when preparing: ", _39$$22); - ZEPHIR_CALL_METHOD(NULL, _38$$22, "__construct", &_8, 9, _40$$22); + if (Z_TYPE_P(&relations) == IS_ARRAY) { + if (zephir_fast_count_int(&relations TSRMLS_CC) != 1) { + ZEPHIR_INIT_NVAR(&_34$$22); + object_init_ex(&_34$$22, phalcon_mvc_model_exception_ce); + zephir_read_property(&_35$$22, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_LNVAR(_36$$22); + ZEPHIR_CONCAT_SVSVSV(&_36$$22, "There is more than one relation between models '", &fromModelName, "' and '", &joinModel, "', the join must be done using an alias, when preparing: ", &_35$$22); + ZEPHIR_CALL_METHOD(NULL, &_34$$22, "__construct", &_6, 4, &_36$$22); zephir_check_call_status(); - zephir_throw_exception_debug(_38$$22, "phalcon/mvc/model/query.zep", 1601 TSRMLS_CC); + zephir_throw_exception_debug(&_34$$22, "phalcon/mvc/model/query.zep", 1601 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_NVAR(relation); - zephir_array_fetch_long(&relation, relations, 0, PH_NOISY, "phalcon/mvc/model/query.zep", 1607 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&relation); + zephir_array_fetch_long(&relation, &relations, 0, PH_NOISY, "phalcon/mvc/model/query.zep", 1607 TSRMLS_CC); } } - if (Z_TYPE_P(relation) == IS_OBJECT) { - ZEPHIR_OBS_NVAR(modelAlias); - zephir_array_fetch(&modelAlias, sqlModelsAliases, fromModelName, PH_NOISY, "phalcon/mvc/model/query.zep", 1619 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_41$$23, relation, "isthrough", NULL, 0); + if (Z_TYPE_P(&relation) == IS_OBJECT) { + ZEPHIR_OBS_NVAR(&modelAlias); + zephir_array_fetch(&modelAlias, &sqlModelsAliases, &fromModelName, PH_NOISY, "phalcon/mvc/model/query.zep", 1619 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_37$$23, &relation, "isthrough", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_41$$23))) { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "_getsinglejoin", &_42, 363, joinType, joinSource, modelAlias, joinAlias, relation); + if (!(zephir_is_true(&_37$$23))) { + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "_getsinglejoin", &_38, 321, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "_getmultijoin", &_43, 364, joinType, joinSource, modelAlias, joinAlias, relation); + ZEPHIR_CALL_METHOD(&sqlJoin, this_ptr, "_getmultijoin", &_39, 322, &joinType, &joinSource, &modelAlias, &joinAlias, &relation); zephir_check_call_status(); } - if (zephir_array_isset_long(sqlJoin, 0)) { - zephir_is_iterable(sqlJoin, &_45$$26, &_44$$26, 0, 0, "phalcon/mvc/model/query.zep", 1637); - for ( - ; zend_hash_get_current_data_ex(_45$$26, (void**) &_46$$26, &_44$$26) == SUCCESS - ; zend_hash_move_forward_ex(_45$$26, &_44$$26) - ) { - ZEPHIR_GET_HVALUE(sqlJoinItem, _46$$26); - zephir_array_append(&sqlJoins, sqlJoinItem, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1635); - } + if (zephir_array_isset_long(&sqlJoin, 0)) { + zephir_is_iterable(&sqlJoin, 0, "phalcon/mvc/model/query.zep", 1637); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&sqlJoin), _40$$26) + { + ZEPHIR_INIT_NVAR(&sqlJoinItem); + ZVAL_COPY(&sqlJoinItem, _40$$26); + zephir_array_append(&sqlJoins, &sqlJoinItem, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1635); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&sqlJoinItem); } else { - zephir_array_append(&sqlJoins, sqlJoin, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1638); + zephir_array_append(&sqlJoins, &sqlJoin, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1638); } } else { - ZEPHIR_INIT_NVAR(_47$$29); - zephir_create_array(_47$$29, 3, 0 TSRMLS_CC); - zephir_array_update_string(&_47$$29, SL("type"), &joinType, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_47$$29, SL("source"), &joinSource, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_48$$29); - array_init(_48$$29); - zephir_array_update_string(&_47$$29, SL("conditions"), &_48$$29, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, _47$$29, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1650); + ZEPHIR_INIT_NVAR(&_41$$29); + zephir_create_array(&_41$$29, 3, 0 TSRMLS_CC); + zephir_array_update_string(&_41$$29, SL("type"), &joinType, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_41$$29, SL("source"), &joinSource, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_42$$29); + array_init(&_42$$29); + zephir_array_update_string(&_41$$29, SL("conditions"), &_42$$29, PH_COPY | PH_SEPARATE); + zephir_array_append(&sqlJoins, &_41$$29, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1650); } } else { - ZEPHIR_INIT_NVAR(_49$$30); - zephir_create_array(_49$$30, 3, 0 TSRMLS_CC); - zephir_array_update_string(&_49$$30, SL("type"), &joinType, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_49$$30, SL("source"), &joinSource, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_50$$30); - zephir_create_array(_50$$30, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_50$$30, preCondition); - zephir_array_update_string(&_49$$30, SL("conditions"), &_50$$30, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlJoins, _49$$30, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1662); + ZEPHIR_INIT_NVAR(&_43$$30); + zephir_create_array(&_43$$30, 3, 0 TSRMLS_CC); + zephir_array_update_string(&_43$$30, SL("type"), &joinType, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_43$$30, SL("source"), &joinSource, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_44$$30); + zephir_create_array(&_44$$30, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_44$$30, &preCondition); + zephir_array_update_string(&_43$$30, SL("conditions"), &_44$$30, PH_COPY | PH_SEPARATE); + zephir_array_append(&sqlJoins, &_43$$30, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1662); } - } - } - RETURN_CCTOR(sqlJoins); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&joinModel); + ZEPHIR_INIT_NVAR(&joinAlias); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_25); + ZEPHIR_INIT_NVAR(&fromModelName); + RETURN_CCTOR(&sqlJoins); } @@ -2151,11 +2518,21 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getJoins) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getOrderClause) { - HashTable *_1; - HashPosition _0; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *order, *orderColumns = NULL, *orderParts = NULL, *orderItem = NULL, *orderPartExpr = NULL, *orderSort = NULL, *orderPartSort = NULL, **_2, *_3$$5, *_5$$7 = NULL, *_6$$8 = NULL; + zval *order, order_sub, orderColumns, orderParts, orderItem, orderPartExpr, orderSort, orderPartSort, *_0, _1$$5, _3$$7, _4$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&order_sub); + ZVAL_UNDEF(&orderColumns); + ZVAL_UNDEF(&orderParts); + ZVAL_UNDEF(&orderItem); + ZVAL_UNDEF(&orderPartExpr); + ZVAL_UNDEF(&orderSort); + ZVAL_UNDEF(&orderPartSort); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &order); @@ -2163,46 +2540,46 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getOrderClause) { if (!(zephir_array_isset_long(order, 0))) { - ZEPHIR_INIT_VAR(orderColumns); - zephir_create_array(orderColumns, 1, 0 TSRMLS_CC); - zephir_array_fast_append(orderColumns, order); + ZEPHIR_INIT_VAR(&orderColumns); + zephir_create_array(&orderColumns, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&orderColumns, order); } else { - ZEPHIR_CPY_WRT(orderColumns, order); - } - ZEPHIR_INIT_VAR(orderParts); - array_init(orderParts); - zephir_is_iterable(orderColumns, &_1, &_0, 0, 0, "phalcon/mvc/model/query.zep", 1708); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(orderItem, _2); - zephir_array_fetch_string(&_3$$5, orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 1690 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "_getexpression", &_4, 355, _3$$5); + ZEPHIR_CPY_WRT(&orderColumns, order); + } + ZEPHIR_INIT_VAR(&orderParts); + array_init(&orderParts); + zephir_is_iterable(&orderColumns, 0, "phalcon/mvc/model/query.zep", 1708); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&orderColumns), _0) + { + ZEPHIR_INIT_NVAR(&orderItem); + ZVAL_COPY(&orderItem, _0); + zephir_array_fetch_string(&_1$$5, &orderItem, SL("column"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 1690 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&orderPartExpr, this_ptr, "_getexpression", &_2, 313, &_1$$5); zephir_check_call_status(); - if (zephir_array_isset_string_fetch(&orderSort, orderItem, SS("sort"), 1 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(orderPartSort); - if (ZEPHIR_IS_LONG(orderSort, 327)) { - zephir_create_array(orderPartSort, 2, 0 TSRMLS_CC); - zephir_array_fast_append(orderPartSort, orderPartExpr); - ZEPHIR_INIT_NVAR(_5$$7); - ZVAL_STRING(_5$$7, "ASC", 1); - zephir_array_fast_append(orderPartSort, _5$$7); + if (zephir_array_isset_string_fetch(&orderSort, &orderItem, SL("sort"), 1)) { + ZEPHIR_INIT_NVAR(&orderPartSort); + if (ZEPHIR_IS_LONG(&orderSort, 327)) { + zephir_create_array(&orderPartSort, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&orderPartSort, &orderPartExpr); + ZEPHIR_INIT_NVAR(&_3$$7); + ZVAL_STRING(&_3$$7, "ASC"); + zephir_array_fast_append(&orderPartSort, &_3$$7); } else { - zephir_create_array(orderPartSort, 2, 0 TSRMLS_CC); - zephir_array_fast_append(orderPartSort, orderPartExpr); - ZEPHIR_INIT_NVAR(_6$$8); - ZVAL_STRING(_6$$8, "DESC", 1); - zephir_array_fast_append(orderPartSort, _6$$8); + zephir_create_array(&orderPartSort, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&orderPartSort, &orderPartExpr); + ZEPHIR_INIT_NVAR(&_4$$8); + ZVAL_STRING(&_4$$8, "DESC"); + zephir_array_fast_append(&orderPartSort, &_4$$8); } } else { - ZEPHIR_INIT_NVAR(orderPartSort); - zephir_create_array(orderPartSort, 1, 0 TSRMLS_CC); - zephir_array_fast_append(orderPartSort, orderPartExpr); + ZEPHIR_INIT_NVAR(&orderPartSort); + zephir_create_array(&orderPartSort, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&orderPartSort, &orderPartExpr); } - zephir_array_append(&orderParts, orderPartSort, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1705); - } - RETURN_CCTOR(orderParts); + zephir_array_append(&orderParts, &orderPartSort, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1705); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&orderItem); + RETURN_CCTOR(&orderParts); } @@ -2211,39 +2588,44 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getOrderClause) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getGroupClause) { - HashTable *_1$$3; - HashPosition _0$$3; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *group_param = NULL, *groupItem = NULL, *groupParts = NULL, **_2$$3, *_3$$4 = NULL, *_5$$5 = NULL; - zval *group = NULL; + zval *group_param = NULL, groupItem, groupParts, *_0$$3, _1$$4, _3$$5; + zval group; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&group); + ZVAL_UNDEF(&groupItem); + ZVAL_UNDEF(&groupParts); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_3$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &group_param); - group = group_param; + ZEPHIR_OBS_COPY_OR_DUP(&group, group_param); - ZEPHIR_INIT_VAR(groupParts); - if (zephir_array_isset_long(group, 0)) { - array_init(groupParts); - zephir_is_iterable(group, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/query.zep", 1726); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(groupItem, _2$$3); - ZEPHIR_CALL_METHOD(&_3$$4, this_ptr, "_getexpression", &_4, 355, groupItem); + ZEPHIR_INIT_VAR(&groupParts); + if (zephir_array_isset_long(&group, 0)) { + array_init(&groupParts); + zephir_is_iterable(&group, 0, "phalcon/mvc/model/query.zep", 1726); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&group), _0$$3) + { + ZEPHIR_INIT_NVAR(&groupItem); + ZVAL_COPY(&groupItem, _0$$3); + ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "_getexpression", &_2, 313, &groupItem); zephir_check_call_status(); - zephir_array_append(&groupParts, _3$$4, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1724); - } + zephir_array_append(&groupParts, &_1$$4, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1724); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&groupItem); } else { - zephir_create_array(groupParts, 1, 0 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_5$$5, this_ptr, "_getexpression", &_4, 355, group); + zephir_create_array(&groupParts, 1, 0 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_3$$5, this_ptr, "_getexpression", &_2, 313, &group); zephir_check_call_status(); - zephir_array_fast_append(groupParts, _5$$5); + zephir_array_fast_append(&groupParts, &_3$$5); } - RETURN_CCTOR(groupParts); + RETURN_CCTOR(&groupParts); } @@ -2253,30 +2635,38 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getGroupClause) { PHP_METHOD(Phalcon_Mvc_Model_Query, _getLimitClause) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *limitClause_param = NULL, *number = NULL, *offset = NULL, *_0$$3 = NULL, *_1$$4 = NULL; - zval *limitClause = NULL, *limit; + zval *limitClause_param = NULL, number, offset, _0$$3, _1$$4; + zval limitClause, limit; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&limitClause); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&number); + ZVAL_UNDEF(&offset); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &limitClause_param); - limitClause = limitClause_param; + ZEPHIR_OBS_COPY_OR_DUP(&limitClause, limitClause_param); - ZEPHIR_INIT_VAR(limit); - array_init(limit); - ZEPHIR_OBS_VAR(number); - if (zephir_array_isset_string_fetch(&number, limitClause, SS("number"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "_getexpression", NULL, 355, number); + ZEPHIR_INIT_VAR(&limit); + array_init(&limit); + ZEPHIR_OBS_VAR(&number); + if (zephir_array_isset_string_fetch(&number, &limitClause, SL("number"), 0)) { + ZEPHIR_CALL_METHOD(&_0$$3, this_ptr, "_getexpression", NULL, 313, &number); zephir_check_call_status(); zephir_array_update_string(&limit, SL("number"), &_0$$3, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(offset); - if (zephir_array_isset_string_fetch(&offset, limitClause, SS("offset"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "_getexpression", NULL, 355, offset); + ZEPHIR_OBS_VAR(&offset); + if (zephir_array_isset_string_fetch(&offset, &limitClause, SL("offset"), 0)) { + ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "_getexpression", NULL, 313, &offset); zephir_check_call_status(); zephir_array_update_string(&limit, SL("offset"), &_1$$4, PH_COPY | PH_SEPARATE); } - RETURN_CTOR(limit); + RETURN_CTOR(&limit); } @@ -2285,24 +2675,122 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _getLimitClause) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) { - zval *_25$$27 = NULL, *_26$$27 = NULL, *_27$$27 = NULL; - zval *_17$$27 = NULL, *_51$$47 = NULL; - HashTable *_1, *_42, *_14$$24, *_47$$41; - HashPosition _0, _41, _13$$24, _46$$41; - zephir_fcall_cache_entry *_5 = NULL, *_8 = NULL, *_12 = NULL, *_18 = NULL, *_20 = NULL, *_45 = NULL; + zval _21$$27, _22$$27, _23$$27; + zval _13$$27, _43$$47; + zephir_fcall_cache_entry *_3 = NULL, *_6 = NULL, *_10 = NULL, *_14 = NULL, *_16 = NULL, *_39 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, position = 0, number = 0; - zval *ast = NULL, *merge = NULL, *sqlModels = NULL, *sqlTables = NULL, *sqlAliases = NULL, *sqlColumns = NULL, *select = NULL, *tables = NULL, *columns = NULL, *sqlAliasesModels = NULL, *sqlModelsAliases = NULL, *sqlAliasesModelsInstances = NULL, *models = NULL, *modelsInstances = NULL, *selectedModels = NULL, *manager = NULL, *metaData = NULL, *selectedModel = NULL, *qualifiedName = NULL, *modelName = NULL, *nsAlias = NULL, *realModelName = NULL, *model = NULL, *schema = NULL, *source = NULL, *completeSource = NULL, *alias = NULL, *joins = NULL, *sqlJoins = NULL, *selectColumns = NULL, *sqlColumnAliases = NULL, *column = NULL, *sqlColumn = NULL, *sqlSelect = NULL, *distinct = NULL, *having = NULL, *where = NULL, *groupBy = NULL, *order = NULL, *limit = NULL, *tempModels = NULL, *tempModelsInstances = NULL, *tempSqlAliases = NULL, *tempSqlModelsAliases = NULL, *tempSqlAliasesModelsInstances = NULL, *tempSqlAliasesModels = NULL, *with = NULL, *withs = NULL, *withItem = NULL, *automaticJoins = NULL, *relation = NULL, *joinAlias = NULL, *relationModel = NULL, *bestAlias = NULL, *eagerType = NULL, **_2, **_43, *_3$$15 = NULL, *_4$$15, *_6$$15, *_7$$14 = NULL, *_9$$20 = NULL, *_10$$20, *_11$$20 = NULL, **_15$$24, _16$$27 = zval_used_for_init, *_19$$28 = NULL, *_21$$30 = NULL, *_22$$31 = NULL, *_23$$31, *_24$$31 = NULL, *_28$$33, *_29$$33, *_30$$33, *_31$$33, *_32$$33, *_33$$33, *_34$$33, *_35$$33, *_36$$33, *_37$$33, *_38$$33, *_39$$33, *_40$$36, *_44$$41 = NULL, **_48$$41, *_49$$46, _50$$47 = zval_used_for_init, *_52$$51 = NULL, *_53$$52 = NULL, *_54$$53 = NULL, *_55$$54 = NULL, *_56$$55 = NULL; + zval *ast = NULL, ast_sub, *merge = NULL, merge_sub, __$null, __$true, sqlModels, sqlTables, sqlAliases, sqlColumns, select, tables, columns, sqlAliasesModels, sqlModelsAliases, sqlAliasesModelsInstances, models, modelsInstances, selectedModels, manager, metaData, selectedModel, qualifiedName, modelName, nsAlias, realModelName, model, schema, source, completeSource, alias, joins, sqlJoins, selectColumns, sqlColumnAliases, column, sqlColumn, sqlSelect, distinct, having, where, groupBy, order, limit, tempModels, tempModelsInstances, tempSqlAliases, tempSqlModelsAliases, tempSqlAliasesModelsInstances, tempSqlAliasesModels, with, withs, withItem, automaticJoins, relation, joinAlias, relationModel, bestAlias, eagerType, *_0, *_37, _1$$15, _2$$15, _4$$15, _5$$14, _7$$20, _8$$20, _9$$20, *_11$$24, _12$$27, _15$$28, _17$$30, _18$$31, _19$$31, _20$$31, _24$$33, _25$$33, _26$$33, _27$$33, _28$$33, _29$$33, _30$$33, _31$$33, _32$$33, _33$$33, _34$$33, _35$$33, _36$$36, _38$$41, *_40$$41, _41$$46, _42$$47, _44$$51, _45$$52, _46$$53, _47$$54, _48$$55; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&ast_sub); + ZVAL_UNDEF(&merge_sub); + ZVAL_NULL(&__$null); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&sqlModels); + ZVAL_UNDEF(&sqlTables); + ZVAL_UNDEF(&sqlAliases); + ZVAL_UNDEF(&sqlColumns); + ZVAL_UNDEF(&select); + ZVAL_UNDEF(&tables); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&sqlAliasesModels); + ZVAL_UNDEF(&sqlModelsAliases); + ZVAL_UNDEF(&sqlAliasesModelsInstances); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(&modelsInstances); + ZVAL_UNDEF(&selectedModels); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&selectedModel); + ZVAL_UNDEF(&qualifiedName); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&nsAlias); + ZVAL_UNDEF(&realModelName); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&completeSource); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&joins); + ZVAL_UNDEF(&sqlJoins); + ZVAL_UNDEF(&selectColumns); + ZVAL_UNDEF(&sqlColumnAliases); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&sqlColumn); + ZVAL_UNDEF(&sqlSelect); + ZVAL_UNDEF(&distinct); + ZVAL_UNDEF(&having); + ZVAL_UNDEF(&where); + ZVAL_UNDEF(&groupBy); + ZVAL_UNDEF(&order); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&tempModels); + ZVAL_UNDEF(&tempModelsInstances); + ZVAL_UNDEF(&tempSqlAliases); + ZVAL_UNDEF(&tempSqlModelsAliases); + ZVAL_UNDEF(&tempSqlAliasesModelsInstances); + ZVAL_UNDEF(&tempSqlAliasesModels); + ZVAL_UNDEF(&with); + ZVAL_UNDEF(&withs); + ZVAL_UNDEF(&withItem); + ZVAL_UNDEF(&automaticJoins); + ZVAL_UNDEF(&relation); + ZVAL_UNDEF(&joinAlias); + ZVAL_UNDEF(&relationModel); + ZVAL_UNDEF(&bestAlias); + ZVAL_UNDEF(&eagerType); + ZVAL_UNDEF(&_1$$15); + ZVAL_UNDEF(&_2$$15); + ZVAL_UNDEF(&_4$$15); + ZVAL_UNDEF(&_5$$14); + ZVAL_UNDEF(&_7$$20); + ZVAL_UNDEF(&_8$$20); + ZVAL_UNDEF(&_9$$20); + ZVAL_UNDEF(&_12$$27); + ZVAL_UNDEF(&_15$$28); + ZVAL_UNDEF(&_17$$30); + ZVAL_UNDEF(&_18$$31); + ZVAL_UNDEF(&_19$$31); + ZVAL_UNDEF(&_20$$31); + ZVAL_UNDEF(&_24$$33); + ZVAL_UNDEF(&_25$$33); + ZVAL_UNDEF(&_26$$33); + ZVAL_UNDEF(&_27$$33); + ZVAL_UNDEF(&_28$$33); + ZVAL_UNDEF(&_29$$33); + ZVAL_UNDEF(&_30$$33); + ZVAL_UNDEF(&_31$$33); + ZVAL_UNDEF(&_32$$33); + ZVAL_UNDEF(&_33$$33); + ZVAL_UNDEF(&_34$$33); + ZVAL_UNDEF(&_35$$33); + ZVAL_UNDEF(&_36$$36); + ZVAL_UNDEF(&_38$$41); + ZVAL_UNDEF(&_41$$46); + ZVAL_UNDEF(&_42$$47); + ZVAL_UNDEF(&_44$$51); + ZVAL_UNDEF(&_45$$52); + ZVAL_UNDEF(&_46$$53); + ZVAL_UNDEF(&_47$$54); + ZVAL_UNDEF(&_48$$55); + ZVAL_UNDEF(&_13$$27); + ZVAL_UNDEF(&_43$$47); + ZVAL_UNDEF(&_21$$27); + ZVAL_UNDEF(&_22$$27); + ZVAL_UNDEF(&_23$$27); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &ast, &merge); if (!ast) { - ZEPHIR_CPY_WRT(ast, ZEPHIR_GLOBAL(global_null)); + ast = &ast_sub; + ZEPHIR_CPY_WRT(ast, &__$null); } else { ZEPHIR_SEPARATE_PARAM(ast); } if (!merge) { - ZEPHIR_CPY_WRT(merge, ZEPHIR_GLOBAL(global_null)); + merge = &merge_sub; + ZEPHIR_CPY_WRT(merge, &__$null); } else { ZEPHIR_SEPARATE_PARAM(merge); } @@ -2310,404 +2798,401 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) { if (ZEPHIR_IS_EMPTY(ast)) { ZEPHIR_OBS_NVAR(ast); - zephir_read_property_this(&ast, this_ptr, SL("_ast"), PH_NOISY_CC); + zephir_read_property(ast, this_ptr, SL("_ast"), PH_NOISY_CC); } if (Z_TYPE_P(merge) == IS_NULL) { ZEPHIR_INIT_NVAR(merge); ZVAL_BOOL(merge, 0); } - ZEPHIR_OBS_VAR(select); - if (!(zephir_array_isset_string_fetch(&select, ast, SS("select"), 0 TSRMLS_CC))) { - ZEPHIR_CPY_WRT(select, ast); + ZEPHIR_OBS_VAR(&select); + if (!(zephir_array_isset_string_fetch(&select, ast, SL("select"), 0))) { + ZEPHIR_CPY_WRT(&select, ast); } - ZEPHIR_OBS_VAR(tables); - if (!(zephir_array_isset_string_fetch(&tables, select, SS("tables"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&tables); + if (!(zephir_array_isset_string_fetch(&tables, &select, SL("tables"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/mvc/model/query.zep", 1781); return; } - ZEPHIR_OBS_VAR(columns); - if (!(zephir_array_isset_string_fetch(&columns, select, SS("columns"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&columns); + if (!(zephir_array_isset_string_fetch(&columns, &select, SL("columns"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted SELECT AST", "phalcon/mvc/model/query.zep", 1785); return; } - ZEPHIR_INIT_VAR(sqlModels); - array_init(sqlModels); - ZEPHIR_INIT_VAR(sqlTables); - array_init(sqlTables); - ZEPHIR_INIT_VAR(sqlColumns); - array_init(sqlColumns); - ZEPHIR_INIT_VAR(sqlAliases); - array_init(sqlAliases); - ZEPHIR_INIT_VAR(sqlAliasesModels); - array_init(sqlAliasesModels); - ZEPHIR_INIT_VAR(sqlModelsAliases); - array_init(sqlModelsAliases); - ZEPHIR_INIT_VAR(sqlAliasesModelsInstances); - array_init(sqlAliasesModelsInstances); - ZEPHIR_INIT_VAR(models); - array_init(models); - ZEPHIR_INIT_VAR(modelsInstances); - array_init(modelsInstances); - if (!(zephir_array_isset_long(tables, 0))) { - ZEPHIR_INIT_VAR(selectedModels); - zephir_create_array(selectedModels, 1, 0 TSRMLS_CC); - zephir_array_fast_append(selectedModels, tables); + ZEPHIR_INIT_VAR(&sqlModels); + array_init(&sqlModels); + ZEPHIR_INIT_VAR(&sqlTables); + array_init(&sqlTables); + ZEPHIR_INIT_VAR(&sqlColumns); + array_init(&sqlColumns); + ZEPHIR_INIT_VAR(&sqlAliases); + array_init(&sqlAliases); + ZEPHIR_INIT_VAR(&sqlAliasesModels); + array_init(&sqlAliasesModels); + ZEPHIR_INIT_VAR(&sqlModelsAliases); + array_init(&sqlModelsAliases); + ZEPHIR_INIT_VAR(&sqlAliasesModelsInstances); + array_init(&sqlAliasesModelsInstances); + ZEPHIR_INIT_VAR(&models); + array_init(&models); + ZEPHIR_INIT_VAR(&modelsInstances); + array_init(&modelsInstances); + if (!(zephir_array_isset_long(&tables, 0))) { + ZEPHIR_INIT_VAR(&selectedModels); + zephir_create_array(&selectedModels, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&selectedModels, &tables); } else { - ZEPHIR_CPY_WRT(selectedModels, tables); + ZEPHIR_CPY_WRT(&selectedModels, &tables); } - if (!(zephir_array_isset_long(columns, 0))) { - ZEPHIR_INIT_VAR(selectColumns); - zephir_create_array(selectColumns, 1, 0 TSRMLS_CC); - zephir_array_fast_append(selectColumns, columns); + if (!(zephir_array_isset_long(&columns, 0))) { + ZEPHIR_INIT_VAR(&selectColumns); + zephir_create_array(&selectColumns, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&selectColumns, &columns); } else { - ZEPHIR_CPY_WRT(selectColumns, columns); + ZEPHIR_CPY_WRT(&selectColumns, &columns); } - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(metaData); - zephir_read_property_this(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); - if (Z_TYPE_P(manager) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&metaData); + zephir_read_property(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); + if (Z_TYPE_P(&manager) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A models-manager is required to execute the query", "phalcon/mvc/model/query.zep", 1847); return; } - if (Z_TYPE_P(metaData) != IS_OBJECT) { + if (Z_TYPE_P(&metaData) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A meta-data is required to execute the query", "phalcon/mvc/model/query.zep", 1851); return; } number = 0; - ZEPHIR_INIT_VAR(automaticJoins); - array_init(automaticJoins); - zephir_is_iterable(selectedModels, &_1, &_0, 0, 0, "phalcon/mvc/model/query.zep", 1980); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(selectedModel, _2); - ZEPHIR_OBS_NVAR(qualifiedName); - zephir_array_fetch_string(&qualifiedName, selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/mvc/model/query.zep", 1860 TSRMLS_CC); - ZEPHIR_OBS_NVAR(modelName); - zephir_array_fetch_string(&modelName, qualifiedName, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 1861 TSRMLS_CC); - if (zephir_memnstr_str(modelName, SL(":"), "phalcon/mvc/model/query.zep", 1864)) { - ZEPHIR_INIT_NVAR(nsAlias); - zephir_fast_explode_str(nsAlias, SL(":"), modelName, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&_4$$15, nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 1866 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_3$$15, manager, "getnamespacealias", &_5, 0, _4$$15); + ZEPHIR_INIT_VAR(&automaticJoins); + array_init(&automaticJoins); + zephir_is_iterable(&selectedModels, 0, "phalcon/mvc/model/query.zep", 1980); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectedModels), _0) + { + ZEPHIR_INIT_NVAR(&selectedModel); + ZVAL_COPY(&selectedModel, _0); + ZEPHIR_OBS_NVAR(&qualifiedName); + zephir_array_fetch_string(&qualifiedName, &selectedModel, SL("qualifiedName"), PH_NOISY, "phalcon/mvc/model/query.zep", 1860 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&modelName); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 1861 TSRMLS_CC); + if (zephir_memnstr_str(&modelName, SL(":"), "phalcon/mvc/model/query.zep", 1864)) { + ZEPHIR_INIT_NVAR(&nsAlias); + zephir_fast_explode_str(&nsAlias, SL(":"), &modelName, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&_2$$15, &nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 1866 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_1$$15, &manager, "getnamespacealias", &_3, 0, &_2$$15); zephir_check_call_status(); - zephir_array_fetch_long(&_6$$15, nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 1866 TSRMLS_CC); - ZEPHIR_INIT_NVAR(realModelName); - ZEPHIR_CONCAT_VSV(realModelName, _3$$15, "\\", _6$$15); + zephir_array_fetch_long(&_4$$15, &nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 1866 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&realModelName); + ZEPHIR_CONCAT_VSV(&realModelName, &_1$$15, "\\", &_4$$15); } else { - ZEPHIR_CPY_WRT(realModelName, modelName); + ZEPHIR_CPY_WRT(&realModelName, &modelName); } - ZEPHIR_INIT_NVAR(_7$$14); - ZVAL_BOOL(_7$$14, 1); - ZEPHIR_CALL_METHOD(&model, manager, "load", &_8, 0, realModelName, _7$$14); + ZVAL_BOOL(&_5$$14, 1); + ZEPHIR_CALL_METHOD(&model, &manager, "load", &_6, 0, &realModelName, &_5$$14); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&schema, model, "getschema", NULL, 0); + ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, model, "getsource", NULL, 0); + ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(schema)) { - ZEPHIR_INIT_NVAR(completeSource); - zephir_create_array(completeSource, 2, 0 TSRMLS_CC); - zephir_array_fast_append(completeSource, source); - zephir_array_fast_append(completeSource, schema); + if (zephir_is_true(&schema)) { + ZEPHIR_INIT_NVAR(&completeSource); + zephir_create_array(&completeSource, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&completeSource, &source); + zephir_array_fast_append(&completeSource, &schema); } else { - ZEPHIR_CPY_WRT(completeSource, source); + ZEPHIR_CPY_WRT(&completeSource, &source); } - ZEPHIR_OBS_NVAR(alias); - if (zephir_array_isset_string_fetch(&alias, selectedModel, SS("alias"), 0 TSRMLS_CC)) { - if (zephir_array_isset(sqlAliases, alias)) { - ZEPHIR_INIT_NVAR(_9$$20); - object_init_ex(_9$$20, phalcon_mvc_model_exception_ce); - _10$$20 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_LNVAR(_11$$20); - ZEPHIR_CONCAT_SVSV(_11$$20, "Alias '", alias, "' is used more than once, when preparing: ", _10$$20); - ZEPHIR_CALL_METHOD(NULL, _9$$20, "__construct", &_12, 9, _11$$20); + ZEPHIR_OBS_NVAR(&alias); + if (zephir_array_isset_string_fetch(&alias, &selectedModel, SL("alias"), 0)) { + if (zephir_array_isset(&sqlAliases, &alias)) { + ZEPHIR_INIT_NVAR(&_7$$20); + object_init_ex(&_7$$20, phalcon_mvc_model_exception_ce); + zephir_read_property(&_8$$20, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_LNVAR(_9$$20); + ZEPHIR_CONCAT_SVSV(&_9$$20, "Alias '", &alias, "' is used more than once, when preparing: ", &_8$$20); + ZEPHIR_CALL_METHOD(NULL, &_7$$20, "__construct", &_10, 4, &_9$$20); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$20, "phalcon/mvc/model/query.zep", 1890 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$20, "phalcon/mvc/model/query.zep", 1890 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_array_update_zval(&sqlAliases, alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModels, alias, &realModelName, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlModelsAliases, realModelName, &alias, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModelsInstances, alias, &model, PH_COPY | PH_SEPARATE); - if (Z_TYPE_P(completeSource) == IS_ARRAY) { - zephir_array_append(&completeSource, alias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1902); + zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModels, &alias, &realModelName, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlModelsAliases, &realModelName, &alias, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&completeSource) == IS_ARRAY) { + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1902); } else { - ZEPHIR_INIT_NVAR(completeSource); - zephir_create_array(completeSource, 3, 0 TSRMLS_CC); - zephir_array_fast_append(completeSource, source); - zephir_array_fast_append(completeSource, ZEPHIR_GLOBAL(global_null)); - zephir_array_fast_append(completeSource, alias); + ZEPHIR_INIT_NVAR(&completeSource); + zephir_create_array(&completeSource, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&completeSource, &source); + zephir_array_fast_append(&completeSource, &__$null); + zephir_array_fast_append(&completeSource, &alias); } - zephir_array_update_zval(&models, realModelName, &alias, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&models, &realModelName, &alias, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_CPY_WRT(alias, source); - zephir_array_update_zval(&sqlAliases, realModelName, &source, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModels, realModelName, &realModelName, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlModelsAliases, realModelName, &realModelName, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModelsInstances, realModelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&models, realModelName, &source, PH_COPY | PH_SEPARATE); + ZEPHIR_CPY_WRT(&alias, &source); + zephir_array_update_zval(&sqlAliases, &realModelName, &source, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModels, &realModelName, &realModelName, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlModelsAliases, &realModelName, &realModelName, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModelsInstances, &realModelName, &model, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&models, &realModelName, &source, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_NVAR(with); - if (zephir_array_isset_string_fetch(&with, selectedModel, SS("with"), 0 TSRMLS_CC)) { - if (!(zephir_array_isset_long(with, 0))) { - ZEPHIR_INIT_NVAR(withs); - zephir_create_array(withs, 1, 0 TSRMLS_CC); - zephir_array_fast_append(withs, with); + ZEPHIR_OBS_NVAR(&with); + if (zephir_array_isset_string_fetch(&with, &selectedModel, SL("with"), 0)) { + if (!(zephir_array_isset_long(&with, 0))) { + ZEPHIR_INIT_NVAR(&withs); + zephir_create_array(&withs, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&withs, &with); } else { - ZEPHIR_CPY_WRT(withs, with); + ZEPHIR_CPY_WRT(&withs, &with); } - zephir_is_iterable(withs, &_14$$24, &_13$$24, 0, 0, "phalcon/mvc/model/query.zep", 1972); - for ( - ; zend_hash_get_current_data_ex(_14$$24, (void**) &_15$$24, &_13$$24) == SUCCESS - ; zend_hash_move_forward_ex(_14$$24, &_13$$24) - ) { - ZEPHIR_GET_HVALUE(withItem, _15$$24); - ZEPHIR_SINIT_NVAR(_16$$27); - ZVAL_LONG(&_16$$27, number); - ZEPHIR_INIT_LNVAR(_17$$27); - ZEPHIR_CONCAT_SV(_17$$27, "AA", &_16$$27); - ZEPHIR_CPY_WRT(joinAlias, _17$$27); - ZEPHIR_OBS_NVAR(relationModel); - zephir_array_fetch_string(&relationModel, withItem, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 1930 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&relation, manager, "getrelationbyalias", &_18, 0, realModelName, relationModel); + zephir_is_iterable(&withs, 0, "phalcon/mvc/model/query.zep", 1972); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&withs), _11$$24) + { + ZEPHIR_INIT_NVAR(&withItem); + ZVAL_COPY(&withItem, _11$$24); + ZEPHIR_SINIT_NVAR(_12$$27); + ZVAL_LONG(&_12$$27, number); + ZEPHIR_INIT_LNVAR(_13$$27); + ZEPHIR_CONCAT_SV(&_13$$27, "AA", &_12$$27); + ZEPHIR_CPY_WRT(&joinAlias, &_13$$27); + ZEPHIR_OBS_NVAR(&relationModel); + zephir_array_fetch_string(&relationModel, &withItem, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 1930 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationbyalias", &_14, 0, &realModelName, &relationModel); zephir_check_call_status(); - if (Z_TYPE_P(relation) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_19$$28); - ZVAL_STRING(_19$$28, "alias", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&bestAlias, relation, "getoption", NULL, 0, _19$$28); - zephir_check_temp_parameter(_19$$28); + if (Z_TYPE_P(&relation) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_15$$28); + ZVAL_STRING(&_15$$28, "alias"); + ZEPHIR_CALL_METHOD(&bestAlias, &relation, "getoption", NULL, 0, &_15$$28); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&relationModel, relation, "getreferencedmodel", NULL, 0); + ZEPHIR_CALL_METHOD(&relationModel, &relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&eagerType, relation, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(&eagerType, &relation, "gettype", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&relation, manager, "getrelationsbetween", &_20, 0, realModelName, relationModel); + ZEPHIR_CALL_METHOD(&relation, &manager, "getrelationsbetween", &_16, 0, &realModelName, &relationModel); zephir_check_call_status(); - if (Z_TYPE_P(relation) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_21$$30); - ZVAL_STRING(_21$$30, "alias", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&bestAlias, relation, "getoption", NULL, 0, _21$$30); - zephir_check_temp_parameter(_21$$30); + if (Z_TYPE_P(&relation) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_17$$30); + ZVAL_STRING(&_17$$30, "alias"); + ZEPHIR_CALL_METHOD(&bestAlias, &relation, "getoption", NULL, 0, &_17$$30); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&relationModel, relation, "getreferencedmodel", NULL, 0); + ZEPHIR_CALL_METHOD(&relationModel, &relation, "getreferencedmodel", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&eagerType, relation, "gettype", NULL, 0); + ZEPHIR_CALL_METHOD(&eagerType, &relation, "gettype", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(_22$$31); - object_init_ex(_22$$31, phalcon_mvc_model_exception_ce); - _23$$31 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_LNVAR(_24$$31); - ZEPHIR_CONCAT_SVSVSV(_24$$31, "Can't find a relationship between '", realModelName, "' and '", relationModel, "' when preparing: ", _23$$31); - ZEPHIR_CALL_METHOD(NULL, _22$$31, "__construct", &_12, 9, _24$$31); + ZEPHIR_INIT_NVAR(&_18$$31); + object_init_ex(&_18$$31, phalcon_mvc_model_exception_ce); + zephir_read_property(&_19$$31, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_LNVAR(_20$$31); + ZEPHIR_CONCAT_SVSVSV(&_20$$31, "Can't find a relationship between '", &realModelName, "' and '", &relationModel, "' when preparing: ", &_19$$31); + ZEPHIR_CALL_METHOD(NULL, &_18$$31, "__construct", &_10, 4, &_20$$31); zephir_check_call_status(); - zephir_throw_exception_debug(_22$$31, "phalcon/mvc/model/query.zep", 1946 TSRMLS_CC); + zephir_throw_exception_debug(&_18$$31, "phalcon/mvc/model/query.zep", 1946 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - ZEPHIR_INIT_NVAR(_25$$27); - zephir_create_array(_25$$27, 5, 0 TSRMLS_CC); - add_assoc_long_ex(_25$$27, SS("type"), 353); - zephir_array_update_string(&_25$$27, SL("column"), &joinAlias, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_25$$27, SL("eager"), &alias, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_25$$27, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_25$$27, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); - zephir_array_append(&selectColumns, _25$$27, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1956); - ZEPHIR_INIT_NVAR(_26$$27); - zephir_create_array(_26$$27, 3, 0 TSRMLS_CC); - add_assoc_long_ex(_26$$27, SS("type"), 360); - ZEPHIR_INIT_NVAR(_27$$27); - zephir_create_array(_27$$27, 2, 0 TSRMLS_CC); - add_assoc_long_ex(_27$$27, SS("type"), 355); - zephir_array_update_string(&_27$$27, SL("name"), &relationModel, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_26$$27, SL("qualified"), &_27$$27, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_27$$27); - zephir_create_array(_27$$27, 2, 0 TSRMLS_CC); - add_assoc_long_ex(_27$$27, SS("type"), 355); - zephir_array_update_string(&_27$$27, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_26$$27, SL("alias"), &_27$$27, PH_COPY | PH_SEPARATE); - zephir_array_append(&automaticJoins, _26$$27, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1968); + ZEPHIR_INIT_NVAR(&_21$$27); + zephir_create_array(&_21$$27, 5, 0 TSRMLS_CC); + add_assoc_long_ex(&_21$$27, SL("type"), 353); + zephir_array_update_string(&_21$$27, SL("column"), &joinAlias, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_21$$27, SL("eager"), &alias, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_21$$27, SL("eagerType"), &eagerType, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_21$$27, SL("balias"), &bestAlias, PH_COPY | PH_SEPARATE); + zephir_array_append(&selectColumns, &_21$$27, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1956); + ZEPHIR_INIT_NVAR(&_22$$27); + zephir_create_array(&_22$$27, 3, 0 TSRMLS_CC); + add_assoc_long_ex(&_22$$27, SL("type"), 360); + ZEPHIR_INIT_NVAR(&_23$$27); + zephir_create_array(&_23$$27, 2, 0 TSRMLS_CC); + add_assoc_long_ex(&_23$$27, SL("type"), 355); + zephir_array_update_string(&_23$$27, SL("name"), &relationModel, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_22$$27, SL("qualified"), &_23$$27, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_23$$27); + zephir_create_array(&_23$$27, 2, 0 TSRMLS_CC); + add_assoc_long_ex(&_23$$27, SL("type"), 355); + zephir_array_update_string(&_23$$27, SL("name"), &joinAlias, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_22$$27, SL("alias"), &_23$$27, PH_COPY | PH_SEPARATE); + zephir_array_append(&automaticJoins, &_22$$27, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1968); number++; - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&withItem); } - zephir_array_append(&sqlModels, realModelName, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1974); - zephir_array_append(&sqlTables, completeSource, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1975); - zephir_array_update_zval(&modelsInstances, realModelName, &model, PH_COPY | PH_SEPARATE); - } + zephir_array_append(&sqlModels, &realModelName, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1974); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/mvc/model/query.zep", 1975); + zephir_array_update_zval(&modelsInstances, &realModelName, &model, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&selectedModel); if (!(zephir_is_true(merge))) { - zephir_update_property_this(getThis(), SL("_models"), models TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_modelsInstances"), modelsInstances TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliases"), sqlAliases TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModels"), sqlAliasesModels TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlModelsAliases"), sqlModelsAliases TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModelsInstances"), sqlAliasesModelsInstances TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_models"), &models); + zephir_update_property_zval(this_ptr, SL("_modelsInstances"), &modelsInstances); + zephir_update_property_zval(this_ptr, SL("_sqlAliases"), &sqlAliases); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModels"), &sqlAliasesModels); + zephir_update_property_zval(this_ptr, SL("_sqlModelsAliases"), &sqlModelsAliases); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModelsInstances"), &sqlAliasesModelsInstances); } else { - ZEPHIR_OBS_VAR(tempModels); - zephir_read_property_this(&tempModels, this_ptr, SL("_models"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(tempModelsInstances); - zephir_read_property_this(&tempModelsInstances, this_ptr, SL("_modelsInstances"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(tempSqlAliases); - zephir_read_property_this(&tempSqlAliases, this_ptr, SL("_sqlAliases"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(tempSqlAliasesModels); - zephir_read_property_this(&tempSqlAliasesModels, this_ptr, SL("_sqlAliasesModels"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(tempSqlModelsAliases); - zephir_read_property_this(&tempSqlModelsAliases, this_ptr, SL("_sqlModelsAliases"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(tempSqlAliasesModelsInstances); - zephir_read_property_this(&tempSqlAliasesModelsInstances, this_ptr, SL("_sqlAliasesModelsInstances"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_28$$33); - _29$$33 = zephir_fetch_nproperty_this(this_ptr, SL("_models"), PH_NOISY_CC); - zephir_fast_array_merge(_28$$33, &(_29$$33), &(models) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_models"), _28$$33 TSRMLS_CC); - ZEPHIR_INIT_VAR(_30$$33); - _31$$33 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsInstances"), PH_NOISY_CC); - zephir_fast_array_merge(_30$$33, &(_31$$33), &(modelsInstances) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_modelsInstances"), _30$$33 TSRMLS_CC); - ZEPHIR_INIT_VAR(_32$$33); - _33$$33 = zephir_fetch_nproperty_this(this_ptr, SL("_sqlAliases"), PH_NOISY_CC); - zephir_fast_array_merge(_32$$33, &(_33$$33), &(sqlAliases) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliases"), _32$$33 TSRMLS_CC); - ZEPHIR_INIT_VAR(_34$$33); - _35$$33 = zephir_fetch_nproperty_this(this_ptr, SL("_sqlAliasesModels"), PH_NOISY_CC); - zephir_fast_array_merge(_34$$33, &(_35$$33), &(sqlAliasesModels) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModels"), _34$$33 TSRMLS_CC); - ZEPHIR_INIT_VAR(_36$$33); - _37$$33 = zephir_fetch_nproperty_this(this_ptr, SL("_sqlModelsAliases"), PH_NOISY_CC); - zephir_fast_array_merge(_36$$33, &(_37$$33), &(sqlModelsAliases) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlModelsAliases"), _36$$33 TSRMLS_CC); - ZEPHIR_INIT_VAR(_38$$33); - _39$$33 = zephir_fetch_nproperty_this(this_ptr, SL("_sqlAliasesModelsInstances"), PH_NOISY_CC); - zephir_fast_array_merge(_38$$33, &(_39$$33), &(sqlAliasesModelsInstances) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModelsInstances"), _38$$33 TSRMLS_CC); - } - ZEPHIR_OBS_VAR(joins); - zephir_array_isset_string_fetch(&joins, select, SS("joins"), 0 TSRMLS_CC); - if (zephir_fast_count_int(joins TSRMLS_CC)) { - if (zephir_fast_count_int(automaticJoins TSRMLS_CC)) { - if (zephir_array_isset_long(joins, 0)) { - ZEPHIR_INIT_VAR(_40$$36); - zephir_fast_array_merge(_40$$36, &(joins), &(automaticJoins) TSRMLS_CC); - zephir_array_update_string(&select, SL("joins"), &_40$$36, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_VAR(&tempModels); + zephir_read_property(&tempModels, this_ptr, SL("_models"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&tempModelsInstances); + zephir_read_property(&tempModelsInstances, this_ptr, SL("_modelsInstances"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&tempSqlAliases); + zephir_read_property(&tempSqlAliases, this_ptr, SL("_sqlAliases"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&tempSqlAliasesModels); + zephir_read_property(&tempSqlAliasesModels, this_ptr, SL("_sqlAliasesModels"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&tempSqlModelsAliases); + zephir_read_property(&tempSqlModelsAliases, this_ptr, SL("_sqlModelsAliases"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&tempSqlAliasesModelsInstances); + zephir_read_property(&tempSqlAliasesModelsInstances, this_ptr, SL("_sqlAliasesModelsInstances"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_24$$33); + zephir_read_property(&_25$$33, this_ptr, SL("_models"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_24$$33, &_25$$33, &models TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_models"), &_24$$33); + ZEPHIR_INIT_VAR(&_26$$33); + zephir_read_property(&_27$$33, this_ptr, SL("_modelsInstances"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_26$$33, &_27$$33, &modelsInstances TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_modelsInstances"), &_26$$33); + ZEPHIR_INIT_VAR(&_28$$33); + zephir_read_property(&_29$$33, this_ptr, SL("_sqlAliases"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_28$$33, &_29$$33, &sqlAliases TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sqlAliases"), &_28$$33); + ZEPHIR_INIT_VAR(&_30$$33); + zephir_read_property(&_31$$33, this_ptr, SL("_sqlAliasesModels"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_30$$33, &_31$$33, &sqlAliasesModels TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModels"), &_30$$33); + ZEPHIR_INIT_VAR(&_32$$33); + zephir_read_property(&_33$$33, this_ptr, SL("_sqlModelsAliases"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_32$$33, &_33$$33, &sqlModelsAliases TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sqlModelsAliases"), &_32$$33); + ZEPHIR_INIT_VAR(&_34$$33); + zephir_read_property(&_35$$33, this_ptr, SL("_sqlAliasesModelsInstances"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_34$$33, &_35$$33, &sqlAliasesModelsInstances TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModelsInstances"), &_34$$33); + } + ZEPHIR_OBS_VAR(&joins); + zephir_array_isset_string_fetch(&joins, &select, SL("joins"), 0); + if (zephir_fast_count_int(&joins TSRMLS_CC)) { + if (zephir_fast_count_int(&automaticJoins TSRMLS_CC)) { + if (zephir_array_isset_long(&joins, 0)) { + ZEPHIR_INIT_VAR(&_36$$36); + zephir_fast_array_merge(&_36$$36, &joins, &automaticJoins TSRMLS_CC); + zephir_array_update_string(&select, SL("joins"), &_36$$36, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&automaticJoins, joins, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2012); + zephir_array_append(&automaticJoins, &joins, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2012); zephir_array_update_string(&select, SL("joins"), &automaticJoins, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "_getjoins", NULL, 365, select); + ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "_getjoins", NULL, 323, &select); zephir_check_call_status(); } else { - if (zephir_fast_count_int(automaticJoins TSRMLS_CC)) { + if (zephir_fast_count_int(&automaticJoins TSRMLS_CC)) { zephir_array_update_string(&select, SL("joins"), &automaticJoins, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "_getjoins", NULL, 365, select); + ZEPHIR_CALL_METHOD(&sqlJoins, this_ptr, "_getjoins", NULL, 323, &select); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(sqlJoins); - array_init(sqlJoins); + ZEPHIR_INIT_NVAR(&sqlJoins); + array_init(&sqlJoins); } } position = 0; - ZEPHIR_INIT_VAR(sqlColumnAliases); - array_init(sqlColumnAliases); - zephir_is_iterable(selectColumns, &_42, &_41, 0, 0, "phalcon/mvc/model/query.zep", 2065); - for ( - ; zend_hash_get_current_data_ex(_42, (void**) &_43, &_41) == SUCCESS - ; zend_hash_move_forward_ex(_42, &_41) - ) { - ZEPHIR_GET_HVALUE(column, _43); - ZEPHIR_CALL_METHOD(&_44$$41, this_ptr, "_getselectcolumn", &_45, 366, column); + ZEPHIR_INIT_VAR(&sqlColumnAliases); + array_init(&sqlColumnAliases); + zephir_is_iterable(&selectColumns, 0, "phalcon/mvc/model/query.zep", 2065); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&selectColumns), _37) + { + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _37); + ZEPHIR_CALL_METHOD(&_38$$41, this_ptr, "_getselectcolumn", &_39, 324, &column); zephir_check_call_status(); - zephir_is_iterable(_44$$41, &_47$$41, &_46$$41, 0, 0, "phalcon/mvc/model/query.zep", 2064); - for ( - ; zend_hash_get_current_data_ex(_47$$41, (void**) &_48$$41, &_46$$41) == SUCCESS - ; zend_hash_move_forward_ex(_47$$41, &_46$$41) - ) { - ZEPHIR_GET_HVALUE(sqlColumn, _48$$41); - ZEPHIR_OBS_NVAR(alias); - if (zephir_array_isset_string_fetch(&alias, column, SS("alias"), 0 TSRMLS_CC)) { + zephir_is_iterable(&_38$$41, 0, "phalcon/mvc/model/query.zep", 2064); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_38$$41), _40$$41) + { + ZEPHIR_INIT_NVAR(&sqlColumn); + ZVAL_COPY(&sqlColumn, _40$$41); + ZEPHIR_OBS_NVAR(&alias); + if (zephir_array_isset_string_fetch(&alias, &column, SL("alias"), 0)) { zephir_array_update_string(&sqlColumn, SL("balias"), &alias, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlColumn, SL("sqlAlias"), &alias, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlColumns, alias, &sqlColumn, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlColumnAliases, alias, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlColumnAliases, &alias, &__$true, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_OBS_NVAR(alias); - if (zephir_array_isset_string_fetch(&alias, sqlColumn, SS("balias"), 0 TSRMLS_CC)) { - zephir_array_update_zval(&sqlColumns, alias, &sqlColumn, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&alias); + if (zephir_array_isset_string_fetch(&alias, &sqlColumn, SL("balias"), 0)) { + zephir_array_update_zval(&sqlColumns, &alias, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_fetch_string(&_49$$46, sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2054 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_49$$46, "scalar")) { - ZEPHIR_SINIT_NVAR(_50$$47); - ZVAL_LONG(&_50$$47, position); - ZEPHIR_INIT_LNVAR(_51$$47); - ZEPHIR_CONCAT_SV(_51$$47, "_", &_50$$47); - zephir_array_update_zval(&sqlColumns, _51$$47, &sqlColumn, PH_COPY | PH_SEPARATE); + zephir_array_fetch_string(&_41$$46, &sqlColumn, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2054 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_41$$46, "scalar")) { + ZEPHIR_SINIT_NVAR(_42$$47); + ZVAL_LONG(&_42$$47, position); + ZEPHIR_INIT_LNVAR(_43$$47); + ZEPHIR_CONCAT_SV(&_43$$47, "_", &_42$$47); + zephir_array_update_zval(&sqlColumns, &_43$$47, &sqlColumn, PH_COPY | PH_SEPARATE); } else { - zephir_array_append(&sqlColumns, sqlColumn, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2057); + zephir_array_append(&sqlColumns, &sqlColumn, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2057); } } } position++; - } - } - zephir_update_property_this(getThis(), SL("_sqlColumnAliases"), sqlColumnAliases TSRMLS_CC); - ZEPHIR_INIT_VAR(sqlSelect); - zephir_create_array(sqlSelect, 3, 0 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&sqlColumn); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); + zephir_update_property_zval(this_ptr, SL("_sqlColumnAliases"), &sqlColumnAliases); + ZEPHIR_INIT_VAR(&sqlSelect); + zephir_create_array(&sqlSelect, 3, 0 TSRMLS_CC); zephir_array_update_string(&sqlSelect, SL("models"), &sqlModels, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlSelect, SL("tables"), &sqlTables, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlSelect, SL("columns"), &sqlColumns, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_VAR(distinct); - if (zephir_array_isset_string_fetch(&distinct, select, SS("distinct"), 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&distinct); + if (zephir_array_isset_string_fetch(&distinct, &select, SL("distinct"), 0)) { zephir_array_update_string(&sqlSelect, SL("distinct"), &distinct, PH_COPY | PH_SEPARATE); } - if (zephir_fast_count_int(sqlJoins TSRMLS_CC)) { + if (zephir_fast_count_int(&sqlJoins TSRMLS_CC)) { zephir_array_update_string(&sqlSelect, SL("joins"), &sqlJoins, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(where); - if (zephir_array_isset_string_fetch(&where, ast, SS("where"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_52$$51, this_ptr, "_getexpression", NULL, 355, where); + ZEPHIR_OBS_VAR(&where); + if (zephir_array_isset_string_fetch(&where, ast, SL("where"), 0)) { + ZEPHIR_CALL_METHOD(&_44$$51, this_ptr, "_getexpression", NULL, 313, &where); zephir_check_call_status(); - zephir_array_update_string(&sqlSelect, SL("where"), &_52$$51, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&sqlSelect, SL("where"), &_44$$51, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(groupBy); - if (zephir_array_isset_string_fetch(&groupBy, ast, SS("groupBy"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_53$$52, this_ptr, "_getgroupclause", NULL, 367, groupBy); + ZEPHIR_OBS_VAR(&groupBy); + if (zephir_array_isset_string_fetch(&groupBy, ast, SL("groupBy"), 0)) { + ZEPHIR_CALL_METHOD(&_45$$52, this_ptr, "_getgroupclause", NULL, 325, &groupBy); zephir_check_call_status(); - zephir_array_update_string(&sqlSelect, SL("group"), &_53$$52, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&sqlSelect, SL("group"), &_45$$52, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(having); - if (zephir_array_isset_string_fetch(&having, ast, SS("having"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_54$$53, this_ptr, "_getexpression", NULL, 355, having); + ZEPHIR_OBS_VAR(&having); + if (zephir_array_isset_string_fetch(&having, ast, SL("having"), 0)) { + ZEPHIR_CALL_METHOD(&_46$$53, this_ptr, "_getexpression", NULL, 313, &having); zephir_check_call_status(); - zephir_array_update_string(&sqlSelect, SL("having"), &_54$$53, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&sqlSelect, SL("having"), &_46$$53, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(order); - if (zephir_array_isset_string_fetch(&order, ast, SS("orderBy"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_55$$54, this_ptr, "_getorderclause", NULL, 368, order); + ZEPHIR_OBS_VAR(&order); + if (zephir_array_isset_string_fetch(&order, ast, SL("orderBy"), 0)) { + ZEPHIR_CALL_METHOD(&_47$$54, this_ptr, "_getorderclause", NULL, 326, &order); zephir_check_call_status(); - zephir_array_update_string(&sqlSelect, SL("order"), &_55$$54, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&sqlSelect, SL("order"), &_47$$54, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(limit); - if (zephir_array_isset_string_fetch(&limit, ast, SS("limit"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_56$$55, this_ptr, "_getlimitclause", NULL, 369, limit); + ZEPHIR_OBS_VAR(&limit); + if (zephir_array_isset_string_fetch(&limit, ast, SL("limit"), 0)) { + ZEPHIR_CALL_METHOD(&_48$$55, this_ptr, "_getlimitclause", NULL, 327, &limit); zephir_check_call_status(); - zephir_array_update_string(&sqlSelect, SL("limit"), &_56$$55, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&sqlSelect, SL("limit"), &_48$$55, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string(ast, SS("forUpdate"))) { - zephir_array_update_string(&sqlSelect, SL("forUpdate"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); + if (zephir_array_isset_string(ast, SL("forUpdate"))) { + zephir_array_update_string(&sqlSelect, SL("forUpdate"), &__$true, PH_COPY | PH_SEPARATE); } if (zephir_is_true(merge)) { - zephir_update_property_this(getThis(), SL("_models"), tempModels TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_modelsInstances"), tempModelsInstances TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliases"), tempSqlAliases TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModels"), tempSqlAliasesModels TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlModelsAliases"), tempSqlModelsAliases TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModelsInstances"), tempSqlAliasesModelsInstances TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_models"), &tempModels); + zephir_update_property_zval(this_ptr, SL("_modelsInstances"), &tempModelsInstances); + zephir_update_property_zval(this_ptr, SL("_sqlAliases"), &tempSqlAliases); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModels"), &tempSqlAliasesModels); + zephir_update_property_zval(this_ptr, SL("_sqlModelsAliases"), &tempSqlModelsAliases); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModelsInstances"), &tempSqlAliasesModelsInstances); } - RETURN_CCTOR(sqlSelect); + RETURN_CCTOR(&sqlSelect); } @@ -2716,126 +3201,154 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareSelect) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) { - zval *_8$$9 = NULL; - HashTable *_6, *_14$$10; - HashPosition _5, _13$$10; + zval _6$$9; zend_bool notQuoting = 0; - zval *ast = NULL, *qualifiedName = NULL, *nsAlias = NULL, *manager = NULL, *modelName = NULL, *model = NULL, *source = NULL, *schema = NULL, *exprValues = NULL, *exprValue = NULL, *sqlInsert = NULL, *metaData = NULL, *fields = NULL, *sqlFields = NULL, *field = NULL, *name = NULL, *realModelName = NULL, *_3, *_4, **_7, *_0$$6 = NULL, *_1$$6, *_2$$6, *_9$$9 = NULL, *_10$$9 = NULL, *_11$$9 = NULL, **_15$$10, *_16$$11 = NULL, *_18$$12 = NULL, *_19$$12, *_20$$12 = NULL; - zephir_fcall_cache_entry *_12 = NULL, *_17 = NULL, *_21 = NULL; + zval ast, qualifiedName, nsAlias, manager, modelName, model, source, schema, exprValues, exprValue, sqlInsert, metaData, fields, sqlFields, field, name, realModelName, _3, _4, *_5, _0$$6, _1$$6, _2$$6, _7$$9, _8$$9, _9$$9, *_11$$10, _12$$11, _14$$12, _15$$12, _16$$12; + zephir_fcall_cache_entry *_10 = NULL, *_13 = NULL, *_17 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&ast); + ZVAL_UNDEF(&qualifiedName); + ZVAL_UNDEF(&nsAlias); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&exprValues); + ZVAL_UNDEF(&exprValue); + ZVAL_UNDEF(&sqlInsert); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&sqlFields); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&realModelName); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_0$$6); + ZVAL_UNDEF(&_1$$6); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_12$$11); + ZVAL_UNDEF(&_14$$12); + ZVAL_UNDEF(&_15$$12); + ZVAL_UNDEF(&_16$$12); + ZVAL_UNDEF(&_6$$9); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(ast); - zephir_read_property_this(&ast, this_ptr, SL("_ast"), PH_NOISY_CC); - if (!(zephir_array_isset_string(ast, SS("qualifiedName")))) { + ZEPHIR_OBS_VAR(&ast); + zephir_read_property(&ast, this_ptr, SL("_ast"), PH_NOISY_CC); + if (!(zephir_array_isset_string(&ast, SL("qualifiedName")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/mvc/model/query.zep", 2137); return; } - if (!(zephir_array_isset_string(ast, SS("values")))) { + if (!(zephir_array_isset_string(&ast, SL("values")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/mvc/model/query.zep", 2141); return; } - ZEPHIR_OBS_VAR(qualifiedName); - zephir_array_fetch_string(&qualifiedName, ast, SL("qualifiedName"), PH_NOISY, "phalcon/mvc/model/query.zep", 2144 TSRMLS_CC); - if (!(zephir_array_isset_string(qualifiedName, SS("name")))) { + ZEPHIR_OBS_VAR(&qualifiedName); + zephir_array_fetch_string(&qualifiedName, &ast, SL("qualifiedName"), PH_NOISY, "phalcon/mvc/model/query.zep", 2144 TSRMLS_CC); + if (!(zephir_array_isset_string(&qualifiedName, SL("name")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted INSERT AST", "phalcon/mvc/model/query.zep", 2148); return; } - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(modelName); - zephir_array_fetch_string(&modelName, qualifiedName, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 2152 TSRMLS_CC); - if (zephir_memnstr_str(modelName, SL(":"), "phalcon/mvc/model/query.zep", 2155)) { - ZEPHIR_INIT_VAR(nsAlias); - zephir_fast_explode_str(nsAlias, SL(":"), modelName, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&_1$$6, nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2157 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_0$$6, manager, "getnamespacealias", NULL, 0, _1$$6); + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&modelName); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 2152 TSRMLS_CC); + if (zephir_memnstr_str(&modelName, SL(":"), "phalcon/mvc/model/query.zep", 2155)) { + ZEPHIR_INIT_VAR(&nsAlias); + zephir_fast_explode_str(&nsAlias, SL(":"), &modelName, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&_1$$6, &nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2157 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_0$$6, &manager, "getnamespacealias", NULL, 0, &_1$$6); zephir_check_call_status(); - zephir_array_fetch_long(&_2$$6, nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2157 TSRMLS_CC); - ZEPHIR_INIT_VAR(realModelName); - ZEPHIR_CONCAT_VSV(realModelName, _0$$6, "\\", _2$$6); + zephir_array_fetch_long(&_2$$6, &nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2157 TSRMLS_CC); + ZEPHIR_INIT_VAR(&realModelName); + ZEPHIR_CONCAT_VSV(&realModelName, &_0$$6, "\\", &_2$$6); } else { - ZEPHIR_CPY_WRT(realModelName, modelName); + ZEPHIR_CPY_WRT(&realModelName, &modelName); } - ZEPHIR_INIT_VAR(_3); - ZVAL_BOOL(_3, 1); - ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, realModelName, _3); + ZVAL_BOOL(&_3, 1); + ZEPHIR_CALL_METHOD(&model, &manager, "load", NULL, 0, &realModelName, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, model, "getsource", NULL, 0); + ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&schema, model, "getschema", NULL, 0); + ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(schema)) { - ZEPHIR_INIT_NVAR(source); - zephir_create_array(source, 2, 0 TSRMLS_CC); - zephir_array_fast_append(source, schema); - zephir_array_fast_append(source, source); + if (zephir_is_true(&schema)) { + ZEPHIR_INIT_NVAR(&source); + zephir_create_array(&source, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&source, &schema); + zephir_array_fast_append(&source, &source); } notQuoting = 0; - ZEPHIR_INIT_VAR(exprValues); - array_init(exprValues); - zephir_array_fetch_string(&_4, ast, SL("values"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2173 TSRMLS_CC); - zephir_is_iterable(_4, &_6, &_5, 0, 0, "phalcon/mvc/model/query.zep", 2182); - for ( - ; zend_hash_get_current_data_ex(_6, (void**) &_7, &_5) == SUCCESS - ; zend_hash_move_forward_ex(_6, &_5) - ) { - ZEPHIR_GET_HVALUE(exprValue, _7); - ZEPHIR_INIT_NVAR(_8$$9); - zephir_create_array(_8$$9, 2, 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(_9$$9); - zephir_array_fetch_string(&_9$$9, exprValue, SL("type"), PH_NOISY, "phalcon/mvc/model/query.zep", 2177 TSRMLS_CC); - zephir_array_update_string(&_8$$9, SL("type"), &_9$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_11$$9); + ZEPHIR_INIT_VAR(&exprValues); + array_init(&exprValues); + zephir_array_fetch_string(&_4, &ast, SL("values"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2173 TSRMLS_CC); + zephir_is_iterable(&_4, 0, "phalcon/mvc/model/query.zep", 2182); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_4), _5) + { + ZEPHIR_INIT_NVAR(&exprValue); + ZVAL_COPY(&exprValue, _5); + ZEPHIR_INIT_NVAR(&_6$$9); + zephir_create_array(&_6$$9, 2, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_7$$9); + zephir_array_fetch_string(&_7$$9, &exprValue, SL("type"), PH_NOISY, "phalcon/mvc/model/query.zep", 2177 TSRMLS_CC); + zephir_array_update_string(&_6$$9, SL("type"), &_7$$9, PH_COPY | PH_SEPARATE); if (notQuoting) { - ZVAL_BOOL(_11$$9, 1); + ZVAL_BOOL(&_9$$9, 1); } else { - ZVAL_BOOL(_11$$9, 0); + ZVAL_BOOL(&_9$$9, 0); } - ZEPHIR_CALL_METHOD(&_10$$9, this_ptr, "_getexpression", &_12, 355, exprValue, _11$$9); + ZEPHIR_CALL_METHOD(&_8$$9, this_ptr, "_getexpression", &_10, 313, &exprValue, &_9$$9); zephir_check_call_status(); - zephir_array_update_string(&_8$$9, SL("value"), &_10$$9, PH_COPY | PH_SEPARATE); - zephir_array_append(&exprValues, _8$$9, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2179); - } - ZEPHIR_INIT_VAR(sqlInsert); - zephir_create_array(sqlInsert, 2, 0 TSRMLS_CC); + zephir_array_update_string(&_6$$9, SL("value"), &_8$$9, PH_COPY | PH_SEPARATE); + zephir_array_append(&exprValues, &_6$$9, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2179); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&exprValue); + ZEPHIR_INIT_VAR(&sqlInsert); + zephir_create_array(&sqlInsert, 2, 0 TSRMLS_CC); zephir_array_update_string(&sqlInsert, SL("model"), &modelName, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlInsert, SL("table"), &source, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_VAR(metaData); - zephir_read_property_this(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(fields); - if (zephir_array_isset_string_fetch(&fields, ast, SS("fields"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(sqlFields); - array_init(sqlFields); - zephir_is_iterable(fields, &_14$$10, &_13$$10, 0, 0, "phalcon/mvc/model/query.zep", 2206); - for ( - ; zend_hash_get_current_data_ex(_14$$10, (void**) &_15$$10, &_13$$10) == SUCCESS - ; zend_hash_move_forward_ex(_14$$10, &_13$$10) - ) { - ZEPHIR_GET_HVALUE(field, _15$$10); - ZEPHIR_OBS_NVAR(name); - zephir_array_fetch_string(&name, field, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 2193 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_16$$11, metaData, "hasattribute", &_17, 0, model, name); + ZEPHIR_OBS_VAR(&metaData); + zephir_read_property(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&fields); + if (zephir_array_isset_string_fetch(&fields, &ast, SL("fields"), 0)) { + ZEPHIR_INIT_VAR(&sqlFields); + array_init(&sqlFields); + zephir_is_iterable(&fields, 0, "phalcon/mvc/model/query.zep", 2206); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&fields), _11$$10) + { + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _11$$10); + ZEPHIR_OBS_NVAR(&name); + zephir_array_fetch_string(&name, &field, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 2193 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_12$$11, &metaData, "hasattribute", &_13, 0, &model, &name); zephir_check_call_status(); - if (!(zephir_is_true(_16$$11))) { - ZEPHIR_INIT_NVAR(_18$$12); - object_init_ex(_18$$12, phalcon_mvc_model_exception_ce); - _19$$12 = zephir_fetch_nproperty_this(this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_LNVAR(_20$$12); - ZEPHIR_CONCAT_SVSVSV(_20$$12, "The model '", modelName, "' doesn't have the attribute '", name, "', when preparing: ", _19$$12); - ZEPHIR_CALL_METHOD(NULL, _18$$12, "__construct", &_21, 9, _20$$12); + if (!(zephir_is_true(&_12$$11))) { + ZEPHIR_INIT_NVAR(&_14$$12); + object_init_ex(&_14$$12, phalcon_mvc_model_exception_ce); + zephir_read_property(&_15$$12, this_ptr, SL("_phql"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_LNVAR(_16$$12); + ZEPHIR_CONCAT_SVSVSV(&_16$$12, "The model '", &modelName, "' doesn't have the attribute '", &name, "', when preparing: ", &_15$$12); + ZEPHIR_CALL_METHOD(NULL, &_14$$12, "__construct", &_17, 4, &_16$$12); zephir_check_call_status(); - zephir_throw_exception_debug(_18$$12, "phalcon/mvc/model/query.zep", 2199 TSRMLS_CC); + zephir_throw_exception_debug(&_14$$12, "phalcon/mvc/model/query.zep", 2199 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_array_append(&sqlFields, name, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2203); - } + zephir_array_append(&sqlFields, &name, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2203); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); zephir_array_update_string(&sqlInsert, SL("fields"), &sqlFields, PH_COPY | PH_SEPARATE); } zephir_array_update_string(&sqlInsert, SL("values"), &exprValues, PH_COPY | PH_SEPARATE); - RETURN_CCTOR(sqlInsert); + RETURN_CCTOR(&sqlInsert); } @@ -2844,181 +3357,222 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareInsert) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) { - zval *_16$$17 = NULL; - HashTable *_1, *_10; - HashPosition _0, _9; + zval _12$$17; zend_bool notQuoting = 0; - zval *ast = NULL, *update = NULL, *tables = NULL, *values = NULL, *modelsInstances = NULL, *models = NULL, *sqlTables = NULL, *sqlAliases = NULL, *sqlAliasesModelsInstances = NULL, *updateTables = NULL, *nsAlias = NULL, *realModelName = NULL, *completeSource = NULL, *sqlModels = NULL, *manager = NULL, *table = NULL, *qualifiedName = NULL, *modelName = NULL, *model = NULL, *source = NULL, *schema = NULL, *alias = NULL, *sqlFields = NULL, *sqlValues = NULL, *updateValues = NULL, *updateValue = NULL, *exprColumn = NULL, *sqlUpdate = NULL, *where = NULL, *limit = NULL, **_2, **_11, *_3$$9 = NULL, *_4$$9, *_6$$9, *_7$$8 = NULL, *_12$$17 = NULL, *_13$$17, *_14$$17 = NULL, *_17$$17 = NULL, *_18$$17 = NULL, *_19$$17 = NULL, *_20$$18 = NULL, *_21$$18, *_22$$19 = NULL; - zephir_fcall_cache_entry *_5 = NULL, *_8 = NULL, *_15 = NULL; + zval __$null, ast, update, tables, values, modelsInstances, models, sqlTables, sqlAliases, sqlAliasesModelsInstances, updateTables, nsAlias, realModelName, completeSource, sqlModels, manager, table, qualifiedName, modelName, model, source, schema, alias, sqlFields, sqlValues, updateValues, updateValue, exprColumn, sqlUpdate, where, limit, *_0, *_7, _1$$9, _2$$9, _4$$9, _5$$8, _8$$17, _9$$17, _10$$17, _13$$17, _14$$17, _15$$17, _16$$18, _17$$18, _18$$19; + zephir_fcall_cache_entry *_3 = NULL, *_6 = NULL, *_11 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&ast); + ZVAL_UNDEF(&update); + ZVAL_UNDEF(&tables); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&modelsInstances); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(&sqlTables); + ZVAL_UNDEF(&sqlAliases); + ZVAL_UNDEF(&sqlAliasesModelsInstances); + ZVAL_UNDEF(&updateTables); + ZVAL_UNDEF(&nsAlias); + ZVAL_UNDEF(&realModelName); + ZVAL_UNDEF(&completeSource); + ZVAL_UNDEF(&sqlModels); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&qualifiedName); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&sqlFields); + ZVAL_UNDEF(&sqlValues); + ZVAL_UNDEF(&updateValues); + ZVAL_UNDEF(&updateValue); + ZVAL_UNDEF(&exprColumn); + ZVAL_UNDEF(&sqlUpdate); + ZVAL_UNDEF(&where); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&_1$$9); + ZVAL_UNDEF(&_2$$9); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_8$$17); + ZVAL_UNDEF(&_9$$17); + ZVAL_UNDEF(&_10$$17); + ZVAL_UNDEF(&_13$$17); + ZVAL_UNDEF(&_14$$17); + ZVAL_UNDEF(&_15$$17); + ZVAL_UNDEF(&_16$$18); + ZVAL_UNDEF(&_17$$18); + ZVAL_UNDEF(&_18$$19); + ZVAL_UNDEF(&_12$$17); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(ast); - zephir_read_property_this(&ast, this_ptr, SL("_ast"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(update); - if (!(zephir_array_isset_string_fetch(&update, ast, SS("update"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&ast); + zephir_read_property(&ast, this_ptr, SL("_ast"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&update); + if (!(zephir_array_isset_string_fetch(&update, &ast, SL("update"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/mvc/model/query.zep", 2230); return; } - ZEPHIR_OBS_VAR(tables); - if (!(zephir_array_isset_string_fetch(&tables, update, SS("tables"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&tables); + if (!(zephir_array_isset_string_fetch(&tables, &update, SL("tables"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/mvc/model/query.zep", 2234); return; } - ZEPHIR_OBS_VAR(values); - if (!(zephir_array_isset_string_fetch(&values, update, SS("values"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&values); + if (!(zephir_array_isset_string_fetch(&values, &update, SL("values"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted UPDATE AST", "phalcon/mvc/model/query.zep", 2238); return; } - ZEPHIR_INIT_VAR(models); - array_init(models); - ZEPHIR_INIT_VAR(modelsInstances); - array_init(modelsInstances); - ZEPHIR_INIT_VAR(sqlTables); - array_init(sqlTables); - ZEPHIR_INIT_VAR(sqlModels); - array_init(sqlModels); - ZEPHIR_INIT_VAR(sqlAliases); - array_init(sqlAliases); - ZEPHIR_INIT_VAR(sqlAliasesModelsInstances); - array_init(sqlAliasesModelsInstances); - if (!(zephir_array_isset_long(tables, 0))) { - ZEPHIR_INIT_VAR(updateTables); - zephir_create_array(updateTables, 1, 0 TSRMLS_CC); - zephir_array_fast_append(updateTables, tables); + ZEPHIR_INIT_VAR(&models); + array_init(&models); + ZEPHIR_INIT_VAR(&modelsInstances); + array_init(&modelsInstances); + ZEPHIR_INIT_VAR(&sqlTables); + array_init(&sqlTables); + ZEPHIR_INIT_VAR(&sqlModels); + array_init(&sqlModels); + ZEPHIR_INIT_VAR(&sqlAliases); + array_init(&sqlAliases); + ZEPHIR_INIT_VAR(&sqlAliasesModelsInstances); + array_init(&sqlAliasesModelsInstances); + if (!(zephir_array_isset_long(&tables, 0))) { + ZEPHIR_INIT_VAR(&updateTables); + zephir_create_array(&updateTables, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&updateTables, &tables); } else { - ZEPHIR_CPY_WRT(updateTables, tables); - } - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - zephir_is_iterable(updateTables, &_1, &_0, 0, 0, "phalcon/mvc/model/query.zep", 2313); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(table, _2); - ZEPHIR_OBS_NVAR(qualifiedName); - zephir_array_fetch_string(&qualifiedName, table, SL("qualifiedName"), PH_NOISY, "phalcon/mvc/model/query.zep", 2261 TSRMLS_CC); - ZEPHIR_OBS_NVAR(modelName); - zephir_array_fetch_string(&modelName, qualifiedName, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 2262 TSRMLS_CC); - if (zephir_memnstr_str(modelName, SL(":"), "phalcon/mvc/model/query.zep", 2267)) { - ZEPHIR_INIT_NVAR(nsAlias); - zephir_fast_explode_str(nsAlias, SL(":"), modelName, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&_4$$9, nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2269 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_3$$9, manager, "getnamespacealias", &_5, 0, _4$$9); + ZEPHIR_CPY_WRT(&updateTables, &tables); + } + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + zephir_is_iterable(&updateTables, 0, "phalcon/mvc/model/query.zep", 2313); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&updateTables), _0) + { + ZEPHIR_INIT_NVAR(&table); + ZVAL_COPY(&table, _0); + ZEPHIR_OBS_NVAR(&qualifiedName); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/mvc/model/query.zep", 2261 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&modelName); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 2262 TSRMLS_CC); + if (zephir_memnstr_str(&modelName, SL(":"), "phalcon/mvc/model/query.zep", 2267)) { + ZEPHIR_INIT_NVAR(&nsAlias); + zephir_fast_explode_str(&nsAlias, SL(":"), &modelName, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&_2$$9, &nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2269 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_1$$9, &manager, "getnamespacealias", &_3, 0, &_2$$9); zephir_check_call_status(); - zephir_array_fetch_long(&_6$$9, nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2269 TSRMLS_CC); - ZEPHIR_INIT_NVAR(realModelName); - ZEPHIR_CONCAT_VSV(realModelName, _3$$9, "\\", _6$$9); + zephir_array_fetch_long(&_4$$9, &nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2269 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&realModelName); + ZEPHIR_CONCAT_VSV(&realModelName, &_1$$9, "\\", &_4$$9); } else { - ZEPHIR_CPY_WRT(realModelName, modelName); + ZEPHIR_CPY_WRT(&realModelName, &modelName); } - ZEPHIR_INIT_NVAR(_7$$8); - ZVAL_BOOL(_7$$8, 1); - ZEPHIR_CALL_METHOD(&model, manager, "load", &_8, 0, realModelName, _7$$8); + ZVAL_BOOL(&_5$$8, 1); + ZEPHIR_CALL_METHOD(&model, &manager, "load", &_6, 0, &realModelName, &_5$$8); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, model, "getsource", NULL, 0); + ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&schema, model, "getschema", NULL, 0); + ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(completeSource); - if (zephir_is_true(schema)) { - zephir_create_array(completeSource, 2, 0 TSRMLS_CC); - zephir_array_fast_append(completeSource, source); - zephir_array_fast_append(completeSource, schema); + ZEPHIR_INIT_NVAR(&completeSource); + if (zephir_is_true(&schema)) { + zephir_create_array(&completeSource, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&completeSource, &source); + zephir_array_fast_append(&completeSource, &schema); } else { - zephir_create_array(completeSource, 2, 0 TSRMLS_CC); - zephir_array_fast_append(completeSource, source); - zephir_array_fast_append(completeSource, ZEPHIR_GLOBAL(global_null)); + zephir_create_array(&completeSource, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&completeSource, &source); + zephir_array_fast_append(&completeSource, &__$null); } - ZEPHIR_OBS_NVAR(alias); - if (zephir_array_isset_string_fetch(&alias, table, SS("alias"), 0 TSRMLS_CC)) { - zephir_array_update_zval(&sqlAliases, alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, alias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2295); - zephir_array_append(&sqlTables, completeSource, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2296); - zephir_array_update_zval(&sqlAliasesModelsInstances, alias, &model, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&models, alias, &realModelName, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&alias); + if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { + zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2295); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2296); + zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&models, &alias, &realModelName, PH_COPY | PH_SEPARATE); } else { - zephir_array_update_zval(&sqlAliases, realModelName, &source, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModelsInstances, realModelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, source, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2302); - zephir_array_update_zval(&models, realModelName, &source, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliases, &realModelName, &source, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModelsInstances, &realModelName, &model, PH_COPY | PH_SEPARATE); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2302); + zephir_array_update_zval(&models, &realModelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, realModelName, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2306); - zephir_array_update_zval(&modelsInstances, realModelName, &model, PH_COPY | PH_SEPARATE); - } - zephir_update_property_this(getThis(), SL("_models"), models TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_modelsInstances"), modelsInstances TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliases"), sqlAliases TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModelsInstances"), sqlAliasesModelsInstances TSRMLS_CC); - ZEPHIR_INIT_VAR(sqlFields); - array_init(sqlFields); - ZEPHIR_INIT_VAR(sqlValues); - array_init(sqlValues); - if (!(zephir_array_isset_long(values, 0))) { - ZEPHIR_INIT_VAR(updateValues); - zephir_create_array(updateValues, 1, 0 TSRMLS_CC); - zephir_array_fast_append(updateValues, values); + zephir_array_append(&sqlModels, &realModelName, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2306); + zephir_array_update_zval(&modelsInstances, &realModelName, &model, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&table); + zephir_update_property_zval(this_ptr, SL("_models"), &models); + zephir_update_property_zval(this_ptr, SL("_modelsInstances"), &modelsInstances); + zephir_update_property_zval(this_ptr, SL("_sqlAliases"), &sqlAliases); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModelsInstances"), &sqlAliasesModelsInstances); + ZEPHIR_INIT_VAR(&sqlFields); + array_init(&sqlFields); + ZEPHIR_INIT_VAR(&sqlValues); + array_init(&sqlValues); + if (!(zephir_array_isset_long(&values, 0))) { + ZEPHIR_INIT_VAR(&updateValues); + zephir_create_array(&updateValues, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&updateValues, &values); } else { - ZEPHIR_CPY_WRT(updateValues, values); + ZEPHIR_CPY_WRT(&updateValues, &values); } notQuoting = 0; - zephir_is_iterable(updateValues, &_10, &_9, 0, 0, "phalcon/mvc/model/query.zep", 2337); - for ( - ; zend_hash_get_current_data_ex(_10, (void**) &_11, &_9) == SUCCESS - ; zend_hash_move_forward_ex(_10, &_9) - ) { - ZEPHIR_GET_HVALUE(updateValue, _11); - zephir_array_fetch_string(&_13$$17, updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2329 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_14$$17); + zephir_is_iterable(&updateValues, 0, "phalcon/mvc/model/query.zep", 2337); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&updateValues), _7) + { + ZEPHIR_INIT_NVAR(&updateValue); + ZVAL_COPY(&updateValue, _7); + zephir_array_fetch_string(&_9$$17, &updateValue, SL("column"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2329 TSRMLS_CC); if (notQuoting) { - ZVAL_BOOL(_14$$17, 1); + ZVAL_BOOL(&_10$$17, 1); } else { - ZVAL_BOOL(_14$$17, 0); + ZVAL_BOOL(&_10$$17, 0); } - ZEPHIR_CALL_METHOD(&_12$$17, this_ptr, "_getexpression", &_15, 355, _13$$17, _14$$17); + ZEPHIR_CALL_METHOD(&_8$$17, this_ptr, "_getexpression", &_11, 313, &_9$$17, &_10$$17); zephir_check_call_status(); - zephir_array_append(&sqlFields, _12$$17, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2329); - ZEPHIR_OBS_NVAR(exprColumn); - zephir_array_fetch_string(&exprColumn, updateValue, SL("expr"), PH_NOISY, "phalcon/mvc/model/query.zep", 2330 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_16$$17); - zephir_create_array(_16$$17, 2, 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(_17$$17); - zephir_array_fetch_string(&_17$$17, exprColumn, SL("type"), PH_NOISY, "phalcon/mvc/model/query.zep", 2332 TSRMLS_CC); - zephir_array_update_string(&_16$$17, SL("type"), &_17$$17, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_19$$17); + zephir_array_append(&sqlFields, &_8$$17, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2329); + ZEPHIR_OBS_NVAR(&exprColumn); + zephir_array_fetch_string(&exprColumn, &updateValue, SL("expr"), PH_NOISY, "phalcon/mvc/model/query.zep", 2330 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_12$$17); + zephir_create_array(&_12$$17, 2, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_13$$17); + zephir_array_fetch_string(&_13$$17, &exprColumn, SL("type"), PH_NOISY, "phalcon/mvc/model/query.zep", 2332 TSRMLS_CC); + zephir_array_update_string(&_12$$17, SL("type"), &_13$$17, PH_COPY | PH_SEPARATE); if (notQuoting) { - ZVAL_BOOL(_19$$17, 1); + ZVAL_BOOL(&_15$$17, 1); } else { - ZVAL_BOOL(_19$$17, 0); + ZVAL_BOOL(&_15$$17, 0); } - ZEPHIR_CALL_METHOD(&_18$$17, this_ptr, "_getexpression", &_15, 355, exprColumn, _19$$17); + ZEPHIR_CALL_METHOD(&_14$$17, this_ptr, "_getexpression", &_11, 313, &exprColumn, &_15$$17); zephir_check_call_status(); - zephir_array_update_string(&_16$$17, SL("value"), &_18$$17, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlValues, _16$$17, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2334); - } - ZEPHIR_INIT_VAR(sqlUpdate); - zephir_create_array(sqlUpdate, 4, 0 TSRMLS_CC); + zephir_array_update_string(&_12$$17, SL("value"), &_14$$17, PH_COPY | PH_SEPARATE); + zephir_array_append(&sqlValues, &_12$$17, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2334); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&updateValue); + ZEPHIR_INIT_VAR(&sqlUpdate); + zephir_create_array(&sqlUpdate, 4, 0 TSRMLS_CC); zephir_array_update_string(&sqlUpdate, SL("tables"), &sqlTables, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlUpdate, SL("models"), &sqlModels, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlUpdate, SL("fields"), &sqlFields, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlUpdate, SL("values"), &sqlValues, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_VAR(where); - if (zephir_array_isset_string_fetch(&where, ast, SS("where"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_21$$18); - ZVAL_BOOL(_21$$18, 1); - ZEPHIR_CALL_METHOD(&_20$$18, this_ptr, "_getexpression", &_15, 355, where, _21$$18); + ZEPHIR_OBS_VAR(&where); + if (zephir_array_isset_string_fetch(&where, &ast, SL("where"), 0)) { + ZVAL_BOOL(&_17$$18, 1); + ZEPHIR_CALL_METHOD(&_16$$18, this_ptr, "_getexpression", &_11, 313, &where, &_17$$18); zephir_check_call_status(); - zephir_array_update_string(&sqlUpdate, SL("where"), &_20$$18, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&sqlUpdate, SL("where"), &_16$$18, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(limit); - if (zephir_array_isset_string_fetch(&limit, ast, SS("limit"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_22$$19, this_ptr, "_getlimitclause", NULL, 369, limit); + ZEPHIR_OBS_VAR(&limit); + if (zephir_array_isset_string_fetch(&limit, &ast, SL("limit"), 0)) { + ZEPHIR_CALL_METHOD(&_18$$19, this_ptr, "_getlimitclause", NULL, 327, &limit); zephir_check_call_status(); - zephir_array_update_string(&sqlUpdate, SL("limit"), &_22$$19, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&sqlUpdate, SL("limit"), &_18$$19, PH_COPY | PH_SEPARATE); } - RETURN_CCTOR(sqlUpdate); + RETURN_CCTOR(&sqlUpdate); } @@ -3027,126 +3581,156 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareUpdate) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) { - HashTable *_1; - HashPosition _0; - zval *ast = NULL, *delete = NULL, *tables = NULL, *models = NULL, *modelsInstances = NULL, *sqlTables = NULL, *sqlModels = NULL, *sqlAliases = NULL, *sqlAliasesModelsInstances = NULL, *deleteTables = NULL, *manager = NULL, *table = NULL, *qualifiedName = NULL, *modelName = NULL, *nsAlias = NULL, *realModelName = NULL, *model = NULL, *source = NULL, *schema = NULL, *completeSource = NULL, *alias = NULL, *sqlDelete = NULL, *where = NULL, *limit = NULL, **_2, *_3$$8 = NULL, *_4$$8, *_6$$8, *_7$$7 = NULL, *_9$$14 = NULL, *_10$$14, *_11$$15 = NULL; - zephir_fcall_cache_entry *_5 = NULL, *_8 = NULL; + zval __$null, ast, delete, tables, models, modelsInstances, sqlTables, sqlModels, sqlAliases, sqlAliasesModelsInstances, deleteTables, manager, table, qualifiedName, modelName, nsAlias, realModelName, model, source, schema, completeSource, alias, sqlDelete, where, limit, *_0, _1$$8, _2$$8, _4$$8, _5$$7, _7$$14, _8$$14, _9$$15; + zephir_fcall_cache_entry *_3 = NULL, *_6 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&ast); + ZVAL_UNDEF(&delete); + ZVAL_UNDEF(&tables); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(&modelsInstances); + ZVAL_UNDEF(&sqlTables); + ZVAL_UNDEF(&sqlModels); + ZVAL_UNDEF(&sqlAliases); + ZVAL_UNDEF(&sqlAliasesModelsInstances); + ZVAL_UNDEF(&deleteTables); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&table); + ZVAL_UNDEF(&qualifiedName); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&nsAlias); + ZVAL_UNDEF(&realModelName); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&schema); + ZVAL_UNDEF(&completeSource); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&sqlDelete); + ZVAL_UNDEF(&where); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&_1$$8); + ZVAL_UNDEF(&_2$$8); + ZVAL_UNDEF(&_4$$8); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_7$$14); + ZVAL_UNDEF(&_8$$14); + ZVAL_UNDEF(&_9$$15); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(ast); - zephir_read_property_this(&ast, this_ptr, SL("_ast"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(delete); - if (!(zephir_array_isset_string_fetch(&delete, ast, SS("delete"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&ast); + zephir_read_property(&ast, this_ptr, SL("_ast"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&delete); + if (!(zephir_array_isset_string_fetch(&delete, &ast, SL("delete"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/mvc/model/query.zep", 2369); return; } - ZEPHIR_OBS_VAR(tables); - if (!(zephir_array_isset_string_fetch(&tables, delete, SS("tables"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&tables); + if (!(zephir_array_isset_string_fetch(&tables, &delete, SL("tables"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted DELETE AST", "phalcon/mvc/model/query.zep", 2373); return; } - ZEPHIR_INIT_VAR(models); - array_init(models); - ZEPHIR_INIT_VAR(modelsInstances); - array_init(modelsInstances); - ZEPHIR_INIT_VAR(sqlTables); - array_init(sqlTables); - ZEPHIR_INIT_VAR(sqlModels); - array_init(sqlModels); - ZEPHIR_INIT_VAR(sqlAliases); - array_init(sqlAliases); - ZEPHIR_INIT_VAR(sqlAliasesModelsInstances); - array_init(sqlAliasesModelsInstances); - if (!(zephir_array_isset_long(tables, 0))) { - ZEPHIR_INIT_VAR(deleteTables); - zephir_create_array(deleteTables, 1, 0 TSRMLS_CC); - zephir_array_fast_append(deleteTables, tables); + ZEPHIR_INIT_VAR(&models); + array_init(&models); + ZEPHIR_INIT_VAR(&modelsInstances); + array_init(&modelsInstances); + ZEPHIR_INIT_VAR(&sqlTables); + array_init(&sqlTables); + ZEPHIR_INIT_VAR(&sqlModels); + array_init(&sqlModels); + ZEPHIR_INIT_VAR(&sqlAliases); + array_init(&sqlAliases); + ZEPHIR_INIT_VAR(&sqlAliasesModelsInstances); + array_init(&sqlAliasesModelsInstances); + if (!(zephir_array_isset_long(&tables, 0))) { + ZEPHIR_INIT_VAR(&deleteTables); + zephir_create_array(&deleteTables, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&deleteTables, &tables); } else { - ZEPHIR_CPY_WRT(deleteTables, tables); - } - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - zephir_is_iterable(deleteTables, &_1, &_0, 0, 0, "phalcon/mvc/model/query.zep", 2443); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(table, _2); - ZEPHIR_OBS_NVAR(qualifiedName); - zephir_array_fetch_string(&qualifiedName, table, SL("qualifiedName"), PH_NOISY, "phalcon/mvc/model/query.zep", 2397 TSRMLS_CC); - ZEPHIR_OBS_NVAR(modelName); - zephir_array_fetch_string(&modelName, qualifiedName, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 2398 TSRMLS_CC); - if (zephir_memnstr_str(modelName, SL(":"), "phalcon/mvc/model/query.zep", 2403)) { - ZEPHIR_INIT_NVAR(nsAlias); - zephir_fast_explode_str(nsAlias, SL(":"), modelName, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&_4$$8, nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2405 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_3$$8, manager, "getnamespacealias", &_5, 0, _4$$8); + ZEPHIR_CPY_WRT(&deleteTables, &tables); + } + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + zephir_is_iterable(&deleteTables, 0, "phalcon/mvc/model/query.zep", 2443); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&deleteTables), _0) + { + ZEPHIR_INIT_NVAR(&table); + ZVAL_COPY(&table, _0); + ZEPHIR_OBS_NVAR(&qualifiedName); + zephir_array_fetch_string(&qualifiedName, &table, SL("qualifiedName"), PH_NOISY, "phalcon/mvc/model/query.zep", 2397 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&modelName); + zephir_array_fetch_string(&modelName, &qualifiedName, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 2398 TSRMLS_CC); + if (zephir_memnstr_str(&modelName, SL(":"), "phalcon/mvc/model/query.zep", 2403)) { + ZEPHIR_INIT_NVAR(&nsAlias); + zephir_fast_explode_str(&nsAlias, SL(":"), &modelName, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&_2$$8, &nsAlias, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2405 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_1$$8, &manager, "getnamespacealias", &_3, 0, &_2$$8); zephir_check_call_status(); - zephir_array_fetch_long(&_6$$8, nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2405 TSRMLS_CC); - ZEPHIR_INIT_NVAR(realModelName); - ZEPHIR_CONCAT_VSV(realModelName, _3$$8, "\\", _6$$8); + zephir_array_fetch_long(&_4$$8, &nsAlias, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2405 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&realModelName); + ZEPHIR_CONCAT_VSV(&realModelName, &_1$$8, "\\", &_4$$8); } else { - ZEPHIR_CPY_WRT(realModelName, modelName); + ZEPHIR_CPY_WRT(&realModelName, &modelName); } - ZEPHIR_INIT_NVAR(_7$$7); - ZVAL_BOOL(_7$$7, 1); - ZEPHIR_CALL_METHOD(&model, manager, "load", &_8, 0, realModelName, _7$$7); + ZVAL_BOOL(&_5$$7, 1); + ZEPHIR_CALL_METHOD(&model, &manager, "load", &_6, 0, &realModelName, &_5$$7); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&source, model, "getsource", NULL, 0); + ZEPHIR_CALL_METHOD(&source, &model, "getsource", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&schema, model, "getschema", NULL, 0); + ZEPHIR_CALL_METHOD(&schema, &model, "getschema", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(completeSource); - if (zephir_is_true(schema)) { - zephir_create_array(completeSource, 2, 0 TSRMLS_CC); - zephir_array_fast_append(completeSource, source); - zephir_array_fast_append(completeSource, schema); + ZEPHIR_INIT_NVAR(&completeSource); + if (zephir_is_true(&schema)) { + zephir_create_array(&completeSource, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&completeSource, &source); + zephir_array_fast_append(&completeSource, &schema); } else { - zephir_create_array(completeSource, 2, 0 TSRMLS_CC); - zephir_array_fast_append(completeSource, source); - zephir_array_fast_append(completeSource, ZEPHIR_GLOBAL(global_null)); + zephir_create_array(&completeSource, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&completeSource, &source); + zephir_array_fast_append(&completeSource, &__$null); } - ZEPHIR_OBS_NVAR(alias); - if (zephir_array_isset_string_fetch(&alias, table, SS("alias"), 0 TSRMLS_CC)) { - zephir_array_update_zval(&sqlAliases, alias, &alias, PH_COPY | PH_SEPARATE); - zephir_array_append(&completeSource, alias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2425); - zephir_array_append(&sqlTables, completeSource, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2426); - zephir_array_update_zval(&sqlAliasesModelsInstances, alias, &model, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&models, alias, &realModelName, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&alias); + if (zephir_array_isset_string_fetch(&alias, &table, SL("alias"), 0)) { + zephir_array_update_zval(&sqlAliases, &alias, &alias, PH_COPY | PH_SEPARATE); + zephir_array_append(&completeSource, &alias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2425); + zephir_array_append(&sqlTables, &completeSource, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2426); + zephir_array_update_zval(&sqlAliasesModelsInstances, &alias, &model, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&models, &alias, &realModelName, PH_COPY | PH_SEPARATE); } else { - zephir_array_update_zval(&sqlAliases, realModelName, &source, PH_COPY | PH_SEPARATE); - zephir_array_update_zval(&sqlAliasesModelsInstances, realModelName, &model, PH_COPY | PH_SEPARATE); - zephir_array_append(&sqlTables, source, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2432); - zephir_array_update_zval(&models, realModelName, &source, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliases, &realModelName, &source, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&sqlAliasesModelsInstances, &realModelName, &model, PH_COPY | PH_SEPARATE); + zephir_array_append(&sqlTables, &source, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2432); + zephir_array_update_zval(&models, &realModelName, &source, PH_COPY | PH_SEPARATE); } - zephir_array_append(&sqlModels, realModelName, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2436); - zephir_array_update_zval(&modelsInstances, realModelName, &model, PH_COPY | PH_SEPARATE); - } - zephir_update_property_this(getThis(), SL("_models"), models TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_modelsInstances"), modelsInstances TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliases"), sqlAliases TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_sqlAliasesModelsInstances"), sqlAliasesModelsInstances TSRMLS_CC); - ZEPHIR_INIT_VAR(sqlDelete); - array_init(sqlDelete); + zephir_array_append(&sqlModels, &realModelName, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2436); + zephir_array_update_zval(&modelsInstances, &realModelName, &model, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&table); + zephir_update_property_zval(this_ptr, SL("_models"), &models); + zephir_update_property_zval(this_ptr, SL("_modelsInstances"), &modelsInstances); + zephir_update_property_zval(this_ptr, SL("_sqlAliases"), &sqlAliases); + zephir_update_property_zval(this_ptr, SL("_sqlAliasesModelsInstances"), &sqlAliasesModelsInstances); + ZEPHIR_INIT_VAR(&sqlDelete); + array_init(&sqlDelete); zephir_array_update_string(&sqlDelete, SL("tables"), &sqlTables, PH_COPY | PH_SEPARATE); zephir_array_update_string(&sqlDelete, SL("models"), &sqlModels, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_VAR(where); - if (zephir_array_isset_string_fetch(&where, ast, SS("where"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_10$$14); - ZVAL_BOOL(_10$$14, 1); - ZEPHIR_CALL_METHOD(&_9$$14, this_ptr, "_getexpression", NULL, 355, where, _10$$14); + ZEPHIR_OBS_VAR(&where); + if (zephir_array_isset_string_fetch(&where, &ast, SL("where"), 0)) { + ZVAL_BOOL(&_8$$14, 1); + ZEPHIR_CALL_METHOD(&_7$$14, this_ptr, "_getexpression", NULL, 313, &where, &_8$$14); zephir_check_call_status(); - zephir_array_update_string(&sqlDelete, SL("where"), &_9$$14, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&sqlDelete, SL("where"), &_7$$14, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(limit); - if (zephir_array_isset_string_fetch(&limit, ast, SS("limit"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_11$$15, this_ptr, "_getlimitclause", NULL, 369, limit); + ZEPHIR_OBS_VAR(&limit); + if (zephir_array_isset_string_fetch(&limit, &ast, SL("limit"), 0)) { + ZEPHIR_CALL_METHOD(&_9$$15, this_ptr, "_getlimitclause", NULL, 327, &limit); zephir_check_call_status(); - zephir_array_update_string(&sqlDelete, SL("limit"), &_11$$15, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&sqlDelete, SL("limit"), &_9$$15, PH_COPY | PH_SEPARATE); } - RETURN_CCTOR(sqlDelete); + RETURN_CCTOR(&sqlDelete); } @@ -3156,85 +3740,97 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _prepareDelete) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, parse) { - zval *intermediate = NULL, *phql = NULL, *ast = NULL, *irPhql = NULL, *uniqueId = NULL, *type = NULL, *_0$$5, *_1$$7, *_2$$13, *_3$$13; + zval intermediate, phql, ast, irPhql, uniqueId, type, _0$$5, _1$$7, _2$$13, _3$$13; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&intermediate); + ZVAL_UNDEF(&phql); + ZVAL_UNDEF(&ast); + ZVAL_UNDEF(&irPhql); + ZVAL_UNDEF(&uniqueId); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$7); + ZVAL_UNDEF(&_2$$13); + ZVAL_UNDEF(&_3$$13); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(intermediate); - zephir_read_property_this(&intermediate, this_ptr, SL("_intermediate"), PH_NOISY_CC); - if (Z_TYPE_P(intermediate) == IS_ARRAY) { - RETURN_CCTOR(intermediate); + ZEPHIR_OBS_VAR(&intermediate); + zephir_read_property(&intermediate, this_ptr, SL("_intermediate"), PH_NOISY_CC); + if (Z_TYPE_P(&intermediate) == IS_ARRAY) { + RETURN_CCTOR(&intermediate); } - ZEPHIR_OBS_VAR(phql); - zephir_read_property_this(&phql, this_ptr, SL("_phql"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(ast); - ZEPHIR_LAST_CALL_STATUS = phql_parse_phql(ast, phql TSRMLS_CC); + ZEPHIR_OBS_VAR(&phql); + zephir_read_property(&phql, this_ptr, SL("_phql"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&ast); + ZEPHIR_LAST_CALL_STATUS = phql_parse_phql(&ast, &phql TSRMLS_CC); zephir_check_call_status(); - ZEPHIR_INIT_VAR(irPhql); - ZVAL_NULL(irPhql); - ZEPHIR_INIT_VAR(uniqueId); - ZVAL_NULL(uniqueId); - if (Z_TYPE_P(ast) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(uniqueId); - if (zephir_array_isset_string_fetch(&uniqueId, ast, SS("id"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_NVAR(irPhql); - _0$$5 = zephir_fetch_static_property_ce(phalcon_mvc_model_query_ce, SL("_irPhqlCache") TSRMLS_CC); - if (zephir_array_isset_fetch(&irPhql, _0$$5, uniqueId, 0 TSRMLS_CC)) { - if (Z_TYPE_P(irPhql) == IS_ARRAY) { - zephir_array_fetch_string(&_1$$7, ast, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2494 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_type"), _1$$7 TSRMLS_CC); - RETURN_CCTOR(irPhql); + ZEPHIR_INIT_VAR(&irPhql); + ZVAL_NULL(&irPhql); + ZEPHIR_INIT_VAR(&uniqueId); + ZVAL_NULL(&uniqueId); + if (Z_TYPE_P(&ast) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&uniqueId); + if (zephir_array_isset_string_fetch(&uniqueId, &ast, SL("id"), 0)) { + ZEPHIR_OBS_NVAR(&irPhql); + zephir_read_static_property_ce(&_0$$5, phalcon_mvc_model_query_ce, SL("_irPhqlCache"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&irPhql, &_0$$5, &uniqueId, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&irPhql) == IS_ARRAY) { + zephir_array_fetch_string(&_1$$7, &ast, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2494 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), &_1$$7); + RETURN_CCTOR(&irPhql); } } } - ZEPHIR_OBS_VAR(type); - if (zephir_array_isset_string_fetch(&type, ast, SS("type"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_ast"), ast TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); + ZEPHIR_OBS_VAR(&type); + if (zephir_array_isset_string_fetch(&type, &ast, SL("type"), 0)) { + zephir_update_property_zval(this_ptr, SL("_ast"), &ast); + zephir_update_property_zval(this_ptr, SL("_type"), &type); do { - if (ZEPHIR_IS_LONG(type, 309)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareselect", NULL, 360); + if (ZEPHIR_IS_LONG(&type, 309)) { + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareselect", NULL, 318); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(type, 306)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareinsert", NULL, 370); + if (ZEPHIR_IS_LONG(&type, 306)) { + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareinsert", NULL, 328); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(type, 300)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareupdate", NULL, 371); + if (ZEPHIR_IS_LONG(&type, 300)) { + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_prepareupdate", NULL, 329); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(type, 303)) { - ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_preparedelete", NULL, 372); + if (ZEPHIR_IS_LONG(&type, 303)) { + ZEPHIR_CALL_METHOD(&irPhql, this_ptr, "_preparedelete", NULL, 330); zephir_check_call_status(); break; } - ZEPHIR_INIT_VAR(_2$$13); - object_init_ex(_2$$13, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_3$$13); - ZEPHIR_CONCAT_SVSV(_3$$13, "Unknown statement ", type, ", when preparing: ", phql); - ZEPHIR_CALL_METHOD(NULL, _2$$13, "__construct", NULL, 9, _3$$13); + ZEPHIR_INIT_VAR(&_2$$13); + object_init_ex(&_2$$13, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_3$$13); + ZEPHIR_CONCAT_SVSV(&_3$$13, "Unknown statement ", &type, ", when preparing: ", &phql); + ZEPHIR_CALL_METHOD(NULL, &_2$$13, "__construct", NULL, 4, &_3$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_2$$13, "phalcon/mvc/model/query.zep", 2527 TSRMLS_CC); + zephir_throw_exception_debug(&_2$$13, "phalcon/mvc/model/query.zep", 2527 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); } } - if (Z_TYPE_P(irPhql) != IS_ARRAY) { + if (Z_TYPE_P(&irPhql) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Corrupted AST", "phalcon/mvc/model/query.zep", 2533); return; } - if (Z_TYPE_P(uniqueId) == IS_LONG) { - zephir_update_static_property_array_multi_ce(phalcon_mvc_model_query_ce, SL("_irPhqlCache"), &irPhql TSRMLS_CC, SL("z"), 1, uniqueId); + if (Z_TYPE_P(&uniqueId) == IS_LONG) { + zephir_update_static_property_array_multi_ce(phalcon_mvc_model_query_ce, SL("_irPhqlCache"), &irPhql TSRMLS_CC, SL("z"), 1, &uniqueId); } - zephir_update_property_this(getThis(), SL("_intermediate"), irPhql TSRMLS_CC); - RETURN_CCTOR(irPhql); + zephir_update_property_zval(this_ptr, SL("_intermediate"), &irPhql); + RETURN_CCTOR(&irPhql); } @@ -3243,7 +3839,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, parse) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getCache) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_cache"); @@ -3254,14 +3851,87 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getCache) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeSelect) { - zend_class_entry *_65$$63; - zval *_23$$25 = NULL, *_31$$28 = NULL, *_49$$59 = NULL, *_54$$61 = NULL; - HashTable *_1, *_9, *_13, *_21$$22, *_29$$27, *_34$$35, *_38$$41, *_47$$58, *_52$$60; - HashPosition _0, _8, _12, _20$$22, _28$$27, _33$$35, _37$$41, _46$$58, _51$$60; - zephir_fcall_cache_entry *_5 = NULL, *_6 = NULL, *_17 = NULL, *_18 = NULL, *_19 = NULL, *_26 = NULL; + zend_class_entry *_55$$63; + zval _17$$25, _23$$28, _39$$59, _44$$61; + zend_string *_10, *_27$$35, *_31$$41, *_43$$60; + zend_ulong _9, _26$$35, _30$$41, _42$$60; + zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL, *_13 = NULL, *_14 = NULL, *_15 = NULL, *_20 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, numberObjects = 0; - zend_bool simulate, haveObjects = 0, haveScalars = 0, isComplex = 0, isSimpleStd = 0, isKeepingSnapshots = 0, _43, _32$$19, _57$$51; - zval *intermediate, *bindParams, *bindTypes, *simulate_param = NULL, *manager = NULL, *modelName = NULL, *models = NULL, *model = NULL, *connection = NULL, *connectionTypes = NULL, *columns = NULL, *column = NULL, *selectColumns = NULL, *simpleColumnMap = NULL, *metaData = NULL, *aliasCopy = NULL, *sqlColumn = NULL, *attributes = NULL, *instance = NULL, *columnMap = NULL, *attribute = NULL, *columnAlias = NULL, *sqlAlias = NULL, *dialect = NULL, *sqlSelect = NULL, *bindCounts = NULL, *processed = NULL, *wildcard = NULL, *value = NULL, *processedTypes = NULL, *typeWildcard = NULL, *result = NULL, *resultData = NULL, *cache = NULL, *resultObject = NULL, *columns1 = NULL, *typesColumnMap = NULL, *wildcardValue = NULL, *resultsetClassName = NULL, **_2, **_10, **_14, *_41, *_44 = NULL, *_3$$3, *_4$$4 = NULL, *_7$$5 = NULL, *_11$$7, *_15$$19, *_16$$20, **_22$$22, *_25$$22 = NULL, *_24$$25 = NULL, *_27$$26 = NULL, **_30$$27, **_35$$35, *_36$$39 = NULL, **_39$$41, *_40$$43 = NULL, *_42$$47 = NULL, *_45$$58 = NULL, **_48$$58, *_50$$59 = NULL, **_53$$60, *_55$$61 = NULL, *_56$$53 = NULL, *_67$$51, *_58$$64, *_59$$64, _60$$63, *_61$$63 = NULL, *_64$$63 = NULL, *_66$$63, *_62$$65, *_63$$65; + zend_bool simulate, haveObjects = 0, haveScalars = 0, isComplex = 0, isSimpleStd = 0, isKeepingSnapshots = 0, _35, _24$$19, _47$$51; + zval *intermediate, intermediate_sub, *bindParams, bindParams_sub, *bindTypes, bindTypes_sub, *simulate_param = NULL, __$true, __$null, manager, modelName, models, model, connection, connectionTypes, columns, column, selectColumns, simpleColumnMap, metaData, aliasCopy, sqlColumn, attributes, instance, columnMap, attribute, columnAlias, sqlAlias, dialect, sqlSelect, bindCounts, processed, wildcard, value, processedTypes, typeWildcard, result, resultData, cache, resultObject, columns1, typesColumnMap, wildcardValue, resultsetClassName, *_0, *_6, *_8, _33, _36, _1$$3, _2$$4, _5$$5, _7$$7, _11$$19, _12$$20, *_16$$22, _19$$22, _18$$25, _21$$26, *_22$$27, *_25$$35, _28$$39, *_29$$41, _32$$43, _34$$47, _37$$58, *_38$$58, _40$$59, *_41$$60, _45$$61, _46$$53, _57$$51, _48$$64, _49$$64, _50$$63, _51$$63, _54$$63, _56$$63, _52$$65, _53$$65; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&intermediate_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&connectionTypes); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&selectColumns); + ZVAL_UNDEF(&simpleColumnMap); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&aliasCopy); + ZVAL_UNDEF(&sqlColumn); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&instance); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&columnAlias); + ZVAL_UNDEF(&sqlAlias); + ZVAL_UNDEF(&dialect); + ZVAL_UNDEF(&sqlSelect); + ZVAL_UNDEF(&bindCounts); + ZVAL_UNDEF(&processed); + ZVAL_UNDEF(&wildcard); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&processedTypes); + ZVAL_UNDEF(&typeWildcard); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&resultData); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&resultObject); + ZVAL_UNDEF(&columns1); + ZVAL_UNDEF(&typesColumnMap); + ZVAL_UNDEF(&wildcardValue); + ZVAL_UNDEF(&resultsetClassName); + ZVAL_UNDEF(&_33); + ZVAL_UNDEF(&_36); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_11$$19); + ZVAL_UNDEF(&_12$$20); + ZVAL_UNDEF(&_19$$22); + ZVAL_UNDEF(&_18$$25); + ZVAL_UNDEF(&_21$$26); + ZVAL_UNDEF(&_28$$39); + ZVAL_UNDEF(&_32$$43); + ZVAL_UNDEF(&_34$$47); + ZVAL_UNDEF(&_37$$58); + ZVAL_UNDEF(&_40$$59); + ZVAL_UNDEF(&_45$$61); + ZVAL_UNDEF(&_46$$53); + ZVAL_UNDEF(&_57$$51); + ZVAL_UNDEF(&_48$$64); + ZVAL_UNDEF(&_49$$64); + ZVAL_UNDEF(&_50$$63); + ZVAL_UNDEF(&_51$$63); + ZVAL_UNDEF(&_54$$63); + ZVAL_UNDEF(&_56$$63); + ZVAL_UNDEF(&_52$$65); + ZVAL_UNDEF(&_53$$65); + ZVAL_UNDEF(&_17$$25); + ZVAL_UNDEF(&_23$$28); + ZVAL_UNDEF(&_39$$59); + ZVAL_UNDEF(&_44$$61); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &intermediate, &bindParams, &bindTypes, &simulate_param); @@ -3274,59 +3944,57 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeSelect) { } - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(connectionTypes); - array_init(connectionTypes); - ZEPHIR_OBS_VAR(models); + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&connectionTypes); + array_init(&connectionTypes); + ZEPHIR_OBS_VAR(&models); zephir_array_fetch_string(&models, intermediate, SL("models"), PH_NOISY, "phalcon/mvc/model/query.zep", 2576 TSRMLS_CC); - zephir_is_iterable(models, &_1, &_0, 0, 0, "phalcon/mvc/model/query.zep", 2597); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HVALUE(modelName, _2); - ZEPHIR_OBS_NVAR(model); - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsInstances"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&model, _3$$3, modelName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_4$$4); - ZVAL_BOOL(_4$$4, 1); - ZEPHIR_CALL_METHOD(&model, manager, "load", &_5, 0, modelName, _4$$4); + zephir_is_iterable(&models, 0, "phalcon/mvc/model/query.zep", 2597); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&models), _0) + { + ZEPHIR_INIT_NVAR(&modelName); + ZVAL_COPY(&modelName, _0); + ZEPHIR_OBS_NVAR(&model); + zephir_read_property(&_1$$3, this_ptr, SL("_modelsInstances"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&model, &_1$$3, &modelName, 0 TSRMLS_CC))) { + ZVAL_BOOL(&_2$$4, 1); + ZEPHIR_CALL_METHOD(&model, &manager, "load", &_3, 0, &modelName, &_2$$4); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_modelsInstances"), modelName, model TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_modelsInstances"), &modelName, &model TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&connection, this_ptr, "getreadconnection", &_6, 0, model, intermediate, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(&connection, this_ptr, "getreadconnection", &_4, 0, &model, intermediate, bindParams, bindTypes); zephir_check_call_status(); - if (Z_TYPE_P(connection) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_7$$5, connection, "gettype", NULL, 0); + if (Z_TYPE_P(&connection) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&_5$$5, &connection, "gettype", NULL, 0); zephir_check_call_status(); - zephir_array_update_zval(&connectionTypes, _7$$5, &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - if (zephir_fast_count_int(connectionTypes TSRMLS_CC) == 2) { + zephir_array_update_zval(&connectionTypes, &_5$$5, &__$true, PH_COPY | PH_SEPARATE); + if (zephir_fast_count_int(&connectionTypes TSRMLS_CC) == 2) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot use models of different database systems in the same query", "phalcon/mvc/model/query.zep", 2592); return; } } - } - ZEPHIR_OBS_VAR(columns); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&modelName); + ZEPHIR_OBS_VAR(&columns); zephir_array_fetch_string(&columns, intermediate, SL("columns"), PH_NOISY, "phalcon/mvc/model/query.zep", 2597 TSRMLS_CC); haveObjects = 0; haveScalars = 0; isComplex = 0; numberObjects = 0; - ZEPHIR_CPY_WRT(columns1, columns); - zephir_is_iterable(columns, &_9, &_8, 0, 0, "phalcon/mvc/model/query.zep", 2624); - for ( - ; zend_hash_get_current_data_ex(_9, (void**) &_10, &_8) == SUCCESS - ; zend_hash_move_forward_ex(_9, &_8) - ) { - ZEPHIR_GET_HVALUE(column, _10); - if (Z_TYPE_P(column) != IS_ARRAY) { + ZEPHIR_CPY_WRT(&columns1, &columns); + zephir_is_iterable(&columns, 0, "phalcon/mvc/model/query.zep", 2624); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&columns), _6) + { + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _6); + if (Z_TYPE_P(&column) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid column definition", "phalcon/mvc/model/query.zep", 2610); return; } - zephir_array_fetch_string(&_11$$7, column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2613 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_11$$7, "scalar")) { - if (!(zephir_array_isset_string(column, SS("balias")))) { + zephir_array_fetch_string(&_7$$7, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2613 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_7$$7, "scalar")) { + if (!(zephir_array_isset_string(&column, SL("balias")))) { isComplex = 1; } haveScalars = 1; @@ -3334,7 +4002,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeSelect) { haveObjects = 1; numberObjects++; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); if (isComplex == 0) { if (haveObjects == 1) { if (haveScalars == 1) { @@ -3350,325 +4019,347 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeSelect) { isSimpleStd = 1; } } - ZEPHIR_INIT_VAR(instance); - ZVAL_NULL(instance); - ZEPHIR_INIT_VAR(selectColumns); - array_init(selectColumns); - ZEPHIR_INIT_VAR(simpleColumnMap); - array_init(simpleColumnMap); - ZEPHIR_OBS_VAR(metaData); - zephir_read_property_this(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); - zephir_is_iterable(columns, &_13, &_12, 0, 0, "phalcon/mvc/model/query.zep", 2723); - for ( - ; zend_hash_get_current_data_ex(_13, (void**) &_14, &_12) == SUCCESS - ; zend_hash_move_forward_ex(_13, &_12) - ) { - ZEPHIR_GET_HMKEY(aliasCopy, _13, _12); - ZEPHIR_GET_HVALUE(column, _14); - ZEPHIR_OBS_NVAR(sqlColumn); - zephir_array_fetch_string(&sqlColumn, column, SL("column"), PH_NOISY, "phalcon/mvc/model/query.zep", 2648 TSRMLS_CC); - zephir_array_fetch_string(&_15$$19, column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2651 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_15$$19, "object")) { - ZEPHIR_OBS_NVAR(modelName); - zephir_array_fetch_string(&modelName, column, SL("model"), PH_NOISY, "phalcon/mvc/model/query.zep", 2653 TSRMLS_CC); - ZEPHIR_OBS_NVAR(instance); - _16$$20 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsInstances"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&instance, _16$$20, modelName, 0 TSRMLS_CC))) { - ZEPHIR_CALL_METHOD(&instance, manager, "load", &_17, 0, modelName); + ZEPHIR_INIT_VAR(&instance); + ZVAL_NULL(&instance); + ZEPHIR_INIT_VAR(&selectColumns); + array_init(&selectColumns); + ZEPHIR_INIT_VAR(&simpleColumnMap); + array_init(&simpleColumnMap); + ZEPHIR_OBS_VAR(&metaData); + zephir_read_property(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); + zephir_is_iterable(&columns, 0, "phalcon/mvc/model/query.zep", 2723); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columns), _9, _10, _8) + { + ZEPHIR_INIT_NVAR(&aliasCopy); + if (_10 != NULL) { + ZVAL_STR_COPY(&aliasCopy, _10); + } else { + ZVAL_LONG(&aliasCopy, _9); + } + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _8); + ZEPHIR_OBS_NVAR(&sqlColumn); + zephir_array_fetch_string(&sqlColumn, &column, SL("column"), PH_NOISY, "phalcon/mvc/model/query.zep", 2648 TSRMLS_CC); + zephir_array_fetch_string(&_11$$19, &column, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2651 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_11$$19, "object")) { + ZEPHIR_OBS_NVAR(&modelName); + zephir_array_fetch_string(&modelName, &column, SL("model"), PH_NOISY, "phalcon/mvc/model/query.zep", 2653 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&instance); + zephir_read_property(&_12$$20, this_ptr, SL("_modelsInstances"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&instance, &_12$$20, &modelName, 0 TSRMLS_CC))) { + ZEPHIR_CALL_METHOD(&instance, &manager, "load", &_13, 0, &modelName); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_modelsInstances"), modelName, instance TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_modelsInstances"), &modelName, &instance TSRMLS_CC); } - ZEPHIR_CALL_METHOD(&attributes, metaData, "getattributes", &_18, 0, instance); + ZEPHIR_CALL_METHOD(&attributes, &metaData, "getattributes", &_14, 0, &instance); zephir_check_call_status(); if (isComplex == 1) { if (ZEPHIR_GLOBAL(orm).column_renaming) { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", &_19, 0, instance); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getcolumnmap", &_15, 0, &instance); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } - zephir_is_iterable(attributes, &_21$$22, &_20$$22, 0, 0, "phalcon/mvc/model/query.zep", 2679); - for ( - ; zend_hash_get_current_data_ex(_21$$22, (void**) &_22$$22, &_20$$22) == SUCCESS - ; zend_hash_move_forward_ex(_21$$22, &_20$$22) - ) { - ZEPHIR_GET_HVALUE(attribute, _22$$22); - ZEPHIR_INIT_NVAR(_23$$25); - zephir_create_array(_23$$25, 3, 0 TSRMLS_CC); - zephir_array_fast_append(_23$$25, attribute); - zephir_array_fast_append(_23$$25, sqlColumn); - ZEPHIR_INIT_LNVAR(_24$$25); - ZEPHIR_CONCAT_SVSV(_24$$25, "_", sqlColumn, "_", attribute); - zephir_array_fast_append(_23$$25, _24$$25); - zephir_array_append(&selectColumns, _23$$25, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2675); - } - zephir_array_update_multi(&columns1, &instance TSRMLS_CC, SL("zs"), 3, aliasCopy, SL("instance")); - zephir_array_update_multi(&columns1, &attributes TSRMLS_CC, SL("zs"), 3, aliasCopy, SL("attributes")); - zephir_array_update_multi(&columns1, &columnMap TSRMLS_CC, SL("zs"), 3, aliasCopy, SL("columnMap")); - ZEPHIR_CALL_METHOD(&_25$$22, manager, "iskeepingsnapshots", &_26, 0, instance); + zephir_is_iterable(&attributes, 0, "phalcon/mvc/model/query.zep", 2679); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _16$$22) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _16$$22); + ZEPHIR_INIT_NVAR(&_17$$25); + zephir_create_array(&_17$$25, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&_17$$25, &attribute); + zephir_array_fast_append(&_17$$25, &sqlColumn); + ZEPHIR_INIT_LNVAR(_18$$25); + ZEPHIR_CONCAT_SVSV(&_18$$25, "_", &sqlColumn, "_", &attribute); + zephir_array_fast_append(&_17$$25, &_18$$25); + zephir_array_append(&selectColumns, &_17$$25, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2675); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); + zephir_array_update_multi(&columns1, &instance TSRMLS_CC, SL("zs"), 3, &aliasCopy, SL("instance")); + zephir_array_update_multi(&columns1, &attributes TSRMLS_CC, SL("zs"), 3, &aliasCopy, SL("attributes")); + zephir_array_update_multi(&columns1, &columnMap TSRMLS_CC, SL("zs"), 3, &aliasCopy, SL("columnMap")); + ZEPHIR_CALL_METHOD(&_19$$22, &manager, "iskeepingsnapshots", &_20, 0, &instance); zephir_check_call_status(); - isKeepingSnapshots = zephir_get_boolval(_25$$22); + isKeepingSnapshots = zephir_get_boolval(&_19$$22); if (isKeepingSnapshots) { - ZEPHIR_INIT_NVAR(_27$$26); - ZVAL_BOOL(_27$$26, isKeepingSnapshots); - zephir_array_update_multi(&columns1, &_27$$26 TSRMLS_CC, SL("zs"), 3, aliasCopy, SL("keepSnapshots")); + ZEPHIR_INIT_NVAR(&_21$$26); + ZVAL_BOOL(&_21$$26, isKeepingSnapshots); + zephir_array_update_multi(&columns1, &_21$$26 TSRMLS_CC, SL("zs"), 3, &aliasCopy, SL("keepSnapshots")); } } else { - zephir_is_iterable(attributes, &_29$$27, &_28$$27, 0, 0, "phalcon/mvc/model/query.zep", 2697); - for ( - ; zend_hash_get_current_data_ex(_29$$27, (void**) &_30$$27, &_28$$27) == SUCCESS - ; zend_hash_move_forward_ex(_29$$27, &_28$$27) - ) { - ZEPHIR_GET_HVALUE(attribute, _30$$27); - ZEPHIR_INIT_NVAR(_31$$28); - zephir_create_array(_31$$28, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_31$$28, attribute); - zephir_array_fast_append(_31$$28, sqlColumn); - zephir_array_append(&selectColumns, _31$$28, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2695); - } + zephir_is_iterable(&attributes, 0, "phalcon/mvc/model/query.zep", 2697); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _22$$27) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _22$$27); + ZEPHIR_INIT_NVAR(&_23$$28); + zephir_create_array(&_23$$28, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_23$$28, &attribute); + zephir_array_fast_append(&_23$$28, &sqlColumn); + zephir_array_append(&selectColumns, &_23$$28, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2695); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); } } else { - ZEPHIR_INIT_NVAR(columnAlias); - if (Z_TYPE_P(aliasCopy) == IS_LONG) { - zephir_create_array(columnAlias, 2, 0 TSRMLS_CC); - zephir_array_fast_append(columnAlias, sqlColumn); - zephir_array_fast_append(columnAlias, ZEPHIR_GLOBAL(global_null)); + ZEPHIR_INIT_NVAR(&columnAlias); + if (Z_TYPE_P(&aliasCopy) == IS_LONG) { + zephir_create_array(&columnAlias, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&columnAlias, &sqlColumn); + zephir_array_fast_append(&columnAlias, &__$null); } else { - zephir_create_array(columnAlias, 3, 0 TSRMLS_CC); - zephir_array_fast_append(columnAlias, sqlColumn); - zephir_array_fast_append(columnAlias, ZEPHIR_GLOBAL(global_null)); - zephir_array_fast_append(columnAlias, aliasCopy); + zephir_create_array(&columnAlias, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&columnAlias, &sqlColumn); + zephir_array_fast_append(&columnAlias, &__$null); + zephir_array_fast_append(&columnAlias, &aliasCopy); } - zephir_array_append(&selectColumns, columnAlias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2708); + zephir_array_append(&selectColumns, &columnAlias, PH_SEPARATE, "phalcon/mvc/model/query.zep", 2708); } - _32$$19 = isComplex == 0; - if (_32$$19) { - _32$$19 = isSimpleStd == 1; + _24$$19 = isComplex == 0; + if (_24$$19) { + _24$$19 = isSimpleStd == 1; } - if (_32$$19) { - ZEPHIR_OBS_NVAR(sqlAlias); - if (zephir_array_isset_string_fetch(&sqlAlias, column, SS("sqlAlias"), 0 TSRMLS_CC)) { - zephir_array_update_zval(&simpleColumnMap, sqlAlias, &aliasCopy, PH_COPY | PH_SEPARATE); + if (_24$$19) { + ZEPHIR_OBS_NVAR(&sqlAlias); + if (zephir_array_isset_string_fetch(&sqlAlias, &column, SL("sqlAlias"), 0)) { + zephir_array_update_zval(&simpleColumnMap, &sqlAlias, &aliasCopy, PH_COPY | PH_SEPARATE); } else { - zephir_array_update_zval(&simpleColumnMap, aliasCopy, &aliasCopy, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&simpleColumnMap, &aliasCopy, &aliasCopy, PH_COPY | PH_SEPARATE); } } - } - ZEPHIR_INIT_VAR(bindCounts); - array_init(bindCounts); - zephir_array_update_string(&intermediate, SL("columns"), &selectColumns, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); + ZEPHIR_INIT_NVAR(&aliasCopy); + ZEPHIR_INIT_VAR(&bindCounts); + array_init(&bindCounts); + zephir_array_update_string(intermediate, SL("columns"), &selectColumns, PH_COPY | PH_SEPARATE); if (Z_TYPE_P(bindParams) == IS_ARRAY) { - ZEPHIR_INIT_VAR(processed); - array_init(processed); - zephir_is_iterable(bindParams, &_34$$35, &_33$$35, 0, 0, "phalcon/mvc/model/query.zep", 2744); - for ( - ; zend_hash_get_current_data_ex(_34$$35, (void**) &_35$$35, &_33$$35) == SUCCESS - ; zend_hash_move_forward_ex(_34$$35, &_33$$35) - ) { - ZEPHIR_GET_HMKEY(wildcard, _34$$35, _33$$35); - ZEPHIR_GET_HVALUE(value, _35$$35); - if (Z_TYPE_P(wildcard) == IS_LONG) { - ZEPHIR_INIT_NVAR(wildcardValue); - ZEPHIR_CONCAT_SV(wildcardValue, ":", wildcard); + ZEPHIR_INIT_VAR(&processed); + array_init(&processed); + zephir_is_iterable(bindParams, 0, "phalcon/mvc/model/query.zep", 2744); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(bindParams), _26$$35, _27$$35, _25$$35) + { + ZEPHIR_INIT_NVAR(&wildcard); + if (_27$$35 != NULL) { + ZVAL_STR_COPY(&wildcard, _27$$35); } else { - ZEPHIR_CPY_WRT(wildcardValue, wildcard); + ZVAL_LONG(&wildcard, _26$$35); } - zephir_array_update_zval(&processed, wildcardValue, &value, PH_COPY | PH_SEPARATE); - if (Z_TYPE_P(value) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_36$$39); - ZVAL_LONG(_36$$39, zephir_fast_count_int(value TSRMLS_CC)); - zephir_array_update_zval(&bindCounts, wildcardValue, &_36$$39, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _25$$35); + if (Z_TYPE_P(&wildcard) == IS_LONG) { + ZEPHIR_INIT_NVAR(&wildcardValue); + ZEPHIR_CONCAT_SV(&wildcardValue, ":", &wildcard); + } else { + ZEPHIR_CPY_WRT(&wildcardValue, &wildcard); } - } + zephir_array_update_zval(&processed, &wildcardValue, &value, PH_COPY | PH_SEPARATE); + if (Z_TYPE_P(&value) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_28$$39); + ZVAL_LONG(&_28$$39, zephir_fast_count_int(&value TSRMLS_CC)); + zephir_array_update_zval(&bindCounts, &wildcardValue, &_28$$39, PH_COPY | PH_SEPARATE); + } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&wildcard); } else { - ZEPHIR_CPY_WRT(processed, bindParams); + ZEPHIR_CPY_WRT(&processed, bindParams); } if (Z_TYPE_P(bindTypes) == IS_ARRAY) { - ZEPHIR_INIT_VAR(processedTypes); - array_init(processedTypes); - zephir_is_iterable(bindTypes, &_38$$41, &_37$$41, 0, 0, "phalcon/mvc/model/query.zep", 2760); - for ( - ; zend_hash_get_current_data_ex(_38$$41, (void**) &_39$$41, &_37$$41) == SUCCESS - ; zend_hash_move_forward_ex(_38$$41, &_37$$41) - ) { - ZEPHIR_GET_HMKEY(typeWildcard, _38$$41, _37$$41); - ZEPHIR_GET_HVALUE(value, _39$$41); - if (Z_TYPE_P(typeWildcard) == IS_LONG) { - ZEPHIR_INIT_LNVAR(_40$$43); - ZEPHIR_CONCAT_SV(_40$$43, ":", typeWildcard); - zephir_array_update_zval(&processedTypes, _40$$43, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&processedTypes); + array_init(&processedTypes); + zephir_is_iterable(bindTypes, 0, "phalcon/mvc/model/query.zep", 2760); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(bindTypes), _30$$41, _31$$41, _29$$41) + { + ZEPHIR_INIT_NVAR(&typeWildcard); + if (_31$$41 != NULL) { + ZVAL_STR_COPY(&typeWildcard, _31$$41); } else { - zephir_array_update_zval(&processedTypes, typeWildcard, &value, PH_COPY | PH_SEPARATE); + ZVAL_LONG(&typeWildcard, _30$$41); } - } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _29$$41); + if (Z_TYPE_P(&typeWildcard) == IS_LONG) { + ZEPHIR_INIT_LNVAR(_32$$43); + ZEPHIR_CONCAT_SV(&_32$$43, ":", &typeWildcard); + zephir_array_update_zval(&processedTypes, &_32$$43, &value, PH_COPY | PH_SEPARATE); + } else { + zephir_array_update_zval(&processedTypes, &typeWildcard, &value, PH_COPY | PH_SEPARATE); + } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&typeWildcard); } else { - ZEPHIR_CPY_WRT(processedTypes, bindTypes); + ZEPHIR_CPY_WRT(&processedTypes, bindTypes); } - if (zephir_fast_count_int(bindCounts TSRMLS_CC)) { - zephir_array_update_string(&intermediate, SL("bindCounts"), &bindCounts, PH_COPY | PH_SEPARATE); + if (zephir_fast_count_int(&bindCounts TSRMLS_CC)) { + zephir_array_update_string(intermediate, SL("bindCounts"), &bindCounts, PH_COPY | PH_SEPARATE); } - ZEPHIR_CALL_METHOD(&dialect, connection, "getdialect", NULL, 0); + ZEPHIR_CALL_METHOD(&dialect, &connection, "getdialect", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&sqlSelect, dialect, "select", NULL, 0, intermediate); + ZEPHIR_CALL_METHOD(&sqlSelect, &dialect, "select", NULL, 0, intermediate); zephir_check_call_status(); - _41 = zephir_fetch_nproperty_this(this_ptr, SL("_sharedLock"), PH_NOISY_CC); - if (zephir_is_true(_41)) { - ZEPHIR_CALL_METHOD(&_42$$47, dialect, "sharedlock", NULL, 0, sqlSelect); + zephir_read_property(&_33, this_ptr, SL("_sharedLock"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_33)) { + ZEPHIR_CALL_METHOD(&_34$$47, &dialect, "sharedlock", NULL, 0, &sqlSelect); zephir_check_call_status(); - ZEPHIR_CPY_WRT(sqlSelect, _42$$47); + ZEPHIR_CPY_WRT(&sqlSelect, &_34$$47); } if (simulate) { zephir_create_array(return_value, 3, 0 TSRMLS_CC); - zephir_array_update_string(&return_value, SL("sql"), &sqlSelect, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("bind"), &processed, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&return_value, SL("bindTypes"), &processedTypes, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("sql"), &sqlSelect, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("bind"), &processed, PH_COPY | PH_SEPARATE); + zephir_array_update_string(return_value, SL("bindTypes"), &processedTypes, PH_COPY | PH_SEPARATE); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&result, connection, "query", NULL, 0, sqlSelect, processed, processedTypes); + ZEPHIR_CALL_METHOD(&result, &connection, "query", NULL, 0, &sqlSelect, &processed, &processedTypes); zephir_check_call_status(); - _43 = zephir_instance_of_ev(result, phalcon_db_resultinterface_ce TSRMLS_CC); - if (_43) { - ZEPHIR_CALL_METHOD(&_44, result, "numrows", NULL, 0); + _35 = zephir_instance_of_ev(&result, phalcon_db_resultinterface_ce TSRMLS_CC); + if (_35) { + ZEPHIR_CALL_METHOD(&_36, &result, "numrows", NULL, 0); zephir_check_call_status(); - _43 = zephir_is_true(_44); + _35 = zephir_is_true(&_36); } - if (_43) { - ZEPHIR_CPY_WRT(resultData, result); + if (_35) { + ZEPHIR_CPY_WRT(&resultData, &result); } else { - ZEPHIR_INIT_NVAR(resultData); - ZVAL_BOOL(resultData, 0); + ZEPHIR_INIT_NVAR(&resultData); + ZVAL_BOOL(&resultData, 0); } - ZEPHIR_OBS_VAR(cache); - zephir_read_property_this(&cache, this_ptr, SL("_cache"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&cache); + zephir_read_property(&cache, this_ptr, SL("_cache"), PH_NOISY_CC); if (isComplex == 0) { if (isSimpleStd == 1) { - ZEPHIR_INIT_VAR(resultObject); - object_init_ex(resultObject, phalcon_mvc_model_row_ce); - if (zephir_has_constructor(resultObject TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, resultObject, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&resultObject); + object_init_ex(&resultObject, phalcon_mvc_model_row_ce); + if (zephir_has_constructor(&resultObject TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &resultObject, "__construct", NULL, 0); zephir_check_call_status(); } isKeepingSnapshots = 0; } else { - if (Z_TYPE_P(instance) == IS_OBJECT) { - ZEPHIR_CPY_WRT(resultObject, instance); + if (Z_TYPE_P(&instance) == IS_OBJECT) { + ZEPHIR_CPY_WRT(&resultObject, &instance); } else { - ZEPHIR_CPY_WRT(resultObject, model); + ZEPHIR_CPY_WRT(&resultObject, &model); } if (!(ZEPHIR_GLOBAL(orm).cast_on_hydrate)) { - ZEPHIR_CALL_METHOD(&simpleColumnMap, metaData, "getcolumnmap", NULL, 0, resultObject); + ZEPHIR_CALL_METHOD(&simpleColumnMap, &metaData, "getcolumnmap", NULL, 0, &resultObject); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, resultObject); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getcolumnmap", NULL, 0, &resultObject); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&typesColumnMap, metaData, "getdatatypes", NULL, 0, resultObject); + ZEPHIR_CALL_METHOD(&typesColumnMap, &metaData, "getdatatypes", NULL, 0, &resultObject); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(simpleColumnMap); - if (Z_TYPE_P(columnMap) == IS_NULL) { - array_init(simpleColumnMap); - ZEPHIR_CALL_METHOD(&_45$$58, metaData, "getattributes", NULL, 0, resultObject); + ZEPHIR_INIT_NVAR(&simpleColumnMap); + if (Z_TYPE_P(&columnMap) == IS_NULL) { + array_init(&simpleColumnMap); + ZEPHIR_CALL_METHOD(&_37$$58, &metaData, "getattributes", NULL, 0, &resultObject); zephir_check_call_status(); - zephir_is_iterable(_45$$58, &_47$$58, &_46$$58, 0, 0, "phalcon/mvc/model/query.zep", 2846); - for ( - ; zend_hash_get_current_data_ex(_47$$58, (void**) &_48$$58, &_46$$58) == SUCCESS - ; zend_hash_move_forward_ex(_47$$58, &_46$$58) - ) { - ZEPHIR_GET_HVALUE(attribute, _48$$58); - ZEPHIR_INIT_NVAR(_49$$59); - zephir_create_array(_49$$59, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_49$$59, attribute); - ZEPHIR_OBS_NVAR(_50$$59); - zephir_array_fetch(&_50$$59, typesColumnMap, attribute, PH_NOISY, "phalcon/mvc/model/query.zep", 2844 TSRMLS_CC); - zephir_array_fast_append(_49$$59, _50$$59); - zephir_array_update_zval(&simpleColumnMap, attribute, &_49$$59, PH_COPY | PH_SEPARATE); - } + zephir_is_iterable(&_37$$58, 0, "phalcon/mvc/model/query.zep", 2846); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_37$$58), _38$$58) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _38$$58); + ZEPHIR_INIT_NVAR(&_39$$59); + zephir_create_array(&_39$$59, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_39$$59, &attribute); + ZEPHIR_OBS_NVAR(&_40$$59); + zephir_array_fetch(&_40$$59, &typesColumnMap, &attribute, PH_NOISY, "phalcon/mvc/model/query.zep", 2844 TSRMLS_CC); + zephir_array_fast_append(&_39$$59, &_40$$59); + zephir_array_update_zval(&simpleColumnMap, &attribute, &_39$$59, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); } else { - array_init(simpleColumnMap); - zephir_is_iterable(columnMap, &_52$$60, &_51$$60, 0, 0, "phalcon/mvc/model/query.zep", 2851); - for ( - ; zend_hash_get_current_data_ex(_52$$60, (void**) &_53$$60, &_51$$60) == SUCCESS - ; zend_hash_move_forward_ex(_52$$60, &_51$$60) - ) { - ZEPHIR_GET_HMKEY(column, _52$$60, _51$$60); - ZEPHIR_GET_HVALUE(attribute, _53$$60); - ZEPHIR_INIT_NVAR(_54$$61); - zephir_create_array(_54$$61, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_54$$61, attribute); - ZEPHIR_OBS_NVAR(_55$$61); - zephir_array_fetch(&_55$$61, typesColumnMap, column, PH_NOISY, "phalcon/mvc/model/query.zep", 2849 TSRMLS_CC); - zephir_array_fast_append(_54$$61, _55$$61); - zephir_array_update_zval(&simpleColumnMap, column, &_54$$61, PH_COPY | PH_SEPARATE); - } + array_init(&simpleColumnMap); + zephir_is_iterable(&columnMap, 0, "phalcon/mvc/model/query.zep", 2851); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columnMap), _42$$60, _43$$60, _41$$60) + { + ZEPHIR_INIT_NVAR(&column); + if (_43$$60 != NULL) { + ZVAL_STR_COPY(&column, _43$$60); + } else { + ZVAL_LONG(&column, _42$$60); + } + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _41$$60); + ZEPHIR_INIT_NVAR(&_44$$61); + zephir_create_array(&_44$$61, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_44$$61, &attribute); + ZEPHIR_OBS_NVAR(&_45$$61); + zephir_array_fetch(&_45$$61, &typesColumnMap, &column, PH_NOISY, "phalcon/mvc/model/query.zep", 2849 TSRMLS_CC); + zephir_array_fast_append(&_44$$61, &_45$$61); + zephir_array_update_zval(&simpleColumnMap, &column, &_44$$61, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); + ZEPHIR_INIT_NVAR(&column); } } - ZEPHIR_CALL_METHOD(&_56$$53, manager, "iskeepingsnapshots", NULL, 0, resultObject); + ZEPHIR_CALL_METHOD(&_46$$53, &manager, "iskeepingsnapshots", NULL, 0, &resultObject); zephir_check_call_status(); - isKeepingSnapshots = zephir_get_boolval(_56$$53); + isKeepingSnapshots = zephir_get_boolval(&_46$$53); } - _57$$51 = zephir_instance_of_ev(resultObject, phalcon_mvc_modelinterface_ce TSRMLS_CC); - if (_57$$51) { - _57$$51 = (zephir_method_exists_ex(resultObject, SS("getresultsetclass") TSRMLS_CC) == SUCCESS); + _47$$51 = zephir_instance_of_ev(&resultObject, phalcon_mvc_modelinterface_ce TSRMLS_CC); + if (_47$$51) { + _47$$51 = (zephir_method_exists_ex(&resultObject, SL("getresultsetclass") TSRMLS_CC) == SUCCESS); } - if (_57$$51) { - ZEPHIR_CALL_METHOD(&resultsetClassName, resultObject, "getresultsetclass", NULL, 0); + if (_47$$51) { + ZEPHIR_CALL_METHOD(&resultsetClassName, &resultObject, "getresultsetclass", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(resultsetClassName)) { - if (!(zephir_class_exists(resultsetClassName, 1 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_58$$64); - object_init_ex(_58$$64, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_59$$64); - ZEPHIR_CONCAT_SVS(_59$$64, "Resultset class \"", resultsetClassName, "\" not found"); - ZEPHIR_CALL_METHOD(NULL, _58$$64, "__construct", NULL, 9, _59$$64); + if (zephir_is_true(&resultsetClassName)) { + if (!(zephir_class_exists(&resultsetClassName, 1 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_48$$64); + object_init_ex(&_48$$64, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_49$$64); + ZEPHIR_CONCAT_SVS(&_49$$64, "Resultset class \"", &resultsetClassName, "\" not found"); + ZEPHIR_CALL_METHOD(NULL, &_48$$64, "__construct", NULL, 4, &_49$$64); zephir_check_call_status(); - zephir_throw_exception_debug(_58$$64, "phalcon/mvc/model/query.zep", 2865 TSRMLS_CC); + zephir_throw_exception_debug(&_48$$64, "phalcon/mvc/model/query.zep", 2865 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_SINIT_VAR(_60$$63); - ZVAL_STRING(&_60$$63, "Phalcon\\Mvc\\Model\\ResultsetInterface", 0); - ZEPHIR_CALL_FUNCTION(&_61$$63, "is_subclass_of", NULL, 343, resultsetClassName, &_60$$63); + ZEPHIR_INIT_VAR(&_50$$63); + ZVAL_STRING(&_50$$63, "Phalcon\\Mvc\\Model\\ResultsetInterface"); + ZEPHIR_CALL_FUNCTION(&_51$$63, "is_subclass_of", NULL, 303, &resultsetClassName, &_50$$63); zephir_check_call_status(); - if (!(zephir_is_true(_61$$63))) { - ZEPHIR_INIT_VAR(_62$$65); - object_init_ex(_62$$65, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_63$$65); - ZEPHIR_CONCAT_SVS(_63$$65, "Resultset class \"", resultsetClassName, "\" must be an implementation of Phalcon\\Mvc\\Model\\ResultsetInterface"); - ZEPHIR_CALL_METHOD(NULL, _62$$65, "__construct", NULL, 9, _63$$65); + if (!(zephir_is_true(&_51$$63))) { + ZEPHIR_INIT_VAR(&_52$$65); + object_init_ex(&_52$$65, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_53$$65); + ZEPHIR_CONCAT_SVS(&_53$$65, "Resultset class \"", &resultsetClassName, "\" must be an implementation of Phalcon\\Mvc\\Model\\ResultsetInterface"); + ZEPHIR_CALL_METHOD(NULL, &_52$$65, "__construct", NULL, 4, &_53$$65); zephir_check_call_status(); - zephir_throw_exception_debug(_62$$65, "phalcon/mvc/model/query.zep", 2869 TSRMLS_CC); + zephir_throw_exception_debug(&_52$$65, "phalcon/mvc/model/query.zep", 2869 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_fetch_safe_class(_64$$63, resultsetClassName); - _65$$63 = zend_fetch_class(Z_STRVAL_P(_64$$63), Z_STRLEN_P(_64$$63), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(return_value, _65$$63); + zephir_fetch_safe_class(&_54$$63, &resultsetClassName); + _55$$63 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_54$$63), Z_STRLEN_P(&_54$$63), ZEND_FETCH_CLASS_AUTO); + object_init_ex(return_value, _55$$63); if (zephir_has_constructor(return_value TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_66$$63); if (isKeepingSnapshots) { - ZVAL_BOOL(_66$$63, 1); + ZVAL_BOOL(&_56$$63, 1); } else { - ZVAL_BOOL(_66$$63, 0); + ZVAL_BOOL(&_56$$63, 0); } - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, simpleColumnMap, resultObject, resultData, cache, _66$$63); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 0, &simpleColumnMap, &resultObject, &resultData, &cache, &_56$$63); zephir_check_call_status(); } RETURN_MM(); } } object_init_ex(return_value, phalcon_mvc_model_resultset_simple_ce); - ZEPHIR_INIT_VAR(_67$$51); if (isKeepingSnapshots) { - ZVAL_BOOL(_67$$51, 1); + ZVAL_BOOL(&_57$$51, 1); } else { - ZVAL_BOOL(_67$$51, 0); + ZVAL_BOOL(&_57$$51, 0); } - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 373, simpleColumnMap, resultObject, resultData, cache, _67$$51); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 331, &simpleColumnMap, &resultObject, &resultData, &cache, &_57$$51); zephir_check_call_status(); RETURN_MM(); } object_init_ex(return_value, phalcon_mvc_model_resultset_complex_ce); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 374, columns1, resultData, cache); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 332, &columns1, &resultData, &cache); zephir_check_call_status(); RETURN_MM(); @@ -3684,150 +4375,192 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeSelect) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeInsert) { - HashTable *_3; - HashPosition _2; + zend_string *_4; + zend_ulong _3; zend_bool automaticFields = 0; zephir_fcall_cache_entry *_6 = NULL, *_8 = NULL, *_13 = NULL, *_15 = NULL, *_16 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *intermediate, *bindParams, *bindTypes, *modelName = NULL, *manager = NULL, *connection = NULL, *metaData = NULL, *attributes = NULL, *fields = NULL, *columnMap = NULL, *dialect = NULL, *insertValues = NULL, *number = NULL, *value = NULL, *model = NULL, *values = NULL, *exprValue = NULL, *insertValue = NULL, *wildcard = NULL, *fieldName = NULL, *attributeName = NULL, *insertModel = NULL, *_0, **_4, *_19 = NULL, *_20 = NULL, *_1$$3, *_5$$8, *_7$$11 = NULL, _9$$11 = zval_used_for_init, _10$$11 = zval_used_for_init, *_11$$13 = NULL, *_12$$13 = NULL, *_14$$14 = NULL, *_17$$17 = NULL, *_18$$17 = NULL; + zval *intermediate, intermediate_sub, *bindParams, bindParams_sub, *bindTypes, bindTypes_sub, modelName, manager, connection, metaData, attributes, fields, columnMap, dialect, insertValues, number, value, model, values, exprValue, insertValue, wildcard, fieldName, attributeName, insertModel, _0, *_2, _19, _20, _1$$3, _5$$8, _7$$11, _9$$11, _10$$11, _11$$13, _12$$13, _14$$14, _17$$17, _18$$17; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&intermediate_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&dialect); + ZVAL_UNDEF(&insertValues); + ZVAL_UNDEF(&number); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&exprValue); + ZVAL_UNDEF(&insertValue); + ZVAL_UNDEF(&wildcard); + ZVAL_UNDEF(&fieldName); + ZVAL_UNDEF(&attributeName); + ZVAL_UNDEF(&insertModel); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_19); + ZVAL_UNDEF(&_20); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_7$$11); + ZVAL_UNDEF(&_9$$11); + ZVAL_UNDEF(&_10$$11); + ZVAL_UNDEF(&_11$$13); + ZVAL_UNDEF(&_12$$13); + ZVAL_UNDEF(&_14$$14); + ZVAL_UNDEF(&_17$$17); + ZVAL_UNDEF(&_18$$17); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &intermediate, &bindParams, &bindTypes); - ZEPHIR_OBS_VAR(modelName); + ZEPHIR_OBS_VAR(&modelName); zephir_array_fetch_string(&modelName, intermediate, SL("model"), PH_NOISY, "phalcon/mvc/model/query.zep", 2904 TSRMLS_CC); - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsInstances"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&model, _0, modelName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_BOOL(_1$$3, 1); - ZEPHIR_CALL_METHOD(&model, manager, "load", NULL, 0, modelName, _1$$3); + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&model); + zephir_read_property(&_0, this_ptr, SL("_modelsInstances"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&model, &_0, &modelName, 0 TSRMLS_CC))) { + ZVAL_BOOL(&_1$$3, 1); + ZEPHIR_CALL_METHOD(&model, &manager, "load", NULL, 0, &modelName, &_1$$3); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&connection, this_ptr, "getwriteconnection", NULL, 0, model, intermediate, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(&connection, this_ptr, "getwriteconnection", NULL, 0, &model, intermediate, bindParams, bindTypes); zephir_check_call_status(); - ZEPHIR_OBS_VAR(metaData); - zephir_read_property_this(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&attributes, metaData, "getattributes", NULL, 0, model); + ZEPHIR_OBS_VAR(&metaData); + zephir_read_property(&metaData, this_ptr, SL("_metaData"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&attributes, &metaData, "getattributes", NULL, 0, &model); zephir_check_call_status(); automaticFields = 0; - ZEPHIR_OBS_VAR(fields); - if (!(zephir_array_isset_string_fetch(&fields, intermediate, SS("fields"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&fields); + if (!(zephir_array_isset_string_fetch(&fields, intermediate, SL("fields"), 0))) { automaticFields = 1; - ZEPHIR_CPY_WRT(fields, attributes); + ZEPHIR_CPY_WRT(&fields, &attributes); if (ZEPHIR_GLOBAL(orm).column_renaming) { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, model); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getcolumnmap", NULL, 0, &model); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } } - ZEPHIR_OBS_VAR(values); + ZEPHIR_OBS_VAR(&values); zephir_array_fetch_string(&values, intermediate, SL("values"), PH_NOISY, "phalcon/mvc/model/query.zep", 2930 TSRMLS_CC); - if (zephir_fast_count_int(fields TSRMLS_CC) != zephir_fast_count_int(values TSRMLS_CC)) { + if (zephir_fast_count_int(&fields TSRMLS_CC) != zephir_fast_count_int(&values TSRMLS_CC)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The column count does not match the values count", "phalcon/mvc/model/query.zep", 2936); return; } - ZEPHIR_CALL_METHOD(&dialect, connection, "getdialect", NULL, 0); + ZEPHIR_CALL_METHOD(&dialect, &connection, "getdialect", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(insertValues); - array_init(insertValues); - zephir_is_iterable(values, &_3, &_2, 0, 0, "phalcon/mvc/model/query.zep", 3006); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HMKEY(number, _3, _2); - ZEPHIR_GET_HVALUE(value, _4); - ZEPHIR_OBS_NVAR(exprValue); - zephir_array_fetch_string(&exprValue, value, SL("value"), PH_NOISY, "phalcon/mvc/model/query.zep", 2947 TSRMLS_CC); - zephir_array_fetch_string(&_5$$8, value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2948 TSRMLS_CC); + ZEPHIR_INIT_VAR(&insertValues); + array_init(&insertValues); + zephir_is_iterable(&values, 0, "phalcon/mvc/model/query.zep", 3006); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&values), _3, _4, _2) + { + ZEPHIR_INIT_NVAR(&number); + if (_4 != NULL) { + ZVAL_STR_COPY(&number, _4); + } else { + ZVAL_LONG(&number, _3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _2); + ZEPHIR_OBS_NVAR(&exprValue); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/mvc/model/query.zep", 2947 TSRMLS_CC); + zephir_array_fetch_string(&_5$$8, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 2948 TSRMLS_CC); do { - if (ZEPHIR_IS_LONG(_5$$8, 260) || ZEPHIR_IS_LONG(_5$$8, 258) || ZEPHIR_IS_LONG(_5$$8, 259)) { - ZEPHIR_CALL_METHOD(&insertValue, dialect, "getsqlexpression", &_6, 0, exprValue); + if (ZEPHIR_IS_LONG(&_5$$8, 260) || ZEPHIR_IS_LONG(&_5$$8, 258) || ZEPHIR_IS_LONG(&_5$$8, 259)) { + ZEPHIR_CALL_METHOD(&insertValue, &dialect, "getsqlexpression", &_6, 0, &exprValue); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(_5$$8, 322)) { - ZEPHIR_INIT_NVAR(insertValue); - ZVAL_NULL(insertValue); + if (ZEPHIR_IS_LONG(&_5$$8, 322)) { + ZEPHIR_INIT_NVAR(&insertValue); + ZVAL_NULL(&insertValue); break; } - if (ZEPHIR_IS_LONG(_5$$8, 273) || ZEPHIR_IS_LONG(_5$$8, 274) || ZEPHIR_IS_LONG(_5$$8, 277)) { + if (ZEPHIR_IS_LONG(&_5$$8, 273) || ZEPHIR_IS_LONG(&_5$$8, 274) || ZEPHIR_IS_LONG(&_5$$8, 277)) { if (Z_TYPE_P(bindParams) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Bound parameter cannot be replaced because placeholders is not an array", "phalcon/mvc/model/query.zep", 2965); return; } - ZEPHIR_CALL_METHOD(&_7$$11, dialect, "getsqlexpression", &_8, 0, exprValue); + ZEPHIR_CALL_METHOD(&_7$$11, &dialect, "getsqlexpression", &_8, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_9$$11); - ZVAL_STRING(&_9$$11, ":", 0); - ZEPHIR_SINIT_NVAR(_10$$11); - ZVAL_STRING(&_10$$11, "", 0); - ZEPHIR_INIT_NVAR(wildcard); - zephir_fast_str_replace(&wildcard, &_9$$11, &_10$$11, _7$$11 TSRMLS_CC); - ZEPHIR_OBS_NVAR(insertValue); - if (!(zephir_array_isset_fetch(&insertValue, bindParams, wildcard, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_11$$13); - object_init_ex(_11$$13, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_9$$11); + ZVAL_STRING(&_9$$11, ":"); + ZEPHIR_INIT_NVAR(&_10$$11); + ZVAL_STRING(&_10$$11, ""); + ZEPHIR_INIT_NVAR(&wildcard); + zephir_fast_str_replace(&wildcard, &_9$$11, &_10$$11, &_7$$11 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&insertValue); + if (!(zephir_array_isset_fetch(&insertValue, bindParams, &wildcard, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_11$$13); + object_init_ex(&_11$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_12$$13); - ZEPHIR_CONCAT_SVS(_12$$13, "Bound parameter '", wildcard, "' cannot be replaced because it isn't in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, _11$$13, "__construct", &_13, 9, _12$$13); + ZEPHIR_CONCAT_SVS(&_12$$13, "Bound parameter '", &wildcard, "' cannot be replaced because it isn't in the placeholders list"); + ZEPHIR_CALL_METHOD(NULL, &_11$$13, "__construct", &_13, 4, &_12$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_11$$13, "phalcon/mvc/model/query.zep", 2972 TSRMLS_CC); + zephir_throw_exception_debug(&_11$$13, "phalcon/mvc/model/query.zep", 2972 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } break; } - ZEPHIR_INIT_NVAR(insertValue); - object_init_ex(insertValue, phalcon_db_rawvalue_ce); - ZEPHIR_CALL_METHOD(&_14$$14, dialect, "getsqlexpression", &_15, 0, exprValue); + ZEPHIR_INIT_NVAR(&insertValue); + object_init_ex(&insertValue, phalcon_db_rawvalue_ce); + ZEPHIR_CALL_METHOD(&_14$$14, &dialect, "getsqlexpression", &_15, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, insertValue, "__construct", &_16, 26, _14$$14); + ZEPHIR_CALL_METHOD(NULL, &insertValue, "__construct", &_16, 21, &_14$$14); zephir_check_call_status(); break; } while(0); - ZEPHIR_OBS_NVAR(fieldName); - zephir_array_fetch(&fieldName, fields, number, PH_NOISY, "phalcon/mvc/model/query.zep", 2982 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&fieldName); + zephir_array_fetch(&fieldName, &fields, &number, PH_NOISY, "phalcon/mvc/model/query.zep", 2982 TSRMLS_CC); if (automaticFields == 1) { - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeName); - if (!(zephir_array_isset_fetch(&attributeName, columnMap, fieldName, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_17$$17); - object_init_ex(_17$$17, phalcon_mvc_model_exception_ce); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeName); + if (!(zephir_array_isset_fetch(&attributeName, &columnMap, &fieldName, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_17$$17); + object_init_ex(&_17$$17, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_18$$17); - ZEPHIR_CONCAT_SVS(_18$$17, "Column '", fieldName, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _17$$17, "__construct", &_13, 9, _18$$17); + ZEPHIR_CONCAT_SVS(&_18$$17, "Column '", &fieldName, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_17$$17, "__construct", &_13, 4, &_18$$17); zephir_check_call_status(); - zephir_throw_exception_debug(_17$$17, "phalcon/mvc/model/query.zep", 2990 TSRMLS_CC); + zephir_throw_exception_debug(&_17$$17, "phalcon/mvc/model/query.zep", 2990 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeName, fieldName); + ZEPHIR_CPY_WRT(&attributeName, &fieldName); } } else { - ZEPHIR_CPY_WRT(attributeName, fieldName); + ZEPHIR_CPY_WRT(&attributeName, &fieldName); } - zephir_array_update_zval(&insertValues, attributeName, &insertValue, PH_COPY | PH_SEPARATE); - } - ZEPHIR_CALL_METHOD(&_19, manager, "load", NULL, 0, modelName); + zephir_array_update_zval(&insertValues, &attributeName, &insertValue, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&number); + ZEPHIR_CALL_METHOD(&_19, &manager, "load", NULL, 0, &modelName); zephir_check_call_status(); - ZEPHIR_INIT_VAR(insertModel); - if (zephir_clone(insertModel, _19 TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&insertModel); + if (zephir_clone(&insertModel, &_19 TSRMLS_CC) == FAILURE) { RETURN_MM(); } object_init_ex(return_value, phalcon_mvc_model_query_status_ce); - ZEPHIR_CALL_METHOD(&_20, insertModel, "create", NULL, 0, insertValues); + ZEPHIR_CALL_METHOD(&_20, &insertModel, "create", NULL, 0, &insertValues); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 375, _20, insertModel); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 333, &_20, &insertModel); zephir_check_call_status(); RETURN_MM(); @@ -3843,164 +4576,205 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeInsert) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeUpdate) { - HashTable *_3; - HashPosition _2; + zend_string *_4; + zend_ulong _3; zephir_fcall_cache_entry *_6 = NULL, *_8 = NULL, *_13 = NULL, *_15 = NULL, *_16 = NULL, *_19 = NULL, *_21 = NULL, *_23 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *intermediate, *bindParams, *bindTypes, *models = NULL, *modelName = NULL, *model = NULL, *connection = NULL, *dialect = NULL, *fields = NULL, *values = NULL, *updateValues = NULL, *fieldName = NULL, *value = NULL, *selectBindParams = NULL, *selectBindTypes = NULL, *number = NULL, *field = NULL, *records = NULL, *exprValue = NULL, *updateValue = NULL, *wildcard = NULL, *record = NULL, *_0, **_4, *_18 = NULL, *_24, *_1$$4, *_5$$5, *_7$$10 = NULL, _9$$10 = zval_used_for_init, _10$$10 = zval_used_for_init, *_11$$13 = NULL, *_12$$13 = NULL, *_14$$15 = NULL, *_17$$16, *_20$$17 = NULL, *_22$$18 = NULL; + zval *intermediate, intermediate_sub, *bindParams, bindParams_sub, *bindTypes, bindTypes_sub, models, modelName, model, connection, dialect, fields, values, updateValues, fieldName, value, selectBindParams, selectBindTypes, number, field, records, exprValue, updateValue, wildcard, record, _0, *_2, _18, _24, _1$$4, _5$$5, _7$$10, _9$$10, _10$$10, _11$$13, _12$$13, _14$$15, _17$$16, _20$$17, _22$$18; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&intermediate_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&dialect); + ZVAL_UNDEF(&fields); + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&updateValues); + ZVAL_UNDEF(&fieldName); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&selectBindParams); + ZVAL_UNDEF(&selectBindTypes); + ZVAL_UNDEF(&number); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&exprValue); + ZVAL_UNDEF(&updateValue); + ZVAL_UNDEF(&wildcard); + ZVAL_UNDEF(&record); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_18); + ZVAL_UNDEF(&_24); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$10); + ZVAL_UNDEF(&_9$$10); + ZVAL_UNDEF(&_10$$10); + ZVAL_UNDEF(&_11$$13); + ZVAL_UNDEF(&_12$$13); + ZVAL_UNDEF(&_14$$15); + ZVAL_UNDEF(&_17$$16); + ZVAL_UNDEF(&_20$$17); + ZVAL_UNDEF(&_22$$18); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &intermediate, &bindParams, &bindTypes); - ZEPHIR_OBS_VAR(models); + ZEPHIR_OBS_VAR(&models); zephir_array_fetch_string(&models, intermediate, SL("models"), PH_NOISY, "phalcon/mvc/model/query.zep", 3030 TSRMLS_CC); - if (zephir_array_isset_long(models, 1)) { + if (zephir_array_isset_long(&models, 1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Updating several models at the same time is still not supported", "phalcon/mvc/model/query.zep", 3033); return; } - ZEPHIR_OBS_VAR(modelName); - zephir_array_fetch_long(&modelName, models, 0, PH_NOISY, "phalcon/mvc/model/query.zep", 3036 TSRMLS_CC); - ZEPHIR_OBS_VAR(model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsInstances"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&model, _0, modelName, 0 TSRMLS_CC))) { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_manager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&model, _1$$4, "load", NULL, 0, modelName); + ZEPHIR_OBS_VAR(&modelName); + zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/mvc/model/query.zep", 3036 TSRMLS_CC); + ZEPHIR_OBS_VAR(&model); + zephir_read_property(&_0, this_ptr, SL("_modelsInstances"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&model, &_0, &modelName, 0 TSRMLS_CC))) { + zephir_read_property(&_1$$4, this_ptr, SL("_manager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&model, &_1$$4, "load", NULL, 0, &modelName); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&connection, this_ptr, "getwriteconnection", NULL, 0, model, intermediate, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(&connection, this_ptr, "getwriteconnection", NULL, 0, &model, intermediate, bindParams, bindTypes); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&dialect, connection, "getdialect", NULL, 0); + ZEPHIR_CALL_METHOD(&dialect, &connection, "getdialect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(fields); + ZEPHIR_OBS_VAR(&fields); zephir_array_fetch_string(&fields, intermediate, SL("fields"), PH_NOISY, "phalcon/mvc/model/query.zep", 3049 TSRMLS_CC); - ZEPHIR_OBS_VAR(values); + ZEPHIR_OBS_VAR(&values); zephir_array_fetch_string(&values, intermediate, SL("values"), PH_NOISY, "phalcon/mvc/model/query.zep", 3050 TSRMLS_CC); - ZEPHIR_INIT_VAR(updateValues); - array_init(updateValues); - ZEPHIR_CPY_WRT(selectBindParams, bindParams); - ZEPHIR_CPY_WRT(selectBindTypes, bindTypes); - zephir_is_iterable(fields, &_3, &_2, 0, 0, "phalcon/mvc/model/query.zep", 3119); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HMKEY(number, _3, _2); - ZEPHIR_GET_HVALUE(field, _4); - ZEPHIR_OBS_NVAR(value); - zephir_array_fetch(&value, values, number, PH_NOISY, "phalcon/mvc/model/query.zep", 3065 TSRMLS_CC); - ZEPHIR_OBS_NVAR(exprValue); - zephir_array_fetch_string(&exprValue, value, SL("value"), PH_NOISY, "phalcon/mvc/model/query.zep", 3066 TSRMLS_CC); - if (zephir_array_isset_string(field, SS("balias"))) { - ZEPHIR_OBS_NVAR(fieldName); - zephir_array_fetch_string(&fieldName, field, SL("balias"), PH_NOISY, "phalcon/mvc/model/query.zep", 3069 TSRMLS_CC); + ZEPHIR_INIT_VAR(&updateValues); + array_init(&updateValues); + ZEPHIR_CPY_WRT(&selectBindParams, bindParams); + ZEPHIR_CPY_WRT(&selectBindTypes, bindTypes); + zephir_is_iterable(&fields, 0, "phalcon/mvc/model/query.zep", 3119); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&fields), _3, _4, _2) + { + ZEPHIR_INIT_NVAR(&number); + if (_4 != NULL) { + ZVAL_STR_COPY(&number, _4); + } else { + ZVAL_LONG(&number, _3); + } + ZEPHIR_INIT_NVAR(&field); + ZVAL_COPY(&field, _2); + ZEPHIR_OBS_NVAR(&value); + zephir_array_fetch(&value, &values, &number, PH_NOISY, "phalcon/mvc/model/query.zep", 3065 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&exprValue); + zephir_array_fetch_string(&exprValue, &value, SL("value"), PH_NOISY, "phalcon/mvc/model/query.zep", 3066 TSRMLS_CC); + if (zephir_array_isset_string(&field, SL("balias"))) { + ZEPHIR_OBS_NVAR(&fieldName); + zephir_array_fetch_string(&fieldName, &field, SL("balias"), PH_NOISY, "phalcon/mvc/model/query.zep", 3069 TSRMLS_CC); } else { - ZEPHIR_OBS_NVAR(fieldName); - zephir_array_fetch_string(&fieldName, field, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 3071 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&fieldName); + zephir_array_fetch_string(&fieldName, &field, SL("name"), PH_NOISY, "phalcon/mvc/model/query.zep", 3071 TSRMLS_CC); } - zephir_array_fetch_string(&_5$$5, value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 3074 TSRMLS_CC); + zephir_array_fetch_string(&_5$$5, &value, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/query.zep", 3074 TSRMLS_CC); do { - if (ZEPHIR_IS_LONG(_5$$5, 260) || ZEPHIR_IS_LONG(_5$$5, 258) || ZEPHIR_IS_LONG(_5$$5, 259)) { - ZEPHIR_CALL_METHOD(&updateValue, dialect, "getsqlexpression", &_6, 0, exprValue); + if (ZEPHIR_IS_LONG(&_5$$5, 260) || ZEPHIR_IS_LONG(&_5$$5, 258) || ZEPHIR_IS_LONG(&_5$$5, 259)) { + ZEPHIR_CALL_METHOD(&updateValue, &dialect, "getsqlexpression", &_6, 0, &exprValue); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(_5$$5, 322)) { - ZEPHIR_INIT_NVAR(updateValue); - ZVAL_NULL(updateValue); + if (ZEPHIR_IS_LONG(&_5$$5, 322)) { + ZEPHIR_INIT_NVAR(&updateValue); + ZVAL_NULL(&updateValue); break; } - if (ZEPHIR_IS_LONG(_5$$5, 273) || ZEPHIR_IS_LONG(_5$$5, 274) || ZEPHIR_IS_LONG(_5$$5, 277)) { + if (ZEPHIR_IS_LONG(&_5$$5, 273) || ZEPHIR_IS_LONG(&_5$$5, 274) || ZEPHIR_IS_LONG(&_5$$5, 277)) { if (Z_TYPE_P(bindParams) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Bound parameter cannot be replaced because placeholders is not an array", "phalcon/mvc/model/query.zep", 3091); return; } - ZEPHIR_CALL_METHOD(&_7$$10, dialect, "getsqlexpression", &_8, 0, exprValue); + ZEPHIR_CALL_METHOD(&_7$$10, &dialect, "getsqlexpression", &_8, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_9$$10); - ZVAL_STRING(&_9$$10, ":", 0); - ZEPHIR_SINIT_NVAR(_10$$10); - ZVAL_STRING(&_10$$10, "", 0); - ZEPHIR_INIT_NVAR(wildcard); - zephir_fast_str_replace(&wildcard, &_9$$10, &_10$$10, _7$$10 TSRMLS_CC); - ZEPHIR_OBS_NVAR(updateValue); - if (zephir_array_isset_fetch(&updateValue, bindParams, wildcard, 0 TSRMLS_CC)) { - zephir_array_unset(&selectBindParams, wildcard, PH_SEPARATE); - zephir_array_unset(&selectBindTypes, wildcard, PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_9$$10); + ZVAL_STRING(&_9$$10, ":"); + ZEPHIR_INIT_NVAR(&_10$$10); + ZVAL_STRING(&_10$$10, ""); + ZEPHIR_INIT_NVAR(&wildcard); + zephir_fast_str_replace(&wildcard, &_9$$10, &_10$$10, &_7$$10 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&updateValue); + if (zephir_array_isset_fetch(&updateValue, bindParams, &wildcard, 0 TSRMLS_CC)) { + zephir_array_unset(&selectBindParams, &wildcard, PH_SEPARATE); + zephir_array_unset(&selectBindTypes, &wildcard, PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(_11$$13); - object_init_ex(_11$$13, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_NVAR(&_11$$13); + object_init_ex(&_11$$13, phalcon_mvc_model_exception_ce); ZEPHIR_INIT_LNVAR(_12$$13); - ZEPHIR_CONCAT_SVS(_12$$13, "Bound parameter '", wildcard, "' cannot be replaced because it's not in the placeholders list"); - ZEPHIR_CALL_METHOD(NULL, _11$$13, "__construct", &_13, 9, _12$$13); + ZEPHIR_CONCAT_SVS(&_12$$13, "Bound parameter '", &wildcard, "' cannot be replaced because it's not in the placeholders list"); + ZEPHIR_CALL_METHOD(NULL, &_11$$13, "__construct", &_13, 4, &_12$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_11$$13, "phalcon/mvc/model/query.zep", 3101 TSRMLS_CC); + zephir_throw_exception_debug(&_11$$13, "phalcon/mvc/model/query.zep", 3101 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } break; } - if (ZEPHIR_IS_LONG(_5$$5, 277)) { + if (ZEPHIR_IS_LONG(&_5$$5, 277)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Not supported", "phalcon/mvc/model/query.zep", 3106); return; } - ZEPHIR_INIT_NVAR(updateValue); - object_init_ex(updateValue, phalcon_db_rawvalue_ce); - ZEPHIR_CALL_METHOD(&_14$$15, dialect, "getsqlexpression", &_15, 0, exprValue); + ZEPHIR_INIT_NVAR(&updateValue); + object_init_ex(&updateValue, phalcon_db_rawvalue_ce); + ZEPHIR_CALL_METHOD(&_14$$15, &dialect, "getsqlexpression", &_15, 0, &exprValue); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, updateValue, "__construct", &_16, 26, _14$$15); + ZEPHIR_CALL_METHOD(NULL, &updateValue, "__construct", &_16, 21, &_14$$15); zephir_check_call_status(); break; } while(0); - zephir_array_update_zval(&updateValues, fieldName, &updateValue, PH_COPY | PH_SEPARATE); - } - ZEPHIR_CALL_METHOD(&records, this_ptr, "_getrelatedrecords", NULL, 376, model, intermediate, selectBindParams, selectBindTypes); + zephir_array_update_zval(&updateValues, &fieldName, &updateValue, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&field); + ZEPHIR_INIT_NVAR(&number); + ZEPHIR_CALL_METHOD(&records, this_ptr, "_getrelatedrecords", NULL, 334, &model, intermediate, &selectBindParams, &selectBindTypes); zephir_check_call_status(); - if (!(zephir_fast_count_int(records TSRMLS_CC))) { + if (!(zephir_fast_count_int(&records TSRMLS_CC))) { object_init_ex(return_value, phalcon_mvc_model_query_status_ce); - ZEPHIR_INIT_VAR(_17$$16); - ZVAL_BOOL(_17$$16, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 375, _17$$16); + ZVAL_BOOL(&_17$$16, 1); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 333, &_17$$16); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&connection, this_ptr, "getwriteconnection", NULL, 0, model, intermediate, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(&connection, this_ptr, "getwriteconnection", NULL, 0, &model, intermediate, bindParams, bindTypes); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, connection, "begin", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "begin", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, records, "rewind", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &records, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_18, records, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_18, &records, "valid", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_18))) { + if (!(zephir_is_true(&_18))) { break; } - ZEPHIR_CALL_METHOD(&record, records, "current", &_19, 0); + ZEPHIR_CALL_METHOD(&record, &records, "current", &_19, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_20$$17, record, "update", NULL, 0, updateValues); + ZEPHIR_CALL_METHOD(&_20$$17, &record, "update", NULL, 0, &updateValues); zephir_check_call_status(); - if (!(zephir_is_true(_20$$17))) { - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_21, 0); + if (!(zephir_is_true(&_20$$17))) { + ZEPHIR_CALL_METHOD(NULL, &connection, "rollback", &_21, 0); zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); - ZEPHIR_INIT_NVAR(_22$$18); - ZVAL_BOOL(_22$$18, 0); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 375, _22$$18, record); + ZVAL_BOOL(&_22$$18, 0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 333, &_22$$18, &record); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_METHOD(NULL, records, "next", &_23, 0); + ZEPHIR_CALL_METHOD(NULL, &records, "next", &_23, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, connection, "commit", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "commit", NULL, 0); zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); - ZEPHIR_INIT_VAR(_24); - ZVAL_BOOL(_24, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 375, _24); + ZVAL_BOOL(&_24, 1); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 333, &_24); zephir_check_call_status(); RETURN_MM(); @@ -4018,73 +4792,88 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeDelete) { zephir_fcall_cache_entry *_4 = NULL, *_6 = NULL, *_8 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *intermediate, *bindParams, *bindTypes, *models = NULL, *modelName = NULL, *model = NULL, *records = NULL, *connection = NULL, *record = NULL, *_0, *_3 = NULL, *_9, *_1$$4, *_2$$5, *_5$$6 = NULL, *_7$$7 = NULL; + zval *intermediate, intermediate_sub, *bindParams, bindParams_sub, *bindTypes, bindTypes_sub, models, modelName, model, records, connection, record, _0, _3, _9, _1$$4, _2$$5, _5$$6, _7$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&intermediate_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&record); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_7$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &intermediate, &bindParams, &bindTypes); - ZEPHIR_OBS_VAR(models); + ZEPHIR_OBS_VAR(&models); zephir_array_fetch_string(&models, intermediate, SL("models"), PH_NOISY, "phalcon/mvc/model/query.zep", 3178 TSRMLS_CC); - if (zephir_array_isset_long(models, 1)) { + if (zephir_array_isset_long(&models, 1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Delete from several models at the same time is still not supported", "phalcon/mvc/model/query.zep", 3181); return; } - ZEPHIR_OBS_VAR(modelName); - zephir_array_fetch_long(&modelName, models, 0, PH_NOISY, "phalcon/mvc/model/query.zep", 3184 TSRMLS_CC); - ZEPHIR_OBS_VAR(model); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_modelsInstances"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&model, _0, modelName, 0 TSRMLS_CC))) { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_manager"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&model, _1$$4, "load", NULL, 0, modelName); + ZEPHIR_OBS_VAR(&modelName); + zephir_array_fetch_long(&modelName, &models, 0, PH_NOISY, "phalcon/mvc/model/query.zep", 3184 TSRMLS_CC); + ZEPHIR_OBS_VAR(&model); + zephir_read_property(&_0, this_ptr, SL("_modelsInstances"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&model, &_0, &modelName, 0 TSRMLS_CC))) { + zephir_read_property(&_1$$4, this_ptr, SL("_manager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&model, &_1$$4, "load", NULL, 0, &modelName); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&records, this_ptr, "_getrelatedrecords", NULL, 376, model, intermediate, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(&records, this_ptr, "_getrelatedrecords", NULL, 334, &model, intermediate, bindParams, bindTypes); zephir_check_call_status(); - if (!(zephir_fast_count_int(records TSRMLS_CC))) { + if (!(zephir_fast_count_int(&records TSRMLS_CC))) { object_init_ex(return_value, phalcon_mvc_model_query_status_ce); - ZEPHIR_INIT_VAR(_2$$5); - ZVAL_BOOL(_2$$5, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 375, _2$$5); + ZVAL_BOOL(&_2$$5, 1); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 333, &_2$$5); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&connection, this_ptr, "getwriteconnection", NULL, 0, model, intermediate, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(&connection, this_ptr, "getwriteconnection", NULL, 0, &model, intermediate, bindParams, bindTypes); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, connection, "begin", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "begin", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, records, "rewind", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &records, "rewind", NULL, 0); zephir_check_call_status(); while (1) { - ZEPHIR_CALL_METHOD(&_3, records, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_3, &records, "valid", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_3))) { + if (!(zephir_is_true(&_3))) { break; } - ZEPHIR_CALL_METHOD(&record, records, "current", &_4, 0); + ZEPHIR_CALL_METHOD(&record, &records, "current", &_4, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_5$$6, record, "delete", NULL, 0); + ZEPHIR_CALL_METHOD(&_5$$6, &record, "delete", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_5$$6))) { - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", &_6, 0); + if (!(zephir_is_true(&_5$$6))) { + ZEPHIR_CALL_METHOD(NULL, &connection, "rollback", &_6, 0); zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); - ZEPHIR_INIT_NVAR(_7$$7); - ZVAL_BOOL(_7$$7, 0); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 375, _7$$7, record); + ZVAL_BOOL(&_7$$7, 0); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 333, &_7$$7, &record); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_METHOD(NULL, records, "next", &_8, 0); + ZEPHIR_CALL_METHOD(NULL, &records, "next", &_8, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, connection, "commit", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "commit", NULL, 0); zephir_check_call_status(); object_init_ex(return_value, phalcon_mvc_model_query_status_ce); - ZEPHIR_INIT_VAR(_9); - ZVAL_BOOL(_9, 1); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 375, _9); + ZVAL_BOOL(&_9, 1); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 333, &_9); zephir_check_call_status(); RETURN_MM(); @@ -4101,58 +4890,74 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, _executeDelete) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, _getRelatedRecords) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *intermediate, *bindParams, *bindTypes, *selectIr = NULL, *whereConditions = NULL, *limitConditions = NULL, *query = NULL, *_2 = NULL, *_3 = NULL, *_4 = NULL, *_5; + zval *model, model_sub, *intermediate, intermediate_sub, *bindParams, bindParams_sub, *bindTypes, bindTypes_sub, selectIr, whereConditions, limitConditions, query, _2, _3, _4, _5, _6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&intermediate_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_UNDEF(&selectIr); + ZVAL_UNDEF(&whereConditions); + ZVAL_UNDEF(&limitConditions); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &model, &intermediate, &bindParams, &bindTypes); - ZEPHIR_INIT_VAR(selectIr); - zephir_create_array(selectIr, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 3, 0 TSRMLS_CC); - add_assoc_stringl_ex(_1, SS("type"), SL("object"), 1); - ZEPHIR_INIT_VAR(_2); - zephir_get_class(_2, model, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&selectIr); + zephir_create_array(&selectIr, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 3, 0 TSRMLS_CC); + add_assoc_stringl_ex(&_1, SL("type"), SL("object")); + ZEPHIR_INIT_VAR(&_2); + zephir_get_class(&_2, model, 0 TSRMLS_CC); zephir_array_update_string(&_1, SL("model"), &_2, PH_COPY | PH_SEPARATE); ZEPHIR_CALL_METHOD(&_3, model, "getsource", NULL, 0); zephir_check_call_status(); zephir_array_update_string(&_1, SL("column"), &_3, PH_COPY | PH_SEPARATE); - zephir_array_fast_append(_0, _1); + zephir_array_fast_append(&_0, &_1); zephir_array_update_string(&selectIr, SL("columns"), &_0, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_VAR(_4); + ZEPHIR_OBS_VAR(&_4); zephir_array_fetch_string(&_4, intermediate, SL("models"), PH_NOISY, "phalcon/mvc/model/query.zep", 3267 TSRMLS_CC); zephir_array_update_string(&selectIr, SL("models"), &_4, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_4); + ZEPHIR_OBS_NVAR(&_4); zephir_array_fetch_string(&_4, intermediate, SL("tables"), PH_NOISY, "phalcon/mvc/model/query.zep", 3269 TSRMLS_CC); zephir_array_update_string(&selectIr, SL("tables"), &_4, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_VAR(whereConditions); - if (zephir_array_isset_string_fetch(&whereConditions, intermediate, SS("where"), 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&whereConditions); + if (zephir_array_isset_string_fetch(&whereConditions, intermediate, SL("where"), 0)) { zephir_array_update_string(&selectIr, SL("where"), &whereConditions, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(limitConditions); - if (zephir_array_isset_string_fetch(&limitConditions, intermediate, SS("limit"), 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&limitConditions); + if (zephir_array_isset_string_fetch(&limitConditions, intermediate, SL("limit"), 0)) { zephir_array_update_string(&selectIr, SL("limit"), &limitConditions, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(query); - object_init_ex(query, phalcon_mvc_model_query_ce); - ZEPHIR_CALL_METHOD(NULL, query, "__construct", NULL, 377); + ZEPHIR_INIT_VAR(&query); + object_init_ex(&query, phalcon_mvc_model_query_ce); + ZEPHIR_CALL_METHOD(NULL, &query, "__construct", NULL, 335); zephir_check_call_status(); - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, query, "setdi", NULL, 378, _5); + zephir_read_property(&_5, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &query, "setdi", NULL, 336, &_5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_2); - ZVAL_LONG(_2, 309); - ZEPHIR_CALL_METHOD(NULL, query, "settype", NULL, 379, _2); + ZVAL_LONG(&_6, 309); + ZEPHIR_CALL_METHOD(NULL, &query, "settype", NULL, 337, &_6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, query, "setintermediate", NULL, 380, selectIr); + ZEPHIR_CALL_METHOD(NULL, &query, "setintermediate", NULL, 338, &selectIr); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(query, "execute", NULL, 381, bindParams, bindTypes); + ZEPHIR_RETURN_CALL_METHOD(&query, "execute", NULL, 339, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); @@ -4169,163 +4974,187 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, execute) { zend_bool _2, _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *bindParams = NULL, *bindTypes = NULL, *uniqueRow = NULL, *cacheOptions = NULL, *key = NULL, *cacheService = NULL, *cache = NULL, *result = NULL, *preparedResult = NULL, *defaultBindParams = NULL, *mergedParams = NULL, *defaultBindTypes = NULL, *mergedTypes = NULL, *type = NULL, *lifetime = NULL, *intermediate = NULL, *_0$$3, *_1$$9, *_4$$27, *_5$$27; + zval *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, uniqueRow, cacheOptions, key, cacheService, cache, result, preparedResult, defaultBindParams, mergedParams, defaultBindTypes, mergedTypes, type, lifetime, intermediate, _0$$3, _1$$9, _4$$27, _5$$27; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&uniqueRow); + ZVAL_UNDEF(&cacheOptions); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&cacheService); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&preparedResult); + ZVAL_UNDEF(&defaultBindParams); + ZVAL_UNDEF(&mergedParams); + ZVAL_UNDEF(&defaultBindTypes); + ZVAL_UNDEF(&mergedTypes); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&lifetime); + ZVAL_UNDEF(&intermediate); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$9); + ZVAL_UNDEF(&_4$$27); + ZVAL_UNDEF(&_5$$27); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &bindParams, &bindTypes); if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_OBS_VAR(uniqueRow); - zephir_read_property_this(&uniqueRow, this_ptr, SL("_uniqueRow"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(cacheOptions); - zephir_read_property_this(&cacheOptions, this_ptr, SL("_cacheOptions"), PH_NOISY_CC); - if (Z_TYPE_P(cacheOptions) != IS_NULL) { - if (Z_TYPE_P(cacheOptions) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&uniqueRow); + zephir_read_property(&uniqueRow, this_ptr, SL("_uniqueRow"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&cacheOptions); + zephir_read_property(&cacheOptions, this_ptr, SL("_cacheOptions"), PH_NOISY_CC); + if (Z_TYPE_P(&cacheOptions) != IS_NULL) { + if (Z_TYPE_P(&cacheOptions) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid caching options", "phalcon/mvc/model/query.zep", 3315); return; } - ZEPHIR_OBS_VAR(key); - if (!(zephir_array_isset_string_fetch(&key, cacheOptions, SS("key"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&key); + if (!(zephir_array_isset_string_fetch(&key, &cacheOptions, SL("key"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A cache key must be provided to identify the cached resultset in the cache backend", "phalcon/mvc/model/query.zep", 3322); return; } - ZEPHIR_OBS_VAR(lifetime); - if (!(zephir_array_isset_string_fetch(&lifetime, cacheOptions, SS("lifetime"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(lifetime); - ZVAL_LONG(lifetime, 3600); + ZEPHIR_OBS_VAR(&lifetime); + if (!(zephir_array_isset_string_fetch(&lifetime, &cacheOptions, SL("lifetime"), 0))) { + ZEPHIR_INIT_NVAR(&lifetime); + ZVAL_LONG(&lifetime, 3600); } - ZEPHIR_OBS_VAR(cacheService); - if (!(zephir_array_isset_string_fetch(&cacheService, cacheOptions, SS("service"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(cacheService); - ZVAL_STRING(cacheService, "modelsCache", 1); + ZEPHIR_OBS_VAR(&cacheService); + if (!(zephir_array_isset_string_fetch(&cacheService, &cacheOptions, SL("service"), 0))) { + ZEPHIR_INIT_NVAR(&cacheService); + ZVAL_STRING(&cacheService, "modelsCache"); } - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&cache, _0$$3, "getshared", NULL, 0, cacheService); + zephir_read_property(&_0$$3, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&cache, &_0$$3, "getshared", NULL, 0, &cacheService); zephir_check_call_status(); - if (Z_TYPE_P(cache) != IS_OBJECT) { + if (Z_TYPE_P(&cache) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cache service must be an object", "phalcon/mvc/model/query.zep", 3341); return; } - ZEPHIR_CALL_METHOD(&result, cache, "get", NULL, 0, key, lifetime); + ZEPHIR_CALL_METHOD(&result, &cache, "get", NULL, 0, &key, &lifetime); zephir_check_call_status(); - if (Z_TYPE_P(result) != IS_NULL) { - if (Z_TYPE_P(result) != IS_OBJECT) { + if (Z_TYPE_P(&result) != IS_NULL) { + if (Z_TYPE_P(&result) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cache didn't return a valid resultset", "phalcon/mvc/model/query.zep", 3348); return; } - ZEPHIR_INIT_VAR(_1$$9); - ZVAL_BOOL(_1$$9, 0); - ZEPHIR_CALL_METHOD(NULL, result, "setisfresh", NULL, 0, _1$$9); + ZVAL_BOOL(&_1$$9, 0); + ZEPHIR_CALL_METHOD(NULL, &result, "setisfresh", NULL, 0, &_1$$9); zephir_check_call_status(); - if (zephir_is_true(uniqueRow)) { - ZEPHIR_CALL_METHOD(&preparedResult, result, "getfirst", NULL, 0); + if (zephir_is_true(&uniqueRow)) { + ZEPHIR_CALL_METHOD(&preparedResult, &result, "getfirst", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedResult, result); + ZEPHIR_CPY_WRT(&preparedResult, &result); } - RETURN_CCTOR(preparedResult); + RETURN_CCTOR(&preparedResult); } - zephir_update_property_this(getThis(), SL("_cache"), cache TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &cache); } - ZEPHIR_OBS_VAR(defaultBindParams); - zephir_read_property_this(&defaultBindParams, this_ptr, SL("_bindParams"), PH_NOISY_CC); - if (Z_TYPE_P(defaultBindParams) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&defaultBindParams); + zephir_read_property(&defaultBindParams, this_ptr, SL("_bindParams"), PH_NOISY_CC); + if (Z_TYPE_P(&defaultBindParams) == IS_ARRAY) { if (Z_TYPE_P(bindParams) == IS_ARRAY) { - ZEPHIR_INIT_VAR(mergedParams); - zephir_add_function(mergedParams, defaultBindParams, bindParams); + ZEPHIR_INIT_VAR(&mergedParams); + zephir_add_function(&mergedParams, &defaultBindParams, bindParams); } else { - ZEPHIR_CPY_WRT(mergedParams, defaultBindParams); + ZEPHIR_CPY_WRT(&mergedParams, &defaultBindParams); } } else { - ZEPHIR_CPY_WRT(mergedParams, bindParams); + ZEPHIR_CPY_WRT(&mergedParams, bindParams); } - zephir_update_property_this(getThis(), SL("_bindParams"), mergedParams TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindParams"), &mergedParams); ZEPHIR_CALL_METHOD(&intermediate, this_ptr, "parse", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(defaultBindTypes); - zephir_read_property_this(&defaultBindTypes, this_ptr, SL("_bindTypes"), PH_NOISY_CC); - if (Z_TYPE_P(defaultBindTypes) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&defaultBindTypes); + zephir_read_property(&defaultBindTypes, this_ptr, SL("_bindTypes"), PH_NOISY_CC); + if (Z_TYPE_P(&defaultBindTypes) == IS_ARRAY) { if (Z_TYPE_P(bindTypes) == IS_ARRAY) { - ZEPHIR_INIT_VAR(mergedTypes); - zephir_add_function(mergedTypes, defaultBindTypes, bindTypes); + ZEPHIR_INIT_VAR(&mergedTypes); + zephir_add_function(&mergedTypes, &defaultBindTypes, bindTypes); } else { - ZEPHIR_CPY_WRT(mergedTypes, defaultBindTypes); + ZEPHIR_CPY_WRT(&mergedTypes, &defaultBindTypes); } } else { - ZEPHIR_CPY_WRT(mergedTypes, bindTypes); + ZEPHIR_CPY_WRT(&mergedTypes, bindTypes); } - _2 = Z_TYPE_P(mergedParams) != IS_NULL; + _2 = Z_TYPE_P(&mergedParams) != IS_NULL; if (_2) { - _2 = Z_TYPE_P(mergedParams) != IS_ARRAY; + _2 = Z_TYPE_P(&mergedParams) != IS_ARRAY; } if (_2) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Bound parameters must be an array", "phalcon/mvc/model/query.zep", 3404); return; } - _3 = Z_TYPE_P(mergedTypes) != IS_NULL; + _3 = Z_TYPE_P(&mergedTypes) != IS_NULL; if (_3) { - _3 = Z_TYPE_P(mergedTypes) != IS_ARRAY; + _3 = Z_TYPE_P(&mergedTypes) != IS_ARRAY; } if (_3) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Bound parameter types must be an array", "phalcon/mvc/model/query.zep", 3408); return; } - ZEPHIR_OBS_VAR(type); - zephir_read_property_this(&type, this_ptr, SL("_type"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&type); + zephir_read_property(&type, this_ptr, SL("_type"), PH_NOISY_CC); do { - if (ZEPHIR_IS_LONG(type, 309)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "_executeselect", NULL, 382, intermediate, mergedParams, mergedTypes); + if (ZEPHIR_IS_LONG(&type, 309)) { + ZEPHIR_CALL_METHOD(&result, this_ptr, "_executeselect", NULL, 340, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(type, 306)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "_executeinsert", NULL, 383, intermediate, mergedParams, mergedTypes); + if (ZEPHIR_IS_LONG(&type, 306)) { + ZEPHIR_CALL_METHOD(&result, this_ptr, "_executeinsert", NULL, 341, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(type, 300)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "_executeupdate", NULL, 384, intermediate, mergedParams, mergedTypes); + if (ZEPHIR_IS_LONG(&type, 300)) { + ZEPHIR_CALL_METHOD(&result, this_ptr, "_executeupdate", NULL, 342, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(type, 303)) { - ZEPHIR_CALL_METHOD(&result, this_ptr, "_executedelete", NULL, 385, intermediate, mergedParams, mergedTypes); + if (ZEPHIR_IS_LONG(&type, 303)) { + ZEPHIR_CALL_METHOD(&result, this_ptr, "_executedelete", NULL, 343, &intermediate, &mergedParams, &mergedTypes); zephir_check_call_status(); break; } - ZEPHIR_INIT_VAR(_4$$27); - object_init_ex(_4$$27, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_5$$27); - ZEPHIR_CONCAT_SV(_5$$27, "Unknown statement ", type); - ZEPHIR_CALL_METHOD(NULL, _4$$27, "__construct", NULL, 9, _5$$27); + ZEPHIR_INIT_VAR(&_4$$27); + object_init_ex(&_4$$27, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_5$$27); + ZEPHIR_CONCAT_SV(&_5$$27, "Unknown statement ", &type); + ZEPHIR_CALL_METHOD(NULL, &_4$$27, "__construct", NULL, 4, &_5$$27); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$27, "phalcon/mvc/model/query.zep", 3431 TSRMLS_CC); + zephir_throw_exception_debug(&_4$$27, "phalcon/mvc/model/query.zep", 3431 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); - if (Z_TYPE_P(cacheOptions) != IS_NULL) { - if (!ZEPHIR_IS_LONG(type, 309)) { + if (Z_TYPE_P(&cacheOptions) != IS_NULL) { + if (!ZEPHIR_IS_LONG(&type, 309)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Only PHQL statements that return resultsets can be cached", "phalcon/mvc/model/query.zep", 3443); return; } - ZEPHIR_CALL_METHOD(NULL, cache, "save", NULL, 0, key, result, lifetime); + ZEPHIR_CALL_METHOD(NULL, &cache, "save", NULL, 0, &key, &result, &lifetime); zephir_check_call_status(); } - if (zephir_is_true(uniqueRow)) { - ZEPHIR_CALL_METHOD(&preparedResult, result, "getfirst", NULL, 0); + if (zephir_is_true(&uniqueRow)) { + ZEPHIR_CALL_METHOD(&preparedResult, &result, "getfirst", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(preparedResult, result); + ZEPHIR_CPY_WRT(&preparedResult, &result); } - RETURN_CCTOR(preparedResult); + RETURN_CCTOR(&preparedResult); } @@ -4339,28 +5168,37 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, execute) { PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleResult) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *bindParams = NULL, *bindTypes = NULL, *_0, *_1 = NULL; + zval *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &bindParams, &bindTypes); if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_uniqueRow"), PH_NOISY_CC); - if (zephir_is_true(_0)) { + zephir_read_property(&_0, this_ptr, SL("_uniqueRow"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { ZEPHIR_RETURN_CALL_METHOD(this_ptr, "execute", NULL, 0, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&_1, this_ptr, "execute", NULL, 381, bindParams, bindTypes); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "execute", NULL, 339, bindParams, bindTypes); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(_1, "getfirst", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&_1, "getfirst", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -4371,8 +5209,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSingleResult) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, setType) { - zval *type_param = NULL, *_0; + zval *type_param = NULL, _0; zend_long type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &type_param); @@ -4380,8 +5221,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setType) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, type); - zephir_update_property_this(getThis(), SL("_type"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, type); + zephir_update_property_zval(this_ptr, SL("_type"), &_0); RETURN_THISW(); } @@ -4391,7 +5232,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setType) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -4403,13 +5245,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getType) { PHP_METHOD(Phalcon_Mvc_Model_Query, setBindParams) { zend_bool merge; - zval *bindParams_param = NULL, *merge_param = NULL, *currentBindParams = NULL, *_0$$4; - zval *bindParams = NULL; + zval *bindParams_param = NULL, *merge_param = NULL, currentBindParams, _0$$4; + zval bindParams; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(¤tBindParams); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &bindParams_param, &merge_param); - bindParams = bindParams_param; + ZEPHIR_OBS_COPY_OR_DUP(&bindParams, bindParams_param); if (!merge_param) { merge = 0; } else { @@ -4418,16 +5265,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setBindParams) { if (merge) { - currentBindParams = zephir_fetch_nproperty_this(this_ptr, SL("_bindParams"), PH_NOISY_CC); - if (Z_TYPE_P(currentBindParams) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$4); - zephir_add_function(_0$$4, currentBindParams, bindParams); - zephir_update_property_this(getThis(), SL("_bindParams"), _0$$4 TSRMLS_CC); + zephir_read_property(¤tBindParams, this_ptr, SL("_bindParams"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(¤tBindParams) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$4); + zephir_add_function(&_0$$4, ¤tBindParams, &bindParams); + zephir_update_property_zval(this_ptr, SL("_bindParams"), &_0$$4); } else { - zephir_update_property_this(getThis(), SL("_bindParams"), bindParams TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindParams"), &bindParams); } } else { - zephir_update_property_this(getThis(), SL("_bindParams"), bindParams TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindParams"), &bindParams); } RETURN_THIS(); @@ -4440,7 +5287,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setBindParams) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getBindParams) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_bindParams"); @@ -4452,13 +5300,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getBindParams) { PHP_METHOD(Phalcon_Mvc_Model_Query, setBindTypes) { zend_bool merge; - zval *bindTypes_param = NULL, *merge_param = NULL, *currentBindTypes = NULL, *_0$$4; - zval *bindTypes = NULL; + zval *bindTypes_param = NULL, *merge_param = NULL, currentBindTypes, _0$$4; + zval bindTypes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(¤tBindTypes); + ZVAL_UNDEF(&_0$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &bindTypes_param, &merge_param); - bindTypes = bindTypes_param; + ZEPHIR_OBS_COPY_OR_DUP(&bindTypes, bindTypes_param); if (!merge_param) { merge = 0; } else { @@ -4467,16 +5320,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setBindTypes) { if (UNEXPECTED(merge)) { - currentBindTypes = zephir_fetch_nproperty_this(this_ptr, SL("_bindTypes"), PH_NOISY_CC); - if (Z_TYPE_P(currentBindTypes) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$4); - zephir_add_function(_0$$4, currentBindTypes, bindTypes); - zephir_update_property_this(getThis(), SL("_bindTypes"), _0$$4 TSRMLS_CC); + zephir_read_property(¤tBindTypes, this_ptr, SL("_bindTypes"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(¤tBindTypes) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$4); + zephir_add_function(&_0$$4, ¤tBindTypes, &bindTypes); + zephir_update_property_zval(this_ptr, SL("_bindTypes"), &_0$$4); } else { - zephir_update_property_this(getThis(), SL("_bindTypes"), bindTypes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindTypes"), &bindTypes); } } else { - zephir_update_property_this(getThis(), SL("_bindTypes"), bindTypes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindTypes"), &bindTypes); } RETURN_THIS(); @@ -4487,8 +5340,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setBindTypes) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, setSharedLock) { - zval *sharedLock_param = NULL; + zval *sharedLock_param = NULL, __$true, __$false; zend_bool sharedLock; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 0, 1, &sharedLock_param); @@ -4500,9 +5357,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setSharedLock) { if (sharedLock) { - zephir_update_property_this(getThis(), SL("_sharedLock"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sharedLock"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_sharedLock"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_sharedLock"), &__$false); } RETURN_THISW(); @@ -4515,7 +5372,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setSharedLock) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getBindTypes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_bindTypes"); @@ -4527,15 +5385,19 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getBindTypes) { PHP_METHOD(Phalcon_Mvc_Model_Query, setIntermediate) { zval *intermediate_param = NULL; - zval *intermediate = NULL; + zval intermediate; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&intermediate); - zephir_fetch_params(0, 1, 0, &intermediate_param); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &intermediate_param); - intermediate = intermediate_param; + ZEPHIR_OBS_COPY_OR_DUP(&intermediate, intermediate_param); - zephir_update_property_this(getThis(), SL("_intermediate"), intermediate TSRMLS_CC); - RETURN_THISW(); + zephir_update_property_zval(this_ptr, SL("_intermediate"), &intermediate); + RETURN_THIS(); } @@ -4546,7 +5408,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, setIntermediate) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getIntermediate) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_intermediate"); @@ -4557,13 +5420,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getIntermediate) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, cache) { - zval *cacheOptions; + zval *cacheOptions, cacheOptions_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&cacheOptions_sub); zephir_fetch_params(0, 1, 0, &cacheOptions); - zephir_update_property_this(getThis(), SL("_cacheOptions"), cacheOptions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cacheOptions"), cacheOptions); RETURN_THISW(); } @@ -4575,7 +5441,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, cache) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getCacheOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_cacheOptions"); @@ -4586,20 +5453,26 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getCacheOptions) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, getSql) { - zval *intermediate = NULL, *_0, *_1$$3, *_2$$3, *_3$$3; + zval intermediate, _0, _1$$3, _2$$3, _3$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&intermediate); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&intermediate, this_ptr, "parse", NULL, 0); zephir_check_call_status(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - if (ZEPHIR_IS_LONG(_0, 309)) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_bindParams"), PH_NOISY_CC); - _2$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_bindTypes"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_3$$3); - ZVAL_BOOL(_3$$3, 1); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_executeselect", NULL, 382, intermediate, _1$$3, _2$$3, _3$$3); + zephir_read_property(&_0, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_LONG(&_0, 309)) { + zephir_read_property(&_1$$3, this_ptr, SL("_bindParams"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_2$$3, this_ptr, SL("_bindTypes"), PH_NOISY_CC | PH_READONLY); + ZVAL_BOOL(&_3$$3, 1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_executeselect", NULL, 340, &intermediate, &_1$$3, &_2$$3, &_3$$3); zephir_check_call_status(); RETURN_MM(); } @@ -4613,13 +5486,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getSql) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, clean) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_static_property_ce(phalcon_mvc_model_query_ce, SL("_irPhqlCache"), &_0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zend_update_static_property(phalcon_mvc_model_query_ce, ZEND_STRL("_irPhqlCache"), &_0); ZEPHIR_MM_RESTORE(); } @@ -4631,53 +5507,61 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getReadConnection) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *intermediate = NULL, *bindParams = NULL, *bindTypes = NULL; - zval *model, *intermediate_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, *connection = NULL, *transaction = NULL; + zval intermediate, bindParams, bindTypes; + zval *model, model_sub, *intermediate_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, connection, transaction; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&transaction); + ZVAL_UNDEF(&intermediate); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&bindTypes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &model, &intermediate_param, &bindParams_param, &bindTypes_param); if (!intermediate_param) { - ZEPHIR_INIT_VAR(intermediate); - array_init(intermediate); + ZEPHIR_INIT_VAR(&intermediate); + array_init(&intermediate); } else { - zephir_get_arrval(intermediate, intermediate_param); + zephir_get_arrval(&intermediate, intermediate_param); } if (!bindParams_param) { - ZEPHIR_INIT_VAR(bindParams); - array_init(bindParams); + ZEPHIR_INIT_VAR(&bindParams); + array_init(&bindParams); } else { - zephir_get_arrval(bindParams, bindParams_param); + zephir_get_arrval(&bindParams, bindParams_param); } if (!bindTypes_param) { - ZEPHIR_INIT_VAR(bindTypes); - array_init(bindTypes); + ZEPHIR_INIT_VAR(&bindTypes); + array_init(&bindTypes); } else { - zephir_get_arrval(bindTypes, bindTypes_param); + zephir_get_arrval(&bindTypes, bindTypes_param); } - ZEPHIR_INIT_VAR(connection); - ZVAL_NULL(connection); - ZEPHIR_OBS_VAR(transaction); - zephir_read_property_this(&transaction, this_ptr, SL("_transaction"), PH_NOISY_CC); - _0 = Z_TYPE_P(transaction) == IS_OBJECT; + ZEPHIR_INIT_VAR(&connection); + ZVAL_NULL(&connection); + ZEPHIR_OBS_VAR(&transaction); + zephir_read_property(&transaction, this_ptr, SL("_transaction"), PH_NOISY_CC); + _0 = Z_TYPE_P(&transaction) == IS_OBJECT; if (_0) { - _0 = zephir_instance_of_ev(transaction, phalcon_mvc_model_transactioninterface_ce TSRMLS_CC); + _0 = zephir_instance_of_ev(&transaction, phalcon_mvc_model_transactioninterface_ce TSRMLS_CC); } if (_0) { - ZEPHIR_RETURN_CALL_METHOD(transaction, "getconnection", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&transaction, "getconnection", NULL, 0); zephir_check_call_status(); RETURN_MM(); } - if ((zephir_method_exists_ex(model, SS("selectreadconnection") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(&connection, model, "selectreadconnection", NULL, 0, intermediate, bindParams, bindTypes); + if ((zephir_method_exists_ex(model, SL("selectreadconnection") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD(&connection, model, "selectreadconnection", NULL, 0, &intermediate, &bindParams, &bindTypes); zephir_check_call_status(); - if (Z_TYPE_P(connection) != IS_OBJECT) { + if (Z_TYPE_P(&connection) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectReadConnection did not return a connection", "phalcon/mvc/model/query.zep", 3650); return; } - RETURN_CCTOR(connection); + RETURN_CCTOR(&connection); } ZEPHIR_RETURN_CALL_METHOD(model, "getreadconnection", NULL, 0); zephir_check_call_status(); @@ -4692,53 +5576,61 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getWriteConnection) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *intermediate = NULL, *bindParams = NULL, *bindTypes = NULL; - zval *model, *intermediate_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, *connection = NULL, *transaction = NULL; + zval intermediate, bindParams, bindTypes; + zval *model, model_sub, *intermediate_param = NULL, *bindParams_param = NULL, *bindTypes_param = NULL, connection, transaction; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&transaction); + ZVAL_UNDEF(&intermediate); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&bindTypes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &model, &intermediate_param, &bindParams_param, &bindTypes_param); if (!intermediate_param) { - ZEPHIR_INIT_VAR(intermediate); - array_init(intermediate); + ZEPHIR_INIT_VAR(&intermediate); + array_init(&intermediate); } else { - zephir_get_arrval(intermediate, intermediate_param); + zephir_get_arrval(&intermediate, intermediate_param); } if (!bindParams_param) { - ZEPHIR_INIT_VAR(bindParams); - array_init(bindParams); + ZEPHIR_INIT_VAR(&bindParams); + array_init(&bindParams); } else { - zephir_get_arrval(bindParams, bindParams_param); + zephir_get_arrval(&bindParams, bindParams_param); } if (!bindTypes_param) { - ZEPHIR_INIT_VAR(bindTypes); - array_init(bindTypes); + ZEPHIR_INIT_VAR(&bindTypes); + array_init(&bindTypes); } else { - zephir_get_arrval(bindTypes, bindTypes_param); + zephir_get_arrval(&bindTypes, bindTypes_param); } - ZEPHIR_INIT_VAR(connection); - ZVAL_NULL(connection); - ZEPHIR_OBS_VAR(transaction); - zephir_read_property_this(&transaction, this_ptr, SL("_transaction"), PH_NOISY_CC); - _0 = Z_TYPE_P(transaction) == IS_OBJECT; + ZEPHIR_INIT_VAR(&connection); + ZVAL_NULL(&connection); + ZEPHIR_OBS_VAR(&transaction); + zephir_read_property(&transaction, this_ptr, SL("_transaction"), PH_NOISY_CC); + _0 = Z_TYPE_P(&transaction) == IS_OBJECT; if (_0) { - _0 = zephir_instance_of_ev(transaction, phalcon_mvc_model_transactioninterface_ce TSRMLS_CC); + _0 = zephir_instance_of_ev(&transaction, phalcon_mvc_model_transactioninterface_ce TSRMLS_CC); } if (_0) { - ZEPHIR_RETURN_CALL_METHOD(transaction, "getconnection", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&transaction, "getconnection", NULL, 0); zephir_check_call_status(); RETURN_MM(); } - if ((zephir_method_exists_ex(model, SS("selectwriteconnection") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(&connection, model, "selectwriteconnection", NULL, 0, intermediate, bindParams, bindTypes); + if ((zephir_method_exists_ex(model, SL("selectwriteconnection") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD(&connection, model, "selectwriteconnection", NULL, 0, &intermediate, &bindParams, &bindTypes); zephir_check_call_status(); - if (Z_TYPE_P(connection) != IS_OBJECT) { + if (Z_TYPE_P(&connection) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "selectWriteConnection did not return a connection", "phalcon/mvc/model/query.zep", 3673); return; } - RETURN_CCTOR(connection); + RETURN_CCTOR(&connection); } ZEPHIR_RETURN_CALL_METHOD(model, "getwriteconnection", NULL, 0); zephir_check_call_status(); @@ -4751,13 +5643,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query, getWriteConnection) { */ PHP_METHOD(Phalcon_Mvc_Model_Query, setTransaction) { - zval *transaction; + zval *transaction, transaction_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&transaction_sub); zephir_fetch_params(0, 1, 0, &transaction); - zephir_update_property_this(getThis(), SL("_transaction"), transaction TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_transaction"), transaction); RETURN_THISW(); } diff --git a/ext/phalcon/mvc/model/query.zep.h b/ext/phalcon/mvc/model/query.zep.h index 01012069732..d278c447226 100644 --- a/ext/phalcon/mvc/model/query.zep.h +++ b/ext/phalcon/mvc/model/query.zep.h @@ -64,32 +64,82 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setuniquerow, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_setuniquerow, 0, 1, Phalcon\\Mvc\\Model\\Query, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_setuniquerow, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, uniqueRow, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, uniqueRow) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getqualified, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_getuniquerow, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_getuniquerow, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getqualified, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getqualified, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expr, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getcallargument, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getcallargument, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getcallargument, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, argument, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getcaseexpression, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getcaseexpression, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getcaseexpression, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expr, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getfunctioncall, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getfunctioncall, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getfunctioncall, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expr, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getexpression, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getexpression, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getexpression, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, expr) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, quoting, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, quoting) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getselectcolumn, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getselectcolumn, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getselectcolumn, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, column, 0) ZEND_END_ARG_INFO() @@ -98,24 +148,44 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__gettable, 0, 0, 2) ZEND_ARG_INFO(0, qualifiedName) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getjoin, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getjoin, 0, 2, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getjoin, 0, 2, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, manager, Phalcon\\Mvc\\Model\\ManagerInterface, 0) ZEND_ARG_INFO(0, join) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getjointype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getjointype, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getjointype, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, join) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getsinglejoin, 0, 0, 5) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getsinglejoin, 0, 5, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getsinglejoin, 0, 5, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, joinType, IS_STRING, 0) +#else ZEND_ARG_INFO(0, joinType) +#endif ZEND_ARG_INFO(0, joinSource) ZEND_ARG_INFO(0, modelAlias) ZEND_ARG_INFO(0, joinAlias) ZEND_ARG_OBJ_INFO(0, relation, Phalcon\\Mvc\\Model\\RelationInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getmultijoin, 0, 0, 5) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getmultijoin, 0, 5, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getmultijoin, 0, 5, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, joinType) ZEND_ARG_INFO(0, joinSource) ZEND_ARG_INFO(0, modelAlias) @@ -127,49 +197,120 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getjoins, 0, 0, 1) ZEND_ARG_INFO(0, select) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getorderclause, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getorderclause, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getorderclause, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, order) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getgroupclause, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getgroupclause, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getgroupclause, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, group, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getlimitclause, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getlimitclause, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getlimitclause, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, limitClause, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__prepareselect, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__prepareselect, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__prepareselect, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, ast) ZEND_ARG_INFO(0, merge) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__prepareinsert, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__prepareinsert, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__prepareupdate, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__prepareupdate, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__preparedelete, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__preparedelete, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_parse, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_parse, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_getcache, 0, 0, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_getcache, 0, 0, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__executeselect, 0, 0, 3) ZEND_ARG_INFO(0, intermediate) ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, simulate, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, simulate) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__executeinsert, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query__executeinsert, 0, 3, Phalcon\\Mvc\\Model\\Query\\StatusInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__executeinsert, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\StatusInterface", 0) +#endif ZEND_ARG_INFO(0, intermediate) ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__executeupdate, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query__executeupdate, 0, 3, Phalcon\\Mvc\\Model\\Query\\StatusInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__executeupdate, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\StatusInterface", 0) +#endif ZEND_ARG_INFO(0, intermediate) ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__executedelete, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query__executedelete, 0, 3, Phalcon\\Mvc\\Model\\Query\\StatusInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__executedelete, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\StatusInterface", 0) +#endif ZEND_ARG_INFO(0, intermediate) ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query__getrelatedrecords, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query__getrelatedrecords, 0, 4, Phalcon\\Mvc\\Model\\ResultsetInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query__getrelatedrecords, 0, 4, IS_OBJECT, "Phalcon\\Mvc\\Model\\ResultsetInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_INFO(0, intermediate) ZEND_ARG_INFO(0, bindParams) @@ -186,47 +327,113 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_getsingleresult, 0, 0, 0) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_settype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_settype, 0, 1, Phalcon\\Mvc\\Model\\Query, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_settype, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setbindparams, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_gettype, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_gettype, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_setbindparams, 0, 1, Phalcon\\Mvc\\Model\\Query, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_setbindparams, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query", 0) +#endif ZEND_ARG_ARRAY_INFO(0, bindParams, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setbindtypes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_setbindtypes, 0, 1, Phalcon\\Mvc\\Model\\Query, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_setbindtypes, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query", 0) +#endif ZEND_ARG_ARRAY_INFO(0, bindTypes, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setsharedlock, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_setsharedlock, 0, 0, Phalcon\\Mvc\\Model\\Query, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_setsharedlock, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sharedLock, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, sharedLock) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_setintermediate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_setintermediate, 0, 1, Phalcon\\Mvc\\Model\\Query, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_setintermediate, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query", 0) +#endif ZEND_ARG_ARRAY_INFO(0, intermediate, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_cache, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_cache, 0, 1, Phalcon\\Mvc\\Model\\Query, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_cache, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query", 0) +#endif ZEND_ARG_INFO(0, cacheOptions) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_getreadconnection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_getsql, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_getsql, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_getreadconnection, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_getreadconnection, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_ARRAY_INFO(0, intermediate, 1) ZEND_ARG_ARRAY_INFO(0, bindParams, 1) ZEND_ARG_ARRAY_INFO(0, bindTypes, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_getwriteconnection, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_getwriteconnection, 0, 1, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_getwriteconnection, 0, 1, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_ARRAY_INFO(0, intermediate, 1) ZEND_ARG_ARRAY_INFO(0, bindParams, 1) ZEND_ARG_ARRAY_INFO(0, bindTypes, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_settransaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_settransaction, 0, 1, Phalcon\\Mvc\\Model\\Query, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_settransaction, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query", 0) +#endif ZEND_ARG_OBJ_INFO(0, transaction, Phalcon\\Mvc\\Model\\TransactionInterface, 0) ZEND_END_ARG_INFO() @@ -234,9 +441,9 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_method_entry) { PHP_ME(Phalcon_Mvc_Model_Query, getTransaction, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, __construct, arginfo_phalcon_mvc_model_query___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Query, setDI, arginfo_phalcon_mvc_model_query_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query, getDI, arginfo_phalcon_mvc_model_query_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, setUniqueRow, arginfo_phalcon_mvc_model_query_setuniquerow, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query, getUniqueRow, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query, getUniqueRow, arginfo_phalcon_mvc_model_query_getuniquerow, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, _getQualified, arginfo_phalcon_mvc_model_query__getqualified, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Query, _getCallArgument, arginfo_phalcon_mvc_model_query__getcallargument, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Query, _getCaseExpression, arginfo_phalcon_mvc_model_query__getcaseexpression, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) @@ -253,11 +460,11 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_method_entry) { PHP_ME(Phalcon_Mvc_Model_Query, _getGroupClause, arginfo_phalcon_mvc_model_query__getgroupclause, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Query, _getLimitClause, arginfo_phalcon_mvc_model_query__getlimitclause, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Query, _prepareSelect, arginfo_phalcon_mvc_model_query__prepareselect, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Mvc_Model_Query, _prepareInsert, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Mvc_Model_Query, _prepareUpdate, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Mvc_Model_Query, _prepareDelete, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Mvc_Model_Query, parse, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query, getCache, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query, _prepareInsert, arginfo_phalcon_mvc_model_query__prepareinsert, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Mvc_Model_Query, _prepareUpdate, arginfo_phalcon_mvc_model_query__prepareupdate, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Mvc_Model_Query, _prepareDelete, arginfo_phalcon_mvc_model_query__preparedelete, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Mvc_Model_Query, parse, arginfo_phalcon_mvc_model_query_parse, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query, getCache, arginfo_phalcon_mvc_model_query_getcache, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, _executeSelect, arginfo_phalcon_mvc_model_query__executeselect, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Query, _executeInsert, arginfo_phalcon_mvc_model_query__executeinsert, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Query, _executeUpdate, arginfo_phalcon_mvc_model_query__executeupdate, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) @@ -266,7 +473,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_method_entry) { PHP_ME(Phalcon_Mvc_Model_Query, execute, arginfo_phalcon_mvc_model_query_execute, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, getSingleResult, arginfo_phalcon_mvc_model_query_getsingleresult, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, setType, arginfo_phalcon_mvc_model_query_settype, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query, getType, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query, getType, arginfo_phalcon_mvc_model_query_gettype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, setBindParams, arginfo_phalcon_mvc_model_query_setbindparams, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, getBindParams, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, setBindTypes, arginfo_phalcon_mvc_model_query_setbindtypes, ZEND_ACC_PUBLIC) @@ -276,7 +483,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_method_entry) { PHP_ME(Phalcon_Mvc_Model_Query, getIntermediate, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, cache, arginfo_phalcon_mvc_model_query_cache, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, getCacheOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query, getSql, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query, getSql, arginfo_phalcon_mvc_model_query_getsql, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query, clean, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Mvc_Model_Query, getReadConnection, arginfo_phalcon_mvc_model_query_getreadconnection, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model_Query, getWriteConnection, arginfo_phalcon_mvc_model_query_getwriteconnection, ZEND_ACC_PROTECTED) diff --git a/ext/phalcon/mvc/model/query/builder.zep.c b/ext/phalcon/mvc/model/query/builder.zep.c index 7d4aacc5b9a..58831ac0410 100644 --- a/ext/phalcon/mvc/model/query/builder.zep.c +++ b/ext/phalcon/mvc/model/query/builder.zep.c @@ -109,154 +109,185 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query_Builder) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, __construct) { - zend_bool _6$$35; - HashTable *_1$$7; - HashPosition _0$$7; - zval *params = NULL, *dependencyInjector = NULL, *conditions = NULL, *columns = NULL, *groupClause = NULL, *havingClause = NULL, *limitClause = NULL, *forUpdate = NULL, *sharedLock = NULL, *orderClause = NULL, *offsetClause = NULL, *joinsClause = NULL, *singleConditionArray = NULL, *limit = NULL, *offset = NULL, *fromClause = NULL, *mergedConditions = NULL, *mergedParams = NULL, *mergedTypes = NULL, *singleCondition = NULL, *singleParams = NULL, *singleTypes = NULL, *distinct = NULL, *bind = NULL, *bindTypes = NULL, **_2$$7, *_5$$7, *_3$$11 = NULL, *_4$$12 = NULL; + zend_bool _4$$35; + zval *params = NULL, params_sub, *dependencyInjector = NULL, dependencyInjector_sub, __$null, conditions, columns, groupClause, havingClause, limitClause, forUpdate, sharedLock, orderClause, offsetClause, joinsClause, singleConditionArray, limit, offset, fromClause, mergedConditions, mergedParams, mergedTypes, singleCondition, singleParams, singleTypes, distinct, bind, bindTypes, *_0$$7, _3$$7, _1$$11, _2$$12; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶ms_sub); + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&groupClause); + ZVAL_UNDEF(&havingClause); + ZVAL_UNDEF(&limitClause); + ZVAL_UNDEF(&forUpdate); + ZVAL_UNDEF(&sharedLock); + ZVAL_UNDEF(&orderClause); + ZVAL_UNDEF(&offsetClause); + ZVAL_UNDEF(&joinsClause); + ZVAL_UNDEF(&singleConditionArray); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&offset); + ZVAL_UNDEF(&fromClause); + ZVAL_UNDEF(&mergedConditions); + ZVAL_UNDEF(&mergedParams); + ZVAL_UNDEF(&mergedTypes); + ZVAL_UNDEF(&singleCondition); + ZVAL_UNDEF(&singleParams); + ZVAL_UNDEF(&singleTypes); + ZVAL_UNDEF(&distinct); + ZVAL_UNDEF(&bind); + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_1$$11); + ZVAL_UNDEF(&_2$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, ¶ms, &dependencyInjector); if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } if (!dependencyInjector) { - dependencyInjector = ZEPHIR_GLOBAL(global_null); + dependencyInjector = &dependencyInjector_sub; + dependencyInjector = &__$null; } if (Z_TYPE_P(params) == IS_ARRAY) { - ZEPHIR_OBS_VAR(conditions); + ZEPHIR_OBS_VAR(&conditions); if (zephir_array_isset_long_fetch(&conditions, params, 0, 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_conditions"), conditions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_conditions"), &conditions); } else { - ZEPHIR_OBS_NVAR(conditions); - if (zephir_array_isset_string_fetch(&conditions, params, SS("conditions"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_conditions"), conditions TSRMLS_CC); + ZEPHIR_OBS_NVAR(&conditions); + if (zephir_array_isset_string_fetch(&conditions, params, SL("conditions"), 0)) { + zephir_update_property_zval(this_ptr, SL("_conditions"), &conditions); } } - if (Z_TYPE_P(conditions) == IS_ARRAY) { - ZEPHIR_INIT_VAR(mergedConditions); - array_init(mergedConditions); - ZEPHIR_INIT_VAR(mergedParams); - array_init(mergedParams); - ZEPHIR_INIT_VAR(mergedTypes); - array_init(mergedTypes); - zephir_is_iterable(conditions, &_1$$7, &_0$$7, 0, 0, "phalcon/mvc/model/query/builder.zep", 155); - for ( - ; zend_hash_get_current_data_ex(_1$$7, (void**) &_2$$7, &_0$$7) == SUCCESS - ; zend_hash_move_forward_ex(_1$$7, &_0$$7) - ) { - ZEPHIR_GET_HVALUE(singleConditionArray, _2$$7); - if (Z_TYPE_P(singleConditionArray) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(singleCondition); - zephir_array_isset_long_fetch(&singleCondition, singleConditionArray, 0, 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(singleParams); - zephir_array_isset_long_fetch(&singleParams, singleConditionArray, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(singleTypes); - zephir_array_isset_long_fetch(&singleTypes, singleConditionArray, 2, 0 TSRMLS_CC); - if (Z_TYPE_P(singleCondition) == IS_STRING) { - zephir_array_append(&mergedConditions, singleCondition, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 142); + if (Z_TYPE_P(&conditions) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&mergedConditions); + array_init(&mergedConditions); + ZEPHIR_INIT_VAR(&mergedParams); + array_init(&mergedParams); + ZEPHIR_INIT_VAR(&mergedTypes); + array_init(&mergedTypes); + zephir_is_iterable(&conditions, 0, "phalcon/mvc/model/query/builder.zep", 155); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&conditions), _0$$7) + { + ZEPHIR_INIT_NVAR(&singleConditionArray); + ZVAL_COPY(&singleConditionArray, _0$$7); + if (Z_TYPE_P(&singleConditionArray) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&singleCondition); + zephir_array_isset_long_fetch(&singleCondition, &singleConditionArray, 0, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&singleParams); + zephir_array_isset_long_fetch(&singleParams, &singleConditionArray, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&singleTypes); + zephir_array_isset_long_fetch(&singleTypes, &singleConditionArray, 2, 0 TSRMLS_CC); + if (Z_TYPE_P(&singleCondition) == IS_STRING) { + zephir_array_append(&mergedConditions, &singleCondition, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 142); } - if (Z_TYPE_P(singleParams) == IS_ARRAY) { - ZEPHIR_INIT_LNVAR(_3$$11); - zephir_add_function(_3$$11, mergedParams, singleParams); - ZEPHIR_CPY_WRT(mergedParams, _3$$11); + if (Z_TYPE_P(&singleParams) == IS_ARRAY) { + ZEPHIR_INIT_LNVAR(_1$$11); + zephir_add_function(&_1$$11, &mergedParams, &singleParams); + ZEPHIR_CPY_WRT(&mergedParams, &_1$$11); } - if (Z_TYPE_P(singleTypes) == IS_ARRAY) { - ZEPHIR_INIT_LNVAR(_4$$12); - zephir_add_function(_4$$12, mergedTypes, singleTypes); - ZEPHIR_CPY_WRT(mergedTypes, _4$$12); + if (Z_TYPE_P(&singleTypes) == IS_ARRAY) { + ZEPHIR_INIT_LNVAR(_2$$12); + zephir_add_function(&_2$$12, &mergedTypes, &singleTypes); + ZEPHIR_CPY_WRT(&mergedTypes, &_2$$12); } } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&singleConditionArray); + ZEPHIR_INIT_VAR(&_3$$7); + zephir_fast_join_str(&_3$$7, SL(" AND "), &mergedConditions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_conditions"), &_3$$7); + if (Z_TYPE_P(&mergedParams) == IS_ARRAY) { + zephir_update_property_zval(this_ptr, SL("_bindParams"), &mergedParams); } - ZEPHIR_INIT_VAR(_5$$7); - zephir_fast_join_str(_5$$7, SL(" AND "), mergedConditions TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_conditions"), _5$$7 TSRMLS_CC); - if (Z_TYPE_P(mergedParams) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_bindParams"), mergedParams TSRMLS_CC); - } - if (Z_TYPE_P(mergedTypes) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_bindTypes"), mergedTypes TSRMLS_CC); + if (Z_TYPE_P(&mergedTypes) == IS_ARRAY) { + zephir_update_property_zval(this_ptr, SL("_bindTypes"), &mergedTypes); } } - ZEPHIR_OBS_VAR(bind); - if (zephir_array_isset_string_fetch(&bind, params, SS("bind"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_bindParams"), bind TSRMLS_CC); + ZEPHIR_OBS_VAR(&bind); + if (zephir_array_isset_string_fetch(&bind, params, SL("bind"), 0)) { + zephir_update_property_zval(this_ptr, SL("_bindParams"), &bind); } - ZEPHIR_OBS_VAR(bindTypes); - if (zephir_array_isset_string_fetch(&bindTypes, params, SS("bindTypes"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_bindTypes"), bindTypes TSRMLS_CC); + ZEPHIR_OBS_VAR(&bindTypes); + if (zephir_array_isset_string_fetch(&bindTypes, params, SL("bindTypes"), 0)) { + zephir_update_property_zval(this_ptr, SL("_bindTypes"), &bindTypes); } - ZEPHIR_OBS_VAR(distinct); - if (zephir_array_isset_string_fetch(&distinct, params, SS("distinct"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_distinct"), distinct TSRMLS_CC); + ZEPHIR_OBS_VAR(&distinct); + if (zephir_array_isset_string_fetch(&distinct, params, SL("distinct"), 0)) { + zephir_update_property_zval(this_ptr, SL("_distinct"), &distinct); } - ZEPHIR_OBS_VAR(fromClause); - if (zephir_array_isset_string_fetch(&fromClause, params, SS("models"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_models"), fromClause TSRMLS_CC); + ZEPHIR_OBS_VAR(&fromClause); + if (zephir_array_isset_string_fetch(&fromClause, params, SL("models"), 0)) { + zephir_update_property_zval(this_ptr, SL("_models"), &fromClause); } - ZEPHIR_OBS_VAR(columns); - if (zephir_array_isset_string_fetch(&columns, params, SS("columns"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_columns"), columns TSRMLS_CC); + ZEPHIR_OBS_VAR(&columns); + if (zephir_array_isset_string_fetch(&columns, params, SL("columns"), 0)) { + zephir_update_property_zval(this_ptr, SL("_columns"), &columns); } - ZEPHIR_OBS_VAR(joinsClause); - if (zephir_array_isset_string_fetch(&joinsClause, params, SS("joins"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_joins"), joinsClause TSRMLS_CC); + ZEPHIR_OBS_VAR(&joinsClause); + if (zephir_array_isset_string_fetch(&joinsClause, params, SL("joins"), 0)) { + zephir_update_property_zval(this_ptr, SL("_joins"), &joinsClause); } - ZEPHIR_OBS_VAR(groupClause); - if (zephir_array_isset_string_fetch(&groupClause, params, SS("group"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_group"), groupClause TSRMLS_CC); + ZEPHIR_OBS_VAR(&groupClause); + if (zephir_array_isset_string_fetch(&groupClause, params, SL("group"), 0)) { + zephir_update_property_zval(this_ptr, SL("_group"), &groupClause); } - ZEPHIR_OBS_VAR(havingClause); - if (zephir_array_isset_string_fetch(&havingClause, params, SS("having"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_having"), havingClause TSRMLS_CC); + ZEPHIR_OBS_VAR(&havingClause); + if (zephir_array_isset_string_fetch(&havingClause, params, SL("having"), 0)) { + zephir_update_property_zval(this_ptr, SL("_having"), &havingClause); } - ZEPHIR_OBS_VAR(orderClause); - if (zephir_array_isset_string_fetch(&orderClause, params, SS("order"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_order"), orderClause TSRMLS_CC); + ZEPHIR_OBS_VAR(&orderClause); + if (zephir_array_isset_string_fetch(&orderClause, params, SL("order"), 0)) { + zephir_update_property_zval(this_ptr, SL("_order"), &orderClause); } - ZEPHIR_OBS_VAR(limitClause); - if (zephir_array_isset_string_fetch(&limitClause, params, SS("limit"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(limitClause) == IS_ARRAY) { - ZEPHIR_OBS_VAR(limit); - if (zephir_array_isset_long_fetch(&limit, limitClause, 0, 0 TSRMLS_CC)) { - if (Z_TYPE_P(limit) == IS_LONG) { - zephir_update_property_this(getThis(), SL("_limit"), limit TSRMLS_CC); + ZEPHIR_OBS_VAR(&limitClause); + if (zephir_array_isset_string_fetch(&limitClause, params, SL("limit"), 0)) { + if (Z_TYPE_P(&limitClause) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&limit); + if (zephir_array_isset_long_fetch(&limit, &limitClause, 0, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&limit) == IS_LONG) { + zephir_update_property_zval(this_ptr, SL("_limit"), &limit); } - ZEPHIR_OBS_VAR(offset); - if (zephir_array_isset_long_fetch(&offset, limitClause, 1, 0 TSRMLS_CC)) { - if (Z_TYPE_P(offset) == IS_LONG) { - zephir_update_property_this(getThis(), SL("_offset"), offset TSRMLS_CC); + ZEPHIR_OBS_VAR(&offset); + if (zephir_array_isset_long_fetch(&offset, &limitClause, 1, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&offset) == IS_LONG) { + zephir_update_property_zval(this_ptr, SL("_offset"), &offset); } } } else { - zephir_update_property_this(getThis(), SL("_limit"), limitClause TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_limit"), &limitClause); } } else { - zephir_update_property_this(getThis(), SL("_limit"), limitClause TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_limit"), &limitClause); } } - if (zephir_array_isset_string_fetch(&offsetClause, params, SS("offset"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_offset"), offsetClause TSRMLS_CC); + if (zephir_array_isset_string_fetch(&offsetClause, params, SL("offset"), 1)) { + zephir_update_property_zval(this_ptr, SL("_offset"), &offsetClause); } - if (zephir_array_isset_string_fetch(&forUpdate, params, SS("for_update"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_forUpdate"), forUpdate TSRMLS_CC); + if (zephir_array_isset_string_fetch(&forUpdate, params, SL("for_update"), 1)) { + zephir_update_property_zval(this_ptr, SL("_forUpdate"), &forUpdate); } - if (zephir_array_isset_string_fetch(&sharedLock, params, SS("shared_lock"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_sharedLock"), sharedLock TSRMLS_CC); + if (zephir_array_isset_string_fetch(&sharedLock, params, SL("shared_lock"), 1)) { + zephir_update_property_zval(this_ptr, SL("_sharedLock"), &sharedLock); } } else { - _6$$35 = Z_TYPE_P(params) == IS_STRING; - if (_6$$35) { - _6$$35 = !ZEPHIR_IS_STRING_IDENTICAL(params, ""); + _4$$35 = Z_TYPE_P(params) == IS_STRING; + if (_4$$35) { + _4$$35 = !ZEPHIR_IS_STRING_IDENTICAL(params, ""); } - if (_6$$35) { - zephir_update_property_this(getThis(), SL("_conditions"), params TSRMLS_CC); + if (_4$$35) { + zephir_update_property_zval(this_ptr, SL("_conditions"), params); } } if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } ZEPHIR_MM_RESTORE(); @@ -267,13 +298,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); RETURN_THISW(); } @@ -283,7 +317,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, setDI) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -299,13 +334,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getDI) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, distinct) { - zval *distinct; + zval *distinct, distinct_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&distinct_sub); zephir_fetch_params(0, 1, 0, &distinct); - zephir_update_property_this(getThis(), SL("_distinct"), distinct TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_distinct"), distinct); RETURN_THISW(); } @@ -315,7 +353,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, distinct) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getDistinct) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_distinct"); @@ -344,13 +383,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getDistinct) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, columns) { - zval *columns; + zval *columns, columns_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&columns_sub); zephir_fetch_params(0, 1, 0, &columns); - zephir_update_property_this(getThis(), SL("_columns"), columns TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_columns"), columns); RETURN_THISW(); } @@ -362,7 +404,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, columns) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getColumns) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_columns"); @@ -391,13 +434,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getColumns) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, from) { - zval *models; + zval *models, models_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&models_sub); zephir_fetch_params(0, 1, 0, &models); - zephir_update_property_this(getThis(), SL("_models"), models TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_models"), models); RETURN_THISW(); } @@ -418,46 +464,57 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, from) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, addFrom) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *model, *alias = NULL, *with = NULL, *models = NULL, *currentModel = NULL, _0$$3, _1$$3; + zval *model, model_sub, *alias = NULL, alias_sub, *with = NULL, with_sub, __$null, models, currentModel, _0$$3, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&alias_sub); + ZVAL_UNDEF(&with_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(¤tModel); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &model, &alias, &with); if (!alias) { - alias = ZEPHIR_GLOBAL(global_null); + alias = &alias_sub; + alias = &__$null; } if (!with) { - with = ZEPHIR_GLOBAL(global_null); + with = &with_sub; + with = &__$null; } if (Z_TYPE_P(with) != IS_NULL) { - ZEPHIR_SINIT_VAR(_0$$3); - ZVAL_STRING(&_0$$3, "The third parameter 'with' is deprecated and will be removed in future releases.", 0); - ZEPHIR_SINIT_VAR(_1$$3); + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "The third parameter 'with' is deprecated and will be removed in future releases."); ZVAL_LONG(&_1$$3, 8192); - ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 2, &_0$$3, &_1$$3); + ZEPHIR_CALL_FUNCTION(NULL, "trigger_error", NULL, 1, &_0$$3, &_1$$3); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(models); - zephir_read_property_this(&models, this_ptr, SL("_models"), PH_NOISY_CC); - if (Z_TYPE_P(models) != IS_ARRAY) { - if (Z_TYPE_P(models) != IS_NULL) { - ZEPHIR_CPY_WRT(currentModel, models); - ZEPHIR_INIT_NVAR(models); - zephir_create_array(models, 1, 0 TSRMLS_CC); - zephir_array_fast_append(models, currentModel); + ZEPHIR_OBS_VAR(&models); + zephir_read_property(&models, this_ptr, SL("_models"), PH_NOISY_CC); + if (Z_TYPE_P(&models) != IS_ARRAY) { + if (Z_TYPE_P(&models) != IS_NULL) { + ZEPHIR_CPY_WRT(¤tModel, &models); + ZEPHIR_INIT_NVAR(&models); + zephir_create_array(&models, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&models, ¤tModel); } else { - ZEPHIR_INIT_NVAR(models); - array_init(models); + ZEPHIR_INIT_NVAR(&models); + array_init(&models); } } if (Z_TYPE_P(alias) == IS_STRING) { - zephir_array_update_zval(&models, alias, &model, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&models, alias, model, PH_COPY | PH_SEPARATE); } else { zephir_array_append(&models, model, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 422); } - zephir_update_property_this(getThis(), SL("_models"), models TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_models"), &models); RETURN_THIS(); } @@ -469,7 +526,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, addFrom) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getFrom) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_models"); @@ -500,41 +558,52 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getFrom) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, join) { - zval *_0; - zval *model_param = NULL, *conditions = NULL, *alias = NULL, *type = NULL; - zval *model = NULL; + zval _0; + zval *model_param = NULL, *conditions = NULL, conditions_sub, *alias = NULL, alias_sub, *type = NULL, type_sub, __$null; + zval model; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&alias_sub); + ZVAL_UNDEF(&type_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &model_param, &conditions, &alias, &type); if (UNEXPECTED(Z_TYPE_P(model_param) != IS_STRING && Z_TYPE_P(model_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(model_param) == IS_STRING)) { - zephir_get_strval(model, model_param); + zephir_get_strval(&model, model_param); } else { - ZEPHIR_INIT_VAR(model); - ZVAL_EMPTY_STRING(model); + ZEPHIR_INIT_VAR(&model); + ZVAL_EMPTY_STRING(&model); } if (!conditions) { - conditions = ZEPHIR_GLOBAL(global_null); + conditions = &conditions_sub; + conditions = &__$null; } if (!alias) { - alias = ZEPHIR_GLOBAL(global_null); + alias = &alias_sub; + alias = &__$null; } if (!type) { - type = ZEPHIR_GLOBAL(global_null); + type = &type_sub; + type = &__$null; } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 4, 0 TSRMLS_CC); - zephir_array_fast_append(_0, model); - zephir_array_fast_append(_0, conditions); - zephir_array_fast_append(_0, alias); - zephir_array_fast_append(_0, type); - zephir_update_property_array_append(this_ptr, SL("_joins"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 4, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, &model); + zephir_array_fast_append(&_0, conditions); + zephir_array_fast_append(&_0, alias); + zephir_array_fast_append(&_0, type); + zephir_update_property_array_append(this_ptr, SL("_joins"), &_0 TSRMLS_CC); RETURN_THIS(); } @@ -561,40 +630,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, join) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, innerJoin) { - zval *_0; - zval *model_param = NULL, *conditions = NULL, *alias = NULL, *_1; - zval *model = NULL; + zval _0; + zval *model_param = NULL, *conditions = NULL, conditions_sub, *alias = NULL, alias_sub, __$null, _1; + zval model; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&alias_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &model_param, &conditions, &alias); if (UNEXPECTED(Z_TYPE_P(model_param) != IS_STRING && Z_TYPE_P(model_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(model_param) == IS_STRING)) { - zephir_get_strval(model, model_param); + zephir_get_strval(&model, model_param); } else { - ZEPHIR_INIT_VAR(model); - ZVAL_EMPTY_STRING(model); + ZEPHIR_INIT_VAR(&model); + ZVAL_EMPTY_STRING(&model); } if (!conditions) { - conditions = ZEPHIR_GLOBAL(global_null); + conditions = &conditions_sub; + conditions = &__$null; } if (!alias) { - alias = ZEPHIR_GLOBAL(global_null); + alias = &alias_sub; + alias = &__$null; } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 4, 0 TSRMLS_CC); - zephir_array_fast_append(_0, model); - zephir_array_fast_append(_0, conditions); - zephir_array_fast_append(_0, alias); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "INNER", 1); - zephir_array_fast_append(_0, _1); - zephir_update_property_array_append(this_ptr, SL("_joins"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 4, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, &model); + zephir_array_fast_append(&_0, conditions); + zephir_array_fast_append(&_0, alias); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "INNER"); + zephir_array_fast_append(&_0, &_1); + zephir_update_property_array_append(this_ptr, SL("_joins"), &_0 TSRMLS_CC); RETURN_THIS(); } @@ -613,40 +692,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, innerJoin) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, leftJoin) { - zval *_0; - zval *model_param = NULL, *conditions = NULL, *alias = NULL, *_1; - zval *model = NULL; + zval _0; + zval *model_param = NULL, *conditions = NULL, conditions_sub, *alias = NULL, alias_sub, __$null, _1; + zval model; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&alias_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &model_param, &conditions, &alias); if (UNEXPECTED(Z_TYPE_P(model_param) != IS_STRING && Z_TYPE_P(model_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(model_param) == IS_STRING)) { - zephir_get_strval(model, model_param); + zephir_get_strval(&model, model_param); } else { - ZEPHIR_INIT_VAR(model); - ZVAL_EMPTY_STRING(model); + ZEPHIR_INIT_VAR(&model); + ZVAL_EMPTY_STRING(&model); } if (!conditions) { - conditions = ZEPHIR_GLOBAL(global_null); + conditions = &conditions_sub; + conditions = &__$null; } if (!alias) { - alias = ZEPHIR_GLOBAL(global_null); + alias = &alias_sub; + alias = &__$null; } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 4, 0 TSRMLS_CC); - zephir_array_fast_append(_0, model); - zephir_array_fast_append(_0, conditions); - zephir_array_fast_append(_0, alias); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "LEFT", 1); - zephir_array_fast_append(_0, _1); - zephir_update_property_array_append(this_ptr, SL("_joins"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 4, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, &model); + zephir_array_fast_append(&_0, conditions); + zephir_array_fast_append(&_0, alias); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "LEFT"); + zephir_array_fast_append(&_0, &_1); + zephir_update_property_array_append(this_ptr, SL("_joins"), &_0 TSRMLS_CC); RETURN_THIS(); } @@ -665,40 +754,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, leftJoin) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, rightJoin) { - zval *_0; - zval *model_param = NULL, *conditions = NULL, *alias = NULL, *_1; - zval *model = NULL; + zval _0; + zval *model_param = NULL, *conditions = NULL, conditions_sub, *alias = NULL, alias_sub, __$null, _1; + zval model; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&alias_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &model_param, &conditions, &alias); if (UNEXPECTED(Z_TYPE_P(model_param) != IS_STRING && Z_TYPE_P(model_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'model' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(model_param) == IS_STRING)) { - zephir_get_strval(model, model_param); + zephir_get_strval(&model, model_param); } else { - ZEPHIR_INIT_VAR(model); - ZVAL_EMPTY_STRING(model); + ZEPHIR_INIT_VAR(&model); + ZVAL_EMPTY_STRING(&model); } if (!conditions) { - conditions = ZEPHIR_GLOBAL(global_null); + conditions = &conditions_sub; + conditions = &__$null; } if (!alias) { - alias = ZEPHIR_GLOBAL(global_null); + alias = &alias_sub; + alias = &__$null; } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 4, 0 TSRMLS_CC); - zephir_array_fast_append(_0, model); - zephir_array_fast_append(_0, conditions); - zephir_array_fast_append(_0, alias); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "RIGHT", 1); - zephir_array_fast_append(_0, _1); - zephir_update_property_array_append(this_ptr, SL("_joins"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 4, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, &model); + zephir_array_fast_append(&_0, conditions); + zephir_array_fast_append(&_0, alias); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "RIGHT"); + zephir_array_fast_append(&_0, &_1); + zephir_update_property_array_append(this_ptr, SL("_joins"), &_0 TSRMLS_CC); RETURN_THIS(); } @@ -710,7 +809,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, rightJoin) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getJoins) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_joins"); @@ -740,38 +840,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getJoins) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, where) { - zval *conditions, *bindParams = NULL, *bindTypes = NULL, *currentBindParams = NULL, *currentBindTypes = NULL, *_0$$4, *_1$$7; + zval *conditions, conditions_sub, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, currentBindParams, currentBindTypes, _0$$4, _1$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¤tBindParams); + ZVAL_UNDEF(¤tBindTypes); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions, &bindParams, &bindTypes); if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - zephir_update_property_this(getThis(), SL("_conditions"), conditions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_conditions"), conditions); if (Z_TYPE_P(bindParams) == IS_ARRAY) { - currentBindParams = zephir_fetch_nproperty_this(this_ptr, SL("_bindParams"), PH_NOISY_CC); - if (Z_TYPE_P(currentBindParams) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$4); - zephir_add_function(_0$$4, currentBindParams, bindParams); - zephir_update_property_this(getThis(), SL("_bindParams"), _0$$4 TSRMLS_CC); + zephir_read_property(¤tBindParams, this_ptr, SL("_bindParams"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(¤tBindParams) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$4); + zephir_add_function(&_0$$4, ¤tBindParams, bindParams); + zephir_update_property_zval(this_ptr, SL("_bindParams"), &_0$$4); } else { - zephir_update_property_this(getThis(), SL("_bindParams"), bindParams TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindParams"), bindParams); } } if (Z_TYPE_P(bindTypes) == IS_ARRAY) { - currentBindTypes = zephir_fetch_nproperty_this(this_ptr, SL("_bindTypes"), PH_NOISY_CC); - if (Z_TYPE_P(currentBindTypes) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_1$$7); - zephir_add_function(_1$$7, currentBindTypes, bindTypes); - zephir_update_property_this(getThis(), SL("_bindTypes"), _1$$7 TSRMLS_CC); + zephir_read_property(¤tBindTypes, this_ptr, SL("_bindTypes"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(¤tBindTypes) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_1$$7); + zephir_add_function(&_1$$7, ¤tBindTypes, bindTypes); + zephir_update_property_zval(this_ptr, SL("_bindTypes"), &_1$$7); } else { - zephir_update_property_this(getThis(), SL("_bindTypes"), bindTypes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindTypes"), bindTypes); } } RETURN_THIS(); @@ -801,38 +913,48 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, where) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, andWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *conditions_param = NULL, *bindParams = NULL, *bindTypes = NULL, *currentConditions = NULL, *_0$$3; - zval *conditions = NULL; + zval *conditions_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, currentConditions, _0$$3; + zval conditions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¤tConditions); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(conditions_param) != IS_STRING && Z_TYPE_P(conditions_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(conditions_param) == IS_STRING)) { - zephir_get_strval(conditions, conditions_param); + zephir_get_strval(&conditions, conditions_param); } else { - ZEPHIR_INIT_VAR(conditions); - ZVAL_EMPTY_STRING(conditions); + ZEPHIR_INIT_VAR(&conditions); + ZVAL_EMPTY_STRING(&conditions); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_OBS_VAR(currentConditions); - zephir_read_property_this(¤tConditions, this_ptr, SL("_conditions"), PH_NOISY_CC); - if (zephir_is_true(currentConditions)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_SVSVS(_0$$3, "(", currentConditions, ") AND (", conditions, ")"); - zephir_get_strval(conditions, _0$$3); + ZEPHIR_OBS_VAR(¤tConditions); + zephir_read_property(¤tConditions, this_ptr, SL("_conditions"), PH_NOISY_CC); + if (zephir_is_true(¤tConditions)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_SVSVS(&_0$$3, "(", ¤tConditions, ") AND (", &conditions, ")"); + zephir_get_strval(&conditions, &_0$$3); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "where", NULL, 0, conditions, bindParams, bindTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "where", NULL, 0, &conditions, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); @@ -861,38 +983,48 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, andWhere) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, orWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *conditions_param = NULL, *bindParams = NULL, *bindTypes = NULL, *currentConditions = NULL, *_0$$3; - zval *conditions = NULL; + zval *conditions_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, currentConditions, _0$$3; + zval conditions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¤tConditions); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(conditions_param) != IS_STRING && Z_TYPE_P(conditions_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(conditions_param) == IS_STRING)) { - zephir_get_strval(conditions, conditions_param); + zephir_get_strval(&conditions, conditions_param); } else { - ZEPHIR_INIT_VAR(conditions); - ZVAL_EMPTY_STRING(conditions); + ZEPHIR_INIT_VAR(&conditions); + ZVAL_EMPTY_STRING(&conditions); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_OBS_VAR(currentConditions); - zephir_read_property_this(¤tConditions, this_ptr, SL("_conditions"), PH_NOISY_CC); - if (zephir_is_true(currentConditions)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_SVSVS(_0$$3, "(", currentConditions, ") OR (", conditions, ")"); - zephir_get_strval(conditions, _0$$3); + ZEPHIR_OBS_VAR(¤tConditions); + zephir_read_property(¤tConditions, this_ptr, SL("_conditions"), PH_NOISY_CC); + if (zephir_is_true(¤tConditions)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_SVSVS(&_0$$3, "(", ¤tConditions, ") OR (", &conditions, ")"); + zephir_get_strval(&conditions, &_0$$3); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "where", NULL, 0, conditions, bindParams, bindTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "where", NULL, 0, &conditions, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); @@ -908,43 +1040,49 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, orWhere) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, betweenWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *minimum, *maximum, *operator_param = NULL, *_0; - zval *expr = NULL, *operator = NULL; + zval *expr_param = NULL, *minimum, minimum_sub, *maximum, maximum_sub, *operator_param = NULL, _0; + zval expr, operator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&minimum_sub); + ZVAL_UNDEF(&maximum_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &expr_param, &minimum, &maximum, &operator_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } if (!operator_param) { - ZEPHIR_INIT_VAR(operator); - ZVAL_STRING(operator, "and", 1); + ZEPHIR_INIT_VAR(&operator); + ZVAL_STRING(&operator, "and"); } else { if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Where", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionbetween", NULL, 0, _0, operator, expr, minimum, maximum); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Where"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionbetween", NULL, 0, &_0, &operator, &expr, minimum, maximum); zephir_check_call_status(); RETURN_MM(); @@ -960,43 +1098,49 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, betweenWhere) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, notBetweenWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *minimum, *maximum, *operator_param = NULL, *_0; - zval *expr = NULL, *operator = NULL; + zval *expr_param = NULL, *minimum, minimum_sub, *maximum, maximum_sub, *operator_param = NULL, _0; + zval expr, operator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&minimum_sub); + ZVAL_UNDEF(&maximum_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &expr_param, &minimum, &maximum, &operator_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } if (!operator_param) { - ZEPHIR_INIT_VAR(operator); - ZVAL_STRING(operator, "and", 1); + ZEPHIR_INIT_VAR(&operator); + ZVAL_STRING(&operator, "and"); } else { if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Where", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionnotbetween", NULL, 0, _0, operator, expr, minimum, maximum); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Where"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionnotbetween", NULL, 0, &_0, &operator, &expr, minimum, maximum); zephir_check_call_status(); RETURN_MM(); @@ -1012,45 +1156,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, notBetweenWhere) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, inWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *values = NULL; - zval *expr_param = NULL, *values_param = NULL, *operator_param = NULL, *_0; - zval *expr = NULL, *operator = NULL; + zval values; + zval *expr_param = NULL, *values_param = NULL, *operator_param = NULL, _0; + zval expr, operator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&values); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &expr_param, &values_param, &operator_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } - values = values_param; + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); if (!operator_param) { - ZEPHIR_INIT_VAR(operator); - ZVAL_STRING(operator, "and", 1); + ZEPHIR_INIT_VAR(&operator); + ZVAL_STRING(&operator, "and"); } else { if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Where", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionin", NULL, 0, _0, operator, expr, values); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Where"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionin", NULL, 0, &_0, &operator, &expr, &values); zephir_check_call_status(); RETURN_MM(); @@ -1066,45 +1215,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, inWhere) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, notInWhere) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *values = NULL; - zval *expr_param = NULL, *values_param = NULL, *operator_param = NULL, *_0; - zval *expr = NULL, *operator = NULL; + zval values; + zval *expr_param = NULL, *values_param = NULL, *operator_param = NULL, _0; + zval expr, operator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&values); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &expr_param, &values_param, &operator_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } - values = values_param; + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); if (!operator_param) { - ZEPHIR_INIT_VAR(operator); - ZVAL_STRING(operator, "and", 1); + ZEPHIR_INIT_VAR(&operator); + ZVAL_STRING(&operator, "and"); } else { if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Where", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionnotin", NULL, 0, _0, operator, expr, values); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Where"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionnotin", NULL, 0, &_0, &operator, &expr, &values); zephir_check_call_status(); RETURN_MM(); @@ -1117,7 +1271,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, notInWhere) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getWhere) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_conditions"); @@ -1137,13 +1292,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getWhere) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, orderBy) { - zval *orderBy; + zval *orderBy, orderBy_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&orderBy_sub); zephir_fetch_params(0, 1, 0, &orderBy); - zephir_update_property_this(getThis(), SL("_order"), orderBy TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_order"), orderBy); RETURN_THISW(); } @@ -1155,7 +1313,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, orderBy) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getOrderBy) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_order"); @@ -1182,38 +1341,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getOrderBy) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, having) { - zval *conditions, *bindParams = NULL, *bindTypes = NULL, *currentBindParams = NULL, *currentBindTypes = NULL, *_0$$4, *_1$$7; + zval *conditions, conditions_sub, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, currentBindParams, currentBindTypes, _0$$4, _1$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions_sub); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¤tBindParams); + ZVAL_UNDEF(¤tBindTypes); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions, &bindParams, &bindTypes); if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - zephir_update_property_this(getThis(), SL("_having"), conditions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_having"), conditions); if (Z_TYPE_P(bindParams) == IS_ARRAY) { - currentBindParams = zephir_fetch_nproperty_this(this_ptr, SL("_bindParams"), PH_NOISY_CC); - if (Z_TYPE_P(currentBindParams) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$4); - zephir_add_function(_0$$4, currentBindParams, bindParams); - zephir_update_property_this(getThis(), SL("_bindParams"), _0$$4 TSRMLS_CC); + zephir_read_property(¤tBindParams, this_ptr, SL("_bindParams"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(¤tBindParams) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$4); + zephir_add_function(&_0$$4, ¤tBindParams, bindParams); + zephir_update_property_zval(this_ptr, SL("_bindParams"), &_0$$4); } else { - zephir_update_property_this(getThis(), SL("_bindParams"), bindParams TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindParams"), bindParams); } } if (Z_TYPE_P(bindTypes) == IS_ARRAY) { - currentBindTypes = zephir_fetch_nproperty_this(this_ptr, SL("_bindTypes"), PH_NOISY_CC); - if (Z_TYPE_P(currentBindTypes) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_1$$7); - zephir_add_function(_1$$7, currentBindTypes, bindTypes); - zephir_update_property_this(getThis(), SL("_bindTypes"), _1$$7 TSRMLS_CC); + zephir_read_property(¤tBindTypes, this_ptr, SL("_bindTypes"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(¤tBindTypes) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_1$$7); + zephir_add_function(&_1$$7, ¤tBindTypes, bindTypes); + zephir_update_property_zval(this_ptr, SL("_bindTypes"), &_1$$7); } else { - zephir_update_property_this(getThis(), SL("_bindTypes"), bindTypes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_bindTypes"), bindTypes); } } RETURN_THIS(); @@ -1242,38 +1413,48 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, having) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, andHaving) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *conditions_param = NULL, *bindParams = NULL, *bindTypes = NULL, *currentConditions = NULL, *_0$$3; - zval *conditions = NULL; + zval *conditions_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, currentConditions, _0$$3; + zval conditions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¤tConditions); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(conditions_param) != IS_STRING && Z_TYPE_P(conditions_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(conditions_param) == IS_STRING)) { - zephir_get_strval(conditions, conditions_param); + zephir_get_strval(&conditions, conditions_param); } else { - ZEPHIR_INIT_VAR(conditions); - ZVAL_EMPTY_STRING(conditions); + ZEPHIR_INIT_VAR(&conditions); + ZVAL_EMPTY_STRING(&conditions); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_OBS_VAR(currentConditions); - zephir_read_property_this(¤tConditions, this_ptr, SL("_having"), PH_NOISY_CC); - if (zephir_is_true(currentConditions)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_SVSVS(_0$$3, "(", currentConditions, ") AND (", conditions, ")"); - zephir_get_strval(conditions, _0$$3); + ZEPHIR_OBS_VAR(¤tConditions); + zephir_read_property(¤tConditions, this_ptr, SL("_having"), PH_NOISY_CC); + if (zephir_is_true(¤tConditions)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_SVSVS(&_0$$3, "(", ¤tConditions, ") AND (", &conditions, ")"); + zephir_get_strval(&conditions, &_0$$3); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "having", NULL, 0, conditions, bindParams, bindTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "having", NULL, 0, &conditions, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); @@ -1301,38 +1482,48 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, andHaving) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, orHaving) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *conditions_param = NULL, *bindParams = NULL, *bindTypes = NULL, *currentConditions = NULL, *_0$$3; - zval *conditions = NULL; + zval *conditions_param = NULL, *bindParams = NULL, bindParams_sub, *bindTypes = NULL, bindTypes_sub, __$null, currentConditions, _0$$3; + zval conditions; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams_sub); + ZVAL_UNDEF(&bindTypes_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¤tConditions); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &conditions_param, &bindParams, &bindTypes); if (UNEXPECTED(Z_TYPE_P(conditions_param) != IS_STRING && Z_TYPE_P(conditions_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'conditions' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(conditions_param) == IS_STRING)) { - zephir_get_strval(conditions, conditions_param); + zephir_get_strval(&conditions, conditions_param); } else { - ZEPHIR_INIT_VAR(conditions); - ZVAL_EMPTY_STRING(conditions); + ZEPHIR_INIT_VAR(&conditions); + ZVAL_EMPTY_STRING(&conditions); } if (!bindParams) { - bindParams = ZEPHIR_GLOBAL(global_null); + bindParams = &bindParams_sub; + bindParams = &__$null; } if (!bindTypes) { - bindTypes = ZEPHIR_GLOBAL(global_null); + bindTypes = &bindTypes_sub; + bindTypes = &__$null; } - ZEPHIR_OBS_VAR(currentConditions); - zephir_read_property_this(¤tConditions, this_ptr, SL("_having"), PH_NOISY_CC); - if (zephir_is_true(currentConditions)) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_SVSVS(_0$$3, "(", currentConditions, ") OR (", conditions, ")"); - zephir_get_strval(conditions, _0$$3); + ZEPHIR_OBS_VAR(¤tConditions); + zephir_read_property(¤tConditions, this_ptr, SL("_having"), PH_NOISY_CC); + if (zephir_is_true(¤tConditions)) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_SVSVS(&_0$$3, "(", ¤tConditions, ") OR (", &conditions, ")"); + zephir_get_strval(&conditions, &_0$$3); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "having", NULL, 0, conditions, bindParams, bindTypes); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "having", NULL, 0, &conditions, bindParams, bindTypes); zephir_check_call_status(); RETURN_MM(); @@ -1348,43 +1539,49 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, orHaving) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, betweenHaving) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *minimum, *maximum, *operator_param = NULL, *_0; - zval *expr = NULL, *operator = NULL; + zval *expr_param = NULL, *minimum, minimum_sub, *maximum, maximum_sub, *operator_param = NULL, _0; + zval expr, operator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&minimum_sub); + ZVAL_UNDEF(&maximum_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &expr_param, &minimum, &maximum, &operator_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } if (!operator_param) { - ZEPHIR_INIT_VAR(operator); - ZVAL_STRING(operator, "and", 1); + ZEPHIR_INIT_VAR(&operator); + ZVAL_STRING(&operator, "and"); } else { if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Having", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionbetween", NULL, 0, _0, operator, expr, minimum, maximum); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Having"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionbetween", NULL, 0, &_0, &operator, &expr, minimum, maximum); zephir_check_call_status(); RETURN_MM(); @@ -1400,43 +1597,49 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, betweenHaving) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, notBetweenHaving) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *minimum, *maximum, *operator_param = NULL, *_0; - zval *expr = NULL, *operator = NULL; + zval *expr_param = NULL, *minimum, minimum_sub, *maximum, maximum_sub, *operator_param = NULL, _0; + zval expr, operator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&minimum_sub); + ZVAL_UNDEF(&maximum_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &expr_param, &minimum, &maximum, &operator_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } if (!operator_param) { - ZEPHIR_INIT_VAR(operator); - ZVAL_STRING(operator, "and", 1); + ZEPHIR_INIT_VAR(&operator); + ZVAL_STRING(&operator, "and"); } else { if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Having", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionnotbetween", NULL, 0, _0, operator, expr, minimum, maximum); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Having"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionnotbetween", NULL, 0, &_0, &operator, &expr, minimum, maximum); zephir_check_call_status(); RETURN_MM(); @@ -1452,45 +1655,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, notBetweenHaving) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, inHaving) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *values = NULL; - zval *expr_param = NULL, *values_param = NULL, *operator_param = NULL, *_0; - zval *expr = NULL, *operator = NULL; + zval values; + zval *expr_param = NULL, *values_param = NULL, *operator_param = NULL, _0; + zval expr, operator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&values); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &expr_param, &values_param, &operator_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } - values = values_param; + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); if (!operator_param) { - ZEPHIR_INIT_VAR(operator); - ZVAL_STRING(operator, "and", 1); + ZEPHIR_INIT_VAR(&operator); + ZVAL_STRING(&operator, "and"); } else { if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Having", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionin", NULL, 0, _0, operator, expr, values); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Having"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionin", NULL, 0, &_0, &operator, &expr, &values); zephir_check_call_status(); RETURN_MM(); @@ -1506,45 +1714,50 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, inHaving) { PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, notInHaving) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *values = NULL; - zval *expr_param = NULL, *values_param = NULL, *operator_param = NULL, *_0; - zval *expr = NULL, *operator = NULL; + zval values; + zval *expr_param = NULL, *values_param = NULL, *operator_param = NULL, _0; + zval expr, operator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&values); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &expr_param, &values_param, &operator_param); if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } - values = values_param; + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); if (!operator_param) { - ZEPHIR_INIT_VAR(operator); - ZVAL_STRING(operator, "and", 1); + ZEPHIR_INIT_VAR(&operator); + ZVAL_STRING(&operator, "and"); } else { if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Having", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionnotin", NULL, 0, _0, operator, expr, values); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Having"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_conditionnotin", NULL, 0, &_0, &operator, &expr, &values); zephir_check_call_status(); RETURN_MM(); @@ -1557,7 +1770,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, notInHaving) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getHaving) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_having"); @@ -1572,8 +1786,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getHaving) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, forUpdate) { - zval *forUpdate_param = NULL; + zval *forUpdate_param = NULL, __$true, __$false; zend_bool forUpdate; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &forUpdate_param); @@ -1581,9 +1799,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, forUpdate) { if (forUpdate) { - zephir_update_property_this(getThis(), SL("_forUpdate"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_forUpdate"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_forUpdate"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_forUpdate"), &__$false); } RETURN_THISW(); @@ -1600,35 +1818,42 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, forUpdate) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, limit) { - zval *limit_param = NULL, *offset = NULL, _0, *_1 = NULL, *_2, _3$$4, *_4$$4 = NULL; + zval *limit_param = NULL, *offset = NULL, offset_sub, __$null, _0, _1, _2$$4, _3$$4; zend_long limit, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&offset_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &limit_param, &offset); limit = zephir_get_intval(limit_param); if (!offset) { - offset = ZEPHIR_GLOBAL(global_null); + offset = &offset_sub; + offset = &__$null; } - ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, limit); - ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 213, &_0); + ZEPHIR_CALL_FUNCTION(&_1, "abs", NULL, 189, &_0); zephir_check_call_status(); - limit = zephir_get_numberval(_1); + limit = zephir_get_numberval(&_1); if (UNEXPECTED(limit == 0)) { RETURN_THIS(); } - ZEPHIR_INIT_ZVAL_NREF(_2); - ZVAL_LONG(_2, limit); - zephir_update_property_this(getThis(), SL("_limit"), _2 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_0); + ZVAL_LONG(&_0, limit); + zephir_update_property_zval(this_ptr, SL("_limit"), &_0); if (zephir_is_numeric(offset)) { - ZEPHIR_SINIT_VAR(_3$$4); - ZVAL_LONG(&_3$$4, zephir_get_intval(offset)); - ZEPHIR_CALL_FUNCTION(&_4$$4, "abs", NULL, 213, &_3$$4); + ZVAL_LONG(&_2$$4, zephir_get_intval(offset)); + ZEPHIR_CALL_FUNCTION(&_3$$4, "abs", NULL, 189, &_2$$4); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_offset"), _4$$4 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_offset"), &_3$$4); } RETURN_THIS(); @@ -1641,7 +1866,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, limit) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getLimit) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_limit"); @@ -1656,8 +1882,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getLimit) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, offset) { - zval *offset_param = NULL, *_0; + zval *offset_param = NULL, _0; zend_long offset; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &offset_param); @@ -1665,8 +1894,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, offset) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, offset); - zephir_update_property_this(getThis(), SL("_offset"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, offset); + zephir_update_property_zval(this_ptr, SL("_offset"), &_0); RETURN_THISW(); } @@ -1678,7 +1907,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, offset) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getOffset) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_offset"); @@ -1700,13 +1930,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getOffset) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, groupBy) { - zval *group; + zval *group, group_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&group_sub); zephir_fetch_params(0, 1, 0, &group); - zephir_update_property_this(getThis(), SL("_group"), group TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_group"), group); RETURN_THISW(); } @@ -1718,7 +1951,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, groupBy) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getGroupBy) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_group"); @@ -1731,100 +1965,195 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getGroupBy) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) { - HashTable *_11$$25, *_17$$31, *_25$$36, *_34$$41, *_49$$49, *_56$$56; - HashPosition _10$$25, _16$$31, _24$$36, _33$$41, _48$$49, _55$$56; + zend_string *_13$$25, *_19$$31, *_27$$36; + zend_ulong _12$$25, _18$$31, _26$$36; zend_class_entry *_3$$8; - zend_bool noPrimary = 0, _9; - zval *dependencyInjector = NULL, *models = NULL, *conditions = NULL, *model = NULL, *metaData = NULL, *modelInstance = NULL, *primaryKeys = NULL, *firstPrimaryKey = NULL, *columnMap = NULL, *modelAlias = NULL, *attributeField = NULL, *phql = NULL, *column = NULL, *columns = NULL, *selectedColumns = NULL, *selectedColumn = NULL, *selectedModel = NULL, *selectedModels = NULL, *columnAlias = NULL, *modelColumnAlias = NULL, *joins = NULL, *join = NULL, *joinModel = NULL, *joinConditions = NULL, *joinAlias = NULL, *joinType = NULL, *group = NULL, *groupItems = NULL, *groupItem = NULL, *having = NULL, *order = NULL, *orderItems = NULL, *orderItem = NULL, *limit = NULL, *number = NULL, *offset = NULL, *forUpdate = NULL, *distinct = NULL, *_1$$8 = NULL, *_2$$8 = NULL, *_4$$17, *_5$$17, *_6$$13 = NULL, *_7$$13 = NULL, *_8$$13, **_12$$25, *_15$$25, *_13$$28 = NULL, *_14$$28 = NULL, **_18$$31, *_21$$31, *_19$$33 = NULL, *_20$$34 = NULL, *_22$$35 = NULL, *_23$$35, **_26$$36, *_29$$36, *_30$$36, *_27$$38 = NULL, *_28$$38 = NULL, *_31$$40 = NULL, *_32$$40, **_35$$41, *_36$$43 = NULL, *_37$$43 = NULL, *_38$$44 = NULL, *_39$$44 = NULL, *_40$$45 = NULL, *_41$$45 = NULL, *_42$$46 = NULL, *_43$$48, *_44$$51, _45$$51, _46$$51, *_47$$50, **_50$$49, *_52$$49, *_53$$49, *_51$$52 = NULL, *_54$$54, **_57$$56, *_63$$56, *_64$$56, *itemExplode$$59 = NULL, *_58$$59 = NULL, *_59$$59, *_60$$59, *_61$$59 = NULL, *_62$$57 = NULL, *_65$$60, _66$$69, *_67$$69 = NULL, *_68$$69, *_69$$69, *_70$$69, _71$$70, *_72$$70 = NULL, *_73$$70, *_74$$70, *_75$$70; + zend_bool noPrimary = 0, _10; + zval dependencyInjector, models, conditions, model, metaData, modelInstance, primaryKeys, firstPrimaryKey, columnMap, modelAlias, attributeField, phql, column, columns, selectedColumns, selectedColumn, selectedModel, selectedModels, columnAlias, modelColumnAlias, joins, join, joinModel, joinConditions, joinAlias, joinType, group, groupItems, groupItem, having, order, orderItems, orderItem, limit, number, offset, forUpdate, distinct, _1$$8, _2$$8, _4$$8, _5$$17, _6$$17, _7$$13, _8$$13, _9$$13, *_11$$25, _16$$25, _14$$28, _15$$28, *_17$$31, _22$$31, _20$$33, _21$$34, _23$$35, _24$$35, *_25$$36, _30$$36, _31$$36, _28$$38, _29$$38, _32$$40, _33$$40, *_34$$41, _35$$43, _36$$43, _37$$44, _38$$44, _39$$45, _40$$45, _41$$46, _42$$48, _43$$51, _44$$51, _45$$51, _46$$50, *_47$$49, _49$$49, _50$$49, _48$$52, _51$$54, *_52$$56, _58$$56, _59$$56, itemExplode$$59, _53$$59, _54$$59, _55$$59, _56$$59, _57$$57, _60$$60, _61$$69, _62$$69, _63$$69, _64$$69, _65$$69, _66$$70, _67$$70, _68$$70, _69$$70, _70$$70; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&models); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&modelInstance); + ZVAL_UNDEF(&primaryKeys); + ZVAL_UNDEF(&firstPrimaryKey); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&modelAlias); + ZVAL_UNDEF(&attributeField); + ZVAL_UNDEF(&phql); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&selectedColumns); + ZVAL_UNDEF(&selectedColumn); + ZVAL_UNDEF(&selectedModel); + ZVAL_UNDEF(&selectedModels); + ZVAL_UNDEF(&columnAlias); + ZVAL_UNDEF(&modelColumnAlias); + ZVAL_UNDEF(&joins); + ZVAL_UNDEF(&join); + ZVAL_UNDEF(&joinModel); + ZVAL_UNDEF(&joinConditions); + ZVAL_UNDEF(&joinAlias); + ZVAL_UNDEF(&joinType); + ZVAL_UNDEF(&group); + ZVAL_UNDEF(&groupItems); + ZVAL_UNDEF(&groupItem); + ZVAL_UNDEF(&having); + ZVAL_UNDEF(&order); + ZVAL_UNDEF(&orderItems); + ZVAL_UNDEF(&orderItem); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&number); + ZVAL_UNDEF(&offset); + ZVAL_UNDEF(&forUpdate); + ZVAL_UNDEF(&distinct); + ZVAL_UNDEF(&_1$$8); + ZVAL_UNDEF(&_2$$8); + ZVAL_UNDEF(&_4$$8); + ZVAL_UNDEF(&_5$$17); + ZVAL_UNDEF(&_6$$17); + ZVAL_UNDEF(&_7$$13); + ZVAL_UNDEF(&_8$$13); + ZVAL_UNDEF(&_9$$13); + ZVAL_UNDEF(&_16$$25); + ZVAL_UNDEF(&_14$$28); + ZVAL_UNDEF(&_15$$28); + ZVAL_UNDEF(&_22$$31); + ZVAL_UNDEF(&_20$$33); + ZVAL_UNDEF(&_21$$34); + ZVAL_UNDEF(&_23$$35); + ZVAL_UNDEF(&_24$$35); + ZVAL_UNDEF(&_30$$36); + ZVAL_UNDEF(&_31$$36); + ZVAL_UNDEF(&_28$$38); + ZVAL_UNDEF(&_29$$38); + ZVAL_UNDEF(&_32$$40); + ZVAL_UNDEF(&_33$$40); + ZVAL_UNDEF(&_35$$43); + ZVAL_UNDEF(&_36$$43); + ZVAL_UNDEF(&_37$$44); + ZVAL_UNDEF(&_38$$44); + ZVAL_UNDEF(&_39$$45); + ZVAL_UNDEF(&_40$$45); + ZVAL_UNDEF(&_41$$46); + ZVAL_UNDEF(&_42$$48); + ZVAL_UNDEF(&_43$$51); + ZVAL_UNDEF(&_44$$51); + ZVAL_UNDEF(&_45$$51); + ZVAL_UNDEF(&_46$$50); + ZVAL_UNDEF(&_49$$49); + ZVAL_UNDEF(&_50$$49); + ZVAL_UNDEF(&_48$$52); + ZVAL_UNDEF(&_51$$54); + ZVAL_UNDEF(&_58$$56); + ZVAL_UNDEF(&_59$$56); + ZVAL_UNDEF(&itemExplode$$59); + ZVAL_UNDEF(&_53$$59); + ZVAL_UNDEF(&_54$$59); + ZVAL_UNDEF(&_55$$59); + ZVAL_UNDEF(&_56$$59); + ZVAL_UNDEF(&_57$$57); + ZVAL_UNDEF(&_60$$60); + ZVAL_UNDEF(&_61$$69); + ZVAL_UNDEF(&_62$$69); + ZVAL_UNDEF(&_63$$69); + ZVAL_UNDEF(&_64$$69); + ZVAL_UNDEF(&_65$$69); + ZVAL_UNDEF(&_66$$70); + ZVAL_UNDEF(&_67$$70); + ZVAL_UNDEF(&_68$$70); + ZVAL_UNDEF(&_69$$70); + ZVAL_UNDEF(&_70$$70); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), &dependencyInjector); } - ZEPHIR_OBS_VAR(models); - zephir_read_property_this(&models, this_ptr, SL("_models"), PH_NOISY_CC); - if (Z_TYPE_P(models) == IS_ARRAY) { - if (!(zephir_fast_count_int(models TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&models); + zephir_read_property(&models, this_ptr, SL("_models"), PH_NOISY_CC); + if (Z_TYPE_P(&models) == IS_ARRAY) { + if (!(zephir_fast_count_int(&models TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "At least one model is required to build the query", "phalcon/mvc/model/query/builder.zep", 1060); return; } } else { - if (!(zephir_is_true(models))) { + if (!(zephir_is_true(&models))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "At least one model is required to build the query", "phalcon/mvc/model/query/builder.zep", 1064); return; } } - ZEPHIR_OBS_VAR(conditions); - zephir_read_property_this(&conditions, this_ptr, SL("_conditions"), PH_NOISY_CC); - if (zephir_is_numeric(conditions)) { - if (Z_TYPE_P(models) == IS_ARRAY) { - if (zephir_fast_count_int(models TSRMLS_CC) > 1) { + ZEPHIR_OBS_VAR(&conditions); + zephir_read_property(&conditions, this_ptr, SL("_conditions"), PH_NOISY_CC); + if (zephir_is_numeric(&conditions)) { + if (Z_TYPE_P(&models) == IS_ARRAY) { + if (zephir_fast_count_int(&models TSRMLS_CC) > 1) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Cannot build the query. Invalid condition", "phalcon/mvc/model/query/builder.zep", 1077); return; } - ZEPHIR_OBS_VAR(model); - zephir_array_fetch_long(&model, models, 0, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1079 TSRMLS_CC); + ZEPHIR_OBS_VAR(&model); + zephir_array_fetch_long(&model, &models, 0, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1079 TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(model, models); + ZEPHIR_CPY_WRT(&model, &models); } - ZEPHIR_INIT_VAR(_1$$8); - ZVAL_STRING(_1$$8, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&metaData, dependencyInjector, "getshared", NULL, 0, _1$$8); - zephir_check_temp_parameter(_1$$8); + ZEPHIR_INIT_VAR(&_1$$8); + ZVAL_STRING(&_1$$8, "modelsMetadata"); + ZEPHIR_CALL_METHOD(&metaData, &dependencyInjector, "getshared", NULL, 0, &_1$$8); zephir_check_call_status(); - ZEPHIR_INIT_VAR(modelInstance); - zephir_fetch_safe_class(_2$$8, model); - _3$$8 = zend_fetch_class(Z_STRVAL_P(_2$$8), Z_STRLEN_P(_2$$8), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(modelInstance, _3$$8); - if (zephir_has_constructor(modelInstance TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_1$$8); - ZVAL_NULL(_1$$8); - ZEPHIR_CALL_METHOD(NULL, modelInstance, "__construct", NULL, 0, _1$$8, dependencyInjector); + ZEPHIR_INIT_VAR(&modelInstance); + zephir_fetch_safe_class(&_2$$8, &model); + _3$$8 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_2$$8), Z_STRLEN_P(&_2$$8), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&modelInstance, _3$$8); + if (zephir_has_constructor(&modelInstance TSRMLS_CC)) { + ZVAL_NULL(&_4$$8); + ZEPHIR_CALL_METHOD(NULL, &modelInstance, "__construct", NULL, 0, &_4$$8, &dependencyInjector); zephir_check_call_status(); } noPrimary = 1; - ZEPHIR_CALL_METHOD(&primaryKeys, metaData, "getprimarykeyattributes", NULL, 0, modelInstance); + ZEPHIR_CALL_METHOD(&primaryKeys, &metaData, "getprimarykeyattributes", NULL, 0, &modelInstance); zephir_check_call_status(); - if (zephir_fast_count_int(primaryKeys TSRMLS_CC)) { - ZEPHIR_OBS_VAR(firstPrimaryKey); - if (zephir_array_isset_long_fetch(&firstPrimaryKey, primaryKeys, 0, 0 TSRMLS_CC)) { + if (zephir_fast_count_int(&primaryKeys TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&firstPrimaryKey); + if (zephir_array_isset_long_fetch(&firstPrimaryKey, &primaryKeys, 0, 0 TSRMLS_CC)) { if (ZEPHIR_GLOBAL(orm).column_renaming) { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, modelInstance); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getcolumnmap", NULL, 0, &modelInstance); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_VAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, firstPrimaryKey, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_4$$17); - object_init_ex(_4$$17, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_5$$17); - ZEPHIR_CONCAT_SVS(_5$$17, "Column '", firstPrimaryKey, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _4$$17, "__construct", NULL, 9, _5$$17); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &firstPrimaryKey, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_5$$17); + object_init_ex(&_5$$17, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_6$$17); + ZEPHIR_CONCAT_SVS(&_6$$17, "Column '", &firstPrimaryKey, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_5$$17, "__construct", NULL, 4, &_6$$17); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$17, "phalcon/mvc/model/query/builder.zep", 1107 TSRMLS_CC); + zephir_throw_exception_debug(&_5$$17, "phalcon/mvc/model/query/builder.zep", 1107 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeField, firstPrimaryKey); + ZEPHIR_CPY_WRT(&attributeField, &firstPrimaryKey); } - ZEPHIR_CALL_METHOD(&_6$$13, this_ptr, "autoescape", NULL, 386, model); + ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "autoescape", NULL, 344, &model); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_7$$13, this_ptr, "autoescape", NULL, 386, attributeField); + ZEPHIR_CALL_METHOD(&_8$$13, this_ptr, "autoescape", NULL, 344, &attributeField); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_8$$13); - ZEPHIR_CONCAT_VSVSV(_8$$13, _6$$13, ".", _7$$13, " = ", conditions); - ZEPHIR_CPY_WRT(conditions, _8$$13); + ZEPHIR_INIT_VAR(&_9$$13); + ZEPHIR_CONCAT_VSVSV(&_9$$13, &_7$$13, ".", &_8$$13, " = ", &conditions); + ZEPHIR_CPY_WRT(&conditions, &_9$$13); noPrimary = 0; } } @@ -1833,325 +2162,341 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) { return; } } - ZEPHIR_OBS_VAR(distinct); - zephir_read_property_this(&distinct, this_ptr, SL("_distinct"), PH_NOISY_CC); - _9 = Z_TYPE_P(distinct) != IS_NULL; - if (_9) { - _9 = Z_TYPE_P(distinct) == IS_BOOL; + ZEPHIR_OBS_VAR(&distinct); + zephir_read_property(&distinct, this_ptr, SL("_distinct"), PH_NOISY_CC); + _10 = Z_TYPE_P(&distinct) != IS_NULL; + if (_10) { + _10 = ((Z_TYPE_P(&distinct) == IS_TRUE || Z_TYPE_P(&distinct) == IS_FALSE) == 1); } - if (_9) { - ZEPHIR_INIT_VAR(phql); - if (zephir_is_true(distinct)) { - ZVAL_STRING(phql, "SELECT DISTINCT ", 1); + if (_10) { + ZEPHIR_INIT_VAR(&phql); + if (zephir_is_true(&distinct)) { + ZVAL_STRING(&phql, "SELECT DISTINCT "); } else { - ZVAL_STRING(phql, "SELECT ALL ", 1); + ZVAL_STRING(&phql, "SELECT ALL "); } } else { - ZEPHIR_INIT_NVAR(phql); - ZVAL_STRING(phql, "SELECT ", 1); - } - ZEPHIR_OBS_VAR(columns); - zephir_read_property_this(&columns, this_ptr, SL("_columns"), PH_NOISY_CC); - if (Z_TYPE_P(columns) != IS_NULL) { - if (Z_TYPE_P(columns) == IS_ARRAY) { - ZEPHIR_INIT_VAR(selectedColumns); - array_init(selectedColumns); - zephir_is_iterable(columns, &_11$$25, &_10$$25, 0, 0, "phalcon/mvc/model/query/builder.zep", 1154); - for ( - ; zend_hash_get_current_data_ex(_11$$25, (void**) &_12$$25, &_10$$25) == SUCCESS - ; zend_hash_move_forward_ex(_11$$25, &_10$$25) - ) { - ZEPHIR_GET_HMKEY(columnAlias, _11$$25, _10$$25); - ZEPHIR_GET_HVALUE(column, _12$$25); - if (Z_TYPE_P(columnAlias) == IS_LONG) { - zephir_array_append(&selectedColumns, column, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1148); + ZEPHIR_INIT_NVAR(&phql); + ZVAL_STRING(&phql, "SELECT "); + } + ZEPHIR_OBS_VAR(&columns); + zephir_read_property(&columns, this_ptr, SL("_columns"), PH_NOISY_CC); + if (Z_TYPE_P(&columns) != IS_NULL) { + if (Z_TYPE_P(&columns) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&selectedColumns); + array_init(&selectedColumns); + zephir_is_iterable(&columns, 0, "phalcon/mvc/model/query/builder.zep", 1154); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&columns), _12$$25, _13$$25, _11$$25) + { + ZEPHIR_INIT_NVAR(&columnAlias); + if (_13$$25 != NULL) { + ZVAL_STR_COPY(&columnAlias, _13$$25); } else { - ZEPHIR_CALL_METHOD(&_13$$28, this_ptr, "autoescape", NULL, 386, columnAlias); + ZVAL_LONG(&columnAlias, _12$$25); + } + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _11$$25); + if (Z_TYPE_P(&columnAlias) == IS_LONG) { + zephir_array_append(&selectedColumns, &column, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1148); + } else { + ZEPHIR_CALL_METHOD(&_14$$28, this_ptr, "autoescape", NULL, 344, &columnAlias); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_14$$28); - ZEPHIR_CONCAT_VSV(_14$$28, column, " AS ", _13$$28); - zephir_array_append(&selectedColumns, _14$$28, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1150); + ZEPHIR_INIT_LNVAR(_15$$28); + ZEPHIR_CONCAT_VSV(&_15$$28, &column, " AS ", &_14$$28); + zephir_array_append(&selectedColumns, &_15$$28, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1150); } - } - ZEPHIR_INIT_VAR(_15$$25); - zephir_fast_join_str(_15$$25, SL(", "), selectedColumns TSRMLS_CC); - zephir_concat_self(&phql, _15$$25 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); + ZEPHIR_INIT_NVAR(&columnAlias); + ZEPHIR_INIT_VAR(&_16$$25); + zephir_fast_join_str(&_16$$25, SL(", "), &selectedColumns TSRMLS_CC); + zephir_concat_self(&phql, &_16$$25 TSRMLS_CC); } else { - zephir_concat_self(&phql, columns TSRMLS_CC); + zephir_concat_self(&phql, &columns TSRMLS_CC); } } else { - if (Z_TYPE_P(models) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(selectedColumns); - array_init(selectedColumns); - zephir_is_iterable(models, &_17$$31, &_16$$31, 0, 0, "phalcon/mvc/model/query/builder.zep", 1177); - for ( - ; zend_hash_get_current_data_ex(_17$$31, (void**) &_18$$31, &_16$$31) == SUCCESS - ; zend_hash_move_forward_ex(_17$$31, &_16$$31) - ) { - ZEPHIR_GET_HMKEY(modelColumnAlias, _17$$31, _16$$31); - ZEPHIR_GET_HVALUE(model, _18$$31); - ZEPHIR_INIT_NVAR(selectedColumn); - if (Z_TYPE_P(modelColumnAlias) == IS_LONG) { - ZEPHIR_CALL_METHOD(&_19$$33, this_ptr, "autoescape", NULL, 386, model); + if (Z_TYPE_P(&models) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&selectedColumns); + array_init(&selectedColumns); + zephir_is_iterable(&models, 0, "phalcon/mvc/model/query/builder.zep", 1177); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&models), _18$$31, _19$$31, _17$$31) + { + ZEPHIR_INIT_NVAR(&modelColumnAlias); + if (_19$$31 != NULL) { + ZVAL_STR_COPY(&modelColumnAlias, _19$$31); + } else { + ZVAL_LONG(&modelColumnAlias, _18$$31); + } + ZEPHIR_INIT_NVAR(&model); + ZVAL_COPY(&model, _17$$31); + ZEPHIR_INIT_NVAR(&selectedColumn); + if (Z_TYPE_P(&modelColumnAlias) == IS_LONG) { + ZEPHIR_CALL_METHOD(&_20$$33, this_ptr, "autoescape", NULL, 344, &model); zephir_check_call_status(); - ZEPHIR_CONCAT_VS(selectedColumn, _19$$33, ".*"); + ZEPHIR_CONCAT_VS(&selectedColumn, &_20$$33, ".*"); } else { - ZEPHIR_CALL_METHOD(&_20$$34, this_ptr, "autoescape", NULL, 386, modelColumnAlias); + ZEPHIR_CALL_METHOD(&_21$$34, this_ptr, "autoescape", NULL, 344, &modelColumnAlias); zephir_check_call_status(); - ZEPHIR_CONCAT_VS(selectedColumn, _20$$34, ".*"); + ZEPHIR_CONCAT_VS(&selectedColumn, &_21$$34, ".*"); } - zephir_array_append(&selectedColumns, selectedColumn, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1174); - } - ZEPHIR_INIT_VAR(_21$$31); - zephir_fast_join_str(_21$$31, SL(", "), selectedColumns TSRMLS_CC); - zephir_concat_self(&phql, _21$$31 TSRMLS_CC); + zephir_array_append(&selectedColumns, &selectedColumn, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1174); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&model); + ZEPHIR_INIT_NVAR(&modelColumnAlias); + ZEPHIR_INIT_VAR(&_22$$31); + zephir_fast_join_str(&_22$$31, SL(", "), &selectedColumns TSRMLS_CC); + zephir_concat_self(&phql, &_22$$31 TSRMLS_CC); } else { - ZEPHIR_CALL_METHOD(&_22$$35, this_ptr, "autoescape", NULL, 386, models); + ZEPHIR_CALL_METHOD(&_23$$35, this_ptr, "autoescape", NULL, 344, &models); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_23$$35); - ZEPHIR_CONCAT_VS(_23$$35, _22$$35, ".*"); - zephir_concat_self(&phql, _23$$35 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_24$$35); + ZEPHIR_CONCAT_VS(&_24$$35, &_23$$35, ".*"); + zephir_concat_self(&phql, &_24$$35 TSRMLS_CC); } } - if (Z_TYPE_P(models) == IS_ARRAY) { - ZEPHIR_INIT_VAR(selectedModels); - array_init(selectedModels); - zephir_is_iterable(models, &_25$$36, &_24$$36, 0, 0, "phalcon/mvc/model/query/builder.zep", 1200); - for ( - ; zend_hash_get_current_data_ex(_25$$36, (void**) &_26$$36, &_24$$36) == SUCCESS - ; zend_hash_move_forward_ex(_25$$36, &_24$$36) - ) { - ZEPHIR_GET_HMKEY(modelAlias, _25$$36, _24$$36); - ZEPHIR_GET_HVALUE(model, _26$$36); - if (Z_TYPE_P(modelAlias) == IS_STRING) { - ZEPHIR_CALL_METHOD(&_27$$38, this_ptr, "autoescape", NULL, 386, model); + if (Z_TYPE_P(&models) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&selectedModels); + array_init(&selectedModels); + zephir_is_iterable(&models, 0, "phalcon/mvc/model/query/builder.zep", 1200); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&models), _26$$36, _27$$36, _25$$36) + { + ZEPHIR_INIT_NVAR(&modelAlias); + if (_27$$36 != NULL) { + ZVAL_STR_COPY(&modelAlias, _27$$36); + } else { + ZVAL_LONG(&modelAlias, _26$$36); + } + ZEPHIR_INIT_NVAR(&model); + ZVAL_COPY(&model, _25$$36); + if (Z_TYPE_P(&modelAlias) == IS_STRING) { + ZEPHIR_CALL_METHOD(&_28$$38, this_ptr, "autoescape", NULL, 344, &model); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_28$$38, this_ptr, "autoescape", NULL, 386, modelAlias); + ZEPHIR_CALL_METHOD(&_29$$38, this_ptr, "autoescape", NULL, 344, &modelAlias); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(selectedModel); - ZEPHIR_CONCAT_VSV(selectedModel, _27$$38, " AS ", _28$$38); + ZEPHIR_INIT_NVAR(&selectedModel); + ZEPHIR_CONCAT_VSV(&selectedModel, &_28$$38, " AS ", &_29$$38); } else { - ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 386, model); + ZEPHIR_CALL_METHOD(&selectedModel, this_ptr, "autoescape", NULL, 344, &model); zephir_check_call_status(); } - zephir_array_append(&selectedModels, selectedModel, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1197); - } - ZEPHIR_INIT_VAR(_29$$36); - zephir_fast_join_str(_29$$36, SL(", "), selectedModels TSRMLS_CC); - ZEPHIR_INIT_VAR(_30$$36); - ZEPHIR_CONCAT_SV(_30$$36, " FROM ", _29$$36); - zephir_concat_self(&phql, _30$$36 TSRMLS_CC); + zephir_array_append(&selectedModels, &selectedModel, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1197); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&model); + ZEPHIR_INIT_NVAR(&modelAlias); + ZEPHIR_INIT_VAR(&_30$$36); + zephir_fast_join_str(&_30$$36, SL(", "), &selectedModels TSRMLS_CC); + ZEPHIR_INIT_VAR(&_31$$36); + ZEPHIR_CONCAT_SV(&_31$$36, " FROM ", &_30$$36); + zephir_concat_self(&phql, &_31$$36 TSRMLS_CC); } else { - ZEPHIR_CALL_METHOD(&_31$$40, this_ptr, "autoescape", NULL, 386, models); + ZEPHIR_CALL_METHOD(&_32$$40, this_ptr, "autoescape", NULL, 344, &models); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_32$$40); - ZEPHIR_CONCAT_SV(_32$$40, " FROM ", _31$$40); - zephir_concat_self(&phql, _32$$40 TSRMLS_CC); - } - ZEPHIR_OBS_VAR(joins); - zephir_read_property_this(&joins, this_ptr, SL("_joins"), PH_NOISY_CC); - if (Z_TYPE_P(joins) == IS_ARRAY) { - zephir_is_iterable(joins, &_34$$41, &_33$$41, 0, 0, "phalcon/mvc/model/query/builder.zep", 1257); - for ( - ; zend_hash_get_current_data_ex(_34$$41, (void**) &_35$$41, &_33$$41) == SUCCESS - ; zend_hash_move_forward_ex(_34$$41, &_33$$41) - ) { - ZEPHIR_GET_HVALUE(join, _35$$41); - ZEPHIR_OBS_NVAR(joinModel); - zephir_array_fetch_long(&joinModel, join, 0, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1217 TSRMLS_CC); - ZEPHIR_OBS_NVAR(joinConditions); - zephir_array_fetch_long(&joinConditions, join, 1, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1222 TSRMLS_CC); - ZEPHIR_OBS_NVAR(joinAlias); - zephir_array_fetch_long(&joinAlias, join, 2, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1227 TSRMLS_CC); - ZEPHIR_OBS_NVAR(joinType); - zephir_array_fetch_long(&joinType, join, 3, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1232 TSRMLS_CC); - if (zephir_is_true(joinType)) { - ZEPHIR_CALL_METHOD(&_36$$43, this_ptr, "autoescape", NULL, 386, joinModel); + ZEPHIR_INIT_VAR(&_33$$40); + ZEPHIR_CONCAT_SV(&_33$$40, " FROM ", &_32$$40); + zephir_concat_self(&phql, &_33$$40 TSRMLS_CC); + } + ZEPHIR_OBS_VAR(&joins); + zephir_read_property(&joins, this_ptr, SL("_joins"), PH_NOISY_CC); + if (Z_TYPE_P(&joins) == IS_ARRAY) { + zephir_is_iterable(&joins, 0, "phalcon/mvc/model/query/builder.zep", 1257); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&joins), _34$$41) + { + ZEPHIR_INIT_NVAR(&join); + ZVAL_COPY(&join, _34$$41); + ZEPHIR_OBS_NVAR(&joinModel); + zephir_array_fetch_long(&joinModel, &join, 0, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1217 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&joinConditions); + zephir_array_fetch_long(&joinConditions, &join, 1, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1222 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&joinAlias); + zephir_array_fetch_long(&joinAlias, &join, 2, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1227 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&joinType); + zephir_array_fetch_long(&joinType, &join, 3, PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1232 TSRMLS_CC); + if (zephir_is_true(&joinType)) { + ZEPHIR_CALL_METHOD(&_35$$43, this_ptr, "autoescape", NULL, 344, &joinModel); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_37$$43); - ZEPHIR_CONCAT_SVSV(_37$$43, " ", joinType, " JOIN ", _36$$43); - zephir_concat_self(&phql, _37$$43 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_36$$43); + ZEPHIR_CONCAT_SVSV(&_36$$43, " ", &joinType, " JOIN ", &_35$$43); + zephir_concat_self(&phql, &_36$$43 TSRMLS_CC); } else { - ZEPHIR_CALL_METHOD(&_38$$44, this_ptr, "autoescape", NULL, 386, joinModel); + ZEPHIR_CALL_METHOD(&_37$$44, this_ptr, "autoescape", NULL, 344, &joinModel); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_39$$44); - ZEPHIR_CONCAT_SV(_39$$44, " JOIN ", _38$$44); - zephir_concat_self(&phql, _39$$44 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_38$$44); + ZEPHIR_CONCAT_SV(&_38$$44, " JOIN ", &_37$$44); + zephir_concat_self(&phql, &_38$$44 TSRMLS_CC); } - if (zephir_is_true(joinAlias)) { - ZEPHIR_CALL_METHOD(&_40$$45, this_ptr, "autoescape", NULL, 386, joinAlias); + if (zephir_is_true(&joinAlias)) { + ZEPHIR_CALL_METHOD(&_39$$45, this_ptr, "autoescape", NULL, 344, &joinAlias); zephir_check_call_status(); - ZEPHIR_INIT_LNVAR(_41$$45); - ZEPHIR_CONCAT_SV(_41$$45, " AS ", _40$$45); - zephir_concat_self(&phql, _41$$45 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_40$$45); + ZEPHIR_CONCAT_SV(&_40$$45, " AS ", &_39$$45); + zephir_concat_self(&phql, &_40$$45 TSRMLS_CC); } - if (zephir_is_true(joinConditions)) { - ZEPHIR_INIT_LNVAR(_42$$46); - ZEPHIR_CONCAT_SV(_42$$46, " ON ", joinConditions); - zephir_concat_self(&phql, _42$$46 TSRMLS_CC); + if (zephir_is_true(&joinConditions)) { + ZEPHIR_INIT_LNVAR(_41$$46); + ZEPHIR_CONCAT_SV(&_41$$46, " ON ", &joinConditions); + zephir_concat_self(&phql, &_41$$46 TSRMLS_CC); } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&join); + } + if (Z_TYPE_P(&conditions) == IS_STRING) { + if (!(ZEPHIR_IS_EMPTY(&conditions))) { + ZEPHIR_INIT_VAR(&_42$$48); + ZEPHIR_CONCAT_SV(&_42$$48, " WHERE ", &conditions); + zephir_concat_self(&phql, &_42$$48 TSRMLS_CC); } } - if (Z_TYPE_P(conditions) == IS_STRING) { - if (!(ZEPHIR_IS_EMPTY(conditions))) { - ZEPHIR_INIT_VAR(_43$$48); - ZEPHIR_CONCAT_SV(_43$$48, " WHERE ", conditions); - zephir_concat_self(&phql, _43$$48 TSRMLS_CC); - } - } - ZEPHIR_OBS_VAR(group); - zephir_read_property_this(&group, this_ptr, SL("_group"), PH_NOISY_CC); - if (Z_TYPE_P(group) != IS_NULL) { - if (Z_TYPE_P(group) == IS_STRING) { - if (zephir_memnstr_str(group, SL(","), "phalcon/mvc/model/query/builder.zep", 1272)) { - ZEPHIR_INIT_VAR(_44$$51); - ZEPHIR_SINIT_VAR(_45$$51); - ZVAL_STRING(&_45$$51, " ", 0); - ZEPHIR_SINIT_VAR(_46$$51); - ZVAL_STRING(&_46$$51, "", 0); - zephir_fast_str_replace(&_44$$51, &_45$$51, &_46$$51, group TSRMLS_CC); - ZEPHIR_CPY_WRT(group, _44$$51); + ZEPHIR_OBS_VAR(&group); + zephir_read_property(&group, this_ptr, SL("_group"), PH_NOISY_CC); + if (Z_TYPE_P(&group) != IS_NULL) { + if (Z_TYPE_P(&group) == IS_STRING) { + if (zephir_memnstr_str(&group, SL(","), "phalcon/mvc/model/query/builder.zep", 1272)) { + ZEPHIR_INIT_VAR(&_43$$51); + ZEPHIR_INIT_VAR(&_44$$51); + ZVAL_STRING(&_44$$51, " "); + ZEPHIR_INIT_VAR(&_45$$51); + ZVAL_STRING(&_45$$51, ""); + zephir_fast_str_replace(&_43$$51, &_44$$51, &_45$$51, &group TSRMLS_CC); + ZEPHIR_CPY_WRT(&group, &_43$$51); } - ZEPHIR_INIT_VAR(_47$$50); - zephir_fast_explode_str(_47$$50, SL(","), group, LONG_MAX TSRMLS_CC); - ZEPHIR_CPY_WRT(group, _47$$50); + ZEPHIR_INIT_VAR(&_46$$50); + zephir_fast_explode_str(&_46$$50, SL(","), &group, LONG_MAX TSRMLS_CC); + ZEPHIR_CPY_WRT(&group, &_46$$50); } - ZEPHIR_INIT_VAR(groupItems); - array_init(groupItems); - zephir_is_iterable(group, &_49$$49, &_48$$49, 0, 0, "phalcon/mvc/model/query/builder.zep", 1284); - for ( - ; zend_hash_get_current_data_ex(_49$$49, (void**) &_50$$49, &_48$$49) == SUCCESS - ; zend_hash_move_forward_ex(_49$$49, &_48$$49) - ) { - ZEPHIR_GET_HVALUE(groupItem, _50$$49); - ZEPHIR_CALL_METHOD(&_51$$52, this_ptr, "autoescape", NULL, 386, groupItem); + ZEPHIR_INIT_VAR(&groupItems); + array_init(&groupItems); + zephir_is_iterable(&group, 0, "phalcon/mvc/model/query/builder.zep", 1284); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&group), _47$$49) + { + ZEPHIR_INIT_NVAR(&groupItem); + ZVAL_COPY(&groupItem, _47$$49); + ZEPHIR_CALL_METHOD(&_48$$52, this_ptr, "autoescape", NULL, 344, &groupItem); zephir_check_call_status(); - zephir_array_append(&groupItems, _51$$52, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1281); - } - ZEPHIR_INIT_VAR(_52$$49); - zephir_fast_join_str(_52$$49, SL(", "), groupItems TSRMLS_CC); - ZEPHIR_INIT_VAR(_53$$49); - ZEPHIR_CONCAT_SV(_53$$49, " GROUP BY ", _52$$49); - zephir_concat_self(&phql, _53$$49 TSRMLS_CC); - } - ZEPHIR_OBS_VAR(having); - zephir_read_property_this(&having, this_ptr, SL("_having"), PH_NOISY_CC); - if (Z_TYPE_P(having) != IS_NULL) { - if (!(ZEPHIR_IS_EMPTY(having))) { - ZEPHIR_INIT_VAR(_54$$54); - ZEPHIR_CONCAT_SV(_54$$54, " HAVING ", having); - zephir_concat_self(&phql, _54$$54 TSRMLS_CC); + zephir_array_append(&groupItems, &_48$$52, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1281); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&groupItem); + ZEPHIR_INIT_VAR(&_49$$49); + zephir_fast_join_str(&_49$$49, SL(", "), &groupItems TSRMLS_CC); + ZEPHIR_INIT_VAR(&_50$$49); + ZEPHIR_CONCAT_SV(&_50$$49, " GROUP BY ", &_49$$49); + zephir_concat_self(&phql, &_50$$49 TSRMLS_CC); + } + ZEPHIR_OBS_VAR(&having); + zephir_read_property(&having, this_ptr, SL("_having"), PH_NOISY_CC); + if (Z_TYPE_P(&having) != IS_NULL) { + if (!(ZEPHIR_IS_EMPTY(&having))) { + ZEPHIR_INIT_VAR(&_51$$54); + ZEPHIR_CONCAT_SV(&_51$$54, " HAVING ", &having); + zephir_concat_self(&phql, &_51$$54 TSRMLS_CC); } } - ZEPHIR_OBS_VAR(order); - zephir_read_property_this(&order, this_ptr, SL("_order"), PH_NOISY_CC); - if (Z_TYPE_P(order) != IS_NULL) { - if (Z_TYPE_P(order) == IS_ARRAY) { - ZEPHIR_INIT_VAR(orderItems); - array_init(orderItems); - zephir_is_iterable(order, &_56$$56, &_55$$56, 0, 0, "phalcon/mvc/model/query/builder.zep", 1325); - for ( - ; zend_hash_get_current_data_ex(_56$$56, (void**) &_57$$56, &_55$$56) == SUCCESS - ; zend_hash_move_forward_ex(_56$$56, &_55$$56) - ) { - ZEPHIR_GET_HVALUE(orderItem, _57$$56); - if (Z_TYPE_P(orderItem) == IS_LONG) { - zephir_array_append(&orderItems, orderItem, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1309); + ZEPHIR_OBS_VAR(&order); + zephir_read_property(&order, this_ptr, SL("_order"), PH_NOISY_CC); + if (Z_TYPE_P(&order) != IS_NULL) { + if (Z_TYPE_P(&order) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&orderItems); + array_init(&orderItems); + zephir_is_iterable(&order, 0, "phalcon/mvc/model/query/builder.zep", 1325); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&order), _52$$56) + { + ZEPHIR_INIT_NVAR(&orderItem); + ZVAL_COPY(&orderItem, _52$$56); + if (Z_TYPE_P(&orderItem) == IS_LONG) { + zephir_array_append(&orderItems, &orderItem, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1309); continue; } - if (zephir_memnstr_str(orderItem, SL(" "), "phalcon/mvc/model/query/builder.zep", 1314) != 0) { - ZEPHIR_INIT_NVAR(itemExplode$$59); - zephir_fast_explode_str(itemExplode$$59, SL(" "), orderItem, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&_59$$59, itemExplode$$59, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query/builder.zep", 1317 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_58$$59, this_ptr, "autoescape", NULL, 386, _59$$59); + if (zephir_memnstr_str(&orderItem, SL(" "), "phalcon/mvc/model/query/builder.zep", 1314) != 0) { + ZEPHIR_INIT_NVAR(&itemExplode$$59); + zephir_fast_explode_str(&itemExplode$$59, SL(" "), &orderItem, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&_54$$59, &itemExplode$$59, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query/builder.zep", 1317 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_53$$59, this_ptr, "autoescape", NULL, 344, &_54$$59); zephir_check_call_status(); - zephir_array_fetch_long(&_60$$59, itemExplode$$59, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query/builder.zep", 1317 TSRMLS_CC); - ZEPHIR_INIT_LNVAR(_61$$59); - ZEPHIR_CONCAT_VSV(_61$$59, _58$$59, " ", _60$$59); - zephir_array_append(&orderItems, _61$$59, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1317); + zephir_array_fetch_long(&_55$$59, &itemExplode$$59, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/model/query/builder.zep", 1317 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_56$$59); + ZEPHIR_CONCAT_VSV(&_56$$59, &_53$$59, " ", &_55$$59); + zephir_array_append(&orderItems, &_56$$59, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1317); continue; } - ZEPHIR_CALL_METHOD(&_62$$57, this_ptr, "autoescape", NULL, 386, orderItem); + ZEPHIR_CALL_METHOD(&_57$$57, this_ptr, "autoescape", NULL, 344, &orderItem); zephir_check_call_status(); - zephir_array_append(&orderItems, _62$$57, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1322); - } - ZEPHIR_INIT_VAR(_63$$56); - zephir_fast_join_str(_63$$56, SL(", "), orderItems TSRMLS_CC); - ZEPHIR_INIT_VAR(_64$$56); - ZEPHIR_CONCAT_SV(_64$$56, " ORDER BY ", _63$$56); - zephir_concat_self(&phql, _64$$56 TSRMLS_CC); + zephir_array_append(&orderItems, &_57$$57, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1322); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&orderItem); + ZEPHIR_INIT_VAR(&_58$$56); + zephir_fast_join_str(&_58$$56, SL(", "), &orderItems TSRMLS_CC); + ZEPHIR_INIT_VAR(&_59$$56); + ZEPHIR_CONCAT_SV(&_59$$56, " ORDER BY ", &_58$$56); + zephir_concat_self(&phql, &_59$$56 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_65$$60); - ZEPHIR_CONCAT_SV(_65$$60, " ORDER BY ", order); - zephir_concat_self(&phql, _65$$60 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_60$$60); + ZEPHIR_CONCAT_SV(&_60$$60, " ORDER BY ", &order); + zephir_concat_self(&phql, &_60$$60 TSRMLS_CC); } } - ZEPHIR_OBS_VAR(limit); - zephir_read_property_this(&limit, this_ptr, SL("_limit"), PH_NOISY_CC); - if (Z_TYPE_P(limit) != IS_NULL) { - ZEPHIR_INIT_VAR(number); - ZVAL_NULL(number); - if (Z_TYPE_P(limit) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(number); - zephir_array_fetch_string(&number, limit, SL("number"), PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1340 TSRMLS_CC); - ZEPHIR_OBS_VAR(offset); - if (zephir_array_isset_string_fetch(&offset, limit, SS("offset"), 0 TSRMLS_CC)) { - if (!(zephir_is_numeric(offset))) { - ZEPHIR_INIT_NVAR(offset); - ZVAL_LONG(offset, 0); + ZEPHIR_OBS_VAR(&limit); + zephir_read_property(&limit, this_ptr, SL("_limit"), PH_NOISY_CC); + if (Z_TYPE_P(&limit) != IS_NULL) { + ZEPHIR_INIT_VAR(&number); + ZVAL_NULL(&number); + if (Z_TYPE_P(&limit) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&number); + zephir_array_fetch_string(&number, &limit, SL("number"), PH_NOISY, "phalcon/mvc/model/query/builder.zep", 1340 TSRMLS_CC); + ZEPHIR_OBS_VAR(&offset); + if (zephir_array_isset_string_fetch(&offset, &limit, SL("offset"), 0)) { + if (!(zephir_is_numeric(&offset))) { + ZEPHIR_INIT_NVAR(&offset); + ZVAL_LONG(&offset, 0); } } } else { - if (zephir_is_numeric(limit)) { - ZEPHIR_CPY_WRT(number, limit); - ZEPHIR_OBS_NVAR(offset); - zephir_read_property_this(&offset, this_ptr, SL("_offset"), PH_NOISY_CC); - if (Z_TYPE_P(offset) != IS_NULL) { - if (!(zephir_is_numeric(offset))) { - ZEPHIR_INIT_NVAR(offset); - ZVAL_LONG(offset, 0); + if (zephir_is_numeric(&limit)) { + ZEPHIR_CPY_WRT(&number, &limit); + ZEPHIR_OBS_NVAR(&offset); + zephir_read_property(&offset, this_ptr, SL("_offset"), PH_NOISY_CC); + if (Z_TYPE_P(&offset) != IS_NULL) { + if (!(zephir_is_numeric(&offset))) { + ZEPHIR_INIT_NVAR(&offset); + ZVAL_LONG(&offset, 0); } } } } - if (zephir_is_numeric(number)) { + if (zephir_is_numeric(&number)) { zephir_concat_self_str(&phql, SL(" LIMIT :APL0:") TSRMLS_CC); - ZEPHIR_SINIT_VAR(_66$$69); - ZVAL_LONG(&_66$$69, 10); - ZEPHIR_CALL_FUNCTION(&_67$$69, "intval", NULL, 39, number, &_66$$69); + ZVAL_LONG(&_61$$69, 10); + ZEPHIR_CALL_FUNCTION(&_62$$69, "intval", NULL, 33, &number, &_61$$69); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_68$$69); - ZVAL_STRING(_68$$69, "APL0", 1); - zephir_update_property_array(this_ptr, SL("_bindParams"), _68$$69, _67$$69 TSRMLS_CC); - ZEPHIR_INIT_VAR(_69$$69); - ZVAL_STRING(_69$$69, "APL0", 1); - ZEPHIR_INIT_VAR(_70$$69); - ZVAL_LONG(_70$$69, 1); - zephir_update_property_array(this_ptr, SL("_bindTypes"), _69$$69, _70$$69 TSRMLS_CC); - if (zephir_is_numeric(offset)) { + ZEPHIR_INIT_VAR(&_63$$69); + ZVAL_STRING(&_63$$69, "APL0"); + zephir_update_property_array(this_ptr, SL("_bindParams"), &_63$$69, &_62$$69 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_64$$69); + ZVAL_STRING(&_64$$69, "APL0"); + ZEPHIR_INIT_VAR(&_65$$69); + ZVAL_LONG(&_65$$69, 1); + zephir_update_property_array(this_ptr, SL("_bindTypes"), &_64$$69, &_65$$69 TSRMLS_CC); + if (zephir_is_numeric(&offset)) { zephir_concat_self_str(&phql, SL(" OFFSET :APL1:") TSRMLS_CC); - ZEPHIR_SINIT_VAR(_71$$70); - ZVAL_LONG(&_71$$70, 10); - ZEPHIR_CALL_FUNCTION(&_72$$70, "intval", NULL, 39, offset, &_71$$70); + ZVAL_LONG(&_66$$70, 10); + ZEPHIR_CALL_FUNCTION(&_67$$70, "intval", NULL, 33, &offset, &_66$$70); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_73$$70); - ZVAL_STRING(_73$$70, "APL1", 1); - zephir_update_property_array(this_ptr, SL("_bindParams"), _73$$70, _72$$70 TSRMLS_CC); - ZEPHIR_INIT_VAR(_74$$70); - ZVAL_STRING(_74$$70, "APL1", 1); - ZEPHIR_INIT_VAR(_75$$70); - ZVAL_LONG(_75$$70, 1); - zephir_update_property_array(this_ptr, SL("_bindTypes"), _74$$70, _75$$70 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_68$$70); + ZVAL_STRING(&_68$$70, "APL1"); + zephir_update_property_array(this_ptr, SL("_bindParams"), &_68$$70, &_67$$70 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_69$$70); + ZVAL_STRING(&_69$$70, "APL1"); + ZEPHIR_INIT_VAR(&_70$$70); + ZVAL_LONG(&_70$$70, 1); + zephir_update_property_array(this_ptr, SL("_bindTypes"), &_69$$70, &_70$$70 TSRMLS_CC); } } } - forUpdate = zephir_fetch_nproperty_this(this_ptr, SL("_forUpdate"), PH_NOISY_CC); - if (Z_TYPE_P(forUpdate) == IS_BOOL) { - if (zephir_is_true(forUpdate)) { + zephir_read_property(&forUpdate, this_ptr, SL("_forUpdate"), PH_NOISY_CC | PH_READONLY); + if (((Z_TYPE_P(&forUpdate) == IS_TRUE || Z_TYPE_P(&forUpdate) == IS_FALSE) == 1)) { + if (zephir_is_true(&forUpdate)) { zephir_concat_self_str(&phql, SL(" FOR UPDATE") TSRMLS_CC); } } - RETURN_CCTOR(phql); + RETURN_CCTOR(&phql); } @@ -2160,50 +2505,62 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getPhql) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, getQuery) { - zval *_2; - zval *query = NULL, *bindParams = NULL, *bindTypes = NULL, *phql = NULL, *dependencyInjector = NULL, *_0, *_1 = NULL, *_3, *_4, *_5$$6; + zval _2; + zval query, bindParams, bindTypes, phql, dependencyInjector, _0, _1, _3, _4, _5$$6; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(&phql); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&phql, this_ptr, "getphql", NULL, 387); + ZEPHIR_CALL_METHOD(&phql, this_ptr, "getphql", NULL, 345); zephir_check_call_status(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A dependency injection object is required to access ORM services", "phalcon/mvc/model/query/builder.zep", 1394); return; } - ZEPHIR_INIT_VAR(_2); - zephir_create_array(_2, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_2, phql); - zephir_array_fast_append(_2, dependencyInjector); - ZEPHIR_INIT_VAR(_3); - ZVAL_STRING(_3, "Phalcon\\Mvc\\Model\\Query", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "get", NULL, 0, _3, _2); - zephir_check_temp_parameter(_3); + ZEPHIR_INIT_VAR(&_2); + zephir_create_array(&_2, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_2, &phql); + zephir_array_fast_append(&_2, &dependencyInjector); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "Phalcon\\Mvc\\Model\\Query"); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "get", NULL, 0, &_3, &_2); zephir_check_call_status(); - ZEPHIR_CPY_WRT(query, _1); - ZEPHIR_OBS_VAR(bindParams); - zephir_read_property_this(&bindParams, this_ptr, SL("_bindParams"), PH_NOISY_CC); - if (Z_TYPE_P(bindParams) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, query, "setbindparams", NULL, 0, bindParams); + ZEPHIR_CPY_WRT(&query, &_1); + ZEPHIR_OBS_VAR(&bindParams); + zephir_read_property(&bindParams, this_ptr, SL("_bindParams"), PH_NOISY_CC); + if (Z_TYPE_P(&bindParams) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(NULL, &query, "setbindparams", NULL, 0, &bindParams); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(bindTypes); - zephir_read_property_this(&bindTypes, this_ptr, SL("_bindTypes"), PH_NOISY_CC); - if (Z_TYPE_P(bindTypes) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, query, "setbindtypes", NULL, 0, bindTypes); + ZEPHIR_OBS_VAR(&bindTypes); + zephir_read_property(&bindTypes, this_ptr, SL("_bindTypes"), PH_NOISY_CC); + if (Z_TYPE_P(&bindTypes) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(NULL, &query, "setbindtypes", NULL, 0, &bindTypes); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(_4); - zephir_read_property_this(&_4, this_ptr, SL("_sharedLock"), PH_NOISY_CC); - if (Z_TYPE_P(_4) == IS_BOOL) { - _5$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_sharedLock"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, query, "setsharedlock", NULL, 0, _5$$6); + ZEPHIR_OBS_VAR(&_4); + zephir_read_property(&_4, this_ptr, SL("_sharedLock"), PH_NOISY_CC); + if (((Z_TYPE_P(&_4) == IS_TRUE || Z_TYPE_P(&_4) == IS_FALSE) == 1)) { + zephir_read_property(&_5$$6, this_ptr, SL("_sharedLock"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &query, "setsharedlock", NULL, 0, &_5$$6); zephir_check_call_status(); } - RETURN_CCTOR(query); + RETURN_CCTOR(&query); } @@ -2214,26 +2571,29 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, autoescape) { zend_bool _0, _1; zval *identifier_param = NULL; - zval *identifier = NULL; + zval identifier; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&identifier); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &identifier_param); - zephir_get_strval(identifier, identifier_param); + zephir_get_strval(&identifier, identifier_param); - _0 = zephir_memnstr_str(identifier, SL("["), "phalcon/mvc/model/query/builder.zep", 1429); + _0 = zephir_memnstr_str(&identifier, SL("["), "phalcon/mvc/model/query/builder.zep", 1429); if (!(_0)) { - _0 = zephir_memnstr_str(identifier, SL("."), "phalcon/mvc/model/query/builder.zep", 1429); + _0 = zephir_memnstr_str(&identifier, SL("."), "phalcon/mvc/model/query/builder.zep", 1429); } _1 = _0; if (!(_1)) { - _1 = zephir_is_numeric(identifier); + _1 = zephir_is_numeric(&identifier); } if (_1) { - RETURN_CTOR(identifier); + RETURN_CTOR(&identifier); } - ZEPHIR_CONCAT_SVS(return_value, "[", identifier, "]"); + ZEPHIR_CONCAT_SVS(return_value, "[", &identifier, "]"); RETURN_MM(); } @@ -2243,86 +2603,104 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, autoescape) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, _conditionBetween) { - zval *_6; + zval _6; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *clause_param = NULL, *operator_param = NULL, *expr_param = NULL, *minimum, *maximum, *hiddenParam = NULL, *nextHiddenParam = NULL, *minimumKey = NULL, *maximumKey = NULL, *operatorMethod = NULL, *_5, *_1$$3, _2$$3, *_3$$3 = NULL; - zval *clause = NULL, *operator = NULL, *expr = NULL, *_4; + zval *clause_param = NULL, *operator_param = NULL, *expr_param = NULL, *minimum, minimum_sub, *maximum, maximum_sub, hiddenParam, nextHiddenParam, minimumKey, maximumKey, operatorMethod, _5, _1$$3, _2$$3, _3$$3; + zval clause, operator, expr, _4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&clause); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&minimum_sub); + ZVAL_UNDEF(&maximum_sub); + ZVAL_UNDEF(&hiddenParam); + ZVAL_UNDEF(&nextHiddenParam); + ZVAL_UNDEF(&minimumKey); + ZVAL_UNDEF(&maximumKey); + ZVAL_UNDEF(&operatorMethod); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 5, 0, &clause_param, &operator_param, &expr_param, &minimum, &maximum); if (UNEXPECTED(Z_TYPE_P(clause_param) != IS_STRING && Z_TYPE_P(clause_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'clause' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'clause' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(clause_param) == IS_STRING)) { - zephir_get_strval(clause, clause_param); + zephir_get_strval(&clause, clause_param); } else { - ZEPHIR_INIT_VAR(clause); - ZVAL_EMPTY_STRING(clause); + ZEPHIR_INIT_VAR(&clause); + ZVAL_EMPTY_STRING(&clause); } if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } - _0 = !ZEPHIR_IS_STRING_IDENTICAL(operator, "and"); + _0 = !ZEPHIR_IS_STRING_IDENTICAL(&operator, "and"); if (_0) { - _0 = !ZEPHIR_IS_STRING_IDENTICAL(operator, "or"); + _0 = !ZEPHIR_IS_STRING_IDENTICAL(&operator, "or"); } if (_0) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_mvc_model_exception_ce); - ZEPHIR_SINIT_VAR(_2$$3); - ZVAL_STRING(&_2$$3, "Operator % is not available.", 0); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 164, &_2$$3, operator); + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Operator % is not available."); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 145, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_3$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/mvc/model/query/builder.zep", 1444 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/mvc/model/query/builder.zep", 1444 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(_4); - ZEPHIR_CONCAT_VV(_4, operator, clause); - ZEPHIR_CPY_WRT(operatorMethod, _4); - ZEPHIR_OBS_VAR(hiddenParam); - zephir_read_property_this(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(nextHiddenParam); - ZVAL_LONG(nextHiddenParam, (zephir_get_numberval(hiddenParam) + 1)); - ZEPHIR_INIT_VAR(minimumKey); - ZEPHIR_CONCAT_SV(minimumKey, "AP", hiddenParam); - ZEPHIR_INIT_VAR(maximumKey); - ZEPHIR_CONCAT_SV(maximumKey, "AP", nextHiddenParam); - ZEPHIR_INIT_VAR(_5); - ZEPHIR_CONCAT_VSVSVS(_5, expr, " BETWEEN :", minimumKey, ": AND :", maximumKey, ":"); - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 2, 0 TSRMLS_CC); - zephir_array_update_zval(&_6, minimumKey, &minimum, PH_COPY); - zephir_array_update_zval(&_6, maximumKey, &maximum, PH_COPY); - ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, operatorMethod, NULL, 0, _5, _6); + ZEPHIR_INIT_VAR(&_4); + ZEPHIR_CONCAT_VV(&_4, &operator, &clause); + ZEPHIR_CPY_WRT(&operatorMethod, &_4); + ZEPHIR_OBS_VAR(&hiddenParam); + zephir_read_property(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&nextHiddenParam); + ZVAL_LONG(&nextHiddenParam, (zephir_get_numberval(&hiddenParam) + 1)); + ZEPHIR_INIT_VAR(&minimumKey); + ZEPHIR_CONCAT_SV(&minimumKey, "AP", &hiddenParam); + ZEPHIR_INIT_VAR(&maximumKey); + ZEPHIR_CONCAT_SV(&maximumKey, "AP", &nextHiddenParam); + ZEPHIR_INIT_VAR(&_5); + ZEPHIR_CONCAT_VSVSVS(&_5, &expr, " BETWEEN :", &minimumKey, ": AND :", &maximumKey, ":"); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 2, 0 TSRMLS_CC); + zephir_array_update_zval(&_6, &minimumKey, minimum, PH_COPY); + zephir_array_update_zval(&_6, &maximumKey, maximum, PH_COPY); + ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &operatorMethod, NULL, 0, &_5, &_6); zephir_check_call_status(); - ZEPHIR_SEPARATE(nextHiddenParam); - zephir_increment(nextHiddenParam); - zephir_update_property_this(getThis(), SL("_hiddenParamNumber"), nextHiddenParam TSRMLS_CC); + ZEPHIR_SEPARATE(&nextHiddenParam); + zephir_increment(&nextHiddenParam); + zephir_update_property_zval(this_ptr, SL("_hiddenParamNumber"), &nextHiddenParam); RETURN_THIS(); } @@ -2332,86 +2710,104 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, _conditionBetween) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, _conditionNotBetween) { - zval *_6; + zval _6; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *clause_param = NULL, *operator_param = NULL, *expr_param = NULL, *minimum, *maximum, *hiddenParam = NULL, *nextHiddenParam = NULL, *minimumKey = NULL, *maximumKey = NULL, *operatorMethod = NULL, *_5, *_1$$3, _2$$3, *_3$$3 = NULL; - zval *clause = NULL, *operator = NULL, *expr = NULL, *_4; + zval *clause_param = NULL, *operator_param = NULL, *expr_param = NULL, *minimum, minimum_sub, *maximum, maximum_sub, hiddenParam, nextHiddenParam, minimumKey, maximumKey, operatorMethod, _5, _1$$3, _2$$3, _3$$3; + zval clause, operator, expr, _4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&clause); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&minimum_sub); + ZVAL_UNDEF(&maximum_sub); + ZVAL_UNDEF(&hiddenParam); + ZVAL_UNDEF(&nextHiddenParam); + ZVAL_UNDEF(&minimumKey); + ZVAL_UNDEF(&maximumKey); + ZVAL_UNDEF(&operatorMethod); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 5, 0, &clause_param, &operator_param, &expr_param, &minimum, &maximum); if (UNEXPECTED(Z_TYPE_P(clause_param) != IS_STRING && Z_TYPE_P(clause_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'clause' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'clause' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(clause_param) == IS_STRING)) { - zephir_get_strval(clause, clause_param); + zephir_get_strval(&clause, clause_param); } else { - ZEPHIR_INIT_VAR(clause); - ZVAL_EMPTY_STRING(clause); + ZEPHIR_INIT_VAR(&clause); + ZVAL_EMPTY_STRING(&clause); } if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } - _0 = !ZEPHIR_IS_STRING_IDENTICAL(operator, "and"); + _0 = !ZEPHIR_IS_STRING_IDENTICAL(&operator, "and"); if (_0) { - _0 = !ZEPHIR_IS_STRING_IDENTICAL(operator, "or"); + _0 = !ZEPHIR_IS_STRING_IDENTICAL(&operator, "or"); } if (_0) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_mvc_model_exception_ce); - ZEPHIR_SINIT_VAR(_2$$3); - ZVAL_STRING(&_2$$3, "Operator % is not available.", 0); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 164, &_2$$3, operator); + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Operator % is not available."); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 145, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_3$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/mvc/model/query/builder.zep", 1483 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/mvc/model/query/builder.zep", 1483 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(_4); - ZEPHIR_CONCAT_VV(_4, operator, clause); - ZEPHIR_CPY_WRT(operatorMethod, _4); - ZEPHIR_OBS_VAR(hiddenParam); - zephir_read_property_this(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(nextHiddenParam); - ZVAL_LONG(nextHiddenParam, (zephir_get_numberval(hiddenParam) + 1)); - ZEPHIR_INIT_VAR(minimumKey); - ZEPHIR_CONCAT_SV(minimumKey, "AP", hiddenParam); - ZEPHIR_INIT_VAR(maximumKey); - ZEPHIR_CONCAT_SV(maximumKey, "AP", nextHiddenParam); - ZEPHIR_INIT_VAR(_5); - ZEPHIR_CONCAT_VSVSVS(_5, expr, " NOT BETWEEN :", minimumKey, ": AND :", maximumKey, ":"); - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 2, 0 TSRMLS_CC); - zephir_array_update_zval(&_6, minimumKey, &minimum, PH_COPY); - zephir_array_update_zval(&_6, maximumKey, &maximum, PH_COPY); - ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, operatorMethod, NULL, 0, _5, _6); + ZEPHIR_INIT_VAR(&_4); + ZEPHIR_CONCAT_VV(&_4, &operator, &clause); + ZEPHIR_CPY_WRT(&operatorMethod, &_4); + ZEPHIR_OBS_VAR(&hiddenParam); + zephir_read_property(&hiddenParam, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&nextHiddenParam); + ZVAL_LONG(&nextHiddenParam, (zephir_get_numberval(&hiddenParam) + 1)); + ZEPHIR_INIT_VAR(&minimumKey); + ZEPHIR_CONCAT_SV(&minimumKey, "AP", &hiddenParam); + ZEPHIR_INIT_VAR(&maximumKey); + ZEPHIR_CONCAT_SV(&maximumKey, "AP", &nextHiddenParam); + ZEPHIR_INIT_VAR(&_5); + ZEPHIR_CONCAT_VSVSVS(&_5, &expr, " NOT BETWEEN :", &minimumKey, ": AND :", &maximumKey, ":"); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 2, 0 TSRMLS_CC); + zephir_array_update_zval(&_6, &minimumKey, minimum, PH_COPY); + zephir_array_update_zval(&_6, &maximumKey, maximum, PH_COPY); + ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &operatorMethod, NULL, 0, &_5, &_6); zephir_check_call_status(); - ZEPHIR_SEPARATE(nextHiddenParam); - zephir_increment(nextHiddenParam); - zephir_update_property_this(getThis(), SL("_hiddenParamNumber"), nextHiddenParam TSRMLS_CC); + ZEPHIR_SEPARATE(&nextHiddenParam); + zephir_increment(&nextHiddenParam); + zephir_update_property_zval(this_ptr, SL("_hiddenParamNumber"), &nextHiddenParam); RETURN_THIS(); } @@ -2421,110 +2817,131 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, _conditionNotBetween) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, _conditionIn) { - HashTable *_8; - HashPosition _7; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS, hiddenParam = 0; - zval *values = NULL; - zval *clause_param = NULL, *operator_param = NULL, *expr_param = NULL, *values_param = NULL, *key = NULL, *queryKey = NULL, *value = NULL, *bindKeys = NULL, *bindParams = NULL, *operatorMethod = NULL, *_6, **_9, *_12, *_13, *_14, *_1$$3, _2$$3, *_3$$3 = NULL, _10$$5 = zval_used_for_init; - zval *clause = NULL, *operator = NULL, *expr = NULL, *_4, *_5$$4, *_11$$5 = NULL; + zval values; + zval *clause_param = NULL, *operator_param = NULL, *expr_param = NULL, *values_param = NULL, key, queryKey, value, bindKeys, bindParams, operatorMethod, _6, *_7, _10, _11, _12, _1$$3, _2$$3, _3$$3, _8$$5; + zval clause, operator, expr, _4, _5$$4, _9$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&clause); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&queryKey); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&bindKeys); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&operatorMethod); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&values); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &clause_param, &operator_param, &expr_param, &values_param); if (UNEXPECTED(Z_TYPE_P(clause_param) != IS_STRING && Z_TYPE_P(clause_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'clause' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'clause' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(clause_param) == IS_STRING)) { - zephir_get_strval(clause, clause_param); + zephir_get_strval(&clause, clause_param); } else { - ZEPHIR_INIT_VAR(clause); - ZVAL_EMPTY_STRING(clause); + ZEPHIR_INIT_VAR(&clause); + ZVAL_EMPTY_STRING(&clause); } if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } - values = values_param; + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); - _0 = !ZEPHIR_IS_STRING_IDENTICAL(operator, "and"); + _0 = !ZEPHIR_IS_STRING_IDENTICAL(&operator, "and"); if (_0) { - _0 = !ZEPHIR_IS_STRING_IDENTICAL(operator, "or"); + _0 = !ZEPHIR_IS_STRING_IDENTICAL(&operator, "or"); } if (_0) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_mvc_model_exception_ce); - ZEPHIR_SINIT_VAR(_2$$3); - ZVAL_STRING(&_2$$3, "Operator % is not available.", 0); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 164, &_2$$3, operator); + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Operator % is not available."); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 145, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_3$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/mvc/model/query/builder.zep", 1522 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/mvc/model/query/builder.zep", 1522 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(_4); - ZEPHIR_CONCAT_VV(_4, operator, clause); - ZEPHIR_CPY_WRT(operatorMethod, _4); - if (!(zephir_fast_count_int(values TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_5$$4); - ZEPHIR_CONCAT_VSV(_5$$4, expr, " != ", expr); - ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, operatorMethod, NULL, 0, _5$$4); + ZEPHIR_INIT_VAR(&_4); + ZEPHIR_CONCAT_VV(&_4, &operator, &clause); + ZEPHIR_CPY_WRT(&operatorMethod, &_4); + if (!(zephir_fast_count_int(&values TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_5$$4); + ZEPHIR_CONCAT_VSV(&_5$$4, &expr, " != ", &expr); + ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &operatorMethod, NULL, 0, &_5$$4); zephir_check_call_status(); RETURN_THIS(); } - ZEPHIR_OBS_VAR(_6); - zephir_read_property_this(&_6, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); - hiddenParam = zephir_get_intval(_6); - ZEPHIR_INIT_VAR(bindParams); - array_init(bindParams); - ZEPHIR_INIT_VAR(bindKeys); - array_init(bindKeys); - zephir_is_iterable(values, &_8, &_7, 0, 0, "phalcon/mvc/model/query/builder.zep", 1551); - for ( - ; zend_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS - ; zend_hash_move_forward_ex(_8, &_7) - ) { - ZEPHIR_GET_HVALUE(value, _9); - ZEPHIR_SINIT_NVAR(_10$$5); - ZVAL_LONG(&_10$$5, hiddenParam); - ZEPHIR_INIT_LNVAR(_11$$5); - ZEPHIR_CONCAT_SV(_11$$5, "AP", &_10$$5); - ZEPHIR_CPY_WRT(key, _11$$5); - ZEPHIR_INIT_NVAR(queryKey); - ZEPHIR_CONCAT_SVS(queryKey, ":", key, ":"); - zephir_array_append(&bindKeys, queryKey, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1542); - zephir_array_update_zval(&bindParams, key, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_VAR(&_6); + zephir_read_property(&_6, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); + hiddenParam = zephir_get_intval(&_6); + ZEPHIR_INIT_VAR(&bindParams); + array_init(&bindParams); + ZEPHIR_INIT_VAR(&bindKeys); + array_init(&bindKeys); + zephir_is_iterable(&values, 0, "phalcon/mvc/model/query/builder.zep", 1551); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&values), _7) + { + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _7); + ZEPHIR_SINIT_NVAR(_8$$5); + ZVAL_LONG(&_8$$5, hiddenParam); + ZEPHIR_INIT_LNVAR(_9$$5); + ZEPHIR_CONCAT_SV(&_9$$5, "AP", &_8$$5); + ZEPHIR_CPY_WRT(&key, &_9$$5); + ZEPHIR_INIT_NVAR(&queryKey); + ZEPHIR_CONCAT_SVS(&queryKey, ":", &key, ":"); + zephir_array_append(&bindKeys, &queryKey, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1542); + zephir_array_update_zval(&bindParams, &key, &value, PH_COPY | PH_SEPARATE); hiddenParam++; - } - ZEPHIR_INIT_VAR(_12); - zephir_fast_join_str(_12, SL(", "), bindKeys TSRMLS_CC); - ZEPHIR_INIT_VAR(_13); - ZEPHIR_CONCAT_VSVS(_13, expr, " IN (", _12, ")"); - ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, operatorMethod, NULL, 0, _13, bindParams); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_VAR(&_10); + zephir_fast_join_str(&_10, SL(", "), &bindKeys TSRMLS_CC); + ZEPHIR_INIT_VAR(&_11); + ZEPHIR_CONCAT_VSVS(&_11, &expr, " IN (", &_10, ")"); + ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &operatorMethod, NULL, 0, &_11, &bindParams); zephir_check_call_status(); - ZEPHIR_INIT_ZVAL_NREF(_14); - ZVAL_LONG(_14, hiddenParam); - zephir_update_property_this(getThis(), SL("_hiddenParamNumber"), _14 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_12); + ZVAL_LONG(&_12, hiddenParam); + zephir_update_property_zval(this_ptr, SL("_hiddenParamNumber"), &_12); RETURN_THIS(); } @@ -2534,110 +2951,131 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, _conditionIn) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Builder, _conditionNotIn) { - HashTable *_8; - HashPosition _7; zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS, hiddenParam = 0; - zval *values = NULL; - zval *clause_param = NULL, *operator_param = NULL, *expr_param = NULL, *values_param = NULL, *key = NULL, *queryKey = NULL, *value = NULL, *bindKeys = NULL, *bindParams = NULL, *operatorMethod = NULL, *_6, **_9, *_12, *_13, *_14, *_1$$3, _2$$3, *_3$$3 = NULL, _10$$5 = zval_used_for_init; - zval *clause = NULL, *operator = NULL, *expr = NULL, *_4, *_5$$4, *_11$$5 = NULL; + zval values; + zval *clause_param = NULL, *operator_param = NULL, *expr_param = NULL, *values_param = NULL, key, queryKey, value, bindKeys, bindParams, operatorMethod, _6, *_7, _10, _11, _12, _1$$3, _2$$3, _3$$3, _8$$5; + zval clause, operator, expr, _4, _5$$4, _9$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&clause); + ZVAL_UNDEF(&operator); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_9$$5); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&queryKey); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&bindKeys); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&operatorMethod); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_8$$5); + ZVAL_UNDEF(&values); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &clause_param, &operator_param, &expr_param, &values_param); if (UNEXPECTED(Z_TYPE_P(clause_param) != IS_STRING && Z_TYPE_P(clause_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'clause' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'clause' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(clause_param) == IS_STRING)) { - zephir_get_strval(clause, clause_param); + zephir_get_strval(&clause, clause_param); } else { - ZEPHIR_INIT_VAR(clause); - ZVAL_EMPTY_STRING(clause); + ZEPHIR_INIT_VAR(&clause); + ZVAL_EMPTY_STRING(&clause); } if (UNEXPECTED(Z_TYPE_P(operator_param) != IS_STRING && Z_TYPE_P(operator_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'operator' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(operator_param) == IS_STRING)) { - zephir_get_strval(operator, operator_param); + zephir_get_strval(&operator, operator_param); } else { - ZEPHIR_INIT_VAR(operator); - ZVAL_EMPTY_STRING(operator); + ZEPHIR_INIT_VAR(&operator); + ZVAL_EMPTY_STRING(&operator); } if (UNEXPECTED(Z_TYPE_P(expr_param) != IS_STRING && Z_TYPE_P(expr_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'expr' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(expr_param) == IS_STRING)) { - zephir_get_strval(expr, expr_param); + zephir_get_strval(&expr, expr_param); } else { - ZEPHIR_INIT_VAR(expr); - ZVAL_EMPTY_STRING(expr); + ZEPHIR_INIT_VAR(&expr); + ZVAL_EMPTY_STRING(&expr); } - values = values_param; + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); - _0 = !ZEPHIR_IS_STRING_IDENTICAL(operator, "and"); + _0 = !ZEPHIR_IS_STRING_IDENTICAL(&operator, "and"); if (_0) { - _0 = !ZEPHIR_IS_STRING_IDENTICAL(operator, "or"); + _0 = !ZEPHIR_IS_STRING_IDENTICAL(&operator, "or"); } if (_0) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_mvc_model_exception_ce); - ZEPHIR_SINIT_VAR(_2$$3); - ZVAL_STRING(&_2$$3, "Operator % is not available.", 0); - ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 164, &_2$$3, operator); + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "Operator % is not available."); + ZEPHIR_CALL_FUNCTION(&_3$$3, "sprintf", NULL, 145, &_2$$3, &operator); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _3$$3); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_3$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/mvc/model/query/builder.zep", 1567 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/mvc/model/query/builder.zep", 1567 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(_4); - ZEPHIR_CONCAT_VV(_4, operator, clause); - ZEPHIR_CPY_WRT(operatorMethod, _4); - if (!(zephir_fast_count_int(values TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_5$$4); - ZEPHIR_CONCAT_VSV(_5$$4, expr, " != ", expr); - ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, operatorMethod, NULL, 0, _5$$4); + ZEPHIR_INIT_VAR(&_4); + ZEPHIR_CONCAT_VV(&_4, &operator, &clause); + ZEPHIR_CPY_WRT(&operatorMethod, &_4); + if (!(zephir_fast_count_int(&values TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_5$$4); + ZEPHIR_CONCAT_VSV(&_5$$4, &expr, " != ", &expr); + ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &operatorMethod, NULL, 0, &_5$$4); zephir_check_call_status(); RETURN_THIS(); } - ZEPHIR_OBS_VAR(_6); - zephir_read_property_this(&_6, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); - hiddenParam = zephir_get_intval(_6); - ZEPHIR_INIT_VAR(bindParams); - array_init(bindParams); - ZEPHIR_INIT_VAR(bindKeys); - array_init(bindKeys); - zephir_is_iterable(values, &_8, &_7, 0, 0, "phalcon/mvc/model/query/builder.zep", 1596); - for ( - ; zend_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS - ; zend_hash_move_forward_ex(_8, &_7) - ) { - ZEPHIR_GET_HVALUE(value, _9); - ZEPHIR_SINIT_NVAR(_10$$5); - ZVAL_LONG(&_10$$5, hiddenParam); - ZEPHIR_INIT_LNVAR(_11$$5); - ZEPHIR_CONCAT_SV(_11$$5, "AP", &_10$$5); - ZEPHIR_CPY_WRT(key, _11$$5); - ZEPHIR_INIT_NVAR(queryKey); - ZEPHIR_CONCAT_SVS(queryKey, ":", key, ":"); - zephir_array_append(&bindKeys, queryKey, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1587); - zephir_array_update_zval(&bindParams, key, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_VAR(&_6); + zephir_read_property(&_6, this_ptr, SL("_hiddenParamNumber"), PH_NOISY_CC); + hiddenParam = zephir_get_intval(&_6); + ZEPHIR_INIT_VAR(&bindParams); + array_init(&bindParams); + ZEPHIR_INIT_VAR(&bindKeys); + array_init(&bindKeys); + zephir_is_iterable(&values, 0, "phalcon/mvc/model/query/builder.zep", 1596); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&values), _7) + { + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _7); + ZEPHIR_SINIT_NVAR(_8$$5); + ZVAL_LONG(&_8$$5, hiddenParam); + ZEPHIR_INIT_LNVAR(_9$$5); + ZEPHIR_CONCAT_SV(&_9$$5, "AP", &_8$$5); + ZEPHIR_CPY_WRT(&key, &_9$$5); + ZEPHIR_INIT_NVAR(&queryKey); + ZEPHIR_CONCAT_SVS(&queryKey, ":", &key, ":"); + zephir_array_append(&bindKeys, &queryKey, PH_SEPARATE, "phalcon/mvc/model/query/builder.zep", 1587); + zephir_array_update_zval(&bindParams, &key, &value, PH_COPY | PH_SEPARATE); hiddenParam++; - } - ZEPHIR_INIT_VAR(_12); - zephir_fast_join_str(_12, SL(", "), bindKeys TSRMLS_CC); - ZEPHIR_INIT_VAR(_13); - ZEPHIR_CONCAT_VSVS(_13, expr, " NOT IN (", _12, ")"); - ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, operatorMethod, NULL, 0, _13, bindParams); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_VAR(&_10); + zephir_fast_join_str(&_10, SL(", "), &bindKeys TSRMLS_CC); + ZEPHIR_INIT_VAR(&_11); + ZEPHIR_CONCAT_VSVS(&_11, &expr, " NOT IN (", &_10, ")"); + ZEPHIR_CALL_METHOD_ZVAL(NULL, this_ptr, &operatorMethod, NULL, 0, &_11, &bindParams); zephir_check_call_status(); - ZEPHIR_INIT_ZVAL_NREF(_14); - ZVAL_LONG(_14, hiddenParam); - zephir_update_property_this(getThis(), SL("_hiddenParamNumber"), _14 TSRMLS_CC); + ZEPHIR_INIT_ZVAL_NREF(_12); + ZVAL_LONG(&_12, hiddenParam); + zephir_update_property_zval(this_ptr, SL("_hiddenParamNumber"), &_12); RETURN_THIS(); } diff --git a/ext/phalcon/mvc/model/query/builder.zep.h b/ext/phalcon/mvc/model/query/builder.zep.h index 73daf54b4e4..a22ec6b176e 100644 --- a/ext/phalcon/mvc/model/query/builder.zep.h +++ b/ext/phalcon/mvc/model/query/builder.zep.h @@ -56,202 +56,522 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder___construct, 0, 0 ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_setdi, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_setdi, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_setdi, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_distinct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_distinct, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_distinct, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif ZEND_ARG_INFO(0, distinct) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_columns, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_getdistinct, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_getdistinct, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_columns, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_columns, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif ZEND_ARG_INFO(0, columns) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_from, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_from, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_from, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif ZEND_ARG_INFO(0, models) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_addfrom, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_addfrom, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_addfrom, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif ZEND_ARG_INFO(0, model) ZEND_ARG_INFO(0, alias) ZEND_ARG_INFO(0, with) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_join, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_join, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_join, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_innerjoin, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_innerjoin, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_innerjoin, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_leftjoin, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_leftjoin, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_leftjoin, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_rightjoin, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_rightjoin, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_rightjoin, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_where, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_where, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_where, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_andwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_andwhere, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_andwhere, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_orwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_orwhere, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_orwhere, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_betweenwhere, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_betweenwhere, 0, 3, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_betweenwhere, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notbetweenwhere, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notbetweenwhere, 0, 3, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notbetweenwhere, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_inwhere, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_inwhere, 0, 2, Phalcon\\Mvc\\Model\\Query\\BuilderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_inwhere, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\BuilderInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notinwhere, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notinwhere, 0, 2, Phalcon\\Mvc\\Model\\Query\\BuilderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notinwhere, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\BuilderInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_orderby, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_orderby, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_orderby, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif ZEND_ARG_INFO(0, orderBy) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_having, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_having, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_having, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_andhaving, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_andhaving, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_andhaving, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_orhaving, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_orhaving, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_orhaving, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_betweenhaving, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_betweenhaving, 0, 3, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_betweenhaving, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notbetweenhaving, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notbetweenhaving, 0, 3, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notbetweenhaving, 0, 3, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_inhaving, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_inhaving, 0, 2, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_inhaving, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notinhaving, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notinhaving, 0, 2, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_notinhaving, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_forupdate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_forupdate, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_forupdate, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, forUpdate, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, forUpdate) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_limit, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_limit, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_limit, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, limit, IS_LONG, 0) +#else ZEND_ARG_INFO(0, limit) +#endif ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_offset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_offset, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_offset, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0) +#else ZEND_ARG_INFO(0, offset) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_groupby, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_groupby, 0, 1, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_groupby, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif ZEND_ARG_INFO(0, group) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder_autoescape, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_getphql, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_getphql, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder_getquery, 0, 0, Phalcon\\Mvc\\Model\\QueryInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_getquery, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\QueryInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_autoescape, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder_autoescape, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, identifier, IS_STRING, 0) +#else ZEND_ARG_INFO(0, identifier) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionbetween, 0, 0, 5) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionbetween, 0, 5, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionbetween, 0, 5, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, clause, IS_STRING, 0) +#else ZEND_ARG_INFO(0, clause) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionnotbetween, 0, 0, 5) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionnotbetween, 0, 5, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionnotbetween, 0, 5, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, clause, IS_STRING, 0) +#else ZEND_ARG_INFO(0, clause) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionin, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionin, 0, 4, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionin, 0, 4, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, clause, IS_STRING, 0) +#else ZEND_ARG_INFO(0, clause) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionnotin, 0, 0, 4) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionnotin, 0, 4, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builder__conditionnotin, 0, 4, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, clause, IS_STRING, 0) +#else ZEND_ARG_INFO(0, clause) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_builder_method_entry) { PHP_ME(Phalcon_Mvc_Model_Query_Builder, __construct, arginfo_phalcon_mvc_model_query_builder___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Query_Builder, setDI, arginfo_phalcon_mvc_model_query_builder_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query_Builder, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query_Builder, getDI, arginfo_phalcon_mvc_model_query_builder_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query_Builder, distinct, arginfo_phalcon_mvc_model_query_builder_distinct, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query_Builder, getDistinct, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query_Builder, getDistinct, arginfo_phalcon_mvc_model_query_builder_getdistinct, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query_Builder, columns, arginfo_phalcon_mvc_model_query_builder_columns, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query_Builder, getColumns, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query_Builder, from, arginfo_phalcon_mvc_model_query_builder_from, ZEND_ACC_PUBLIC) @@ -287,8 +607,8 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_builder_method_entry) { PHP_ME(Phalcon_Mvc_Model_Query_Builder, getOffset, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query_Builder, groupBy, arginfo_phalcon_mvc_model_query_builder_groupby, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query_Builder, getGroupBy, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query_Builder, getPhql, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Mvc_Model_Query_Builder, getQuery, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query_Builder, getPhql, arginfo_phalcon_mvc_model_query_builder_getphql, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Mvc_Model_Query_Builder, getQuery, arginfo_phalcon_mvc_model_query_builder_getquery, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query_Builder, autoescape, arginfo_phalcon_mvc_model_query_builder_autoescape, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Query_Builder, _conditionBetween, arginfo_phalcon_mvc_model_query_builder__conditionbetween, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_Model_Query_Builder, _conditionNotBetween, arginfo_phalcon_mvc_model_query_builder__conditionnotbetween, ZEND_ACC_PROTECTED) diff --git a/ext/phalcon/mvc/model/query/builderinterface.zep.c b/ext/phalcon/mvc/model/query/builderinterface.zep.c index a450622369c..af11411ef41 100644 --- a/ext/phalcon/mvc/model/query/builderinterface.zep.c +++ b/ext/phalcon/mvc/model/query/builderinterface.zep.c @@ -21,9 +21,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query_BuilderInterface) { ZEPHIR_REGISTER_INTERFACE(Phalcon\\Mvc\\Model\\Query, BuilderInterface, phalcon, mvc_model_query_builderinterface, phalcon_mvc_model_query_builderinterface_method_entry); - zend_declare_class_constant_string(phalcon_mvc_model_query_builderinterface_ce, SL("OPERATOR_OR"), "or" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_mvc_model_query_builderinterface_ce, SL("OPERATOR_OR"), "or"); - zend_declare_class_constant_string(phalcon_mvc_model_query_builderinterface_ce, SL("OPERATOR_AND"), "and" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_mvc_model_query_builderinterface_ce, SL("OPERATOR_AND"), "and"); return SUCCESS; diff --git a/ext/phalcon/mvc/model/query/builderinterface.zep.h b/ext/phalcon/mvc/model/query/builderinterface.zep.h index 9cd421f0cfd..136a862a518 100644 --- a/ext/phalcon/mvc/model/query/builderinterface.zep.h +++ b/ext/phalcon/mvc/model/query/builderinterface.zep.h @@ -17,26 +17,42 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_addfrom, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_join, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_innerjoin, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_leftjoin, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_rightjoin, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, model, IS_STRING, 0) +#else ZEND_ARG_INFO(0, model) +#endif ZEND_ARG_INFO(0, conditions) ZEND_ARG_INFO(0, alias) ZEND_END_ARG_INFO() @@ -48,41 +64,89 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_where, 0 ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_andwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_orwhere, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, conditions, IS_STRING, 0) +#else ZEND_ARG_INFO(0, conditions) +#endif ZEND_ARG_INFO(0, bindParams) ZEND_ARG_INFO(0, bindTypes) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_betweenwhere, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_notbetweenwhere, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_INFO(0, minimum) ZEND_ARG_INFO(0, maximum) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_inwhere, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_inwhere, 0, 2, Phalcon\\Mvc\\Model\\Query\\BuilderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_inwhere, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\BuilderInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_notinwhere, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_notinwhere, 0, 2, Phalcon\\Mvc\\Model\\Query\\BuilderInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_notinwhere, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\BuilderInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, expr, IS_STRING, 0) +#else ZEND_ARG_INFO(0, expr) +#endif ZEND_ARG_ARRAY_INFO(0, values, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, operator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, operator) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_orderby, 0, 0, 1) @@ -94,7 +158,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_having, ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_builderinterface_limit, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, limit, IS_LONG, 0) +#else ZEND_ARG_INFO(0, limit) +#endif ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/query/lang.zep.c b/ext/phalcon/mvc/model/query/lang.zep.c index 9dea7eb3b4b..a96c4a9d602 100644 --- a/ext/phalcon/mvc/model/query/lang.zep.c +++ b/ext/phalcon/mvc/model/query/lang.zep.c @@ -56,24 +56,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Lang, parsePHQL) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *phql_param = NULL; - zval *phql = NULL; + zval phql; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&phql); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &phql_param); if (UNEXPECTED(Z_TYPE_P(phql_param) != IS_STRING && Z_TYPE_P(phql_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'phql' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'phql' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(phql_param) == IS_STRING)) { - zephir_get_strval(phql, phql_param); + zephir_get_strval(&phql, phql_param); } else { - ZEPHIR_INIT_VAR(phql); - ZVAL_EMPTY_STRING(phql); + ZEPHIR_INIT_VAR(&phql); + ZVAL_EMPTY_STRING(&phql); } - ZEPHIR_LAST_CALL_STATUS = phql_parse_phql(return_value, phql TSRMLS_CC); + ZEPHIR_LAST_CALL_STATUS = phql_parse_phql(return_value, &phql TSRMLS_CC); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/mvc/model/query/lang.zep.h b/ext/phalcon/mvc/model/query/lang.zep.h index a005a3e31fd..d8eac9f1533 100644 --- a/ext/phalcon/mvc/model/query/lang.zep.h +++ b/ext/phalcon/mvc/model/query/lang.zep.h @@ -6,7 +6,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query_Lang); PHP_METHOD(Phalcon_Mvc_Model_Query_Lang, parsePHQL); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_lang_parsephql, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, phql, IS_STRING, 0) +#else ZEND_ARG_INFO(0, phql) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_lang_method_entry) { diff --git a/ext/phalcon/mvc/model/query/status.zep.c b/ext/phalcon/mvc/model/query/status.zep.c index 3a5979a5cb4..c8329d4e96c 100644 --- a/ext/phalcon/mvc/model/query/status.zep.c +++ b/ext/phalcon/mvc/model/query/status.zep.c @@ -63,23 +63,30 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query_Status) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Status, __construct) { - zval *success_param = NULL, *model = NULL; + zval *success_param = NULL, *model = NULL, model_sub, __$true, __$false, __$null; zend_bool success; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 1, 1, &success_param, &model); success = zephir_get_boolval(success_param); if (!model) { - model = ZEPHIR_GLOBAL(global_null); + model = &model_sub; + model = &__$null; } if (success) { - zephir_update_property_this(getThis(), SL("_success"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_success"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_success"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_success"), &__$false); } - zephir_update_property_this(getThis(), SL("_model"), model TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_model"), model); } @@ -88,7 +95,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Status, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Status, getModel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_model"); @@ -99,18 +107,21 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Status, getModel) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Status, getMessages) { - zval *model = NULL; + zval model; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(model); - zephir_read_property_this(&model, this_ptr, SL("_model"), PH_NOISY_CC); - if (Z_TYPE_P(model) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&model); + zephir_read_property(&model, this_ptr, SL("_model"), PH_NOISY_CC); + if (Z_TYPE_P(&model) != IS_OBJECT) { array_init(return_value); RETURN_MM(); } - ZEPHIR_RETURN_CALL_METHOD(model, "getmessages", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&model, "getmessages", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -121,7 +132,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Status, getMessages) { */ PHP_METHOD(Phalcon_Mvc_Model_Query_Status, success) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_success"); diff --git a/ext/phalcon/mvc/model/query/status.zep.h b/ext/phalcon/mvc/model/query/status.zep.h index ecbd59023bf..8e74cab88c5 100644 --- a/ext/phalcon/mvc/model/query/status.zep.h +++ b/ext/phalcon/mvc/model/query/status.zep.h @@ -9,14 +9,39 @@ PHP_METHOD(Phalcon_Mvc_Model_Query_Status, getMessages); PHP_METHOD(Phalcon_Mvc_Model_Query_Status, success); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_query_status___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, success, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, success) +#endif ZEND_ARG_OBJ_INFO(0, model, Phalcon\\Mvc\\ModelInterface, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_status_getmodel, 0, 0, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_status_getmodel, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_status_getmessages, 0, 0, Phalcon\\Mvc\\Model\\MessageInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_status_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\MessageInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_status_success, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_status_success, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_status_method_entry) { PHP_ME(Phalcon_Mvc_Model_Query_Status, __construct, arginfo_phalcon_mvc_model_query_status___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Mvc_Model_Query_Status, getModel, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query_Status, getMessages, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Query_Status, success, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query_Status, getModel, arginfo_phalcon_mvc_model_query_status_getmodel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query_Status, getMessages, arginfo_phalcon_mvc_model_query_status_getmessages, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Query_Status, success, arginfo_phalcon_mvc_model_query_status_success, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/query/statusinterface.zep.h b/ext/phalcon/mvc/model/query/statusinterface.zep.h index 818432d55be..4eecc6c4c7a 100644 --- a/ext/phalcon/mvc/model/query/statusinterface.zep.h +++ b/ext/phalcon/mvc/model/query/statusinterface.zep.h @@ -3,9 +3,30 @@ extern zend_class_entry *phalcon_mvc_model_query_statusinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Query_StatusInterface); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_statusinterface_getmodel, 0, 0, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_statusinterface_getmodel, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_query_statusinterface_getmessages, 0, 0, Phalcon\\Mvc\\Model\\MessageInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_statusinterface_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\MessageInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_statusinterface_success, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_query_statusinterface_success, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_query_statusinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Query_StatusInterface, getModel, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Query_StatusInterface, getMessages, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Query_StatusInterface, success, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Query_StatusInterface, getModel, arginfo_phalcon_mvc_model_query_statusinterface_getmodel) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Query_StatusInterface, getMessages, arginfo_phalcon_mvc_model_query_statusinterface_getmessages) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Query_StatusInterface, success, arginfo_phalcon_mvc_model_query_statusinterface_success) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/queryinterface.zep.h b/ext/phalcon/mvc/model/queryinterface.zep.h index 4352e0b24d8..a1595182ae4 100644 --- a/ext/phalcon/mvc/model/queryinterface.zep.h +++ b/ext/phalcon/mvc/model/queryinterface.zep.h @@ -8,7 +8,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface_cache, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface_setuniquerow, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, uniqueRow, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, uniqueRow) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_queryinterface_execute, 0, 0, 0) diff --git a/ext/phalcon/mvc/model/relation.zep.c b/ext/phalcon/mvc/model/relation.zep.c index fa902d3f2e0..0478f4a480a 100644 --- a/ext/phalcon/mvc/model/relation.zep.c +++ b/ext/phalcon/mvc/model/relation.zep.c @@ -45,21 +45,21 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Relation) { zend_declare_property_null(phalcon_mvc_model_relation_ce, SL("_options"), ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("BELONGS_TO"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("BELONGS_TO"), 0); - zend_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("HAS_ONE"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("HAS_ONE"), 1); - zend_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("HAS_MANY"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("HAS_MANY"), 2); - zend_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("HAS_ONE_THROUGH"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("HAS_ONE_THROUGH"), 3); - zend_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("HAS_MANY_THROUGH"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("HAS_MANY_THROUGH"), 4); - zend_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("NO_ACTION"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("NO_ACTION"), 0); - zend_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("ACTION_RESTRICT"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("ACTION_RESTRICT"), 1); - zend_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("ACTION_CASCADE"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_relation_ce, SL("ACTION_CASCADE"), 2); zend_class_implements(phalcon_mvc_model_relation_ce TSRMLS_CC, 1, phalcon_mvc_model_relationinterface_ce); return SUCCESS; @@ -77,32 +77,41 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Relation) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, __construct) { - zval *referencedModel = NULL; - zval *type, *referencedModel_param = NULL, *fields, *referencedFields, *options = NULL; + zval referencedModel; + zval *type, type_sub, *referencedModel_param = NULL, *fields, fields_sub, *referencedFields, referencedFields_sub, *options = NULL, options_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type_sub); + ZVAL_UNDEF(&fields_sub); + ZVAL_UNDEF(&referencedFields_sub); + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&referencedModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &type, &referencedModel_param, &fields, &referencedFields, &options); if (UNEXPECTED(Z_TYPE_P(referencedModel_param) != IS_STRING && Z_TYPE_P(referencedModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'referencedModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(referencedModel_param) == IS_STRING)) { - zephir_get_strval(referencedModel, referencedModel_param); + zephir_get_strval(&referencedModel, referencedModel_param); } else { - ZEPHIR_INIT_VAR(referencedModel); - ZVAL_EMPTY_STRING(referencedModel); + ZEPHIR_INIT_VAR(&referencedModel); + ZVAL_EMPTY_STRING(&referencedModel); } if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } - zephir_update_property_this(getThis(), SL("_type"), type TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_referencedModel"), referencedModel TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_fields"), fields TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_referencedFields"), referencedFields TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_type"), type); + zephir_update_property_zval(this_ptr, SL("_referencedModel"), &referencedModel); + zephir_update_property_zval(this_ptr, SL("_fields"), fields); + zephir_update_property_zval(this_ptr, SL("_referencedFields"), referencedFields); + zephir_update_property_zval(this_ptr, SL("_options"), options); ZEPHIR_MM_RESTORE(); } @@ -116,27 +125,32 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, setIntermediateRelation) { - zval *intermediateModel = NULL; - zval *intermediateFields, *intermediateModel_param = NULL, *intermediateReferencedFields; + zval intermediateModel; + zval *intermediateFields, intermediateFields_sub, *intermediateModel_param = NULL, *intermediateReferencedFields, intermediateReferencedFields_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&intermediateFields_sub); + ZVAL_UNDEF(&intermediateReferencedFields_sub); + ZVAL_UNDEF(&intermediateModel); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &intermediateFields, &intermediateModel_param, &intermediateReferencedFields); if (UNEXPECTED(Z_TYPE_P(intermediateModel_param) != IS_STRING && Z_TYPE_P(intermediateModel_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'intermediateModel' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(intermediateModel_param) == IS_STRING)) { - zephir_get_strval(intermediateModel, intermediateModel_param); + zephir_get_strval(&intermediateModel, intermediateModel_param); } else { - ZEPHIR_INIT_VAR(intermediateModel); - ZVAL_EMPTY_STRING(intermediateModel); + ZEPHIR_INIT_VAR(&intermediateModel); + ZVAL_EMPTY_STRING(&intermediateModel); } - zephir_update_property_this(getThis(), SL("_intermediateFields"), intermediateFields TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_intermediateModel"), intermediateModel TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_intermediateReferencedFields"), intermediateReferencedFields TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_intermediateFields"), intermediateFields); + zephir_update_property_zval(this_ptr, SL("_intermediateModel"), &intermediateModel); + zephir_update_property_zval(this_ptr, SL("_intermediateReferencedFields"), intermediateReferencedFields); ZEPHIR_MM_RESTORE(); } @@ -146,7 +160,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, setIntermediateRelation) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getType) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_type"); @@ -157,7 +172,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getType) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getReferencedModel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_referencedModel"); @@ -170,7 +186,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getReferencedModel) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getFields) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_fields"); @@ -183,7 +200,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getFields) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getReferencedFields) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_referencedFields"); @@ -196,7 +214,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getReferencedFields) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -208,27 +227,32 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getOptions) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getOption) { - zval *name_param = NULL, *option = NULL, *_0; - zval *name = NULL; + zval *name_param = NULL, option, _0; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&option); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&option, _0, name, 1 TSRMLS_CC)) { - RETURN_CTOR(option); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&option, &_0, &name, 1 TSRMLS_CC)) { + RETURN_CTOR(&option); } RETURN_MM_NULL(); @@ -239,11 +263,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getOption) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, isForeignKey) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - RETURN_BOOL(zephir_array_isset_string(_0, SS("foreignKey"))); + + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_array_isset_string(&_0, SL("foreignKey"))); } @@ -254,14 +281,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, isForeignKey) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getForeignKey) { - zval *options = NULL, *foreignKey = NULL; + zval options, foreignKey; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&foreignKey); - options = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&foreignKey, options, SS("foreignKey"), 1 TSRMLS_CC)) { - if (zephir_is_true(foreignKey)) { - RETURN_CTORW(foreignKey); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&foreignKey, &options, SL("foreignKey"), 1)) { + if (zephir_is_true(&foreignKey)) { + RETURN_CTORW(&foreignKey); } } } @@ -276,14 +307,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getForeignKey) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getParams) { - zval *options = NULL, *params = NULL; + zval options, params; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(¶ms); - options = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(¶ms, options, SS("params"), 1 TSRMLS_CC)) { - if (zephir_is_true(params)) { - RETURN_CTORW(params); + + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(¶ms, &options, SL("params"), 1)) { + if (zephir_is_true(¶ms)) { + RETURN_CTORW(¶ms); } } } @@ -297,13 +332,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getParams) { PHP_METHOD(Phalcon_Mvc_Model_Relation, isThrough) { zend_bool _0; - zval *type = NULL; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); - type = zephir_fetch_nproperty_this(this_ptr, SL("_type"), PH_NOISY_CC); - _0 = ZEPHIR_IS_LONG(type, 3); + zephir_read_property(&type, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY); + _0 = ZEPHIR_IS_LONG(&type, 3); if (!(_0)) { - _0 = ZEPHIR_IS_LONG(type, 4); + _0 = ZEPHIR_IS_LONG(&type, 4); } RETURN_BOOL(_0); @@ -314,13 +352,17 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, isThrough) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, isReusable) { - zval *options = NULL, *reusable = NULL; + zval options, reusable; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&reusable); - options = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string_fetch(&reusable, options, SS("reusable"), 1 TSRMLS_CC)) { - RETURN_CTORW(reusable); + + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string_fetch(&reusable, &options, SL("reusable"), 1)) { + RETURN_CTORW(&reusable); } } RETURN_BOOL(0); @@ -334,7 +376,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, isReusable) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getIntermediateFields) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_intermediateFields"); @@ -345,7 +388,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getIntermediateFields) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getIntermediateModel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_intermediateModel"); @@ -358,7 +402,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getIntermediateModel) { */ PHP_METHOD(Phalcon_Mvc_Model_Relation, getIntermediateReferencedFields) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_intermediateReferencedFields"); diff --git a/ext/phalcon/mvc/model/relation.zep.h b/ext/phalcon/mvc/model/relation.zep.h index 1b617f7f47c..1ceae749d34 100644 --- a/ext/phalcon/mvc/model/relation.zep.h +++ b/ext/phalcon/mvc/model/relation.zep.h @@ -22,7 +22,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Relation, getIntermediateReferencedFields); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_relation___construct, 0, 0, 4) ZEND_ARG_INFO(0, type) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, referencedModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, referencedModel) +#endif ZEND_ARG_INFO(0, fields) ZEND_ARG_INFO(0, referencedFields) ZEND_ARG_INFO(0, options) @@ -30,30 +34,80 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_relation_setintermediaterelation, 0, 0, 3) ZEND_ARG_INFO(0, intermediateFields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, intermediateModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, intermediateModel) +#endif ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_gettype, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_gettype, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_getreferencedmodel, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_getreferencedmodel, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_relation_getoption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_isforeignkey, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_isforeignkey, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_isthrough, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_isthrough, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_isreusable, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_isreusable, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_getintermediatemodel, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relation_getintermediatemodel, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_relation_method_entry) { PHP_ME(Phalcon_Mvc_Model_Relation, __construct, arginfo_phalcon_mvc_model_relation___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Relation, setIntermediateRelation, arginfo_phalcon_mvc_model_relation_setintermediaterelation, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Relation, getType, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Relation, getReferencedModel, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Relation, getType, arginfo_phalcon_mvc_model_relation_gettype, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Relation, getReferencedModel, arginfo_phalcon_mvc_model_relation_getreferencedmodel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Relation, getFields, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Relation, getReferencedFields, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Relation, getOptions, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Relation, getOption, arginfo_phalcon_mvc_model_relation_getoption, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Relation, isForeignKey, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Relation, isForeignKey, arginfo_phalcon_mvc_model_relation_isforeignkey, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Relation, getForeignKey, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Relation, getParams, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Relation, isThrough, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Relation, isReusable, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Relation, isThrough, arginfo_phalcon_mvc_model_relation_isthrough, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Relation, isReusable, arginfo_phalcon_mvc_model_relation_isreusable, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Relation, getIntermediateFields, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Relation, getIntermediateModel, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Relation, getIntermediateModel, arginfo_phalcon_mvc_model_relation_getintermediatemodel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Relation, getIntermediateReferencedFields, NULL, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/relationinterface.zep.h b/ext/phalcon/mvc/model/relationinterface.zep.h index b003258a577..cc3e285d255 100644 --- a/ext/phalcon/mvc/model/relationinterface.zep.h +++ b/ext/phalcon/mvc/model/relationinterface.zep.h @@ -5,28 +5,78 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_RelationInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_setintermediaterelation, 0, 0, 3) ZEND_ARG_INFO(0, intermediateFields) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, intermediateModel, IS_STRING, 0) +#else ZEND_ARG_INFO(0, intermediateModel) +#endif ZEND_ARG_INFO(0, intermediateReferencedFields) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_isreusable, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_isreusable, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_gettype, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_gettype, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_getreferencedmodel, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_getreferencedmodel, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_getoption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_isforeignkey, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_isforeignkey, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_isthrough, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_isthrough, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_getintermediatemodel, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_relationinterface_getintermediatemodel, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_relationinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, setIntermediateRelation, arginfo_phalcon_mvc_model_relationinterface_setintermediaterelation) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, isReusable, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getType, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getReferencedModel, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, isReusable, arginfo_phalcon_mvc_model_relationinterface_isreusable) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getType, arginfo_phalcon_mvc_model_relationinterface_gettype) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getReferencedModel, arginfo_phalcon_mvc_model_relationinterface_getreferencedmodel) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getFields, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getReferencedFields, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getOptions, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getOption, arginfo_phalcon_mvc_model_relationinterface_getoption) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, isForeignKey, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, isForeignKey, arginfo_phalcon_mvc_model_relationinterface_isforeignkey) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getForeignKey, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, isThrough, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, isThrough, arginfo_phalcon_mvc_model_relationinterface_isthrough) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getIntermediateFields, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getIntermediateModel, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getIntermediateModel, arginfo_phalcon_mvc_model_relationinterface_getintermediatemodel) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_RelationInterface, getIntermediateReferencedFields, NULL) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/resultinterface.zep.h b/ext/phalcon/mvc/model/resultinterface.zep.h index 1f7d4a44c3a..f0bb0406bf9 100644 --- a/ext/phalcon/mvc/model/resultinterface.zep.h +++ b/ext/phalcon/mvc/model/resultinterface.zep.h @@ -4,7 +4,11 @@ extern zend_class_entry *phalcon_mvc_model_resultinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_ResultInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultinterface_setdirtystate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_resultinterface_method_entry) { diff --git a/ext/phalcon/mvc/model/resultset.zep.c b/ext/phalcon/mvc/model/resultset.zep.c index ad79640a3d3..59e325d4fdd 100644 --- a/ext/phalcon/mvc/model/resultset.zep.c +++ b/ext/phalcon/mvc/model/resultset.zep.c @@ -89,15 +89,15 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Resultset) { zend_declare_property_long(phalcon_mvc_model_resultset_ce, SL("_hydrateMode"), 0, ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("TYPE_RESULT_FULL"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("TYPE_RESULT_FULL"), 0); - zend_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("TYPE_RESULT_PARTIAL"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("TYPE_RESULT_PARTIAL"), 1); - zend_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("HYDRATE_RECORDS"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("HYDRATE_RECORDS"), 0); - zend_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("HYDRATE_OBJECTS"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("HYDRATE_OBJECTS"), 2); - zend_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("HYDRATE_ARRAYS"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_resultset_ce, SL("HYDRATE_ARRAYS"), 1); zend_class_implements(phalcon_mvc_model_resultset_ce TSRMLS_CC, 1, phalcon_mvc_model_resultsetinterface_ce); zend_class_implements(phalcon_mvc_model_resultset_ce TSRMLS_CC, 1, zend_ce_iterator); @@ -105,7 +105,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Resultset) { zend_class_implements(phalcon_mvc_model_resultset_ce TSRMLS_CC, 1, spl_ce_Countable); zend_class_implements(phalcon_mvc_model_resultset_ce TSRMLS_CC, 1, zend_ce_arrayaccess); zend_class_implements(phalcon_mvc_model_resultset_ce TSRMLS_CC, 1, zend_ce_serializable); - zend_class_implements(phalcon_mvc_model_resultset_ce TSRMLS_CC, 1, zephir_get_internal_ce(SS("jsonserializable") TSRMLS_CC)); + zend_class_implements(phalcon_mvc_model_resultset_ce TSRMLS_CC, 1, zephir_get_internal_ce(SL("jsonserializable"))); return SUCCESS; } @@ -119,51 +119,63 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Resultset) { PHP_METHOD(Phalcon_Mvc_Model_Resultset, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *result, *cache = NULL, *rowCount = NULL, *rows = NULL, *_2, *_0$$3, *_1$$3, *_3$$5, *_4$$8; + zval *result, result_sub, *cache = NULL, cache_sub, __$null, rowCount, rows, _2, _0$$3, _1$$3, _3$$5, _4$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&result_sub); + ZVAL_UNDEF(&cache_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&rowCount); + ZVAL_UNDEF(&rows); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &result, &cache); if (!cache) { - cache = ZEPHIR_GLOBAL(global_null); + cache = &cache_sub; + cache = &__$null; } if (Z_TYPE_P(result) != IS_OBJECT) { ZEPHIR_INIT_ZVAL_NREF(_0$$3); - ZVAL_LONG(_0$$3, 0); - zephir_update_property_this(getThis(), SL("_count"), _0$$3 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_rows"), _1$$3 TSRMLS_CC); + ZVAL_LONG(&_0$$3, 0); + zephir_update_property_zval(this_ptr, SL("_count"), &_0$$3); + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_rows"), &_1$$3); RETURN_MM_NULL(); } - zephir_update_property_this(getThis(), SL("_result"), result TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_result"), result); if (Z_TYPE_P(cache) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_cache"), cache TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), cache); } - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, 2); - ZEPHIR_CALL_METHOD(NULL, result, "setfetchmode", NULL, 0, _2); + ZVAL_LONG(&_2, 2); + ZEPHIR_CALL_METHOD(NULL, result, "setfetchmode", NULL, 0, &_2); zephir_check_call_status(); ZEPHIR_CALL_METHOD(&rowCount, result, "numrows", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_count"), rowCount TSRMLS_CC); - if (ZEPHIR_IS_LONG(rowCount, 0)) { - ZEPHIR_INIT_VAR(_3$$5); - array_init(_3$$5); - zephir_update_property_this(getThis(), SL("_rows"), _3$$5 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_count"), &rowCount); + if (ZEPHIR_IS_LONG(&rowCount, 0)) { + ZEPHIR_INIT_VAR(&_3$$5); + array_init(&_3$$5); + zephir_update_property_zval(this_ptr, SL("_rows"), &_3$$5); RETURN_MM_NULL(); } - if (ZEPHIR_LE_LONG(rowCount, 32)) { + if (ZEPHIR_LE_LONG(&rowCount, 32)) { ZEPHIR_CALL_METHOD(&rows, result, "fetchall", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(rows) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_rows"), rows TSRMLS_CC); + if (Z_TYPE_P(&rows) == IS_ARRAY) { + zephir_update_property_zval(this_ptr, SL("_rows"), &rows); } else { - ZEPHIR_INIT_VAR(_4$$8); - array_init(_4$$8); - zephir_update_property_this(getThis(), SL("_rows"), _4$$8 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$8); + array_init(&_4$$8); + zephir_update_property_zval(this_ptr, SL("_rows"), &_4$$8); } } ZEPHIR_MM_RESTORE(); @@ -175,15 +187,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, next) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, (zephir_get_numberval(_0) + 1)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 79, _1); + zephir_read_property(&_0, this_ptr, SL("_pointer"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_1, (zephir_get_numberval(&_0) + 1)); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 72, &_1); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -194,12 +209,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, next) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, valid) { - zval *_0, *_1; + zval _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_count"), PH_NOISY_CC); - RETURN_BOOL(ZEPHIR_LT(_0, _1)); + zephir_read_property(&_0, this_ptr, SL("_pointer"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_count"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(ZEPHIR_LT(&_0, &_1)); } @@ -208,12 +227,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, valid) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, key) { - zval *_0, *_1; + zval _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_count"), PH_NOISY_CC); - if (ZEPHIR_GE(_0, _1)) { + zephir_read_property(&_0, this_ptr, SL("_pointer"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_count"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_GE(&_0, &_1)) { RETURN_NULL(); } RETURN_MEMBER(getThis(), "_pointer"); @@ -225,14 +248,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, key) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, rewind) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 79, _0); + ZVAL_LONG(&_0, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 72, &_0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -247,66 +272,83 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, seek) { zend_bool _1, _6$$3; zephir_fcall_cache_entry *_13 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *position, *result = NULL, *row = NULL, *_0, *_2, *_3$$3, *_5$$3, *_7$$3, *_9$$3, *_11$$3, *_4$$4, *_8$$6 = NULL, *_10$$7 = NULL, *_12$$8 = NULL; + zval *position, position_sub, __$null, result, row, _0, _2, _3$$3, _5$$3, _7$$3, _9$$3, _11$$3, _4$$4, _8$$6, _10$$7, _12$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&row); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_7$$3); + ZVAL_UNDEF(&_9$$3); + ZVAL_UNDEF(&_11$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_12$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &position); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC); - _1 = !ZEPHIR_IS_EQUAL(_0, position); + zephir_read_property(&_0, this_ptr, SL("_pointer"), PH_NOISY_CC | PH_READONLY); + _1 = !ZEPHIR_IS_EQUAL(&_0, position); if (!(_1)) { - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_row"), PH_NOISY_CC); - _1 = Z_TYPE_P(_2) == IS_NULL; + zephir_read_property(&_2, this_ptr, SL("_row"), PH_NOISY_CC | PH_READONLY); + _1 = Z_TYPE_P(&_2) == IS_NULL; } if (_1) { - ZEPHIR_OBS_VAR(_3$$3); - zephir_read_property_this(&_3$$3, this_ptr, SL("_rows"), PH_NOISY_CC); - if (Z_TYPE_P(_3$$3) == IS_ARRAY) { - ZEPHIR_OBS_VAR(row); - _4$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_rows"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&row, _4$$4, position, 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_row"), row TSRMLS_CC); + ZEPHIR_OBS_VAR(&_3$$3); + zephir_read_property(&_3$$3, this_ptr, SL("_rows"), PH_NOISY_CC); + if (Z_TYPE_P(&_3$$3) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&row); + zephir_read_property(&_4$$4, this_ptr, SL("_rows"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&row, &_4$$4, position, 0 TSRMLS_CC)) { + zephir_update_property_zval(this_ptr, SL("_row"), &row); } - zephir_update_property_this(getThis(), SL("_pointer"), position TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_activeRow"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_pointer"), position); + zephir_update_property_zval(this_ptr, SL("_activeRow"), &__$null); RETURN_MM_NULL(); } - ZEPHIR_OBS_VAR(result); - zephir_read_property_this(&result, this_ptr, SL("_result"), PH_NOISY_CC); - _5$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_row"), PH_NOISY_CC); - _6$$3 = Z_TYPE_P(_5$$3) == IS_NULL; + ZEPHIR_OBS_VAR(&result); + zephir_read_property(&result, this_ptr, SL("_result"), PH_NOISY_CC); + zephir_read_property(&_5$$3, this_ptr, SL("_row"), PH_NOISY_CC | PH_READONLY); + _6$$3 = Z_TYPE_P(&_5$$3) == IS_NULL; if (_6$$3) { - _7$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC); - _6$$3 = ZEPHIR_IS_LONG_IDENTICAL(_7$$3, 0); + zephir_read_property(&_7$$3, this_ptr, SL("_pointer"), PH_NOISY_CC | PH_READONLY); + _6$$3 = ZEPHIR_IS_LONG_IDENTICAL(&_7$$3, 0); } if (_6$$3) { - ZEPHIR_CALL_METHOD(&_8$$6, result, "fetch", NULL, 0); + ZEPHIR_CALL_METHOD(&_8$$6, &result, "fetch", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_row"), _8$$6 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_row"), &_8$$6); } - _9$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC); - if (ZEPHIR_GT(_9$$3, position)) { - ZEPHIR_CALL_METHOD(NULL, result, "dataseek", NULL, 0, position); + zephir_read_property(&_9$$3, this_ptr, SL("_pointer"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_GT(&_9$$3, position)) { + ZEPHIR_CALL_METHOD(NULL, &result, "dataseek", NULL, 0, position); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_10$$7, result, "fetch", NULL, 0); + ZEPHIR_CALL_METHOD(&_10$$7, &result, "fetch", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_row"), _10$$7 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_pointer"), position TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_row"), &_10$$7); + zephir_update_property_zval(this_ptr, SL("_pointer"), position); } while (1) { - _11$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_pointer"), PH_NOISY_CC); - if (!(ZEPHIR_LT(_11$$3, position))) { + zephir_read_property(&_11$$3, this_ptr, SL("_pointer"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_LT(&_11$$3, position))) { break; } - ZEPHIR_CALL_METHOD(&_12$$8, result, "fetch", &_13, 0); + ZEPHIR_CALL_METHOD(&_12$$8, &result, "fetch", &_13, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_row"), _12$$8 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_row"), &_12$$8); RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_pointer") TSRMLS_CC)); } - zephir_update_property_this(getThis(), SL("_pointer"), position TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_activeRow"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_pointer"), position); + zephir_update_property_zval(this_ptr, SL("_activeRow"), &__$null); } ZEPHIR_MM_RESTORE(); @@ -317,7 +359,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, seek) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, count) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_count"); @@ -328,14 +371,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, count) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetExists) { - zval *index, *_0; + zval *index, index_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &index); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_count"), PH_NOISY_CC); - RETURN_BOOL(ZEPHIR_LT(index, _0)); + zephir_read_property(&_0, this_ptr, SL("_count"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(ZEPHIR_LT(index, &_0)); } @@ -345,16 +392,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetExists) { PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetGet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index, *_0; + zval *index, index_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_count"), PH_NOISY_CC); - if (ZEPHIR_LT(index, _0)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 79, index); + zephir_read_property(&_0, this_ptr, SL("_count"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_LT(index, &_0)) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 72, index); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0); zephir_check_call_status(); @@ -373,7 +424,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetGet) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetSet) { - zval *index, *value; + zval *index, index_sub, *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&value_sub); zephir_fetch_params(0, 2, 0, &index, &value); @@ -389,7 +444,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetSet) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetUnset) { - zval *offset; + zval *offset, offset_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&offset_sub); zephir_fetch_params(0, 1, 0, &offset); @@ -405,19 +463,23 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetUnset) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getType) { - zval *_0, *_1; + zval _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_OBS_VAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_rows"), PH_NOISY_CC); - if (Z_TYPE_P(_1) == IS_ARRAY) { - ZVAL_LONG(_0, 0); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_rows"), PH_NOISY_CC); + if (Z_TYPE_P(&_1) == IS_ARRAY) { + ZVAL_LONG(&_0, 0); } else { - ZVAL_LONG(_0, 1); + ZVAL_LONG(&_0, 1); } - RETURN_CCTOR(_0); + RETURN_CCTOR(&_0); } @@ -426,18 +488,21 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getType) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getFirst) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_count"), PH_NOISY_CC); - if (ZEPHIR_IS_LONG(_0, 0)) { + zephir_read_property(&_0, this_ptr, SL("_count"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_LONG(&_0, 0)) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 79, _1); + ZVAL_LONG(&_1, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 72, &_1); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0); zephir_check_call_status(); @@ -450,19 +515,22 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getFirst) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getLast) { - zval *count = NULL, *_0; + zval count, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&count); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(count); - zephir_read_property_this(&count, this_ptr, SL("_count"), PH_NOISY_CC); - if (ZEPHIR_IS_LONG(count, 0)) { + ZEPHIR_OBS_VAR(&count); + zephir_read_property(&count, this_ptr, SL("_count"), PH_NOISY_CC); + if (ZEPHIR_IS_LONG(&count, 0)) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, (zephir_get_numberval(count) - 1)); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 79, _0); + ZVAL_LONG(&_0, (zephir_get_numberval(&count) - 1)); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "seek", NULL, 72, &_0); zephir_check_call_status(); ZEPHIR_RETURN_CALL_METHOD(this_ptr, "current", NULL, 0); zephir_check_call_status(); @@ -475,8 +543,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getLast) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, setIsFresh) { - zval *isFresh_param = NULL; + zval *isFresh_param = NULL, __$true, __$false; zend_bool isFresh; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &isFresh_param); @@ -484,9 +556,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, setIsFresh) { if (isFresh) { - zephir_update_property_this(getThis(), SL("_isFresh"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isFresh"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_isFresh"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isFresh"), &__$false); } RETURN_THISW(); @@ -497,7 +569,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, setIsFresh) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, isFresh) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_isFresh"); @@ -508,8 +581,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, isFresh) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, setHydrateMode) { - zval *hydrateMode_param = NULL, *_0; + zval *hydrateMode_param = NULL, _0; zend_long hydrateMode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &hydrateMode_param); @@ -517,8 +593,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, setHydrateMode) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, hydrateMode); - zephir_update_property_this(getThis(), SL("_hydrateMode"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, hydrateMode); + zephir_update_property_zval(this_ptr, SL("_hydrateMode"), &_0); RETURN_THISW(); } @@ -528,7 +604,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, setHydrateMode) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getHydrateMode) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_hydrateMode"); @@ -539,7 +616,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getHydrateMode) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getCache) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_cache"); @@ -550,7 +628,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getCache) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getMessages) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_errorMessages"); @@ -565,64 +644,77 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, getMessages) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, update) { - zval *_4$$6 = NULL; + zval _4$$6; zend_bool transaction = 0; zephir_fcall_cache_entry *_1 = NULL, *_2 = NULL, *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, *conditionCallback = NULL, *record = NULL, *connection = NULL, *_0 = NULL, *_3$$6 = NULL, *_6$$3 = NULL, *_7$$8 = NULL; + zval *data, data_sub, *conditionCallback = NULL, conditionCallback_sub, __$null, record, connection, _0, _3$$6, _6$$3, _7$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&conditionCallback_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&record); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &data, &conditionCallback); if (!conditionCallback) { - conditionCallback = ZEPHIR_GLOBAL(global_null); + conditionCallback = &conditionCallback_sub; + conditionCallback = &__$null; } - ZEPHIR_INIT_VAR(connection); - ZVAL_NULL(connection); + ZEPHIR_INIT_VAR(&connection); + ZVAL_NULL(&connection); transaction = 0; - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 80); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 73); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { break; } ZEPHIR_CALL_METHOD(&record, this_ptr, "current", &_2, 0); zephir_check_call_status(); if (transaction == 0) { - if (!((zephir_method_exists_ex(record, SS("getwriteconnection") TSRMLS_CC) == SUCCESS))) { + if (!((zephir_method_exists_ex(&record, SL("getwriteconnection") TSRMLS_CC) == SUCCESS))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/mvc/model/resultset.zep", 434); return; } - ZEPHIR_CALL_METHOD(&connection, record, "getwriteconnection", NULL, 0); + ZEPHIR_CALL_METHOD(&connection, &record, "getwriteconnection", NULL, 0); zephir_check_call_status(); transaction = 1; - ZEPHIR_CALL_METHOD(NULL, connection, "begin", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "begin", NULL, 0); zephir_check_call_status(); } if (Z_TYPE_P(conditionCallback) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_3$$6); - ZEPHIR_INIT_NVAR(_4$$6); - zephir_create_array(_4$$6, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_4$$6, record); - ZEPHIR_CALL_USER_FUNC_ARRAY(_3$$6, conditionCallback, _4$$6); + ZEPHIR_INIT_NVAR(&_3$$6); + ZEPHIR_INIT_NVAR(&_4$$6); + zephir_create_array(&_4$$6, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_4$$6, &record); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_3$$6, conditionCallback, &_4$$6); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_3$$6)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_3$$6)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_5, 0); zephir_check_call_status(); continue; } } - ZEPHIR_CALL_METHOD(&_6$$3, record, "save", NULL, 0, data); + ZEPHIR_CALL_METHOD(&_6$$3, &record, "save", NULL, 0, data); zephir_check_call_status(); - if (!(zephir_is_true(_6$$3))) { - ZEPHIR_CALL_METHOD(&_7$$8, record, "getmessages", NULL, 0); + if (!(zephir_is_true(&_6$$3))) { + ZEPHIR_CALL_METHOD(&_7$$8, &record, "getmessages", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_errorMessages"), _7$$8 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_7$$8); + ZEPHIR_CALL_METHOD(NULL, &connection, "rollback", NULL, 0); zephir_check_call_status(); transaction = 0; break; @@ -631,7 +723,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, update) { zephir_check_call_status(); } if (transaction == 1) { - ZEPHIR_CALL_METHOD(NULL, connection, "commit", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "commit", NULL, 0); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -643,65 +735,77 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, update) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset, delete) { - zval *_4$$6 = NULL; + zval _4$$6; zend_bool result = 0, transaction = 0; zephir_fcall_cache_entry *_1 = NULL, *_2 = NULL, *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *conditionCallback = NULL, *record = NULL, *connection = NULL, *_0 = NULL, *_3$$6 = NULL, *_6$$3 = NULL, *_7$$8 = NULL; + zval *conditionCallback = NULL, conditionCallback_sub, __$null, record, connection, _0, _3$$6, _6$$3, _7$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&conditionCallback_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&record); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &conditionCallback); if (!conditionCallback) { - conditionCallback = ZEPHIR_GLOBAL(global_null); + conditionCallback = &conditionCallback_sub; + conditionCallback = &__$null; } - ZEPHIR_INIT_VAR(connection); - ZVAL_NULL(connection); + ZEPHIR_INIT_VAR(&connection); + ZVAL_NULL(&connection); result = 1; transaction = 0; - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 80); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 73); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { break; } ZEPHIR_CALL_METHOD(&record, this_ptr, "current", &_2, 0); zephir_check_call_status(); if (transaction == 0) { - if (!((zephir_method_exists_ex(record, SS("getwriteconnection") TSRMLS_CC) == SUCCESS))) { + if (!((zephir_method_exists_ex(&record, SL("getwriteconnection") TSRMLS_CC) == SUCCESS))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The returned record is not valid", "phalcon/mvc/model/resultset.zep", 507); return; } - ZEPHIR_CALL_METHOD(&connection, record, "getwriteconnection", NULL, 0); + ZEPHIR_CALL_METHOD(&connection, &record, "getwriteconnection", NULL, 0); zephir_check_call_status(); transaction = 1; - ZEPHIR_CALL_METHOD(NULL, connection, "begin", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "begin", NULL, 0); zephir_check_call_status(); } if (Z_TYPE_P(conditionCallback) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_3$$6); - ZEPHIR_INIT_NVAR(_4$$6); - zephir_create_array(_4$$6, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_4$$6, record); - ZEPHIR_CALL_USER_FUNC_ARRAY(_3$$6, conditionCallback, _4$$6); + ZEPHIR_INIT_NVAR(&_3$$6); + ZEPHIR_INIT_NVAR(&_4$$6); + zephir_create_array(&_4$$6, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_4$$6, &record); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_3$$6, conditionCallback, &_4$$6); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_3$$6)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_3$$6)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_5, 0); zephir_check_call_status(); continue; } } - ZEPHIR_CALL_METHOD(&_6$$3, record, "delete", NULL, 0); + ZEPHIR_CALL_METHOD(&_6$$3, &record, "delete", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_6$$3))) { - ZEPHIR_CALL_METHOD(&_7$$8, record, "getmessages", NULL, 0); + if (!(zephir_is_true(&_6$$3))) { + ZEPHIR_CALL_METHOD(&_7$$8, &record, "getmessages", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_errorMessages"), _7$$8 TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", NULL, 0); + zephir_update_property_zval(this_ptr, SL("_errorMessages"), &_7$$8); + ZEPHIR_CALL_METHOD(NULL, &connection, "rollback", NULL, 0); zephir_check_call_status(); result = 0; transaction = 0; @@ -711,7 +815,7 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, delete) { zephir_check_call_status(); } if (transaction == 1) { - ZEPHIR_CALL_METHOD(NULL, connection, "commit", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "commit", NULL, 0); zephir_check_call_status(); } RETURN_MM_BOOL(result); @@ -739,45 +843,53 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, filter) { zend_bool _3$$3; zephir_fcall_cache_entry *_1 = NULL, *_2 = NULL, *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *filter, *records = NULL, *record = NULL, *parameters = NULL, *processedRecord = NULL, *_0 = NULL; + zval *filter, filter_sub, records, record, parameters, processedRecord, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filter_sub); + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&record); + ZVAL_UNDEF(¶meters); + ZVAL_UNDEF(&processedRecord); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &filter); - ZEPHIR_INIT_VAR(records); - array_init(records); - ZEPHIR_INIT_VAR(parameters); - array_init(parameters); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 80); + ZEPHIR_INIT_VAR(&records); + array_init(&records); + ZEPHIR_INIT_VAR(¶meters); + array_init(¶meters); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 73); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { break; } ZEPHIR_CALL_METHOD(&record, this_ptr, "current", &_2, 0); zephir_check_call_status(); zephir_array_update_long(¶meters, 0, &record, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - ZEPHIR_INIT_NVAR(processedRecord); - ZEPHIR_CALL_USER_FUNC_ARRAY(processedRecord, filter, parameters); + ZEPHIR_INIT_NVAR(&processedRecord); + ZEPHIR_CALL_USER_FUNC_ARRAY(&processedRecord, filter, ¶meters); zephir_check_call_status(); - _3$$3 = Z_TYPE_P(processedRecord) != IS_OBJECT; + _3$$3 = Z_TYPE_P(&processedRecord) != IS_OBJECT; if (_3$$3) { - _3$$3 = Z_TYPE_P(processedRecord) != IS_ARRAY; + _3$$3 = Z_TYPE_P(&processedRecord) != IS_ARRAY; } if (_3$$3) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_4, 0); zephir_check_call_status(); continue; } - zephir_array_append(&records, processedRecord, PH_SEPARATE, "phalcon/mvc/model/resultset.zep", 598); + zephir_array_append(&records, &processedRecord, PH_SEPARATE, "phalcon/mvc/model/resultset.zep", 598); ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_4, 0); zephir_check_call_status(); } - RETURN_CCTOR(records); + RETURN_CCTOR(&records); } @@ -795,39 +907,45 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset, filter) { PHP_METHOD(Phalcon_Mvc_Model_Resultset, jsonSerialize) { zend_bool _3$$3; - zval *records = NULL, *current = NULL, *_0 = NULL, *_4$$4 = NULL; + zval records, current, _0, _4$$4; zephir_fcall_cache_entry *_1 = NULL, *_2 = NULL, *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&records); + ZVAL_UNDEF(¤t); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(records); - array_init(records); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 80); + ZEPHIR_INIT_VAR(&records); + array_init(&records); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 73); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { break; } ZEPHIR_CALL_METHOD(¤t, this_ptr, "current", &_2, 0); zephir_check_call_status(); - _3$$3 = Z_TYPE_P(current) == IS_OBJECT; + _3$$3 = Z_TYPE_P(¤t) == IS_OBJECT; if (_3$$3) { - _3$$3 = (zephir_method_exists_ex(current, SS("jsonserialize") TSRMLS_CC) == SUCCESS); + _3$$3 = (zephir_method_exists_ex(¤t, SL("jsonserialize") TSRMLS_CC) == SUCCESS); } if (_3$$3) { - ZEPHIR_CALL_METHOD(&_4$$4, current, "jsonserialize", NULL, 0); + ZEPHIR_CALL_METHOD(&_4$$4, ¤t, "jsonserialize", NULL, 0); zephir_check_call_status(); - zephir_array_append(&records, _4$$4, PH_SEPARATE, "phalcon/mvc/model/resultset.zep", 627); + zephir_array_append(&records, &_4$$4, PH_SEPARATE, "phalcon/mvc/model/resultset.zep", 627); } else { - zephir_array_append(&records, current, PH_SEPARATE, "phalcon/mvc/model/resultset.zep", 629); + zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/mvc/model/resultset.zep", 629); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_5, 0); zephir_check_call_status(); } - RETURN_CCTOR(records); + RETURN_CCTOR(&records); } diff --git a/ext/phalcon/mvc/model/resultset.zep.h b/ext/phalcon/mvc/model/resultset.zep.h index fc4c93f3b15..6ad7fc4c42e 100644 --- a/ext/phalcon/mvc/model/resultset.zep.h +++ b/ext/phalcon/mvc/model/resultset.zep.h @@ -33,11 +33,36 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset___construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, cache, Phalcon\\Cache\\BackendInterface, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_valid, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_valid, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_key, 0, 0, IS_LONG, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_key, 0, 0, IS_LONG, NULL, 1) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_seek, 0, 0, 1) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_count, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetexists, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() @@ -54,51 +79,121 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_offsetunset, 0, 0, 1) ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_setisfresh, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_gettype, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_gettype, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultset_setisfresh, 0, 1, Phalcon\\Mvc\\Model\\Resultset, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_setisfresh, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Resultset", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, isFresh, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, isFresh) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_isfresh, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_isfresh, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_sethydratemode, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultset_sethydratemode, 0, 1, Phalcon\\Mvc\\Model\\Resultset, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_sethydratemode, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Resultset", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, hydrateMode, IS_LONG, 0) +#else ZEND_ARG_INFO(0, hydrateMode) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_gethydratemode, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_gethydratemode, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultset_getcache, 0, 0, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_getcache, 0, 0, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_update, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_resultset_getmessages, 0, 0, Phalcon\\Mvc\\Model\\MessageInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\MessageInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_update, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_update, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, data) ZEND_ARG_OBJ_INFO(0, conditionCallback, Closure, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_delete, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_delete, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_delete, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, conditionCallback, Closure, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_filter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_filter, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_filter, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, filter) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_jsonserialize, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_jsonserialize, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_resultset_method_entry) { PHP_ME(Phalcon_Mvc_Model_Resultset, __construct, arginfo_phalcon_mvc_model_resultset___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Resultset, next, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset, valid, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset, key, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset, valid, arginfo_phalcon_mvc_model_resultset_valid, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset, key, arginfo_phalcon_mvc_model_resultset_key, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, rewind, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Resultset, seek, arginfo_phalcon_mvc_model_resultset_seek, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Mvc_Model_Resultset, count, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Mvc_Model_Resultset, count, arginfo_phalcon_mvc_model_resultset_count, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Resultset, offsetExists, arginfo_phalcon_mvc_model_resultset_offsetexists, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, offsetGet, arginfo_phalcon_mvc_model_resultset_offsetget, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, offsetSet, arginfo_phalcon_mvc_model_resultset_offsetset, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, offsetUnset, arginfo_phalcon_mvc_model_resultset_offsetunset, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset, getType, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset, getType, arginfo_phalcon_mvc_model_resultset_gettype, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, getFirst, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, getLast, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, setIsFresh, arginfo_phalcon_mvc_model_resultset_setisfresh, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset, isFresh, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset, isFresh, arginfo_phalcon_mvc_model_resultset_isfresh, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, setHydrateMode, arginfo_phalcon_mvc_model_resultset_sethydratemode, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset, getHydrateMode, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset, getCache, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset, getMessages, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset, getHydrateMode, arginfo_phalcon_mvc_model_resultset_gethydratemode, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset, getCache, arginfo_phalcon_mvc_model_resultset_getcache, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset, getMessages, arginfo_phalcon_mvc_model_resultset_getmessages, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, update, arginfo_phalcon_mvc_model_resultset_update, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, delete, arginfo_phalcon_mvc_model_resultset_delete, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset, filter, arginfo_phalcon_mvc_model_resultset_filter, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset, jsonSerialize, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset, jsonSerialize, arginfo_phalcon_mvc_model_resultset_jsonserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/resultset/complex.zep.c b/ext/phalcon/mvc/model/resultset/complex.zep.c index a35afb462c4..95001ff1481 100644 --- a/ext/phalcon/mvc/model/resultset/complex.zep.c +++ b/ext/phalcon/mvc/model/resultset/complex.zep.c @@ -55,21 +55,29 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *columnTypes, *result = NULL, *cache = NULL; + zval *columnTypes, columnTypes_sub, *result = NULL, result_sub, *cache = NULL, cache_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&columnTypes_sub); + ZVAL_UNDEF(&result_sub); + ZVAL_UNDEF(&cache_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &columnTypes, &result, &cache); if (!result) { - result = ZEPHIR_GLOBAL(global_null); + result = &result_sub; + result = &__$null; } if (!cache) { - cache = ZEPHIR_GLOBAL(global_null); + cache = &cache_sub; + cache = &__$null; } - zephir_update_property_this(getThis(), SL("_columnTypes"), columnTypes TSRMLS_CC); - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_resultset_complex_ce, getThis(), "__construct", &_0, 388, result, cache); + zephir_update_property_zval(this_ptr, SL("_columnTypes"), columnTypes); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_resultset_complex_ce, getThis(), "__construct", &_0, 0, result, cache); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -80,167 +88,203 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) { - zend_class_entry *_13$$15; - HashTable *_3, *_6$$11; - HashPosition _2, _5$$11; - zval *row = NULL, *hydrateMode = NULL, *eager = NULL, *alias = NULL, *activeRow = NULL, *type = NULL, *column = NULL, *columnValue = NULL, *value = NULL, *attribute = NULL, *source = NULL, *attributes = NULL, *columnMap = NULL, *rowModel = NULL, *keepSnapshots = NULL, *sqlAlias = NULL, *modelName = NULL, *_0, *_1, **_4, **_7$$11, *_8$$12 = NULL, *_9$$15 = NULL, *_11$$15, *_12$$15 = NULL, *_10$$16, *_15$$18, *_16$$18 = NULL, _18$$24 = zval_used_for_init, _19$$24 = zval_used_for_init; - zephir_fcall_cache_entry *_14 = NULL, *_17 = NULL; + zend_class_entry *_11$$15; + zend_string *_4; + zend_ulong _3; + zephir_fcall_cache_entry *_12 = NULL, *_15 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, dirtyState = 0; + zval __$true, __$false, row, hydrateMode, eager, alias, activeRow, type, column, columnValue, value, attribute, source, attributes, columnMap, rowModel, keepSnapshots, sqlAlias, modelName, _0, _1, *_2, *_5$$11, _6$$12, _7$$15, _9$$15, _10$$15, _8$$16, _13$$18, _14$$18, _16$$24, _17$$24; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&row); + ZVAL_UNDEF(&hydrateMode); + ZVAL_UNDEF(&eager); + ZVAL_UNDEF(&alias); + ZVAL_UNDEF(&activeRow); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&column); + ZVAL_UNDEF(&columnValue); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&source); + ZVAL_UNDEF(&attributes); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&rowModel); + ZVAL_UNDEF(&keepSnapshots); + ZVAL_UNDEF(&sqlAlias); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_6$$12); + ZVAL_UNDEF(&_7$$15); + ZVAL_UNDEF(&_9$$15); + ZVAL_UNDEF(&_10$$15); + ZVAL_UNDEF(&_8$$16); + ZVAL_UNDEF(&_13$$18); + ZVAL_UNDEF(&_14$$18); + ZVAL_UNDEF(&_16$$24); + ZVAL_UNDEF(&_17$$24); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(activeRow); - zephir_read_property_this(&activeRow, this_ptr, SL("_activeRow"), PH_NOISY_CC); - if (Z_TYPE_P(activeRow) != IS_NULL) { - RETURN_CCTOR(activeRow); + ZEPHIR_OBS_VAR(&activeRow); + zephir_read_property(&activeRow, this_ptr, SL("_activeRow"), PH_NOISY_CC); + if (Z_TYPE_P(&activeRow) != IS_NULL) { + RETURN_CCTOR(&activeRow); } - ZEPHIR_OBS_VAR(row); - zephir_read_property_this(&row, this_ptr, SL("_row"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_disableHydration"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - zephir_update_property_this(getThis(), SL("_activeRow"), row TSRMLS_CC); - RETURN_CCTOR(row); + ZEPHIR_OBS_VAR(&row); + zephir_read_property(&row, this_ptr, SL("_row"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_disableHydration"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + zephir_update_property_zval(this_ptr, SL("_activeRow"), &row); + RETURN_CCTOR(&row); } - if (Z_TYPE_P(row) != IS_ARRAY) { + if (Z_TYPE_P(&row) != IS_ARRAY) { if (0) { - zephir_update_property_this(getThis(), SL("_activeRow"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_activeRow"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_activeRow"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_activeRow"), &__$false); } RETURN_MM_BOOL(0); } - ZEPHIR_OBS_VAR(hydrateMode); - zephir_read_property_this(&hydrateMode, this_ptr, SL("_hydrateMode"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&hydrateMode); + zephir_read_property(&hydrateMode, this_ptr, SL("_hydrateMode"), PH_NOISY_CC); do { - if (ZEPHIR_IS_LONG(hydrateMode, 0)) { - ZEPHIR_INIT_NVAR(activeRow); - object_init_ex(activeRow, phalcon_mvc_model_row_ce); - if (zephir_has_constructor(activeRow TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, activeRow, "__construct", NULL, 0); + if (ZEPHIR_IS_LONG(&hydrateMode, 0)) { + ZEPHIR_INIT_NVAR(&activeRow); + object_init_ex(&activeRow, phalcon_mvc_model_row_ce); + if (zephir_has_constructor(&activeRow TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &activeRow, "__construct", NULL, 0); zephir_check_call_status(); } break; } - if (ZEPHIR_IS_LONG(hydrateMode, 1)) { - ZEPHIR_INIT_NVAR(activeRow); - array_init(activeRow); + if (ZEPHIR_IS_LONG(&hydrateMode, 1)) { + ZEPHIR_INIT_NVAR(&activeRow); + array_init(&activeRow); break; } - ZEPHIR_INIT_NVAR(activeRow); - object_init(activeRow); + ZEPHIR_INIT_NVAR(&activeRow); + object_init(&activeRow); break; } while(0); dirtyState = 0; - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_columnTypes"), PH_NOISY_CC); - zephir_is_iterable(_1, &_3, &_2, 0, 0, "phalcon/mvc/model/resultset/complex.zep", 246); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HMKEY(alias, _3, _2); - ZEPHIR_GET_HVALUE(column, _4); - if (Z_TYPE_P(column) != IS_ARRAY) { + zephir_read_property(&_1, this_ptr, SL("_columnTypes"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_1, 0, "phalcon/mvc/model/resultset/complex.zep", 246); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_1), _3, _4, _2) + { + ZEPHIR_INIT_NVAR(&alias); + if (_4 != NULL) { + ZVAL_STR_COPY(&alias, _4); + } else { + ZVAL_LONG(&alias, _3); + } + ZEPHIR_INIT_NVAR(&column); + ZVAL_COPY(&column, _2); + if (Z_TYPE_P(&column) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Column type is corrupt", "phalcon/mvc/model/resultset/complex.zep", 133); return; } - ZEPHIR_OBS_NVAR(type); - zephir_array_fetch_string(&type, column, SL("type"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 136 TSRMLS_CC); - if (ZEPHIR_IS_STRING(type, "object")) { - ZEPHIR_OBS_NVAR(source); - zephir_array_fetch_string(&source, column, SL("column"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 142 TSRMLS_CC); - ZEPHIR_OBS_NVAR(attributes); - zephir_array_fetch_string(&attributes, column, SL("attributes"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 143 TSRMLS_CC); - ZEPHIR_OBS_NVAR(columnMap); - zephir_array_fetch_string(&columnMap, column, SL("columnMap"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 144 TSRMLS_CC); - ZEPHIR_INIT_NVAR(rowModel); - array_init(rowModel); - zephir_is_iterable(attributes, &_6$$11, &_5$$11, 0, 0, "phalcon/mvc/model/resultset/complex.zep", 162); - for ( - ; zend_hash_get_current_data_ex(_6$$11, (void**) &_7$$11, &_5$$11) == SUCCESS - ; zend_hash_move_forward_ex(_6$$11, &_5$$11) - ) { - ZEPHIR_GET_HVALUE(attribute, _7$$11); - ZEPHIR_OBS_NVAR(columnValue); - ZEPHIR_INIT_LNVAR(_8$$12); - ZEPHIR_CONCAT_SVSV(_8$$12, "_", source, "_", attribute); - zephir_array_fetch(&columnValue, row, _8$$12, PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 155 TSRMLS_CC); - zephir_array_update_zval(&rowModel, attribute, &columnValue, PH_COPY | PH_SEPARATE); - } + ZEPHIR_OBS_NVAR(&type); + zephir_array_fetch_string(&type, &column, SL("type"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 136 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&type, "object")) { + ZEPHIR_OBS_NVAR(&source); + zephir_array_fetch_string(&source, &column, SL("column"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 142 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&attributes); + zephir_array_fetch_string(&attributes, &column, SL("attributes"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 143 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&columnMap); + zephir_array_fetch_string(&columnMap, &column, SL("columnMap"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 144 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&rowModel); + array_init(&rowModel); + zephir_is_iterable(&attributes, 0, "phalcon/mvc/model/resultset/complex.zep", 162); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&attributes), _5$$11) + { + ZEPHIR_INIT_NVAR(&attribute); + ZVAL_COPY(&attribute, _5$$11); + ZEPHIR_OBS_NVAR(&columnValue); + ZEPHIR_INIT_LNVAR(_6$$12); + ZEPHIR_CONCAT_SVSV(&_6$$12, "_", &source, "_", &attribute); + zephir_array_fetch(&columnValue, &row, &_6$$12, PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 155 TSRMLS_CC); + zephir_array_update_zval(&rowModel, &attribute, &columnValue, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&attribute); do { - if (ZEPHIR_IS_LONG(hydrateMode, 0)) { - ZEPHIR_OBS_NVAR(keepSnapshots); - if (!(zephir_array_isset_string_fetch(&keepSnapshots, column, SS("keepSnapshots"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(keepSnapshots); - ZVAL_BOOL(keepSnapshots, 0); + if (ZEPHIR_IS_LONG(&hydrateMode, 0)) { + ZEPHIR_OBS_NVAR(&keepSnapshots); + if (!(zephir_array_isset_string_fetch(&keepSnapshots, &column, SL("keepSnapshots"), 0))) { + ZEPHIR_INIT_NVAR(&keepSnapshots); + ZVAL_BOOL(&keepSnapshots, 0); } if (ZEPHIR_GLOBAL(orm).late_state_binding) { - ZEPHIR_OBS_NVAR(_9$$15); - zephir_array_fetch_string(&_9$$15, column, SL("instance"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 173 TSRMLS_CC); - if (zephir_instance_of_ev(_9$$15, phalcon_mvc_model_ce TSRMLS_CC)) { - zephir_array_fetch_string(&_10$$16, column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 174 TSRMLS_CC); - ZEPHIR_INIT_NVAR(modelName); - zephir_get_class(modelName, _10$$16, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&_7$$15); + zephir_array_fetch_string(&_7$$15, &column, SL("instance"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 173 TSRMLS_CC); + if (zephir_instance_of_ev(&_7$$15, phalcon_mvc_model_ce TSRMLS_CC)) { + zephir_array_fetch_string(&_8$$16, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 174 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&modelName); + zephir_get_class(&modelName, &_8$$16, 0 TSRMLS_CC); } else { - ZEPHIR_INIT_NVAR(modelName); - ZVAL_STRING(modelName, "Phalcon\\Mvc\\Model", 1); + ZEPHIR_INIT_NVAR(&modelName); + ZVAL_STRING(&modelName, "Phalcon\\Mvc\\Model"); } - zephir_array_fetch_string(&_11$$15, column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 180 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_12$$15); - ZVAL_LONG(_12$$15, dirtyState); - _13$$15 = zephir_fetch_class(modelName TSRMLS_CC); - ZEPHIR_CALL_CE_STATIC(&value, _13$$15, "cloneresultmap", NULL, 0, _11$$15, rowModel, columnMap, _12$$15, keepSnapshots); + zephir_array_fetch_string(&_9$$15, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 180 TSRMLS_CC); + ZVAL_LONG(&_10$$15, dirtyState); + _11$$15 = zephir_fetch_class(&modelName TSRMLS_CC); + ZEPHIR_CALL_CE_STATIC(&value, _11$$15, "cloneresultmap", NULL, 0, &_9$$15, &rowModel, &columnMap, &_10$$15, &keepSnapshots); zephir_check_call_status(); } else { - zephir_array_fetch_string(&_15$$18, column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 188 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_16$$18); - ZVAL_LONG(_16$$18, dirtyState); - ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_14, 0, _15$$18, rowModel, columnMap, _16$$18, keepSnapshots); + zephir_array_fetch_string(&_13$$18, &column, SL("instance"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 188 TSRMLS_CC); + ZVAL_LONG(&_14$$18, dirtyState); + ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmap", &_12, 0, &_13$$18, &rowModel, &columnMap, &_14$$18, &keepSnapshots); zephir_check_call_status(); } break; } - ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmaphydrate", &_17, 0, rowModel, columnMap, hydrateMode); + ZEPHIR_CALL_CE_STATIC(&value, phalcon_mvc_model_ce, "cloneresultmaphydrate", &_15, 0, &rowModel, &columnMap, &hydrateMode); zephir_check_call_status(); break; } while(0); - ZEPHIR_OBS_NVAR(attribute); - zephir_array_fetch_string(&attribute, column, SL("balias"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 202 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&attribute); + zephir_array_fetch_string(&attribute, &column, SL("balias"), PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 202 TSRMLS_CC); } else { - ZEPHIR_OBS_NVAR(sqlAlias); - if (zephir_array_isset_string_fetch(&sqlAlias, column, SS("sqlAlias"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_NVAR(value); - zephir_array_fetch(&value, row, sqlAlias, PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 210 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&sqlAlias); + if (zephir_array_isset_string_fetch(&sqlAlias, &column, SL("sqlAlias"), 0)) { + ZEPHIR_OBS_NVAR(&value); + zephir_array_fetch(&value, &row, &sqlAlias, PH_NOISY, "phalcon/mvc/model/resultset/complex.zep", 210 TSRMLS_CC); } else { - ZEPHIR_OBS_NVAR(value); - zephir_array_isset_fetch(&value, row, alias, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&value); + zephir_array_isset_fetch(&value, &row, &alias, 0 TSRMLS_CC); } - if (zephir_array_isset_string(column, SS("balias"))) { - ZEPHIR_CPY_WRT(attribute, alias); + if (zephir_array_isset_string(&column, SL("balias"))) { + ZEPHIR_CPY_WRT(&attribute, &alias); } else { - ZEPHIR_SINIT_NVAR(_18$$24); - ZVAL_STRING(&_18$$24, "_", 0); - ZEPHIR_SINIT_NVAR(_19$$24); - ZVAL_STRING(&_19$$24, "", 0); - ZEPHIR_INIT_NVAR(attribute); - zephir_fast_str_replace(&attribute, &_18$$24, &_19$$24, alias TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_16$$24); + ZVAL_STRING(&_16$$24, "_"); + ZEPHIR_INIT_NVAR(&_17$$24); + ZVAL_STRING(&_17$$24, ""); + ZEPHIR_INIT_NVAR(&attribute); + zephir_fast_str_replace(&attribute, &_16$$24, &_17$$24, &alias TSRMLS_CC); } } - if (!(zephir_array_isset_string_fetch(&eager, column, SS("eager"), 1 TSRMLS_CC))) { + if (!(zephir_array_isset_string_fetch(&eager, &column, SL("eager"), 1))) { do { - if (ZEPHIR_IS_LONG(hydrateMode, 1)) { - zephir_array_update_zval(&activeRow, attribute, &value, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_LONG(&hydrateMode, 1)) { + zephir_array_update_zval(&activeRow, &attribute, &value, PH_COPY | PH_SEPARATE); break; } - zephir_update_property_zval_zval(activeRow, attribute, value TSRMLS_CC); + zephir_update_property_zval_zval(&activeRow, &attribute, &value TSRMLS_CC); break; } while(0); } - } - zephir_update_property_this(getThis(), SL("_activeRow"), activeRow TSRMLS_CC); - RETURN_CCTOR(activeRow); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&column); + ZEPHIR_INIT_NVAR(&alias); + zephir_update_property_zval(this_ptr, SL("_activeRow"), &activeRow); + RETURN_CCTOR(&activeRow); } @@ -250,29 +294,34 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, current) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray) { - zval *records = NULL, *current = NULL, *_0 = NULL; + zval records, current, _0; zephir_fcall_cache_entry *_1 = NULL, *_2 = NULL, *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&records); + ZVAL_UNDEF(¤t); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(records); - array_init(records); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 80); + ZEPHIR_INIT_VAR(&records); + array_init(&records); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rewind", NULL, 73); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0, this_ptr, "valid", &_1, 0); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { break; } - ZEPHIR_CALL_METHOD(¤t, this_ptr, "current", &_2, 389); + ZEPHIR_CALL_METHOD(¤t, this_ptr, "current", &_2, 346); zephir_check_call_status(); - zephir_array_append(&records, current, PH_SEPARATE, "phalcon/mvc/model/resultset/complex.zep", 263); + zephir_array_append(&records, ¤t, PH_SEPARATE, "phalcon/mvc/model/resultset/complex.zep", 263); ZEPHIR_CALL_METHOD(NULL, this_ptr, "next", &_3, 0); zephir_check_call_status(); } - RETURN_CCTOR(records); + RETURN_CCTOR(&records); } @@ -281,29 +330,37 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, toArray) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, serialize) { - zval *_0; - zval *records = NULL, *cache = NULL, *columnTypes = NULL, *hydrateMode = NULL, *serialized = NULL; + zval _0; + zval records, cache, columnTypes, hydrateMode, serialized; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&columnTypes); + ZVAL_UNDEF(&hydrateMode); + ZVAL_UNDEF(&serialized); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&records, this_ptr, "toarray", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(cache); - zephir_read_property_this(&cache, this_ptr, SL("_cache"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(columnTypes); - zephir_read_property_this(&columnTypes, this_ptr, SL("_columnTypes"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(hydrateMode); - zephir_read_property_this(&hydrateMode, this_ptr, SL("_hydrateMode"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 4, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&cache); + zephir_read_property(&cache, this_ptr, SL("_cache"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&columnTypes); + zephir_read_property(&columnTypes, this_ptr, SL("_columnTypes"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&hydrateMode); + zephir_read_property(&hydrateMode, this_ptr, SL("_hydrateMode"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 4, 0 TSRMLS_CC); zephir_array_update_string(&_0, SL("cache"), &cache, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_0, SL("rows"), &records, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_0, SL("columnTypes"), &columnTypes, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_0, SL("hydrateMode"), &hydrateMode, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&serialized, "serialize", NULL, 68, _0); + ZEPHIR_CALL_FUNCTION(&serialized, "serialize", NULL, 61, &_0); zephir_check_call_status(); - RETURN_CCTOR(serialized); + RETURN_CCTOR(&serialized); } @@ -313,7 +370,19 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, serialize) { PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, *resultset = NULL, *_0, *_1, *_2, *_3, *_4, *_5; + zval *data, data_sub, __$true, __$false, resultset, _0, _1, _2, _3, _4, _5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&resultset); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); @@ -321,28 +390,28 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, unserialize) { if (1) { - zephir_update_property_this(getThis(), SL("_disableHydration"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_disableHydration"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_disableHydration"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_disableHydration"), &__$false); } - ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 69, data); + ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 62, data); zephir_check_call_status(); - if (Z_TYPE_P(resultset) != IS_ARRAY) { + if (Z_TYPE_P(&resultset) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/mvc/model/resultset/complex.zep", 310); return; } - zephir_array_fetch_string(&_0, resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 313 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_rows"), _0 TSRMLS_CC); - zephir_array_fetch_string(&_1, resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 314 TSRMLS_CC); + zephir_array_fetch_string(&_0, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 313 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rows"), &_0); + zephir_array_fetch_string(&_1, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 314 TSRMLS_CC); ZEPHIR_INIT_ZVAL_NREF(_2); - ZVAL_LONG(_2, zephir_fast_count_int(_1 TSRMLS_CC)); - zephir_update_property_this(getThis(), SL("_count"), _2 TSRMLS_CC); - zephir_array_fetch_string(&_3, resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 315 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_cache"), _3 TSRMLS_CC); - zephir_array_fetch_string(&_4, resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 316 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_columnTypes"), _4 TSRMLS_CC); - zephir_array_fetch_string(&_5, resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 317 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_hydrateMode"), _5 TSRMLS_CC); + ZVAL_LONG(&_2, zephir_fast_count_int(&_1 TSRMLS_CC)); + zephir_update_property_zval(this_ptr, SL("_count"), &_2); + zephir_array_fetch_string(&_3, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 315 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &_3); + zephir_array_fetch_string(&_4, &resultset, SL("columnTypes"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 316 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_columnTypes"), &_4); + zephir_array_fetch_string(&_5, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/complex.zep", 317 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_hydrateMode"), &_5); ZEPHIR_MM_RESTORE(); } diff --git a/ext/phalcon/mvc/model/resultset/complex.zep.h b/ext/phalcon/mvc/model/resultset/complex.zep.h index 6103e2f869e..744fa44efa1 100644 --- a/ext/phalcon/mvc/model/resultset/complex.zep.h +++ b/ext/phalcon/mvc/model/resultset/complex.zep.h @@ -15,6 +15,20 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex___construct, ZEND_ARG_OBJ_INFO(0, cache, Phalcon\\Cache\\BackendInterface, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_toarray, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_toarray, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_serialize, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_serialize, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_complex_unserialize, 0, 0, 1) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() @@ -22,8 +36,8 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_resultset_complex_method_entry) { PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, __construct, arginfo_phalcon_mvc_model_resultset_complex___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, current, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, toArray, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, serialize, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, toArray, arginfo_phalcon_mvc_model_resultset_complex_toarray, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, serialize, arginfo_phalcon_mvc_model_resultset_complex_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Complex, unserialize, arginfo_phalcon_mvc_model_resultset_complex_unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/resultset/simple.zep.c b/ext/phalcon/mvc/model/resultset/simple.zep.c index aa8c8fc5a77..c3d50623457 100644 --- a/ext/phalcon/mvc/model/resultset/simple.zep.c +++ b/ext/phalcon/mvc/model/resultset/simple.zep.c @@ -54,23 +54,33 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *columnMap, *model, *result, *cache = NULL, *keepSnapshots = NULL; + zval *columnMap, columnMap_sub, *model, model_sub, *result, result_sub, *cache = NULL, cache_sub, *keepSnapshots = NULL, keepSnapshots_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&columnMap_sub); + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&result_sub); + ZVAL_UNDEF(&cache_sub); + ZVAL_UNDEF(&keepSnapshots_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 2, &columnMap, &model, &result, &cache, &keepSnapshots); if (!cache) { - cache = ZEPHIR_GLOBAL(global_null); + cache = &cache_sub; + cache = &__$null; } if (!keepSnapshots) { - keepSnapshots = ZEPHIR_GLOBAL(global_null); + keepSnapshots = &keepSnapshots_sub; + keepSnapshots = &__$null; } - zephir_update_property_this(getThis(), SL("_model"), model TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_columnMap"), columnMap TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_keepSnapshots"), keepSnapshots TSRMLS_CC); - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_resultset_simple_ce, getThis(), "__construct", &_0, 388, result, cache); + zephir_update_property_zval(this_ptr, SL("_model"), model); + zephir_update_property_zval(this_ptr, SL("_columnMap"), columnMap); + zephir_update_property_zval(this_ptr, SL("_keepSnapshots"), keepSnapshots); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_resultset_simple_ce, getThis(), "__construct", &_0, 0, result, cache); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -82,68 +92,83 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, __construct) { PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, current) { zend_class_entry *_5$$6; - zval *row = NULL, *hydrateMode = NULL, *columnMap = NULL, *activeRow = NULL, *modelName = NULL, *_0$$6, *_2$$6, *_3$$6, *_4$$6, *_1$$7, *_7$$9, *_8$$9, *_9$$9; zephir_fcall_cache_entry *_6 = NULL, *_10 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval __$true, __$false, row, hydrateMode, columnMap, activeRow, modelName, _0$$6, _2$$6, _3$$6, _4$$6, _1$$7, _7$$9, _8$$9, _9$$9; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&row); + ZVAL_UNDEF(&hydrateMode); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&activeRow); + ZVAL_UNDEF(&modelName); + ZVAL_UNDEF(&_0$$6); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_1$$7); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(activeRow); - zephir_read_property_this(&activeRow, this_ptr, SL("_activeRow"), PH_NOISY_CC); - if (Z_TYPE_P(activeRow) != IS_NULL) { - RETURN_CCTOR(activeRow); + ZEPHIR_OBS_VAR(&activeRow); + zephir_read_property(&activeRow, this_ptr, SL("_activeRow"), PH_NOISY_CC); + if (Z_TYPE_P(&activeRow) != IS_NULL) { + RETURN_CCTOR(&activeRow); } - ZEPHIR_OBS_VAR(row); - zephir_read_property_this(&row, this_ptr, SL("_row"), PH_NOISY_CC); - if (Z_TYPE_P(row) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&row); + zephir_read_property(&row, this_ptr, SL("_row"), PH_NOISY_CC); + if (Z_TYPE_P(&row) != IS_ARRAY) { if (0) { - zephir_update_property_this(getThis(), SL("_activeRow"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_activeRow"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_activeRow"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_activeRow"), &__$false); } RETURN_MM_BOOL(0); } - ZEPHIR_OBS_VAR(hydrateMode); - zephir_read_property_this(&hydrateMode, this_ptr, SL("_hydrateMode"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(columnMap); - zephir_read_property_this(&columnMap, this_ptr, SL("_columnMap"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&hydrateMode); + zephir_read_property(&hydrateMode, this_ptr, SL("_hydrateMode"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&columnMap); + zephir_read_property(&columnMap, this_ptr, SL("_columnMap"), PH_NOISY_CC); do { - if (ZEPHIR_IS_LONG(hydrateMode, 0)) { + if (ZEPHIR_IS_LONG(&hydrateMode, 0)) { if (ZEPHIR_GLOBAL(orm).late_state_binding) { - ZEPHIR_OBS_VAR(_0$$6); - zephir_read_property_this(&_0$$6, this_ptr, SL("_model"), PH_NOISY_CC); - if (zephir_instance_of_ev(_0$$6, phalcon_mvc_model_ce TSRMLS_CC)) { - _1$$7 = zephir_fetch_nproperty_this(this_ptr, SL("_model"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(modelName); - zephir_get_class(modelName, _1$$7, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_0$$6); + zephir_read_property(&_0$$6, this_ptr, SL("_model"), PH_NOISY_CC); + if (zephir_instance_of_ev(&_0$$6, phalcon_mvc_model_ce TSRMLS_CC)) { + zephir_read_property(&_1$$7, this_ptr, SL("_model"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&modelName); + zephir_get_class(&modelName, &_1$$7, 0 TSRMLS_CC); } else { - ZEPHIR_INIT_NVAR(modelName); - ZVAL_STRING(modelName, "Phalcon\\Mvc\\Model", 1); + ZEPHIR_INIT_NVAR(&modelName); + ZVAL_STRING(&modelName, "Phalcon\\Mvc\\Model"); } - _2$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_model"), PH_NOISY_CC); - _3$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_keepSnapshots"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_4$$6); - ZVAL_LONG(_4$$6, 0); - _5$$6 = zephir_fetch_class(modelName TSRMLS_CC); - ZEPHIR_CALL_CE_STATIC(&activeRow, _5$$6, "cloneresultmap", NULL, 0, _2$$6, row, columnMap, _4$$6, _3$$6); + zephir_read_property(&_2$$6, this_ptr, SL("_model"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_3$$6, this_ptr, SL("_keepSnapshots"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_4$$6, 0); + _5$$6 = zephir_fetch_class(&modelName TSRMLS_CC); + ZEPHIR_CALL_CE_STATIC(&activeRow, _5$$6, "cloneresultmap", NULL, 0, &_2$$6, &row, &columnMap, &_4$$6, &_3$$6); zephir_check_call_status(); } else { - _7$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_model"), PH_NOISY_CC); - _8$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_keepSnapshots"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_9$$9); - ZVAL_LONG(_9$$9, 0); - ZEPHIR_CALL_CE_STATIC(&activeRow, phalcon_mvc_model_ce, "cloneresultmap", &_6, 390, _7$$9, row, columnMap, _9$$9, _8$$9); + zephir_read_property(&_7$$9, this_ptr, SL("_model"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_8$$9, this_ptr, SL("_keepSnapshots"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_9$$9, 0); + ZEPHIR_CALL_CE_STATIC(&activeRow, phalcon_mvc_model_ce, "cloneresultmap", &_6, 0, &_7$$9, &row, &columnMap, &_9$$9, &_8$$9); zephir_check_call_status(); } break; } - ZEPHIR_CALL_CE_STATIC(&activeRow, phalcon_mvc_model_ce, "cloneresultmaphydrate", &_10, 391, row, columnMap, hydrateMode); + ZEPHIR_CALL_CE_STATIC(&activeRow, phalcon_mvc_model_ce, "cloneresultmaphydrate", &_10, 0, &row, &columnMap, &hydrateMode); zephir_check_call_status(); break; } while(0); - zephir_update_property_this(getThis(), SL("_activeRow"), activeRow TSRMLS_CC); - RETURN_CCTOR(activeRow); + zephir_update_property_zval(this_ptr, SL("_activeRow"), &activeRow); + RETURN_CCTOR(&activeRow); } @@ -154,12 +179,29 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, current) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) { - HashTable *_2$$7, *_5$$8; - HashPosition _1$$7, _4$$8; - zephir_fcall_cache_entry *_9 = NULL; + zend_string *_4$$8; + zend_ulong _3$$8; + zephir_fcall_cache_entry *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *renameColumns_param = NULL, *result = NULL, *records = NULL, *record = NULL, *renamed = NULL, *renamedKey = NULL, *key = NULL, *value = NULL, *renamedRecords = NULL, *columnMap = NULL, *_0$$3, **_3$$7, **_6$$8, *_7$$10 = NULL, *_8$$10 = NULL, *_10$$12 = NULL, *_11$$12 = NULL; + zval *renameColumns_param = NULL, __$null, result, records, record, renamed, renamedKey, key, value, renamedRecords, columnMap, _0$$3, *_1$$7, *_2$$8, _5$$10, _6$$10, _8$$12, _9$$12; zend_bool renameColumns; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&records); + ZVAL_UNDEF(&record); + ZVAL_UNDEF(&renamed); + ZVAL_UNDEF(&renamedKey); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&renamedRecords); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_5$$10); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&_8$$12); + ZVAL_UNDEF(&_9$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &renameColumns_param); @@ -171,79 +213,85 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) { } - ZEPHIR_OBS_VAR(records); - zephir_read_property_this(&records, this_ptr, SL("_rows"), PH_NOISY_CC); - if (Z_TYPE_P(records) != IS_ARRAY) { - ZEPHIR_OBS_VAR(result); - zephir_read_property_this(&result, this_ptr, SL("_result"), PH_NOISY_CC); - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_row"), PH_NOISY_CC); - if (Z_TYPE_P(_0$$3) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, result, "execute", NULL, 0); + ZEPHIR_OBS_VAR(&records); + zephir_read_property(&records, this_ptr, SL("_rows"), PH_NOISY_CC); + if (Z_TYPE_P(&records) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&result); + zephir_read_property(&result, this_ptr, SL("_result"), PH_NOISY_CC); + zephir_read_property(&_0$$3, this_ptr, SL("_row"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0$$3) != IS_NULL) { + ZEPHIR_CALL_METHOD(NULL, &result, "execute", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&records, result, "fetchall", NULL, 0); + ZEPHIR_CALL_METHOD(&records, &result, "fetchall", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_row"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_rows"), records TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_row"), &__$null); + zephir_update_property_zval(this_ptr, SL("_rows"), &records); } if (renameColumns) { - ZEPHIR_OBS_VAR(columnMap); - zephir_read_property_this(&columnMap, this_ptr, SL("_columnMap"), PH_NOISY_CC); - if (Z_TYPE_P(columnMap) != IS_ARRAY) { - RETURN_CCTOR(records); + ZEPHIR_OBS_VAR(&columnMap); + zephir_read_property(&columnMap, this_ptr, SL("_columnMap"), PH_NOISY_CC); + if (Z_TYPE_P(&columnMap) != IS_ARRAY) { + RETURN_CCTOR(&records); } - ZEPHIR_INIT_VAR(renamedRecords); - array_init(renamedRecords); - if (Z_TYPE_P(records) == IS_ARRAY) { - zephir_is_iterable(records, &_2$$7, &_1$$7, 0, 0, "phalcon/mvc/model/resultset/simple.zep", 217); - for ( - ; zend_hash_get_current_data_ex(_2$$7, (void**) &_3$$7, &_1$$7) == SUCCESS - ; zend_hash_move_forward_ex(_2$$7, &_1$$7) - ) { - ZEPHIR_GET_HVALUE(record, _3$$7); - ZEPHIR_INIT_NVAR(renamed); - array_init(renamed); - zephir_is_iterable(record, &_5$$8, &_4$$8, 0, 0, "phalcon/mvc/model/resultset/simple.zep", 215); - for ( - ; zend_hash_get_current_data_ex(_5$$8, (void**) &_6$$8, &_4$$8) == SUCCESS - ; zend_hash_move_forward_ex(_5$$8, &_4$$8) - ) { - ZEPHIR_GET_HMKEY(key, _5$$8, _4$$8); - ZEPHIR_GET_HVALUE(value, _6$$8); - ZEPHIR_OBS_NVAR(renamedKey); - if (!(zephir_array_isset_fetch(&renamedKey, columnMap, key, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_7$$10); - object_init_ex(_7$$10, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_8$$10); - ZEPHIR_CONCAT_SVS(_8$$10, "Column '", key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _7$$10, "__construct", &_9, 9, _8$$10); + ZEPHIR_INIT_VAR(&renamedRecords); + array_init(&renamedRecords); + if (Z_TYPE_P(&records) == IS_ARRAY) { + zephir_is_iterable(&records, 0, "phalcon/mvc/model/resultset/simple.zep", 217); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&records), _1$$7) + { + ZEPHIR_INIT_NVAR(&record); + ZVAL_COPY(&record, _1$$7); + ZEPHIR_INIT_NVAR(&renamed); + array_init(&renamed); + zephir_is_iterable(&record, 0, "phalcon/mvc/model/resultset/simple.zep", 215); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&record), _3$$8, _4$$8, _2$$8) + { + ZEPHIR_INIT_NVAR(&key); + if (_4$$8 != NULL) { + ZVAL_STR_COPY(&key, _4$$8); + } else { + ZVAL_LONG(&key, _3$$8); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _2$$8); + ZEPHIR_OBS_NVAR(&renamedKey); + if (!(zephir_array_isset_fetch(&renamedKey, &columnMap, &key, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_5$$10); + object_init_ex(&_5$$10, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_6$$10); + ZEPHIR_CONCAT_SVS(&_6$$10, "Column '", &key, "' is not part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_5$$10, "__construct", &_7, 4, &_6$$10); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$10, "phalcon/mvc/model/resultset/simple.zep", 199 TSRMLS_CC); + zephir_throw_exception_debug(&_5$$10, "phalcon/mvc/model/resultset/simple.zep", 199 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (Z_TYPE_P(renamedKey) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(renamedKey); - if (!(zephir_array_isset_long_fetch(&renamedKey, renamedKey, 0, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_10$$12); - object_init_ex(_10$$12, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_11$$12); - ZEPHIR_CONCAT_SVS(_11$$12, "Column '", key, "' is not part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _10$$12, "__construct", &_9, 9, _11$$12); + if (Z_TYPE_P(&renamedKey) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&renamedKey); + if (!(zephir_array_isset_long_fetch(&renamedKey, &renamedKey, 0, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_8$$12); + object_init_ex(&_8$$12, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_9$$12); + ZEPHIR_CONCAT_SVS(&_9$$12, "Column '", &key, "' is not part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_8$$12, "__construct", &_7, 4, &_9$$12); zephir_check_call_status(); - zephir_throw_exception_debug(_10$$12, "phalcon/mvc/model/resultset/simple.zep", 205 TSRMLS_CC); + zephir_throw_exception_debug(&_8$$12, "phalcon/mvc/model/resultset/simple.zep", 205 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - zephir_array_update_zval(&renamed, renamedKey, &value, PH_COPY | PH_SEPARATE); - } - zephir_array_append(&renamedRecords, renamed, PH_SEPARATE, "phalcon/mvc/model/resultset/simple.zep", 215); - } + zephir_array_update_zval(&renamed, &renamedKey, &value, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + zephir_array_append(&renamedRecords, &renamed, PH_SEPARATE, "phalcon/mvc/model/resultset/simple.zep", 215); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&record); } - RETURN_CCTOR(renamedRecords); + RETURN_CCTOR(&renamedRecords); } - RETURN_CCTOR(records); + RETURN_CCTOR(&records); } @@ -252,35 +300,40 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, toArray) { */ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, serialize) { - zval *_1 = NULL, *_2 = NULL, *_3; - zval *_0; + zval _1, _2, _3; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 6, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_model"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 6, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_model"), PH_NOISY_CC); zephir_array_update_string(&_0, SL("model"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_cache"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_cache"), PH_NOISY_CC); zephir_array_update_string(&_0, SL("cache"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_3); - ZVAL_BOOL(_3, 0); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "toarray", NULL, 0, _3); + ZVAL_BOOL(&_3, 0); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "toarray", NULL, 0, &_3); zephir_check_call_status(); zephir_array_update_string(&_0, SL("rows"), &_2, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_columnMap"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_columnMap"), PH_NOISY_CC); zephir_array_update_string(&_0, SL("columnMap"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_hydrateMode"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_hydrateMode"), PH_NOISY_CC); zephir_array_update_string(&_0, SL("hydrateMode"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_keepSnapshots"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_keepSnapshots"), PH_NOISY_CC); zephir_array_update_string(&_0, SL("keepSnapshots"), &_1, PH_COPY | PH_SEPARATE); - ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 68, _0); + ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 61, &_0); zephir_check_call_status(); RETURN_MM(); @@ -292,35 +345,47 @@ PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, serialize) { PHP_METHOD(Phalcon_Mvc_Model_Resultset_Simple, unserialize) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data, *resultset = NULL, *keepSnapshots = NULL, *_0, *_1, *_2, *_3, *_4, *_5, *_6; + zval *data, data_sub, resultset, keepSnapshots, _0, _1, _2, _3, _4, _5, _6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&resultset); + ZVAL_UNDEF(&keepSnapshots); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data); - ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 69, data); + ZEPHIR_CALL_FUNCTION(&resultset, "unserialize", NULL, 62, data); zephir_check_call_status(); - if (Z_TYPE_P(resultset) != IS_ARRAY) { + if (Z_TYPE_P(&resultset) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Invalid serialization data", "phalcon/mvc/model/resultset/simple.zep", 252); return; } - zephir_array_fetch_string(&_0, resultset, SL("model"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 255 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_model"), _0 TSRMLS_CC); - zephir_array_fetch_string(&_1, resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 256 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_rows"), _1 TSRMLS_CC); - zephir_array_fetch_string(&_2, resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 257 TSRMLS_CC); + zephir_array_fetch_string(&_0, &resultset, SL("model"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 255 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_model"), &_0); + zephir_array_fetch_string(&_1, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 256 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rows"), &_1); + zephir_array_fetch_string(&_2, &resultset, SL("rows"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 257 TSRMLS_CC); ZEPHIR_INIT_ZVAL_NREF(_3); - ZVAL_LONG(_3, zephir_fast_count_int(_2 TSRMLS_CC)); - zephir_update_property_this(getThis(), SL("_count"), _3 TSRMLS_CC); - zephir_array_fetch_string(&_4, resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 258 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_cache"), _4 TSRMLS_CC); - zephir_array_fetch_string(&_5, resultset, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 259 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_columnMap"), _5 TSRMLS_CC); - zephir_array_fetch_string(&_6, resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 260 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_hydrateMode"), _6 TSRMLS_CC); - if (zephir_array_isset_string_fetch(&keepSnapshots, resultset, SS("keepSnapshots"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_keepSnapshots"), keepSnapshots TSRMLS_CC); + ZVAL_LONG(&_3, zephir_fast_count_int(&_2 TSRMLS_CC)); + zephir_update_property_zval(this_ptr, SL("_count"), &_3); + zephir_array_fetch_string(&_4, &resultset, SL("cache"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 258 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &_4); + zephir_array_fetch_string(&_5, &resultset, SL("columnMap"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 259 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_columnMap"), &_5); + zephir_array_fetch_string(&_6, &resultset, SL("hydrateMode"), PH_NOISY | PH_READONLY, "phalcon/mvc/model/resultset/simple.zep", 260 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_hydrateMode"), &_6); + if (zephir_array_isset_string_fetch(&keepSnapshots, &resultset, SL("keepSnapshots"), 1)) { + zephir_update_property_zval(this_ptr, SL("_keepSnapshots"), &keepSnapshots); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/model/resultset/simple.zep.h b/ext/phalcon/mvc/model/resultset/simple.zep.h index 00b5cb1326a..1be71f4fb88 100644 --- a/ext/phalcon/mvc/model/resultset/simple.zep.h +++ b/ext/phalcon/mvc/model/resultset/simple.zep.h @@ -17,8 +17,23 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple___construct, 0 ZEND_ARG_INFO(0, keepSnapshots) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple_toarray, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple_toarray, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple_toarray, 0, 0, IS_ARRAY, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, renameColumns, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, renameColumns) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple_serialize, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple_serialize, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultset_simple_unserialize, 0, 0, 1) @@ -29,7 +44,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_resultset_simple_method_entry) { PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, __construct, arginfo_phalcon_mvc_model_resultset_simple___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, current, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, toArray, arginfo_phalcon_mvc_model_resultset_simple_toarray, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, serialize, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, serialize, arginfo_phalcon_mvc_model_resultset_simple_serialize, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Resultset_Simple, unserialize, arginfo_phalcon_mvc_model_resultset_simple_unserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/resultsetinterface.zep.h b/ext/phalcon/mvc/model/resultsetinterface.zep.h index 3f4cdb8969f..c8fa7ea55cf 100644 --- a/ext/phalcon/mvc/model/resultsetinterface.zep.h +++ b/ext/phalcon/mvc/model/resultsetinterface.zep.h @@ -3,17 +3,42 @@ extern zend_class_entry *phalcon_mvc_model_resultsetinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_ResultsetInterface); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_gettype, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_gettype, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_setisfresh, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, isFresh, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, isFresh) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_isfresh, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_isfresh, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_toarray, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_resultsetinterface_toarray, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_resultsetinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, getType, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, getType, arginfo_phalcon_mvc_model_resultsetinterface_gettype) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, getFirst, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, getLast, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, setIsFresh, arginfo_phalcon_mvc_model_resultsetinterface_setisfresh) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, isFresh, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, isFresh, arginfo_phalcon_mvc_model_resultsetinterface_isfresh) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, getCache, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, toArray, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_ResultsetInterface, toArray, arginfo_phalcon_mvc_model_resultsetinterface_toarray) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/row.zep.c b/ext/phalcon/mvc/model/row.zep.c index 465479203cf..83c21db4ccc 100644 --- a/ext/phalcon/mvc/model/row.zep.c +++ b/ext/phalcon/mvc/model/row.zep.c @@ -34,7 +34,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Row) { zend_class_implements(phalcon_mvc_model_row_ce TSRMLS_CC, 1, phalcon_mvc_entityinterface_ce); zend_class_implements(phalcon_mvc_model_row_ce TSRMLS_CC, 1, phalcon_mvc_model_resultinterface_ce); zend_class_implements(phalcon_mvc_model_row_ce TSRMLS_CC, 1, zend_ce_arrayaccess); - zend_class_implements(phalcon_mvc_model_row_ce TSRMLS_CC, 1, zephir_get_internal_ce(SS("jsonserializable") TSRMLS_CC)); + zend_class_implements(phalcon_mvc_model_row_ce TSRMLS_CC, 1, zephir_get_internal_ce(SL("jsonserializable"))); return SUCCESS; } @@ -46,6 +46,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, setDirtyState) { zval *dirtyState_param = NULL; zend_long dirtyState; + zval *this_ptr = getThis(); + zephir_fetch_params(0, 1, 0, &dirtyState_param); @@ -64,7 +66,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, setDirtyState) { */ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetExists) { - zval *index; + zval *index, index_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); zephir_fetch_params(0, 1, 0, &index); @@ -82,16 +87,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetExists) { */ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetGet) { - zval *index, *value = NULL; + zval *index, index_sub, value; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index); - ZEPHIR_OBS_VAR(value); + ZEPHIR_OBS_VAR(&value); if (zephir_fetch_property_zval(&value, this_ptr, index, PH_SILENT_CC)) { - RETURN_CCTOR(value); + RETURN_CCTOR(&value); } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the row", "phalcon/mvc/model/row.zep", 67); return; @@ -106,7 +115,11 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetGet) { */ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetSet) { - zval *index, *value; + zval *index, index_sub, *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index_sub); + ZVAL_UNDEF(&value_sub); zephir_fetch_params(0, 2, 0, &index, &value); @@ -124,7 +137,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetSet) { */ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetUnset) { - zval *offset; + zval *offset, offset_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&offset_sub); zephir_fetch_params(0, 1, 0, &offset); @@ -147,16 +163,20 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, offsetUnset) { */ PHP_METHOD(Phalcon_Mvc_Model_Row, readAttribute) { - zval *attribute, *value = NULL; + zval *attribute, attribute_sub, value; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute_sub); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &attribute); - ZEPHIR_OBS_VAR(value); + ZEPHIR_OBS_VAR(&value); if (zephir_fetch_property_zval(&value, this_ptr, attribute, PH_SILENT_CC)) { - RETURN_CTOR(value); + RETURN_CTOR(&value); } RETURN_MM_NULL(); @@ -174,25 +194,29 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, readAttribute) { */ PHP_METHOD(Phalcon_Mvc_Model_Row, writeAttribute) { - zval *attribute_param = NULL, *value; - zval *attribute = NULL; + zval *attribute_param = NULL, *value, value_sub; + zval attribute; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &attribute_param, &value); if (UNEXPECTED(Z_TYPE_P(attribute_param) != IS_STRING && Z_TYPE_P(attribute_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(attribute_param) == IS_STRING)) { - zephir_get_strval(attribute, attribute_param); + zephir_get_strval(&attribute, attribute_param); } else { - ZEPHIR_INIT_VAR(attribute); - ZVAL_EMPTY_STRING(attribute); + ZEPHIR_INIT_VAR(&attribute); + ZVAL_EMPTY_STRING(&attribute); } - zephir_update_property_zval_zval(getThis(), attribute, value TSRMLS_CC); + zephir_update_property_zval_zval(this_ptr, &attribute, value TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -205,10 +229,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, writeAttribute) { PHP_METHOD(Phalcon_Mvc_Model_Row, toArray) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 22, this_ptr); + ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 17, this_ptr); zephir_check_call_status(); RETURN_MM(); @@ -222,6 +248,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, toArray) { PHP_METHOD(Phalcon_Mvc_Model_Row, jsonSerialize) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); diff --git a/ext/phalcon/mvc/model/row.zep.h b/ext/phalcon/mvc/model/row.zep.h index 79862aa0874..05ca2c063b8 100644 --- a/ext/phalcon/mvc/model/row.zep.h +++ b/ext/phalcon/mvc/model/row.zep.h @@ -13,11 +13,23 @@ PHP_METHOD(Phalcon_Mvc_Model_Row, writeAttribute); PHP_METHOD(Phalcon_Mvc_Model_Row, toArray); PHP_METHOD(Phalcon_Mvc_Model_Row, jsonSerialize); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_row_setdirtystate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_setdirtystate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_setdirtystate, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_row_offsetexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_offsetexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_offsetexists, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() @@ -39,10 +51,28 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_row_readattribute, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_row_writeattribute, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, attribute, IS_STRING, 0) +#else ZEND_ARG_INFO(0, attribute) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_toarray, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_toarray, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_jsonserialize, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_row_jsonserialize, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_row_method_entry) { PHP_ME(Phalcon_Mvc_Model_Row, setDirtyState, arginfo_phalcon_mvc_model_row_setdirtystate, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Row, offsetExists, arginfo_phalcon_mvc_model_row_offsetexists, ZEND_ACC_PUBLIC) @@ -51,7 +81,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_model_row_method_entry) { PHP_ME(Phalcon_Mvc_Model_Row, offsetUnset, arginfo_phalcon_mvc_model_row_offsetunset, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Row, readAttribute, arginfo_phalcon_mvc_model_row_readattribute, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Row, writeAttribute, arginfo_phalcon_mvc_model_row_writeattribute, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Row, toArray, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Row, jsonSerialize, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Row, toArray, arginfo_phalcon_mvc_model_row_toarray, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Row, jsonSerialize, arginfo_phalcon_mvc_model_row_jsonserialize, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/transaction.zep.c b/ext/phalcon/mvc/model/transaction.zep.c index cd31cc77bed..5d72a465b4b 100644 --- a/ext/phalcon/mvc/model/transaction.zep.c +++ b/ext/phalcon/mvc/model/transaction.zep.c @@ -91,9 +91,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Transaction) { PHP_METHOD(Phalcon_Mvc_Model_Transaction, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *service = NULL; + zval service; zend_bool autoBegin; - zval *dependencyInjector, *autoBegin_param = NULL, *service_param = NULL, *connection = NULL, *_0, *_1$$4; + zval *dependencyInjector, dependencyInjector_sub, *autoBegin_param = NULL, *service_param = NULL, connection, _0, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&service); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &dependencyInjector, &autoBegin_param, &service_param); @@ -104,29 +111,28 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, __construct) { autoBegin = zephir_get_boolval(autoBegin_param); } if (!service_param) { - ZEPHIR_INIT_VAR(service); - ZVAL_EMPTY_STRING(service); + ZEPHIR_INIT_VAR(&service); + ZVAL_STRING(&service, ""); } else { - zephir_get_strval(service, service_param); + zephir_get_strval(&service, service_param); } - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_messages"), _0 TSRMLS_CC); - if (!(!service) && Z_STRLEN_P(service)) { - ZEPHIR_CALL_METHOD(&connection, dependencyInjector, "get", NULL, 0, service); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_messages"), &_0); + if (!(Z_TYPE_P(&service) == IS_UNDEF) && Z_STRLEN_P(&service)) { + ZEPHIR_CALL_METHOD(&connection, dependencyInjector, "get", NULL, 0, &service); zephir_check_call_status(); } else { - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_STRING(_1$$4, "db", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&connection, dependencyInjector, "get", NULL, 0, _1$$4); - zephir_check_temp_parameter(_1$$4); + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_STRING(&_1$$4, "db"); + ZEPHIR_CALL_METHOD(&connection, dependencyInjector, "get", NULL, 0, &_1$$4); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_connection"), connection TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_connection"), &connection); if (autoBegin) { - ZEPHIR_CALL_METHOD(NULL, connection, "begin", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "begin", NULL, 0); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -138,13 +144,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setTransactionManager) { - zval *manager; + zval *manager, manager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&manager_sub); zephir_fetch_params(0, 1, 0, &manager); - zephir_update_property_this(getThis(), SL("_manager"), manager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_manager"), manager); } @@ -153,13 +162,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setTransactionManager) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, begin) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_connection"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "begin", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_connection"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "begin", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -170,19 +182,23 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, begin) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, commit) { - zval *manager = NULL, *_0; + zval manager, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - if (Z_TYPE_P(manager) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(NULL, manager, "notifycommit", NULL, 0, this_ptr); + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + if (Z_TYPE_P(&manager) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(NULL, &manager, "notifycommit", NULL, 0, this_ptr); zephir_check_call_status(); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_connection"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "commit", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_connection"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "commit", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -194,45 +210,57 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, commit) { PHP_METHOD(Phalcon_Mvc_Model_Transaction, rollback) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *rollbackMessage = NULL, *rollbackRecord = NULL, *manager = NULL, *connection = NULL, *_0 = NULL, *_1$$4, *_2$$4; + zval *rollbackMessage = NULL, rollbackMessage_sub, *rollbackRecord = NULL, rollbackRecord_sub, __$null, manager, connection, _0, _1$$4, _2$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&rollbackMessage_sub); + ZVAL_UNDEF(&rollbackRecord_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&manager); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &rollbackMessage, &rollbackRecord); if (!rollbackMessage) { - ZEPHIR_CPY_WRT(rollbackMessage, ZEPHIR_GLOBAL(global_null)); + rollbackMessage = &rollbackMessage_sub; + ZEPHIR_CPY_WRT(rollbackMessage, &__$null); } else { ZEPHIR_SEPARATE_PARAM(rollbackMessage); } if (!rollbackRecord) { - rollbackRecord = ZEPHIR_GLOBAL(global_null); + rollbackRecord = &rollbackRecord_sub; + rollbackRecord = &__$null; } - ZEPHIR_OBS_VAR(manager); - zephir_read_property_this(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); - if (Z_TYPE_P(manager) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(NULL, manager, "notifyrollback", NULL, 0, this_ptr); + ZEPHIR_OBS_VAR(&manager); + zephir_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC); + if (Z_TYPE_P(&manager) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(NULL, &manager, "notifyrollback", NULL, 0, this_ptr); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(connection); - zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0, connection, "rollback", NULL, 0); + ZEPHIR_OBS_VAR(&connection); + zephir_read_property(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); + ZEPHIR_CALL_METHOD(&_0, &connection, "rollback", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_0)) { + if (zephir_is_true(&_0)) { if (!(zephir_is_true(rollbackMessage))) { ZEPHIR_INIT_NVAR(rollbackMessage); - ZVAL_STRING(rollbackMessage, "Transaction aborted", 1); + ZVAL_STRING(rollbackMessage, "Transaction aborted"); } if (Z_TYPE_P(rollbackRecord) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_rollbackRecord"), rollbackRecord TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rollbackRecord"), rollbackRecord); } - ZEPHIR_INIT_VAR(_1$$4); - object_init_ex(_1$$4, phalcon_mvc_model_transaction_failed_ce); - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_rollbackRecord"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _1$$4, "__construct", NULL, 392, rollbackMessage, _2$$4); + ZEPHIR_INIT_VAR(&_1$$4); + object_init_ex(&_1$$4, phalcon_mvc_model_transaction_failed_ce); + zephir_read_property(&_2$$4, this_ptr, SL("_rollbackRecord"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 347, rollbackMessage, &_2$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$4, "phalcon/mvc/model/transaction.zep", 159 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$4, "phalcon/mvc/model/transaction.zep", 159 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -245,20 +273,24 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, rollback) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, getConnection) { - zval *_0, *_1$$3 = NULL, *_2$$4; + zval _0, _1$$3, _2$$4; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_rollbackOnAbort"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - ZEPHIR_CALL_FUNCTION(&_1$$3, "connection_aborted", NULL, 393); + zephir_read_property(&_0, this_ptr, SL("_rollbackOnAbort"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + ZEPHIR_CALL_FUNCTION(&_1$$3, "connection_aborted", NULL, 348); zephir_check_call_status(); - if (zephir_is_true(_1$$3)) { - ZEPHIR_INIT_VAR(_2$$4); - ZVAL_STRING(_2$$4, "The request was aborted", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "rollback", NULL, 0, _2$$4); - zephir_check_temp_parameter(_2$$4); + if (zephir_is_true(&_1$$3)) { + ZEPHIR_INIT_VAR(&_2$$4); + ZVAL_STRING(&_2$$4, "The request was aborted"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "rollback", NULL, 0, &_2$$4); zephir_check_call_status(); } } @@ -271,8 +303,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, getConnection) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setIsNewTransaction) { - zval *isNew_param = NULL; + zval *isNew_param = NULL, __$true, __$false; zend_bool isNew; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &isNew_param); @@ -280,9 +316,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setIsNewTransaction) { if (isNew) { - zephir_update_property_this(getThis(), SL("_isNewTransaction"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isNewTransaction"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_isNewTransaction"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_isNewTransaction"), &__$false); } } @@ -292,8 +328,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setIsNewTransaction) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setRollbackOnAbort) { - zval *rollbackOnAbort_param = NULL; + zval *rollbackOnAbort_param = NULL, __$true, __$false; zend_bool rollbackOnAbort; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &rollbackOnAbort_param); @@ -301,9 +341,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setRollbackOnAbort) { if (rollbackOnAbort) { - zephir_update_property_this(getThis(), SL("_rollbackOnAbort"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rollbackOnAbort"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_rollbackOnAbort"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rollbackOnAbort"), &__$false); } } @@ -313,13 +353,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setRollbackOnAbort) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, isManaged) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_manager"), PH_NOISY_CC); - RETURN_MM_BOOL(Z_TYPE_P(_0) == IS_OBJECT); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_manager"), PH_NOISY_CC); + RETURN_MM_BOOL(Z_TYPE_P(&_0) == IS_OBJECT); } @@ -328,7 +371,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, isManaged) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, getMessages) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_messages"); @@ -339,13 +383,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, getMessages) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, isValid) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_connection"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "isundertransaction", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_connection"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "isundertransaction", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -356,13 +403,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, isValid) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setRollbackedRecord) { - zval *record; + zval *record, record_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); zephir_fetch_params(0, 1, 0, &record); - zephir_update_property_this(getThis(), SL("_rollbackRecord"), record TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rollbackRecord"), record); } diff --git a/ext/phalcon/mvc/model/transaction.zep.h b/ext/phalcon/mvc/model/transaction.zep.h index 3b72a1ce202..65c5d533875 100644 --- a/ext/phalcon/mvc/model/transaction.zep.h +++ b/ext/phalcon/mvc/model/transaction.zep.h @@ -18,25 +18,87 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction, setRollbackedRecord); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction___construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, autoBegin, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, autoBegin) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, service, IS_STRING, 1) +#else ZEND_ARG_INFO(0, service) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_settransactionmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, manager, Phalcon\\Mvc\\Model\\Transaction\\ManagerInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_rollback, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_begin, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_begin, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_commit, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_commit, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_rollback, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_rollback, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, rollbackMessage) ZEND_ARG_OBJ_INFO(0, rollbackRecord, Phalcon\\Mvc\\ModelInterface, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transaction_getconnection, 0, 0, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_getconnection, 0, 0, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_setisnewtransaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, isNew, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, isNew) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_setrollbackonabort, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, rollbackOnAbort, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, rollbackOnAbort) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_ismanaged, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_ismanaged, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_getmessages, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_getmessages, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_isvalid, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_isvalid, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_setrollbackedrecord, 0, 0, 1) @@ -46,15 +108,15 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_transaction_method_entry) { PHP_ME(Phalcon_Mvc_Model_Transaction, __construct, arginfo_phalcon_mvc_model_transaction___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Transaction, setTransactionManager, arginfo_phalcon_mvc_model_transaction_settransactionmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction, begin, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction, commit, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction, begin, arginfo_phalcon_mvc_model_transaction_begin, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction, commit, arginfo_phalcon_mvc_model_transaction_commit, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Transaction, rollback, arginfo_phalcon_mvc_model_transaction_rollback, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction, getConnection, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction, getConnection, arginfo_phalcon_mvc_model_transaction_getconnection, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Transaction, setIsNewTransaction, arginfo_phalcon_mvc_model_transaction_setisnewtransaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Transaction, setRollbackOnAbort, arginfo_phalcon_mvc_model_transaction_setrollbackonabort, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction, isManaged, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction, getMessages, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction, isValid, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction, isManaged, arginfo_phalcon_mvc_model_transaction_ismanaged, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction, getMessages, arginfo_phalcon_mvc_model_transaction_getmessages, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction, isValid, arginfo_phalcon_mvc_model_transaction_isvalid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Transaction, setRollbackedRecord, arginfo_phalcon_mvc_model_transaction_setrollbackedrecord, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/transaction/failed.zep.c b/ext/phalcon/mvc/model/transaction/failed.zep.c index 9f4079f84b4..f31da11c696 100644 --- a/ext/phalcon/mvc/model/transaction/failed.zep.c +++ b/ext/phalcon/mvc/model/transaction/failed.zep.c @@ -41,29 +41,35 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Transaction_Failed) { PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *record = NULL; - zval *message = NULL; + zval *message_param = NULL, *record = NULL, record_sub, __$null; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&record_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &message_param, &record); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!record) { - record = ZEPHIR_GLOBAL(global_null); + record = &record_sub; + record = &__$null; } - zephir_update_property_this(getThis(), SL("_record"), record TSRMLS_CC); - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_transaction_failed_ce, getThis(), "__construct", NULL, 0, message); + zephir_update_property_zval(this_ptr, SL("_record"), record); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_transaction_failed_ce, getThis(), "__construct", NULL, 0, &message); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -74,15 +80,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, getRecordMessages) { - zval *record = NULL; + zval record; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(record); - zephir_read_property_this(&record, this_ptr, SL("_record"), PH_NOISY_CC); - if (Z_TYPE_P(record) != IS_NULL) { - ZEPHIR_RETURN_CALL_METHOD(record, "getmessages", NULL, 0); + ZEPHIR_OBS_VAR(&record); + zephir_read_property(&record, this_ptr, SL("_record"), PH_NOISY_CC); + if (Z_TYPE_P(&record) != IS_NULL) { + ZEPHIR_RETURN_CALL_METHOD(&record, "getmessages", NULL, 0); zephir_check_call_status(); RETURN_MM(); } @@ -97,7 +106,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, getRecordMessages) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, getRecord) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_record"); diff --git a/ext/phalcon/mvc/model/transaction/failed.zep.h b/ext/phalcon/mvc/model/transaction/failed.zep.h index 267b39d980a..f5ef570d30c 100644 --- a/ext/phalcon/mvc/model/transaction/failed.zep.h +++ b/ext/phalcon/mvc/model/transaction/failed.zep.h @@ -8,13 +8,31 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, getRecordMessages); PHP_METHOD(Phalcon_Mvc_Model_Transaction_Failed, getRecord); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_failed___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\ModelInterface, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transaction_failed_getrecordmessages, 0, 0, Phalcon\\Mvc\\Model\\MessageInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_failed_getrecordmessages, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\MessageInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transaction_failed_getrecord, 0, 0, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_failed_getrecord, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_transaction_failed_method_entry) { PHP_ME(Phalcon_Mvc_Model_Transaction_Failed, __construct, arginfo_phalcon_mvc_model_transaction_failed___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Mvc_Model_Transaction_Failed, getRecordMessages, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction_Failed, getRecord, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction_Failed, getRecordMessages, arginfo_phalcon_mvc_model_transaction_failed_getrecordmessages, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction_Failed, getRecord, arginfo_phalcon_mvc_model_transaction_failed_getrecord, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/transaction/manager.zep.c b/ext/phalcon/mvc/model/transaction/manager.zep.c index 8eb9d83efb1..fa61901880b 100644 --- a/ext/phalcon/mvc/model/transaction/manager.zep.c +++ b/ext/phalcon/mvc/model/transaction/manager.zep.c @@ -96,23 +96,28 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *dependencyInjector = NULL; + zval *dependencyInjector = NULL, dependencyInjector_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &dependencyInjector); if (!dependencyInjector) { - ZEPHIR_CPY_WRT(dependencyInjector, ZEPHIR_GLOBAL(global_null)); + dependencyInjector = &dependencyInjector_sub; + ZEPHIR_CPY_WRT(dependencyInjector, &__$null); } else { ZEPHIR_SEPARATE_PARAM(dependencyInjector); } if (!(zephir_is_true(dependencyInjector))) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_CALL_CE_STATIC(dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_transaction_exception_ce, "A dependency injector container is required to obtain the services related to the ORM", "phalcon/mvc/model/transaction/manager.zep", 102); return; @@ -126,13 +131,16 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -141,7 +149,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setDI) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -153,24 +162,27 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getDI) { PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setDbService) { zval *service_param = NULL; - zval *service = NULL; + zval service; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&service); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &service_param); if (UNEXPECTED(Z_TYPE_P(service_param) != IS_STRING && Z_TYPE_P(service_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'service' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'service' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(service_param) == IS_STRING)) { - zephir_get_strval(service, service_param); + zephir_get_strval(&service, service_param); } else { - ZEPHIR_INIT_VAR(service); - ZVAL_EMPTY_STRING(service); + ZEPHIR_INIT_VAR(&service); + ZVAL_EMPTY_STRING(&service); } - zephir_update_property_this(getThis(), SL("_service"), service TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_service"), &service); RETURN_THIS(); } @@ -180,7 +192,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setDbService) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getDbService) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_service"); @@ -191,8 +204,12 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getDbService) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setRollbackPendent) { - zval *rollbackPendent_param = NULL; + zval *rollbackPendent_param = NULL, __$true, __$false; zend_bool rollbackPendent; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &rollbackPendent_param); @@ -200,9 +217,9 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setRollbackPendent) { if (rollbackPendent) { - zephir_update_property_this(getThis(), SL("_rollbackPendent"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rollbackPendent"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_rollbackPendent"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_rollbackPendent"), &__$false); } RETURN_THISW(); @@ -213,7 +230,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, setRollbackPendent) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getRollbackPendent) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_rollbackPendent"); @@ -224,11 +242,14 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getRollbackPendent) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, has) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_number"), PH_NOISY_CC); - RETURN_BOOL(ZEPHIR_GT_LONG(_0, 0)); + zephir_read_property(&_0, this_ptr, SL("_number"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(ZEPHIR_GT_LONG(&_0, 0)); } @@ -238,10 +259,19 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, has) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, get) { - zval *_2$$4; + zval _2$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *autoBegin_param = NULL, *_0, *_4, *_1$$3, *_3$$4; + zval *autoBegin_param = NULL, __$true, __$false, _0, _4, _1$$3, _3$$4; zend_bool autoBegin; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &autoBegin_param); @@ -253,32 +283,31 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, get) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_rollbackPendent"), PH_NOISY_CC); - if (zephir_is_true(_1$$3)) { - ZEPHIR_INIT_VAR(_2$$4); - zephir_create_array(_2$$4, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_2$$4, this_ptr); - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_STRING(_3$$4, "rollbackPendent", 1); - zephir_array_fast_append(_2$$4, _3$$4); - ZEPHIR_CALL_FUNCTION(NULL, "register_shutdown_function", NULL, 394, _2$$4); + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { + zephir_read_property(&_1$$3, this_ptr, SL("_rollbackPendent"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_1$$3)) { + ZEPHIR_INIT_VAR(&_2$$4); + zephir_create_array(&_2$$4, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_2$$4, this_ptr); + ZEPHIR_INIT_VAR(&_3$$4); + ZVAL_STRING(&_3$$4, "rollbackPendent"); + zephir_array_fast_append(&_2$$4, &_3$$4); + ZEPHIR_CALL_FUNCTION(NULL, "register_shutdown_function", NULL, 349, &_2$$4); zephir_check_call_status(); } if (1) { - zephir_update_property_this(getThis(), SL("_initialized"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_initialized"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_initialized"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_initialized"), &__$false); } } - ZEPHIR_INIT_VAR(_4); if (autoBegin) { - ZVAL_BOOL(_4, 1); + ZVAL_BOOL(&_4, 1); } else { - ZVAL_BOOL(_4, 0); + ZVAL_BOOL(&_4, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getorcreatetransaction", NULL, 0, _4); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getorcreatetransaction", NULL, 0, &_4); zephir_check_call_status(); RETURN_MM(); @@ -289,11 +318,18 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, get) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getOrCreateTransaction) { - HashTable *_2$$5; - HashPosition _1$$5; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *autoBegin_param = NULL, *dependencyInjector = NULL, *transaction = NULL, *transactions = NULL, *_0, *_5, *_6, **_3$$5, *_4$$7 = NULL; + zval *autoBegin_param = NULL, dependencyInjector, transaction, transactions, _0, _3, _4, *_1$$5, _2$$7; zend_bool autoBegin; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&transaction); + ZVAL_UNDEF(&transactions); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_2$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &autoBegin_param); @@ -305,49 +341,47 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getOrCreateTransaction) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_transaction_exception_ce, "A dependency injector container is required to obtain the services related to the ORM", "phalcon/mvc/model/transaction/manager.zep", 188); return; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_number"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - ZEPHIR_OBS_VAR(transactions); - zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); - if (Z_TYPE_P(transactions) == IS_ARRAY) { - zephir_is_iterable(transactions, &_2$$5, &_1$$5, 0, 1, "phalcon/mvc/model/transaction/manager.zep", 200); - for ( - ; zend_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS - ; zend_hash_move_backwards_ex(_2$$5, &_1$$5) - ) { - ZEPHIR_GET_HVALUE(transaction, _3$$5); - if (Z_TYPE_P(transaction) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_4$$7); - ZVAL_BOOL(_4$$7, 0); - ZEPHIR_CALL_METHOD(NULL, transaction, "setisnewtransaction", NULL, 0, _4$$7); + zephir_read_property(&_0, this_ptr, SL("_number"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + ZEPHIR_OBS_VAR(&transactions); + zephir_read_property(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); + if (Z_TYPE_P(&transactions) == IS_ARRAY) { + zephir_is_iterable(&transactions, 0, "phalcon/mvc/model/transaction/manager.zep", 200); + ZEND_HASH_REVERSE_FOREACH_VAL(Z_ARRVAL_P(&transactions), _1$$5) + { + ZEPHIR_INIT_NVAR(&transaction); + ZVAL_COPY(&transaction, _1$$5); + if (Z_TYPE_P(&transaction) == IS_OBJECT) { + ZVAL_BOOL(&_2$$7, 0); + ZEPHIR_CALL_METHOD(NULL, &transaction, "setisnewtransaction", NULL, 0, &_2$$7); zephir_check_call_status(); - RETURN_CCTOR(transaction); + RETURN_CCTOR(&transaction); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&transaction); } } - ZEPHIR_INIT_NVAR(transaction); - object_init_ex(transaction, phalcon_mvc_model_transaction_ce); - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_service"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_6); + ZEPHIR_INIT_NVAR(&transaction); + object_init_ex(&transaction, phalcon_mvc_model_transaction_ce); + zephir_read_property(&_3, this_ptr, SL("_service"), PH_NOISY_CC | PH_READONLY); if (autoBegin) { - ZVAL_BOOL(_6, 1); + ZVAL_BOOL(&_4, 1); } else { - ZVAL_BOOL(_6, 0); + ZVAL_BOOL(&_4, 0); } - ZEPHIR_CALL_METHOD(NULL, transaction, "__construct", NULL, 395, dependencyInjector, _6, _5); + ZEPHIR_CALL_METHOD(NULL, &transaction, "__construct", NULL, 350, &dependencyInjector, &_4, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, transaction, "settransactionmanager", NULL, 396, this_ptr); + ZEPHIR_CALL_METHOD(NULL, &transaction, "settransactionmanager", NULL, 351, this_ptr); zephir_check_call_status(); - zephir_update_property_array_append(this_ptr, SL("_transactions"), transaction TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_transactions"), &transaction TSRMLS_CC); RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_number") TSRMLS_CC)); - RETURN_CCTOR(transaction); + RETURN_CCTOR(&transaction); } @@ -357,6 +391,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, getOrCreateTransaction) { PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, rollbackPendent) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -371,31 +407,35 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, rollbackPendent) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, commit) { - HashTable *_1$$3; - HashPosition _0$$3; - zval *transactions = NULL, *transaction = NULL, *connection = NULL, **_2$$3, *_3$$4 = NULL; + zval transactions, transaction, connection, *_0$$3, _1$$4; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&transactions); + ZVAL_UNDEF(&transaction); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(transactions); - zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); - if (Z_TYPE_P(transactions) == IS_ARRAY) { - zephir_is_iterable(transactions, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/transaction/manager.zep", 233); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(transaction, _2$$3); - ZEPHIR_CALL_METHOD(&connection, transaction, "getconnection", NULL, 0); + ZEPHIR_OBS_VAR(&transactions); + zephir_read_property(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); + if (Z_TYPE_P(&transactions) == IS_ARRAY) { + zephir_is_iterable(&transactions, 0, "phalcon/mvc/model/transaction/manager.zep", 233); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&transactions), _0$$3) + { + ZEPHIR_INIT_NVAR(&transaction); + ZVAL_COPY(&transaction, _0$$3); + ZEPHIR_CALL_METHOD(&connection, &transaction, "getconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3$$4, connection, "isundertransaction", NULL, 0); + ZEPHIR_CALL_METHOD(&_1$$4, &connection, "isundertransaction", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_3$$4)) { - ZEPHIR_CALL_METHOD(NULL, connection, "commit", NULL, 0); + if (zephir_is_true(&_1$$4)) { + ZEPHIR_CALL_METHOD(NULL, &connection, "commit", NULL, 0); zephir_check_call_status(); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&transaction); } ZEPHIR_MM_RESTORE(); @@ -409,44 +449,51 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, commit) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, rollback) { - HashTable *_1$$3; - HashPosition _0$$3; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *collect = NULL, *transactions = NULL, *transaction = NULL, *connection = NULL, **_2$$3, *_3$$4 = NULL; + zval *collect = NULL, collect_sub, __$true, transactions, transaction, connection, *_0$$3, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&collect_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&transactions); + ZVAL_UNDEF(&transaction); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &collect); if (!collect) { - collect = ZEPHIR_GLOBAL(global_true); + collect = &collect_sub; + collect = &__$true; } - ZEPHIR_OBS_VAR(transactions); - zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); - if (Z_TYPE_P(transactions) == IS_ARRAY) { - zephir_is_iterable(transactions, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/transaction/manager.zep", 258); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(transaction, _2$$3); - ZEPHIR_CALL_METHOD(&connection, transaction, "getconnection", NULL, 0); + ZEPHIR_OBS_VAR(&transactions); + zephir_read_property(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); + if (Z_TYPE_P(&transactions) == IS_ARRAY) { + zephir_is_iterable(&transactions, 0, "phalcon/mvc/model/transaction/manager.zep", 258); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&transactions), _0$$3) + { + ZEPHIR_INIT_NVAR(&transaction); + ZVAL_COPY(&transaction, _0$$3); + ZEPHIR_CALL_METHOD(&connection, &transaction, "getconnection", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3$$4, connection, "isundertransaction", NULL, 0); + ZEPHIR_CALL_METHOD(&_1$$4, &connection, "isundertransaction", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(_3$$4)) { - ZEPHIR_CALL_METHOD(NULL, connection, "rollback", NULL, 0); + if (zephir_is_true(&_1$$4)) { + ZEPHIR_CALL_METHOD(NULL, &connection, "rollback", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, connection, "close", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &connection, "close", NULL, 0); zephir_check_call_status(); } if (zephir_is_true(collect)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_collecttransaction", &_4, 0, transaction); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_collecttransaction", &_2, 0, &transaction); zephir_check_call_status(); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&transaction); } ZEPHIR_MM_RESTORE(); @@ -458,7 +505,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, rollback) { PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, notifyRollback) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *transaction; + zval *transaction, transaction_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&transaction_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &transaction); @@ -477,7 +527,10 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, notifyRollback) { PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, notifyCommit) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *transaction; + zval *transaction, transaction_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&transaction_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &transaction); @@ -495,33 +548,37 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, notifyCommit) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, _collectTransaction) { - HashTable *_1$$3; - HashPosition _0$$3; - zval *transaction, *transactions = NULL, *newTransactions = NULL, *managedTransaction = NULL, **_2$$3; + zval *transaction, transaction_sub, transactions, newTransactions, managedTransaction, *_0$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&transaction_sub); + ZVAL_UNDEF(&transactions); + ZVAL_UNDEF(&newTransactions); + ZVAL_UNDEF(&managedTransaction); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &transaction); - ZEPHIR_OBS_VAR(transactions); - zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); - if (zephir_fast_count_int(transactions TSRMLS_CC)) { - ZEPHIR_INIT_VAR(newTransactions); - array_init(newTransactions); - zephir_is_iterable(transactions, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/model/transaction/manager.zep", 295); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(managedTransaction, _2$$3); - if (!ZEPHIR_IS_EQUAL(managedTransaction, transaction)) { + ZEPHIR_OBS_VAR(&transactions); + zephir_read_property(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); + if (zephir_fast_count_int(&transactions TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&newTransactions); + array_init(&newTransactions); + zephir_is_iterable(&transactions, 0, "phalcon/mvc/model/transaction/manager.zep", 295); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&transactions), _0$$3) + { + ZEPHIR_INIT_NVAR(&managedTransaction); + ZVAL_COPY(&managedTransaction, _0$$3); + if (!ZEPHIR_IS_EQUAL(&managedTransaction, transaction)) { zephir_array_append(&newTransactions, transaction, PH_SEPARATE, "phalcon/mvc/model/transaction/manager.zep", 289); } else { RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_number") TSRMLS_CC)); } - } - zephir_update_property_this(getThis(), SL("_transactions"), newTransactions TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&managedTransaction); + zephir_update_property_zval(this_ptr, SL("_transactions"), &newTransactions); } ZEPHIR_MM_RESTORE(); @@ -532,25 +589,28 @@ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, _collectTransaction) { */ PHP_METHOD(Phalcon_Mvc_Model_Transaction_Manager, collectTransactions) { - HashTable *_2$$3; - HashPosition _1$$3; - zval *transactions = NULL, *_0$$3 = NULL, **_3$$3; + zval __$null, transactions, _0$$3, *_1$$3; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&transactions); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(transactions); - zephir_read_property_this(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); - if (zephir_fast_count_int(transactions TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_is_iterable(transactions, &_2$$3, &_1$$3, 0, 0, "phalcon/mvc/model/transaction/manager.zep", 311); - for ( - ; zend_hash_get_current_data_ex(_2$$3, (void**) &_3$$3, &_1$$3) == SUCCESS - ; zend_hash_move_forward_ex(_2$$3, &_1$$3) - ) { - ZEPHIR_GET_HVALUE(_0$$3, _3$$3); + ZEPHIR_OBS_VAR(&transactions); + zephir_read_property(&transactions, this_ptr, SL("_transactions"), PH_NOISY_CC); + if (zephir_fast_count_int(&transactions TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_0$$3); + zephir_is_iterable(&transactions, 0, "phalcon/mvc/model/transaction/manager.zep", 311); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&transactions), _1$$3) + { + ZEPHIR_INIT_NVAR(&_0$$3); + ZVAL_COPY(&_0$$3, _1$$3); RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_number") TSRMLS_CC)); - } - zephir_update_property_this(getThis(), SL("_transactions"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_0$$3); + zephir_update_property_zval(this_ptr, SL("_transactions"), &__$null); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/model/transaction/manager.zep.h b/ext/phalcon/mvc/model/transaction/manager.zep.h index b8a4aa3862e..22e312f03be 100644 --- a/ext/phalcon/mvc/model/transaction/manager.zep.h +++ b/ext/phalcon/mvc/model/transaction/manager.zep.h @@ -29,20 +29,80 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_setdi, 0, 0 ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_setdbservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_setdbservice, 0, 1, Phalcon\\Mvc\\Model\\Transaction\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_setdbservice, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Transaction\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, service, IS_STRING, 0) +#else ZEND_ARG_INFO(0, service) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_getdbservice, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_getdbservice, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_setrollbackpendent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_setrollbackpendent, 0, 1, Phalcon\\Mvc\\Model\\Transaction\\Manager, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_setrollbackpendent, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Model\\Transaction\\Manager", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, rollbackPendent, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, rollbackPendent) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_getrollbackpendent, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_getrollbackpendent, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_has, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_has, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_get, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_get, 0, 0, Phalcon\\Mvc\\Model\\TransactionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_get, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\TransactionInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, autoBegin, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, autoBegin) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_getorcreatetransaction, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_getorcreatetransaction, 0, 0, Phalcon\\Mvc\\Model\\TransactionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_getorcreatetransaction, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\TransactionInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, autoBegin, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, autoBegin) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_manager_rollback, 0, 0, 0) @@ -64,12 +124,12 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_transaction_manager_method_entry) { PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, __construct, arginfo_phalcon_mvc_model_transaction_manager___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, setDI, arginfo_phalcon_mvc_model_transaction_manager_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, getDI, arginfo_phalcon_mvc_model_transaction_manager_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, setDbService, arginfo_phalcon_mvc_model_transaction_manager_setdbservice, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, getDbService, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, getDbService, arginfo_phalcon_mvc_model_transaction_manager_getdbservice, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, setRollbackPendent, arginfo_phalcon_mvc_model_transaction_manager_setrollbackpendent, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, getRollbackPendent, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, has, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, getRollbackPendent, arginfo_phalcon_mvc_model_transaction_manager_getrollbackpendent, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, has, arginfo_phalcon_mvc_model_transaction_manager_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, get, arginfo_phalcon_mvc_model_transaction_manager_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, getOrCreateTransaction, arginfo_phalcon_mvc_model_transaction_manager_getorcreatetransaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Transaction_Manager, rollbackPendent, NULL, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/mvc/model/transaction/managerinterface.zep.h b/ext/phalcon/mvc/model/transaction/managerinterface.zep.h index 22ea3d13da5..878a891c2bf 100644 --- a/ext/phalcon/mvc/model/transaction/managerinterface.zep.h +++ b/ext/phalcon/mvc/model/transaction/managerinterface.zep.h @@ -3,8 +3,23 @@ extern zend_class_entry *phalcon_mvc_model_transaction_managerinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Transaction_ManagerInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_managerinterface_get, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_managerinterface_has, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_managerinterface_has, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transaction_managerinterface_get, 0, 0, Phalcon\\Mvc\\Model\\TransactionInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transaction_managerinterface_get, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\TransactionInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, autoBegin, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, autoBegin) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_managerinterface_rollback, 0, 0, 0) @@ -20,7 +35,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transaction_managerinterface_no ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_transaction_managerinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Transaction_ManagerInterface, has, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Transaction_ManagerInterface, has, arginfo_phalcon_mvc_model_transaction_managerinterface_has) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Transaction_ManagerInterface, get, arginfo_phalcon_mvc_model_transaction_managerinterface_get) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Transaction_ManagerInterface, rollbackPendent, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_Transaction_ManagerInterface, commit, NULL) diff --git a/ext/phalcon/mvc/model/transactioninterface.zep.h b/ext/phalcon/mvc/model/transactioninterface.zep.h index 05139ef21af..69b8c3570db 100644 --- a/ext/phalcon/mvc/model/transactioninterface.zep.h +++ b/ext/phalcon/mvc/model/transactioninterface.zep.h @@ -7,17 +7,67 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_settransac ZEND_ARG_OBJ_INFO(0, manager, Phalcon\\Mvc\\Model\\Transaction\\ManagerInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_begin, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_begin, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_commit, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_commit, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_rollback, 0, 0, 0) ZEND_ARG_INFO(0, rollbackMessage) ZEND_ARG_OBJ_INFO(0, rollbackRecord, Phalcon\\Mvc\\ModelInterface, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_getconnection, 0, 0, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_getconnection, 0, 0, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_setisnewtransaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, isNew, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, isNew) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_setrollbackonabort, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, rollbackOnAbort, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, rollbackOnAbort) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_ismanaged, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_ismanaged, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_getmessages, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_getmessages, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_isvalid, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_isvalid, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_transactioninterface_setrollbackedrecord, 0, 0, 1) @@ -26,15 +76,15 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_transactioninterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, setTransactionManager, arginfo_phalcon_mvc_model_transactioninterface_settransactionmanager) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, begin, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, commit, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, begin, arginfo_phalcon_mvc_model_transactioninterface_begin) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, commit, arginfo_phalcon_mvc_model_transactioninterface_commit) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, rollback, arginfo_phalcon_mvc_model_transactioninterface_rollback) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, getConnection, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, getConnection, arginfo_phalcon_mvc_model_transactioninterface_getconnection) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, setIsNewTransaction, arginfo_phalcon_mvc_model_transactioninterface_setisnewtransaction) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, setRollbackOnAbort, arginfo_phalcon_mvc_model_transactioninterface_setrollbackonabort) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, isManaged, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, getMessages, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, isValid, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, isManaged, arginfo_phalcon_mvc_model_transactioninterface_ismanaged) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, getMessages, arginfo_phalcon_mvc_model_transactioninterface_getmessages) + PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, isValid, arginfo_phalcon_mvc_model_transactioninterface_isvalid) PHP_ABSTRACT_ME(Phalcon_Mvc_Model_TransactionInterface, setRollbackedRecord, arginfo_phalcon_mvc_model_transactioninterface_setrollbackedrecord) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/validationfailed.zep.c b/ext/phalcon/mvc/model/validationfailed.zep.c index ccdfd51ce5a..709e39c2490 100644 --- a/ext/phalcon/mvc/model/validationfailed.zep.c +++ b/ext/phalcon/mvc/model/validationfailed.zep.c @@ -47,27 +47,33 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_ValidationFailed) { PHP_METHOD(Phalcon_Mvc_Model_ValidationFailed, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *validationMessages = NULL; - zval *model, *validationMessages_param = NULL, *messageStr = NULL, *message = NULL; + zval validationMessages; + zval *model, model_sub, *validationMessages_param = NULL, messageStr, message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&model_sub); + ZVAL_UNDEF(&messageStr); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&validationMessages); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &model, &validationMessages_param); - validationMessages = validationMessages_param; + ZEPHIR_OBS_COPY_OR_DUP(&validationMessages, validationMessages_param); - if (zephir_fast_count_int(validationMessages TSRMLS_CC) > 0) { - ZEPHIR_OBS_VAR(message); - zephir_array_fetch_long(&message, validationMessages, 0, PH_NOISY, "phalcon/mvc/model/validationfailed.zep", 51 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&messageStr, message, "getmessage", NULL, 0); + if (zephir_fast_count_int(&validationMessages TSRMLS_CC) > 0) { + ZEPHIR_OBS_VAR(&message); + zephir_array_fetch_long(&message, &validationMessages, 0, PH_NOISY, "phalcon/mvc/model/validationfailed.zep", 51 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&messageStr, &message, "getmessage", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(messageStr); - ZVAL_STRING(messageStr, "Validation failed", 1); + ZEPHIR_INIT_NVAR(&messageStr); + ZVAL_STRING(&messageStr, "Validation failed"); } - zephir_update_property_this(getThis(), SL("_model"), model TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_messages"), validationMessages TSRMLS_CC); - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_validationfailed_ce, getThis(), "__construct", NULL, 0, messageStr); + zephir_update_property_zval(this_ptr, SL("_model"), model); + zephir_update_property_zval(this_ptr, SL("_messages"), &validationMessages); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_model_validationfailed_ce, getThis(), "__construct", NULL, 0, &messageStr); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -78,7 +84,8 @@ PHP_METHOD(Phalcon_Mvc_Model_ValidationFailed, __construct) { */ PHP_METHOD(Phalcon_Mvc_Model_ValidationFailed, getModel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_model"); @@ -89,7 +96,8 @@ PHP_METHOD(Phalcon_Mvc_Model_ValidationFailed, getModel) { */ PHP_METHOD(Phalcon_Mvc_Model_ValidationFailed, getMessages) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_messages"); diff --git a/ext/phalcon/mvc/model/validationfailed.zep.h b/ext/phalcon/mvc/model/validationfailed.zep.h index 02537007cc6..68d641eea97 100644 --- a/ext/phalcon/mvc/model/validationfailed.zep.h +++ b/ext/phalcon/mvc/model/validationfailed.zep.h @@ -12,9 +12,23 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validationfailed___construct, 0 ZEND_ARG_ARRAY_INFO(0, validationMessages, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_validationfailed_getmodel, 0, 0, Phalcon\\Mvc\\Model, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validationfailed_getmodel, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_model_validationfailed_getmessages, 0, 0, Phalcon\\Mvc\\Model\\Message, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validationfailed_getmessages, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\Message", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_model_validationfailed_method_entry) { PHP_ME(Phalcon_Mvc_Model_ValidationFailed, __construct, arginfo_phalcon_mvc_model_validationfailed___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Mvc_Model_ValidationFailed, getModel, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Model_ValidationFailed, getMessages, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_ValidationFailed, getModel, arginfo_phalcon_mvc_model_validationfailed_getmodel, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_ValidationFailed, getMessages, arginfo_phalcon_mvc_model_validationfailed_getmessages, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/model/validator.zep.c b/ext/phalcon/mvc/model/validator.zep.c index 45c9ed931f3..73e5ce046d4 100644 --- a/ext/phalcon/mvc/model/validator.zep.c +++ b/ext/phalcon/mvc/model/validator.zep.c @@ -54,14 +54,19 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator) { PHP_METHOD(Phalcon_Mvc_Model_Validator, __construct) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &options_param); + ZVAL_UNDEF(&options); - options = options_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &options_param); + + ZEPHIR_OBS_COPY_OR_DUP(&options, options_param); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &options); + ZEPHIR_MM_RESTORE(); } @@ -75,47 +80,59 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator, __construct) { PHP_METHOD(Phalcon_Mvc_Model_Validator, appendMessage) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *message_param = NULL, *field = NULL, *type = NULL, *_0$$3, _1$$3, _2$$3, *_3; - zval *message = NULL; + zval *message_param = NULL, *field = NULL, field_sub, *type = NULL, type_sub, __$null, _0$$3, _1$$3, _2$$3, _3; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&field_sub); + ZVAL_UNDEF(&type_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &message_param, &field, &type); if (UNEXPECTED(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(message_param) == IS_STRING)) { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } else { - ZEPHIR_INIT_VAR(message); - ZVAL_EMPTY_STRING(message); + ZEPHIR_INIT_VAR(&message); + ZVAL_EMPTY_STRING(&message); } if (!field) { - field = ZEPHIR_GLOBAL(global_null); + field = &field_sub; + field = &__$null; } if (!type) { - ZEPHIR_CPY_WRT(type, ZEPHIR_GLOBAL(global_null)); + type = &type_sub; + ZEPHIR_CPY_WRT(type, &__$null); } else { ZEPHIR_SEPARATE_PARAM(type); } if (!(zephir_is_true(type))) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_get_class(_0$$3, this_ptr, 0 TSRMLS_CC); - ZEPHIR_SINIT_VAR(_1$$3); - ZVAL_STRING(&_1$$3, "Validator", 0); - ZEPHIR_SINIT_VAR(_2$$3); - ZVAL_STRING(&_2$$3, "", 0); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_get_class(&_0$$3, this_ptr, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "Validator"); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, ""); ZEPHIR_INIT_NVAR(type); - zephir_fast_str_replace(&type, &_1$$3, &_2$$3, _0$$3 TSRMLS_CC); + zephir_fast_str_replace(type, &_1$$3, &_2$$3, &_0$$3 TSRMLS_CC); } - ZEPHIR_INIT_VAR(_3); - object_init_ex(_3, phalcon_mvc_model_message_ce); - ZEPHIR_CALL_METHOD(NULL, _3, "__construct", NULL, 8, message, field, type); + ZEPHIR_INIT_VAR(&_3); + object_init_ex(&_3, phalcon_mvc_model_message_ce); + ZEPHIR_CALL_METHOD(NULL, &_3, "__construct", NULL, 3, &message, field, type); zephir_check_call_status(); - zephir_update_property_array_append(this_ptr, SL("_messages"), _3 TSRMLS_CC); + zephir_update_property_array_append(this_ptr, SL("_messages"), &_3 TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -125,7 +142,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator, appendMessage) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator, getMessages) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_messages"); @@ -138,7 +156,8 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator, getMessages) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator, getOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -149,31 +168,38 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator, getOptions) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator, getOption) { - zval *option_param = NULL, *defaultValue = NULL, *options = NULL, *value = NULL; - zval *option = NULL; + zval *option_param = NULL, *defaultValue = NULL, defaultValue_sub, options, value; + zval option; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &option_param, &defaultValue); if (UNEXPECTED(Z_TYPE_P(option_param) != IS_STRING && Z_TYPE_P(option_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(option_param) == IS_STRING)) { - zephir_get_strval(option, option_param); + zephir_get_strval(&option, option_param); } else { - ZEPHIR_INIT_VAR(option); - ZVAL_EMPTY_STRING(option); + ZEPHIR_INIT_VAR(&option); + ZVAL_EMPTY_STRING(&option); } if (!defaultValue) { + defaultValue = &defaultValue_sub; ZEPHIR_INIT_VAR(defaultValue); - ZVAL_STRING(defaultValue, "", 1); + ZVAL_STRING(defaultValue, ""); } - options = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&value, options, option, 1 TSRMLS_CC)) { - RETURN_CTOR(value); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&value, &options, &option, 1 TSRMLS_CC)) { + RETURN_CTOR(&value); } RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); @@ -185,57 +211,52 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator, getOption) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator, isSetOption) { - zval *option_param = NULL, *_0; - zval *option = NULL; + zval *option_param = NULL, _0; + zval option; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &option_param); if (UNEXPECTED(Z_TYPE_P(option_param) != IS_STRING && Z_TYPE_P(option_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(option_param) == IS_STRING)) { - zephir_get_strval(option, option_param); + zephir_get_strval(&option, option_param); } else { - ZEPHIR_INIT_VAR(option); - ZVAL_EMPTY_STRING(option); + ZEPHIR_INIT_VAR(&option); + ZVAL_EMPTY_STRING(&option); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, option)); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &option)); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_Validator(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Model_Validator(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_1$$3; + zval _0, _1$$3; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_messages"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_messages"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_messages"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_messages"), &_1$$3); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/model/validator.zep.h b/ext/phalcon/mvc/model/validator.zep.h index 410fbc76885..49d8c5a9c08 100644 --- a/ext/phalcon/mvc/model/validator.zep.h +++ b/ext/phalcon/mvc/model/validator.zep.h @@ -9,31 +9,54 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator, getMessages); PHP_METHOD(Phalcon_Mvc_Model_Validator, getOptions); PHP_METHOD(Phalcon_Mvc_Model_Validator, getOption); PHP_METHOD(Phalcon_Mvc_Model_Validator, isSetOption); -zend_object_value zephir_init_properties_Phalcon_Mvc_Model_Validator(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Model_Validator(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator___construct, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_appendmessage, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) +#endif ZEND_ARG_INFO(0, field) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_getmessages, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_getmessages, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_getoption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +#else ZEND_ARG_INFO(0, option) +#endif ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_issetoption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_issetoption, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_issetoption, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +#else ZEND_ARG_INFO(0, option) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_model_validator_method_entry) { PHP_ME(Phalcon_Mvc_Model_Validator, __construct, arginfo_phalcon_mvc_model_validator___construct, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Model_Validator, appendMessage, arginfo_phalcon_mvc_model_validator_appendmessage, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_Model_Validator, getMessages, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Model_Validator, getMessages, arginfo_phalcon_mvc_model_validator_getmessages, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Validator, getOptions, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Validator, getOption, arginfo_phalcon_mvc_model_validator_getoption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Model_Validator, isSetOption, arginfo_phalcon_mvc_model_validator_issetoption, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/mvc/model/validator/email.zep.c b/ext/phalcon/mvc/model/validator/email.zep.c index 66bc158bcea..ff89393487f 100644 --- a/ext/phalcon/mvc/model/validator/email.zep.c +++ b/ext/phalcon/mvc/model/validator/email.zep.c @@ -65,62 +65,70 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Email) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_Email, validate) { - zval *_6$$5; + zval _6$$5; zend_bool _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *record, *field = NULL, *value = NULL, *message = NULL, *_0 = NULL, *_1 = NULL, _3, *_4 = NULL, *_5$$5 = NULL, *_7$$5 = NULL; + zval *record, record_sub, field, value, message, _0, _1, _3, _4, _5$$5, _7$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_6$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) != IS_STRING) { + if (Z_TYPE_P(&field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/email.zep", 71); return; } - ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowEmpty"); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - _2 = zephir_is_true(_1); + _2 = zephir_is_true(&_1); if (_2) { - _2 = ZEPHIR_IS_EMPTY(value); + _2 = ZEPHIR_IS_EMPTY(&value); } if (_2) { RETURN_MM_BOOL(1); } - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, 274); - ZEPHIR_CALL_FUNCTION(&_4, "filter_var", NULL, 212, value, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "filter_var", NULL, 188, &value, &_3); zephir_check_call_status(); - if (!(zephir_is_true(_4))) { - ZEPHIR_INIT_VAR(_5$$5); - ZVAL_STRING(_5$$5, "message", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _5$$5); - zephir_check_temp_parameter(_5$$5); + if (!(zephir_is_true(&_4))) { + ZEPHIR_INIT_VAR(&_5$$5); + ZVAL_STRING(&_5$$5, "message"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_5$$5); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "Value of field ':field' must have a valid e-mail format", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "Value of field ':field' must have a valid e-mail format"); } - ZEPHIR_INIT_VAR(_6$$5); - zephir_create_array(_6$$5, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$5); + zephir_create_array(&_6$$5, 1, 0 TSRMLS_CC); zephir_array_update_string(&_6$$5, SL(":field"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_7$$5, "strtr", NULL, 27, message, _6$$5); + ZEPHIR_CALL_FUNCTION(&_7$$5, "strtr", NULL, 22, &message, &_6$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_5$$5); - ZVAL_STRING(_5$$5, "Email", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _7$$5, field, _5$$5); - zephir_check_temp_parameter(_5$$5); + ZEPHIR_INIT_NVAR(&_5$$5); + ZVAL_STRING(&_5$$5, "Email"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_7$$5, &field, &_5$$5); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/email.zep.h b/ext/phalcon/mvc/model/validator/email.zep.h index d7c2b5a1b55..a36a45d68c7 100644 --- a/ext/phalcon/mvc/model/validator/email.zep.h +++ b/ext/phalcon/mvc/model/validator/email.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Email); PHP_METHOD(Phalcon_Mvc_Model_Validator_Email, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_email_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_email_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_email_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validator/exclusionin.zep.c b/ext/phalcon/mvc/model/validator/exclusionin.zep.c index 767fee99061..38ec2468fa0 100644 --- a/ext/phalcon/mvc/model/validator/exclusionin.zep.c +++ b/ext/phalcon/mvc/model/validator/exclusionin.zep.c @@ -67,79 +67,86 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Exclusionin) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_Exclusionin, validate) { - zval *_5$$7; + zval _5$$7; zend_bool _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *record, *field = NULL, *domain = NULL, *value = NULL, *message = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_4$$7 = NULL, *_6$$7 = NULL; + zval *record, record_sub, field, domain, value, message, _0, _1, _2, _4$$7, _6$$7; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_5$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) != IS_STRING) { + if (Z_TYPE_P(&field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/exclusionin.zep", 73); return; } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "domain", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "domain"); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'domain' is required by this validator", "phalcon/mvc/model/validator/exclusionin.zep", 80); return; } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "domain", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "domain"); + ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(domain) != IS_ARRAY) { + if (Z_TYPE_P(&domain) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Option 'domain' must be an array", "phalcon/mvc/model/validator/exclusionin.zep", 85); return; } - ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowEmpty"); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - _3 = zephir_is_true(_2); + _3 = zephir_is_true(&_2); if (_3) { - _3 = ZEPHIR_IS_EMPTY(value); + _3 = ZEPHIR_IS_EMPTY(&value); } if (_3) { RETURN_MM_BOOL(1); } - if (zephir_fast_in_array(value, domain TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_4$$7); - ZVAL_STRING(_4$$7, "message", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _4$$7); - zephir_check_temp_parameter(_4$$7); + if (zephir_fast_in_array(&value, &domain TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_4$$7); + ZVAL_STRING(&_4$$7, "message"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_4$$7); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "Value of field ':field' must not be part of list: :domain", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "Value of field ':field' must not be part of list: :domain"); } - ZEPHIR_INIT_VAR(_5$$7); - zephir_create_array(_5$$7, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$7); + zephir_create_array(&_5$$7, 2, 0 TSRMLS_CC); zephir_array_update_string(&_5$$7, SL(":field"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_4$$7); - zephir_fast_join_str(_4$$7, SL(", "), domain TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_4$$7); + zephir_fast_join_str(&_4$$7, SL(", "), &domain TSRMLS_CC); zephir_array_update_string(&_5$$7, SL(":domain"), &_4$$7, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_6$$7, "strtr", NULL, 27, message, _5$$7); + ZEPHIR_CALL_FUNCTION(&_6$$7, "strtr", NULL, 22, &message, &_5$$7); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_4$$7); - ZVAL_STRING(_4$$7, "Exclusion", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _6$$7, field, _4$$7); - zephir_check_temp_parameter(_4$$7); + ZEPHIR_INIT_NVAR(&_4$$7); + ZVAL_STRING(&_4$$7, "Exclusion"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_6$$7, &field, &_4$$7); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/exclusionin.zep.h b/ext/phalcon/mvc/model/validator/exclusionin.zep.h index b3fdc96ce66..ce1e503b177 100644 --- a/ext/phalcon/mvc/model/validator/exclusionin.zep.h +++ b/ext/phalcon/mvc/model/validator/exclusionin.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Exclusionin); PHP_METHOD(Phalcon_Mvc_Model_Validator_Exclusionin, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_exclusionin_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_exclusionin_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_exclusionin_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validator/inclusionin.zep.c b/ext/phalcon/mvc/model/validator/inclusionin.zep.c index 1967320c450..7747c9e56d5 100644 --- a/ext/phalcon/mvc/model/validator/inclusionin.zep.c +++ b/ext/phalcon/mvc/model/validator/inclusionin.zep.c @@ -67,99 +67,108 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Inclusionin) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_Inclusionin, validate) { - zval *_8$$9; + zval _8$$9; zend_bool _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *record, *field = NULL, *domain = NULL, *value = NULL, *message = NULL, *strict = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_4 = NULL, *_6 = NULL, *_5$$7, *_7$$9 = NULL, *_9$$9 = NULL; + zval *record, record_sub, field, domain, value, message, strict, _0, _1, _2, _4, _6, _5$$7, _7$$9, _9$$9; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&domain); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&strict); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_8$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) != IS_STRING) { + if (Z_TYPE_P(&field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/inclusionin.zep", 71); return; } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "domain", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "domain"); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_1)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The option 'domain' is required for this validator", "phalcon/mvc/model/validator/inclusionin.zep", 78); return; } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "domain", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "domain"); + ZEPHIR_CALL_METHOD(&domain, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(domain) != IS_ARRAY) { + if (Z_TYPE_P(&domain) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Option 'domain' must be an array", "phalcon/mvc/model/validator/inclusionin.zep", 83); return; } - ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowEmpty"); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - _3 = zephir_is_true(_2); + _3 = zephir_is_true(&_2); if (_3) { - _3 = ZEPHIR_IS_EMPTY(value); + _3 = ZEPHIR_IS_EMPTY(&value); } if (_3) { RETURN_MM_BOOL(1); } - ZEPHIR_INIT_VAR(strict); - ZVAL_BOOL(strict, 0); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "strict", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&strict); + ZVAL_BOOL(&strict, 0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "strict"); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - if (zephir_is_true(_4)) { - if (Z_TYPE_P(strict) != IS_BOOL) { + if (zephir_is_true(&_4)) { + if (((Z_TYPE_P(&strict) == IS_TRUE || Z_TYPE_P(&strict) == IS_FALSE) != 1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Option 'strict' must be a boolean", "phalcon/mvc/model/validator/inclusionin.zep", 95); return; } - ZEPHIR_INIT_VAR(_5$$7); - ZVAL_STRING(_5$$7, "strict", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&strict, this_ptr, "getoption", NULL, 0, _5$$7); - zephir_check_temp_parameter(_5$$7); + ZEPHIR_INIT_VAR(&_5$$7); + ZVAL_STRING(&_5$$7, "strict"); + ZEPHIR_CALL_METHOD(&strict, this_ptr, "getoption", NULL, 0, &_5$$7); zephir_check_call_status(); } - ZEPHIR_CALL_FUNCTION(&_6, "in_array", NULL, 397, value, domain, strict); + ZEPHIR_CALL_FUNCTION(&_6, "in_array", NULL, 352, &value, &domain, &strict); zephir_check_call_status(); - if (!(zephir_is_true(_6))) { - ZEPHIR_INIT_VAR(_7$$9); - ZVAL_STRING(_7$$9, "message", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _7$$9); - zephir_check_temp_parameter(_7$$9); + if (!(zephir_is_true(&_6))) { + ZEPHIR_INIT_VAR(&_7$$9); + ZVAL_STRING(&_7$$9, "message"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_7$$9); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "Value of field ':field' must be part of list: :domain", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "Value of field ':field' must be part of list: :domain"); } - ZEPHIR_INIT_VAR(_8$$9); - zephir_create_array(_8$$9, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_8$$9); + zephir_create_array(&_8$$9, 2, 0 TSRMLS_CC); zephir_array_update_string(&_8$$9, SL(":field"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_7$$9); - zephir_fast_join_str(_7$$9, SL(", "), domain TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_7$$9); + zephir_fast_join_str(&_7$$9, SL(", "), &domain TSRMLS_CC); zephir_array_update_string(&_8$$9, SL(":domain"), &_7$$9, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_9$$9, "strtr", NULL, 27, message, _8$$9); + ZEPHIR_CALL_FUNCTION(&_9$$9, "strtr", NULL, 22, &message, &_8$$9); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_7$$9); - ZVAL_STRING(_7$$9, "Inclusion", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _9$$9, field, _7$$9); - zephir_check_temp_parameter(_7$$9); + ZEPHIR_INIT_NVAR(&_7$$9); + ZVAL_STRING(&_7$$9, "Inclusion"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_9$$9, &field, &_7$$9); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/inclusionin.zep.h b/ext/phalcon/mvc/model/validator/inclusionin.zep.h index ea2c6208c2e..1e7f7d03f0c 100644 --- a/ext/phalcon/mvc/model/validator/inclusionin.zep.h +++ b/ext/phalcon/mvc/model/validator/inclusionin.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Inclusionin); PHP_METHOD(Phalcon_Mvc_Model_Validator_Inclusionin, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_inclusionin_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_inclusionin_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_inclusionin_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validator/ip.zep.c b/ext/phalcon/mvc/model/validator/ip.zep.c index 61f98df4c63..b4aa4229792 100644 --- a/ext/phalcon/mvc/model/validator/ip.zep.c +++ b/ext/phalcon/mvc/model/validator/ip.zep.c @@ -83,9 +83,9 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Ip) { ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\Model\\Validator, Ip, phalcon, mvc_model_validator_ip, phalcon_mvc_model_validator_ce, phalcon_mvc_model_validator_ip_method_entry, 0); - zend_declare_class_constant_long(phalcon_mvc_model_validator_ip_ce, SL("VERSION_4"), 1048576 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_validator_ip_ce, SL("VERSION_4"), 1048576); - zend_declare_class_constant_long(phalcon_mvc_model_validator_ip_ce, SL("VERSION_6"), 2097152 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_model_validator_ip_ce, SL("VERSION_6"), 2097152); return SUCCESS; @@ -96,105 +96,118 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Ip) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_Ip, validate) { - zval *_6, *_12$$5; + zval _6, _12$$5; zend_bool _5; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *record, *field = NULL, *value = NULL, *message = NULL, *version = NULL, *allowPrivate = NULL, *allowReserved = NULL, *options = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_3 = NULL, *_4 = NULL, _7 = zval_used_for_init, *_8, *_9 = NULL, *_10$$5 = NULL, *_11$$5, *_13$$5 = NULL; + zval *record, record_sub, __$false, field, value, message, version, allowPrivate, allowReserved, options, _0, _1, _2, _3, _4, _7, _8, _9, _10$$5, _11$$5, _13$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&version); + ZVAL_UNDEF(&allowPrivate); + ZVAL_UNDEF(&allowReserved); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10$$5); + ZVAL_UNDEF(&_11$$5); + ZVAL_UNDEF(&_13$$5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_12$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) != IS_STRING) { + if (Z_TYPE_P(&field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/ip.zep", 101); return; } - ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "version", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, (1048576 | 2097152)); - ZEPHIR_CALL_METHOD(&version, this_ptr, "getoption", NULL, 0, _0, _1); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "version"); + ZVAL_LONG(&_1, (1048576 | 2097152)); + ZEPHIR_CALL_METHOD(&version, this_ptr, "getoption", NULL, 0, &_0, &_1); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowPrivate", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowPrivate"); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (zephir_is_true(_2)) { - ZEPHIR_INIT_VAR(allowPrivate); - ZVAL_LONG(allowPrivate, 0); + if (zephir_is_true(&_2)) { + ZEPHIR_INIT_VAR(&allowPrivate); + ZVAL_LONG(&allowPrivate, 0); } else { - ZEPHIR_INIT_NVAR(allowPrivate); - ZVAL_LONG(allowPrivate, 8388608); + ZEPHIR_INIT_NVAR(&allowPrivate); + ZVAL_LONG(&allowPrivate, 8388608); } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowReserved", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowReserved"); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (zephir_is_true(_3)) { - ZEPHIR_INIT_VAR(allowReserved); - ZVAL_LONG(allowReserved, 0); + if (zephir_is_true(&_3)) { + ZEPHIR_INIT_VAR(&allowReserved); + ZVAL_LONG(&allowReserved, 0); } else { - ZEPHIR_INIT_NVAR(allowReserved); - ZVAL_LONG(allowReserved, 4194304); + ZEPHIR_INIT_NVAR(&allowReserved); + ZVAL_LONG(&allowReserved, 4194304); } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_NVAR(_1); - ZVAL_BOOL(_1, 0); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "getoption", NULL, 0, _0, _1); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowEmpty"); + ZVAL_BOOL(&_1, 0); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "getoption", NULL, 0, &_0, &_1); zephir_check_call_status(); - _5 = zephir_is_true(_4); + _5 = zephir_is_true(&_4); if (_5) { - _5 = ZEPHIR_IS_EMPTY(value); + _5 = ZEPHIR_IS_EMPTY(&value); } if (_5) { RETURN_MM_BOOL(1); } - ZEPHIR_INIT_VAR(options); - zephir_create_array(options, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_6, SL("default"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&options); + zephir_create_array(&options, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_6, SL("default"), &__$false, PH_COPY | PH_SEPARATE); zephir_array_update_string(&options, SL("options"), &_6, PH_COPY | PH_SEPARATE); ZEPHIR_SINIT_VAR(_7); - zephir_bitwise_or_function(&_7, version, allowPrivate TSRMLS_CC); - ZEPHIR_INIT_VAR(_8); - zephir_bitwise_or_function(_8, &_7, allowReserved TSRMLS_CC); + zephir_bitwise_or_function(&_7, &version, &allowPrivate TSRMLS_CC); + ZEPHIR_INIT_VAR(&_8); + zephir_bitwise_or_function(&_8, &_7, &allowReserved TSRMLS_CC); zephir_array_update_string(&options, SL("flags"), &_8, PH_COPY | PH_SEPARATE); - ZEPHIR_SINIT_NVAR(_7); - ZVAL_LONG(&_7, 275); - ZEPHIR_CALL_FUNCTION(&_9, "filter_var", NULL, 212, value, &_7, options); + ZVAL_LONG(&_1, 275); + ZEPHIR_CALL_FUNCTION(&_9, "filter_var", NULL, 188, &value, &_1, &options); zephir_check_call_status(); - if (!(zephir_is_true(_9))) { - ZEPHIR_INIT_VAR(_10$$5); - ZVAL_STRING(_10$$5, "message", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_11$$5); - ZVAL_STRING(_11$$5, "IP address is incorrect", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _10$$5, _11$$5); - zephir_check_temp_parameter(_10$$5); - zephir_check_temp_parameter(_11$$5); + if (!(zephir_is_true(&_9))) { + ZEPHIR_INIT_VAR(&_10$$5); + ZVAL_STRING(&_10$$5, "message"); + ZEPHIR_INIT_VAR(&_11$$5); + ZVAL_STRING(&_11$$5, "IP address is incorrect"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_10$$5, &_11$$5); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_12$$5); - zephir_create_array(_12$$5, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_12$$5); + zephir_create_array(&_12$$5, 1, 0 TSRMLS_CC); zephir_array_update_string(&_12$$5, SL(":field"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_13$$5, "strtr", NULL, 27, message, _12$$5); + ZEPHIR_CALL_FUNCTION(&_13$$5, "strtr", NULL, 22, &message, &_12$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_10$$5); - ZVAL_STRING(_10$$5, "IP", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _13$$5, field, _10$$5); - zephir_check_temp_parameter(_10$$5); + ZEPHIR_INIT_NVAR(&_10$$5); + ZVAL_STRING(&_10$$5, "IP"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_13$$5, &field, &_10$$5); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/ip.zep.h b/ext/phalcon/mvc/model/validator/ip.zep.h index b6dcab5039e..eca962424a0 100644 --- a/ext/phalcon/mvc/model/validator/ip.zep.h +++ b/ext/phalcon/mvc/model/validator/ip.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Ip); PHP_METHOD(Phalcon_Mvc_Model_Validator_Ip, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_ip_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_ip_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_ip_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validator/numericality.zep.c b/ext/phalcon/mvc/model/validator/numericality.zep.c index 4f99bcdf12d..41e0c8ae3ea 100644 --- a/ext/phalcon/mvc/model/validator/numericality.zep.c +++ b/ext/phalcon/mvc/model/validator/numericality.zep.c @@ -65,58 +65,65 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Numericality) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_Numericality, validate) { - zval *_4$$5; + zval _4$$5; zend_bool _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *record, *field = NULL, *value = NULL, *message = NULL, *_0 = NULL, *_1 = NULL, *_3$$5 = NULL, *_5$$5 = NULL; + zval *record, record_sub, field, value, message, _0, _1, _3$$5, _5$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) != IS_STRING) { + if (Z_TYPE_P(&field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/numericality.zep", 70); return; } - ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowEmpty"); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - _2 = zephir_is_true(_1); + _2 = zephir_is_true(&_1); if (_2) { - _2 = ZEPHIR_IS_EMPTY(value); + _2 = ZEPHIR_IS_EMPTY(&value); } if (_2) { RETURN_MM_BOOL(1); } - if (!(zephir_is_numeric(value))) { - ZEPHIR_INIT_VAR(_3$$5); - ZVAL_STRING(_3$$5, "message", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _3$$5); - zephir_check_temp_parameter(_3$$5); + if (!(zephir_is_numeric(&value))) { + ZEPHIR_INIT_VAR(&_3$$5); + ZVAL_STRING(&_3$$5, "message"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_3$$5); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "Value of field :field must be numeric", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "Value of field :field must be numeric"); } - ZEPHIR_INIT_VAR(_4$$5); - zephir_create_array(_4$$5, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$5); + zephir_create_array(&_4$$5, 1, 0 TSRMLS_CC); zephir_array_update_string(&_4$$5, SL(":field"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_5$$5, "strtr", NULL, 27, message, _4$$5); + ZEPHIR_CALL_FUNCTION(&_5$$5, "strtr", NULL, 22, &message, &_4$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_3$$5); - ZVAL_STRING(_3$$5, "Numericality", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _5$$5, field, _3$$5); - zephir_check_temp_parameter(_3$$5); + ZEPHIR_INIT_NVAR(&_3$$5); + ZVAL_STRING(&_3$$5, "Numericality"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_5$$5, &field, &_3$$5); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/numericality.zep.h b/ext/phalcon/mvc/model/validator/numericality.zep.h index 6d91c3bc139..1bcde7e48ff 100644 --- a/ext/phalcon/mvc/model/validator/numericality.zep.h +++ b/ext/phalcon/mvc/model/validator/numericality.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Numericality); PHP_METHOD(Phalcon_Mvc_Model_Validator_Numericality, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_numericality_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_numericality_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_numericality_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validator/presenceof.zep.c b/ext/phalcon/mvc/model/validator/presenceof.zep.c index e75d2800b68..21be5f5aba7 100644 --- a/ext/phalcon/mvc/model/validator/presenceof.zep.c +++ b/ext/phalcon/mvc/model/validator/presenceof.zep.c @@ -67,54 +67,61 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_PresenceOf) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_PresenceOf, validate) { - zval *_4$$4; + zval _4$$4; zend_bool _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *record, *field = NULL, *value = NULL, *message = NULL, *_0, *_3$$4 = NULL, *_5$$4 = NULL; + zval *record, record_sub, field, value, message, _0, _3$$4, _5$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) != IS_STRING) { + if (Z_TYPE_P(&field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/presenceof.zep", 71); return; } - ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - _1 = Z_TYPE_P(value) == IS_NULL; + _1 = Z_TYPE_P(&value) == IS_NULL; if (!(_1)) { - _2 = Z_TYPE_P(value) == IS_STRING; + _2 = Z_TYPE_P(&value) == IS_STRING; if (_2) { - _2 = !(zephir_fast_strlen_ev(value)); + _2 = !(zephir_fast_strlen_ev(&value)); } _1 = _2; } if (_1) { - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_STRING(_3$$4, "message", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _3$$4); - zephir_check_temp_parameter(_3$$4); + ZEPHIR_INIT_VAR(&_3$$4); + ZVAL_STRING(&_3$$4, "message"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_3$$4); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "':field' is required", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "':field' is required"); } - ZEPHIR_INIT_VAR(_4$$4); - zephir_create_array(_4$$4, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$4); + zephir_create_array(&_4$$4, 1, 0 TSRMLS_CC); zephir_array_update_string(&_4$$4, SL(":field"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_5$$4, "strtr", NULL, 27, message, _4$$4); + ZEPHIR_CALL_FUNCTION(&_5$$4, "strtr", NULL, 22, &message, &_4$$4); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_3$$4); - ZVAL_STRING(_3$$4, "PresenceOf", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _5$$4, field, _3$$4); - zephir_check_temp_parameter(_3$$4); + ZEPHIR_INIT_NVAR(&_3$$4); + ZVAL_STRING(&_3$$4, "PresenceOf"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_5$$4, &field, &_3$$4); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/presenceof.zep.h b/ext/phalcon/mvc/model/validator/presenceof.zep.h index d0d4d3feaaf..e87c3e1b668 100644 --- a/ext/phalcon/mvc/model/validator/presenceof.zep.h +++ b/ext/phalcon/mvc/model/validator/presenceof.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_PresenceOf); PHP_METHOD(Phalcon_Mvc_Model_Validator_PresenceOf, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_presenceof_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_presenceof_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_presenceof_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validator/regex.zep.c b/ext/phalcon/mvc/model/validator/regex.zep.c index 83fd5ed288b..d7e8d4176e4 100644 --- a/ext/phalcon/mvc/model/validator/regex.zep.c +++ b/ext/phalcon/mvc/model/validator/regex.zep.c @@ -67,83 +67,92 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Regex) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_Regex, validate) { - zval *_6$$8; + zval _6$$8; zend_bool failed = 0, _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *record, *field = NULL, *value = NULL, *matches = NULL, *pattern = NULL, *message = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, *_4$$6, *_5$$8 = NULL, *_7$$8 = NULL; + zval *record, record_sub, field, value, matches, pattern, message, _0, _1, _2, _4$$6, _5$$8, _7$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_7$$8); + ZVAL_UNDEF(&_6$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) != IS_STRING) { + if (Z_TYPE_P(&field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/regex.zep", 71); return; } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "pattern", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "pattern"); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - if (!(zephir_is_true(_1))) { + if (!(zephir_is_true(&_1))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Validator requires a perl-compatible regex pattern", "phalcon/mvc/model/validator/regex.zep", 78); return; } - ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowEmpty"); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - _3 = zephir_is_true(_2); + _3 = zephir_is_true(&_2); if (_3) { - _3 = ZEPHIR_IS_EMPTY(value); + _3 = ZEPHIR_IS_EMPTY(&value); } if (_3) { RETURN_MM_BOOL(1); } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "pattern", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&pattern, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "pattern"); + ZEPHIR_CALL_METHOD(&pattern, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); failed = 0; - ZEPHIR_INIT_VAR(matches); - ZVAL_NULL(matches); - ZEPHIR_INIT_NVAR(_0); - zephir_preg_match(_0, pattern, value, matches, 0, 0 , 0 TSRMLS_CC); - if (zephir_is_true(_0)) { - zephir_array_fetch_long(&_4$$6, matches, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/validator/regex.zep", 97 TSRMLS_CC); - failed = !ZEPHIR_IS_EQUAL(_4$$6, value); + ZEPHIR_INIT_VAR(&matches); + ZVAL_NULL(&matches); + ZEPHIR_INIT_NVAR(&_0); + zephir_preg_match(&_0, &pattern, &value, &matches, 0, 0 , 0 TSRMLS_CC); + if (zephir_is_true(&_0)) { + zephir_array_fetch_long(&_4$$6, &matches, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/model/validator/regex.zep", 97 TSRMLS_CC); + failed = !ZEPHIR_IS_EQUAL(&_4$$6, &value); } else { failed = 1; } if (failed == 1) { - ZEPHIR_INIT_VAR(_5$$8); - ZVAL_STRING(_5$$8, "message", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _5$$8); - zephir_check_temp_parameter(_5$$8); + ZEPHIR_INIT_VAR(&_5$$8); + ZVAL_STRING(&_5$$8, "message"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_5$$8); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "Value of field ':field' doesn't match regular expression", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "Value of field ':field' doesn't match regular expression"); } - ZEPHIR_INIT_VAR(_6$$8); - zephir_create_array(_6$$8, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$8); + zephir_create_array(&_6$$8, 1, 0 TSRMLS_CC); zephir_array_update_string(&_6$$8, SL(":field"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_7$$8, "strtr", NULL, 27, message, _6$$8); + ZEPHIR_CALL_FUNCTION(&_7$$8, "strtr", NULL, 22, &message, &_6$$8); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_5$$8); - ZVAL_STRING(_5$$8, "Regex", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _7$$8, field, _5$$8); - zephir_check_temp_parameter(_5$$8); + ZEPHIR_INIT_NVAR(&_5$$8); + ZVAL_STRING(&_5$$8, "Regex"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_7$$8, &field, &_5$$8); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/regex.zep.h b/ext/phalcon/mvc/model/validator/regex.zep.h index a1e331e875e..72b5af37743 100644 --- a/ext/phalcon/mvc/model/validator/regex.zep.h +++ b/ext/phalcon/mvc/model/validator/regex.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Regex); PHP_METHOD(Phalcon_Mvc_Model_Validator_Regex, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_regex_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_regex_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_regex_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validator/stringlength.zep.c b/ext/phalcon/mvc/model/validator/stringlength.zep.c index 9caf0703ea6..179c8f7d14f 100644 --- a/ext/phalcon/mvc/model/validator/stringlength.zep.c +++ b/ext/phalcon/mvc/model/validator/stringlength.zep.c @@ -71,120 +71,131 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_StringLength) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_StringLength, validate) { - zval *_6$$9, *_10$$12; + zval _6$$9, _10$$12; zend_bool _1, _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *record, *field = NULL, *isSetMin = NULL, *isSetMax = NULL, *value = NULL, *length = NULL, *maximum = NULL, *minimum = NULL, *message = NULL, *_0 = NULL, *_2 = NULL, *_4$$8, *_5$$9 = NULL, *_7$$9 = NULL, *_8$$11, *_9$$12 = NULL, *_11$$12 = NULL; + zval *record, record_sub, field, isSetMin, isSetMax, value, length, maximum, minimum, message, _0, _2, _4$$8, _5$$9, _7$$9, _8$$11, _9$$12, _11$$12; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&isSetMin); + ZVAL_UNDEF(&isSetMax); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&length); + ZVAL_UNDEF(&maximum); + ZVAL_UNDEF(&minimum); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4$$8); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_8$$11); + ZVAL_UNDEF(&_9$$12); + ZVAL_UNDEF(&_11$$12); + ZVAL_UNDEF(&_6$$9); + ZVAL_UNDEF(&_10$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) != IS_STRING) { + if (Z_TYPE_P(&field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/stringlength.zep", 75); return; } - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "min", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&isSetMin, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "min"); + ZEPHIR_CALL_METHOD(&isSetMin, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "max", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&isSetMax, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "max"); + ZEPHIR_CALL_METHOD(&isSetMax, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - _1 = !zephir_is_true(isSetMin); + _1 = !zephir_is_true(&isSetMin); if (_1) { - _1 = !zephir_is_true(isSetMax); + _1 = !zephir_is_true(&isSetMax); } if (_1) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "A minimum or maximum must be set", "phalcon/mvc/model/validator/stringlength.zep", 85); return; } - ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowEmpty"); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - _3 = zephir_is_true(_2); + _3 = zephir_is_true(&_2); if (_3) { - _3 = ZEPHIR_IS_EMPTY(value); + _3 = ZEPHIR_IS_EMPTY(&value); } if (_3) { RETURN_MM_BOOL(1); } - if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 238, value); + if ((zephir_function_exists_ex(SL("mb_strlen") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_FUNCTION(&length, "mb_strlen", NULL, 200, &value); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(length); - ZVAL_LONG(length, zephir_fast_strlen_ev(value)); + ZEPHIR_INIT_NVAR(&length); + ZVAL_LONG(&length, zephir_fast_strlen_ev(&value)); } - if (zephir_is_true(isSetMax)) { - ZEPHIR_INIT_VAR(_4$$8); - ZVAL_STRING(_4$$8, "max", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&maximum, this_ptr, "getoption", NULL, 0, _4$$8); - zephir_check_temp_parameter(_4$$8); + if (zephir_is_true(&isSetMax)) { + ZEPHIR_INIT_VAR(&_4$$8); + ZVAL_STRING(&_4$$8, "max"); + ZEPHIR_CALL_METHOD(&maximum, this_ptr, "getoption", NULL, 0, &_4$$8); zephir_check_call_status(); - if (ZEPHIR_GT(length, maximum)) { - ZEPHIR_INIT_VAR(_5$$9); - ZVAL_STRING(_5$$9, "messageMaximum", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _5$$9); - zephir_check_temp_parameter(_5$$9); + if (ZEPHIR_GT(&length, &maximum)) { + ZEPHIR_INIT_VAR(&_5$$9); + ZVAL_STRING(&_5$$9, "messageMaximum"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_5$$9); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "Value of field ':field' exceeds the maximum :max characters", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "Value of field ':field' exceeds the maximum :max characters"); } - ZEPHIR_INIT_VAR(_6$$9); - zephir_create_array(_6$$9, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$9); + zephir_create_array(&_6$$9, 2, 0 TSRMLS_CC); zephir_array_update_string(&_6$$9, SL(":field"), &field, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_6$$9, SL(":max"), &maximum, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_7$$9, "strtr", NULL, 27, message, _6$$9); + ZEPHIR_CALL_FUNCTION(&_7$$9, "strtr", NULL, 22, &message, &_6$$9); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_5$$9); - ZVAL_STRING(_5$$9, "TooLong", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _7$$9, field, _5$$9); - zephir_check_temp_parameter(_5$$9); + ZEPHIR_INIT_NVAR(&_5$$9); + ZVAL_STRING(&_5$$9, "TooLong"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_7$$9, &field, &_5$$9); zephir_check_call_status(); RETURN_MM_BOOL(0); } } - if (zephir_is_true(isSetMin)) { - ZEPHIR_INIT_VAR(_8$$11); - ZVAL_STRING(_8$$11, "min", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&minimum, this_ptr, "getoption", NULL, 0, _8$$11); - zephir_check_temp_parameter(_8$$11); + if (zephir_is_true(&isSetMin)) { + ZEPHIR_INIT_VAR(&_8$$11); + ZVAL_STRING(&_8$$11, "min"); + ZEPHIR_CALL_METHOD(&minimum, this_ptr, "getoption", NULL, 0, &_8$$11); zephir_check_call_status(); - if (ZEPHIR_LT(length, minimum)) { - ZEPHIR_INIT_VAR(_9$$12); - ZVAL_STRING(_9$$12, "messageMinimum", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _9$$12); - zephir_check_temp_parameter(_9$$12); + if (ZEPHIR_LT(&length, &minimum)) { + ZEPHIR_INIT_VAR(&_9$$12); + ZVAL_STRING(&_9$$12, "messageMinimum"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_9$$12); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "Value of field ':field' is less than the minimum :min characters", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "Value of field ':field' is less than the minimum :min characters"); } - ZEPHIR_INIT_VAR(_10$$12); - zephir_create_array(_10$$12, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_10$$12); + zephir_create_array(&_10$$12, 2, 0 TSRMLS_CC); zephir_array_update_string(&_10$$12, SL(":field"), &field, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_10$$12, SL(":min"), &minimum, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_11$$12, "strtr", NULL, 27, message, _10$$12); + ZEPHIR_CALL_FUNCTION(&_11$$12, "strtr", NULL, 22, &message, &_10$$12); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_9$$12); - ZVAL_STRING(_9$$12, "TooShort", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _11$$12, field, _9$$12); - zephir_check_temp_parameter(_9$$12); + ZEPHIR_INIT_NVAR(&_9$$12); + ZVAL_STRING(&_9$$12, "TooShort"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_11$$12, &field, &_9$$12); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/stringlength.zep.h b/ext/phalcon/mvc/model/validator/stringlength.zep.h index b9bf985dc97..6be4c2f34e0 100644 --- a/ext/phalcon/mvc/model/validator/stringlength.zep.h +++ b/ext/phalcon/mvc/model/validator/stringlength.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_StringLength); PHP_METHOD(Phalcon_Mvc_Model_Validator_StringLength, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_stringlength_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_stringlength_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_stringlength_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validator/uniqueness.zep.c b/ext/phalcon/mvc/model/validator/uniqueness.zep.c index 4df7738fd92..a93c5d27e50 100644 --- a/ext/phalcon/mvc/model/validator/uniqueness.zep.c +++ b/ext/phalcon/mvc/model/validator/uniqueness.zep.c @@ -71,12 +71,57 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Uniqueness) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate) { - HashTable *_2$$5, *_22$$16; - HashPosition _1$$5, _21$$16; - zend_class_entry *_33; - zephir_fcall_cache_entry *_6 = NULL, *_12 = NULL, *_31 = NULL; + zend_class_entry *_29; + zephir_fcall_cache_entry *_4 = NULL, *_10 = NULL, *_27 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, number = 0; - zval *record, *field = NULL, *dependencyInjector = NULL, *metaData = NULL, *message = NULL, *bindTypes = NULL, *bindDataTypes = NULL, *columnMap = NULL, *conditions = NULL, *bindParams = NULL, *composeField = NULL, *columnField = NULL, *bindType = NULL, *primaryField = NULL, *attributeField = NULL, *params = NULL, *className = NULL, *replacePairs = NULL, *_0 = NULL, *_19 = NULL, *_32 = NULL, **_3$$5, *_4$$8 = NULL, *_5$$8 = NULL, *_7$$10 = NULL, *_8$$10 = NULL, _9$$6 = zval_used_for_init, *_10$$6 = NULL, *_11$$6 = NULL, *_13$$13, *_14$$13, *_15$$15, *_16$$15, *_17$$11, *_18$$11 = NULL, *_20$$16 = NULL, **_23$$16, *_24$$20 = NULL, *_25$$20 = NULL, *_26$$22 = NULL, *_27$$22 = NULL, _28$$19 = zval_used_for_init, *_29$$19 = NULL, *_30$$19 = NULL, *_34$$24 = NULL, *_36$$24 = NULL, *_35$$25; + zval *record, record_sub, field, dependencyInjector, metaData, message, bindTypes, bindDataTypes, columnMap, conditions, bindParams, composeField, columnField, bindType, primaryField, attributeField, params, className, replacePairs, _0, _17, _28, *_1$$5, _2$$8, _3$$8, _5$$10, _6$$10, _7$$6, _8$$6, _9$$6, _11$$13, _12$$13, _13$$15, _14$$15, _15$$11, _16$$11, _18$$16, *_19$$16, _20$$20, _21$$20, _22$$22, _23$$22, _24$$19, _25$$19, _26$$19, _30$$24, _32$$24, _31$$25; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&metaData); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&bindTypes); + ZVAL_UNDEF(&bindDataTypes); + ZVAL_UNDEF(&columnMap); + ZVAL_UNDEF(&conditions); + ZVAL_UNDEF(&bindParams); + ZVAL_UNDEF(&composeField); + ZVAL_UNDEF(&columnField); + ZVAL_UNDEF(&bindType); + ZVAL_UNDEF(&primaryField); + ZVAL_UNDEF(&attributeField); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&replacePairs); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_17); + ZVAL_UNDEF(&_28); + ZVAL_UNDEF(&_2$$8); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_5$$10); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_11$$13); + ZVAL_UNDEF(&_12$$13); + ZVAL_UNDEF(&_13$$15); + ZVAL_UNDEF(&_14$$15); + ZVAL_UNDEF(&_15$$11); + ZVAL_UNDEF(&_16$$11); + ZVAL_UNDEF(&_18$$16); + ZVAL_UNDEF(&_20$$20); + ZVAL_UNDEF(&_21$$20); + ZVAL_UNDEF(&_22$$22); + ZVAL_UNDEF(&_23$$22); + ZVAL_UNDEF(&_24$$19); + ZVAL_UNDEF(&_25$$19); + ZVAL_UNDEF(&_26$$19); + ZVAL_UNDEF(&_30$$24); + ZVAL_UNDEF(&_32$$24); + ZVAL_UNDEF(&_31$$25); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); @@ -85,217 +130,213 @@ PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate) { ZEPHIR_CALL_METHOD(&dependencyInjector, record, "getdi", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "modelsMetadata", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&metaData, dependencyInjector, "getshared", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "modelsMetadata"); + ZEPHIR_CALL_METHOD(&metaData, &dependencyInjector, "getshared", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(bindTypes); - array_init(bindTypes); - ZEPHIR_CALL_METHOD(&bindDataTypes, metaData, "getbindtypes", NULL, 0, record); + ZEPHIR_INIT_VAR(&bindTypes); + array_init(&bindTypes); + ZEPHIR_CALL_METHOD(&bindDataTypes, &metaData, "getbindtypes", NULL, 0, record); zephir_check_call_status(); if (ZEPHIR_GLOBAL(orm).column_renaming) { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getreversecolumnmap", NULL, 0, record); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getreversecolumnmap", NULL, 0, record); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } - ZEPHIR_INIT_VAR(conditions); - array_init(conditions); - ZEPHIR_INIT_VAR(bindParams); - array_init(bindParams); + ZEPHIR_INIT_VAR(&conditions); + array_init(&conditions); + ZEPHIR_INIT_VAR(&bindParams); + array_init(&bindParams); number = 0; - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) == IS_ARRAY) { - zephir_is_iterable(field, &_2$$5, &_1$$5, 0, 0, "phalcon/mvc/model/validator/uniqueness.zep", 130); - for ( - ; zend_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS - ; zend_hash_move_forward_ex(_2$$5, &_1$$5) - ) { - ZEPHIR_GET_HVALUE(composeField, _3$$5); - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(columnField); - if (!(zephir_array_isset_fetch(&columnField, columnMap, composeField, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_4$$8); - object_init_ex(_4$$8, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_5$$8); - ZEPHIR_CONCAT_SVS(_5$$8, "Column '", composeField, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _4$$8, "__construct", &_6, 9, _5$$8); + if (Z_TYPE_P(&field) == IS_ARRAY) { + zephir_is_iterable(&field, 0, "phalcon/mvc/model/validator/uniqueness.zep", 130); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&field), _1$$5) + { + ZEPHIR_INIT_NVAR(&composeField); + ZVAL_COPY(&composeField, _1$$5); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&columnField); + if (!(zephir_array_isset_fetch(&columnField, &columnMap, &composeField, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_2$$8); + object_init_ex(&_2$$8, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_3$$8); + ZEPHIR_CONCAT_SVS(&_3$$8, "Column '", &composeField, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_2$$8, "__construct", &_4, 4, &_3$$8); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$8, "phalcon/mvc/model/validator/uniqueness.zep", 107 TSRMLS_CC); + zephir_throw_exception_debug(&_2$$8, "phalcon/mvc/model/validator/uniqueness.zep", 107 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(columnField, composeField); + ZEPHIR_CPY_WRT(&columnField, &composeField); } - ZEPHIR_OBS_NVAR(bindType); - if (!(zephir_array_isset_fetch(&bindType, bindDataTypes, columnField, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_7$$10); - object_init_ex(_7$$10, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_8$$10); - ZEPHIR_CONCAT_SVS(_8$$10, "Column '", columnField, "' isn't part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, _7$$10, "__construct", &_6, 9, _8$$10); + ZEPHIR_OBS_NVAR(&bindType); + if (!(zephir_array_isset_fetch(&bindType, &bindDataTypes, &columnField, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_5$$10); + object_init_ex(&_5$$10, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_6$$10); + ZEPHIR_CONCAT_SVS(&_6$$10, "Column '", &columnField, "' isn't part of the table columns"); + ZEPHIR_CALL_METHOD(NULL, &_5$$10, "__construct", &_4, 4, &_6$$10); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$10, "phalcon/mvc/model/validator/uniqueness.zep", 117 TSRMLS_CC); + zephir_throw_exception_debug(&_5$$10, "phalcon/mvc/model/validator/uniqueness.zep", 117 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_SINIT_NVAR(_9$$6); - ZVAL_LONG(&_9$$6, number); - ZEPHIR_INIT_LNVAR(_10$$6); - ZEPHIR_CONCAT_SVSV(_10$$6, "[", composeField, "] = ?", &_9$$6); - zephir_array_append(&conditions, _10$$6, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 123); - ZEPHIR_CALL_METHOD(&_11$$6, record, "readattribute", &_12, 0, composeField); + ZEPHIR_SINIT_NVAR(_7$$6); + ZVAL_LONG(&_7$$6, number); + ZEPHIR_INIT_LNVAR(_8$$6); + ZEPHIR_CONCAT_SVSV(&_8$$6, "[", &composeField, "] = ?", &_7$$6); + zephir_array_append(&conditions, &_8$$6, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 123); + ZEPHIR_CALL_METHOD(&_9$$6, record, "readattribute", &_10, 0, &composeField); zephir_check_call_status(); - zephir_array_append(&bindParams, _11$$6, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 124); - zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 125); + zephir_array_append(&bindParams, &_9$$6, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 124); + zephir_array_append(&bindTypes, &bindType, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 125); number++; - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&composeField); } else { - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(columnField); - if (!(zephir_array_isset_fetch(&columnField, columnMap, field, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_13$$13); - object_init_ex(_13$$13, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_14$$13); - ZEPHIR_CONCAT_SVS(_14$$13, "Column '", field, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _13$$13, "__construct", &_6, 9, _14$$13); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&columnField); + if (!(zephir_array_isset_fetch(&columnField, &columnMap, &field, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_11$$13); + object_init_ex(&_11$$13, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_12$$13); + ZEPHIR_CONCAT_SVS(&_12$$13, "Column '", &field, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_11$$13, "__construct", &_4, 4, &_12$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_13$$13, "phalcon/mvc/model/validator/uniqueness.zep", 137 TSRMLS_CC); + zephir_throw_exception_debug(&_11$$13, "phalcon/mvc/model/validator/uniqueness.zep", 137 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(columnField, field); + ZEPHIR_CPY_WRT(&columnField, &field); } - ZEPHIR_OBS_NVAR(bindType); - if (!(zephir_array_isset_fetch(&bindType, bindDataTypes, columnField, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_15$$15); - object_init_ex(_15$$15, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_VAR(_16$$15); - ZEPHIR_CONCAT_SVS(_16$$15, "Column '", columnField, "' isn't part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, _15$$15, "__construct", &_6, 9, _16$$15); + ZEPHIR_OBS_NVAR(&bindType); + if (!(zephir_array_isset_fetch(&bindType, &bindDataTypes, &columnField, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_13$$15); + object_init_ex(&_13$$15, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_VAR(&_14$$15); + ZEPHIR_CONCAT_SVS(&_14$$15, "Column '", &columnField, "' isn't part of the table columns"); + ZEPHIR_CALL_METHOD(NULL, &_13$$15, "__construct", &_4, 4, &_14$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_15$$15, "phalcon/mvc/model/validator/uniqueness.zep", 147 TSRMLS_CC); + zephir_throw_exception_debug(&_13$$15, "phalcon/mvc/model/validator/uniqueness.zep", 147 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(_17$$11); - ZEPHIR_CONCAT_SVS(_17$$11, "[", field, "] = ?0"); - zephir_array_append(&conditions, _17$$11, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 153); - ZEPHIR_CALL_METHOD(&_18$$11, record, "readattribute", NULL, 0, field); + ZEPHIR_INIT_VAR(&_15$$11); + ZEPHIR_CONCAT_SVS(&_15$$11, "[", &field, "] = ?0"); + zephir_array_append(&conditions, &_15$$11, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 153); + ZEPHIR_CALL_METHOD(&_16$$11, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - zephir_array_append(&bindParams, _18$$11, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 154); - zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 155); + zephir_array_append(&bindParams, &_16$$11, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 154); + zephir_array_append(&bindTypes, &bindType, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 155); number++; } - ZEPHIR_CALL_METHOD(&_19, record, "getoperationmade", NULL, 0); + ZEPHIR_CALL_METHOD(&_17, record, "getoperationmade", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(_19, 2)) { + if (ZEPHIR_IS_LONG(&_17, 2)) { if (ZEPHIR_GLOBAL(orm).column_renaming) { - ZEPHIR_CALL_METHOD(&columnMap, metaData, "getcolumnmap", NULL, 0, record); + ZEPHIR_CALL_METHOD(&columnMap, &metaData, "getcolumnmap", NULL, 0, record); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(columnMap); - ZVAL_NULL(columnMap); + ZEPHIR_INIT_NVAR(&columnMap); + ZVAL_NULL(&columnMap); } - ZEPHIR_CALL_METHOD(&_20$$16, metaData, "getprimarykeyattributes", NULL, 0, record); + ZEPHIR_CALL_METHOD(&_18$$16, &metaData, "getprimarykeyattributes", NULL, 0, record); zephir_check_call_status(); - zephir_is_iterable(_20$$16, &_22$$16, &_21$$16, 0, 0, "phalcon/mvc/model/validator/uniqueness.zep", 200); - for ( - ; zend_hash_get_current_data_ex(_22$$16, (void**) &_23$$16, &_21$$16) == SUCCESS - ; zend_hash_move_forward_ex(_22$$16, &_21$$16) - ) { - ZEPHIR_GET_HVALUE(primaryField, _23$$16); - ZEPHIR_OBS_NVAR(bindType); - if (!(zephir_array_isset_fetch(&bindType, bindDataTypes, primaryField, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_24$$20); - object_init_ex(_24$$20, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_25$$20); - ZEPHIR_CONCAT_SVS(_25$$20, "Column '", primaryField, "' isn't part of the table columns"); - ZEPHIR_CALL_METHOD(NULL, _24$$20, "__construct", &_6, 9, _25$$20); + zephir_is_iterable(&_18$$16, 0, "phalcon/mvc/model/validator/uniqueness.zep", 200); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_18$$16), _19$$16) + { + ZEPHIR_INIT_NVAR(&primaryField); + ZVAL_COPY(&primaryField, _19$$16); + ZEPHIR_OBS_NVAR(&bindType); + if (!(zephir_array_isset_fetch(&bindType, &bindDataTypes, &primaryField, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_20$$20); + object_init_ex(&_20$$20, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_21$$20); + ZEPHIR_CONCAT_SVS(&_21$$20, "Column '", &primaryField, "' isn't part of the table columns"); + ZEPHIR_CALL_METHOD(NULL, &_20$$20, "__construct", &_4, 4, &_21$$20); zephir_check_call_status(); - zephir_throw_exception_debug(_24$$20, "phalcon/mvc/model/validator/uniqueness.zep", 177 TSRMLS_CC); + zephir_throw_exception_debug(&_20$$20, "phalcon/mvc/model/validator/uniqueness.zep", 177 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (Z_TYPE_P(columnMap) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(attributeField); - if (!(zephir_array_isset_fetch(&attributeField, columnMap, primaryField, 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(_26$$22); - object_init_ex(_26$$22, phalcon_mvc_model_exception_ce); - ZEPHIR_INIT_LNVAR(_27$$22); - ZEPHIR_CONCAT_SVS(_27$$22, "Column '", primaryField, "' isn't part of the column map"); - ZEPHIR_CALL_METHOD(NULL, _26$$22, "__construct", &_6, 9, _27$$22); + if (Z_TYPE_P(&columnMap) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&attributeField); + if (!(zephir_array_isset_fetch(&attributeField, &columnMap, &primaryField, 0 TSRMLS_CC))) { + ZEPHIR_INIT_NVAR(&_22$$22); + object_init_ex(&_22$$22, phalcon_mvc_model_exception_ce); + ZEPHIR_INIT_LNVAR(_23$$22); + ZEPHIR_CONCAT_SVS(&_23$$22, "Column '", &primaryField, "' isn't part of the column map"); + ZEPHIR_CALL_METHOD(NULL, &_22$$22, "__construct", &_4, 4, &_23$$22); zephir_check_call_status(); - zephir_throw_exception_debug(_26$$22, "phalcon/mvc/model/validator/uniqueness.zep", 185 TSRMLS_CC); + zephir_throw_exception_debug(&_22$$22, "phalcon/mvc/model/validator/uniqueness.zep", 185 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } else { - ZEPHIR_CPY_WRT(attributeField, primaryField); + ZEPHIR_CPY_WRT(&attributeField, &primaryField); } - ZEPHIR_SINIT_NVAR(_28$$19); - ZVAL_LONG(&_28$$19, number); - ZEPHIR_INIT_LNVAR(_29$$19); - ZEPHIR_CONCAT_SVSV(_29$$19, "[", attributeField, "] <> ?", &_28$$19); - zephir_array_append(&conditions, _29$$19, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 194); - ZEPHIR_CALL_METHOD(&_30$$19, record, "readattribute", &_31, 0, primaryField); + ZEPHIR_SINIT_NVAR(_24$$19); + ZVAL_LONG(&_24$$19, number); + ZEPHIR_INIT_LNVAR(_25$$19); + ZEPHIR_CONCAT_SVSV(&_25$$19, "[", &attributeField, "] <> ?", &_24$$19); + zephir_array_append(&conditions, &_25$$19, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 194); + ZEPHIR_CALL_METHOD(&_26$$19, record, "readattribute", &_27, 0, &primaryField); zephir_check_call_status(); - zephir_array_append(&bindParams, _30$$19, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 195); - zephir_array_append(&bindTypes, bindType, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 196); + zephir_array_append(&bindParams, &_26$$19, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 195); + zephir_array_append(&bindTypes, &bindType, PH_SEPARATE, "phalcon/mvc/model/validator/uniqueness.zep", 196); number++; - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&primaryField); } - ZEPHIR_INIT_VAR(params); - array_init(params); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); zephir_array_update_string(¶ms, SL("di"), &dependencyInjector, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_0); - zephir_fast_join_str(_0, SL(" AND "), conditions TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_0); + zephir_fast_join_str(&_0, SL(" AND "), &conditions TSRMLS_CC); zephir_array_update_string(¶ms, SL("conditions"), &_0, PH_COPY | PH_SEPARATE); zephir_array_update_string(¶ms, SL("bind"), &bindParams, PH_COPY | PH_SEPARATE); zephir_array_update_string(¶ms, SL("bindTypes"), &bindTypes, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(className); - zephir_get_class(className, record, 0 TSRMLS_CC); - _33 = zephir_fetch_class(className TSRMLS_CC); - ZEPHIR_CALL_CE_STATIC(&_32, _33, "count", NULL, 0, params); + ZEPHIR_INIT_VAR(&className); + zephir_get_class(&className, record, 0 TSRMLS_CC); + _29 = zephir_fetch_class(&className TSRMLS_CC); + ZEPHIR_CALL_CE_STATIC(&_28, _29, "count", NULL, 0, ¶ms); zephir_check_call_status(); - if (!ZEPHIR_IS_LONG(_32, 0)) { - ZEPHIR_INIT_VAR(_34$$24); - ZVAL_STRING(_34$$24, "message", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _34$$24); - zephir_check_temp_parameter(_34$$24); + if (!ZEPHIR_IS_LONG(&_28, 0)) { + ZEPHIR_INIT_VAR(&_30$$24); + ZVAL_STRING(&_30$$24, "message"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_30$$24); zephir_check_call_status(); - ZEPHIR_INIT_VAR(replacePairs); - if (Z_TYPE_P(field) == IS_ARRAY) { - zephir_create_array(replacePairs, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_35$$25); - zephir_fast_join_str(_35$$25, SL(", "), field TSRMLS_CC); - zephir_array_update_string(&replacePairs, SL(":fields"), &_35$$25, PH_COPY | PH_SEPARATE); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "Value of fields: :fields are already present in another record", 1); + ZEPHIR_INIT_VAR(&replacePairs); + if (Z_TYPE_P(&field) == IS_ARRAY) { + zephir_create_array(&replacePairs, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_31$$25); + zephir_fast_join_str(&_31$$25, SL(", "), &field TSRMLS_CC); + zephir_array_update_string(&replacePairs, SL(":fields"), &_31$$25, PH_COPY | PH_SEPARATE); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "Value of fields: :fields are already present in another record"); } } else { - zephir_create_array(replacePairs, 1, 0 TSRMLS_CC); + zephir_create_array(&replacePairs, 1, 0 TSRMLS_CC); zephir_array_update_string(&replacePairs, SL(":field"), &field, PH_COPY | PH_SEPARATE); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, "Value of field: ':field' is already present in another record", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, "Value of field: ':field' is already present in another record"); } } - ZEPHIR_CALL_FUNCTION(&_36$$24, "strtr", NULL, 27, message, replacePairs); + ZEPHIR_CALL_FUNCTION(&_32$$24, "strtr", NULL, 22, &message, &replacePairs); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_34$$24); - ZVAL_STRING(_34$$24, "Unique", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _36$$24, field, _34$$24); - zephir_check_temp_parameter(_34$$24); + ZEPHIR_INIT_NVAR(&_30$$24); + ZVAL_STRING(&_30$$24, "Unique"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_32$$24, &field, &_30$$24); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/uniqueness.zep.h b/ext/phalcon/mvc/model/validator/uniqueness.zep.h index 9aca3496236..c7861a10981 100644 --- a/ext/phalcon/mvc/model/validator/uniqueness.zep.h +++ b/ext/phalcon/mvc/model/validator/uniqueness.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Uniqueness); PHP_METHOD(Phalcon_Mvc_Model_Validator_Uniqueness, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_uniqueness_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_uniqueness_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_uniqueness_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validator/url.zep.c b/ext/phalcon/mvc/model/validator/url.zep.c index b7898c70153..7dbaf492a51 100644 --- a/ext/phalcon/mvc/model/validator/url.zep.c +++ b/ext/phalcon/mvc/model/validator/url.zep.c @@ -65,62 +65,70 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Url) { */ PHP_METHOD(Phalcon_Mvc_Model_Validator_Url, validate) { - zval *_6$$5; + zval _6$$5; zend_bool _2; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *record, *field = NULL, *value = NULL, *message = NULL, *_0 = NULL, *_1 = NULL, _3, *_4 = NULL, *_5$$5 = NULL, *_7$$5 = NULL; + zval *record, record_sub, field, value, message, _0, _1, _3, _4, _5$$5, _7$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&record_sub); + ZVAL_UNDEF(&field); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_6$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &record); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "field", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "field"); + ZEPHIR_CALL_METHOD(&field, this_ptr, "getoption", NULL, 0, &_0); zephir_check_call_status(); - if (Z_TYPE_P(field) != IS_STRING) { + if (Z_TYPE_P(&field) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "Field name must be a string", "phalcon/mvc/model/validator/url.zep", 70); return; } - ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, field); + ZEPHIR_CALL_METHOD(&value, record, "readattribute", NULL, 0, &field); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_0); - ZVAL_STRING(_0, "allowEmpty", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "allowEmpty"); + ZEPHIR_CALL_METHOD(&_1, this_ptr, "issetoption", NULL, 0, &_0); zephir_check_call_status(); - _2 = zephir_is_true(_1); + _2 = zephir_is_true(&_1); if (_2) { - _2 = ZEPHIR_IS_EMPTY(value); + _2 = ZEPHIR_IS_EMPTY(&value); } if (_2) { RETURN_MM_BOOL(1); } - ZEPHIR_SINIT_VAR(_3); ZVAL_LONG(&_3, 273); - ZEPHIR_CALL_FUNCTION(&_4, "filter_var", NULL, 212, value, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "filter_var", NULL, 188, &value, &_3); zephir_check_call_status(); - if (!(zephir_is_true(_4))) { - ZEPHIR_INIT_VAR(_5$$5); - ZVAL_STRING(_5$$5, "message", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, _5$$5); - zephir_check_temp_parameter(_5$$5); + if (!(zephir_is_true(&_4))) { + ZEPHIR_INIT_VAR(&_5$$5); + ZVAL_STRING(&_5$$5, "message"); + ZEPHIR_CALL_METHOD(&message, this_ptr, "getoption", NULL, 0, &_5$$5); zephir_check_call_status(); - if (ZEPHIR_IS_EMPTY(message)) { - ZEPHIR_INIT_NVAR(message); - ZVAL_STRING(message, ":field does not have a valid url format", 1); + if (ZEPHIR_IS_EMPTY(&message)) { + ZEPHIR_INIT_NVAR(&message); + ZVAL_STRING(&message, ":field does not have a valid url format"); } - ZEPHIR_INIT_VAR(_6$$5); - zephir_create_array(_6$$5, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$5); + zephir_create_array(&_6$$5, 1, 0 TSRMLS_CC); zephir_array_update_string(&_6$$5, SL(":field"), &field, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_FUNCTION(&_7$$5, "strtr", NULL, 27, message, _6$$5); + ZEPHIR_CALL_FUNCTION(&_7$$5, "strtr", NULL, 22, &message, &_6$$5); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_5$$5); - ZVAL_STRING(_5$$5, "Url", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, _7$$5, field, _5$$5); - zephir_check_temp_parameter(_5$$5); + ZEPHIR_INIT_NVAR(&_5$$5); + ZVAL_STRING(&_5$$5, "Url"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "appendmessage", NULL, 0, &_7$$5, &field, &_5$$5); zephir_check_call_status(); RETURN_MM_BOOL(0); } diff --git a/ext/phalcon/mvc/model/validator/url.zep.h b/ext/phalcon/mvc/model/validator/url.zep.h index 22414804d4f..ade8696d8d6 100644 --- a/ext/phalcon/mvc/model/validator/url.zep.h +++ b/ext/phalcon/mvc/model/validator/url.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Validator_Url); PHP_METHOD(Phalcon_Mvc_Model_Validator_Url, validate); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validator_url_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_url_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validator_url_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/model/validatorinterface.zep.h b/ext/phalcon/mvc/model/validatorinterface.zep.h index 4bca75351c6..ad06d8ffd5b 100644 --- a/ext/phalcon/mvc/model/validatorinterface.zep.h +++ b/ext/phalcon/mvc/model/validatorinterface.zep.h @@ -3,7 +3,11 @@ extern zend_class_entry *phalcon_mvc_model_validatorinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_ValidatorInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_model_validatorinterface_validate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validatorinterface_validate, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_model_validatorinterface_validate, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_OBJ_INFO(0, record, Phalcon\\Mvc\\EntityInterface, 0) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/mvc/modelinterface.zep.h b/ext/phalcon/mvc/modelinterface.zep.h index 1c7ffa78b5a..a06eea1af4c 100644 --- a/ext/phalcon/mvc/modelinterface.zep.h +++ b/ext/phalcon/mvc/modelinterface.zep.h @@ -3,24 +3,83 @@ extern zend_class_entry *phalcon_mvc_modelinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_ModelInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_settransaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_modelinterface_settransaction, 0, 1, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_settransaction, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, transaction, Phalcon\\Mvc\\Model\\TransactionInterface, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_setconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_setwriteconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_setreadconnectionservice, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, connectionService, IS_STRING, 0) +#else ZEND_ARG_INFO(0, connectionService) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_setdirtystate, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_getreadconnectionservice, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_getreadconnectionservice, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_getwriteconnectionservice, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_getwriteconnectionservice, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_modelinterface_getreadconnection, 0, 0, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_getreadconnection, 0, 0, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_modelinterface_getwriteconnection, 0, 0, Phalcon\\Db\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_getwriteconnection, 0, 0, IS_OBJECT, "Phalcon\\Db\\AdapterInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_modelinterface_setdirtystate, 0, 1, Phalcon\\Mvc\\ModelInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_setdirtystate, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\ModelInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_getdirtystate, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_modelinterface_getdirtystate, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_assign, 0, 0, 1) @@ -33,20 +92,36 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_cloneresultmap, 0, 0, ZEND_ARG_INFO(0, base) ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_ARG_INFO(0, columnMap) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, keepSnapshots, _IS_BOOL, 1) +#else ZEND_ARG_INFO(0, keepSnapshots) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_cloneresult, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, base, Phalcon\\Mvc\\ModelInterface, 0) ZEND_ARG_ARRAY_INFO(0, data, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, dirtyState, IS_LONG, 0) +#else ZEND_ARG_INFO(0, dirtyState) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_cloneresultmaphydrate, 0, 0, 3) ZEND_ARG_ARRAY_INFO(0, data, 0) ZEND_ARG_INFO(0, columnMap) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, hydrationMode, IS_LONG, 0) +#else ZEND_ARG_INFO(0, hydrationMode) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_find, 0, 0, 0) @@ -82,11 +157,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_average, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_fireevent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_fireeventcancel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, eventName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, eventName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_appendmessage, 0, 0, 1) @@ -109,11 +192,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_update, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_skipoperation, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, skip, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, skip) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_modelinterface_getrelated, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alias, IS_STRING, 0) +#else ZEND_ARG_INFO(0, alias) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() @@ -129,12 +220,12 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_modelinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, setConnectionService, arginfo_phalcon_mvc_modelinterface_setconnectionservice) PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, setWriteConnectionService, arginfo_phalcon_mvc_modelinterface_setwriteconnectionservice) PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, setReadConnectionService, arginfo_phalcon_mvc_modelinterface_setreadconnectionservice) - PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getReadConnectionService, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getWriteConnectionService, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getReadConnection, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getWriteConnection, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getReadConnectionService, arginfo_phalcon_mvc_modelinterface_getreadconnectionservice) + PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getWriteConnectionService, arginfo_phalcon_mvc_modelinterface_getwriteconnectionservice) + PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getReadConnection, arginfo_phalcon_mvc_modelinterface_getreadconnection) + PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getWriteConnection, arginfo_phalcon_mvc_modelinterface_getwriteconnection) PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, setDirtyState, arginfo_phalcon_mvc_modelinterface_setdirtystate) - PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getDirtyState, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, getDirtyState, arginfo_phalcon_mvc_modelinterface_getdirtystate) PHP_ABSTRACT_ME(Phalcon_Mvc_ModelInterface, assign, arginfo_phalcon_mvc_modelinterface_assign) ZEND_FENTRY(cloneResultMap, NULL, arginfo_phalcon_mvc_modelinterface_cloneresultmap, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) ZEND_FENTRY(cloneResult, NULL, arginfo_phalcon_mvc_modelinterface_cloneresult, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/mvc/router.zep.c b/ext/phalcon/mvc/router.zep.c index 06d7e088cea..584ee63526d 100644 --- a/ext/phalcon/mvc/router.zep.c +++ b/ext/phalcon/mvc/router.zep.c @@ -96,13 +96,13 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router) { zend_declare_property_null(phalcon_mvc_router_ce, SL("_keyRouteIds"), ZEND_ACC_PROTECTED TSRMLS_CC); phalcon_mvc_router_ce->create_object = zephir_init_properties_Phalcon_Mvc_Router; - zend_declare_class_constant_long(phalcon_mvc_router_ce, SL("URI_SOURCE_GET_URL"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_router_ce, SL("URI_SOURCE_GET_URL"), 0); - zend_declare_class_constant_long(phalcon_mvc_router_ce, SL("URI_SOURCE_SERVER_REQUEST_URI"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_router_ce, SL("URI_SOURCE_SERVER_REQUEST_URI"), 1); - zend_declare_class_constant_long(phalcon_mvc_router_ce, SL("POSITION_FIRST"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_router_ce, SL("POSITION_FIRST"), 0); - zend_declare_class_constant_long(phalcon_mvc_router_ce, SL("POSITION_LAST"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_router_ce, SL("POSITION_LAST"), 1); zend_class_implements(phalcon_mvc_router_ce TSRMLS_CC, 1, phalcon_di_injectionawareinterface_ce); zend_class_implements(phalcon_mvc_router_ce TSRMLS_CC, 1, phalcon_mvc_routerinterface_ce); @@ -113,7 +113,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router) { PHP_METHOD(Phalcon_Mvc_Router, getKeyRouteNames) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_keyRouteNames"); @@ -121,20 +122,24 @@ PHP_METHOD(Phalcon_Mvc_Router, getKeyRouteNames) { PHP_METHOD(Phalcon_Mvc_Router, setKeyRouteNames) { - zval *keyRouteNames; + zval *keyRouteNames, keyRouteNames_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyRouteNames_sub); zephir_fetch_params(0, 1, 0, &keyRouteNames); - zephir_update_property_this(getThis(), SL("_keyRouteNames"), keyRouteNames TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_keyRouteNames"), keyRouteNames); RETURN_THISW(); } PHP_METHOD(Phalcon_Mvc_Router, getKeyRouteIds) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_keyRouteIds"); @@ -142,13 +147,16 @@ PHP_METHOD(Phalcon_Mvc_Router, getKeyRouteIds) { PHP_METHOD(Phalcon_Mvc_Router, setKeyRouteIds) { - zval *keyRouteIds; + zval *keyRouteIds, keyRouteIds_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&keyRouteIds_sub); zephir_fetch_params(0, 1, 0, &keyRouteIds); - zephir_update_property_this(getThis(), SL("_keyRouteIds"), keyRouteIds TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_keyRouteIds"), keyRouteIds); RETURN_THISW(); } @@ -158,10 +166,18 @@ PHP_METHOD(Phalcon_Mvc_Router, setKeyRouteIds) { */ PHP_METHOD(Phalcon_Mvc_Router, __construct) { - zval *routes, *_1$$3, *_3$$3; + zval routes, _1$$3, _3$$3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *defaultRoutes_param = NULL, *_0$$3, *_2$$3 = NULL, *_4$$3; + zval *defaultRoutes_param = NULL, _0$$3, _2$$3, _4$$3; zend_bool defaultRoutes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&routes); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &defaultRoutes_param); @@ -169,43 +185,41 @@ PHP_METHOD(Phalcon_Mvc_Router, __construct) { if (!defaultRoutes_param) { defaultRoutes = 1; } else { - if (UNEXPECTED(Z_TYPE_P(defaultRoutes_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'defaultRoutes' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(defaultRoutes_param) != IS_TRUE && Z_TYPE_P(defaultRoutes_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'defaultRoutes' must be of the type bool") TSRMLS_CC); RETURN_MM_NULL(); } - defaultRoutes = Z_BVAL_P(defaultRoutes_param); + defaultRoutes = (Z_TYPE_P(defaultRoutes_param) == IS_TRUE); } - ZEPHIR_INIT_VAR(routes); - array_init(routes); + ZEPHIR_INIT_VAR(&routes); + array_init(&routes); if (defaultRoutes) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_mvc_router_route_ce); - ZEPHIR_INIT_VAR(_1$$3); - zephir_create_array(_1$$3, 1, 0 TSRMLS_CC); - add_assoc_long_ex(_1$$3, SS("controller"), 1); - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_STRING(_2$$3, "#^/([\\w0-9\\_\\-]+)[/]{0,1}$#u", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 82, _2$$3, _1$$3); - zephir_check_temp_parameter(_2$$3); + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_mvc_router_route_ce); + ZEPHIR_INIT_VAR(&_1$$3); + zephir_create_array(&_1$$3, 1, 0 TSRMLS_CC); + add_assoc_long_ex(&_1$$3, SL("controller"), 1); + ZEPHIR_INIT_VAR(&_2$$3); + ZVAL_STRING(&_2$$3, "#^/([\\w0-9\\_\\-]+)[/]{0,1}$#u"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 74, &_2$$3, &_1$$3); zephir_check_call_status(); - zephir_array_append(&routes, _0$$3, PH_SEPARATE, "phalcon/mvc/router.zep", 124); - ZEPHIR_INIT_NVAR(_2$$3); - object_init_ex(_2$$3, phalcon_mvc_router_route_ce); - ZEPHIR_INIT_VAR(_3$$3); - zephir_create_array(_3$$3, 3, 0 TSRMLS_CC); - add_assoc_long_ex(_3$$3, SS("controller"), 1); - add_assoc_long_ex(_3$$3, SS("action"), 2); - add_assoc_long_ex(_3$$3, SS("params"), 3); - ZEPHIR_INIT_VAR(_4$$3); - ZVAL_STRING(_4$$3, "#^/([\\w0-9\\_\\-]+)/([\\w0-9\\.\\_]+)(/.*)*$#u", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _2$$3, "__construct", NULL, 82, _4$$3, _3$$3); - zephir_check_temp_parameter(_4$$3); + zephir_array_append(&routes, &_0$$3, PH_SEPARATE, "phalcon/mvc/router.zep", 124); + ZEPHIR_INIT_NVAR(&_2$$3); + object_init_ex(&_2$$3, phalcon_mvc_router_route_ce); + ZEPHIR_INIT_VAR(&_3$$3); + zephir_create_array(&_3$$3, 3, 0 TSRMLS_CC); + add_assoc_long_ex(&_3$$3, SL("controller"), 1); + add_assoc_long_ex(&_3$$3, SL("action"), 2); + add_assoc_long_ex(&_3$$3, SL("params"), 3); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "#^/([\\w0-9\\_\\-]+)/([\\w0-9\\.\\_]+)(/.*)*$#u"); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", NULL, 74, &_4$$3, &_3$$3); zephir_check_call_status(); - zephir_array_append(&routes, _2$$3, PH_SEPARATE, "phalcon/mvc/router.zep", 130); + zephir_array_append(&routes, &_2$$3, PH_SEPARATE, "phalcon/mvc/router.zep", 130); } - zephir_update_property_this(getThis(), SL("_routes"), routes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_routes"), &routes); ZEPHIR_MM_RESTORE(); } @@ -215,13 +229,16 @@ PHP_METHOD(Phalcon_Mvc_Router, __construct) { */ PHP_METHOD(Phalcon_Mvc_Router, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -230,7 +247,8 @@ PHP_METHOD(Phalcon_Mvc_Router, setDI) { */ PHP_METHOD(Phalcon_Mvc_Router, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -241,13 +259,16 @@ PHP_METHOD(Phalcon_Mvc_Router, getDI) { */ PHP_METHOD(Phalcon_Mvc_Router, setEventsManager) { - zval *eventsManager; + zval *eventsManager, eventsManager_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&eventsManager_sub); zephir_fetch_params(0, 1, 0, &eventsManager); - zephir_update_property_this(getThis(), SL("_eventsManager"), eventsManager TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_eventsManager"), eventsManager); } @@ -256,7 +277,8 @@ PHP_METHOD(Phalcon_Mvc_Router, setEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Router, getEventsManager) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_eventsManager"); @@ -267,32 +289,38 @@ PHP_METHOD(Phalcon_Mvc_Router, getEventsManager) { */ PHP_METHOD(Phalcon_Mvc_Router, getRewriteUri) { - zval *_GET, *_SERVER, *url = NULL, *urlParts = NULL, *realUri = NULL, *_0; + zval *_GET, *_SERVER, url, urlParts, realUri, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&url); + ZVAL_UNDEF(&urlParts); + ZVAL_UNDEF(&realUri); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); - zephir_get_global(&_GET, SS("_GET") TSRMLS_CC); - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_uriSource"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { - ZEPHIR_OBS_VAR(url); - if (zephir_array_isset_string_fetch(&url, _GET, SS("_url"), 0 TSRMLS_CC)) { - if (!(ZEPHIR_IS_EMPTY(url))) { - RETURN_CCTOR(url); + zephir_get_global(&_SERVER, SL("_SERVER")); + zephir_get_global(&_GET, SL("_GET")); + + zephir_read_property(&_0, this_ptr, SL("_uriSource"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { + ZEPHIR_OBS_VAR(&url); + if (zephir_array_isset_string_fetch(&url, _GET, SL("_url"), 0)) { + if (!(ZEPHIR_IS_EMPTY(&url))) { + RETURN_CCTOR(&url); } } } else { - ZEPHIR_OBS_NVAR(url); - if (zephir_array_isset_string_fetch(&url, _SERVER, SS("REQUEST_URI"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(urlParts); - zephir_fast_explode_str(urlParts, SL("?"), url, LONG_MAX TSRMLS_CC); - zephir_array_fetch_long(&realUri, urlParts, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/router.zep", 190 TSRMLS_CC); - if (!(ZEPHIR_IS_EMPTY(realUri))) { - RETURN_CTOR(realUri); + ZEPHIR_OBS_NVAR(&url); + if (zephir_array_isset_string_fetch(&url, _SERVER, SL("REQUEST_URI"), 0)) { + ZEPHIR_INIT_VAR(&urlParts); + zephir_fast_explode_str(&urlParts, SL("?"), &url, LONG_MAX TSRMLS_CC); + zephir_array_fetch_long(&realUri, &urlParts, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/router.zep", 190 TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&realUri))) { + RETURN_CTOR(&realUri); } } } - RETURN_MM_STRING("/", 1); + RETURN_MM_STRING("/"); } @@ -307,13 +335,16 @@ PHP_METHOD(Phalcon_Mvc_Router, getRewriteUri) { */ PHP_METHOD(Phalcon_Mvc_Router, setUriSource) { - zval *uriSource; + zval *uriSource, uriSource_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uriSource_sub); zephir_fetch_params(0, 1, 0, &uriSource); - zephir_update_property_this(getThis(), SL("_uriSource"), uriSource TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_uriSource"), uriSource); RETURN_THISW(); } @@ -323,22 +354,26 @@ PHP_METHOD(Phalcon_Mvc_Router, setUriSource) { */ PHP_METHOD(Phalcon_Mvc_Router, removeExtraSlashes) { - zval *remove_param = NULL; + zval *remove_param = NULL, __$true, __$false; zend_bool remove; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 1, 0, &remove_param); - if (UNEXPECTED(Z_TYPE_P(remove_param) != IS_BOOL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'remove' must be a bool") TSRMLS_CC); + if (UNEXPECTED(Z_TYPE_P(remove_param) != IS_TRUE && Z_TYPE_P(remove_param) != IS_FALSE)) { + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'remove' must be of the type bool") TSRMLS_CC); RETURN_NULL(); } - remove = Z_BVAL_P(remove_param); + remove = (Z_TYPE_P(remove_param) == IS_TRUE); if (remove) { - zephir_update_property_this(getThis(), SL("_removeExtraSlashes"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_removeExtraSlashes"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_removeExtraSlashes"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_removeExtraSlashes"), &__$false); } RETURN_THISW(); @@ -350,24 +385,27 @@ PHP_METHOD(Phalcon_Mvc_Router, removeExtraSlashes) { PHP_METHOD(Phalcon_Mvc_Router, setDefaultNamespace) { zval *namespaceName_param = NULL; - zval *namespaceName = NULL; + zval namespaceName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&namespaceName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &namespaceName_param); if (UNEXPECTED(Z_TYPE_P(namespaceName_param) != IS_STRING && Z_TYPE_P(namespaceName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'namespaceName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'namespaceName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(namespaceName_param) == IS_STRING)) { - zephir_get_strval(namespaceName, namespaceName_param); + zephir_get_strval(&namespaceName, namespaceName_param); } else { - ZEPHIR_INIT_VAR(namespaceName); - ZVAL_EMPTY_STRING(namespaceName); + ZEPHIR_INIT_VAR(&namespaceName); + ZVAL_EMPTY_STRING(&namespaceName); } - zephir_update_property_this(getThis(), SL("_defaultNamespace"), namespaceName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultNamespace"), &namespaceName); RETURN_THIS(); } @@ -378,24 +416,27 @@ PHP_METHOD(Phalcon_Mvc_Router, setDefaultNamespace) { PHP_METHOD(Phalcon_Mvc_Router, setDefaultModule) { zval *moduleName_param = NULL; - zval *moduleName = NULL; + zval moduleName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&moduleName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &moduleName_param); if (UNEXPECTED(Z_TYPE_P(moduleName_param) != IS_STRING && Z_TYPE_P(moduleName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'moduleName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'moduleName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(moduleName_param) == IS_STRING)) { - zephir_get_strval(moduleName, moduleName_param); + zephir_get_strval(&moduleName, moduleName_param); } else { - ZEPHIR_INIT_VAR(moduleName); - ZVAL_EMPTY_STRING(moduleName); + ZEPHIR_INIT_VAR(&moduleName); + ZVAL_EMPTY_STRING(&moduleName); } - zephir_update_property_this(getThis(), SL("_defaultModule"), moduleName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultModule"), &moduleName); RETURN_THIS(); } @@ -406,24 +447,27 @@ PHP_METHOD(Phalcon_Mvc_Router, setDefaultModule) { PHP_METHOD(Phalcon_Mvc_Router, setDefaultController) { zval *controllerName_param = NULL; - zval *controllerName = NULL; + zval controllerName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&controllerName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &controllerName_param); if (UNEXPECTED(Z_TYPE_P(controllerName_param) != IS_STRING && Z_TYPE_P(controllerName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(controllerName_param) == IS_STRING)) { - zephir_get_strval(controllerName, controllerName_param); + zephir_get_strval(&controllerName, controllerName_param); } else { - ZEPHIR_INIT_VAR(controllerName); - ZVAL_EMPTY_STRING(controllerName); + ZEPHIR_INIT_VAR(&controllerName); + ZVAL_EMPTY_STRING(&controllerName); } - zephir_update_property_this(getThis(), SL("_defaultController"), controllerName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultController"), &controllerName); RETURN_THIS(); } @@ -434,24 +478,27 @@ PHP_METHOD(Phalcon_Mvc_Router, setDefaultController) { PHP_METHOD(Phalcon_Mvc_Router, setDefaultAction) { zval *actionName_param = NULL; - zval *actionName = NULL; + zval actionName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&actionName); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &actionName_param); if (UNEXPECTED(Z_TYPE_P(actionName_param) != IS_STRING && Z_TYPE_P(actionName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'actionName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'actionName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(actionName_param) == IS_STRING)) { - zephir_get_strval(actionName, actionName_param); + zephir_get_strval(&actionName, actionName_param); } else { - ZEPHIR_INIT_VAR(actionName); - ZVAL_EMPTY_STRING(actionName); + ZEPHIR_INIT_VAR(&actionName); + ZVAL_EMPTY_STRING(&actionName); } - zephir_update_property_this(getThis(), SL("_defaultAction"), actionName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_defaultAction"), &actionName); RETURN_THIS(); } @@ -471,30 +518,39 @@ PHP_METHOD(Phalcon_Mvc_Router, setDefaultAction) { */ PHP_METHOD(Phalcon_Mvc_Router, setDefaults) { - zval *defaults_param = NULL, *namespaceName = NULL, *module = NULL, *controller = NULL, *action = NULL, *params = NULL; - zval *defaults = NULL; + zval *defaults_param = NULL, namespaceName, module, controller, action, params; + zval defaults; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &defaults_param); + ZVAL_UNDEF(&defaults); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&module); + ZVAL_UNDEF(&controller); + ZVAL_UNDEF(&action); + ZVAL_UNDEF(¶ms); - defaults = defaults_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &defaults_param); + + ZEPHIR_OBS_COPY_OR_DUP(&defaults, defaults_param); - if (zephir_array_isset_string_fetch(&namespaceName, defaults, SS("namespace"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_defaultNamespace"), namespaceName TSRMLS_CC); + if (zephir_array_isset_string_fetch(&namespaceName, &defaults, SL("namespace"), 1)) { + zephir_update_property_zval(this_ptr, SL("_defaultNamespace"), &namespaceName); } - if (zephir_array_isset_string_fetch(&module, defaults, SS("module"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_defaultModule"), module TSRMLS_CC); + if (zephir_array_isset_string_fetch(&module, &defaults, SL("module"), 1)) { + zephir_update_property_zval(this_ptr, SL("_defaultModule"), &module); } - if (zephir_array_isset_string_fetch(&controller, defaults, SS("controller"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_defaultController"), controller TSRMLS_CC); + if (zephir_array_isset_string_fetch(&controller, &defaults, SL("controller"), 1)) { + zephir_update_property_zval(this_ptr, SL("_defaultController"), &controller); } - if (zephir_array_isset_string_fetch(&action, defaults, SS("action"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_defaultAction"), action TSRMLS_CC); + if (zephir_array_isset_string_fetch(&action, &defaults, SL("action"), 1)) { + zephir_update_property_zval(this_ptr, SL("_defaultAction"), &action); } - if (zephir_array_isset_string_fetch(¶ms, defaults, SS("params"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_defaultParams"), params TSRMLS_CC); + if (zephir_array_isset_string_fetch(¶ms, &defaults, SL("params"), 1)) { + zephir_update_property_zval(this_ptr, SL("_defaultParams"), ¶ms); } - RETURN_THISW(); + RETURN_THIS(); } @@ -503,26 +559,29 @@ PHP_METHOD(Phalcon_Mvc_Router, setDefaults) { */ PHP_METHOD(Phalcon_Mvc_Router, getDefaults) { - zval *_0 = NULL; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_create_array(return_value, 5, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_defaultNamespace"), PH_NOISY_CC); - zephir_array_update_string(&return_value, SL("namespace"), &_0, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_defaultModule"), PH_NOISY_CC); - zephir_array_update_string(&return_value, SL("module"), &_0, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_defaultController"), PH_NOISY_CC); - zephir_array_update_string(&return_value, SL("controller"), &_0, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_defaultAction"), PH_NOISY_CC); - zephir_array_update_string(&return_value, SL("action"), &_0, PH_COPY | PH_SEPARATE); - ZEPHIR_OBS_NVAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_defaultParams"), PH_NOISY_CC); - zephir_array_update_string(&return_value, SL("params"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_defaultNamespace"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("namespace"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_defaultModule"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("module"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_defaultController"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("controller"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_defaultAction"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("action"), &_0, PH_COPY | PH_SEPARATE); + ZEPHIR_OBS_NVAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_defaultParams"), PH_NOISY_CC); + zephir_array_update_string(return_value, SL("params"), &_0, PH_COPY | PH_SEPARATE); RETURN_MM(); } @@ -540,365 +599,430 @@ PHP_METHOD(Phalcon_Mvc_Router, getDefaults) { */ PHP_METHOD(Phalcon_Mvc_Router, handle) { - zval *_21$$29 = NULL, *_32$$40 = NULL, *_34$$43 = NULL; - HashTable *_6, *_25$$34; - HashPosition _5, _24$$34; - zend_bool _1, _30$$35; - zephir_fcall_cache_entry *_18 = NULL, *_20 = NULL, *_23 = NULL, *_29 = NULL, *_35 = NULL; + zend_string *_24$$34; + zend_ulong _23$$34; + zval _19$$29, _30$$40, _32$$43; + zend_bool _1, _28$$35; + zephir_fcall_cache_entry *_16 = NULL, *_18 = NULL, *_21 = NULL, *_27 = NULL, *_33 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri_param = NULL, *realUri = NULL, *request = NULL, *currentHostName = NULL, *routeFound = NULL, *parts = NULL, *params = NULL, *matches = NULL, *notFoundPaths = NULL, *vnamespace = NULL, *module = NULL, *controller = NULL, *action = NULL, *paramsStr = NULL, *strParams = NULL, *route = NULL, *methods = NULL, *dependencyInjector = NULL, *hostname = NULL, *regexHostName = NULL, *matched = NULL, *pattern = NULL, *handledUri = NULL, *beforeMatch = NULL, *paths = NULL, *converters = NULL, *part = NULL, *position = NULL, *matchPosition = NULL, *converter = NULL, *eventsManager = NULL, *_0, *_4, **_7, *_36, *_37, *_38, *_39, *_40, _2$$5, *_3$$7, *_8$$10, *_9$$10 = NULL, *_10$$10 = NULL, *_11$$9 = NULL, *_12$$9 = NULL, *_13$$14, *_14$$14 = NULL, *_15$$14 = NULL, *_16$$18 = NULL, *_17$$24 = NULL, *_19$$28 = NULL, *_22$$32 = NULL, **_26$$34, *_27$$36 = NULL, *_28$$36 = NULL, *_31$$40 = NULL, *_33$$43 = NULL, _41$$60, *_42$$62, *_43$$64; - zval *uri = NULL; + zval *uri_param = NULL, __$true, __$false, __$null, realUri, request, currentHostName, routeFound, parts, params, matches, notFoundPaths, vnamespace, module, controller, action, paramsStr, strParams, route, methods, dependencyInjector, hostname, regexHostName, matched, pattern, handledUri, beforeMatch, paths, converters, part, position, matchPosition, converter, eventsManager, _0, _4, *_5, _34, _35, _36, _37, _38, _2$$5, _3$$7, _6$$10, _7$$10, _8$$10, _9$$9, _10$$9, _11$$14, _12$$14, _13$$14, _14$$18, _15$$24, _17$$28, _20$$32, *_22$$34, _25$$36, _26$$36, _29$$40, _31$$43, _39$$60, _40$$62, _41$$64; + zval uri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uri); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&realUri); + ZVAL_UNDEF(&request); + ZVAL_UNDEF(¤tHostName); + ZVAL_UNDEF(&routeFound); + ZVAL_UNDEF(&parts); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(¬FoundPaths); + ZVAL_UNDEF(&vnamespace); + ZVAL_UNDEF(&module); + ZVAL_UNDEF(&controller); + ZVAL_UNDEF(&action); + ZVAL_UNDEF(¶msStr); + ZVAL_UNDEF(&strParams); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&methods); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&hostname); + ZVAL_UNDEF(®exHostName); + ZVAL_UNDEF(&matched); + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&handledUri); + ZVAL_UNDEF(&beforeMatch); + ZVAL_UNDEF(&paths); + ZVAL_UNDEF(&converters); + ZVAL_UNDEF(&part); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&matchPosition); + ZVAL_UNDEF(&converter); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_34); + ZVAL_UNDEF(&_35); + ZVAL_UNDEF(&_36); + ZVAL_UNDEF(&_37); + ZVAL_UNDEF(&_38); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_6$$10); + ZVAL_UNDEF(&_7$$10); + ZVAL_UNDEF(&_8$$10); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_10$$9); + ZVAL_UNDEF(&_11$$14); + ZVAL_UNDEF(&_12$$14); + ZVAL_UNDEF(&_13$$14); + ZVAL_UNDEF(&_14$$18); + ZVAL_UNDEF(&_15$$24); + ZVAL_UNDEF(&_17$$28); + ZVAL_UNDEF(&_20$$32); + ZVAL_UNDEF(&_25$$36); + ZVAL_UNDEF(&_26$$36); + ZVAL_UNDEF(&_29$$40); + ZVAL_UNDEF(&_31$$43); + ZVAL_UNDEF(&_39$$60); + ZVAL_UNDEF(&_40$$62); + ZVAL_UNDEF(&_41$$64); + ZVAL_UNDEF(&_19$$29); + ZVAL_UNDEF(&_30$$40); + ZVAL_UNDEF(&_32$$43); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &uri_param); if (!uri_param) { - ZEPHIR_INIT_VAR(uri); - ZVAL_EMPTY_STRING(uri); + ZEPHIR_INIT_VAR(&uri); + ZVAL_STRING(&uri, ""); } else { - zephir_get_strval(uri, uri_param); + zephir_get_strval(&uri, uri_param); } - if (!(!(!uri) && Z_STRLEN_P(uri))) { + if (!(!(Z_TYPE_P(&uri) == IS_UNDEF) && Z_STRLEN_P(&uri))) { ZEPHIR_CALL_METHOD(&realUri, this_ptr, "getrewriteuri", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(realUri, uri); + ZEPHIR_CPY_WRT(&realUri, &uri); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_removeExtraSlashes"), PH_NOISY_CC); - _1 = zephir_is_true(_0); + zephir_read_property(&_0, this_ptr, SL("_removeExtraSlashes"), PH_NOISY_CC | PH_READONLY); + _1 = zephir_is_true(&_0); if (_1) { - _1 = !ZEPHIR_IS_STRING(realUri, "/"); + _1 = !ZEPHIR_IS_STRING(&realUri, "/"); } if (_1) { - ZEPHIR_SINIT_VAR(_2$$5); - ZVAL_STRING(&_2$$5, "/", 0); - ZEPHIR_INIT_VAR(handledUri); - zephir_fast_trim(handledUri, realUri, &_2$$5, ZEPHIR_TRIM_RIGHT TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$5); + ZVAL_STRING(&_2$$5, "/"); + ZEPHIR_INIT_VAR(&handledUri); + zephir_fast_trim(&handledUri, &realUri, &_2$$5, ZEPHIR_TRIM_RIGHT TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(handledUri, realUri); - } - ZEPHIR_INIT_VAR(request); - ZVAL_NULL(request); - ZEPHIR_INIT_VAR(currentHostName); - ZVAL_NULL(currentHostName); - ZEPHIR_INIT_VAR(routeFound); - ZVAL_BOOL(routeFound, 0); - ZEPHIR_INIT_VAR(parts); - array_init(parts); - ZEPHIR_INIT_VAR(params); - array_init(params); - ZEPHIR_INIT_VAR(matches); - ZVAL_NULL(matches); + ZEPHIR_CPY_WRT(&handledUri, &realUri); + } + ZEPHIR_INIT_VAR(&request); + ZVAL_NULL(&request); + ZEPHIR_INIT_VAR(¤tHostName); + ZVAL_NULL(¤tHostName); + ZEPHIR_INIT_VAR(&routeFound); + ZVAL_BOOL(&routeFound, 0); + ZEPHIR_INIT_VAR(&parts); + array_init(&parts); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); + ZEPHIR_INIT_VAR(&matches); + ZVAL_NULL(&matches); if (0) { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); - } - zephir_update_property_this(getThis(), SL("_matchedRoute"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_3$$7); - ZVAL_STRING(_3$$7, "router:beforeCheckRoutes", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _3$$7, this_ptr); - zephir_check_temp_parameter(_3$$7); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$false); + } + zephir_update_property_zval(this_ptr, SL("_matchedRoute"), &__$null); + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_3$$7); + ZVAL_STRING(&_3$$7, "router:beforeCheckRoutes"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_3$$7, this_ptr); zephir_check_call_status(); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); - zephir_is_iterable(_4, &_6, &_5, 0, 1, "phalcon/mvc/router.zep", 586); - for ( - ; zend_hash_get_current_data_ex(_6, (void**) &_7, &_5) == SUCCESS - ; zend_hash_move_backwards_ex(_6, &_5) - ) { - ZEPHIR_GET_HVALUE(route, _7); - ZEPHIR_INIT_NVAR(params); - array_init(params); - ZEPHIR_INIT_NVAR(matches); - ZVAL_NULL(matches); - ZEPHIR_CALL_METHOD(&methods, route, "gethttpmethods", NULL, 0); + zephir_read_property(&_4, this_ptr, SL("_routes"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_4, 0, "phalcon/mvc/router.zep", 586); + ZEND_HASH_REVERSE_FOREACH_VAL(Z_ARRVAL_P(&_4), _5) + { + ZEPHIR_INIT_NVAR(&route); + ZVAL_COPY(&route, _5); + ZEPHIR_INIT_NVAR(¶ms); + array_init(¶ms); + ZEPHIR_INIT_NVAR(&matches); + ZVAL_NULL(&matches); + ZEPHIR_CALL_METHOD(&methods, &route, "gethttpmethods", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(methods) != IS_NULL) { - if (Z_TYPE_P(request) == IS_NULL) { - _8$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _8$$10); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&methods) != IS_NULL) { + if (Z_TYPE_P(&request) == IS_NULL) { + zephir_read_property(&_6$$10, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_6$$10); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "A dependency injection container is required to access the 'request' service", "phalcon/mvc/router.zep", 391); return; } - ZEPHIR_INIT_NVAR(_10$$10); - ZVAL_STRING(_10$$10, "request", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_9$$10, dependencyInjector, "getshared", NULL, 0, _10$$10); - zephir_check_temp_parameter(_10$$10); + ZEPHIR_INIT_NVAR(&_8$$10); + ZVAL_STRING(&_8$$10, "request"); + ZEPHIR_CALL_METHOD(&_7$$10, &dependencyInjector, "getshared", NULL, 0, &_8$$10); zephir_check_call_status(); - ZEPHIR_CPY_WRT(request, _9$$10); + ZEPHIR_CPY_WRT(&request, &_7$$10); } - ZEPHIR_INIT_NVAR(_12$$9); - ZVAL_BOOL(_12$$9, 1); - ZEPHIR_CALL_METHOD(&_11$$9, request, "ismethod", NULL, 0, methods, _12$$9); + ZVAL_BOOL(&_10$$9, 1); + ZEPHIR_CALL_METHOD(&_9$$9, &request, "ismethod", NULL, 0, &methods, &_10$$9); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_11$$9)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_9$$9)) { continue; } } - ZEPHIR_CALL_METHOD(&hostname, route, "gethostname", NULL, 0); + ZEPHIR_CALL_METHOD(&hostname, &route, "gethostname", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(hostname) != IS_NULL) { - if (Z_TYPE_P(request) == IS_NULL) { - _13$$14 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _13$$14); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&hostname) != IS_NULL) { + if (Z_TYPE_P(&request) == IS_NULL) { + zephir_read_property(&_11$$14, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_11$$14); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "A dependency injection container is required to access the 'request' service", "phalcon/mvc/router.zep", 418); return; } - ZEPHIR_INIT_NVAR(_15$$14); - ZVAL_STRING(_15$$14, "request", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_14$$14, dependencyInjector, "getshared", NULL, 0, _15$$14); - zephir_check_temp_parameter(_15$$14); + ZEPHIR_INIT_NVAR(&_13$$14); + ZVAL_STRING(&_13$$14, "request"); + ZEPHIR_CALL_METHOD(&_12$$14, &dependencyInjector, "getshared", NULL, 0, &_13$$14); zephir_check_call_status(); - ZEPHIR_CPY_WRT(request, _14$$14); + ZEPHIR_CPY_WRT(&request, &_12$$14); } - if (Z_TYPE_P(currentHostName) == IS_NULL) { - ZEPHIR_CALL_METHOD(¤tHostName, request, "gethttphost", NULL, 0); + if (Z_TYPE_P(¤tHostName) == IS_NULL) { + ZEPHIR_CALL_METHOD(¤tHostName, &request, "gethttphost", NULL, 0); zephir_check_call_status(); } - if (!(zephir_is_true(currentHostName))) { + if (!(zephir_is_true(¤tHostName))) { continue; } - if (zephir_memnstr_str(hostname, SL("("), "phalcon/mvc/router.zep", 441)) { - if (!(zephir_memnstr_str(hostname, SL("#"), "phalcon/mvc/router.zep", 442))) { - ZEPHIR_INIT_NVAR(regexHostName); - ZEPHIR_CONCAT_SV(regexHostName, "#^", hostname); - if (!(zephir_memnstr_str(hostname, SL(":"), "phalcon/mvc/router.zep", 444))) { + if (zephir_memnstr_str(&hostname, SL("("), "phalcon/mvc/router.zep", 441)) { + if (!(zephir_memnstr_str(&hostname, SL("#"), "phalcon/mvc/router.zep", 442))) { + ZEPHIR_INIT_NVAR(®exHostName); + ZEPHIR_CONCAT_SV(®exHostName, "#^", &hostname); + if (!(zephir_memnstr_str(&hostname, SL(":"), "phalcon/mvc/router.zep", 444))) { zephir_concat_self_str(®exHostName, SL("(:[[:digit:]]+)?") TSRMLS_CC); } zephir_concat_self_str(®exHostName, SL("$#i") TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(regexHostName, hostname); + ZEPHIR_CPY_WRT(®exHostName, &hostname); } - ZEPHIR_INIT_NVAR(_16$$18); - ZEPHIR_INIT_NVAR(matched); - zephir_preg_match(matched, regexHostName, currentHostName, _16$$18, 0, 0 , 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_14$$18); + ZEPHIR_INIT_NVAR(&matched); + zephir_preg_match(&matched, ®exHostName, ¤tHostName, &_14$$18, 0, 0 , 0 TSRMLS_CC); } else { - ZEPHIR_INIT_NVAR(matched); - ZVAL_BOOL(matched, ZEPHIR_IS_EQUAL(currentHostName, hostname)); + ZEPHIR_INIT_NVAR(&matched); + ZVAL_BOOL(&matched, ZEPHIR_IS_EQUAL(¤tHostName, &hostname)); } - if (!(zephir_is_true(matched))) { + if (!(zephir_is_true(&matched))) { continue; } } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_17$$24); - ZVAL_STRING(_17$$24, "router:beforeCheckRoute", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_18, 0, _17$$24, this_ptr, route); - zephir_check_temp_parameter(_17$$24); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_15$$24); + ZVAL_STRING(&_15$$24, "router:beforeCheckRoute"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_16, 0, &_15$$24, this_ptr, &route); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&pattern, route, "getcompiledpattern", NULL, 0); + ZEPHIR_CALL_METHOD(&pattern, &route, "getcompiledpattern", NULL, 0); zephir_check_call_status(); - if (zephir_memnstr_str(pattern, SL("^"), "phalcon/mvc/router.zep", 470)) { - ZEPHIR_INIT_NVAR(routeFound); - zephir_preg_match(routeFound, pattern, handledUri, matches, 0, 0 , 0 TSRMLS_CC); + if (zephir_memnstr_str(&pattern, SL("^"), "phalcon/mvc/router.zep", 470)) { + ZEPHIR_INIT_NVAR(&routeFound); + zephir_preg_match(&routeFound, &pattern, &handledUri, &matches, 0, 0 , 0 TSRMLS_CC); } else { - ZEPHIR_INIT_NVAR(routeFound); - ZVAL_BOOL(routeFound, ZEPHIR_IS_EQUAL(pattern, handledUri)); + ZEPHIR_INIT_NVAR(&routeFound); + ZVAL_BOOL(&routeFound, ZEPHIR_IS_EQUAL(&pattern, &handledUri)); } - if (zephir_is_true(routeFound)) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_19$$28); - ZVAL_STRING(_19$$28, "router:matchedRoute", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_20, 0, _19$$28, this_ptr, route); - zephir_check_temp_parameter(_19$$28); + if (zephir_is_true(&routeFound)) { + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_17$$28); + ZVAL_STRING(&_17$$28, "router:matchedRoute"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_18, 0, &_17$$28, this_ptr, &route); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&beforeMatch, route, "getbeforematch", NULL, 0); + ZEPHIR_CALL_METHOD(&beforeMatch, &route, "getbeforematch", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(beforeMatch) != IS_NULL) { - if (!(zephir_is_callable(beforeMatch TSRMLS_CC))) { + if (Z_TYPE_P(&beforeMatch) != IS_NULL) { + if (!(zephir_is_callable(&beforeMatch TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "Before-Match callback is not callable in matched route", "phalcon/mvc/router.zep", 492); return; } - ZEPHIR_INIT_NVAR(_21$$29); - zephir_create_array(_21$$29, 3, 0 TSRMLS_CC); - zephir_array_fast_append(_21$$29, handledUri); - zephir_array_fast_append(_21$$29, route); - zephir_array_fast_append(_21$$29, this_ptr); - ZEPHIR_INIT_NVAR(routeFound); - ZEPHIR_CALL_USER_FUNC_ARRAY(routeFound, beforeMatch, _21$$29); + ZEPHIR_INIT_NVAR(&_19$$29); + zephir_create_array(&_19$$29, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&_19$$29, &handledUri); + zephir_array_fast_append(&_19$$29, &route); + zephir_array_fast_append(&_19$$29, this_ptr); + ZEPHIR_INIT_NVAR(&routeFound); + ZEPHIR_CALL_USER_FUNC_ARRAY(&routeFound, &beforeMatch, &_19$$29); zephir_check_call_status(); } } else { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_22$$32); - ZVAL_STRING(_22$$32, "router:notMatchedRoute", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&routeFound, eventsManager, "fire", &_23, 0, _22$$32, this_ptr, route); - zephir_check_temp_parameter(_22$$32); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_20$$32); + ZVAL_STRING(&_20$$32, "router:notMatchedRoute"); + ZEPHIR_CALL_METHOD(&routeFound, &eventsManager, "fire", &_21, 0, &_20$$32, this_ptr, &route); zephir_check_call_status(); } } - if (zephir_is_true(routeFound)) { - ZEPHIR_CALL_METHOD(&paths, route, "getpaths", NULL, 0); + if (zephir_is_true(&routeFound)) { + ZEPHIR_CALL_METHOD(&paths, &route, "getpaths", NULL, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(parts, paths); - if (Z_TYPE_P(matches) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&converters, route, "getconverters", NULL, 0); + ZEPHIR_CPY_WRT(&parts, &paths); + if (Z_TYPE_P(&matches) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(&converters, &route, "getconverters", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(paths, &_25$$34, &_24$$34, 0, 0, "phalcon/mvc/router.zep", 575); - for ( - ; zend_hash_get_current_data_ex(_25$$34, (void**) &_26$$34, &_24$$34) == SUCCESS - ; zend_hash_move_forward_ex(_25$$34, &_24$$34) - ) { - ZEPHIR_GET_HMKEY(part, _25$$34, _24$$34); - ZEPHIR_GET_HVALUE(position, _26$$34); - if (Z_TYPE_P(part) != IS_STRING) { - ZEPHIR_INIT_NVAR(_27$$36); - object_init_ex(_27$$36, phalcon_mvc_router_exception_ce); - ZEPHIR_INIT_LNVAR(_28$$36); - ZEPHIR_CONCAT_SV(_28$$36, "Wrong key in paths: ", part); - ZEPHIR_CALL_METHOD(NULL, _27$$36, "__construct", &_29, 9, _28$$36); + zephir_is_iterable(&paths, 0, "phalcon/mvc/router.zep", 575); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&paths), _23$$34, _24$$34, _22$$34) + { + ZEPHIR_INIT_NVAR(&part); + if (_24$$34 != NULL) { + ZVAL_STR_COPY(&part, _24$$34); + } else { + ZVAL_LONG(&part, _23$$34); + } + ZEPHIR_INIT_NVAR(&position); + ZVAL_COPY(&position, _22$$34); + if (Z_TYPE_P(&part) != IS_STRING) { + ZEPHIR_INIT_NVAR(&_25$$36); + object_init_ex(&_25$$36, phalcon_mvc_router_exception_ce); + ZEPHIR_INIT_LNVAR(_26$$36); + ZEPHIR_CONCAT_SV(&_26$$36, "Wrong key in paths: ", &part); + ZEPHIR_CALL_METHOD(NULL, &_25$$36, "__construct", &_27, 4, &_26$$36); zephir_check_call_status(); - zephir_throw_exception_debug(_27$$36, "phalcon/mvc/router.zep", 528 TSRMLS_CC); + zephir_throw_exception_debug(&_25$$36, "phalcon/mvc/router.zep", 528 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - _30$$35 = Z_TYPE_P(position) != IS_STRING; - if (_30$$35) { - _30$$35 = Z_TYPE_P(position) != IS_LONG; + _28$$35 = Z_TYPE_P(&position) != IS_STRING; + if (_28$$35) { + _28$$35 = Z_TYPE_P(&position) != IS_LONG; } - if (_30$$35) { + if (_28$$35) { continue; } - ZEPHIR_OBS_NVAR(matchPosition); - if (zephir_array_isset_fetch(&matchPosition, matches, position, 0 TSRMLS_CC)) { - if (Z_TYPE_P(converters) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(converter); - if (zephir_array_isset_fetch(&converter, converters, part, 0 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_31$$40); - ZEPHIR_INIT_NVAR(_32$$40); - zephir_create_array(_32$$40, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_32$$40, matchPosition); - ZEPHIR_CALL_USER_FUNC_ARRAY(_31$$40, converter, _32$$40); + ZEPHIR_OBS_NVAR(&matchPosition); + if (zephir_array_isset_fetch(&matchPosition, &matches, &position, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&converters) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&converter); + if (zephir_array_isset_fetch(&converter, &converters, &part, 0 TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_29$$40); + ZEPHIR_INIT_NVAR(&_30$$40); + zephir_create_array(&_30$$40, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_30$$40, &matchPosition); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_29$$40, &converter, &_30$$40); zephir_check_call_status(); - zephir_array_update_zval(&parts, part, &_31$$40, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&parts, &part, &_29$$40, PH_COPY | PH_SEPARATE); continue; } } - zephir_array_update_zval(&parts, part, &matchPosition, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&parts, &part, &matchPosition, PH_COPY | PH_SEPARATE); } else { - if (Z_TYPE_P(converters) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(converter); - if (zephir_array_isset_fetch(&converter, converters, part, 0 TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_33$$43); - ZEPHIR_INIT_NVAR(_34$$43); - zephir_create_array(_34$$43, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_34$$43, position); - ZEPHIR_CALL_USER_FUNC_ARRAY(_33$$43, converter, _34$$43); + if (Z_TYPE_P(&converters) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&converter); + if (zephir_array_isset_fetch(&converter, &converters, &part, 0 TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_31$$43); + ZEPHIR_INIT_NVAR(&_32$$43); + zephir_create_array(&_32$$43, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_32$$43, &position); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_31$$43, &converter, &_32$$43); zephir_check_call_status(); - zephir_array_update_zval(&parts, part, &_33$$43, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&parts, &part, &_31$$43, PH_COPY | PH_SEPARATE); } } else { - if (Z_TYPE_P(position) == IS_LONG) { - zephir_array_unset(&parts, part, PH_SEPARATE); + if (Z_TYPE_P(&position) == IS_LONG) { + zephir_array_unset(&parts, &part, PH_SEPARATE); } } } - } - zephir_update_property_this(getThis(), SL("_matches"), matches TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&position); + ZEPHIR_INIT_NVAR(&part); + zephir_update_property_zval(this_ptr, SL("_matches"), &matches); } - zephir_update_property_this(getThis(), SL("_matchedRoute"), route TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_matchedRoute"), &route); break; } - } - if (zephir_is_true(routeFound)) { + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&route); + if (zephir_is_true(&routeFound)) { if (1) { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$false); } } else { if (0) { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_wasMatched"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_wasMatched"), &__$false); } } - if (!(zephir_is_true(routeFound))) { - ZEPHIR_OBS_VAR(notFoundPaths); - zephir_read_property_this(¬FoundPaths, this_ptr, SL("_notFoundPaths"), PH_NOISY_CC); - if (Z_TYPE_P(notFoundPaths) != IS_NULL) { - ZEPHIR_CALL_CE_STATIC(&parts, phalcon_mvc_router_route_ce, "getroutepaths", &_35, 83, notFoundPaths); + if (!(zephir_is_true(&routeFound))) { + ZEPHIR_OBS_VAR(¬FoundPaths); + zephir_read_property(¬FoundPaths, this_ptr, SL("_notFoundPaths"), PH_NOISY_CC); + if (Z_TYPE_P(¬FoundPaths) != IS_NULL) { + ZEPHIR_CALL_CE_STATIC(&parts, phalcon_mvc_router_route_ce, "getroutepaths", &_33, 0, ¬FoundPaths); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(routeFound); - ZVAL_BOOL(routeFound, 1); + ZEPHIR_INIT_NVAR(&routeFound); + ZVAL_BOOL(&routeFound, 1); } } - _36 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultNamespace"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_namespace"), _36 TSRMLS_CC); - _37 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultModule"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_module"), _37 TSRMLS_CC); - _38 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultController"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_controller"), _38 TSRMLS_CC); - _39 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultAction"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_action"), _39 TSRMLS_CC); - _40 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultParams"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_params"), _40 TSRMLS_CC); - if (zephir_is_true(routeFound)) { - ZEPHIR_OBS_VAR(vnamespace); - if (zephir_array_isset_string_fetch(&vnamespace, parts, SS("namespace"), 0 TSRMLS_CC)) { - if (!(zephir_is_numeric(vnamespace))) { - zephir_update_property_this(getThis(), SL("_namespace"), vnamespace TSRMLS_CC); + zephir_read_property(&_34, this_ptr, SL("_defaultNamespace"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_namespace"), &_34); + zephir_read_property(&_35, this_ptr, SL("_defaultModule"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_module"), &_35); + zephir_read_property(&_36, this_ptr, SL("_defaultController"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_controller"), &_36); + zephir_read_property(&_37, this_ptr, SL("_defaultAction"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_action"), &_37); + zephir_read_property(&_38, this_ptr, SL("_defaultParams"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(this_ptr, SL("_params"), &_38); + if (zephir_is_true(&routeFound)) { + ZEPHIR_OBS_VAR(&vnamespace); + if (zephir_array_isset_string_fetch(&vnamespace, &parts, SL("namespace"), 0)) { + if (!(zephir_is_numeric(&vnamespace))) { + zephir_update_property_zval(this_ptr, SL("_namespace"), &vnamespace); } - zephir_array_unset_string(&parts, SS("namespace"), PH_SEPARATE); + zephir_array_unset_string(&parts, SL("namespace"), PH_SEPARATE); } - ZEPHIR_OBS_VAR(module); - if (zephir_array_isset_string_fetch(&module, parts, SS("module"), 0 TSRMLS_CC)) { - if (!(zephir_is_numeric(module))) { - zephir_update_property_this(getThis(), SL("_module"), module TSRMLS_CC); + ZEPHIR_OBS_VAR(&module); + if (zephir_array_isset_string_fetch(&module, &parts, SL("module"), 0)) { + if (!(zephir_is_numeric(&module))) { + zephir_update_property_zval(this_ptr, SL("_module"), &module); } - zephir_array_unset_string(&parts, SS("module"), PH_SEPARATE); + zephir_array_unset_string(&parts, SL("module"), PH_SEPARATE); } - ZEPHIR_OBS_VAR(controller); - if (zephir_array_isset_string_fetch(&controller, parts, SS("controller"), 0 TSRMLS_CC)) { - if (!(zephir_is_numeric(controller))) { - zephir_update_property_this(getThis(), SL("_controller"), controller TSRMLS_CC); + ZEPHIR_OBS_VAR(&controller); + if (zephir_array_isset_string_fetch(&controller, &parts, SL("controller"), 0)) { + if (!(zephir_is_numeric(&controller))) { + zephir_update_property_zval(this_ptr, SL("_controller"), &controller); } - zephir_array_unset_string(&parts, SS("controller"), PH_SEPARATE); + zephir_array_unset_string(&parts, SL("controller"), PH_SEPARATE); } - ZEPHIR_OBS_VAR(action); - if (zephir_array_isset_string_fetch(&action, parts, SS("action"), 0 TSRMLS_CC)) { - if (!(zephir_is_numeric(action))) { - zephir_update_property_this(getThis(), SL("_action"), action TSRMLS_CC); + ZEPHIR_OBS_VAR(&action); + if (zephir_array_isset_string_fetch(&action, &parts, SL("action"), 0)) { + if (!(zephir_is_numeric(&action))) { + zephir_update_property_zval(this_ptr, SL("_action"), &action); } - zephir_array_unset_string(&parts, SS("action"), PH_SEPARATE); + zephir_array_unset_string(&parts, SL("action"), PH_SEPARATE); } - ZEPHIR_OBS_VAR(paramsStr); - if (zephir_array_isset_string_fetch(¶msStr, parts, SS("params"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(paramsStr) == IS_STRING) { - ZEPHIR_SINIT_VAR(_41$$60); - ZVAL_STRING(&_41$$60, "/", 0); - ZEPHIR_INIT_VAR(strParams); - zephir_fast_trim(strParams, paramsStr, &_41$$60, ZEPHIR_TRIM_BOTH TSRMLS_CC); - if (!ZEPHIR_IS_STRING_IDENTICAL(strParams, "")) { - ZEPHIR_INIT_NVAR(params); - zephir_fast_explode_str(params, SL("/"), strParams, LONG_MAX TSRMLS_CC); + ZEPHIR_OBS_VAR(¶msStr); + if (zephir_array_isset_string_fetch(¶msStr, &parts, SL("params"), 0)) { + if (Z_TYPE_P(¶msStr) == IS_STRING) { + ZEPHIR_INIT_VAR(&_39$$60); + ZVAL_STRING(&_39$$60, "/"); + ZEPHIR_INIT_VAR(&strParams); + zephir_fast_trim(&strParams, ¶msStr, &_39$$60, ZEPHIR_TRIM_BOTH TSRMLS_CC); + if (!ZEPHIR_IS_STRING_IDENTICAL(&strParams, "")) { + ZEPHIR_INIT_NVAR(¶ms); + zephir_fast_explode_str(¶ms, SL("/"), &strParams, LONG_MAX TSRMLS_CC); } } - zephir_array_unset_string(&parts, SS("params"), PH_SEPARATE); + zephir_array_unset_string(&parts, SL("params"), PH_SEPARATE); } - if (zephir_fast_count_int(params TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_42$$62); - zephir_fast_array_merge(_42$$62, &(params), &(parts) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_params"), _42$$62 TSRMLS_CC); + if (zephir_fast_count_int(¶ms TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_40$$62); + zephir_fast_array_merge(&_40$$62, ¶ms, &parts TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_params"), &_40$$62); } else { - zephir_update_property_this(getThis(), SL("_params"), parts TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_params"), &parts); } } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_43$$64); - ZVAL_STRING(_43$$64, "router:afterCheckRoutes", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _43$$64, this_ptr); - zephir_check_temp_parameter(_43$$64); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_41$$64); + ZVAL_STRING(&_41$$64, "router:afterCheckRoutes"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_41$$64, this_ptr); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -928,13 +1052,21 @@ PHP_METHOD(Phalcon_Mvc_Router, handle) { */ PHP_METHOD(Phalcon_Mvc_Router, attach) { - zval *_1$$4; - zval *route, *position = NULL, *_0$$4, *_2$$4; + zval _1$$4; + zval *route, route_sub, *position = NULL, position_sub, _0$$4, _2$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&route_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &route, &position); if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } @@ -946,13 +1078,13 @@ PHP_METHOD(Phalcon_Mvc_Router, attach) { break; } if (ZEPHIR_IS_LONG(position, 0)) { - ZEPHIR_INIT_VAR(_0$$4); - ZEPHIR_INIT_VAR(_1$$4); - zephir_create_array(_1$$4, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_1$$4, route); - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); - zephir_fast_array_merge(_0$$4, &(_1$$4), &(_2$$4) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_routes"), _0$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$4); + ZEPHIR_INIT_VAR(&_1$$4); + zephir_create_array(&_1$$4, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_1$$4, route); + zephir_read_property(&_2$$4, this_ptr, SL("_routes"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_0$$4, &_1$$4, &_2$$4 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_routes"), &_0$$4); break; } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "Invalid route position", "phalcon/mvc/router.zep", 711); @@ -977,41 +1109,52 @@ PHP_METHOD(Phalcon_Mvc_Router, attach) { PHP_METHOD(Phalcon_Mvc_Router, add) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *httpMethods = NULL, *position = NULL, *route = NULL; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, *position = NULL, position_sub, __$null, route; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&httpMethods_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&route); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &pattern_param, &paths, &httpMethods, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!httpMethods) { - httpMethods = ZEPHIR_GLOBAL(global_null); + httpMethods = &httpMethods_sub; + httpMethods = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(route); - object_init_ex(route, phalcon_mvc_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, route, "__construct", NULL, 82, pattern, paths, httpMethods); + ZEPHIR_INIT_VAR(&route); + object_init_ex(&route, phalcon_mvc_router_route_ce); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 74, &pattern, paths, httpMethods); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "attach", NULL, 0, route, position); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "attach", NULL, 0, &route, position); zephir_check_call_status(); - RETURN_CCTOR(route); + RETURN_CCTOR(&route); } @@ -1021,35 +1164,43 @@ PHP_METHOD(Phalcon_Mvc_Router, add) { PHP_METHOD(Phalcon_Mvc_Router, addGet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "GET", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "GET"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1061,35 +1212,43 @@ PHP_METHOD(Phalcon_Mvc_Router, addGet) { PHP_METHOD(Phalcon_Mvc_Router, addPost) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "POST", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "POST"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1101,35 +1260,43 @@ PHP_METHOD(Phalcon_Mvc_Router, addPost) { PHP_METHOD(Phalcon_Mvc_Router, addPut) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "PUT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "PUT"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1141,35 +1308,43 @@ PHP_METHOD(Phalcon_Mvc_Router, addPut) { PHP_METHOD(Phalcon_Mvc_Router, addPatch) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "PATCH", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "PATCH"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1181,35 +1356,43 @@ PHP_METHOD(Phalcon_Mvc_Router, addPatch) { PHP_METHOD(Phalcon_Mvc_Router, addDelete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "DELETE", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "DELETE"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1221,35 +1404,43 @@ PHP_METHOD(Phalcon_Mvc_Router, addDelete) { PHP_METHOD(Phalcon_Mvc_Router, addOptions) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "OPTIONS", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "OPTIONS"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1261,35 +1452,43 @@ PHP_METHOD(Phalcon_Mvc_Router, addOptions) { PHP_METHOD(Phalcon_Mvc_Router, addHead) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "HEAD", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "HEAD"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1301,35 +1500,43 @@ PHP_METHOD(Phalcon_Mvc_Router, addHead) { PHP_METHOD(Phalcon_Mvc_Router, addPurge) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "PURGE", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "PURGE"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1341,35 +1548,43 @@ PHP_METHOD(Phalcon_Mvc_Router, addPurge) { PHP_METHOD(Phalcon_Mvc_Router, addTrace) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "TRACE", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "TRACE"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1381,35 +1596,43 @@ PHP_METHOD(Phalcon_Mvc_Router, addTrace) { PHP_METHOD(Phalcon_Mvc_Router, addConnect) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *position = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *position = NULL, position_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&position_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &position); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!position) { + position = &position_sub; ZEPHIR_INIT_VAR(position); ZVAL_LONG(position, 1); } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "CONNECT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, pattern, paths, _0, position); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "CONNECT"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "add", NULL, 0, &pattern, paths, &_0, position); zephir_check_call_status(); RETURN_MM(); @@ -1420,65 +1643,73 @@ PHP_METHOD(Phalcon_Mvc_Router, addConnect) { */ PHP_METHOD(Phalcon_Mvc_Router, mount) { - HashTable *_2$$5, *_5$$7; - HashPosition _1$$5, _4$$7; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *group, *groupRoutes = NULL, *beforeMatch = NULL, *hostname = NULL, *routes = NULL, *route = NULL, *eventsManager = NULL, *_0$$3, **_3$$5, **_6$$7, *_7$$9; + zval *group, group_sub, groupRoutes, beforeMatch, hostname, routes, route, eventsManager, _0$$3, *_1$$5, *_2$$7, _3$$9; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&group_sub); + ZVAL_UNDEF(&groupRoutes); + ZVAL_UNDEF(&beforeMatch); + ZVAL_UNDEF(&hostname); + ZVAL_UNDEF(&routes); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_3$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &group); - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_STRING(_0$$3, "router:beforeMount", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _0$$3, this_ptr, group); - zephir_check_temp_parameter(_0$$3); + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "router:beforeMount"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_0$$3, this_ptr, group); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&groupRoutes, group, "getroutes", NULL, 0); zephir_check_call_status(); - if (!(zephir_fast_count_int(groupRoutes TSRMLS_CC))) { + if (!(zephir_fast_count_int(&groupRoutes TSRMLS_CC))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "The group of routes does not contain any routes", "phalcon/mvc/router.zep", 837); return; } ZEPHIR_CALL_METHOD(&beforeMatch, group, "getbeforematch", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(beforeMatch) != IS_NULL) { - zephir_is_iterable(groupRoutes, &_2$$5, &_1$$5, 0, 0, "phalcon/mvc/router.zep", 849); - for ( - ; zend_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS - ; zend_hash_move_forward_ex(_2$$5, &_1$$5) - ) { - ZEPHIR_GET_HVALUE(route, _3$$5); - ZEPHIR_CALL_METHOD(NULL, route, "beforematch", NULL, 0, beforeMatch); + if (Z_TYPE_P(&beforeMatch) != IS_NULL) { + zephir_is_iterable(&groupRoutes, 0, "phalcon/mvc/router.zep", 849); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&groupRoutes), _1$$5) + { + ZEPHIR_INIT_NVAR(&route); + ZVAL_COPY(&route, _1$$5); + ZEPHIR_CALL_METHOD(NULL, &route, "beforematch", NULL, 0, &beforeMatch); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&route); } ZEPHIR_CALL_METHOD(&hostname, group, "gethostname", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(hostname) != IS_NULL) { - zephir_is_iterable(groupRoutes, &_5$$7, &_4$$7, 0, 0, "phalcon/mvc/router.zep", 858); - for ( - ; zend_hash_get_current_data_ex(_5$$7, (void**) &_6$$7, &_4$$7) == SUCCESS - ; zend_hash_move_forward_ex(_5$$7, &_4$$7) - ) { - ZEPHIR_GET_HVALUE(route, _6$$7); - ZEPHIR_CALL_METHOD(NULL, route, "sethostname", NULL, 0, hostname); + if (Z_TYPE_P(&hostname) != IS_NULL) { + zephir_is_iterable(&groupRoutes, 0, "phalcon/mvc/router.zep", 858); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&groupRoutes), _2$$7) + { + ZEPHIR_INIT_NVAR(&route); + ZVAL_COPY(&route, _2$$7); + ZEPHIR_CALL_METHOD(NULL, &route, "sethostname", NULL, 0, &hostname); zephir_check_call_status(); - } - } - ZEPHIR_OBS_VAR(routes); - zephir_read_property_this(&routes, this_ptr, SL("_routes"), PH_NOISY_CC); - if (Z_TYPE_P(routes) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_7$$9); - zephir_fast_array_merge(_7$$9, &(routes), &(groupRoutes) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_routes"), _7$$9 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&route); + } + ZEPHIR_OBS_VAR(&routes); + zephir_read_property(&routes, this_ptr, SL("_routes"), PH_NOISY_CC); + if (Z_TYPE_P(&routes) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_3$$9); + zephir_fast_array_merge(&_3$$9, &routes, &groupRoutes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_routes"), &_3$$9); } else { - zephir_update_property_this(getThis(), SL("_routes"), groupRoutes TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_routes"), &groupRoutes); } RETURN_THIS(); @@ -1490,7 +1721,10 @@ PHP_METHOD(Phalcon_Mvc_Router, mount) { PHP_METHOD(Phalcon_Mvc_Router, notFound) { zend_bool _0; - zval *paths; + zval *paths, paths_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&paths_sub); zephir_fetch_params(0, 1, 0, &paths); @@ -1504,7 +1738,7 @@ PHP_METHOD(Phalcon_Mvc_Router, notFound) { ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_router_exception_ce, "The not-found paths must be an array or string", "phalcon/mvc/router.zep", 877); return; } - zephir_update_property_this(getThis(), SL("_notFoundPaths"), paths TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_notFoundPaths"), paths); RETURN_THISW(); } @@ -1514,13 +1748,16 @@ PHP_METHOD(Phalcon_Mvc_Router, notFound) { */ PHP_METHOD(Phalcon_Mvc_Router, clear) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_routes"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_routes"), &_0); ZEPHIR_MM_RESTORE(); } @@ -1530,7 +1767,8 @@ PHP_METHOD(Phalcon_Mvc_Router, clear) { */ PHP_METHOD(Phalcon_Mvc_Router, getNamespaceName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_namespace"); @@ -1541,7 +1779,8 @@ PHP_METHOD(Phalcon_Mvc_Router, getNamespaceName) { */ PHP_METHOD(Phalcon_Mvc_Router, getModuleName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_module"); @@ -1552,7 +1791,8 @@ PHP_METHOD(Phalcon_Mvc_Router, getModuleName) { */ PHP_METHOD(Phalcon_Mvc_Router, getControllerName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_controller"); @@ -1563,7 +1803,8 @@ PHP_METHOD(Phalcon_Mvc_Router, getControllerName) { */ PHP_METHOD(Phalcon_Mvc_Router, getActionName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_action"); @@ -1574,7 +1815,8 @@ PHP_METHOD(Phalcon_Mvc_Router, getActionName) { */ PHP_METHOD(Phalcon_Mvc_Router, getParams) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_params"); @@ -1585,7 +1827,8 @@ PHP_METHOD(Phalcon_Mvc_Router, getParams) { */ PHP_METHOD(Phalcon_Mvc_Router, getMatchedRoute) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_matchedRoute"); @@ -1596,7 +1839,8 @@ PHP_METHOD(Phalcon_Mvc_Router, getMatchedRoute) { */ PHP_METHOD(Phalcon_Mvc_Router, getMatches) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_matches"); @@ -1607,7 +1851,8 @@ PHP_METHOD(Phalcon_Mvc_Router, getMatches) { */ PHP_METHOD(Phalcon_Mvc_Router, wasMatched) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_wasMatched"); @@ -1618,7 +1863,8 @@ PHP_METHOD(Phalcon_Mvc_Router, wasMatched) { */ PHP_METHOD(Phalcon_Mvc_Router, getRoutes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_routes"); @@ -1629,38 +1875,54 @@ PHP_METHOD(Phalcon_Mvc_Router, getRoutes) { */ PHP_METHOD(Phalcon_Mvc_Router, getRouteById) { - HashTable *_5; - HashPosition _4; + zend_string *_6; + zend_ulong _5; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, *route = NULL, *routeId = NULL, *key = NULL, *_0, *_3, **_6, *_1$$3, *_2$$3; + zval *id, id_sub, route, routeId, key, _0, _3, *_4, _1$$3, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&routeId); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &id); - ZEPHIR_OBS_VAR(key); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_keyRouteIds"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&key, _0, id, 0 TSRMLS_CC)) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); - zephir_array_fetch(&_2$$3, _1$$3, key, PH_NOISY | PH_READONLY, "phalcon/mvc/router.zep", 971 TSRMLS_CC); - RETURN_CTOR(_2$$3); + ZEPHIR_OBS_VAR(&key); + zephir_read_property(&_0, this_ptr, SL("_keyRouteIds"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&key, &_0, id, 0 TSRMLS_CC)) { + zephir_read_property(&_1$$3, this_ptr, SL("_routes"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_2$$3, &_1$$3, &key, PH_NOISY | PH_READONLY, "phalcon/mvc/router.zep", 971 TSRMLS_CC); + RETURN_CTOR(&_2$$3); } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); - zephir_is_iterable(_3, &_5, &_4, 0, 0, "phalcon/mvc/router.zep", 982); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HMKEY(key, _5, _4); - ZEPHIR_GET_HVALUE(route, _6); - ZEPHIR_CALL_METHOD(&routeId, route, "getrouteid", NULL, 0); + zephir_read_property(&_3, this_ptr, SL("_routes"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_3, 0, "phalcon/mvc/router.zep", 982); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_3), _5, _6, _4) + { + ZEPHIR_INIT_NVAR(&key); + if (_6 != NULL) { + ZVAL_STR_COPY(&key, _6); + } else { + ZVAL_LONG(&key, _5); + } + ZEPHIR_INIT_NVAR(&route); + ZVAL_COPY(&route, _4); + ZEPHIR_CALL_METHOD(&routeId, &route, "getrouteid", NULL, 0); zephir_check_call_status(); - zephir_update_property_array(this_ptr, SL("_keyRouteIds"), routeId, key TSRMLS_CC); - if (ZEPHIR_IS_EQUAL(routeId, id)) { - RETURN_CCTOR(route); + zephir_update_property_array(this_ptr, SL("_keyRouteIds"), &routeId, &key TSRMLS_CC); + if (ZEPHIR_IS_EQUAL(&routeId, id)) { + RETURN_CCTOR(&route); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&route); + ZEPHIR_INIT_NVAR(&key); RETURN_MM_BOOL(0); } @@ -1670,51 +1932,67 @@ PHP_METHOD(Phalcon_Mvc_Router, getRouteById) { */ PHP_METHOD(Phalcon_Mvc_Router, getRouteByName) { - HashTable *_5; - HashPosition _4; + zend_string *_6; + zend_ulong _5; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *route = NULL, *routeName = NULL, *key = NULL, *_0, *_3, **_6, *_1$$3, *_2$$3; - zval *name = NULL; + zval *name_param = NULL, route, routeName, key, _0, _3, *_4, _1$$3, _2$$3; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&routeName); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); - } - - - ZEPHIR_OBS_VAR(key); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_keyRouteNames"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&key, _0, name, 0 TSRMLS_CC)) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); - zephir_array_fetch(&_2$$3, _1$$3, key, PH_NOISY | PH_READONLY, "phalcon/mvc/router.zep", 993 TSRMLS_CC); - RETURN_CTOR(_2$$3); - } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_routes"), PH_NOISY_CC); - zephir_is_iterable(_3, &_5, &_4, 0, 0, "phalcon/mvc/router.zep", 1006); - for ( - ; zend_hash_get_current_data_ex(_5, (void**) &_6, &_4) == SUCCESS - ; zend_hash_move_forward_ex(_5, &_4) - ) { - ZEPHIR_GET_HMKEY(key, _5, _4); - ZEPHIR_GET_HVALUE(route, _6); - ZEPHIR_CALL_METHOD(&routeName, route, "getname", NULL, 0); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); + } + + + ZEPHIR_OBS_VAR(&key); + zephir_read_property(&_0, this_ptr, SL("_keyRouteNames"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&key, &_0, &name, 0 TSRMLS_CC)) { + zephir_read_property(&_1$$3, this_ptr, SL("_routes"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_2$$3, &_1$$3, &key, PH_NOISY | PH_READONLY, "phalcon/mvc/router.zep", 993 TSRMLS_CC); + RETURN_CTOR(&_2$$3); + } + zephir_read_property(&_3, this_ptr, SL("_routes"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_3, 0, "phalcon/mvc/router.zep", 1006); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_3), _5, _6, _4) + { + ZEPHIR_INIT_NVAR(&key); + if (_6 != NULL) { + ZVAL_STR_COPY(&key, _6); + } else { + ZVAL_LONG(&key, _5); + } + ZEPHIR_INIT_NVAR(&route); + ZVAL_COPY(&route, _4); + ZEPHIR_CALL_METHOD(&routeName, &route, "getname", NULL, 0); zephir_check_call_status(); - if (!(ZEPHIR_IS_EMPTY(routeName))) { - zephir_update_property_array(this_ptr, SL("_keyRouteNames"), routeName, key TSRMLS_CC); - if (ZEPHIR_IS_EQUAL(routeName, name)) { - RETURN_CCTOR(route); + if (!(ZEPHIR_IS_EMPTY(&routeName))) { + zephir_update_property_array(this_ptr, SL("_keyRouteNames"), &routeName, &key TSRMLS_CC); + if (ZEPHIR_IS_EQUAL(&routeName, &name)) { + RETURN_CCTOR(&route); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&route); + ZEPHIR_INIT_NVAR(&key); RETURN_MM_BOOL(0); } @@ -1724,58 +2002,56 @@ PHP_METHOD(Phalcon_Mvc_Router, getRouteByName) { */ PHP_METHOD(Phalcon_Mvc_Router, isExactControllerName) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Router(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Router(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_2, *_4, *_6, *_1$$3, *_3$$4, *_5$$5, *_7$$6; + zval _0, _2, _4, _6, _1$$3, _3$$4, _5$$5, _7$$6; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$6); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_keyRouteIds"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_keyRouteIds"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_keyRouteIds"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_keyRouteIds"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_keyRouteNames"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("_keyRouteNames"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_keyRouteNames"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("_keyRouteNames"), &_3$$4); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultParams"), PH_NOISY_CC); - if (Z_TYPE_P(_4) == IS_NULL) { - ZEPHIR_INIT_VAR(_5$$5); - array_init(_5$$5); - zephir_update_property_this(getThis(), SL("_defaultParams"), _5$$5 TSRMLS_CC); + zephir_read_property(&_4, this_ptr, SL("_defaultParams"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_4) == IS_NULL) { + ZEPHIR_INIT_VAR(&_5$$5); + array_init(&_5$$5); + zephir_update_property_zval(this_ptr, SL("_defaultParams"), &_5$$5); } - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (Z_TYPE_P(_6) == IS_NULL) { - ZEPHIR_INIT_VAR(_7$$6); - array_init(_7$$6); - zephir_update_property_this(getThis(), SL("_params"), _7$$6 TSRMLS_CC); + zephir_read_property(&_6, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_6) == IS_NULL) { + ZEPHIR_INIT_VAR(&_7$$6); + array_init(&_7$$6); + zephir_update_property_zval(this_ptr, SL("_params"), &_7$$6); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/router.zep.h b/ext/phalcon/mvc/router.zep.h index 10427a5b90b..e710dac5a37 100644 --- a/ext/phalcon/mvc/router.zep.h +++ b/ext/phalcon/mvc/router.zep.h @@ -49,7 +49,7 @@ PHP_METHOD(Phalcon_Mvc_Router, getRoutes); PHP_METHOD(Phalcon_Mvc_Router, getRouteById); PHP_METHOD(Phalcon_Mvc_Router, getRouteByName); PHP_METHOD(Phalcon_Mvc_Router, isExactControllerName); -zend_object_value zephir_init_properties_Phalcon_Mvc_Router(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Router(zend_class_entry *class_type TSRMLS_DC); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_setkeyroutenames, 0, 0, 1) ZEND_ARG_INFO(0, keyRouteNames) @@ -60,135 +60,393 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_setkeyrouteids, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router___construct, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultRoutes, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, defaultRoutes) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_seteventsmanager, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, eventsManager, Phalcon\\Events\\ManagerInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_seturisource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_geteventsmanager, 0, 0, Phalcon\\Events\\ManagerInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_geteventsmanager, 0, 0, IS_OBJECT, "Phalcon\\Events\\ManagerInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getrewriteuri, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getrewriteuri, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_seturisource, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_seturisource, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif ZEND_ARG_INFO(0, uriSource) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_removeextraslashes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_removeextraslashes, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_removeextraslashes, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, remove, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, remove) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_setdefaultnamespace, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_setdefaultnamespace, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_setdefaultnamespace, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespaceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespaceName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_setdefaultmodule, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_setdefaultmodule, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_setdefaultmodule, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, moduleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, moduleName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_setdefaultcontroller, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_setdefaultcontroller, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_setdefaultcontroller, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_setdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_setdefaultaction, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_setdefaultaction, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_setdefaults, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_setdefaults, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_setdefaults, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif ZEND_ARG_ARRAY_INFO(0, defaults, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getdefaults, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getdefaults, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_handle, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) +#else ZEND_ARG_INFO(0, uri) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_attach, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_attach, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_attach, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, route, Phalcon\\Mvc\\Router\\RouteInterface, 0) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_add, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_add, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_add, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, httpMethods) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_addget, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_addget, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_addget, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_addpost, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_addpost, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_addpost, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_addput, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_addput, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_addput, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_addpatch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_addpatch, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_addpatch, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_adddelete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_adddelete, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_adddelete, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_addoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_addoptions, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_addoptions, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_addhead, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_addhead, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_addhead, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_addpurge, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_addpurge, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_addpurge, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_addtrace, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_addtrace, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_addtrace, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_addconnect, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_addconnect, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_addconnect, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, position) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_mount, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_mount, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_mount, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, group, Phalcon\\Mvc\\Router\\GroupInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_notfound, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_notfound, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_notfound, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getnamespacename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getnamespacename, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getmodulename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getmodulename, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getcontrollername, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getcontrollername, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getactionname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getactionname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getparams, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getparams, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_getmatchedroute, 0, 0, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getmatchedroute, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getmatches, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getmatches, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_wasmatched, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_wasmatched, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_getroutes, 0, 0, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_getroutes, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_getroutebyid, 0, 0, 1) ZEND_ARG_INFO(0, id) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_getroutebyname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_isexactcontrollername, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_isexactcontrollername, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_router_method_entry) { @@ -198,10 +456,10 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_router_method_entry) { PHP_ME(Phalcon_Mvc_Router, setKeyRouteIds, arginfo_phalcon_mvc_router_setkeyrouteids, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, __construct, arginfo_phalcon_mvc_router___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Router, setDI, arginfo_phalcon_mvc_router_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getDI, arginfo_phalcon_mvc_router_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, setEventsManager, arginfo_phalcon_mvc_router_seteventsmanager, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getEventsManager, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getRewriteUri, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getEventsManager, arginfo_phalcon_mvc_router_geteventsmanager, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getRewriteUri, arginfo_phalcon_mvc_router_getrewriteuri, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, setUriSource, arginfo_phalcon_mvc_router_seturisource, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, removeExtraSlashes, arginfo_phalcon_mvc_router_removeextraslashes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, setDefaultNamespace, arginfo_phalcon_mvc_router_setdefaultnamespace, ZEND_ACC_PUBLIC) @@ -209,7 +467,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_router_method_entry) { PHP_ME(Phalcon_Mvc_Router, setDefaultController, arginfo_phalcon_mvc_router_setdefaultcontroller, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, setDefaultAction, arginfo_phalcon_mvc_router_setdefaultaction, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, setDefaults, arginfo_phalcon_mvc_router_setdefaults, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getDefaults, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getDefaults, arginfo_phalcon_mvc_router_getdefaults, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, handle, arginfo_phalcon_mvc_router_handle, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, attach, arginfo_phalcon_mvc_router_attach, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, add, arginfo_phalcon_mvc_router_add, ZEND_ACC_PUBLIC) @@ -226,17 +484,17 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_router_method_entry) { PHP_ME(Phalcon_Mvc_Router, mount, arginfo_phalcon_mvc_router_mount, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, notFound, arginfo_phalcon_mvc_router_notfound, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, clear, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getNamespaceName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getModuleName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getControllerName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getActionName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getParams, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getMatchedRoute, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getMatches, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, wasMatched, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, getRoutes, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getNamespaceName, arginfo_phalcon_mvc_router_getnamespacename, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getModuleName, arginfo_phalcon_mvc_router_getmodulename, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getControllerName, arginfo_phalcon_mvc_router_getcontrollername, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getActionName, arginfo_phalcon_mvc_router_getactionname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getParams, arginfo_phalcon_mvc_router_getparams, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getMatchedRoute, arginfo_phalcon_mvc_router_getmatchedroute, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getMatches, arginfo_phalcon_mvc_router_getmatches, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, wasMatched, arginfo_phalcon_mvc_router_wasmatched, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, getRoutes, arginfo_phalcon_mvc_router_getroutes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, getRouteById, arginfo_phalcon_mvc_router_getroutebyid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router, getRouteByName, arginfo_phalcon_mvc_router_getroutebyname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router, isExactControllerName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router, isExactControllerName, arginfo_phalcon_mvc_router_isexactcontrollername, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/router/annotations.zep.c b/ext/phalcon/mvc/router/annotations.zep.c index 108a007dc7a..87822229948 100644 --- a/ext/phalcon/mvc/router/annotations.zep.c +++ b/ext/phalcon/mvc/router/annotations.zep.c @@ -68,45 +68,50 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_Annotations) { */ PHP_METHOD(Phalcon_Mvc_Router_Annotations, addResource) { - zval *_0; + zval _0; zval *handler_param = NULL, *prefix_param = NULL; - zval *handler = NULL, *prefix = NULL; + zval handler, prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &handler_param, &prefix_param); if (UNEXPECTED(Z_TYPE_P(handler_param) != IS_STRING && Z_TYPE_P(handler_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(handler_param) == IS_STRING)) { - zephir_get_strval(handler, handler_param); + zephir_get_strval(&handler, handler_param); } else { - ZEPHIR_INIT_VAR(handler); - ZVAL_EMPTY_STRING(handler); + ZEPHIR_INIT_VAR(&handler); + ZVAL_EMPTY_STRING(&handler); } if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } else { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_EMPTY_STRING(&prefix); } } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_0, prefix); - zephir_array_fast_append(_0, handler); - zephir_update_property_array_append(this_ptr, SL("_handlers"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, &prefix); + zephir_array_fast_append(&_0, &handler); + zephir_update_property_array_append(this_ptr, SL("_handlers"), &_0 TSRMLS_CC); RETURN_THIS(); } @@ -118,56 +123,62 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, addResource) { */ PHP_METHOD(Phalcon_Mvc_Router_Annotations, addModuleResource) { - zval *_0; + zval _0; zval *module_param = NULL, *handler_param = NULL, *prefix_param = NULL; - zval *module = NULL, *handler = NULL, *prefix = NULL; + zval module, handler, prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&module); + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &module_param, &handler_param, &prefix_param); if (UNEXPECTED(Z_TYPE_P(module_param) != IS_STRING && Z_TYPE_P(module_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'module' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'module' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(module_param) == IS_STRING)) { - zephir_get_strval(module, module_param); + zephir_get_strval(&module, module_param); } else { - ZEPHIR_INIT_VAR(module); - ZVAL_EMPTY_STRING(module); + ZEPHIR_INIT_VAR(&module); + ZVAL_EMPTY_STRING(&module); } if (UNEXPECTED(Z_TYPE_P(handler_param) != IS_STRING && Z_TYPE_P(handler_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(handler_param) == IS_STRING)) { - zephir_get_strval(handler, handler_param); + zephir_get_strval(&handler, handler_param); } else { - ZEPHIR_INIT_VAR(handler); - ZVAL_EMPTY_STRING(handler); + ZEPHIR_INIT_VAR(&handler); + ZVAL_EMPTY_STRING(&handler); } if (!prefix_param) { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_STRING(&prefix, ""); } else { if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } else { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_EMPTY_STRING(&prefix); } } - ZEPHIR_INIT_VAR(_0); - zephir_create_array(_0, 3, 0 TSRMLS_CC); - zephir_array_fast_append(_0, prefix); - zephir_array_fast_append(_0, handler); - zephir_array_fast_append(_0, module); - zephir_update_property_array_append(this_ptr, SL("_handlers"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + zephir_create_array(&_0, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&_0, &prefix); + zephir_array_fast_append(&_0, &handler); + zephir_array_fast_append(&_0, &module); + zephir_update_property_array_append(this_ptr, SL("_handlers"), &_0 TSRMLS_CC); RETURN_THIS(); } @@ -177,146 +188,179 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, addModuleResource) { */ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) { - zend_bool _5$$6; - HashTable *_3, *_9$$14, *_13$$16, *_17$$18; - HashPosition _2, _8$$14, _12$$16, _16$$18; - zephir_fcall_cache_entry *_7 = NULL, *_11 = NULL, *_19 = NULL, *_20 = NULL; + zend_string *_10$$16; + zend_ulong _9$$16; + zend_bool _3$$6; + zephir_fcall_cache_entry *_5 = NULL, *_7 = NULL, *_13 = NULL, *_14 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri_param = NULL, *realUri = NULL, *annotationsService = NULL, *handlers = NULL, *controllerSuffix = NULL, *scope = NULL, *prefix = NULL, *dependencyInjector = NULL, *handler = NULL, *controllerName = NULL, *lowerControllerName = NULL, *namespaceName = NULL, *moduleName = NULL, *sufixed = NULL, *handlerAnnotations = NULL, *classAnnotations = NULL, *annotations = NULL, *annotation = NULL, *methodAnnotations = NULL, *method = NULL, *collection = NULL, *_0, *_1, **_4, *_6$$11 = NULL, **_10$$14, **_14$$16, *_15$$18 = NULL, **_18$$18; - zval *uri = NULL; + zval *uri_param = NULL, __$null, realUri, annotationsService, handlers, controllerSuffix, scope, prefix, dependencyInjector, handler, controllerName, lowerControllerName, namespaceName, moduleName, sufixed, handlerAnnotations, classAnnotations, annotations, annotation, methodAnnotations, method, collection, _0, _1, *_2, _4$$11, *_6$$14, *_8$$16, _11$$18, *_12$$18; + zval uri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uri); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&realUri); + ZVAL_UNDEF(&annotationsService); + ZVAL_UNDEF(&handlers); + ZVAL_UNDEF(&controllerSuffix); + ZVAL_UNDEF(&scope); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&controllerName); + ZVAL_UNDEF(&lowerControllerName); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&moduleName); + ZVAL_UNDEF(&sufixed); + ZVAL_UNDEF(&handlerAnnotations); + ZVAL_UNDEF(&classAnnotations); + ZVAL_UNDEF(&annotations); + ZVAL_UNDEF(&annotation); + ZVAL_UNDEF(&methodAnnotations); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&collection); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_4$$11); + ZVAL_UNDEF(&_11$$18); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &uri_param); if (!uri_param) { - ZEPHIR_INIT_VAR(uri); - ZVAL_EMPTY_STRING(uri); + ZEPHIR_INIT_VAR(&uri); + ZVAL_STRING(&uri, ""); } else { if (UNEXPECTED(Z_TYPE_P(uri_param) != IS_STRING && Z_TYPE_P(uri_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'uri' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(uri_param) == IS_STRING)) { - zephir_get_strval(uri, uri_param); + zephir_get_strval(&uri, uri_param); } else { - ZEPHIR_INIT_VAR(uri); - ZVAL_EMPTY_STRING(uri); + ZEPHIR_INIT_VAR(&uri); + ZVAL_EMPTY_STRING(&uri); } } - if (!(!(!uri) && Z_STRLEN_P(uri))) { + if (!(!(Z_TYPE_P(&uri) == IS_UNDEF) && Z_STRLEN_P(&uri))) { ZEPHIR_CALL_METHOD(&realUri, this_ptr, "getrewriteuri", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(realUri, uri); + ZEPHIR_CPY_WRT(&realUri, &uri); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "A dependency injection container is required to access the 'annotations' service", "phalcon/mvc/router/annotations.zep", 104); return; } - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "annotations", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&annotationsService, dependencyInjector, "getshared", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "annotations"); + ZEPHIR_CALL_METHOD(&annotationsService, &dependencyInjector, "getshared", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_OBS_VAR(handlers); - zephir_read_property_this(&handlers, this_ptr, SL("_handlers"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(controllerSuffix); - zephir_read_property_this(&controllerSuffix, this_ptr, SL("_controllerSuffix"), PH_NOISY_CC); - zephir_is_iterable(handlers, &_3, &_2, 0, 0, "phalcon/mvc/router/annotations.zep", 205); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HVALUE(scope, _4); - if (Z_TYPE_P(scope) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&handlers); + zephir_read_property(&handlers, this_ptr, SL("_handlers"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&controllerSuffix); + zephir_read_property(&controllerSuffix, this_ptr, SL("_controllerSuffix"), PH_NOISY_CC); + zephir_is_iterable(&handlers, 0, "phalcon/mvc/router/annotations.zep", 205); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&handlers), _2) + { + ZEPHIR_INIT_NVAR(&scope); + ZVAL_COPY(&scope, _2); + if (Z_TYPE_P(&scope) != IS_ARRAY) { continue; } - ZEPHIR_OBS_NVAR(prefix); - zephir_array_fetch_long(&prefix, scope, 0, PH_NOISY, "phalcon/mvc/router/annotations.zep", 122 TSRMLS_CC); - _5$$6 = !(ZEPHIR_IS_EMPTY(prefix)); - if (_5$$6) { - _5$$6 = !(zephir_start_with(realUri, prefix, NULL)); + ZEPHIR_OBS_NVAR(&prefix); + zephir_array_fetch_long(&prefix, &scope, 0, PH_NOISY, "phalcon/mvc/router/annotations.zep", 122 TSRMLS_CC); + _3$$6 = !(ZEPHIR_IS_EMPTY(&prefix)); + if (_3$$6) { + _3$$6 = !(zephir_start_with(&realUri, &prefix, NULL)); } - if (_5$$6) { + if (_3$$6) { continue; } - ZEPHIR_OBS_NVAR(handler); - zephir_array_fetch_long(&handler, scope, 1, PH_NOISY, "phalcon/mvc/router/annotations.zep", 131 TSRMLS_CC); - if (zephir_memnstr_str(handler, SL("\\"), "phalcon/mvc/router/annotations.zep", 133)) { - ZEPHIR_INIT_NVAR(controllerName); - zephir_get_class_ns(controllerName, handler, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(namespaceName); - zephir_get_ns_class(namespaceName, handler, 0 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&handler); + zephir_array_fetch_long(&handler, &scope, 1, PH_NOISY, "phalcon/mvc/router/annotations.zep", 131 TSRMLS_CC); + if (zephir_memnstr_str(&handler, SL("\\"), "phalcon/mvc/router/annotations.zep", 133)) { + ZEPHIR_INIT_NVAR(&controllerName); + zephir_get_class_ns(&controllerName, &handler, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&namespaceName); + zephir_get_ns_class(&namespaceName, &handler, 0 TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(controllerName, handler); - ZEPHIR_OBS_NVAR(namespaceName); + ZEPHIR_CPY_WRT(&controllerName, &handler); + ZEPHIR_OBS_NVAR(&namespaceName); zephir_fetch_property(&namespaceName, this_ptr, SL("_defaultNamespace"), PH_SILENT_CC); } - zephir_update_property_this(getThis(), SL("_routePrefix"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); - ZEPHIR_OBS_NVAR(moduleName); - zephir_array_isset_long_fetch(&moduleName, scope, 2, 0 TSRMLS_CC); - ZEPHIR_INIT_NVAR(sufixed); - ZEPHIR_CONCAT_VV(sufixed, controllerName, controllerSuffix); - if (Z_TYPE_P(namespaceName) != IS_NULL) { - ZEPHIR_INIT_LNVAR(_6$$11); - ZEPHIR_CONCAT_VSV(_6$$11, namespaceName, "\\", sufixed); - ZEPHIR_CPY_WRT(sufixed, _6$$11); + zephir_update_property_zval(this_ptr, SL("_routePrefix"), &__$null); + ZEPHIR_OBS_NVAR(&moduleName); + zephir_array_isset_long_fetch(&moduleName, &scope, 2, 0 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&sufixed); + ZEPHIR_CONCAT_VV(&sufixed, &controllerName, &controllerSuffix); + if (Z_TYPE_P(&namespaceName) != IS_NULL) { + ZEPHIR_INIT_LNVAR(_4$$11); + ZEPHIR_CONCAT_VSV(&_4$$11, &namespaceName, "\\", &sufixed); + ZEPHIR_CPY_WRT(&sufixed, &_4$$11); } - ZEPHIR_CALL_METHOD(&handlerAnnotations, annotationsService, "get", &_7, 0, sufixed); + ZEPHIR_CALL_METHOD(&handlerAnnotations, &annotationsService, "get", &_5, 0, &sufixed); zephir_check_call_status(); - if (Z_TYPE_P(handlerAnnotations) != IS_OBJECT) { + if (Z_TYPE_P(&handlerAnnotations) != IS_OBJECT) { continue; } - ZEPHIR_CALL_METHOD(&classAnnotations, handlerAnnotations, "getclassannotations", NULL, 0); + ZEPHIR_CALL_METHOD(&classAnnotations, &handlerAnnotations, "getclassannotations", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(classAnnotations) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&annotations, classAnnotations, "getannotations", NULL, 0); + if (Z_TYPE_P(&classAnnotations) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&annotations, &classAnnotations, "getannotations", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(annotations) == IS_ARRAY) { - zephir_is_iterable(annotations, &_9$$14, &_8$$14, 0, 0, "phalcon/mvc/router/annotations.zep", 182); - for ( - ; zend_hash_get_current_data_ex(_9$$14, (void**) &_10$$14, &_8$$14) == SUCCESS - ; zend_hash_move_forward_ex(_9$$14, &_8$$14) - ) { - ZEPHIR_GET_HVALUE(annotation, _10$$14); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processcontrollerannotation", &_11, 0, controllerName, annotation); + if (Z_TYPE_P(&annotations) == IS_ARRAY) { + zephir_is_iterable(&annotations, 0, "phalcon/mvc/router/annotations.zep", 182); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&annotations), _6$$14) + { + ZEPHIR_INIT_NVAR(&annotation); + ZVAL_COPY(&annotation, _6$$14); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "processcontrollerannotation", &_7, 0, &controllerName, &annotation); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&annotation); } } - ZEPHIR_CALL_METHOD(&methodAnnotations, handlerAnnotations, "getmethodsannotations", NULL, 0); + ZEPHIR_CALL_METHOD(&methodAnnotations, &handlerAnnotations, "getmethodsannotations", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(methodAnnotations) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(lowerControllerName); - zephir_uncamelize(lowerControllerName, controllerName, NULL ); - zephir_is_iterable(methodAnnotations, &_13$$16, &_12$$16, 0, 0, "phalcon/mvc/router/annotations.zep", 199); - for ( - ; zend_hash_get_current_data_ex(_13$$16, (void**) &_14$$16, &_12$$16) == SUCCESS - ; zend_hash_move_forward_ex(_13$$16, &_12$$16) - ) { - ZEPHIR_GET_HMKEY(method, _13$$16, _12$$16); - ZEPHIR_GET_HVALUE(collection, _14$$16); - if (Z_TYPE_P(collection) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_15$$18, collection, "getannotations", NULL, 0); + if (Z_TYPE_P(&methodAnnotations) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&lowerControllerName); + zephir_uncamelize(&lowerControllerName, &controllerName, NULL ); + zephir_is_iterable(&methodAnnotations, 0, "phalcon/mvc/router/annotations.zep", 199); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&methodAnnotations), _9$$16, _10$$16, _8$$16) + { + ZEPHIR_INIT_NVAR(&method); + if (_10$$16 != NULL) { + ZVAL_STR_COPY(&method, _10$$16); + } else { + ZVAL_LONG(&method, _9$$16); + } + ZEPHIR_INIT_NVAR(&collection); + ZVAL_COPY(&collection, _8$$16); + if (Z_TYPE_P(&collection) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&_11$$18, &collection, "getannotations", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_15$$18, &_17$$18, &_16$$18, 0, 0, "phalcon/mvc/router/annotations.zep", 197); - for ( - ; zend_hash_get_current_data_ex(_17$$18, (void**) &_18$$18, &_16$$18) == SUCCESS - ; zend_hash_move_forward_ex(_17$$18, &_16$$18) - ) { - ZEPHIR_GET_HVALUE(annotation, _18$$18); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_19, 0, moduleName, namespaceName, lowerControllerName, method, annotation); + zephir_is_iterable(&_11$$18, 0, "phalcon/mvc/router/annotations.zep", 197); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_11$$18), _12$$18) + { + ZEPHIR_INIT_NVAR(&annotation); + ZVAL_COPY(&annotation, _12$$18); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "processactionannotation", &_13, 0, &moduleName, &namespaceName, &lowerControllerName, &method, &annotation); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&annotation); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&collection); + ZEPHIR_INIT_NVAR(&method); } - } - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_router_annotations_ce, getThis(), "handle", &_20, 398, realUri); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&scope); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_router_annotations_ce, getThis(), "handle", &_14, 0, &realUri); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -328,32 +372,38 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, handle) { PHP_METHOD(Phalcon_Mvc_Router_Annotations, processControllerAnnotation) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *handler_param = NULL, *annotation, *_0 = NULL, *_1$$3 = NULL, *_2$$3; - zval *handler = NULL; + zval *handler_param = NULL, *annotation, annotation_sub, _0, _1$$3, _2$$3; + zval handler; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handler); + ZVAL_UNDEF(&annotation_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &handler_param, &annotation); if (UNEXPECTED(Z_TYPE_P(handler_param) != IS_STRING && Z_TYPE_P(handler_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'handler' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(handler_param) == IS_STRING)) { - zephir_get_strval(handler, handler_param); + zephir_get_strval(&handler, handler_param); } else { - ZEPHIR_INIT_VAR(handler); - ZVAL_EMPTY_STRING(handler); + ZEPHIR_INIT_VAR(&handler); + ZVAL_EMPTY_STRING(&handler); } ZEPHIR_CALL_METHOD(&_0, annotation, "getname", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_STRING(_0, "RoutePrefix")) { - ZEPHIR_INIT_VAR(_2$$3); - ZVAL_LONG(_2$$3, 0); - ZEPHIR_CALL_METHOD(&_1$$3, annotation, "getargument", NULL, 0, _2$$3); + if (ZEPHIR_IS_STRING(&_0, "RoutePrefix")) { + ZVAL_LONG(&_2$$3, 0); + ZEPHIR_CALL_METHOD(&_1$$3, annotation, "getargument", NULL, 0, &_2$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_routePrefix"), _1$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_routePrefix"), &_1$$3); } ZEPHIR_MM_RESTORE(); @@ -364,227 +414,259 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, processControllerAnnotation) { */ PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation) { - HashTable *_7$$23, *_11$$25; - HashPosition _6$$23, _10$$25; - zend_bool isRoute = 0, _14$$10, _5$$21; - zephir_fcall_cache_entry *_9 = NULL, *_13 = NULL; + zend_string *_9$$23, *_13$$25; + zend_ulong _8$$23, _12$$25; + zend_bool isRoute = 0, _15$$10, _6$$21; + zephir_fcall_cache_entry *_10 = NULL, *_14 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *module_param = NULL, *namespaceName_param = NULL, *controller_param = NULL, *action_param = NULL, *annotation, *name = NULL, *actionName = NULL, *routePrefix = NULL, *paths = NULL, *value = NULL, *uri = NULL, *route = NULL, *methods = NULL, *converts = NULL, *param = NULL, *convert = NULL, *conversorParam = NULL, *routeName = NULL, *beforeMatch = NULL, *_0$$10, *_1$$10, _2$$10, *_3$$10 = NULL, *_4$$21, **_8$$23, **_12$$25; - zval *module = NULL, *namespaceName = NULL, *controller = NULL, *action = NULL; + zval *module_param = NULL, *namespaceName_param = NULL, *controller_param = NULL, *action_param = NULL, *annotation, annotation_sub, name, actionName, routePrefix, paths, value, uri, route, methods, converts, param, convert, conversorParam, routeName, beforeMatch, _0$$10, _1$$10, _2$$10, _3$$10, _4$$10, _5$$21, *_7$$23, *_11$$25; + zval module, namespaceName, controller, action; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&module); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&controller); + ZVAL_UNDEF(&action); + ZVAL_UNDEF(&annotation_sub); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&actionName); + ZVAL_UNDEF(&routePrefix); + ZVAL_UNDEF(&paths); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&uri); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&methods); + ZVAL_UNDEF(&converts); + ZVAL_UNDEF(¶m); + ZVAL_UNDEF(&convert); + ZVAL_UNDEF(&conversorParam); + ZVAL_UNDEF(&routeName); + ZVAL_UNDEF(&beforeMatch); + ZVAL_UNDEF(&_0$$10); + ZVAL_UNDEF(&_1$$10); + ZVAL_UNDEF(&_2$$10); + ZVAL_UNDEF(&_3$$10); + ZVAL_UNDEF(&_4$$10); + ZVAL_UNDEF(&_5$$21); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 5, 0, &module_param, &namespaceName_param, &controller_param, &action_param, &annotation); if (UNEXPECTED(Z_TYPE_P(module_param) != IS_STRING && Z_TYPE_P(module_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'module' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'module' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(module_param) == IS_STRING)) { - zephir_get_strval(module, module_param); + zephir_get_strval(&module, module_param); } else { - ZEPHIR_INIT_VAR(module); - ZVAL_EMPTY_STRING(module); + ZEPHIR_INIT_VAR(&module); + ZVAL_EMPTY_STRING(&module); } if (UNEXPECTED(Z_TYPE_P(namespaceName_param) != IS_STRING && Z_TYPE_P(namespaceName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'namespaceName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'namespaceName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(namespaceName_param) == IS_STRING)) { - zephir_get_strval(namespaceName, namespaceName_param); + zephir_get_strval(&namespaceName, namespaceName_param); } else { - ZEPHIR_INIT_VAR(namespaceName); - ZVAL_EMPTY_STRING(namespaceName); + ZEPHIR_INIT_VAR(&namespaceName); + ZVAL_EMPTY_STRING(&namespaceName); } if (UNEXPECTED(Z_TYPE_P(controller_param) != IS_STRING && Z_TYPE_P(controller_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controller' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controller' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(controller_param) == IS_STRING)) { - zephir_get_strval(controller, controller_param); + zephir_get_strval(&controller, controller_param); } else { - ZEPHIR_INIT_VAR(controller); - ZVAL_EMPTY_STRING(controller); + ZEPHIR_INIT_VAR(&controller); + ZVAL_EMPTY_STRING(&controller); } if (UNEXPECTED(Z_TYPE_P(action_param) != IS_STRING && Z_TYPE_P(action_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'action' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'action' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(action_param) == IS_STRING)) { - zephir_get_strval(action, action_param); + zephir_get_strval(&action, action_param); } else { - ZEPHIR_INIT_VAR(action); - ZVAL_EMPTY_STRING(action); + ZEPHIR_INIT_VAR(&action); + ZVAL_EMPTY_STRING(&action); } isRoute = 0; - ZEPHIR_INIT_VAR(methods); - ZVAL_NULL(methods); + ZEPHIR_INIT_VAR(&methods); + ZVAL_NULL(&methods); ZEPHIR_CALL_METHOD(&name, annotation, "getname", NULL, 0); zephir_check_call_status(); do { - if (ZEPHIR_IS_STRING(name, "Route")) { + if (ZEPHIR_IS_STRING(&name, "Route")) { isRoute = 1; break; } - if (ZEPHIR_IS_STRING(name, "Get")) { + if (ZEPHIR_IS_STRING(&name, "Get")) { isRoute = 1; - ZEPHIR_INIT_NVAR(methods); - ZVAL_STRING(methods, "GET", 1); + ZEPHIR_INIT_NVAR(&methods); + ZVAL_STRING(&methods, "GET"); break; } - if (ZEPHIR_IS_STRING(name, "Post")) { + if (ZEPHIR_IS_STRING(&name, "Post")) { isRoute = 1; - ZEPHIR_INIT_NVAR(methods); - ZVAL_STRING(methods, "POST", 1); + ZEPHIR_INIT_NVAR(&methods); + ZVAL_STRING(&methods, "POST"); break; } - if (ZEPHIR_IS_STRING(name, "Put")) { + if (ZEPHIR_IS_STRING(&name, "Put")) { isRoute = 1; - ZEPHIR_INIT_NVAR(methods); - ZVAL_STRING(methods, "PUT", 1); + ZEPHIR_INIT_NVAR(&methods); + ZVAL_STRING(&methods, "PUT"); break; } - if (ZEPHIR_IS_STRING(name, "Patch")) { + if (ZEPHIR_IS_STRING(&name, "Patch")) { isRoute = 1; - ZEPHIR_INIT_NVAR(methods); - ZVAL_STRING(methods, "PATCH", 1); + ZEPHIR_INIT_NVAR(&methods); + ZVAL_STRING(&methods, "PATCH"); break; } - if (ZEPHIR_IS_STRING(name, "Delete")) { + if (ZEPHIR_IS_STRING(&name, "Delete")) { isRoute = 1; - ZEPHIR_INIT_NVAR(methods); - ZVAL_STRING(methods, "DELETE", 1); + ZEPHIR_INIT_NVAR(&methods); + ZVAL_STRING(&methods, "DELETE"); break; } - if (ZEPHIR_IS_STRING(name, "Options")) { + if (ZEPHIR_IS_STRING(&name, "Options")) { isRoute = 1; - ZEPHIR_INIT_NVAR(methods); - ZVAL_STRING(methods, "OPTIONS", 1); + ZEPHIR_INIT_NVAR(&methods); + ZVAL_STRING(&methods, "OPTIONS"); break; } } while(0); if (isRoute == 1) { - ZEPHIR_INIT_VAR(_0$$10); - _1$$10 = zephir_fetch_nproperty_this(this_ptr, SL("_actionSuffix"), PH_NOISY_CC); - ZEPHIR_SINIT_VAR(_2$$10); - ZVAL_STRING(&_2$$10, "", 0); - zephir_fast_str_replace(&_0$$10, _1$$10, &_2$$10, action TSRMLS_CC); - ZEPHIR_INIT_VAR(actionName); - zephir_fast_strtolower(actionName, _0$$10); - ZEPHIR_OBS_VAR(routePrefix); - zephir_read_property_this(&routePrefix, this_ptr, SL("_routePrefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_3$$10); - ZVAL_STRING(_3$$10, "paths", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&paths, annotation, "getnamedargument", NULL, 0, _3$$10); - zephir_check_temp_parameter(_3$$10); + ZEPHIR_INIT_VAR(&_0$$10); + zephir_read_property(&_1$$10, this_ptr, SL("_actionSuffix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2$$10); + ZVAL_STRING(&_2$$10, ""); + zephir_fast_str_replace(&_0$$10, &_1$$10, &_2$$10, &action TSRMLS_CC); + ZEPHIR_INIT_VAR(&actionName); + zephir_fast_strtolower(&actionName, &_0$$10); + ZEPHIR_OBS_VAR(&routePrefix); + zephir_read_property(&routePrefix, this_ptr, SL("_routePrefix"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_3$$10); + ZVAL_STRING(&_3$$10, "paths"); + ZEPHIR_CALL_METHOD(&paths, annotation, "getnamedargument", NULL, 0, &_3$$10); zephir_check_call_status(); - if (Z_TYPE_P(paths) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(paths); - array_init(paths); + if (Z_TYPE_P(&paths) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&paths); + array_init(&paths); } - if (!(ZEPHIR_IS_EMPTY(module))) { + if (!(ZEPHIR_IS_EMPTY(&module))) { zephir_array_update_string(&paths, SL("module"), &module, PH_COPY | PH_SEPARATE); } - if (!(ZEPHIR_IS_EMPTY(namespaceName))) { + if (!(ZEPHIR_IS_EMPTY(&namespaceName))) { zephir_array_update_string(&paths, SL("namespace"), &namespaceName, PH_COPY | PH_SEPARATE); } zephir_array_update_string(&paths, SL("controller"), &controller, PH_COPY | PH_SEPARATE); zephir_array_update_string(&paths, SL("action"), &actionName, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_NVAR(_3$$10); - ZVAL_LONG(_3$$10, 0); - ZEPHIR_CALL_METHOD(&value, annotation, "getargument", NULL, 0, _3$$10); + ZVAL_LONG(&_4$$10, 0); + ZEPHIR_CALL_METHOD(&value, annotation, "getargument", NULL, 0, &_4$$10); zephir_check_call_status(); - if (Z_TYPE_P(value) != IS_NULL) { - if (!ZEPHIR_IS_STRING(value, "/")) { - ZEPHIR_INIT_VAR(uri); - ZEPHIR_CONCAT_VV(uri, routePrefix, value); + if (Z_TYPE_P(&value) != IS_NULL) { + if (!ZEPHIR_IS_STRING(&value, "/")) { + ZEPHIR_INIT_VAR(&uri); + ZEPHIR_CONCAT_VV(&uri, &routePrefix, &value); } else { - if (Z_TYPE_P(routePrefix) != IS_NULL) { - ZEPHIR_CPY_WRT(uri, routePrefix); + if (Z_TYPE_P(&routePrefix) != IS_NULL) { + ZEPHIR_CPY_WRT(&uri, &routePrefix); } else { - ZEPHIR_CPY_WRT(uri, value); + ZEPHIR_CPY_WRT(&uri, &value); } } } else { - ZEPHIR_INIT_NVAR(uri); - ZEPHIR_CONCAT_VV(uri, routePrefix, actionName); + ZEPHIR_INIT_NVAR(&uri); + ZEPHIR_CONCAT_VV(&uri, &routePrefix, &actionName); } - ZEPHIR_CALL_METHOD(&route, this_ptr, "add", NULL, 0, uri, paths); + ZEPHIR_CALL_METHOD(&route, this_ptr, "add", NULL, 0, &uri, &paths); zephir_check_call_status(); - if (Z_TYPE_P(methods) != IS_NULL) { - ZEPHIR_CALL_METHOD(NULL, route, "via", NULL, 0, methods); + if (Z_TYPE_P(&methods) != IS_NULL) { + ZEPHIR_CALL_METHOD(NULL, &route, "via", NULL, 0, &methods); zephir_check_call_status(); } else { - ZEPHIR_INIT_VAR(_4$$21); - ZVAL_STRING(_4$$21, "methods", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&methods, annotation, "getnamedargument", NULL, 0, _4$$21); - zephir_check_temp_parameter(_4$$21); + ZEPHIR_INIT_VAR(&_5$$21); + ZVAL_STRING(&_5$$21, "methods"); + ZEPHIR_CALL_METHOD(&methods, annotation, "getnamedargument", NULL, 0, &_5$$21); zephir_check_call_status(); - _5$$21 = Z_TYPE_P(methods) == IS_ARRAY; - if (!(_5$$21)) { - _5$$21 = Z_TYPE_P(methods) == IS_STRING; + _6$$21 = Z_TYPE_P(&methods) == IS_ARRAY; + if (!(_6$$21)) { + _6$$21 = Z_TYPE_P(&methods) == IS_STRING; } - if (_5$$21) { - ZEPHIR_CALL_METHOD(NULL, route, "via", NULL, 0, methods); + if (_6$$21) { + ZEPHIR_CALL_METHOD(NULL, &route, "via", NULL, 0, &methods); zephir_check_call_status(); } } - ZEPHIR_INIT_NVAR(_3$$10); - ZVAL_STRING(_3$$10, "converts", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, _3$$10); - zephir_check_temp_parameter(_3$$10); + ZEPHIR_INIT_NVAR(&_3$$10); + ZVAL_STRING(&_3$$10, "converts"); + ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, &_3$$10); zephir_check_call_status(); - if (Z_TYPE_P(converts) == IS_ARRAY) { - zephir_is_iterable(converts, &_7$$23, &_6$$23, 0, 0, "phalcon/mvc/router/annotations.zep", 343); - for ( - ; zend_hash_get_current_data_ex(_7$$23, (void**) &_8$$23, &_6$$23) == SUCCESS - ; zend_hash_move_forward_ex(_7$$23, &_6$$23) - ) { - ZEPHIR_GET_HMKEY(param, _7$$23, _6$$23); - ZEPHIR_GET_HVALUE(convert, _8$$23); - ZEPHIR_CALL_METHOD(NULL, route, "convert", &_9, 0, param, convert); + if (Z_TYPE_P(&converts) == IS_ARRAY) { + zephir_is_iterable(&converts, 0, "phalcon/mvc/router/annotations.zep", 343); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&converts), _8$$23, _9$$23, _7$$23) + { + ZEPHIR_INIT_NVAR(¶m); + if (_9$$23 != NULL) { + ZVAL_STR_COPY(¶m, _9$$23); + } else { + ZVAL_LONG(¶m, _8$$23); + } + ZEPHIR_INIT_NVAR(&convert); + ZVAL_COPY(&convert, _7$$23); + ZEPHIR_CALL_METHOD(NULL, &route, "convert", &_10, 0, ¶m, &convert); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&convert); + ZEPHIR_INIT_NVAR(¶m); } - ZEPHIR_INIT_NVAR(_3$$10); - ZVAL_STRING(_3$$10, "conversors", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, _3$$10); - zephir_check_temp_parameter(_3$$10); + ZEPHIR_INIT_NVAR(&_3$$10); + ZVAL_STRING(&_3$$10, "conversors"); + ZEPHIR_CALL_METHOD(&converts, annotation, "getnamedargument", NULL, 0, &_3$$10); zephir_check_call_status(); - if (Z_TYPE_P(converts) == IS_ARRAY) { - zephir_is_iterable(converts, &_11$$25, &_10$$25, 0, 0, "phalcon/mvc/router/annotations.zep", 353); - for ( - ; zend_hash_get_current_data_ex(_11$$25, (void**) &_12$$25, &_10$$25) == SUCCESS - ; zend_hash_move_forward_ex(_11$$25, &_10$$25) - ) { - ZEPHIR_GET_HMKEY(conversorParam, _11$$25, _10$$25); - ZEPHIR_GET_HVALUE(convert, _12$$25); - ZEPHIR_CALL_METHOD(NULL, route, "convert", &_13, 0, conversorParam, convert); + if (Z_TYPE_P(&converts) == IS_ARRAY) { + zephir_is_iterable(&converts, 0, "phalcon/mvc/router/annotations.zep", 353); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&converts), _12$$25, _13$$25, _11$$25) + { + ZEPHIR_INIT_NVAR(&conversorParam); + if (_13$$25 != NULL) { + ZVAL_STR_COPY(&conversorParam, _13$$25); + } else { + ZVAL_LONG(&conversorParam, _12$$25); + } + ZEPHIR_INIT_NVAR(&convert); + ZVAL_COPY(&convert, _11$$25); + ZEPHIR_CALL_METHOD(NULL, &route, "convert", &_14, 0, &conversorParam, &convert); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&convert); + ZEPHIR_INIT_NVAR(&conversorParam); } - ZEPHIR_INIT_NVAR(_3$$10); - ZVAL_STRING(_3$$10, "beforeMatch", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&beforeMatch, annotation, "getnamedargument", NULL, 0, _3$$10); - zephir_check_temp_parameter(_3$$10); + ZEPHIR_INIT_NVAR(&_3$$10); + ZVAL_STRING(&_3$$10, "beforeMatch"); + ZEPHIR_CALL_METHOD(&beforeMatch, annotation, "getnamedargument", NULL, 0, &_3$$10); zephir_check_call_status(); - _14$$10 = Z_TYPE_P(beforeMatch) == IS_ARRAY; - if (!(_14$$10)) { - _14$$10 = Z_TYPE_P(beforeMatch) == IS_STRING; + _15$$10 = Z_TYPE_P(&beforeMatch) == IS_ARRAY; + if (!(_15$$10)) { + _15$$10 = Z_TYPE_P(&beforeMatch) == IS_STRING; } - if (_14$$10) { - ZEPHIR_CALL_METHOD(NULL, route, "beforematch", NULL, 0, beforeMatch); + if (_15$$10) { + ZEPHIR_CALL_METHOD(NULL, &route, "beforematch", NULL, 0, &beforeMatch); zephir_check_call_status(); } - ZEPHIR_INIT_NVAR(_3$$10); - ZVAL_STRING(_3$$10, "name", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&routeName, annotation, "getnamedargument", NULL, 0, _3$$10); - zephir_check_temp_parameter(_3$$10); + ZEPHIR_INIT_NVAR(&_3$$10); + ZVAL_STRING(&_3$$10, "name"); + ZEPHIR_CALL_METHOD(&routeName, annotation, "getnamedargument", NULL, 0, &_3$$10); zephir_check_call_status(); - if (Z_TYPE_P(routeName) == IS_STRING) { - ZEPHIR_CALL_METHOD(NULL, route, "setname", NULL, 0, routeName); + if (Z_TYPE_P(&routeName) == IS_STRING) { + ZEPHIR_CALL_METHOD(NULL, &route, "setname", NULL, 0, &routeName); zephir_check_call_status(); } RETURN_MM_BOOL(1); @@ -599,24 +681,27 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation) { PHP_METHOD(Phalcon_Mvc_Router_Annotations, setControllerSuffix) { zval *controllerSuffix_param = NULL; - zval *controllerSuffix = NULL; + zval controllerSuffix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&controllerSuffix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &controllerSuffix_param); if (UNEXPECTED(Z_TYPE_P(controllerSuffix_param) != IS_STRING && Z_TYPE_P(controllerSuffix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerSuffix' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerSuffix' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(controllerSuffix_param) == IS_STRING)) { - zephir_get_strval(controllerSuffix, controllerSuffix_param); + zephir_get_strval(&controllerSuffix, controllerSuffix_param); } else { - ZEPHIR_INIT_VAR(controllerSuffix); - ZVAL_EMPTY_STRING(controllerSuffix); + ZEPHIR_INIT_VAR(&controllerSuffix); + ZVAL_EMPTY_STRING(&controllerSuffix); } - zephir_update_property_this(getThis(), SL("_controllerSuffix"), controllerSuffix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_controllerSuffix"), &controllerSuffix); ZEPHIR_MM_RESTORE(); } @@ -627,24 +712,27 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, setControllerSuffix) { PHP_METHOD(Phalcon_Mvc_Router_Annotations, setActionSuffix) { zval *actionSuffix_param = NULL; - zval *actionSuffix = NULL; + zval actionSuffix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&actionSuffix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &actionSuffix_param); if (UNEXPECTED(Z_TYPE_P(actionSuffix_param) != IS_STRING && Z_TYPE_P(actionSuffix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'actionSuffix' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'actionSuffix' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(actionSuffix_param) == IS_STRING)) { - zephir_get_strval(actionSuffix, actionSuffix_param); + zephir_get_strval(&actionSuffix, actionSuffix_param); } else { - ZEPHIR_INIT_VAR(actionSuffix); - ZVAL_EMPTY_STRING(actionSuffix); + ZEPHIR_INIT_VAR(&actionSuffix); + ZVAL_EMPTY_STRING(&actionSuffix); } - zephir_update_property_this(getThis(), SL("_actionSuffix"), actionSuffix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_actionSuffix"), &actionSuffix); ZEPHIR_MM_RESTORE(); } @@ -654,64 +742,64 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, setActionSuffix) { */ PHP_METHOD(Phalcon_Mvc_Router_Annotations, getResources) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_handlers"); } -zend_object_value zephir_init_properties_Phalcon_Mvc_Router_Annotations(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_Router_Annotations(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_2, *_4, *_6, *_8, *_1$$3, *_3$$4, *_5$$5, *_7$$6, *_9$$7; + zval _0, _2, _4, _6, _8, _1$$3, _3$$4, _5$$5, _7$$6, _9$$7; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_9$$7); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_keyRouteIds"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_keyRouteIds"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_keyRouteIds"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_keyRouteIds"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_keyRouteNames"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("_keyRouteNames"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_keyRouteNames"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("_keyRouteNames"), &_3$$4); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_defaultParams"), PH_NOISY_CC); - if (Z_TYPE_P(_4) == IS_NULL) { - ZEPHIR_INIT_VAR(_5$$5); - array_init(_5$$5); - zephir_update_property_this(getThis(), SL("_defaultParams"), _5$$5 TSRMLS_CC); + zephir_read_property(&_4, this_ptr, SL("_defaultParams"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_4) == IS_NULL) { + ZEPHIR_INIT_VAR(&_5$$5); + array_init(&_5$$5); + zephir_update_property_zval(this_ptr, SL("_defaultParams"), &_5$$5); } - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_params"), PH_NOISY_CC); - if (Z_TYPE_P(_6) == IS_NULL) { - ZEPHIR_INIT_VAR(_7$$6); - array_init(_7$$6); - zephir_update_property_this(getThis(), SL("_params"), _7$$6 TSRMLS_CC); + zephir_read_property(&_6, this_ptr, SL("_params"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_6) == IS_NULL) { + ZEPHIR_INIT_VAR(&_7$$6); + array_init(&_7$$6); + zephir_update_property_zval(this_ptr, SL("_params"), &_7$$6); } - _8 = zephir_fetch_nproperty_this(this_ptr, SL("_handlers"), PH_NOISY_CC); - if (Z_TYPE_P(_8) == IS_NULL) { - ZEPHIR_INIT_VAR(_9$$7); - array_init(_9$$7); - zephir_update_property_this(getThis(), SL("_handlers"), _9$$7 TSRMLS_CC); + zephir_read_property(&_8, this_ptr, SL("_handlers"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_8) == IS_NULL) { + ZEPHIR_INIT_VAR(&_9$$7); + array_init(&_9$$7); + zephir_update_property_zval(this_ptr, SL("_handlers"), &_9$$7); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/router/annotations.zep.h b/ext/phalcon/mvc/router/annotations.zep.h index 15fd1d00001..b1406f74c65 100644 --- a/ext/phalcon/mvc/router/annotations.zep.h +++ b/ext/phalcon/mvc/router/annotations.zep.h @@ -11,42 +11,109 @@ PHP_METHOD(Phalcon_Mvc_Router_Annotations, processActionAnnotation); PHP_METHOD(Phalcon_Mvc_Router_Annotations, setControllerSuffix); PHP_METHOD(Phalcon_Mvc_Router_Annotations, setActionSuffix); PHP_METHOD(Phalcon_Mvc_Router_Annotations, getResources); -zend_object_value zephir_init_properties_Phalcon_Mvc_Router_Annotations(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_Router_Annotations(zend_class_entry *class_type TSRMLS_DC); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_annotations_addresource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_annotations_addresource, 0, 1, Phalcon\\Mvc\\Router\\Annotations, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_annotations_addresource, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\Annotations", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, handler, IS_STRING, 0) +#else ZEND_ARG_INFO(0, handler) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_annotations_addmoduleresource, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_annotations_addmoduleresource, 0, 2, Phalcon\\Mvc\\Router\\Annotations, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_annotations_addmoduleresource, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\Annotations", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, module, IS_STRING, 0) +#else ZEND_ARG_INFO(0, module) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, handler, IS_STRING, 0) +#else ZEND_ARG_INFO(0, handler) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 1) +#else ZEND_ARG_INFO(0, prefix) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_annotations_handle, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) +#else ZEND_ARG_INFO(0, uri) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_annotations_processcontrollerannotation, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, handler, IS_STRING, 0) +#else ZEND_ARG_INFO(0, handler) +#endif ZEND_ARG_OBJ_INFO(0, annotation, Phalcon\\Annotations\\Annotation, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_annotations_processactionannotation, 0, 0, 5) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, module, IS_STRING, 0) +#else ZEND_ARG_INFO(0, module) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, namespaceName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, namespaceName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controller, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controller) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, action, IS_STRING, 0) +#else ZEND_ARG_INFO(0, action) +#endif ZEND_ARG_OBJ_INFO(0, annotation, Phalcon\\Annotations\\Annotation, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_annotations_setcontrollersuffix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerSuffix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerSuffix) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_annotations_setactionsuffix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionSuffix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionSuffix) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_annotations_getresources, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_annotations_getresources, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_router_annotations_method_entry) { @@ -57,6 +124,6 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_router_annotations_method_entry) { PHP_ME(Phalcon_Mvc_Router_Annotations, processActionAnnotation, arginfo_phalcon_mvc_router_annotations_processactionannotation, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Annotations, setControllerSuffix, arginfo_phalcon_mvc_router_annotations_setcontrollersuffix, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Annotations, setActionSuffix, arginfo_phalcon_mvc_router_annotations_setactionsuffix, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Annotations, getResources, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Annotations, getResources, arginfo_phalcon_mvc_router_annotations_getresources, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/router/group.zep.c b/ext/phalcon/mvc/router/group.zep.c index cec6401df74..30e560aa5bb 100644 --- a/ext/phalcon/mvc/router/group.zep.c +++ b/ext/phalcon/mvc/router/group.zep.c @@ -96,13 +96,18 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, __construct) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *paths = NULL; + zval *paths = NULL, paths_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &paths); if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } @@ -111,9 +116,9 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, __construct) { _0 = Z_TYPE_P(paths) == IS_STRING; } if (_0) { - zephir_update_property_this(getThis(), SL("_paths"), paths TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_paths"), paths); } - if ((zephir_method_exists_ex(this_ptr, SS("initialize") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(this_ptr, SL("initialize") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0, paths); zephir_check_call_status(); } @@ -127,15 +132,18 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, __construct) { PHP_METHOD(Phalcon_Mvc_Router_Group, setHostname) { zval *hostname_param = NULL; - zval *hostname = NULL; + zval hostname; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&hostname); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &hostname_param); - zephir_get_strval(hostname, hostname_param); + zephir_get_strval(&hostname, hostname_param); - zephir_update_property_this(getThis(), SL("_hostname"), hostname TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_hostname"), &hostname); RETURN_THIS(); } @@ -145,7 +153,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, setHostname) { */ PHP_METHOD(Phalcon_Mvc_Router_Group, getHostname) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_hostname"); @@ -157,15 +166,18 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, getHostname) { PHP_METHOD(Phalcon_Mvc_Router_Group, setPrefix) { zval *prefix_param = NULL; - zval *prefix = NULL; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &prefix_param); - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); RETURN_THIS(); } @@ -175,7 +187,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, setPrefix) { */ PHP_METHOD(Phalcon_Mvc_Router_Group, getPrefix) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_prefix"); @@ -188,13 +201,16 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, getPrefix) { */ PHP_METHOD(Phalcon_Mvc_Router_Group, beforeMatch) { - zval *beforeMatch; + zval *beforeMatch, beforeMatch_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&beforeMatch_sub); zephir_fetch_params(0, 1, 0, &beforeMatch); - zephir_update_property_this(getThis(), SL("_beforeMatch"), beforeMatch TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_beforeMatch"), beforeMatch); RETURN_THISW(); } @@ -204,7 +220,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, beforeMatch) { */ PHP_METHOD(Phalcon_Mvc_Router_Group, getBeforeMatch) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_beforeMatch"); @@ -215,13 +232,16 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, getBeforeMatch) { */ PHP_METHOD(Phalcon_Mvc_Router_Group, setPaths) { - zval *paths; + zval *paths, paths_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&paths_sub); zephir_fetch_params(0, 1, 0, &paths); - zephir_update_property_this(getThis(), SL("_paths"), paths TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_paths"), paths); RETURN_THISW(); } @@ -231,7 +251,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, setPaths) { */ PHP_METHOD(Phalcon_Mvc_Router_Group, getPaths) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_paths"); @@ -242,7 +263,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, getPaths) { */ PHP_METHOD(Phalcon_Mvc_Router_Group, getRoutes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_routes"); @@ -258,31 +280,39 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, getRoutes) { PHP_METHOD(Phalcon_Mvc_Router_Group, add) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *httpMethods = NULL; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, __$null; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&httpMethods_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &httpMethods); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!httpMethods) { - httpMethods = ZEPHIR_GLOBAL(global_null); + httpMethods = &httpMethods_sub; + httpMethods = &__$null; } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, pattern, paths, httpMethods); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, &pattern, paths, httpMethods); zephir_check_call_status(); RETURN_MM(); @@ -298,31 +328,37 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, add) { PHP_METHOD(Phalcon_Mvc_Router_Group, addGet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "GET", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, pattern, paths, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "GET"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, &pattern, paths, &_0); zephir_check_call_status(); RETURN_MM(); @@ -338,31 +374,37 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, addGet) { PHP_METHOD(Phalcon_Mvc_Router_Group, addPost) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "POST", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, pattern, paths, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "POST"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, &pattern, paths, &_0); zephir_check_call_status(); RETURN_MM(); @@ -378,31 +420,37 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, addPost) { PHP_METHOD(Phalcon_Mvc_Router_Group, addPut) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "PUT", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, pattern, paths, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "PUT"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, &pattern, paths, &_0); zephir_check_call_status(); RETURN_MM(); @@ -418,31 +466,37 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, addPut) { PHP_METHOD(Phalcon_Mvc_Router_Group, addPatch) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "PATCH", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, pattern, paths, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "PATCH"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, &pattern, paths, &_0); zephir_check_call_status(); RETURN_MM(); @@ -458,31 +512,37 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, addPatch) { PHP_METHOD(Phalcon_Mvc_Router_Group, addDelete) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "DELETE", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, pattern, paths, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "DELETE"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, &pattern, paths, &_0); zephir_check_call_status(); RETURN_MM(); @@ -498,31 +558,37 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, addDelete) { PHP_METHOD(Phalcon_Mvc_Router_Group, addOptions) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "OPTIONS", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, pattern, paths, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "OPTIONS"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, &pattern, paths, &_0); zephir_check_call_status(); RETURN_MM(); @@ -538,31 +604,37 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, addOptions) { PHP_METHOD(Phalcon_Mvc_Router_Group, addHead) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "HEAD", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, pattern, paths, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "HEAD"); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_addroute", NULL, 0, &pattern, paths, &_0); zephir_check_call_status(); RETURN_MM(); @@ -573,13 +645,16 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, addHead) { */ PHP_METHOD(Phalcon_Mvc_Router_Group, clear) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_routes"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_routes"), &_0); ZEPHIR_MM_RESTORE(); } @@ -591,59 +666,73 @@ PHP_METHOD(Phalcon_Mvc_Router_Group, _addRoute) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *pattern_param = NULL, *paths = NULL, *httpMethods = NULL, *mergedPaths = NULL, *route = NULL, *defaultPaths = NULL, *processedPaths = NULL, *_1, *_2; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, __$null, mergedPaths, route, defaultPaths, processedPaths, _1, _2; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&httpMethods_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&mergedPaths); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&defaultPaths); + ZVAL_UNDEF(&processedPaths); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &httpMethods); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!httpMethods) { - httpMethods = ZEPHIR_GLOBAL(global_null); + httpMethods = &httpMethods_sub; + httpMethods = &__$null; } - ZEPHIR_OBS_VAR(defaultPaths); - zephir_read_property_this(&defaultPaths, this_ptr, SL("_paths"), PH_NOISY_CC); - if (Z_TYPE_P(defaultPaths) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&defaultPaths); + zephir_read_property(&defaultPaths, this_ptr, SL("_paths"), PH_NOISY_CC); + if (Z_TYPE_P(&defaultPaths) == IS_ARRAY) { if (Z_TYPE_P(paths) == IS_STRING) { - ZEPHIR_CALL_CE_STATIC(&processedPaths, phalcon_mvc_router_route_ce, "getroutepaths", &_0, 83, paths); + ZEPHIR_CALL_CE_STATIC(&processedPaths, phalcon_mvc_router_route_ce, "getroutepaths", &_0, 0, paths); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(processedPaths, paths); + ZEPHIR_CPY_WRT(&processedPaths, paths); } - if (Z_TYPE_P(processedPaths) == IS_ARRAY) { - ZEPHIR_INIT_VAR(mergedPaths); - zephir_fast_array_merge(mergedPaths, &(defaultPaths), &(processedPaths) TSRMLS_CC); + if (Z_TYPE_P(&processedPaths) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&mergedPaths); + zephir_fast_array_merge(&mergedPaths, &defaultPaths, &processedPaths TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(mergedPaths, defaultPaths); + ZEPHIR_CPY_WRT(&mergedPaths, &defaultPaths); } } else { - ZEPHIR_CPY_WRT(mergedPaths, paths); - } - ZEPHIR_INIT_VAR(route); - object_init_ex(route, phalcon_mvc_router_route_ce); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_VV(_2, _1, pattern); - ZEPHIR_CALL_METHOD(NULL, route, "__construct", NULL, 82, _2, mergedPaths, httpMethods); + ZEPHIR_CPY_WRT(&mergedPaths, paths); + } + ZEPHIR_INIT_VAR(&route); + object_init_ex(&route, phalcon_mvc_router_route_ce); + zephir_read_property(&_1, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_VV(&_2, &_1, &pattern); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 74, &_2, &mergedPaths, httpMethods); zephir_check_call_status(); - zephir_update_property_array_append(this_ptr, SL("_routes"), route TSRMLS_CC); - ZEPHIR_CALL_METHOD(NULL, route, "setgroup", NULL, 399, this_ptr); + zephir_update_property_array_append(this_ptr, SL("_routes"), &route TSRMLS_CC); + ZEPHIR_CALL_METHOD(NULL, &route, "setgroup", NULL, 353, this_ptr); zephir_check_call_status(); - RETURN_CCTOR(route); + RETURN_CCTOR(&route); } diff --git a/ext/phalcon/mvc/router/group.zep.h b/ext/phalcon/mvc/router/group.zep.h index cd8ba6256b5..f73e9c49efc 100644 --- a/ext/phalcon/mvc/router/group.zep.h +++ b/ext/phalcon/mvc/router/group.zep.h @@ -28,65 +28,182 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group___construct, 0, 0, 0) ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_sethostname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_sethostname, 0, 1, Phalcon\\Mvc\\Router\\GroupInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_sethostname, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\GroupInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) +#else ZEND_ARG_INFO(0, hostname) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_setprefix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_gethostname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_gethostname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_setprefix, 0, 1, Phalcon\\Mvc\\Router\\GroupInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_setprefix, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\GroupInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, prefix) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_getprefix, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_getprefix, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_beforematch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_beforematch, 0, 1, Phalcon\\Mvc\\Router\\GroupInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_beforematch, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\GroupInterface", 0) +#endif ZEND_ARG_INFO(0, beforeMatch) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_setpaths, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_setpaths, 0, 1, Phalcon\\Mvc\\Router\\GroupInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_setpaths, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\GroupInterface", 0) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_add, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_getroutes, 0, 0, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_getroutes, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_add, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_add, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, httpMethods) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_addget, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_addget, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_addget, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_addpost, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_addpost, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_addpost, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_addput, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_addput, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_addput, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_addpatch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_addpatch, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_addpatch, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_adddelete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_adddelete, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_adddelete, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_addoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_addoptions, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_addoptions, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group_addhead, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group_addhead, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group_addhead, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_group__addroute, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_group__addroute, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_group__addroute, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, httpMethods) ZEND_END_ARG_INFO() @@ -94,14 +211,14 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_router_group_method_entry) { PHP_ME(Phalcon_Mvc_Router_Group, __construct, arginfo_phalcon_mvc_router_group___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_Router_Group, setHostname, arginfo_phalcon_mvc_router_group_sethostname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Group, getHostname, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Group, getHostname, arginfo_phalcon_mvc_router_group_gethostname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Group, setPrefix, arginfo_phalcon_mvc_router_group_setprefix, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Group, getPrefix, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Group, getPrefix, arginfo_phalcon_mvc_router_group_getprefix, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Group, beforeMatch, arginfo_phalcon_mvc_router_group_beforematch, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Group, getBeforeMatch, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Group, setPaths, arginfo_phalcon_mvc_router_group_setpaths, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Group, getPaths, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Group, getRoutes, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Group, getRoutes, arginfo_phalcon_mvc_router_group_getroutes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Group, add, arginfo_phalcon_mvc_router_group_add, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Group, addGet, arginfo_phalcon_mvc_router_group_addget, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Group, addPost, arginfo_phalcon_mvc_router_group_addpost, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/mvc/router/groupinterface.zep.h b/ext/phalcon/mvc/router/groupinterface.zep.h index 654cd2d3a05..509703b04d3 100644 --- a/ext/phalcon/mvc/router/groupinterface.zep.h +++ b/ext/phalcon/mvc/router/groupinterface.zep.h @@ -3,73 +3,182 @@ extern zend_class_entry *phalcon_mvc_router_groupinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_GroupInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_sethostname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_sethostname, 0, 1, Phalcon\\Mvc\\Router\\GroupInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_sethostname, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\GroupInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) +#else ZEND_ARG_INFO(0, hostname) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_setprefix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_gethostname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_gethostname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_setprefix, 0, 1, Phalcon\\Mvc\\Router\\GroupInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_setprefix, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\GroupInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, prefix) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_getprefix, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_getprefix, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_beforematch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_beforematch, 0, 1, Phalcon\\Mvc\\Router\\GroupInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_beforematch, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\GroupInterface", 0) +#endif ZEND_ARG_INFO(0, beforeMatch) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_setpaths, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_setpaths, 0, 1, Phalcon\\Mvc\\Router\\GroupInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_setpaths, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\GroupInterface", 0) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_add, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_getroutes, 0, 0, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_getroutes, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_add, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_add, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, httpMethods) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addget, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addget, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addget, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addpost, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addpost, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addpost, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addput, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addput, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addput, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addpatch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addpatch, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addpatch, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_adddelete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_adddelete, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_adddelete, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addoptions, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addoptions, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addhead, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addhead, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_groupinterface_addhead, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_router_groupinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, setHostname, arginfo_phalcon_mvc_router_groupinterface_sethostname) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, getHostname, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, getHostname, arginfo_phalcon_mvc_router_groupinterface_gethostname) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, setPrefix, arginfo_phalcon_mvc_router_groupinterface_setprefix) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, getPrefix, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, getPrefix, arginfo_phalcon_mvc_router_groupinterface_getprefix) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, beforeMatch, arginfo_phalcon_mvc_router_groupinterface_beforematch) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, getBeforeMatch, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, setPaths, arginfo_phalcon_mvc_router_groupinterface_setpaths) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, getPaths, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, getRoutes, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, getRoutes, arginfo_phalcon_mvc_router_groupinterface_getroutes) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, add, arginfo_phalcon_mvc_router_groupinterface_add) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, addGet, arginfo_phalcon_mvc_router_groupinterface_addget) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_GroupInterface, addPost, arginfo_phalcon_mvc_router_groupinterface_addpost) diff --git a/ext/phalcon/mvc/router/route.zep.c b/ext/phalcon/mvc/router/route.zep.c index 7fa55864bf7..b63cb31ce6d 100644 --- a/ext/phalcon/mvc/router/route.zep.c +++ b/ext/phalcon/mvc/router/route.zep.c @@ -63,7 +63,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_Route) { PHP_METHOD(Phalcon_Mvc_Router_Route, getId) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_id"); @@ -75,44 +76,55 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getId) { PHP_METHOD(Phalcon_Mvc_Router_Route, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *httpMethods = NULL, *routeId = NULL, *uniqueId = NULL, *_0; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, __$null, routeId, uniqueId, _0; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_UNDEF(&httpMethods_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&routeId); + ZVAL_UNDEF(&uniqueId); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &pattern_param, &paths, &httpMethods); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (!httpMethods) { - httpMethods = ZEPHIR_GLOBAL(global_null); + httpMethods = &httpMethods_sub; + httpMethods = &__$null; } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "reconfigure", NULL, 0, pattern, paths); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "reconfigure", NULL, 0, &pattern, paths); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_methods"), httpMethods TSRMLS_CC); - ZEPHIR_OBS_VAR(uniqueId); - zephir_read_static_property_ce(&uniqueId, phalcon_mvc_router_route_ce, SL("_uniqueId") TSRMLS_CC); - if (Z_TYPE_P(uniqueId) == IS_NULL) { - ZEPHIR_INIT_NVAR(uniqueId); - ZVAL_LONG(uniqueId, 0); + zephir_update_property_zval(this_ptr, SL("_methods"), httpMethods); + ZEPHIR_OBS_VAR(&uniqueId); + zephir_read_static_property_ce(&uniqueId, phalcon_mvc_router_route_ce, SL("_uniqueId"), PH_NOISY_CC); + if (Z_TYPE_P(&uniqueId) == IS_NULL) { + ZEPHIR_INIT_NVAR(&uniqueId); + ZVAL_LONG(&uniqueId, 0); } - ZEPHIR_CPY_WRT(routeId, uniqueId); - zephir_update_property_this(getThis(), SL("_id"), routeId TSRMLS_CC); + ZEPHIR_CPY_WRT(&routeId, &uniqueId); + zephir_update_property_zval(this_ptr, SL("_id"), &routeId); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, (zephir_get_numberval(uniqueId) + 1)); - zephir_update_static_property_ce(phalcon_mvc_router_route_ce, SL("_uniqueId"), &_0 TSRMLS_CC); + ZVAL_LONG(&_0, (zephir_get_numberval(&uniqueId) + 1)); + zend_update_static_property(phalcon_mvc_router_route_ce, ZEND_STRL("_uniqueId"), &_0); ZEPHIR_MM_RESTORE(); } @@ -122,83 +134,101 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, __construct) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, compilePattern) { - zval *pattern_param = NULL, *idPattern = NULL, *_0$$4, _1$$4, *_2$$5, _3$$5, *_4$$6, _5$$6, *_6$$7, _7$$7, *_8$$8, _9$$8, _10$$8, *_11$$9, _12$$9, _13$$9; - zval *pattern = NULL; + zval *pattern_param = NULL, idPattern, _0$$4, _1$$4, _2$$5, _3$$5, _4$$6, _5$$6, _6$$7, _7$$7, _8$$8, _9$$8, _10$$8, _11$$9, _12$$9, _13$$9; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&idPattern); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$8); + ZVAL_UNDEF(&_10$$8); + ZVAL_UNDEF(&_11$$9); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_13$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &pattern_param); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } - if (zephir_memnstr_str(pattern, SL(":"), "phalcon/mvc/router/route.zep", 89)) { - ZEPHIR_INIT_VAR(idPattern); - ZVAL_STRING(idPattern, "/([\\w0-9\\_\\-]+)", 1); - if (zephir_memnstr_str(pattern, SL("/:module"), "phalcon/mvc/router/route.zep", 95)) { - ZEPHIR_INIT_VAR(_0$$4); - ZEPHIR_SINIT_VAR(_1$$4); - ZVAL_STRING(&_1$$4, "/:module", 0); - zephir_fast_str_replace(&_0$$4, &_1$$4, idPattern, pattern TSRMLS_CC); - zephir_get_strval(pattern, _0$$4); + if (zephir_memnstr_str(&pattern, SL(":"), "phalcon/mvc/router/route.zep", 89)) { + ZEPHIR_INIT_VAR(&idPattern); + ZVAL_STRING(&idPattern, "/([\\w0-9\\_\\-]+)"); + if (zephir_memnstr_str(&pattern, SL("/:module"), "phalcon/mvc/router/route.zep", 95)) { + ZEPHIR_INIT_VAR(&_0$$4); + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_STRING(&_1$$4, "/:module"); + zephir_fast_str_replace(&_0$$4, &_1$$4, &idPattern, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_0$$4); } - if (zephir_memnstr_str(pattern, SL("/:controller"), "phalcon/mvc/router/route.zep", 100)) { - ZEPHIR_INIT_VAR(_2$$5); - ZEPHIR_SINIT_VAR(_3$$5); - ZVAL_STRING(&_3$$5, "/:controller", 0); - zephir_fast_str_replace(&_2$$5, &_3$$5, idPattern, pattern TSRMLS_CC); - zephir_get_strval(pattern, _2$$5); + if (zephir_memnstr_str(&pattern, SL("/:controller"), "phalcon/mvc/router/route.zep", 100)) { + ZEPHIR_INIT_VAR(&_2$$5); + ZEPHIR_INIT_VAR(&_3$$5); + ZVAL_STRING(&_3$$5, "/:controller"); + zephir_fast_str_replace(&_2$$5, &_3$$5, &idPattern, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_2$$5); } - if (zephir_memnstr_str(pattern, SL("/:namespace"), "phalcon/mvc/router/route.zep", 105)) { - ZEPHIR_INIT_VAR(_4$$6); - ZEPHIR_SINIT_VAR(_5$$6); - ZVAL_STRING(&_5$$6, "/:namespace", 0); - zephir_fast_str_replace(&_4$$6, &_5$$6, idPattern, pattern TSRMLS_CC); - zephir_get_strval(pattern, _4$$6); + if (zephir_memnstr_str(&pattern, SL("/:namespace"), "phalcon/mvc/router/route.zep", 105)) { + ZEPHIR_INIT_VAR(&_4$$6); + ZEPHIR_INIT_VAR(&_5$$6); + ZVAL_STRING(&_5$$6, "/:namespace"); + zephir_fast_str_replace(&_4$$6, &_5$$6, &idPattern, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_4$$6); } - if (zephir_memnstr_str(pattern, SL("/:action"), "phalcon/mvc/router/route.zep", 110)) { - ZEPHIR_INIT_VAR(_6$$7); - ZEPHIR_SINIT_VAR(_7$$7); - ZVAL_STRING(&_7$$7, "/:action", 0); - zephir_fast_str_replace(&_6$$7, &_7$$7, idPattern, pattern TSRMLS_CC); - zephir_get_strval(pattern, _6$$7); + if (zephir_memnstr_str(&pattern, SL("/:action"), "phalcon/mvc/router/route.zep", 110)) { + ZEPHIR_INIT_VAR(&_6$$7); + ZEPHIR_INIT_VAR(&_7$$7); + ZVAL_STRING(&_7$$7, "/:action"); + zephir_fast_str_replace(&_6$$7, &_7$$7, &idPattern, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_6$$7); } - if (zephir_memnstr_str(pattern, SL("/:params"), "phalcon/mvc/router/route.zep", 115)) { - ZEPHIR_INIT_VAR(_8$$8); - ZEPHIR_SINIT_VAR(_9$$8); - ZVAL_STRING(&_9$$8, "/:params", 0); - ZEPHIR_SINIT_VAR(_10$$8); - ZVAL_STRING(&_10$$8, "(/.*)*", 0); - zephir_fast_str_replace(&_8$$8, &_9$$8, &_10$$8, pattern TSRMLS_CC); - zephir_get_strval(pattern, _8$$8); + if (zephir_memnstr_str(&pattern, SL("/:params"), "phalcon/mvc/router/route.zep", 115)) { + ZEPHIR_INIT_VAR(&_8$$8); + ZEPHIR_INIT_VAR(&_9$$8); + ZVAL_STRING(&_9$$8, "/:params"); + ZEPHIR_INIT_VAR(&_10$$8); + ZVAL_STRING(&_10$$8, "(/.*)*"); + zephir_fast_str_replace(&_8$$8, &_9$$8, &_10$$8, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_8$$8); } - if (zephir_memnstr_str(pattern, SL("/:int"), "phalcon/mvc/router/route.zep", 120)) { - ZEPHIR_INIT_VAR(_11$$9); - ZEPHIR_SINIT_VAR(_12$$9); - ZVAL_STRING(&_12$$9, "/:int", 0); - ZEPHIR_SINIT_VAR(_13$$9); - ZVAL_STRING(&_13$$9, "/([0-9]+)", 0); - zephir_fast_str_replace(&_11$$9, &_12$$9, &_13$$9, pattern TSRMLS_CC); - zephir_get_strval(pattern, _11$$9); + if (zephir_memnstr_str(&pattern, SL("/:int"), "phalcon/mvc/router/route.zep", 120)) { + ZEPHIR_INIT_VAR(&_11$$9); + ZEPHIR_INIT_VAR(&_12$$9); + ZVAL_STRING(&_12$$9, "/:int"); + ZEPHIR_INIT_VAR(&_13$$9); + ZVAL_STRING(&_13$$9, "/([0-9]+)"); + zephir_fast_str_replace(&_11$$9, &_12$$9, &_13$$9, &pattern TSRMLS_CC); + zephir_get_strval(&pattern, &_11$$9); } } - if (zephir_memnstr_str(pattern, SL("("), "phalcon/mvc/router/route.zep", 126)) { - ZEPHIR_CONCAT_SVS(return_value, "#^", pattern, "$#u"); + if (zephir_memnstr_str(&pattern, SL("("), "phalcon/mvc/router/route.zep", 126)) { + ZEPHIR_CONCAT_SVS(return_value, "#^", &pattern, "$#u"); RETURN_MM(); } - if (zephir_memnstr_str(pattern, SL("["), "phalcon/mvc/router/route.zep", 131)) { - ZEPHIR_CONCAT_SVS(return_value, "#^", pattern, "$#u"); + if (zephir_memnstr_str(&pattern, SL("["), "phalcon/mvc/router/route.zep", 131)) { + ZEPHIR_CONCAT_SVS(return_value, "#^", &pattern, "$#u"); RETURN_MM(); } - RETURN_CTOR(pattern); + RETURN_CTOR(&pattern); } @@ -218,13 +248,16 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, compilePattern) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, via) { - zval *httpMethods; + zval *httpMethods, httpMethods_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&httpMethods_sub); zephir_fetch_params(0, 1, 0, &httpMethods); - zephir_update_property_this(getThis(), SL("_methods"), httpMethods TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_methods"), httpMethods); RETURN_THISW(); } @@ -238,21 +271,44 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, extractNamedParams) { zend_bool notValid = 0, _6$$12, _7$$12, _8$$12, _9$$12, _10$$12, _11$$12, _12$$12, _13$$12, _14$$12, _15$$12, _16$$12, _17$$12, _25$$18, _31$$36, _32$$37, _33$$37, _34$$37; zend_long tmp = 0, cursor = 0, cursorVar = 0, marker = 0, bracketCount, parenthesesCount, foundPattern, intermediate, numberMatches; char ch = 0, prevCh; - zval *pattern_param = NULL, *matches = NULL, _1$$11 = zval_used_for_init, _2$$11 = zval_used_for_init, *_3$$11 = NULL, _18$$16 = zval_used_for_init, _19$$16 = zval_used_for_init, *_20$$16 = NULL, _22$$16 = zval_used_for_init, *_23$$16 = NULL, *_28$$19 = NULL, *_29$$28 = NULL; - zval *pattern = NULL, *route = NULL, *item = NULL, *variable = NULL, *regexp = NULL, *_4$$11 = NULL, *_21$$16 = NULL, *_24$$16 = NULL, *_27$$26 = NULL, *_30$$29 = NULL; + zval *pattern_param = NULL, matches, _1$$11, _2$$11, _3$$11, _18$$16, _19$$16, _20$$16, _22$$16, _23$$16, _28$$19, _29$$28; + zval pattern, route, item, variable, regexp, _4$$11, _21$$16, _24$$16, _27$$26, _30$$29; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&item); + ZVAL_UNDEF(&variable); + ZVAL_UNDEF(®exp); + ZVAL_UNDEF(&_4$$11); + ZVAL_UNDEF(&_21$$16); + ZVAL_UNDEF(&_24$$16); + ZVAL_UNDEF(&_27$$26); + ZVAL_UNDEF(&_30$$29); + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&_1$$11); + ZVAL_UNDEF(&_2$$11); + ZVAL_UNDEF(&_3$$11); + ZVAL_UNDEF(&_18$$16); + ZVAL_UNDEF(&_19$$16); + ZVAL_UNDEF(&_20$$16); + ZVAL_UNDEF(&_22$$16); + ZVAL_UNDEF(&_23$$16); + ZVAL_UNDEF(&_28$$19); + ZVAL_UNDEF(&_29$$28); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &pattern_param); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } @@ -262,16 +318,16 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, extractNamedParams) { foundPattern = 0; intermediate = 0; numberMatches = 0; - if (zephir_fast_strlen_ev(pattern) <= 0) { + if (zephir_fast_strlen_ev(&pattern) <= 0) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(matches); - array_init(matches); - ZEPHIR_INIT_VAR(route); - ZVAL_EMPTY_STRING(route); - for (_0 = 0; _0 < Z_STRLEN_P(pattern); _0++) { + ZEPHIR_INIT_VAR(&matches); + array_init(&matches); + ZEPHIR_INIT_VAR(&route); + ZVAL_STRING(&route, ""); + for (_0 = 0; _0 < Z_STRLEN_P(&pattern); _0++) { cursor = _0; - ch = ZEPHIR_STRING_OFFSET(pattern, _0); + ch = ZEPHIR_STRING_OFFSET(&pattern, _0); if (parenthesesCount == 0) { if (ch == '{') { if (bracketCount == 0) { @@ -286,21 +342,19 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, extractNamedParams) { if (intermediate > 0) { if (bracketCount == 0) { numberMatches++; - ZEPHIR_INIT_NVAR(variable); - ZVAL_EMPTY_STRING(variable); - ZEPHIR_INIT_NVAR(regexp); - ZVAL_EMPTY_STRING(regexp); - ZEPHIR_SINIT_NVAR(_1$$11); + ZEPHIR_INIT_NVAR(&variable); + ZVAL_STRING(&variable, ""); + ZEPHIR_INIT_NVAR(®exp); + ZVAL_STRING(®exp, ""); ZVAL_LONG(&_1$$11, marker); - ZEPHIR_SINIT_NVAR(_2$$11); ZVAL_LONG(&_2$$11, (cursor - marker)); - ZEPHIR_INIT_NVAR(_3$$11); - zephir_substr(_3$$11, pattern, zephir_get_intval(&_1$$11), zephir_get_intval(&_2$$11), 0); - zephir_get_strval(_4$$11, _3$$11); - ZEPHIR_CPY_WRT(item, _4$$11); - for (_5$$11 = 0; _5$$11 < Z_STRLEN_P(item); _5$$11++) { + ZEPHIR_INIT_NVAR(&_3$$11); + zephir_substr(&_3$$11, &pattern, zephir_get_intval(&_1$$11), zephir_get_intval(&_2$$11), 0); + zephir_get_strval(&_4$$11, &_3$$11); + ZEPHIR_CPY_WRT(&item, &_4$$11); + for (_5$$11 = 0; _5$$11 < Z_STRLEN_P(&item); _5$$11++) { cursorVar = _5$$11; - ch = ZEPHIR_STRING_OFFSET(item, _5$$11); + ch = ZEPHIR_STRING_OFFSET(&item, _5$$11); if (ch == '\0') { break; } @@ -358,20 +412,17 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, extractNamedParams) { } if (_17$$12) { if (ch == ':') { - ZEPHIR_SINIT_NVAR(_18$$16); ZVAL_LONG(&_18$$16, 0); - ZEPHIR_SINIT_NVAR(_19$$16); ZVAL_LONG(&_19$$16, cursorVar); - ZEPHIR_INIT_NVAR(_20$$16); - zephir_substr(_20$$16, item, 0 , zephir_get_intval(&_19$$16), 0); - zephir_get_strval(_21$$16, _20$$16); - ZEPHIR_CPY_WRT(variable, _21$$16); - ZEPHIR_SINIT_NVAR(_22$$16); + ZEPHIR_INIT_NVAR(&_20$$16); + zephir_substr(&_20$$16, &item, 0 , zephir_get_intval(&_19$$16), 0); + zephir_get_strval(&_21$$16, &_20$$16); + ZEPHIR_CPY_WRT(&variable, &_21$$16); ZVAL_LONG(&_22$$16, (cursorVar + 1)); - ZEPHIR_INIT_NVAR(_23$$16); - zephir_substr(_23$$16, item, zephir_get_intval(&_22$$16), 0, ZEPHIR_SUBSTR_NO_LENGTH); - zephir_get_strval(_24$$16, _23$$16); - ZEPHIR_CPY_WRT(regexp, _24$$16); + ZEPHIR_INIT_NVAR(&_23$$16); + zephir_substr(&_23$$16, &item, zephir_get_intval(&_22$$16), 0, ZEPHIR_SUBSTR_NO_LENGTH); + zephir_get_strval(&_24$$16, &_23$$16); + ZEPHIR_CPY_WRT(®exp, &_24$$16); break; } } else { @@ -381,14 +432,14 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, extractNamedParams) { } if (!(notValid)) { tmp = numberMatches; - _25$$18 = zephir_is_true(variable); + _25$$18 = zephir_is_true(&variable); if (_25$$18) { - _25$$18 = zephir_is_true(regexp); + _25$$18 = zephir_is_true(®exp); } if (_25$$18) { foundPattern = 0; - for (_26$$19 = 0; _26$$19 < Z_STRLEN_P(regexp); _26$$19++) { - ch = ZEPHIR_STRING_OFFSET(regexp, _26$$19); + for (_26$$19 = 0; _26$$19 < Z_STRLEN_P(®exp); _26$$19++) { + ch = ZEPHIR_STRING_OFFSET(®exp, _26$$19); if (ch == '\0') { break; } @@ -405,24 +456,24 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, extractNamedParams) { } if (foundPattern != 2) { ZEPHIR_INIT_LNVAR(_27$$26); - ZEPHIR_CONCAT_SVS(_27$$26, "(", regexp, ")"); - zephir_concat_self(&route, _27$$26 TSRMLS_CC); + ZEPHIR_CONCAT_SVS(&_27$$26, "(", ®exp, ")"); + zephir_concat_self(&route, &_27$$26 TSRMLS_CC); } else { - zephir_concat_self(&route, regexp TSRMLS_CC); + zephir_concat_self(&route, ®exp TSRMLS_CC); } - ZEPHIR_INIT_NVAR(_28$$19); - ZVAL_LONG(_28$$19, tmp); - zephir_array_update_zval(&matches, variable, &_28$$19, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_28$$19); + ZVAL_LONG(&_28$$19, tmp); + zephir_array_update_zval(&matches, &variable, &_28$$19, PH_COPY | PH_SEPARATE); } else { zephir_concat_self_str(&route, "([^/]*)", sizeof("([^/]*)")-1 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_29$$28); - ZVAL_LONG(_29$$28, tmp); - zephir_array_update_zval(&matches, item, &_29$$28, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&_29$$28); + ZVAL_LONG(&_29$$28, tmp); + zephir_array_update_zval(&matches, &item, &_29$$28, PH_COPY | PH_SEPARATE); } } else { ZEPHIR_INIT_LNVAR(_30$$29); - ZEPHIR_CONCAT_SVS(_30$$29, "{", item, "}"); - zephir_concat_self(&route, _30$$29 TSRMLS_CC); + ZEPHIR_CONCAT_SVS(&_30$$29, "{", &item, "}"); + zephir_concat_self(&route, &_30$$29 TSRMLS_CC); } continue; } @@ -471,8 +522,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, extractNamedParams) { } } zephir_create_array(return_value, 2, 0 TSRMLS_CC); - zephir_array_fast_append(return_value, route); - zephir_array_fast_append(return_value, matches); + zephir_array_fast_append(return_value, &route); + zephir_array_fast_append(return_value, &matches); RETURN_MM(); } @@ -483,50 +534,62 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, extractNamedParams) { PHP_METHOD(Phalcon_Mvc_Router_Route, reConfigure) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *pattern_param = NULL, *paths = NULL, *routePaths = NULL, *pcrePattern = NULL, *compiledPattern = NULL, *extracted = NULL, *_0$$4, *_1$$4; - zval *pattern = NULL; + zval *pattern_param = NULL, *paths = NULL, paths_sub, __$null, routePaths, pcrePattern, compiledPattern, extracted, _0$$4, _1$$4; + zval pattern; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&pattern); + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&routePaths); + ZVAL_UNDEF(&pcrePattern); + ZVAL_UNDEF(&compiledPattern); + ZVAL_UNDEF(&extracted); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &pattern_param, &paths); if (UNEXPECTED(Z_TYPE_P(pattern_param) != IS_STRING && Z_TYPE_P(pattern_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'pattern' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(pattern_param) == IS_STRING)) { - zephir_get_strval(pattern, pattern_param); + zephir_get_strval(&pattern, pattern_param); } else { - ZEPHIR_INIT_VAR(pattern); - ZVAL_EMPTY_STRING(pattern); + ZEPHIR_INIT_VAR(&pattern); + ZVAL_EMPTY_STRING(&pattern); } if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } ZEPHIR_CALL_SELF(&routePaths, "getroutepaths", NULL, 0, paths); zephir_check_call_status(); - if (!(zephir_start_with_str(pattern, SL("#")))) { - if (zephir_memnstr_str(pattern, SL("{"), "phalcon/mvc/router/route.zep", 309)) { - ZEPHIR_CALL_METHOD(&extracted, this_ptr, "extractnamedparams", NULL, 0, pattern); + if (!(zephir_start_with_str(&pattern, SL("#")))) { + if (zephir_memnstr_str(&pattern, SL("{"), "phalcon/mvc/router/route.zep", 309)) { + ZEPHIR_CALL_METHOD(&extracted, this_ptr, "extractnamedparams", NULL, 0, &pattern); zephir_check_call_status(); - ZEPHIR_OBS_VAR(pcrePattern); - zephir_array_fetch_long(&pcrePattern, extracted, 0, PH_NOISY, "phalcon/mvc/router/route.zep", 314 TSRMLS_CC); - ZEPHIR_INIT_VAR(_0$$4); - zephir_array_fetch_long(&_1$$4, extracted, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/router/route.zep", 315 TSRMLS_CC); - zephir_fast_array_merge(_0$$4, &(routePaths), &(_1$$4) TSRMLS_CC); - ZEPHIR_CPY_WRT(routePaths, _0$$4); + ZEPHIR_OBS_VAR(&pcrePattern); + zephir_array_fetch_long(&pcrePattern, &extracted, 0, PH_NOISY, "phalcon/mvc/router/route.zep", 314 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$4); + zephir_array_fetch_long(&_1$$4, &extracted, 1, PH_NOISY | PH_READONLY, "phalcon/mvc/router/route.zep", 315 TSRMLS_CC); + zephir_fast_array_merge(&_0$$4, &routePaths, &_1$$4 TSRMLS_CC); + ZEPHIR_CPY_WRT(&routePaths, &_0$$4); } else { - ZEPHIR_CPY_WRT(pcrePattern, pattern); + ZEPHIR_CPY_WRT(&pcrePattern, &pattern); } - ZEPHIR_CALL_METHOD(&compiledPattern, this_ptr, "compilepattern", NULL, 0, pcrePattern); + ZEPHIR_CALL_METHOD(&compiledPattern, this_ptr, "compilepattern", NULL, 0, &pcrePattern); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(compiledPattern, pattern); + ZEPHIR_CPY_WRT(&compiledPattern, &pattern); } - zephir_update_property_this(getThis(), SL("_pattern"), pattern TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_compiledPattern"), compiledPattern TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_paths"), routePaths TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_pattern"), &pattern); + zephir_update_property_zval(this_ptr, SL("_compiledPattern"), &compiledPattern); + zephir_update_property_zval(this_ptr, SL("_paths"), &routePaths); ZEPHIR_MM_RESTORE(); } @@ -537,87 +600,100 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, reConfigure) { PHP_METHOD(Phalcon_Mvc_Router_Route, getRoutePaths) { zend_long _0$$4; - zval *paths = NULL, *moduleName = NULL, *controllerName = NULL, *actionName = NULL, *parts = NULL, *routePaths = NULL, *realClassName = NULL, *namespaceName = NULL, *_1$$9; + zval *paths = NULL, paths_sub, __$null, moduleName, controllerName, actionName, parts, routePaths, realClassName, namespaceName, _1$$9; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&paths_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&moduleName); + ZVAL_UNDEF(&controllerName); + ZVAL_UNDEF(&actionName); + ZVAL_UNDEF(&parts); + ZVAL_UNDEF(&routePaths); + ZVAL_UNDEF(&realClassName); + ZVAL_UNDEF(&namespaceName); + ZVAL_UNDEF(&_1$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &paths); if (!paths) { - paths = ZEPHIR_GLOBAL(global_null); + paths = &paths_sub; + paths = &__$null; } if (Z_TYPE_P(paths) != IS_NULL) { if (Z_TYPE_P(paths) == IS_STRING) { - ZEPHIR_INIT_VAR(moduleName); - ZVAL_NULL(moduleName); - ZEPHIR_INIT_VAR(controllerName); - ZVAL_NULL(controllerName); - ZEPHIR_INIT_VAR(actionName); - ZVAL_NULL(actionName); - ZEPHIR_INIT_VAR(parts); - zephir_fast_explode_str(parts, SL("::"), paths, LONG_MAX TSRMLS_CC); + ZEPHIR_INIT_VAR(&moduleName); + ZVAL_NULL(&moduleName); + ZEPHIR_INIT_VAR(&controllerName); + ZVAL_NULL(&controllerName); + ZEPHIR_INIT_VAR(&actionName); + ZVAL_NULL(&actionName); + ZEPHIR_INIT_VAR(&parts); + zephir_fast_explode_str(&parts, SL("::"), paths, LONG_MAX TSRMLS_CC); do { - _0$$4 = zephir_fast_count_int(parts TSRMLS_CC); + _0$$4 = zephir_fast_count_int(&parts TSRMLS_CC); if (_0$$4 == 3) { - ZEPHIR_OBS_NVAR(moduleName); - zephir_array_fetch_long(&moduleName, parts, 0, PH_NOISY, "phalcon/mvc/router/route.zep", 367 TSRMLS_CC); - ZEPHIR_OBS_NVAR(controllerName); - zephir_array_fetch_long(&controllerName, parts, 1, PH_NOISY, "phalcon/mvc/router/route.zep", 368 TSRMLS_CC); - ZEPHIR_OBS_NVAR(actionName); - zephir_array_fetch_long(&actionName, parts, 2, PH_NOISY, "phalcon/mvc/router/route.zep", 369 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&moduleName); + zephir_array_fetch_long(&moduleName, &parts, 0, PH_NOISY, "phalcon/mvc/router/route.zep", 367 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&controllerName); + zephir_array_fetch_long(&controllerName, &parts, 1, PH_NOISY, "phalcon/mvc/router/route.zep", 368 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&actionName); + zephir_array_fetch_long(&actionName, &parts, 2, PH_NOISY, "phalcon/mvc/router/route.zep", 369 TSRMLS_CC); break; } if (_0$$4 == 2) { - ZEPHIR_OBS_NVAR(controllerName); - zephir_array_fetch_long(&controllerName, parts, 0, PH_NOISY, "phalcon/mvc/router/route.zep", 373 TSRMLS_CC); - ZEPHIR_OBS_NVAR(actionName); - zephir_array_fetch_long(&actionName, parts, 1, PH_NOISY, "phalcon/mvc/router/route.zep", 374 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&controllerName); + zephir_array_fetch_long(&controllerName, &parts, 0, PH_NOISY, "phalcon/mvc/router/route.zep", 373 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&actionName); + zephir_array_fetch_long(&actionName, &parts, 1, PH_NOISY, "phalcon/mvc/router/route.zep", 374 TSRMLS_CC); break; } if (_0$$4 == 1) { - ZEPHIR_OBS_NVAR(controllerName); - zephir_array_fetch_long(&controllerName, parts, 0, PH_NOISY, "phalcon/mvc/router/route.zep", 378 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&controllerName); + zephir_array_fetch_long(&controllerName, &parts, 0, PH_NOISY, "phalcon/mvc/router/route.zep", 378 TSRMLS_CC); break; } } while(0); - ZEPHIR_INIT_VAR(routePaths); - array_init(routePaths); - if (Z_TYPE_P(moduleName) != IS_NULL) { + ZEPHIR_INIT_VAR(&routePaths); + array_init(&routePaths); + if (Z_TYPE_P(&moduleName) != IS_NULL) { zephir_array_update_string(&routePaths, SL("module"), &moduleName, PH_COPY | PH_SEPARATE); } - if (Z_TYPE_P(controllerName) != IS_NULL) { - if (zephir_memnstr_str(controllerName, SL("\\"), "phalcon/mvc/router/route.zep", 393)) { - ZEPHIR_INIT_VAR(realClassName); - zephir_get_class_ns(realClassName, controllerName, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(namespaceName); - zephir_get_ns_class(namespaceName, controllerName, 0 TSRMLS_CC); - if (zephir_is_true(namespaceName)) { + if (Z_TYPE_P(&controllerName) != IS_NULL) { + if (zephir_memnstr_str(&controllerName, SL("\\"), "phalcon/mvc/router/route.zep", 393)) { + ZEPHIR_INIT_VAR(&realClassName); + zephir_get_class_ns(&realClassName, &controllerName, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&namespaceName); + zephir_get_ns_class(&namespaceName, &controllerName, 0 TSRMLS_CC); + if (zephir_is_true(&namespaceName)) { zephir_array_update_string(&routePaths, SL("namespace"), &namespaceName, PH_COPY | PH_SEPARATE); } } else { - ZEPHIR_CPY_WRT(realClassName, controllerName); + ZEPHIR_CPY_WRT(&realClassName, &controllerName); } - ZEPHIR_INIT_VAR(_1$$9); - zephir_uncamelize(_1$$9, realClassName, NULL ); + ZEPHIR_INIT_VAR(&_1$$9); + zephir_uncamelize(&_1$$9, &realClassName, NULL ); zephir_array_update_string(&routePaths, SL("controller"), &_1$$9, PH_COPY | PH_SEPARATE); } - if (Z_TYPE_P(actionName) != IS_NULL) { + if (Z_TYPE_P(&actionName) != IS_NULL) { zephir_array_update_string(&routePaths, SL("action"), &actionName, PH_COPY | PH_SEPARATE); } } else { - ZEPHIR_CPY_WRT(routePaths, paths); + ZEPHIR_CPY_WRT(&routePaths, paths); } } else { - ZEPHIR_INIT_NVAR(routePaths); - array_init(routePaths); + ZEPHIR_INIT_NVAR(&routePaths); + array_init(&routePaths); } - if (Z_TYPE_P(routePaths) != IS_ARRAY) { + if (Z_TYPE_P(&routePaths) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_router_exception_ce, "The route contains invalid paths", "phalcon/mvc/router/route.zep", 425); return; } - RETURN_CCTOR(routePaths); + RETURN_CCTOR(&routePaths); } @@ -626,7 +702,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getRoutePaths) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_name"); @@ -647,15 +724,18 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getName) { PHP_METHOD(Phalcon_Mvc_Router_Route, setName) { zval *name_param = NULL; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); RETURN_THIS(); } @@ -686,13 +766,16 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, setName) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, beforeMatch) { - zval *callback; + zval *callback, callback_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&callback_sub); zephir_fetch_params(0, 1, 0, &callback); - zephir_update_property_this(getThis(), SL("_beforeMatch"), callback TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_beforeMatch"), callback); RETURN_THISW(); } @@ -702,7 +785,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, beforeMatch) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getBeforeMatch) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_beforeMatch"); @@ -724,13 +808,16 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getBeforeMatch) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, match) { - zval *callback; + zval *callback, callback_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&callback_sub); zephir_fetch_params(0, 1, 0, &callback); - zephir_update_property_this(getThis(), SL("_match"), callback TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_match"), callback); RETURN_THISW(); } @@ -740,7 +827,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, match) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getMatch) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_match"); @@ -751,7 +839,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getMatch) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getRouteId) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_id"); @@ -762,7 +851,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getRouteId) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getPattern) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_pattern"); @@ -773,7 +863,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getPattern) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getCompiledPattern) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_compiledPattern"); @@ -784,7 +875,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getCompiledPattern) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getPaths) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_paths"); @@ -795,25 +887,37 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getPaths) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getReversedPaths) { - HashTable *_2; - HashPosition _1; - zval *reversed = NULL, *path = NULL, *position = NULL, *_0, **_3; + zend_string *_3; + zend_ulong _2; + zval reversed, path, position, _0, *_1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&reversed); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(reversed); - array_init(reversed); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_paths"), PH_NOISY_CC); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/mvc/router/route.zep", 566); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HMKEY(path, _2, _1); - ZEPHIR_GET_HVALUE(position, _3); - zephir_array_update_zval(&reversed, position, &path, PH_COPY | PH_SEPARATE); - } - RETURN_CCTOR(reversed); + ZEPHIR_INIT_VAR(&reversed); + array_init(&reversed); + zephir_read_property(&_0, this_ptr, SL("_paths"), PH_NOISY_CC | PH_READONLY); + zephir_is_iterable(&_0, 0, "phalcon/mvc/router/route.zep", 566); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&_0), _2, _3, _1) + { + ZEPHIR_INIT_NVAR(&path); + if (_3 != NULL) { + ZVAL_STR_COPY(&path, _3); + } else { + ZVAL_LONG(&path, _2); + } + ZEPHIR_INIT_NVAR(&position); + ZVAL_COPY(&position, _1); + zephir_array_update_zval(&reversed, &position, &path, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&position); + ZEPHIR_INIT_NVAR(&path); + RETURN_CCTOR(&reversed); } @@ -827,13 +931,16 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getReversedPaths) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, setHttpMethods) { - zval *httpMethods; + zval *httpMethods, httpMethods_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&httpMethods_sub); zephir_fetch_params(0, 1, 0, &httpMethods); - zephir_update_property_this(getThis(), SL("_methods"), httpMethods TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_methods"), httpMethods); RETURN_THISW(); } @@ -843,7 +950,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, setHttpMethods) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getHttpMethods) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_methods"); @@ -859,24 +967,27 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getHttpMethods) { PHP_METHOD(Phalcon_Mvc_Router_Route, setHostname) { zval *hostname_param = NULL; - zval *hostname = NULL; + zval hostname; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&hostname); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &hostname_param); if (UNEXPECTED(Z_TYPE_P(hostname_param) != IS_STRING && Z_TYPE_P(hostname_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'hostname' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'hostname' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(hostname_param) == IS_STRING)) { - zephir_get_strval(hostname, hostname_param); + zephir_get_strval(&hostname, hostname_param); } else { - ZEPHIR_INIT_VAR(hostname); - ZVAL_EMPTY_STRING(hostname); + ZEPHIR_INIT_VAR(&hostname); + ZVAL_EMPTY_STRING(&hostname); } - zephir_update_property_this(getThis(), SL("_hostname"), hostname TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_hostname"), &hostname); RETURN_THIS(); } @@ -886,7 +997,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, setHostname) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getHostname) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_hostname"); @@ -897,13 +1009,16 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getHostname) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, setGroup) { - zval *group; + zval *group, group_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&group_sub); zephir_fetch_params(0, 1, 0, &group); - zephir_update_property_this(getThis(), SL("_group"), group TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_group"), group); RETURN_THISW(); } @@ -913,7 +1028,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, setGroup) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getGroup) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_group"); @@ -948,25 +1064,29 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getGroup) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, convert) { - zval *name_param = NULL, *converter; - zval *name = NULL; + zval *name_param = NULL, *converter, converter_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&converter_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &converter); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - zephir_update_property_array(this_ptr, SL("_converters"), name, converter TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_converters"), &name, converter TSRMLS_CC); RETURN_THIS(); } @@ -976,7 +1096,8 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, convert) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, getConverters) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_converters"); @@ -987,9 +1108,13 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getConverters) { */ PHP_METHOD(Phalcon_Mvc_Router_Route, reset) { - + zval __$null; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + - zephir_update_static_property_ce(phalcon_mvc_router_route_ce, SL("_uniqueId"), &ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zend_update_static_property(phalcon_mvc_router_route_ce, ZEND_STRL("_uniqueId"), &__$null); } diff --git a/ext/phalcon/mvc/router/route.zep.h b/ext/phalcon/mvc/router/route.zep.h index 732cde803b2..1c05007cff2 100644 --- a/ext/phalcon/mvc/router/route.zep.h +++ b/ext/phalcon/mvc/router/route.zep.h @@ -32,61 +32,192 @@ PHP_METHOD(Phalcon_Mvc_Router_Route, getConverters); PHP_METHOD(Phalcon_Mvc_Router_Route, reset); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, httpMethods) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_compilepattern, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_compilepattern, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_compilepattern, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_via, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_route_via, 0, 1, Phalcon\\Mvc\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_via, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\Route", 0) +#endif ZEND_ARG_INFO(0, httpMethods) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_extractnamedparams, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_reconfigure, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_getroutepaths, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getroutepaths, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getroutepaths, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_setname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_route_setname, 0, 1, Phalcon\\Mvc\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_setname, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\Route", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_beforematch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_route_beforematch, 0, 1, Phalcon\\Mvc\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_beforematch, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\Route", 0) +#endif ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_match, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_route_match, 0, 1, Phalcon\\Mvc\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_match, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\Route", 0) +#endif ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_sethttpmethods, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getrouteid, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getrouteid, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getpattern, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getpattern, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getcompiledpattern, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getcompiledpattern, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getpaths, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getpaths, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getreversedpaths, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getreversedpaths, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_route_sethttpmethods, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_sethttpmethods, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif ZEND_ARG_INFO(0, httpMethods) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_sethostname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_route_sethostname, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_sethostname, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) +#else ZEND_ARG_INFO(0, hostname) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_gethostname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_gethostname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_setgroup, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_route_setgroup, 0, 1, Phalcon\\Mvc\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_setgroup, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\Route", 0) +#endif ZEND_ARG_OBJ_INFO(0, group, Phalcon\\Mvc\\Router\\GroupInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_route_convert, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_route_getgroup, 0, 0, Phalcon\\Mvc\\Router\\GroupInterface, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getgroup, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Router\\GroupInterface", 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_route_convert, 0, 2, Phalcon\\Mvc\\Router\\Route, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_convert, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\Router\\Route", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, converter) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getconverters, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_route_getconverters, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_router_route_method_entry) { PHP_ME(Phalcon_Mvc_Router_Route, getId, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, __construct, arginfo_phalcon_mvc_router_route___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) @@ -95,25 +226,25 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_router_route_method_entry) { PHP_ME(Phalcon_Mvc_Router_Route, extractNamedParams, arginfo_phalcon_mvc_router_route_extractnamedparams, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, reConfigure, arginfo_phalcon_mvc_router_route_reconfigure, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, getRoutePaths, arginfo_phalcon_mvc_router_route_getroutepaths, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Mvc_Router_Route, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Route, getName, arginfo_phalcon_mvc_router_route_getname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, setName, arginfo_phalcon_mvc_router_route_setname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, beforeMatch, arginfo_phalcon_mvc_router_route_beforematch, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, getBeforeMatch, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, match, arginfo_phalcon_mvc_router_route_match, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, getMatch, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Route, getRouteId, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Route, getPattern, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Route, getCompiledPattern, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Route, getPaths, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Route, getReversedPaths, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Route, getRouteId, arginfo_phalcon_mvc_router_route_getrouteid, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Route, getPattern, arginfo_phalcon_mvc_router_route_getpattern, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Route, getCompiledPattern, arginfo_phalcon_mvc_router_route_getcompiledpattern, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Route, getPaths, arginfo_phalcon_mvc_router_route_getpaths, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Route, getReversedPaths, arginfo_phalcon_mvc_router_route_getreversedpaths, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, setHttpMethods, arginfo_phalcon_mvc_router_route_sethttpmethods, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, getHttpMethods, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, setHostname, arginfo_phalcon_mvc_router_route_sethostname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Route, getHostname, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Route, getHostname, arginfo_phalcon_mvc_router_route_gethostname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, setGroup, arginfo_phalcon_mvc_router_route_setgroup, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Route, getGroup, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Route, getGroup, arginfo_phalcon_mvc_router_route_getgroup, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, convert, arginfo_phalcon_mvc_router_route_convert, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Router_Route, getConverters, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Router_Route, getConverters, arginfo_phalcon_mvc_router_route_getconverters, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Router_Route, reset, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/router/routeinterface.zep.h b/ext/phalcon/mvc/router/routeinterface.zep.h index 1c76992f843..20dc76e2c14 100644 --- a/ext/phalcon/mvc/router/routeinterface.zep.h +++ b/ext/phalcon/mvc/router/routeinterface.zep.h @@ -3,12 +3,35 @@ extern zend_class_entry *phalcon_mvc_router_routeinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_Router_RouteInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_sethostname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_sethostname, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_sethostname, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) +#else ZEND_ARG_INFO(0, hostname) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_compilepattern, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_gethostname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_gethostname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_compilepattern, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_compilepattern, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_via, 0, 0, 1) @@ -16,32 +39,86 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_via, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_reconfigure, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_setname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_sethttpmethods, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_sethttpmethods, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_sethttpmethods, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif ZEND_ARG_INFO(0, httpMethods) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getrouteid, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getrouteid, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getpattern, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getpattern, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getcompiledpattern, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getcompiledpattern, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getpaths, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getpaths, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getreversedpaths, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_router_routeinterface_getreversedpaths, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_router_routeinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, setHostname, arginfo_phalcon_mvc_router_routeinterface_sethostname) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getHostname, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getHostname, arginfo_phalcon_mvc_router_routeinterface_gethostname) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, compilePattern, arginfo_phalcon_mvc_router_routeinterface_compilepattern) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, via, arginfo_phalcon_mvc_router_routeinterface_via) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, reConfigure, arginfo_phalcon_mvc_router_routeinterface_reconfigure) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getName, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getName, arginfo_phalcon_mvc_router_routeinterface_getname) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, setName, arginfo_phalcon_mvc_router_routeinterface_setname) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, setHttpMethods, arginfo_phalcon_mvc_router_routeinterface_sethttpmethods) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getRouteId, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getPattern, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getCompiledPattern, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getPaths, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getReversedPaths, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getRouteId, arginfo_phalcon_mvc_router_routeinterface_getrouteid) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getPattern, arginfo_phalcon_mvc_router_routeinterface_getpattern) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getCompiledPattern, arginfo_phalcon_mvc_router_routeinterface_getcompiledpattern) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getPaths, arginfo_phalcon_mvc_router_routeinterface_getpaths) + PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getReversedPaths, arginfo_phalcon_mvc_router_routeinterface_getreversedpaths) PHP_ABSTRACT_ME(Phalcon_Mvc_Router_RouteInterface, getHttpMethods, NULL) ZEND_FENTRY(reset, NULL, NULL, ZEND_ACC_STATIC|ZEND_ACC_ABSTRACT|ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/mvc/routerinterface.zep.h b/ext/phalcon/mvc/routerinterface.zep.h index 6a4900e3f91..131aa4932f4 100644 --- a/ext/phalcon/mvc/routerinterface.zep.h +++ b/ext/phalcon/mvc/routerinterface.zep.h @@ -4,15 +4,27 @@ extern zend_class_entry *phalcon_mvc_routerinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_RouterInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_setdefaultmodule, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, moduleName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, moduleName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_setdefaultcontroller, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_setdefaultaction, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_setdefaults, 0, 0, 1) @@ -20,75 +32,238 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_setdefaults, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_handle, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 1) +#else ZEND_ARG_INFO(0, uri) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_add, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_add, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_add, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_ARG_INFO(0, httpMethods) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_addget, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_addget, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_addget, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_addpost, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_addpost, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_addpost, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_addput, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_addput, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_addput, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_addpatch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_addpatch, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_addpatch, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_adddelete, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_adddelete, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_adddelete, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_addoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_addoptions, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_addoptions, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_addhead, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_addhead, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_addhead, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_addpurge, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_addpurge, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_addpurge, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_addtrace, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_addtrace, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_addtrace, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_addconnect, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_addconnect, 0, 1, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_addconnect, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0) +#else ZEND_ARG_INFO(0, pattern) +#endif ZEND_ARG_INFO(0, paths) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_mount, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_mount, 0, 1, Phalcon\\Mvc\\RouterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_mount, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\RouterInterface", 0) +#endif ZEND_ARG_OBJ_INFO(0, group, Phalcon\\Mvc\\Router\\GroupInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getmodulename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getmodulename, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getnamespacename, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getnamespacename, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getcontrollername, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getcontrollername, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getactionname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getactionname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getparams, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getparams, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_getmatchedroute, 0, 0, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getmatchedroute, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getmatches, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getmatches, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_wasmatched, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_wasmatched, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_routerinterface_getroutes, 0, 0, Phalcon\\Mvc\\Router\\RouteInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_routerinterface_getroutes, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Router\\RouteInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_getroutebyid, 0, 0, 1) ZEND_ARG_INFO(0, id) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_routerinterface_getroutebyname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_routerinterface_method_entry) { @@ -110,15 +285,15 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_routerinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, addConnect, arginfo_phalcon_mvc_routerinterface_addconnect) PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, mount, arginfo_phalcon_mvc_routerinterface_mount) PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, clear, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getModuleName, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getNamespaceName, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getControllerName, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getActionName, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getParams, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getMatchedRoute, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getMatches, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, wasMatched, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getRoutes, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getModuleName, arginfo_phalcon_mvc_routerinterface_getmodulename) + PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getNamespaceName, arginfo_phalcon_mvc_routerinterface_getnamespacename) + PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getControllerName, arginfo_phalcon_mvc_routerinterface_getcontrollername) + PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getActionName, arginfo_phalcon_mvc_routerinterface_getactionname) + PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getParams, arginfo_phalcon_mvc_routerinterface_getparams) + PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getMatchedRoute, arginfo_phalcon_mvc_routerinterface_getmatchedroute) + PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getMatches, arginfo_phalcon_mvc_routerinterface_getmatches) + PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, wasMatched, arginfo_phalcon_mvc_routerinterface_wasmatched) + PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getRoutes, arginfo_phalcon_mvc_routerinterface_getroutes) PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getRouteById, arginfo_phalcon_mvc_routerinterface_getroutebyid) PHP_ABSTRACT_ME(Phalcon_Mvc_RouterInterface, getRouteByName, arginfo_phalcon_mvc_routerinterface_getroutebyname) PHP_FE_END diff --git a/ext/phalcon/mvc/url.zep.c b/ext/phalcon/mvc/url.zep.c index 9d6a6efb1ca..d3c93b07549 100644 --- a/ext/phalcon/mvc/url.zep.c +++ b/ext/phalcon/mvc/url.zep.c @@ -68,13 +68,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_Url) { */ PHP_METHOD(Phalcon_Mvc_Url, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -83,7 +86,8 @@ PHP_METHOD(Phalcon_Mvc_Url, setDI) { */ PHP_METHOD(Phalcon_Mvc_Url, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -100,28 +104,32 @@ PHP_METHOD(Phalcon_Mvc_Url, getDI) { */ PHP_METHOD(Phalcon_Mvc_Url, setBaseUri) { - zval *baseUri_param = NULL, *_0; - zval *baseUri = NULL; + zval *baseUri_param = NULL, _0; + zval baseUri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&baseUri); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &baseUri_param); if (UNEXPECTED(Z_TYPE_P(baseUri_param) != IS_STRING && Z_TYPE_P(baseUri_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'baseUri' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'baseUri' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(baseUri_param) == IS_STRING)) { - zephir_get_strval(baseUri, baseUri_param); + zephir_get_strval(&baseUri, baseUri_param); } else { - ZEPHIR_INIT_VAR(baseUri); - ZVAL_EMPTY_STRING(baseUri); + ZEPHIR_INIT_VAR(&baseUri); + ZVAL_EMPTY_STRING(&baseUri); } - zephir_update_property_this(getThis(), SL("_baseUri"), baseUri TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_staticBaseUri"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - zephir_update_property_this(getThis(), SL("_staticBaseUri"), baseUri TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_baseUri"), &baseUri); + zephir_read_property(&_0, this_ptr, SL("_staticBaseUri"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + zephir_update_property_zval(this_ptr, SL("_staticBaseUri"), &baseUri); } RETURN_THIS(); @@ -137,24 +145,27 @@ PHP_METHOD(Phalcon_Mvc_Url, setBaseUri) { PHP_METHOD(Phalcon_Mvc_Url, setStaticBaseUri) { zval *staticBaseUri_param = NULL; - zval *staticBaseUri = NULL; + zval staticBaseUri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&staticBaseUri); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &staticBaseUri_param); if (UNEXPECTED(Z_TYPE_P(staticBaseUri_param) != IS_STRING && Z_TYPE_P(staticBaseUri_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'staticBaseUri' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'staticBaseUri' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(staticBaseUri_param) == IS_STRING)) { - zephir_get_strval(staticBaseUri, staticBaseUri_param); + zephir_get_strval(&staticBaseUri, staticBaseUri_param); } else { - ZEPHIR_INIT_VAR(staticBaseUri); - ZVAL_EMPTY_STRING(staticBaseUri); + ZEPHIR_INIT_VAR(&staticBaseUri); + ZVAL_EMPTY_STRING(&staticBaseUri); } - zephir_update_property_this(getThis(), SL("_staticBaseUri"), staticBaseUri TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_staticBaseUri"), &staticBaseUri); RETURN_THIS(); } @@ -164,31 +175,36 @@ PHP_METHOD(Phalcon_Mvc_Url, setStaticBaseUri) { */ PHP_METHOD(Phalcon_Mvc_Url, getBaseUri) { - zval *_SERVER, *baseUri = NULL, *phpSelf = NULL, *uri = NULL; + zval *_SERVER, baseUri, phpSelf, uri; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&baseUri); + ZVAL_UNDEF(&phpSelf); + ZVAL_UNDEF(&uri); ZEPHIR_MM_GROW(); - zephir_get_global(&_SERVER, SS("_SERVER") TSRMLS_CC); - - ZEPHIR_OBS_VAR(baseUri); - zephir_read_property_this(&baseUri, this_ptr, SL("_baseUri"), PH_NOISY_CC); - if (Z_TYPE_P(baseUri) == IS_NULL) { - ZEPHIR_OBS_VAR(phpSelf); - if (zephir_array_isset_string_fetch(&phpSelf, _SERVER, SS("PHP_SELF"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(uri); - phalcon_get_uri(uri, phpSelf); + zephir_get_global(&_SERVER, SL("_SERVER")); + + ZEPHIR_OBS_VAR(&baseUri); + zephir_read_property(&baseUri, this_ptr, SL("_baseUri"), PH_NOISY_CC); + if (Z_TYPE_P(&baseUri) == IS_NULL) { + ZEPHIR_OBS_VAR(&phpSelf); + if (zephir_array_isset_string_fetch(&phpSelf, _SERVER, SL("PHP_SELF"), 0)) { + ZEPHIR_INIT_VAR(&uri); + phalcon_get_uri(&uri, &phpSelf); } else { - ZEPHIR_INIT_NVAR(uri); - ZVAL_NULL(uri); + ZEPHIR_INIT_NVAR(&uri); + ZVAL_NULL(&uri); } - ZEPHIR_INIT_NVAR(baseUri); - if (!(zephir_is_true(uri))) { - ZVAL_STRING(baseUri, "/", 1); + ZEPHIR_INIT_NVAR(&baseUri); + if (!(zephir_is_true(&uri))) { + ZVAL_STRING(&baseUri, "/"); } else { - ZEPHIR_CONCAT_SVS(baseUri, "/", uri, "/"); + ZEPHIR_CONCAT_SVS(&baseUri, "/", &uri, "/"); } - zephir_update_property_this(getThis(), SL("_baseUri"), baseUri TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_baseUri"), &baseUri); } - RETURN_CCTOR(baseUri); + RETURN_CCTOR(&baseUri); } @@ -197,15 +213,18 @@ PHP_METHOD(Phalcon_Mvc_Url, getBaseUri) { */ PHP_METHOD(Phalcon_Mvc_Url, getStaticBaseUri) { - zval *staticBaseUri = NULL; + zval staticBaseUri; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&staticBaseUri); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(staticBaseUri); - zephir_read_property_this(&staticBaseUri, this_ptr, SL("_staticBaseUri"), PH_NOISY_CC); - if (Z_TYPE_P(staticBaseUri) != IS_NULL) { - RETURN_CCTOR(staticBaseUri); + ZEPHIR_OBS_VAR(&staticBaseUri); + zephir_read_property(&staticBaseUri, this_ptr, SL("_staticBaseUri"), PH_NOISY_CC); + if (Z_TYPE_P(&staticBaseUri) != IS_NULL) { + RETURN_CCTOR(&staticBaseUri); } ZEPHIR_RETURN_CALL_METHOD(this_ptr, "getbaseuri", NULL, 0); zephir_check_call_status(); @@ -223,24 +242,27 @@ PHP_METHOD(Phalcon_Mvc_Url, getStaticBaseUri) { PHP_METHOD(Phalcon_Mvc_Url, setBasePath) { zval *basePath_param = NULL; - zval *basePath = NULL; + zval basePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&basePath); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &basePath_param); if (UNEXPECTED(Z_TYPE_P(basePath_param) != IS_STRING && Z_TYPE_P(basePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'basePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'basePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(basePath_param) == IS_STRING)) { - zephir_get_strval(basePath, basePath_param); + zephir_get_strval(&basePath, basePath_param); } else { - ZEPHIR_INIT_VAR(basePath); - ZVAL_EMPTY_STRING(basePath); + ZEPHIR_INIT_VAR(&basePath); + ZVAL_EMPTY_STRING(&basePath); } - zephir_update_property_this(getThis(), SL("_basePath"), basePath TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_basePath"), &basePath); RETURN_THIS(); } @@ -250,7 +272,8 @@ PHP_METHOD(Phalcon_Mvc_Url, setBasePath) { */ PHP_METHOD(Phalcon_Mvc_Url, getBasePath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_basePath"); @@ -291,30 +314,67 @@ PHP_METHOD(Phalcon_Mvc_Url, getBasePath) { */ PHP_METHOD(Phalcon_Mvc_Url, get) { - unsigned char _17$$14, _19$$14, _24$$16; - zend_bool _0$$3, _1$$3, _15$$14, _16$$14, _18$$14, _22$$16, _23$$16, _25$$19; - zval *strUri = NULL, *_14$$14 = NULL; + unsigned char _18$$14, _20$$14, _25$$16; + zend_bool _0$$3, _1$$3, _16$$14, _17$$14, _19$$14, _23$$16, _24$$16, _26$$19; + zval strUri, _15$$14; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri = NULL, *args = NULL, *local = NULL, *baseUri = NULL, *router = NULL, *dependencyInjector = NULL, *routeName = NULL, *route = NULL, *queryString = NULL, *_2$$4, *_3$$4, _4$$4, *_5$$9, *_9$$9 = NULL, *_12$$9, *_13$$9 = NULL, *_6$$11, *_7$$11 = NULL, *_8$$11, *_10$$13, *_11$$13, _20$$15, *_21$$15, _26$$20, *_27$$20, *_28$$21, *_29$$22; + zval *uri = NULL, uri_sub, *args = NULL, args_sub, *local = NULL, local_sub, *baseUri = NULL, baseUri_sub, __$null, router, dependencyInjector, routeName, route, queryString, _2$$4, _3$$4, _4$$4, _5$$4, _6$$9, _10$$9, _13$$9, _14$$9, _7$$11, _8$$11, _9$$11, _11$$13, _12$$13, _21$$15, _22$$15, _27$$20, _28$$20, _29$$21, _30$$22; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uri_sub); + ZVAL_UNDEF(&args_sub); + ZVAL_UNDEF(&local_sub); + ZVAL_UNDEF(&baseUri_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&router); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&routeName); + ZVAL_UNDEF(&route); + ZVAL_UNDEF(&queryString); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$4); + ZVAL_UNDEF(&_6$$9); + ZVAL_UNDEF(&_10$$9); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_14$$9); + ZVAL_UNDEF(&_7$$11); + ZVAL_UNDEF(&_8$$11); + ZVAL_UNDEF(&_9$$11); + ZVAL_UNDEF(&_11$$13); + ZVAL_UNDEF(&_12$$13); + ZVAL_UNDEF(&_21$$15); + ZVAL_UNDEF(&_22$$15); + ZVAL_UNDEF(&_27$$20); + ZVAL_UNDEF(&_28$$20); + ZVAL_UNDEF(&_29$$21); + ZVAL_UNDEF(&_30$$22); + ZVAL_UNDEF(&strUri); + ZVAL_UNDEF(&_15$$14); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &uri, &args, &local, &baseUri); if (!uri) { - ZEPHIR_CPY_WRT(uri, ZEPHIR_GLOBAL(global_null)); + uri = &uri_sub; + ZEPHIR_CPY_WRT(uri, &__$null); } else { ZEPHIR_SEPARATE_PARAM(uri); } if (!args) { - args = ZEPHIR_GLOBAL(global_null); + args = &args_sub; + args = &__$null; } if (!local) { - ZEPHIR_CPY_WRT(local, ZEPHIR_GLOBAL(global_null)); + local = &local_sub; + ZEPHIR_CPY_WRT(local, &__$null); } else { ZEPHIR_SEPARATE_PARAM(local); } if (!baseUri) { - ZEPHIR_CPY_WRT(baseUri, ZEPHIR_GLOBAL(global_null)); + baseUri = &baseUri_sub; + ZEPHIR_CPY_WRT(baseUri, &__$null); } else { ZEPHIR_SEPARATE_PARAM(baseUri); } @@ -330,13 +390,15 @@ PHP_METHOD(Phalcon_Mvc_Url, get) { _0$$3 = _1$$3; } if (_0$$3) { - ZEPHIR_INIT_VAR(_2$$4); - ZEPHIR_INIT_VAR(_3$$4); - ZEPHIR_SINIT_VAR(_4$$4); - ZVAL_STRING(&_4$$4, "#^((//)|([a-z0-9]+://)|([a-z0-9]+:))#i", 0); - zephir_preg_match(_3$$4, &_4$$4, uri, _2$$4, 0, 0 , 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$4); + ZEPHIR_INIT_VAR(&_3$$4); + ZVAL_STRING(&_3$$4, "#^((//)|([a-z0-9]+://)|([a-z0-9]+:))#i"); + ZEPHIR_INIT_VAR(&_4$$4); + ZEPHIR_INIT_VAR(&_5$$4); + ZVAL_STRING(&_5$$4, "#^((//)|([a-z0-9]+://)|([a-z0-9]+:))#i"); + zephir_preg_match(&_4$$4, &_5$$4, uri, &_2$$4, 0, 0 , 0 TSRMLS_CC); ZEPHIR_INIT_NVAR(local); - if (zephir_is_true(_3$$4)) { + if (zephir_is_true(&_4$$4)) { ZVAL_BOOL(local, 0); } else { ZVAL_BOOL(local, 1); @@ -347,116 +409,114 @@ PHP_METHOD(Phalcon_Mvc_Url, get) { } } if (Z_TYPE_P(baseUri) != IS_STRING) { - ZEPHIR_CALL_METHOD(&baseUri, this_ptr, "getbaseuri", NULL, 0); + ZEPHIR_CALL_METHOD(baseUri, this_ptr, "getbaseuri", NULL, 0); zephir_check_call_status(); } if (Z_TYPE_P(uri) == IS_ARRAY) { - ZEPHIR_OBS_VAR(routeName); - if (!(zephir_array_isset_string_fetch(&routeName, uri, SS("for"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&routeName); + if (!(zephir_array_isset_string_fetch(&routeName, uri, SL("for"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_url_exception_ce, "It's necessary to define the route name with the parameter 'for'", "phalcon/mvc/url.zep", 226); return; } - _5$$9 = zephir_fetch_nproperty_this(this_ptr, SL("_router"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(router, _5$$9); - if (Z_TYPE_P(router) != IS_OBJECT) { - _6$$11 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _6$$11); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_6$$9, this_ptr, SL("_router"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&router, &_6$$9); + if (Z_TYPE_P(&router) != IS_OBJECT) { + zephir_read_property(&_7$$11, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_7$$11); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_url_exception_ce, "A dependency injector container is required to obtain the 'router' service", "phalcon/mvc/url.zep", 238); return; } - ZEPHIR_INIT_VAR(_8$$11); - ZVAL_STRING(_8$$11, "router", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_7$$11, dependencyInjector, "getshared", NULL, 0, _8$$11); - zephir_check_temp_parameter(_8$$11); + ZEPHIR_INIT_VAR(&_9$$11); + ZVAL_STRING(&_9$$11, "router"); + ZEPHIR_CALL_METHOD(&_8$$11, &dependencyInjector, "getshared", NULL, 0, &_9$$11); zephir_check_call_status(); - ZEPHIR_CPY_WRT(router, _7$$11); - zephir_update_property_this(getThis(), SL("_router"), router TSRMLS_CC); + ZEPHIR_CPY_WRT(&router, &_8$$11); + zephir_update_property_zval(this_ptr, SL("_router"), &router); } - ZEPHIR_CALL_METHOD(&_9$$9, router, "getroutebyname", NULL, 0, routeName); + ZEPHIR_CALL_METHOD(&_10$$9, &router, "getroutebyname", NULL, 0, &routeName); zephir_check_call_status(); - ZEPHIR_CPY_WRT(route, _9$$9); - if (Z_TYPE_P(route) != IS_OBJECT) { - ZEPHIR_INIT_VAR(_10$$13); - object_init_ex(_10$$13, phalcon_mvc_url_exception_ce); - ZEPHIR_INIT_VAR(_11$$13); - ZEPHIR_CONCAT_SVS(_11$$13, "Cannot obtain a route using the name '", routeName, "'"); - ZEPHIR_CALL_METHOD(NULL, _10$$13, "__construct", NULL, 9, _11$$13); + ZEPHIR_CPY_WRT(&route, &_10$$9); + if (Z_TYPE_P(&route) != IS_OBJECT) { + ZEPHIR_INIT_VAR(&_11$$13); + object_init_ex(&_11$$13, phalcon_mvc_url_exception_ce); + ZEPHIR_INIT_VAR(&_12$$13); + ZEPHIR_CONCAT_SVS(&_12$$13, "Cannot obtain a route using the name '", &routeName, "'"); + ZEPHIR_CALL_METHOD(NULL, &_11$$13, "__construct", NULL, 4, &_12$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_10$$13, "phalcon/mvc/url.zep", 250 TSRMLS_CC); + zephir_throw_exception_debug(&_11$$13, "phalcon/mvc/url.zep", 250 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(_12$$9); - ZEPHIR_CALL_METHOD(&_9$$9, route, "getpattern", NULL, 0); + ZEPHIR_INIT_VAR(&_13$$9); + ZEPHIR_CALL_METHOD(&_10$$9, &route, "getpattern", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_13$$9, route, "getreversedpaths", NULL, 0); + ZEPHIR_CALL_METHOD(&_14$$9, &route, "getreversedpaths", NULL, 0); zephir_check_call_status(); - phalcon_replace_paths(_12$$9, _9$$9, _13$$9, uri TSRMLS_CC); - ZEPHIR_CPY_WRT(uri, _12$$9); + phalcon_replace_paths(&_13$$9, &_10$$9, &_14$$9, uri TSRMLS_CC); + ZEPHIR_CPY_WRT(uri, &_13$$9); } if (zephir_is_true(local)) { - zephir_get_strval(_14$$14, uri); - ZEPHIR_CPY_WRT(strUri, _14$$14); - _15$$14 = ZEPHIR_IS_STRING(baseUri, "/"); - if (_15$$14) { - _15$$14 = zephir_fast_strlen_ev(strUri) > 2; - } - _16$$14 = _15$$14; + zephir_get_strval(&_15$$14, uri); + ZEPHIR_CPY_WRT(&strUri, &_15$$14); + _16$$14 = ZEPHIR_IS_STRING(baseUri, "/"); if (_16$$14) { - _17$$14 = ZEPHIR_STRING_OFFSET(strUri, 0); - _16$$14 = _17$$14 == '/'; + _16$$14 = zephir_fast_strlen_ev(&strUri) > 2; } - _18$$14 = _16$$14; - if (_18$$14) { - _19$$14 = ZEPHIR_STRING_OFFSET(strUri, 1); - _18$$14 = _19$$14 != '/'; + _17$$14 = _16$$14; + if (_17$$14) { + _18$$14 = ZEPHIR_STRING_OFFSET(&strUri, 0); + _17$$14 = _18$$14 == '/'; } - if (_18$$14) { - ZEPHIR_SINIT_VAR(_20$$15); - ZVAL_LONG(&_20$$15, 1); - ZEPHIR_INIT_VAR(_21$$15); - zephir_substr(_21$$15, strUri, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + _19$$14 = _17$$14; + if (_19$$14) { + _20$$14 = ZEPHIR_STRING_OFFSET(&strUri, 1); + _19$$14 = _20$$14 != '/'; + } + if (_19$$14) { + ZVAL_LONG(&_21$$15, 1); + ZEPHIR_INIT_VAR(&_22$$15); + zephir_substr(&_22$$15, &strUri, 1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); ZEPHIR_INIT_NVAR(uri); - ZEPHIR_CONCAT_VV(uri, baseUri, _21$$15); + ZEPHIR_CONCAT_VV(uri, baseUri, &_22$$15); } else { - _22$$16 = ZEPHIR_IS_STRING(baseUri, "/"); - if (_22$$16) { - _22$$16 = zephir_fast_strlen_ev(strUri) == 1; - } - _23$$16 = _22$$16; + _23$$16 = ZEPHIR_IS_STRING(baseUri, "/"); if (_23$$16) { - _24$$16 = ZEPHIR_STRING_OFFSET(strUri, 0); - _23$$16 = _24$$16 == '/'; + _23$$16 = zephir_fast_strlen_ev(&strUri) == 1; } - if (_23$$16) { + _24$$16 = _23$$16; + if (_24$$16) { + _25$$16 = ZEPHIR_STRING_OFFSET(&strUri, 0); + _24$$16 = _25$$16 == '/'; + } + if (_24$$16) { ZEPHIR_CPY_WRT(uri, baseUri); } else { ZEPHIR_INIT_NVAR(uri); - ZEPHIR_CONCAT_VV(uri, baseUri, strUri); + ZEPHIR_CONCAT_VV(uri, baseUri, &strUri); } } } if (zephir_is_true(args)) { - ZEPHIR_CALL_FUNCTION(&queryString, "http_build_query", NULL, 400, args); + ZEPHIR_CALL_FUNCTION(&queryString, "http_build_query", NULL, 354, args); zephir_check_call_status(); - _25$$19 = Z_TYPE_P(queryString) == IS_STRING; - if (_25$$19) { - _25$$19 = ((zephir_fast_strlen_ev(queryString)) ? 1 : 0); + _26$$19 = Z_TYPE_P(&queryString) == IS_STRING; + if (_26$$19) { + _26$$19 = ((zephir_fast_strlen_ev(&queryString)) ? 1 : 0); } - if (_25$$19) { - ZEPHIR_SINIT_VAR(_26$$20); - ZVAL_STRING(&_26$$20, "?", 0); - ZEPHIR_INIT_VAR(_27$$20); - zephir_fast_strpos(_27$$20, uri, &_26$$20, 0 ); - if (!ZEPHIR_IS_FALSE_IDENTICAL(_27$$20)) { - ZEPHIR_INIT_VAR(_28$$21); - ZEPHIR_CONCAT_SV(_28$$21, "&", queryString); - zephir_concat_self(&uri, _28$$21 TSRMLS_CC); + if (_26$$19) { + ZEPHIR_INIT_VAR(&_27$$20); + ZVAL_STRING(&_27$$20, "?"); + ZEPHIR_INIT_VAR(&_28$$20); + zephir_fast_strpos(&_28$$20, uri, &_27$$20, 0 ); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&_28$$20)) { + ZEPHIR_INIT_VAR(&_29$$21); + ZEPHIR_CONCAT_SV(&_29$$21, "&", &queryString); + zephir_concat_self(uri, &_29$$21 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_29$$22); - ZEPHIR_CONCAT_SV(_29$$22, "?", queryString); - zephir_concat_self(&uri, _29$$22 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_30$$22); + ZEPHIR_CONCAT_SV(&_30$$22, "?", &queryString); + zephir_concat_self(uri, &_30$$22 TSRMLS_CC); } } } @@ -483,23 +543,29 @@ PHP_METHOD(Phalcon_Mvc_Url, get) { PHP_METHOD(Phalcon_Mvc_Url, getStatic) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *uri = NULL, *_0 = NULL, *_1, *_2; + zval *uri = NULL, uri_sub, __$null, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uri_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &uri); if (!uri) { - uri = ZEPHIR_GLOBAL(global_null); + uri = &uri_sub; + uri = &__$null; } ZEPHIR_CALL_METHOD(&_0, this_ptr, "getstaticbaseuri", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_1); - ZVAL_NULL(_1); - ZEPHIR_INIT_VAR(_2); - ZVAL_NULL(_2); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0, uri, _1, _2, _0); + ZVAL_NULL(&_1); + ZVAL_NULL(&_2); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0, uri, &_1, &_2, &_0); zephir_check_call_status(); RETURN_MM(); @@ -510,22 +576,26 @@ PHP_METHOD(Phalcon_Mvc_Url, getStatic) { */ PHP_METHOD(Phalcon_Mvc_Url, path) { - zval *path_param = NULL, *_0; - zval *path = NULL; + zval *path_param = NULL, _0; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &path_param); if (!path_param) { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_STRING(&path, ""); } else { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_basePath"), PH_NOISY_CC); - ZEPHIR_CONCAT_VV(return_value, _0, path); + zephir_read_property(&_0, this_ptr, SL("_basePath"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CONCAT_VV(return_value, &_0, &path); RETURN_MM(); } diff --git a/ext/phalcon/mvc/url.zep.h b/ext/phalcon/mvc/url.zep.h index d98d99ba5ee..8156d7c13ad 100644 --- a/ext/phalcon/mvc/url.zep.h +++ b/ext/phalcon/mvc/url.zep.h @@ -19,42 +19,110 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_url_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_url_setbaseuri, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_url_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_url_setbaseuri, 0, 1, Phalcon\\Mvc\\Url, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_setbaseuri, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Url", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, baseUri, IS_STRING, 0) +#else ZEND_ARG_INFO(0, baseUri) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_url_setstaticbaseuri, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_url_setstaticbaseuri, 0, 1, Phalcon\\Mvc\\Url, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_setstaticbaseuri, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Url", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, staticBaseUri, IS_STRING, 0) +#else ZEND_ARG_INFO(0, staticBaseUri) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_getbaseuri, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_getbaseuri, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_url_setbasepath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_getstaticbaseuri, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_getstaticbaseuri, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_url_setbasepath, 0, 1, Phalcon\\Mvc\\Url, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_setbasepath, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\Url", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, basePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, basePath) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_getbasepath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_getbasepath, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_url_get, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_get, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_get, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, uri) ZEND_ARG_INFO(0, args) ZEND_ARG_INFO(0, local) ZEND_ARG_INFO(0, baseUri) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_url_getstatic, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_getstatic, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_getstatic, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, uri) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_url_path, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_path, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_url_path, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 1) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_url_method_entry) { PHP_ME(Phalcon_Mvc_Url, setDI, arginfo_phalcon_mvc_url_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Url, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Url, getDI, arginfo_phalcon_mvc_url_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Url, setBaseUri, arginfo_phalcon_mvc_url_setbaseuri, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Url, setStaticBaseUri, arginfo_phalcon_mvc_url_setstaticbaseuri, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Url, getBaseUri, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Url, getStaticBaseUri, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Url, getBaseUri, arginfo_phalcon_mvc_url_getbaseuri, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Url, getStaticBaseUri, arginfo_phalcon_mvc_url_getstaticbaseuri, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Url, setBasePath, arginfo_phalcon_mvc_url_setbasepath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_Url, getBasePath, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_Url, getBasePath, arginfo_phalcon_mvc_url_getbasepath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Url, get, arginfo_phalcon_mvc_url_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Url, getStatic, arginfo_phalcon_mvc_url_getstatic, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_Url, path, arginfo_phalcon_mvc_url_path, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/mvc/urlinterface.zep.h b/ext/phalcon/mvc/urlinterface.zep.h index f5b177ed691..23f07e9e470 100644 --- a/ext/phalcon/mvc/urlinterface.zep.h +++ b/ext/phalcon/mvc/urlinterface.zep.h @@ -4,29 +4,63 @@ extern zend_class_entry *phalcon_mvc_urlinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_UrlInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_urlinterface_setbaseuri, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, baseUri, IS_STRING, 0) +#else ZEND_ARG_INFO(0, baseUri) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_urlinterface_getbaseuri, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_urlinterface_getbaseuri, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_urlinterface_setbasepath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, basePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, basePath) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_urlinterface_getbasepath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_urlinterface_getbasepath, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_urlinterface_get, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_urlinterface_get, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_urlinterface_get, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, uri) ZEND_ARG_INFO(0, args) ZEND_ARG_INFO(0, local) ZEND_ARG_INFO(0, baseUri) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_urlinterface_path, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_urlinterface_path, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_urlinterface_path, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 1) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_urlinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_UrlInterface, setBaseUri, arginfo_phalcon_mvc_urlinterface_setbaseuri) - PHP_ABSTRACT_ME(Phalcon_Mvc_UrlInterface, getBaseUri, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_UrlInterface, getBaseUri, arginfo_phalcon_mvc_urlinterface_getbaseuri) PHP_ABSTRACT_ME(Phalcon_Mvc_UrlInterface, setBasePath, arginfo_phalcon_mvc_urlinterface_setbasepath) - PHP_ABSTRACT_ME(Phalcon_Mvc_UrlInterface, getBasePath, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_UrlInterface, getBasePath, arginfo_phalcon_mvc_urlinterface_getbasepath) PHP_ABSTRACT_ME(Phalcon_Mvc_UrlInterface, get, arginfo_phalcon_mvc_urlinterface_get) PHP_ABSTRACT_ME(Phalcon_Mvc_UrlInterface, path, arginfo_phalcon_mvc_urlinterface_path) PHP_FE_END diff --git a/ext/phalcon/mvc/view.zep.c b/ext/phalcon/mvc/view.zep.c index 10dc226f582..38dcc413769 100644 --- a/ext/phalcon/mvc/view.zep.c +++ b/ext/phalcon/mvc/view.zep.c @@ -110,43 +110,43 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_View) { * Render Level: To the main layout * */ - zend_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_MAIN_LAYOUT"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_MAIN_LAYOUT"), 5); /** * Render Level: Render to the templates "after" * */ - zend_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_AFTER_TEMPLATE"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_AFTER_TEMPLATE"), 4); /** * Render Level: To the controller layout * */ - zend_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_LAYOUT"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_LAYOUT"), 3); /** * Render Level: To the templates "before" * */ - zend_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_BEFORE_TEMPLATE"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_BEFORE_TEMPLATE"), 2); /** * Render Level: To the action view */ - zend_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_ACTION_VIEW"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_ACTION_VIEW"), 1); /** * Render Level: No render any view * */ - zend_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_NO_RENDER"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_view_ce, SL("LEVEL_NO_RENDER"), 0); /** * Cache Mode */ - zend_declare_class_constant_long(phalcon_mvc_view_ce, SL("CACHE_MODE_NONE"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_view_ce, SL("CACHE_MODE_NONE"), 0); - zend_declare_class_constant_long(phalcon_mvc_view_ce, SL("CACHE_MODE_INVERSE"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_mvc_view_ce, SL("CACHE_MODE_INVERSE"), 1); zend_class_implements(phalcon_mvc_view_ce TSRMLS_CC, 1, phalcon_mvc_viewinterface_ce); return SUCCESS; @@ -155,7 +155,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_View) { PHP_METHOD(Phalcon_Mvc_View, getRenderLevel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_renderLevel"); @@ -163,7 +164,8 @@ PHP_METHOD(Phalcon_Mvc_View, getRenderLevel) { PHP_METHOD(Phalcon_Mvc_View, getCurrentRenderLevel) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_currentRenderLevel"); @@ -173,7 +175,8 @@ PHP_METHOD(Phalcon_Mvc_View, getCurrentRenderLevel) { */ PHP_METHOD(Phalcon_Mvc_View, getRegisteredEngines) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_registeredEngines"); @@ -185,20 +188,23 @@ PHP_METHOD(Phalcon_Mvc_View, getRegisteredEngines) { PHP_METHOD(Phalcon_Mvc_View, __construct) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options_param); if (!options_param) { - ZEPHIR_INIT_VAR(options); - array_init(options); + ZEPHIR_INIT_VAR(&options); + array_init(&options); } else { - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); } - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &options); ZEPHIR_MM_RESTORE(); } @@ -210,33 +216,37 @@ PHP_METHOD(Phalcon_Mvc_View, _isAbsolutePath) { unsigned char _6, _2$$3, _4$$3; zend_bool _5, _1$$3, _3$$3; - zval *path_param = NULL, *_0; - zval *path = NULL; + zval *path_param = NULL, _0; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &path_param); - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_GET_CONSTANT(_0, "PHP_OS"); - if (ZEPHIR_IS_STRING(_0, "WINNT")) { - _1$$3 = zephir_fast_strlen_ev(path) >= 3; + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_GET_CONSTANT(&_0, "PHP_OS"); + if (ZEPHIR_IS_STRING(&_0, "WINNT")) { + _1$$3 = zephir_fast_strlen_ev(&path) >= 3; if (_1$$3) { - _2$$3 = ZEPHIR_STRING_OFFSET(path, 1); + _2$$3 = ZEPHIR_STRING_OFFSET(&path, 1); _1$$3 = _2$$3 == ':'; } _3$$3 = _1$$3; if (_3$$3) { - _4$$3 = ZEPHIR_STRING_OFFSET(path, 2); + _4$$3 = ZEPHIR_STRING_OFFSET(&path, 2); _3$$3 = _4$$3 == '\\'; } RETURN_MM_BOOL(_3$$3); } - _5 = zephir_fast_strlen_ev(path) >= 1; + _5 = zephir_fast_strlen_ev(&path) >= 1; if (_5) { - _6 = ZEPHIR_STRING_OFFSET(path, 0); + _6 = ZEPHIR_STRING_OFFSET(&path, 0); _5 = _6 == '/'; } RETURN_MM_BOOL(_5); @@ -249,10 +259,23 @@ PHP_METHOD(Phalcon_Mvc_View, _isAbsolutePath) { */ PHP_METHOD(Phalcon_Mvc_View, setViewsDir) { - HashTable *_5$$6; - HashPosition _4$$6; + zend_string *_6$$6; + zend_ulong _5$$6; zend_bool _0; - zval *viewsDir = NULL, *position = NULL, *directory = NULL, *directorySeparator = NULL, *newViewsDir = NULL, _1$$4, *_2$$4, *_3$$5, **_6$$6, _7$$7 = zval_used_for_init, *_8$$7 = NULL, *_9$$9 = NULL; + zval *viewsDir = NULL, viewsDir_sub, position, directory, directorySeparator, newViewsDir, _1$$4, _2$$4, _3$$5, *_4$$6, _7$$7, _8$$7, _9$$9; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewsDir_sub); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(&directory); + ZVAL_UNDEF(&directorySeparator); + ZVAL_UNDEF(&newViewsDir); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_9$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &viewsDir); @@ -268,46 +291,50 @@ PHP_METHOD(Phalcon_Mvc_View, setViewsDir) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "Views directory must be a string or an array", "phalcon/mvc/view.zep", 179); return; } - ZEPHIR_INIT_VAR(directorySeparator); - ZVAL_STRING(directorySeparator, "/", 1); + ZEPHIR_INIT_VAR(&directorySeparator); + ZVAL_STRING(&directorySeparator, "/"); if (Z_TYPE_P(viewsDir) == IS_STRING) { - ZEPHIR_SINIT_VAR(_1$$4); ZVAL_LONG(&_1$$4, -1); - ZEPHIR_INIT_VAR(_2$$4); - zephir_substr(_2$$4, viewsDir, -1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - if (!ZEPHIR_IS_EQUAL(_2$$4, directorySeparator)) { - ZEPHIR_INIT_VAR(_3$$5); - ZEPHIR_CONCAT_VV(_3$$5, viewsDir, directorySeparator); - ZEPHIR_CPY_WRT(viewsDir, _3$$5); + ZEPHIR_INIT_VAR(&_2$$4); + zephir_substr(&_2$$4, viewsDir, -1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + if (!ZEPHIR_IS_EQUAL(&_2$$4, &directorySeparator)) { + ZEPHIR_INIT_VAR(&_3$$5); + ZEPHIR_CONCAT_VV(&_3$$5, viewsDir, &directorySeparator); + ZEPHIR_CPY_WRT(viewsDir, &_3$$5); } - zephir_update_property_this(getThis(), SL("_viewsDirs"), viewsDir TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_viewsDirs"), viewsDir); } else { - ZEPHIR_INIT_VAR(newViewsDir); - array_init(newViewsDir); - zephir_is_iterable(viewsDir, &_5$$6, &_4$$6, 0, 0, "phalcon/mvc/view.zep", 206); - for ( - ; zend_hash_get_current_data_ex(_5$$6, (void**) &_6$$6, &_4$$6) == SUCCESS - ; zend_hash_move_forward_ex(_5$$6, &_4$$6) - ) { - ZEPHIR_GET_HMKEY(position, _5$$6, _4$$6); - ZEPHIR_GET_HVALUE(directory, _6$$6); - if (Z_TYPE_P(directory) != IS_STRING) { + ZEPHIR_INIT_VAR(&newViewsDir); + array_init(&newViewsDir); + zephir_is_iterable(viewsDir, 0, "phalcon/mvc/view.zep", 206); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(viewsDir), _5$$6, _6$$6, _4$$6) + { + ZEPHIR_INIT_NVAR(&position); + if (_6$$6 != NULL) { + ZVAL_STR_COPY(&position, _6$$6); + } else { + ZVAL_LONG(&position, _5$$6); + } + ZEPHIR_INIT_NVAR(&directory); + ZVAL_COPY(&directory, _4$$6); + if (Z_TYPE_P(&directory) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "Views directory item must be a string", "phalcon/mvc/view.zep", 196); return; } - ZEPHIR_SINIT_NVAR(_7$$7); ZVAL_LONG(&_7$$7, -1); - ZEPHIR_INIT_NVAR(_8$$7); - zephir_substr(_8$$7, directory, -1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); - if (!ZEPHIR_IS_EQUAL(_8$$7, directorySeparator)) { + ZEPHIR_INIT_NVAR(&_8$$7); + zephir_substr(&_8$$7, &directory, -1 , 0, ZEPHIR_SUBSTR_NO_LENGTH); + if (!ZEPHIR_IS_EQUAL(&_8$$7, &directorySeparator)) { ZEPHIR_INIT_LNVAR(_9$$9); - ZEPHIR_CONCAT_VV(_9$$9, directory, directorySeparator); - zephir_array_update_zval(&newViewsDir, position, &_9$$9, PH_COPY | PH_SEPARATE); + ZEPHIR_CONCAT_VV(&_9$$9, &directory, &directorySeparator); + zephir_array_update_zval(&newViewsDir, &position, &_9$$9, PH_COPY | PH_SEPARATE); } else { - zephir_array_update_zval(&newViewsDir, position, &directory, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&newViewsDir, &position, &directory, PH_COPY | PH_SEPARATE); } - } - zephir_update_property_this(getThis(), SL("_viewsDirs"), newViewsDir TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&directory); + ZEPHIR_INIT_NVAR(&position); + zephir_update_property_zval(this_ptr, SL("_viewsDirs"), &newViewsDir); } RETURN_THIS(); @@ -318,7 +345,8 @@ PHP_METHOD(Phalcon_Mvc_View, setViewsDir) { */ PHP_METHOD(Phalcon_Mvc_View, getViewsDir) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_viewsDirs"); @@ -335,15 +363,18 @@ PHP_METHOD(Phalcon_Mvc_View, getViewsDir) { PHP_METHOD(Phalcon_Mvc_View, setLayoutsDir) { zval *layoutsDir_param = NULL; - zval *layoutsDir = NULL; + zval layoutsDir; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&layoutsDir); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &layoutsDir_param); - zephir_get_strval(layoutsDir, layoutsDir_param); + zephir_get_strval(&layoutsDir, layoutsDir_param); - zephir_update_property_this(getThis(), SL("_layoutsDir"), layoutsDir TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_layoutsDir"), &layoutsDir); RETURN_THIS(); } @@ -353,7 +384,8 @@ PHP_METHOD(Phalcon_Mvc_View, setLayoutsDir) { */ PHP_METHOD(Phalcon_Mvc_View, getLayoutsDir) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_layoutsDir"); @@ -370,15 +402,18 @@ PHP_METHOD(Phalcon_Mvc_View, getLayoutsDir) { PHP_METHOD(Phalcon_Mvc_View, setPartialsDir) { zval *partialsDir_param = NULL; - zval *partialsDir = NULL; + zval partialsDir; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&partialsDir); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &partialsDir_param); - zephir_get_strval(partialsDir, partialsDir_param); + zephir_get_strval(&partialsDir, partialsDir_param); - zephir_update_property_this(getThis(), SL("_partialsDir"), partialsDir TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_partialsDir"), &partialsDir); RETURN_THIS(); } @@ -388,7 +423,8 @@ PHP_METHOD(Phalcon_Mvc_View, setPartialsDir) { */ PHP_METHOD(Phalcon_Mvc_View, getPartialsDir) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_partialsDir"); @@ -404,15 +440,18 @@ PHP_METHOD(Phalcon_Mvc_View, getPartialsDir) { PHP_METHOD(Phalcon_Mvc_View, setBasePath) { zval *basePath_param = NULL; - zval *basePath = NULL; + zval basePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&basePath); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &basePath_param); - zephir_get_strval(basePath, basePath_param); + zephir_get_strval(&basePath, basePath_param); - zephir_update_property_this(getThis(), SL("_basePath"), basePath TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_basePath"), &basePath); RETURN_THIS(); } @@ -422,7 +461,8 @@ PHP_METHOD(Phalcon_Mvc_View, setBasePath) { */ PHP_METHOD(Phalcon_Mvc_View, getBasePath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_basePath"); @@ -440,8 +480,11 @@ PHP_METHOD(Phalcon_Mvc_View, getBasePath) { */ PHP_METHOD(Phalcon_Mvc_View, setRenderLevel) { - zval *level_param = NULL, *_0; + zval *level_param = NULL, _0; zend_long level; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &level_param); @@ -449,8 +492,8 @@ PHP_METHOD(Phalcon_Mvc_View, setRenderLevel) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, level); - zephir_update_property_this(getThis(), SL("_renderLevel"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, level); + zephir_update_property_zval(this_ptr, SL("_renderLevel"), &_0); RETURN_THISW(); } @@ -467,16 +510,20 @@ PHP_METHOD(Phalcon_Mvc_View, setRenderLevel) { */ PHP_METHOD(Phalcon_Mvc_View, disableLevel) { - zval *level; + zval *level, level_sub, __$true; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&level_sub); + ZVAL_BOOL(&__$true, 1); zephir_fetch_params(0, 1, 0, &level); if (Z_TYPE_P(level) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_disabledLevels"), level TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_disabledLevels"), level); } else { - zephir_update_property_array(this_ptr, SL("_disabledLevels"), level, ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_disabledLevels"), level, &__$true TSRMLS_CC); } RETURN_THISW(); @@ -493,15 +540,18 @@ PHP_METHOD(Phalcon_Mvc_View, disableLevel) { PHP_METHOD(Phalcon_Mvc_View, setMainView) { zval *viewPath_param = NULL; - zval *viewPath = NULL; + zval viewPath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewPath); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &viewPath_param); - zephir_get_strval(viewPath, viewPath_param); + zephir_get_strval(&viewPath, viewPath_param); - zephir_update_property_this(getThis(), SL("_mainView"), viewPath TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_mainView"), &viewPath); RETURN_THIS(); } @@ -511,7 +561,8 @@ PHP_METHOD(Phalcon_Mvc_View, setMainView) { */ PHP_METHOD(Phalcon_Mvc_View, getMainView) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_mainView"); @@ -527,15 +578,18 @@ PHP_METHOD(Phalcon_Mvc_View, getMainView) { PHP_METHOD(Phalcon_Mvc_View, setLayout) { zval *layout_param = NULL; - zval *layout = NULL; + zval layout; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&layout); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &layout_param); - zephir_get_strval(layout, layout_param); + zephir_get_strval(&layout, layout_param); - zephir_update_property_this(getThis(), SL("_layout"), layout TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_layout"), &layout); RETURN_THIS(); } @@ -545,7 +599,8 @@ PHP_METHOD(Phalcon_Mvc_View, setLayout) { */ PHP_METHOD(Phalcon_Mvc_View, getLayout) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_layout"); @@ -556,8 +611,12 @@ PHP_METHOD(Phalcon_Mvc_View, getLayout) { */ PHP_METHOD(Phalcon_Mvc_View, setTemplateBefore) { - zval *_0$$3; - zval *templateBefore; + zval _0$$3; + zval *templateBefore, templateBefore_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&templateBefore_sub); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &templateBefore); @@ -565,12 +624,12 @@ PHP_METHOD(Phalcon_Mvc_View, setTemplateBefore) { if (Z_TYPE_P(templateBefore) != IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_create_array(_0$$3, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_0$$3, templateBefore); - zephir_update_property_this(getThis(), SL("_templatesBefore"), _0$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_create_array(&_0$$3, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_0$$3, templateBefore); + zephir_update_property_zval(this_ptr, SL("_templatesBefore"), &_0$$3); } else { - zephir_update_property_this(getThis(), SL("_templatesBefore"), templateBefore TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_templatesBefore"), templateBefore); } RETURN_THIS(); @@ -581,13 +640,16 @@ PHP_METHOD(Phalcon_Mvc_View, setTemplateBefore) { */ PHP_METHOD(Phalcon_Mvc_View, cleanTemplateBefore) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_templatesBefore"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_templatesBefore"), &_0); RETURN_THIS(); } @@ -597,8 +659,12 @@ PHP_METHOD(Phalcon_Mvc_View, cleanTemplateBefore) { */ PHP_METHOD(Phalcon_Mvc_View, setTemplateAfter) { - zval *_0$$3; - zval *templateAfter; + zval _0$$3; + zval *templateAfter, templateAfter_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&templateAfter_sub); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &templateAfter); @@ -606,12 +672,12 @@ PHP_METHOD(Phalcon_Mvc_View, setTemplateAfter) { if (Z_TYPE_P(templateAfter) != IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$3); - zephir_create_array(_0$$3, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_0$$3, templateAfter); - zephir_update_property_this(getThis(), SL("_templatesAfter"), _0$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_create_array(&_0$$3, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_0$$3, templateAfter); + zephir_update_property_zval(this_ptr, SL("_templatesAfter"), &_0$$3); } else { - zephir_update_property_this(getThis(), SL("_templatesAfter"), templateAfter TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_templatesAfter"), templateAfter); } RETURN_THIS(); @@ -622,13 +688,16 @@ PHP_METHOD(Phalcon_Mvc_View, setTemplateAfter) { */ PHP_METHOD(Phalcon_Mvc_View, cleanTemplateAfter) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_templatesAfter"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_templatesAfter"), &_0); RETURN_THIS(); } @@ -642,25 +711,29 @@ PHP_METHOD(Phalcon_Mvc_View, cleanTemplateAfter) { */ PHP_METHOD(Phalcon_Mvc_View, setParamToView) { - zval *key_param = NULL, *value; - zval *key = NULL; + zval *key_param = NULL, *value, value_sub; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &value); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - zephir_update_property_array(this_ptr, SL("_viewParams"), key, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_viewParams"), &key, value TSRMLS_CC); RETURN_THIS(); } @@ -679,13 +752,18 @@ PHP_METHOD(Phalcon_Mvc_View, setParamToView) { PHP_METHOD(Phalcon_Mvc_View, setVars) { zend_bool merge; - zval *params_param = NULL, *merge_param = NULL, *_0$$3, *_1$$3; - zval *params = NULL; + zval *params_param = NULL, *merge_param = NULL, _0$$3, _1$$3; + zval params; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, ¶ms_param, &merge_param); - params = params_param; + ZEPHIR_OBS_COPY_OR_DUP(¶ms, params_param); if (!merge_param) { merge = 1; } else { @@ -694,12 +772,12 @@ PHP_METHOD(Phalcon_Mvc_View, setVars) { if (merge) { - ZEPHIR_INIT_VAR(_0$$3); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_viewParams"), PH_NOISY_CC); - zephir_fast_array_merge(_0$$3, &(_1$$3), &(params) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_viewParams"), _0$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_read_property(&_1$$3, this_ptr, SL("_viewParams"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_0$$3, &_1$$3, ¶ms TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_viewParams"), &_0$$3); } else { - zephir_update_property_this(getThis(), SL("_viewParams"), params TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_viewParams"), ¶ms); } RETURN_THIS(); @@ -714,25 +792,29 @@ PHP_METHOD(Phalcon_Mvc_View, setVars) { */ PHP_METHOD(Phalcon_Mvc_View, setVar) { - zval *key_param = NULL, *value; - zval *key = NULL; + zval *key_param = NULL, *value, value_sub; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &value); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - zephir_update_property_array(this_ptr, SL("_viewParams"), key, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_viewParams"), &key, value TSRMLS_CC); RETURN_THIS(); } @@ -742,29 +824,34 @@ PHP_METHOD(Phalcon_Mvc_View, setVar) { */ PHP_METHOD(Phalcon_Mvc_View, getVar) { - zval *key_param = NULL, *value = NULL, *_0; - zval *key = NULL; + zval *key_param = NULL, value, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_viewParams"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(&value, _0, key, 1 TSRMLS_CC))) { + zephir_read_property(&_0, this_ptr, SL("_viewParams"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&value, &_0, &key, 1 TSRMLS_CC))) { RETURN_MM_NULL(); } - RETURN_CTOR(value); + RETURN_CTOR(&value); } @@ -773,7 +860,8 @@ PHP_METHOD(Phalcon_Mvc_View, getVar) { */ PHP_METHOD(Phalcon_Mvc_View, getParamsToView) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_viewParams"); @@ -784,7 +872,8 @@ PHP_METHOD(Phalcon_Mvc_View, getParamsToView) { */ PHP_METHOD(Phalcon_Mvc_View, getControllerName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_controllerName"); @@ -795,7 +884,8 @@ PHP_METHOD(Phalcon_Mvc_View, getControllerName) { */ PHP_METHOD(Phalcon_Mvc_View, getActionName) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_actionName"); @@ -808,7 +898,8 @@ PHP_METHOD(Phalcon_Mvc_View, getActionName) { */ PHP_METHOD(Phalcon_Mvc_View, getParams) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_params"); @@ -819,13 +910,17 @@ PHP_METHOD(Phalcon_Mvc_View, getParams) { */ PHP_METHOD(Phalcon_Mvc_View, start) { + zval __$null; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 140); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 121); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_content"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_content"), &__$null); RETURN_THIS(); } @@ -835,75 +930,95 @@ PHP_METHOD(Phalcon_Mvc_View, start) { */ PHP_METHOD(Phalcon_Mvc_View, _loadTemplateEngines) { - HashTable *_3$$5; - HashPosition _2$$5; - zval *engines = NULL, *dependencyInjector = NULL, *registeredEngines = NULL, *arguments = NULL, *engineService = NULL, *extension = NULL, *_0$$3, *_1$$4, **_4$$5, *_5$$9 = NULL, *_6$$12 = NULL, *_7$$12 = NULL, *_9$$11 = NULL; + zend_string *_4$$5; + zend_ulong _3$$5; + zval engines, dependencyInjector, registeredEngines, arguments, engineService, extension, _0$$3, _1$$4, *_2$$5, _5$$9, _6$$12, _7$$12, _9$$11; zephir_fcall_cache_entry *_8 = NULL, *_10 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&engines); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(®isteredEngines); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&engineService); + ZVAL_UNDEF(&extension); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_6$$12); + ZVAL_UNDEF(&_7$$12); + ZVAL_UNDEF(&_9$$11); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(engines); - zephir_read_property_this(&engines, this_ptr, SL("_engines"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(engines)) { - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0$$3); - ZEPHIR_INIT_NVAR(engines); - array_init(engines); - ZEPHIR_OBS_VAR(registeredEngines); - zephir_read_property_this(®isteredEngines, this_ptr, SL("_registeredEngines"), PH_NOISY_CC); - if (Z_TYPE_P(registeredEngines) != IS_ARRAY) { - ZEPHIR_INIT_VAR(_1$$4); - object_init_ex(_1$$4, phalcon_mvc_view_engine_php_ce); - ZEPHIR_CALL_METHOD(NULL, _1$$4, "__construct", NULL, 401, this_ptr, dependencyInjector); + ZEPHIR_OBS_VAR(&engines); + zephir_read_property(&engines, this_ptr, SL("_engines"), PH_NOISY_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&engines)) { + zephir_read_property(&_0$$3, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0$$3); + ZEPHIR_INIT_NVAR(&engines); + array_init(&engines); + ZEPHIR_OBS_VAR(®isteredEngines); + zephir_read_property(®isteredEngines, this_ptr, SL("_registeredEngines"), PH_NOISY_CC); + if (Z_TYPE_P(®isteredEngines) != IS_ARRAY) { + ZEPHIR_INIT_VAR(&_1$$4); + object_init_ex(&_1$$4, phalcon_mvc_view_engine_php_ce); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 355, this_ptr, &dependencyInjector); zephir_check_call_status(); zephir_array_update_string(&engines, SL(".phtml"), &_1$$4, PH_COPY | PH_SEPARATE); } else { - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the application services", "phalcon/mvc/view.zep", 542); return; } - ZEPHIR_INIT_VAR(arguments); - zephir_create_array(arguments, 2, 0 TSRMLS_CC); - zephir_array_fast_append(arguments, this_ptr); - zephir_array_fast_append(arguments, dependencyInjector); - zephir_is_iterable(registeredEngines, &_3$$5, &_2$$5, 0, 0, "phalcon/mvc/view.zep", 571); - for ( - ; zend_hash_get_current_data_ex(_3$$5, (void**) &_4$$5, &_2$$5) == SUCCESS - ; zend_hash_move_forward_ex(_3$$5, &_2$$5) - ) { - ZEPHIR_GET_HMKEY(extension, _3$$5, _2$$5); - ZEPHIR_GET_HVALUE(engineService, _4$$5); - if (Z_TYPE_P(engineService) == IS_OBJECT) { - if (zephir_instance_of_ev(engineService, zend_ce_closure TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(_5$$9); - ZEPHIR_CALL_USER_FUNC_ARRAY(_5$$9, engineService, arguments); + ZEPHIR_INIT_VAR(&arguments); + zephir_create_array(&arguments, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&arguments, this_ptr); + zephir_array_fast_append(&arguments, &dependencyInjector); + zephir_is_iterable(®isteredEngines, 0, "phalcon/mvc/view.zep", 571); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(®isteredEngines), _3$$5, _4$$5, _2$$5) + { + ZEPHIR_INIT_NVAR(&extension); + if (_4$$5 != NULL) { + ZVAL_STR_COPY(&extension, _4$$5); + } else { + ZVAL_LONG(&extension, _3$$5); + } + ZEPHIR_INIT_NVAR(&engineService); + ZVAL_COPY(&engineService, _2$$5); + if (Z_TYPE_P(&engineService) == IS_OBJECT) { + if (zephir_instance_of_ev(&engineService, zend_ce_closure TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&_5$$9); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_5$$9, &engineService, &arguments); zephir_check_call_status(); - zephir_array_update_zval(&engines, extension, &_5$$9, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&engines, &extension, &_5$$9, PH_COPY | PH_SEPARATE); } else { - zephir_array_update_zval(&engines, extension, &engineService, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&engines, &extension, &engineService, PH_COPY | PH_SEPARATE); } } else { - if (Z_TYPE_P(engineService) != IS_STRING) { - ZEPHIR_INIT_NVAR(_6$$12); - object_init_ex(_6$$12, phalcon_mvc_view_exception_ce); + if (Z_TYPE_P(&engineService) != IS_STRING) { + ZEPHIR_INIT_NVAR(&_6$$12); + object_init_ex(&_6$$12, phalcon_mvc_view_exception_ce); ZEPHIR_INIT_LNVAR(_7$$12); - ZEPHIR_CONCAT_SV(_7$$12, "Invalid template engine registration for extension: ", extension); - ZEPHIR_CALL_METHOD(NULL, _6$$12, "__construct", &_8, 9, _7$$12); + ZEPHIR_CONCAT_SV(&_7$$12, "Invalid template engine registration for extension: ", &extension); + ZEPHIR_CALL_METHOD(NULL, &_6$$12, "__construct", &_8, 4, &_7$$12); zephir_check_call_status(); - zephir_throw_exception_debug(_6$$12, "phalcon/mvc/view.zep", 565 TSRMLS_CC); + zephir_throw_exception_debug(&_6$$12, "phalcon/mvc/view.zep", 565 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_9$$11, dependencyInjector, "getshared", &_10, 0, engineService, arguments); + ZEPHIR_CALL_METHOD(&_9$$11, &dependencyInjector, "getshared", &_10, 0, &engineService, &arguments); zephir_check_call_status(); - zephir_array_update_zval(&engines, extension, &_9$$11, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&engines, &extension, &_9$$11, PH_COPY | PH_SEPARATE); } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&engineService); + ZEPHIR_INIT_NVAR(&extension); } - zephir_update_property_this(getThis(), SL("_engines"), engines TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_engines"), &engines); } - RETURN_CCTOR(engines); + RETURN_CCTOR(&engines); } @@ -918,157 +1033,195 @@ PHP_METHOD(Phalcon_Mvc_View, _loadTemplateEngines) { */ PHP_METHOD(Phalcon_Mvc_View, _engineRender) { - zval *_17$$16 = NULL; - HashTable *_3, *_15$$3; - HashPosition _2, _14$$3; - zephir_fcall_cache_entry *_6 = NULL, *_10 = NULL, *_11 = NULL, *_13 = NULL, *_20 = NULL, *_23 = NULL; + zval _15$$16; + zend_string *_14$$3; + zend_ulong _13$$3; + zephir_fcall_cache_entry *_4 = NULL, *_8 = NULL, *_9 = NULL, *_11 = NULL, *_18 = NULL, *_21 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, renderLevel = 0, cacheLevel = 0; zend_bool silence, mustClean, notExists = 0; - zval *viewPath = NULL, *_26$$21; - zval *engines, *viewPath_param = NULL, *silence_param = NULL, *mustClean_param = NULL, *cache = NULL, *key = NULL, *lifetime = NULL, *viewsDir = NULL, *basePath = NULL, *viewsDirPath = NULL, *viewOptions = NULL, *cacheOptions = NULL, *cachedView = NULL, *viewParams = NULL, *eventsManager = NULL, *extension = NULL, *engine = NULL, *viewEnginePath = NULL, *viewEnginePaths = NULL, *_0, *_1 = NULL, **_4, *_5$$3 = NULL, **_16$$3, *_7$$6 = NULL, *_8$$6 = NULL, *_9$$7 = NULL, *_12$$7 = NULL, *_18$$16 = NULL, *_19$$16 = NULL, *_21$$15 = NULL, *_22$$18 = NULL, *_24$$20, *_25$$21; + zval viewPath, _24$$21; + zval *engines, engines_sub, *viewPath_param = NULL, *silence_param = NULL, *mustClean_param = NULL, *cache = NULL, cache_sub, __$null, key, lifetime, viewsDir, basePath, viewsDirPath, viewOptions, cacheOptions, cachedView, viewParams, eventsManager, extension, engine, viewEnginePath, viewEnginePaths, _0, _1, *_2, _3$$3, *_12$$3, _5$$6, _6$$6, _7$$7, _10$$7, _16$$16, _17$$16, _19$$15, _20$$18, _22$$20, _23$$21; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&engines_sub); + ZVAL_UNDEF(&cache_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&lifetime); + ZVAL_UNDEF(&viewsDir); + ZVAL_UNDEF(&basePath); + ZVAL_UNDEF(&viewsDirPath); + ZVAL_UNDEF(&viewOptions); + ZVAL_UNDEF(&cacheOptions); + ZVAL_UNDEF(&cachedView); + ZVAL_UNDEF(&viewParams); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&extension); + ZVAL_UNDEF(&engine); + ZVAL_UNDEF(&viewEnginePath); + ZVAL_UNDEF(&viewEnginePaths); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_16$$16); + ZVAL_UNDEF(&_17$$16); + ZVAL_UNDEF(&_19$$15); + ZVAL_UNDEF(&_20$$18); + ZVAL_UNDEF(&_22$$20); + ZVAL_UNDEF(&_23$$21); + ZVAL_UNDEF(&viewPath); + ZVAL_UNDEF(&_24$$21); + ZVAL_UNDEF(&_15$$16); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 1, &engines, &viewPath_param, &silence_param, &mustClean_param, &cache); - zephir_get_strval(viewPath, viewPath_param); + zephir_get_strval(&viewPath, viewPath_param); silence = zephir_get_boolval(silence_param); mustClean = zephir_get_boolval(mustClean_param); if (!cache) { - cache = ZEPHIR_GLOBAL(global_null); + cache = &cache_sub; + cache = &__$null; } notExists = 1; - ZEPHIR_OBS_VAR(basePath); - zephir_read_property_this(&basePath, this_ptr, SL("_basePath"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(viewParams); - zephir_read_property_this(&viewParams, this_ptr, SL("_viewParams"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _0); - ZEPHIR_INIT_VAR(viewEnginePaths); - array_init(viewEnginePaths); + ZEPHIR_OBS_VAR(&basePath); + zephir_read_property(&basePath, this_ptr, SL("_basePath"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&viewParams); + zephir_read_property(&viewParams, this_ptr, SL("_viewParams"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_0); + ZEPHIR_INIT_VAR(&viewEnginePaths); + array_init(&viewEnginePaths); ZEPHIR_CALL_METHOD(&_1, this_ptr, "getviewsdirs", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_1, &_3, &_2, 0, 0, "phalcon/mvc/view.zep", 698); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HVALUE(viewsDir, _4); - ZEPHIR_CALL_METHOD(&_5$$3, this_ptr, "_isabsolutepath", &_6, 402, viewPath); + zephir_is_iterable(&_1, 0, "phalcon/mvc/view.zep", 698); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_1), _2) + { + ZEPHIR_INIT_NVAR(&viewsDir); + ZVAL_COPY(&viewsDir, _2); + ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "_isabsolutepath", &_4, 356, &viewPath); zephir_check_call_status(); - if (!(zephir_is_true(_5$$3))) { - ZEPHIR_INIT_NVAR(viewsDirPath); - ZEPHIR_CONCAT_VVV(viewsDirPath, basePath, viewsDir, viewPath); + if (!(zephir_is_true(&_3$$3))) { + ZEPHIR_INIT_NVAR(&viewsDirPath); + ZEPHIR_CONCAT_VVV(&viewsDirPath, &basePath, &viewsDir, &viewPath); } else { - ZEPHIR_CPY_WRT(viewsDirPath, viewPath); + ZEPHIR_CPY_WRT(&viewsDirPath, &viewPath); } if (Z_TYPE_P(cache) == IS_OBJECT) { - ZEPHIR_OBS_NVAR(_7$$6); - zephir_read_property_this(&_7$$6, this_ptr, SL("_renderLevel"), PH_NOISY_CC); - renderLevel = zephir_get_intval(_7$$6); - ZEPHIR_OBS_NVAR(_8$$6); - zephir_read_property_this(&_8$$6, this_ptr, SL("_cacheLevel"), PH_NOISY_CC); - cacheLevel = zephir_get_intval(_8$$6); + ZEPHIR_OBS_NVAR(&_5$$6); + zephir_read_property(&_5$$6, this_ptr, SL("_renderLevel"), PH_NOISY_CC); + renderLevel = zephir_get_intval(&_5$$6); + ZEPHIR_OBS_NVAR(&_6$$6); + zephir_read_property(&_6$$6, this_ptr, SL("_cacheLevel"), PH_NOISY_CC); + cacheLevel = zephir_get_intval(&_6$$6); if (renderLevel >= cacheLevel) { - ZEPHIR_CALL_METHOD(&_9$$7, cache, "isstarted", &_10, 0); + ZEPHIR_CALL_METHOD(&_7$$7, cache, "isstarted", &_8, 0); zephir_check_call_status(); - if (!(zephir_is_true(_9$$7))) { - ZEPHIR_INIT_NVAR(key); - ZVAL_NULL(key); - ZEPHIR_INIT_NVAR(lifetime); - ZVAL_NULL(lifetime); - ZEPHIR_OBS_NVAR(viewOptions); - zephir_read_property_this(&viewOptions, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_NVAR(cacheOptions); - if (zephir_array_isset_string_fetch(&cacheOptions, viewOptions, SS("cache"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(cacheOptions) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(key); - zephir_array_isset_string_fetch(&key, cacheOptions, SS("key"), 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(lifetime); - zephir_array_isset_string_fetch(&lifetime, cacheOptions, SS("lifetime"), 0 TSRMLS_CC); + if (!(zephir_is_true(&_7$$7))) { + ZEPHIR_INIT_NVAR(&key); + ZVAL_NULL(&key); + ZEPHIR_INIT_NVAR(&lifetime); + ZVAL_NULL(&lifetime); + ZEPHIR_OBS_NVAR(&viewOptions); + zephir_read_property(&viewOptions, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&cacheOptions); + if (zephir_array_isset_string_fetch(&cacheOptions, &viewOptions, SL("cache"), 0)) { + if (Z_TYPE_P(&cacheOptions) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&key); + zephir_array_isset_string_fetch(&key, &cacheOptions, SL("key"), 0); + ZEPHIR_OBS_NVAR(&lifetime); + zephir_array_isset_string_fetch(&lifetime, &cacheOptions, SL("lifetime"), 0); } } - if (Z_TYPE_P(key) == IS_NULL) { - ZEPHIR_INIT_NVAR(key); - zephir_md5(key, viewPath); + if (Z_TYPE_P(&key) == IS_NULL) { + ZEPHIR_INIT_NVAR(&key); + zephir_md5(&key, &viewPath); } - ZEPHIR_CALL_METHOD(&cachedView, cache, "start", &_11, 0, key, lifetime); + ZEPHIR_CALL_METHOD(&cachedView, cache, "start", &_9, 0, &key, &lifetime); zephir_check_call_status(); - if (Z_TYPE_P(cachedView) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_content"), cachedView TSRMLS_CC); + if (Z_TYPE_P(&cachedView) != IS_NULL) { + zephir_update_property_zval(this_ptr, SL("_content"), &cachedView); RETURN_MM_NULL(); } } - ZEPHIR_CALL_METHOD(&_12$$7, cache, "isfresh", &_13, 0); + ZEPHIR_CALL_METHOD(&_10$$7, cache, "isfresh", &_11, 0); zephir_check_call_status(); - if (!(zephir_is_true(_12$$7))) { + if (!(zephir_is_true(&_10$$7))) { RETURN_MM_NULL(); } } } - zephir_is_iterable(engines, &_15$$3, &_14$$3, 0, 0, "phalcon/mvc/view.zep", 696); - for ( - ; zend_hash_get_current_data_ex(_15$$3, (void**) &_16$$3, &_14$$3) == SUCCESS - ; zend_hash_move_forward_ex(_15$$3, &_14$$3) - ) { - ZEPHIR_GET_HMKEY(extension, _15$$3, _14$$3); - ZEPHIR_GET_HVALUE(engine, _16$$3); - ZEPHIR_INIT_NVAR(viewEnginePath); - ZEPHIR_CONCAT_VV(viewEnginePath, viewsDirPath, extension); - if ((zephir_file_exists(viewEnginePath TSRMLS_CC) == SUCCESS)) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_17$$16); - zephir_create_array(_17$$16, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_17$$16, viewEnginePath); - zephir_update_property_this(getThis(), SL("_activeRenderPaths"), _17$$16 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_19$$16); - ZVAL_STRING(_19$$16, "view:beforeRenderView", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_18$$16, eventsManager, "fire", &_20, 0, _19$$16, this_ptr, viewEnginePath); - zephir_check_temp_parameter(_19$$16); + zephir_is_iterable(engines, 0, "phalcon/mvc/view.zep", 696); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(engines), _13$$3, _14$$3, _12$$3) + { + ZEPHIR_INIT_NVAR(&extension); + if (_14$$3 != NULL) { + ZVAL_STR_COPY(&extension, _14$$3); + } else { + ZVAL_LONG(&extension, _13$$3); + } + ZEPHIR_INIT_NVAR(&engine); + ZVAL_COPY(&engine, _12$$3); + ZEPHIR_INIT_NVAR(&viewEnginePath); + ZEPHIR_CONCAT_VV(&viewEnginePath, &viewsDirPath, &extension); + if ((zephir_file_exists(&viewEnginePath TSRMLS_CC) == SUCCESS)) { + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_15$$16); + zephir_create_array(&_15$$16, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_15$$16, &viewEnginePath); + zephir_update_property_zval(this_ptr, SL("_activeRenderPaths"), &_15$$16); + ZEPHIR_INIT_NVAR(&_17$$16); + ZVAL_STRING(&_17$$16, "view:beforeRenderView"); + ZEPHIR_CALL_METHOD(&_16$$16, &eventsManager, "fire", &_18, 0, &_17$$16, this_ptr, &viewEnginePath); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_18$$16)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_16$$16)) { continue; } } - ZEPHIR_INIT_NVAR(_21$$15); if (mustClean) { - ZVAL_BOOL(_21$$15, 1); + ZVAL_BOOL(&_19$$15, 1); } else { - ZVAL_BOOL(_21$$15, 0); + ZVAL_BOOL(&_19$$15, 0); } - ZEPHIR_CALL_METHOD(NULL, engine, "render", NULL, 0, viewEnginePath, viewParams, _21$$15); + ZEPHIR_CALL_METHOD(NULL, &engine, "render", NULL, 0, &viewEnginePath, &viewParams, &_19$$15); zephir_check_call_status(); notExists = 0; - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_22$$18); - ZVAL_STRING(_22$$18, "view:afterRenderView", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_23, 0, _22$$18, this_ptr); - zephir_check_temp_parameter(_22$$18); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_20$$18); + ZVAL_STRING(&_20$$18, "view:afterRenderView"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_21, 0, &_20$$18, this_ptr); zephir_check_call_status(); } break; } - zephir_array_append(&viewEnginePaths, viewEnginePath, PH_SEPARATE, "phalcon/mvc/view.zep", 694); - } - } + zephir_array_append(&viewEnginePaths, &viewEnginePath, PH_SEPARATE, "phalcon/mvc/view.zep", 694); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&engine); + ZEPHIR_INIT_NVAR(&extension); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&viewsDir); if (notExists == 1) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_activeRenderPaths"), viewEnginePaths TSRMLS_CC); - ZEPHIR_INIT_VAR(_24$$20); - ZVAL_STRING(_24$$20, "view:notFoundView", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _24$$20, this_ptr, viewEnginePath); - zephir_check_temp_parameter(_24$$20); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_activeRenderPaths"), &viewEnginePaths); + ZEPHIR_INIT_VAR(&_22$$20); + ZVAL_STRING(&_22$$20, "view:notFoundView"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_22$$20, this_ptr, &viewEnginePath); zephir_check_call_status(); } if (!(silence)) { - ZEPHIR_INIT_VAR(_25$$21); - object_init_ex(_25$$21, phalcon_mvc_view_exception_ce); - ZEPHIR_INIT_VAR(_26$$21); - ZEPHIR_CONCAT_SVS(_26$$21, "View '", viewPath, "' was not found in any of the views directory"); - ZEPHIR_CALL_METHOD(NULL, _25$$21, "__construct", NULL, 9, _26$$21); + ZEPHIR_INIT_VAR(&_23$$21); + object_init_ex(&_23$$21, phalcon_mvc_view_exception_ce); + ZEPHIR_INIT_VAR(&_24$$21); + ZEPHIR_CONCAT_SVS(&_24$$21, "View '", &viewPath, "' was not found in any of the views directory"); + ZEPHIR_CALL_METHOD(NULL, &_23$$21, "__construct", NULL, 4, &_24$$21); zephir_check_call_status(); - zephir_throw_exception_debug(_25$$21, "phalcon/mvc/view.zep", 708 TSRMLS_CC); + zephir_throw_exception_debug(&_23$$21, "phalcon/mvc/view.zep", 708 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } @@ -1093,15 +1246,19 @@ PHP_METHOD(Phalcon_Mvc_View, _engineRender) { PHP_METHOD(Phalcon_Mvc_View, registerEngines) { zval *engines_param = NULL; - zval *engines = NULL; + zval engines; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&engines); - zephir_fetch_params(0, 1, 0, &engines_param); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &engines_param); - engines = engines_param; + ZEPHIR_OBS_COPY_OR_DUP(&engines, engines_param); - zephir_update_property_this(getThis(), SL("_registeredEngines"), engines TSRMLS_CC); - RETURN_THISW(); + zephir_update_property_zval(this_ptr, SL("_registeredEngines"), &engines); + RETURN_THIS(); } @@ -1110,60 +1267,76 @@ PHP_METHOD(Phalcon_Mvc_View, registerEngines) { */ PHP_METHOD(Phalcon_Mvc_View, exists) { - HashTable *_2, *_6$$4; - HashPosition _1, _5$$4; + zend_string *_5$$4; + zend_ulong _4$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *view_param = NULL, *basePath = NULL, *viewsDir = NULL, *engines = NULL, *extension = NULL, *_0 = NULL, **_3, *_4$$4 = NULL, **_7$$4, *_8$$5 = NULL; - zval *view = NULL; + zval *view_param = NULL, basePath, viewsDir, engines, extension, _0, *_1, _2$$4, *_3$$4, _6$$5; + zval view; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&view); + ZVAL_UNDEF(&basePath); + ZVAL_UNDEF(&viewsDir); + ZVAL_UNDEF(&engines); + ZVAL_UNDEF(&extension); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_6$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &view_param); if (UNEXPECTED(Z_TYPE_P(view_param) != IS_STRING && Z_TYPE_P(view_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'view' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'view' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(view_param) == IS_STRING)) { - zephir_get_strval(view, view_param); + zephir_get_strval(&view, view_param); } else { - ZEPHIR_INIT_VAR(view); - ZVAL_EMPTY_STRING(view); + ZEPHIR_INIT_VAR(&view); + ZVAL_EMPTY_STRING(&view); } - ZEPHIR_OBS_VAR(basePath); - zephir_read_property_this(&basePath, this_ptr, SL("_basePath"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(engines); - zephir_read_property_this(&engines, this_ptr, SL("_registeredEngines"), PH_NOISY_CC); - if (Z_TYPE_P(engines) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(engines); - zephir_create_array(engines, 1, 0 TSRMLS_CC); - add_assoc_stringl_ex(engines, SS(".phtml"), SL("Phalcon\\Mvc\\View\\Engine\\Php"), 1); - zephir_update_property_this(getThis(), SL("_registeredEngines"), engines TSRMLS_CC); + ZEPHIR_OBS_VAR(&basePath); + zephir_read_property(&basePath, this_ptr, SL("_basePath"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&engines); + zephir_read_property(&engines, this_ptr, SL("_registeredEngines"), PH_NOISY_CC); + if (Z_TYPE_P(&engines) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&engines); + zephir_create_array(&engines, 1, 0 TSRMLS_CC); + add_assoc_stringl_ex(&engines, SL(".phtml"), SL("Phalcon\\Mvc\\View\\Engine\\Php")); + zephir_update_property_zval(this_ptr, SL("_registeredEngines"), &engines); } ZEPHIR_CALL_METHOD(&_0, this_ptr, "getviewsdirs", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(_0, &_2, &_1, 0, 0, "phalcon/mvc/view.zep", 755); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(viewsDir, _3); - ZEPHIR_INIT_NVAR(_4$$4); - zephir_is_iterable(engines, &_6$$4, &_5$$4, 0, 0, "phalcon/mvc/view.zep", 753); - for ( - ; zend_hash_get_current_data_ex(_6$$4, (void**) &_7$$4, &_5$$4) == SUCCESS - ; zend_hash_move_forward_ex(_6$$4, &_5$$4) - ) { - ZEPHIR_GET_HMKEY(extension, _6$$4, _5$$4); - ZEPHIR_GET_HVALUE(_4$$4, _7$$4); - ZEPHIR_INIT_LNVAR(_8$$5); - ZEPHIR_CONCAT_VVVV(_8$$5, basePath, viewsDir, view, extension); - if ((zephir_file_exists(_8$$5 TSRMLS_CC) == SUCCESS)) { + zephir_is_iterable(&_0, 0, "phalcon/mvc/view.zep", 755); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&_0), _1) + { + ZEPHIR_INIT_NVAR(&viewsDir); + ZVAL_COPY(&viewsDir, _1); + ZEPHIR_INIT_NVAR(&_2$$4); + zephir_is_iterable(&engines, 0, "phalcon/mvc/view.zep", 753); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&engines), _4$$4, _5$$4, _3$$4) + { + ZEPHIR_INIT_NVAR(&extension); + if (_5$$4 != NULL) { + ZVAL_STR_COPY(&extension, _5$$4); + } else { + ZVAL_LONG(&extension, _4$$4); + } + ZEPHIR_INIT_NVAR(&_2$$4); + ZVAL_COPY(&_2$$4, _3$$4); + ZEPHIR_INIT_LNVAR(_6$$5); + ZEPHIR_CONCAT_VVVV(&_6$$5, &basePath, &viewsDir, &view, &extension); + if ((zephir_file_exists(&_6$$5 TSRMLS_CC) == SUCCESS)) { RETURN_MM_BOOL(1); } - } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_2$$4); + ZEPHIR_INIT_NVAR(&extension); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&viewsDir); RETURN_MM_BOOL(0); } @@ -1182,282 +1355,319 @@ PHP_METHOD(Phalcon_Mvc_View, exists) { */ PHP_METHOD(Phalcon_Mvc_View, render) { - HashTable *_15$$20, *_26$$25; - HashPosition _14$$20, _25$$25; - zend_bool silence = 0, mustClean = 0, _36$$29; + zend_bool silence = 0, mustClean = 0, _30$$29; zend_long ZEPHIR_LAST_CALL_STATUS, renderLevel = 0; - zval *controllerName_param = NULL, *actionName_param = NULL, *params = NULL, *layoutsDir = NULL, *layout = NULL, *pickView = NULL, *layoutName = NULL, *engines = NULL, *renderView = NULL, *pickViewAction = NULL, *eventsManager = NULL, *disabledLevels = NULL, *templatesBefore = NULL, *templatesAfter = NULL, *templateBefore = NULL, *templateAfter = NULL, *cache = NULL, *_0, *_3, *_4, *_5, *_8 = NULL, *_9, *_1$$3 = NULL, *_6$$14 = NULL, *_7$$14, *_10$$18, *_11$$18, *_12$$18, *_13$$20, **_16$$20, *_17$$21 = NULL, *_18$$21 = NULL, *_19$$21 = NULL, *_20$$23, *_21$$23, *_22$$23, *_23$$23, *_24$$25, **_27$$25, *_28$$26 = NULL, *_29$$26 = NULL, *_30$$26 = NULL, *_31$$28, *_32$$28, *_33$$28, *_34$$16, *_35$$29 = NULL, *_37$$29 = NULL, *_38$$32; - zval *controllerName = NULL, *actionName = NULL, *_2$$8; + zval *controllerName_param = NULL, *actionName_param = NULL, *params = NULL, params_sub, __$null, layoutsDir, layout, pickView, layoutName, engines, renderView, pickViewAction, eventsManager, disabledLevels, templatesBefore, templatesAfter, templateBefore, templateAfter, cache, _0, _3, _4, _5, _8, _9, _1$$3, _6$$14, _7$$14, _10$$18, _11$$18, _12$$20, *_13$$20, _14$$21, _15$$21, _16$$21, _17$$23, _18$$23, _19$$23, _20$$25, *_21$$25, _22$$26, _23$$26, _24$$26, _25$$28, _26$$28, _27$$28, _28$$16, _29$$29, _31$$29, _32$$32; + zval controllerName, actionName, _2$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&controllerName); + ZVAL_UNDEF(&actionName); + ZVAL_UNDEF(&_2$$8); + ZVAL_UNDEF(¶ms_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&layoutsDir); + ZVAL_UNDEF(&layout); + ZVAL_UNDEF(&pickView); + ZVAL_UNDEF(&layoutName); + ZVAL_UNDEF(&engines); + ZVAL_UNDEF(&renderView); + ZVAL_UNDEF(&pickViewAction); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&disabledLevels); + ZVAL_UNDEF(&templatesBefore); + ZVAL_UNDEF(&templatesAfter); + ZVAL_UNDEF(&templateBefore); + ZVAL_UNDEF(&templateAfter); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_6$$14); + ZVAL_UNDEF(&_7$$14); + ZVAL_UNDEF(&_10$$18); + ZVAL_UNDEF(&_11$$18); + ZVAL_UNDEF(&_12$$20); + ZVAL_UNDEF(&_14$$21); + ZVAL_UNDEF(&_15$$21); + ZVAL_UNDEF(&_16$$21); + ZVAL_UNDEF(&_17$$23); + ZVAL_UNDEF(&_18$$23); + ZVAL_UNDEF(&_19$$23); + ZVAL_UNDEF(&_20$$25); + ZVAL_UNDEF(&_22$$26); + ZVAL_UNDEF(&_23$$26); + ZVAL_UNDEF(&_24$$26); + ZVAL_UNDEF(&_25$$28); + ZVAL_UNDEF(&_26$$28); + ZVAL_UNDEF(&_27$$28); + ZVAL_UNDEF(&_28$$16); + ZVAL_UNDEF(&_29$$29); + ZVAL_UNDEF(&_31$$29); + ZVAL_UNDEF(&_32$$32); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &controllerName_param, &actionName_param, ¶ms); if (UNEXPECTED(Z_TYPE_P(controllerName_param) != IS_STRING && Z_TYPE_P(controllerName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(controllerName_param) == IS_STRING)) { - zephir_get_strval(controllerName, controllerName_param); + zephir_get_strval(&controllerName, controllerName_param); } else { - ZEPHIR_INIT_VAR(controllerName); - ZVAL_EMPTY_STRING(controllerName); + ZEPHIR_INIT_VAR(&controllerName); + ZVAL_EMPTY_STRING(&controllerName); } if (UNEXPECTED(Z_TYPE_P(actionName_param) != IS_STRING && Z_TYPE_P(actionName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'actionName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'actionName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(actionName_param) == IS_STRING)) { - zephir_get_strval(actionName, actionName_param); + zephir_get_strval(&actionName, actionName_param); } else { - ZEPHIR_INIT_VAR(actionName); - ZVAL_EMPTY_STRING(actionName); + ZEPHIR_INIT_VAR(&actionName); + ZVAL_EMPTY_STRING(&actionName); } if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_currentRenderLevel"), _0 TSRMLS_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_disabled"), PH_NOISY_CC); - if (!ZEPHIR_IS_FALSE_IDENTICAL(_0)) { - ZEPHIR_CALL_FUNCTION(&_1$$3, "ob_get_contents", NULL, 141); + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_currentRenderLevel"), &_0); + zephir_read_property(&_0, this_ptr, SL("_disabled"), PH_NOISY_CC | PH_READONLY); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { + ZEPHIR_CALL_FUNCTION(&_1$$3, "ob_get_contents", NULL, 122); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_content"), _1$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_content"), &_1$$3); RETURN_MM_BOOL(0); } - zephir_update_property_this(getThis(), SL("_controllerName"), controllerName TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_actionName"), actionName TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_controllerName"), &controllerName); + zephir_update_property_zval(this_ptr, SL("_actionName"), &actionName); if (Z_TYPE_P(params) == IS_ARRAY) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "setvars", NULL, 0, params); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(layoutsDir); - zephir_read_property_this(&layoutsDir, this_ptr, SL("_layoutsDir"), PH_NOISY_CC); - if (!(zephir_is_true(layoutsDir))) { - ZEPHIR_INIT_NVAR(layoutsDir); - ZVAL_STRING(layoutsDir, "layouts/", 1); + ZEPHIR_OBS_VAR(&layoutsDir); + zephir_read_property(&layoutsDir, this_ptr, SL("_layoutsDir"), PH_NOISY_CC); + if (!(zephir_is_true(&layoutsDir))) { + ZEPHIR_INIT_NVAR(&layoutsDir); + ZVAL_STRING(&layoutsDir, "layouts/"); } - ZEPHIR_OBS_VAR(layout); - zephir_read_property_this(&layout, this_ptr, SL("_layout"), PH_NOISY_CC); - if (zephir_is_true(layout)) { - ZEPHIR_CPY_WRT(layoutName, layout); + ZEPHIR_OBS_VAR(&layout); + zephir_read_property(&layout, this_ptr, SL("_layout"), PH_NOISY_CC); + if (zephir_is_true(&layout)) { + ZEPHIR_CPY_WRT(&layoutName, &layout); } else { - ZEPHIR_CPY_WRT(layoutName, controllerName); + ZEPHIR_CPY_WRT(&layoutName, &controllerName); } ZEPHIR_CALL_METHOD(&engines, this_ptr, "_loadtemplateengines", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(pickView); - zephir_read_property_this(&pickView, this_ptr, SL("_pickView"), PH_NOISY_CC); - if (Z_TYPE_P(pickView) == IS_NULL) { - ZEPHIR_INIT_VAR(_2$$8); - ZEPHIR_CONCAT_VSV(_2$$8, controllerName, "/", actionName); - ZEPHIR_CPY_WRT(renderView, _2$$8); + ZEPHIR_OBS_VAR(&pickView); + zephir_read_property(&pickView, this_ptr, SL("_pickView"), PH_NOISY_CC); + if (Z_TYPE_P(&pickView) == IS_NULL) { + ZEPHIR_INIT_VAR(&_2$$8); + ZEPHIR_CONCAT_VSV(&_2$$8, &controllerName, "/", &actionName); + ZEPHIR_CPY_WRT(&renderView, &_2$$8); } else { - ZEPHIR_OBS_NVAR(renderView); - zephir_array_fetch_long(&renderView, pickView, 0, PH_NOISY, "phalcon/mvc/view.zep", 831 TSRMLS_CC); - if (Z_TYPE_P(layoutName) == IS_NULL) { - ZEPHIR_OBS_VAR(pickViewAction); - if (zephir_array_isset_long_fetch(&pickViewAction, pickView, 1, 0 TSRMLS_CC)) { - ZEPHIR_CPY_WRT(layoutName, pickViewAction); + ZEPHIR_OBS_NVAR(&renderView); + zephir_array_fetch_long(&renderView, &pickView, 0, PH_NOISY, "phalcon/mvc/view.zep", 831 TSRMLS_CC); + if (Z_TYPE_P(&layoutName) == IS_NULL) { + ZEPHIR_OBS_VAR(&pickViewAction); + if (zephir_array_isset_long_fetch(&pickViewAction, &pickView, 1, 0 TSRMLS_CC)) { + ZEPHIR_CPY_WRT(&layoutName, &pickViewAction); } } } - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_cacheLevel"), PH_NOISY_CC); - if (zephir_is_true(_3)) { + zephir_read_property(&_3, this_ptr, SL("_cacheLevel"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_3)) { ZEPHIR_CALL_METHOD(&cache, this_ptr, "getcache", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(cache); - ZVAL_NULL(cache); + ZEPHIR_INIT_NVAR(&cache); + ZVAL_NULL(&cache); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_eventsManager"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(eventsManager, _4); - ZEPHIR_INIT_VAR(_5); + zephir_read_property(&_4, this_ptr, SL("_eventsManager"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&eventsManager, &_4); + ZEPHIR_INIT_VAR(&_5); zephir_create_symbol_table(TSRMLS_C); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_7$$14); - ZVAL_STRING(_7$$14, "view:beforeRender", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_6$$14, eventsManager, "fire", NULL, 0, _7$$14, this_ptr); - zephir_check_temp_parameter(_7$$14); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_7$$14); + ZVAL_STRING(&_7$$14, "view:beforeRender"); + ZEPHIR_CALL_METHOD(&_6$$14, &eventsManager, "fire", NULL, 0, &_7$$14, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_6$$14)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_6$$14)) { RETURN_MM_BOOL(0); } } - ZEPHIR_CALL_FUNCTION(&_8, "ob_get_contents", NULL, 141); + ZEPHIR_CALL_FUNCTION(&_8, "ob_get_contents", NULL, 122); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_content"), _8 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_content"), &_8); mustClean = 1; silence = 1; - ZEPHIR_OBS_VAR(disabledLevels); - zephir_read_property_this(&disabledLevels, this_ptr, SL("_disabledLevels"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(_9); - zephir_read_property_this(&_9, this_ptr, SL("_renderLevel"), PH_NOISY_CC); - renderLevel = zephir_get_intval(_9); + ZEPHIR_OBS_VAR(&disabledLevels); + zephir_read_property(&disabledLevels, this_ptr, SL("_disabledLevels"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_9); + zephir_read_property(&_9, this_ptr, SL("_renderLevel"), PH_NOISY_CC); + renderLevel = zephir_get_intval(&_9); if (renderLevel) { if (renderLevel >= 1) { - if (!(zephir_array_isset_long(disabledLevels, 1))) { + if (!(zephir_array_isset_long(&disabledLevels, 1))) { ZEPHIR_INIT_ZVAL_NREF(_10$$18); - ZVAL_LONG(_10$$18, 1); - zephir_update_property_this(getThis(), SL("_currentRenderLevel"), _10$$18 TSRMLS_CC); - ZEPHIR_INIT_VAR(_11$$18); + ZVAL_LONG(&_10$$18, 1); + zephir_update_property_zval(this_ptr, SL("_currentRenderLevel"), &_10$$18); if (silence) { - ZVAL_BOOL(_11$$18, 1); + ZVAL_BOOL(&_10$$18, 1); } else { - ZVAL_BOOL(_11$$18, 0); + ZVAL_BOOL(&_10$$18, 0); } - ZEPHIR_INIT_VAR(_12$$18); if (mustClean) { - ZVAL_BOOL(_12$$18, 1); + ZVAL_BOOL(&_11$$18, 1); } else { - ZVAL_BOOL(_12$$18, 0); + ZVAL_BOOL(&_11$$18, 0); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, engines, renderView, _11$$18, _12$$18, cache); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, &engines, &renderView, &_10$$18, &_11$$18, &cache); zephir_check_call_status(); } } if (renderLevel >= 2) { - if (!(zephir_array_isset_long(disabledLevels, 2))) { - ZEPHIR_INIT_ZVAL_NREF(_13$$20); - ZVAL_LONG(_13$$20, 2); - zephir_update_property_this(getThis(), SL("_currentRenderLevel"), _13$$20 TSRMLS_CC); - ZEPHIR_OBS_VAR(templatesBefore); - zephir_read_property_this(&templatesBefore, this_ptr, SL("_templatesBefore"), PH_NOISY_CC); + if (!(zephir_array_isset_long(&disabledLevels, 2))) { + ZEPHIR_INIT_ZVAL_NREF(_12$$20); + ZVAL_LONG(&_12$$20, 2); + zephir_update_property_zval(this_ptr, SL("_currentRenderLevel"), &_12$$20); + ZEPHIR_OBS_VAR(&templatesBefore); + zephir_read_property(&templatesBefore, this_ptr, SL("_templatesBefore"), PH_NOISY_CC); silence = 0; - zephir_is_iterable(templatesBefore, &_15$$20, &_14$$20, 0, 0, "phalcon/mvc/view.zep", 906); - for ( - ; zend_hash_get_current_data_ex(_15$$20, (void**) &_16$$20, &_14$$20) == SUCCESS - ; zend_hash_move_forward_ex(_15$$20, &_14$$20) - ) { - ZEPHIR_GET_HVALUE(templateBefore, _16$$20); - ZEPHIR_INIT_LNVAR(_17$$21); - ZEPHIR_CONCAT_VV(_17$$21, layoutsDir, templateBefore); - ZEPHIR_INIT_NVAR(_18$$21); + zephir_is_iterable(&templatesBefore, 0, "phalcon/mvc/view.zep", 906); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&templatesBefore), _13$$20) + { + ZEPHIR_INIT_NVAR(&templateBefore); + ZVAL_COPY(&templateBefore, _13$$20); + ZEPHIR_INIT_LNVAR(_14$$21); + ZEPHIR_CONCAT_VV(&_14$$21, &layoutsDir, &templateBefore); if (silence) { - ZVAL_BOOL(_18$$21, 1); + ZVAL_BOOL(&_15$$21, 1); } else { - ZVAL_BOOL(_18$$21, 0); + ZVAL_BOOL(&_15$$21, 0); } - ZEPHIR_INIT_NVAR(_19$$21); if (mustClean) { - ZVAL_BOOL(_19$$21, 1); + ZVAL_BOOL(&_16$$21, 1); } else { - ZVAL_BOOL(_19$$21, 0); + ZVAL_BOOL(&_16$$21, 0); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, engines, _17$$21, _18$$21, _19$$21, cache); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, &engines, &_14$$21, &_15$$21, &_16$$21, &cache); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&templateBefore); silence = 1; } } if (renderLevel >= 3) { - if (!(zephir_array_isset_long(disabledLevels, 3))) { - ZEPHIR_INIT_ZVAL_NREF(_20$$23); - ZVAL_LONG(_20$$23, 3); - zephir_update_property_this(getThis(), SL("_currentRenderLevel"), _20$$23 TSRMLS_CC); - ZEPHIR_INIT_VAR(_21$$23); - ZEPHIR_CONCAT_VV(_21$$23, layoutsDir, layoutName); - ZEPHIR_INIT_VAR(_22$$23); + if (!(zephir_array_isset_long(&disabledLevels, 3))) { + ZEPHIR_INIT_ZVAL_NREF(_17$$23); + ZVAL_LONG(&_17$$23, 3); + zephir_update_property_zval(this_ptr, SL("_currentRenderLevel"), &_17$$23); + ZEPHIR_INIT_VAR(&_18$$23); + ZEPHIR_CONCAT_VV(&_18$$23, &layoutsDir, &layoutName); if (silence) { - ZVAL_BOOL(_22$$23, 1); + ZVAL_BOOL(&_17$$23, 1); } else { - ZVAL_BOOL(_22$$23, 0); + ZVAL_BOOL(&_17$$23, 0); } - ZEPHIR_INIT_VAR(_23$$23); if (mustClean) { - ZVAL_BOOL(_23$$23, 1); + ZVAL_BOOL(&_19$$23, 1); } else { - ZVAL_BOOL(_23$$23, 0); + ZVAL_BOOL(&_19$$23, 0); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, engines, _21$$23, _22$$23, _23$$23, cache); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, &engines, &_18$$23, &_17$$23, &_19$$23, &cache); zephir_check_call_status(); } } if (renderLevel >= 4) { - if (!(zephir_array_isset_long(disabledLevels, 4))) { - ZEPHIR_INIT_ZVAL_NREF(_24$$25); - ZVAL_LONG(_24$$25, 4); - zephir_update_property_this(getThis(), SL("_currentRenderLevel"), _24$$25 TSRMLS_CC); - ZEPHIR_OBS_VAR(templatesAfter); - zephir_read_property_this(&templatesAfter, this_ptr, SL("_templatesAfter"), PH_NOISY_CC); + if (!(zephir_array_isset_long(&disabledLevels, 4))) { + ZEPHIR_INIT_ZVAL_NREF(_20$$25); + ZVAL_LONG(&_20$$25, 4); + zephir_update_property_zval(this_ptr, SL("_currentRenderLevel"), &_20$$25); + ZEPHIR_OBS_VAR(&templatesAfter); + zephir_read_property(&templatesAfter, this_ptr, SL("_templatesAfter"), PH_NOISY_CC); silence = 0; - zephir_is_iterable(templatesAfter, &_26$$25, &_25$$25, 0, 0, "phalcon/mvc/view.zep", 933); - for ( - ; zend_hash_get_current_data_ex(_26$$25, (void**) &_27$$25, &_25$$25) == SUCCESS - ; zend_hash_move_forward_ex(_26$$25, &_25$$25) - ) { - ZEPHIR_GET_HVALUE(templateAfter, _27$$25); - ZEPHIR_INIT_LNVAR(_28$$26); - ZEPHIR_CONCAT_VV(_28$$26, layoutsDir, templateAfter); - ZEPHIR_INIT_NVAR(_29$$26); + zephir_is_iterable(&templatesAfter, 0, "phalcon/mvc/view.zep", 933); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&templatesAfter), _21$$25) + { + ZEPHIR_INIT_NVAR(&templateAfter); + ZVAL_COPY(&templateAfter, _21$$25); + ZEPHIR_INIT_LNVAR(_22$$26); + ZEPHIR_CONCAT_VV(&_22$$26, &layoutsDir, &templateAfter); if (silence) { - ZVAL_BOOL(_29$$26, 1); + ZVAL_BOOL(&_23$$26, 1); } else { - ZVAL_BOOL(_29$$26, 0); + ZVAL_BOOL(&_23$$26, 0); } - ZEPHIR_INIT_NVAR(_30$$26); if (mustClean) { - ZVAL_BOOL(_30$$26, 1); + ZVAL_BOOL(&_24$$26, 1); } else { - ZVAL_BOOL(_30$$26, 0); + ZVAL_BOOL(&_24$$26, 0); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, engines, _28$$26, _29$$26, _30$$26, cache); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, &engines, &_22$$26, &_23$$26, &_24$$26, &cache); zephir_check_call_status(); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&templateAfter); silence = 1; } } if (renderLevel >= 5) { - if (!(zephir_array_isset_long(disabledLevels, 5))) { - ZEPHIR_INIT_ZVAL_NREF(_31$$28); - ZVAL_LONG(_31$$28, 5); - zephir_update_property_this(getThis(), SL("_currentRenderLevel"), _31$$28 TSRMLS_CC); - _31$$28 = zephir_fetch_nproperty_this(this_ptr, SL("_mainView"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_32$$28); + if (!(zephir_array_isset_long(&disabledLevels, 5))) { + ZEPHIR_INIT_ZVAL_NREF(_25$$28); + ZVAL_LONG(&_25$$28, 5); + zephir_update_property_zval(this_ptr, SL("_currentRenderLevel"), &_25$$28); + zephir_read_property(&_25$$28, this_ptr, SL("_mainView"), PH_NOISY_CC | PH_READONLY); if (silence) { - ZVAL_BOOL(_32$$28, 1); + ZVAL_BOOL(&_26$$28, 1); } else { - ZVAL_BOOL(_32$$28, 0); + ZVAL_BOOL(&_26$$28, 0); } - ZEPHIR_INIT_VAR(_33$$28); if (mustClean) { - ZVAL_BOOL(_33$$28, 1); + ZVAL_BOOL(&_27$$28, 1); } else { - ZVAL_BOOL(_33$$28, 0); + ZVAL_BOOL(&_27$$28, 0); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, engines, _31$$28, _32$$28, _33$$28, cache); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, &engines, &_25$$28, &_26$$28, &_27$$28, &cache); zephir_check_call_status(); } } - ZEPHIR_INIT_ZVAL_NREF(_34$$16); - ZVAL_LONG(_34$$16, 0); - zephir_update_property_this(getThis(), SL("_currentRenderLevel"), _34$$16 TSRMLS_CC); - if (Z_TYPE_P(cache) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_35$$29, cache, "isstarted", NULL, 0); + ZEPHIR_INIT_ZVAL_NREF(_28$$16); + ZVAL_LONG(&_28$$16, 0); + zephir_update_property_zval(this_ptr, SL("_currentRenderLevel"), &_28$$16); + if (Z_TYPE_P(&cache) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&_29$$29, &cache, "isstarted", NULL, 0); zephir_check_call_status(); - _36$$29 = zephir_is_true(_35$$29); - if (_36$$29) { - ZEPHIR_CALL_METHOD(&_37$$29, cache, "isfresh", NULL, 0); + _30$$29 = zephir_is_true(&_29$$29); + if (_30$$29) { + ZEPHIR_CALL_METHOD(&_31$$29, &cache, "isfresh", NULL, 0); zephir_check_call_status(); - _36$$29 = zephir_is_true(_37$$29); + _30$$29 = zephir_is_true(&_31$$29); } - if (_36$$29) { - ZEPHIR_CALL_METHOD(NULL, cache, "save", NULL, 0); + if (_30$$29) { + ZEPHIR_CALL_METHOD(NULL, &cache, "save", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(NULL, cache, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &cache, "stop", NULL, 0); zephir_check_call_status(); } } } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_38$$32); - ZVAL_STRING(_38$$32, "view:afterRender", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _38$$32, this_ptr); - zephir_check_temp_parameter(_38$$32); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_32$$32); + ZVAL_STRING(&_32$$32, "view:afterRender"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_32$$32, this_ptr); zephir_check_call_status(); } RETURN_THIS(); @@ -1484,7 +1694,13 @@ PHP_METHOD(Phalcon_Mvc_View, render) { */ PHP_METHOD(Phalcon_Mvc_View, pick) { - zval *renderView, *pickView = NULL, *layout = NULL, *parts = NULL; + zval *renderView, renderView_sub, pickView, layout, parts; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&renderView_sub); + ZVAL_UNDEF(&pickView); + ZVAL_UNDEF(&layout); + ZVAL_UNDEF(&parts); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &renderView); @@ -1492,24 +1708,24 @@ PHP_METHOD(Phalcon_Mvc_View, pick) { if (Z_TYPE_P(renderView) == IS_ARRAY) { - ZEPHIR_CPY_WRT(pickView, renderView); + ZEPHIR_CPY_WRT(&pickView, renderView); } else { - ZEPHIR_INIT_VAR(layout); - ZVAL_NULL(layout); + ZEPHIR_INIT_VAR(&layout); + ZVAL_NULL(&layout); if (zephir_memnstr_str(renderView, SL("/"), "phalcon/mvc/view.zep", 998)) { - ZEPHIR_INIT_VAR(parts); - zephir_fast_explode_str(parts, SL("/"), renderView, LONG_MAX TSRMLS_CC); - ZEPHIR_OBS_NVAR(layout); - zephir_array_fetch_long(&layout, parts, 0, PH_NOISY, "phalcon/mvc/view.zep", 999 TSRMLS_CC); + ZEPHIR_INIT_VAR(&parts); + zephir_fast_explode_str(&parts, SL("/"), renderView, LONG_MAX TSRMLS_CC); + ZEPHIR_OBS_NVAR(&layout); + zephir_array_fetch_long(&layout, &parts, 0, PH_NOISY, "phalcon/mvc/view.zep", 999 TSRMLS_CC); } - ZEPHIR_INIT_NVAR(pickView); - zephir_create_array(pickView, 1, 0 TSRMLS_CC); - zephir_array_fast_append(pickView, renderView); - if (Z_TYPE_P(layout) != IS_NULL) { - zephir_array_append(&pickView, layout, PH_SEPARATE, "phalcon/mvc/view.zep", 1004); + ZEPHIR_INIT_NVAR(&pickView); + zephir_create_array(&pickView, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&pickView, renderView); + if (Z_TYPE_P(&layout) != IS_NULL) { + zephir_array_append(&pickView, &layout, PH_SEPARATE, "phalcon/mvc/view.zep", 1004); } } - zephir_update_property_this(getThis(), SL("_pickView"), pickView TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_pickView"), &pickView); RETURN_THIS(); } @@ -1535,32 +1751,38 @@ PHP_METHOD(Phalcon_Mvc_View, pick) { PHP_METHOD(Phalcon_Mvc_View, getPartial) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *partialPath_param = NULL, *params = NULL; - zval *partialPath = NULL; + zval *partialPath_param = NULL, *params = NULL, params_sub, __$null; + zval partialPath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&partialPath); + ZVAL_UNDEF(¶ms_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &partialPath_param, ¶ms); if (UNEXPECTED(Z_TYPE_P(partialPath_param) != IS_STRING && Z_TYPE_P(partialPath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(partialPath_param) == IS_STRING)) { - zephir_get_strval(partialPath, partialPath_param); + zephir_get_strval(&partialPath, partialPath_param); } else { - ZEPHIR_INIT_VAR(partialPath); - ZVAL_EMPTY_STRING(partialPath); + ZEPHIR_INIT_VAR(&partialPath); + ZVAL_EMPTY_STRING(&partialPath); } if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 140); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 121); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "partial", NULL, 0, partialPath, params); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "partial", NULL, 0, &partialPath, params); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 307); + ZEPHIR_RETURN_CALL_FUNCTION("ob_get_clean", NULL, 267); zephir_check_call_status(); RETURN_MM(); @@ -1587,50 +1809,62 @@ PHP_METHOD(Phalcon_Mvc_View, getPartial) { PHP_METHOD(Phalcon_Mvc_View, partial) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *partialPath_param = NULL, *params = NULL, *viewParams = NULL, *_2 = NULL, *_3, *_4, *_5, *_6, *_0$$3, *_1$$3; - zval *partialPath = NULL; + zval *partialPath_param = NULL, *params = NULL, params_sub, __$null, viewParams, _2, _3, _4, _5, _6, _0$$3, _1$$3; + zval partialPath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&partialPath); + ZVAL_UNDEF(¶ms_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&viewParams); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &partialPath_param, ¶ms); if (UNEXPECTED(Z_TYPE_P(partialPath_param) != IS_STRING && Z_TYPE_P(partialPath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(partialPath_param) == IS_STRING)) { - zephir_get_strval(partialPath, partialPath_param); + zephir_get_strval(&partialPath, partialPath_param); } else { - ZEPHIR_INIT_VAR(partialPath); - ZVAL_EMPTY_STRING(partialPath); + ZEPHIR_INIT_VAR(&partialPath); + ZVAL_EMPTY_STRING(&partialPath); } if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } if (Z_TYPE_P(params) == IS_ARRAY) { - ZEPHIR_OBS_VAR(viewParams); - zephir_read_property_this(&viewParams, this_ptr, SL("_viewParams"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_0$$3); - zephir_fast_array_merge(_0$$3, &(viewParams), &(params) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_viewParams"), _0$$3 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1$$3); + ZEPHIR_OBS_VAR(&viewParams); + zephir_read_property(&viewParams, this_ptr, SL("_viewParams"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_0$$3); + zephir_fast_array_merge(&_0$$3, &viewParams, params TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_viewParams"), &_0$$3); + ZEPHIR_INIT_VAR(&_1$$3); zephir_create_symbol_table(TSRMLS_C); } ZEPHIR_CALL_METHOD(&_2, this_ptr, "_loadtemplateengines", NULL, 0); zephir_check_call_status(); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_partialsDir"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_4); - ZEPHIR_CONCAT_VV(_4, _3, partialPath); - ZEPHIR_INIT_VAR(_5); - ZVAL_BOOL(_5, 0); - ZEPHIR_INIT_VAR(_6); - ZVAL_BOOL(_6, 0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, _2, _4, _5, _6); + zephir_read_property(&_3, this_ptr, SL("_partialsDir"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_4); + ZEPHIR_CONCAT_VV(&_4, &_3, &partialPath); + ZVAL_BOOL(&_5, 0); + ZVAL_BOOL(&_6, 0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_enginerender", NULL, 0, &_2, &_4, &_5, &_6); zephir_check_call_status(); if (Z_TYPE_P(params) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_viewParams"), viewParams TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_viewParams"), &viewParams); } ZEPHIR_MM_RESTORE(); @@ -1657,67 +1891,79 @@ PHP_METHOD(Phalcon_Mvc_View, partial) { */ PHP_METHOD(Phalcon_Mvc_View, getRender) { - zval *_1$$4; + zval _1$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *controllerName_param = NULL, *actionName_param = NULL, *params = NULL, *configCallback = NULL, *view = NULL, *_0$$4; - zval *controllerName = NULL, *actionName = NULL; + zval *controllerName_param = NULL, *actionName_param = NULL, *params = NULL, params_sub, *configCallback = NULL, configCallback_sub, __$null, view, _0$$4; + zval controllerName, actionName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&controllerName); + ZVAL_UNDEF(&actionName); + ZVAL_UNDEF(¶ms_sub); + ZVAL_UNDEF(&configCallback_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&view); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 2, &controllerName_param, &actionName_param, ¶ms, &configCallback); if (UNEXPECTED(Z_TYPE_P(controllerName_param) != IS_STRING && Z_TYPE_P(controllerName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'controllerName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(controllerName_param) == IS_STRING)) { - zephir_get_strval(controllerName, controllerName_param); + zephir_get_strval(&controllerName, controllerName_param); } else { - ZEPHIR_INIT_VAR(controllerName); - ZVAL_EMPTY_STRING(controllerName); + ZEPHIR_INIT_VAR(&controllerName); + ZVAL_EMPTY_STRING(&controllerName); } if (UNEXPECTED(Z_TYPE_P(actionName_param) != IS_STRING && Z_TYPE_P(actionName_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'actionName' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'actionName' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(actionName_param) == IS_STRING)) { - zephir_get_strval(actionName, actionName_param); + zephir_get_strval(&actionName, actionName_param); } else { - ZEPHIR_INIT_VAR(actionName); - ZVAL_EMPTY_STRING(actionName); + ZEPHIR_INIT_VAR(&actionName); + ZVAL_EMPTY_STRING(&actionName); } if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } if (!configCallback) { - configCallback = ZEPHIR_GLOBAL(global_null); + configCallback = &configCallback_sub; + configCallback = &__$null; } - ZEPHIR_INIT_VAR(view); - if (zephir_clone(view, this_ptr TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&view); + if (zephir_clone(&view, this_ptr TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_CALL_METHOD(NULL, view, "reset", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &view, "reset", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(params) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, view, "setvars", NULL, 0, params); + ZEPHIR_CALL_METHOD(NULL, &view, "setvars", NULL, 0, params); zephir_check_call_status(); } if (Z_TYPE_P(configCallback) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_0$$4); - ZEPHIR_INIT_VAR(_1$$4); - zephir_create_array(_1$$4, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_1$$4, view); - ZEPHIR_CALL_USER_FUNC_ARRAY(_0$$4, configCallback, _1$$4); + ZEPHIR_INIT_VAR(&_0$$4); + ZEPHIR_INIT_VAR(&_1$$4); + zephir_create_array(&_1$$4, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_1$$4, &view); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_0$$4, configCallback, &_1$$4); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, view, "start", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &view, "start", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, view, "render", NULL, 0, controllerName, actionName); + ZEPHIR_CALL_METHOD(NULL, &view, "render", NULL, 0, &controllerName, &actionName); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 142); + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 123); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_METHOD(view, "getcontent", NULL, 0); + ZEPHIR_RETURN_CALL_METHOD(&view, "getcontent", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -1729,10 +1975,12 @@ PHP_METHOD(Phalcon_Mvc_View, getRender) { PHP_METHOD(Phalcon_Mvc_View, finish) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 142); + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 123); zephir_check_call_status(); RETURN_THIS(); @@ -1743,36 +1991,45 @@ PHP_METHOD(Phalcon_Mvc_View, finish) { */ PHP_METHOD(Phalcon_Mvc_View, _createCache) { - zval *dependencyInjector = NULL, *cacheService = NULL, *viewCache = NULL, *viewOptions = NULL, *cacheOptions = NULL, *_0, *_1 = NULL; + zval dependencyInjector, cacheService, viewCache, viewOptions, cacheOptions, _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&cacheService); + ZVAL_UNDEF(&viewCache); + ZVAL_UNDEF(&viewOptions); + ZVAL_UNDEF(&cacheOptions); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the view cache services", "phalcon/mvc/view.zep", 1183); return; } - ZEPHIR_INIT_VAR(cacheService); - ZVAL_STRING(cacheService, "viewCache", 1); - ZEPHIR_OBS_VAR(viewOptions); - zephir_read_property_this(&viewOptions, this_ptr, SL("_options"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(cacheOptions); - if (zephir_array_isset_string_fetch(&cacheOptions, viewOptions, SS("cache"), 0 TSRMLS_CC)) { - if (zephir_array_isset_string(cacheOptions, SS("service"))) { - ZEPHIR_OBS_NVAR(cacheService); - zephir_array_fetch_string(&cacheService, cacheOptions, SL("service"), PH_NOISY, "phalcon/mvc/view.zep", 1192 TSRMLS_CC); + ZEPHIR_INIT_VAR(&cacheService); + ZVAL_STRING(&cacheService, "viewCache"); + ZEPHIR_OBS_VAR(&viewOptions); + zephir_read_property(&viewOptions, this_ptr, SL("_options"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&cacheOptions); + if (zephir_array_isset_string_fetch(&cacheOptions, &viewOptions, SL("cache"), 0)) { + if (zephir_array_isset_string(&cacheOptions, SL("service"))) { + ZEPHIR_OBS_NVAR(&cacheService); + zephir_array_fetch_string(&cacheService, &cacheOptions, SL("service"), PH_NOISY, "phalcon/mvc/view.zep", 1192 TSRMLS_CC); } } - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "getshared", NULL, 0, cacheService); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "getshared", NULL, 0, &cacheService); zephir_check_call_status(); - ZEPHIR_CPY_WRT(viewCache, _1); - if (Z_TYPE_P(viewCache) != IS_OBJECT) { + ZEPHIR_CPY_WRT(&viewCache, &_1); + if (Z_TYPE_P(&viewCache) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "The injected caching service is invalid", "phalcon/mvc/view.zep", 1201); return; } - RETURN_CCTOR(viewCache); + RETURN_CCTOR(&viewCache); } @@ -1781,11 +2038,14 @@ PHP_METHOD(Phalcon_Mvc_View, _createCache) { */ PHP_METHOD(Phalcon_Mvc_View, isCaching) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_cacheLevel"), PH_NOISY_CC); - RETURN_BOOL(ZEPHIR_GT_LONG(_0, 0)); + zephir_read_property(&_0, this_ptr, SL("_cacheLevel"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(ZEPHIR_GT_LONG(&_0, 0)); } @@ -1795,22 +2055,27 @@ PHP_METHOD(Phalcon_Mvc_View, isCaching) { PHP_METHOD(Phalcon_Mvc_View, getCache) { zend_bool _1; - zval *_0, *_2, *_3$$3 = NULL; + zval _0, _2, _3$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_cache"), PH_NOISY_CC); - _1 = !zephir_is_true(_0); + zephir_read_property(&_0, this_ptr, SL("_cache"), PH_NOISY_CC | PH_READONLY); + _1 = !zephir_is_true(&_0); if (!(_1)) { - ZEPHIR_OBS_VAR(_2); - zephir_read_property_this(&_2, this_ptr, SL("_cache"), PH_NOISY_CC); - _1 = Z_TYPE_P(_2) != IS_OBJECT; + ZEPHIR_OBS_VAR(&_2); + zephir_read_property(&_2, this_ptr, SL("_cache"), PH_NOISY_CC); + _1 = Z_TYPE_P(&_2) != IS_OBJECT; } if (_1) { ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "_createcache", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_cache"), _3$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &_3$$3); } RETURN_MM_MEMBER(getThis(), "_cache"); @@ -1830,57 +2095,76 @@ PHP_METHOD(Phalcon_Mvc_View, getCache) { */ PHP_METHOD(Phalcon_Mvc_View, cache) { - HashTable *_1$$3; - HashPosition _0$$3; - zval *options = NULL, *viewOptions = NULL, *cacheOptions = NULL, *key = NULL, *value = NULL, *cacheLevel = NULL, **_2$$3, *_3$$8, *_4$$10, *_5$$11; + zend_string *_2$$3; + zend_ulong _1$$3; + zval *options = NULL, options_sub, __$true, viewOptions, cacheOptions, key, value, cacheLevel, *_0$$3, _3$$8, _4$$10, _5$$11; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&viewOptions); + ZVAL_UNDEF(&cacheOptions); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&cacheLevel); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_4$$10); + ZVAL_UNDEF(&_5$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_true); + options = &options_sub; + options = &__$true; } if (Z_TYPE_P(options) == IS_ARRAY) { - ZEPHIR_OBS_VAR(viewOptions); - zephir_read_property_this(&viewOptions, this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(viewOptions) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(viewOptions); - array_init(viewOptions); + ZEPHIR_OBS_VAR(&viewOptions); + zephir_read_property(&viewOptions, this_ptr, SL("_options"), PH_NOISY_CC); + if (Z_TYPE_P(&viewOptions) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&viewOptions); + array_init(&viewOptions); } - ZEPHIR_OBS_VAR(cacheOptions); - if (!(zephir_array_isset_string_fetch(&cacheOptions, viewOptions, SS("cache"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(cacheOptions); - array_init(cacheOptions); + ZEPHIR_OBS_VAR(&cacheOptions); + if (!(zephir_array_isset_string_fetch(&cacheOptions, &viewOptions, SL("cache"), 0))) { + ZEPHIR_INIT_NVAR(&cacheOptions); + array_init(&cacheOptions); } - zephir_is_iterable(options, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/view.zep", 1264); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HMKEY(key, _1$$3, _0$$3); - ZEPHIR_GET_HVALUE(value, _2$$3); - zephir_array_update_zval(&cacheOptions, key, &value, PH_COPY | PH_SEPARATE); - } - if (zephir_array_isset_string_fetch(&cacheLevel, cacheOptions, SS("level"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_cacheLevel"), cacheLevel TSRMLS_CC); + zephir_is_iterable(options, 0, "phalcon/mvc/view.zep", 1264); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(options), _1$$3, _2$$3, _0$$3) + { + ZEPHIR_INIT_NVAR(&key); + if (_2$$3 != NULL) { + ZVAL_STR_COPY(&key, _2$$3); + } else { + ZVAL_LONG(&key, _1$$3); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0$$3); + zephir_array_update_zval(&cacheOptions, &key, &value, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + if (zephir_array_isset_string_fetch(&cacheLevel, &cacheOptions, SL("level"), 1)) { + zephir_update_property_zval(this_ptr, SL("_cacheLevel"), &cacheLevel); } else { ZEPHIR_INIT_ZVAL_NREF(_3$$8); - ZVAL_LONG(_3$$8, 5); - zephir_update_property_this(getThis(), SL("_cacheLevel"), _3$$8 TSRMLS_CC); + ZVAL_LONG(&_3$$8, 5); + zephir_update_property_zval(this_ptr, SL("_cacheLevel"), &_3$$8); } zephir_array_update_string(&viewOptions, SL("cache"), &cacheOptions, PH_COPY | PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_options"), viewOptions TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &viewOptions); } else { if (zephir_is_true(options)) { ZEPHIR_INIT_ZVAL_NREF(_4$$10); - ZVAL_LONG(_4$$10, 5); - zephir_update_property_this(getThis(), SL("_cacheLevel"), _4$$10 TSRMLS_CC); + ZVAL_LONG(&_4$$10, 5); + zephir_update_property_zval(this_ptr, SL("_cacheLevel"), &_4$$10); } else { ZEPHIR_INIT_ZVAL_NREF(_5$$11); - ZVAL_LONG(_5$$11, 0); - zephir_update_property_this(getThis(), SL("_cacheLevel"), _5$$11 TSRMLS_CC); + ZVAL_LONG(&_5$$11, 0); + zephir_update_property_zval(this_ptr, SL("_cacheLevel"), &_5$$11); } } RETURN_THIS(); @@ -1897,15 +2181,18 @@ PHP_METHOD(Phalcon_Mvc_View, cache) { PHP_METHOD(Phalcon_Mvc_View, setContent) { zval *content_param = NULL; - zval *content = NULL; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &content_param); - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); - zephir_update_property_this(getThis(), SL("_content"), content TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_content"), &content); RETURN_THIS(); } @@ -1915,7 +2202,8 @@ PHP_METHOD(Phalcon_Mvc_View, setContent) { */ PHP_METHOD(Phalcon_Mvc_View, getContent) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_content"); @@ -1926,29 +2214,34 @@ PHP_METHOD(Phalcon_Mvc_View, getContent) { */ PHP_METHOD(Phalcon_Mvc_View, getActiveRenderPath) { - zval *activeRenderPath = NULL, *_0 = NULL, *_1$$5; + zval activeRenderPath, _0, _1$$5; zend_long ZEPHIR_LAST_CALL_STATUS, viewsDirsCount = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&activeRenderPath); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&_0, this_ptr, "getviewsdirs", NULL, 0); zephir_check_call_status(); - viewsDirsCount = zephir_fast_count_int(_0 TSRMLS_CC); - ZEPHIR_OBS_VAR(activeRenderPath); - zephir_read_property_this(&activeRenderPath, this_ptr, SL("_activeRenderPaths"), PH_NOISY_CC); + viewsDirsCount = zephir_fast_count_int(&_0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&activeRenderPath); + zephir_read_property(&activeRenderPath, this_ptr, SL("_activeRenderPaths"), PH_NOISY_CC); if (viewsDirsCount == 1) { - if (Z_TYPE_P(activeRenderPath) == IS_ARRAY) { - if (zephir_fast_count_int(activeRenderPath TSRMLS_CC)) { - zephir_array_fetch_long(&_1$$5, activeRenderPath, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/view.zep", 1322 TSRMLS_CC); - ZEPHIR_CPY_WRT(activeRenderPath, _1$$5); + if (Z_TYPE_P(&activeRenderPath) == IS_ARRAY) { + if (zephir_fast_count_int(&activeRenderPath TSRMLS_CC)) { + zephir_array_fetch_long(&_1$$5, &activeRenderPath, 0, PH_NOISY | PH_READONLY, "phalcon/mvc/view.zep", 1322 TSRMLS_CC); + ZEPHIR_CPY_WRT(&activeRenderPath, &_1$$5); } } } - if (Z_TYPE_P(activeRenderPath) == IS_NULL) { - ZEPHIR_INIT_NVAR(activeRenderPath); - ZVAL_STRING(activeRenderPath, "", 1); + if (Z_TYPE_P(&activeRenderPath) == IS_NULL) { + ZEPHIR_INIT_NVAR(&activeRenderPath); + ZVAL_STRING(&activeRenderPath, ""); } - RETURN_CCTOR(activeRenderPath); + RETURN_CCTOR(&activeRenderPath); } @@ -1957,12 +2250,17 @@ PHP_METHOD(Phalcon_Mvc_View, getActiveRenderPath) { */ PHP_METHOD(Phalcon_Mvc_View, disable) { - + zval __$true, __$false; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + if (1) { - zephir_update_property_this(getThis(), SL("_disabled"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_disabled"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_disabled"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_disabled"), &__$false); } RETURN_THISW(); @@ -1973,12 +2271,17 @@ PHP_METHOD(Phalcon_Mvc_View, disable) { */ PHP_METHOD(Phalcon_Mvc_View, enable) { - + zval __$true, __$false; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + if (0) { - zephir_update_property_this(getThis(), SL("_disabled"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_disabled"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_disabled"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_disabled"), &__$false); } RETURN_THISW(); @@ -1989,34 +2292,42 @@ PHP_METHOD(Phalcon_Mvc_View, enable) { */ PHP_METHOD(Phalcon_Mvc_View, reset) { - zval *_0, *_1, *_2; + zval __$true, __$false, __$null, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); if (0) { - zephir_update_property_this(getThis(), SL("_disabled"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_disabled"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_disabled"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_disabled"), &__$false); } if (0) { - zephir_update_property_this(getThis(), SL("_engines"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_engines"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_engines"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_engines"), &__$false); } - zephir_update_property_this(getThis(), SL("_cache"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &__$null); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 5); - zephir_update_property_this(getThis(), SL("_renderLevel"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, 5); + zephir_update_property_zval(this_ptr, SL("_renderLevel"), &_0); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_cacheLevel"), _0 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_content"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - array_init(_1); - zephir_update_property_this(getThis(), SL("_templatesBefore"), _1 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - array_init(_2); - zephir_update_property_this(getThis(), SL("_templatesAfter"), _2 TSRMLS_CC); + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_cacheLevel"), &_0); + zephir_update_property_zval(this_ptr, SL("_content"), &__$null); + ZEPHIR_INIT_VAR(&_1); + array_init(&_1); + zephir_update_property_zval(this_ptr, SL("_templatesBefore"), &_1); + ZEPHIR_INIT_VAR(&_2); + array_init(&_2); + zephir_update_property_zval(this_ptr, SL("_templatesAfter"), &_2); RETURN_THIS(); } @@ -2030,25 +2341,29 @@ PHP_METHOD(Phalcon_Mvc_View, reset) { */ PHP_METHOD(Phalcon_Mvc_View, __set) { - zval *key_param = NULL, *value; - zval *key = NULL; + zval *key_param = NULL, *value, value_sub; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &value); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - zephir_update_property_array(this_ptr, SL("_viewParams"), key, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_viewParams"), &key, value TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -2062,27 +2377,32 @@ PHP_METHOD(Phalcon_Mvc_View, __set) { */ PHP_METHOD(Phalcon_Mvc_View, __get) { - zval *key_param = NULL, *value = NULL, *_0; - zval *key = NULL; + zval *key_param = NULL, value, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_viewParams"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&value, _0, key, 1 TSRMLS_CC)) { - RETURN_CTOR(value); + zephir_read_property(&_0, this_ptr, SL("_viewParams"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&value, &_0, &key, 1 TSRMLS_CC)) { + RETURN_CTOR(&value); } RETURN_MM_NULL(); @@ -2093,7 +2413,8 @@ PHP_METHOD(Phalcon_Mvc_View, __get) { */ PHP_METHOD(Phalcon_Mvc_View, isDisabled) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_disabled"); @@ -2108,26 +2429,30 @@ PHP_METHOD(Phalcon_Mvc_View, isDisabled) { */ PHP_METHOD(Phalcon_Mvc_View, __isset) { - zval *key_param = NULL, *_0; - zval *key = NULL; + zval *key_param = NULL, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_viewParams"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_0, key)); + zephir_read_property(&_0, this_ptr, SL("_viewParams"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_0, &key)); } @@ -2136,69 +2461,70 @@ PHP_METHOD(Phalcon_Mvc_View, __isset) { */ PHP_METHOD(Phalcon_Mvc_View, getViewsDirs) { - zval *_0, *_1$$3; + zval _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_viewsDirs"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_STRING) { + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_viewsDirs"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) == IS_STRING) { zephir_create_array(return_value, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_1$$3); - zephir_read_property_this(&_1$$3, this_ptr, SL("_viewsDirs"), PH_NOISY_CC); - zephir_array_fast_append(return_value, _1$$3); + ZEPHIR_OBS_VAR(&_1$$3); + zephir_read_property(&_1$$3, this_ptr, SL("_viewsDirs"), PH_NOISY_CC); + zephir_array_fast_append(return_value, &_1$$3); RETURN_MM(); } RETURN_MM_MEMBER(getThis(), "_viewsDirs"); } -zend_object_value zephir_init_properties_Phalcon_Mvc_View(zend_class_entry *class_type TSRMLS_DC) { +zend_object *zephir_init_properties_Phalcon_Mvc_View(zend_class_entry *class_type TSRMLS_DC) { - zval *_0, *_2, *_4, *_6, *_1$$3, *_3$$4, *_5$$5, *_7$$6; + zval _0, _2, _4, _6, _1$$3, _3$$4, _5$$5, _7$$6; + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_7$$6); ZEPHIR_MM_GROW(); { - zval zthis = zval_used_for_init; - zval *this_ptr = &zthis; - zend_object* obj = ecalloc(1, sizeof(zend_object)); - zend_object_value retval; - - zend_object_std_init(obj, class_type TSRMLS_CC); - object_properties_init(obj, class_type); - retval.handle = zend_objects_store_put(obj, (zend_objects_store_dtor_t)zend_objects_destroy_object, zephir_free_object_storage, NULL TSRMLS_CC); - retval.handlers = zend_get_std_object_handlers(); - - Z_TYPE(zthis) = IS_OBJECT; - Z_OBJVAL(zthis) = retval; - - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_templatesAfter"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_property_this(getThis(), SL("_templatesAfter"), _1$$3 TSRMLS_CC); + zval local_this_ptr, *this_ptr = &local_this_ptr; + ZEPHIR_CREATE_OBJECT(this_ptr, class_type); + zephir_read_property(&_0, this_ptr, SL("_templatesAfter"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zephir_update_property_zval(this_ptr, SL("_templatesAfter"), &_1$$3); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_templatesBefore"), PH_NOISY_CC); - if (Z_TYPE_P(_2) == IS_NULL) { - ZEPHIR_INIT_VAR(_3$$4); - array_init(_3$$4); - zephir_update_property_this(getThis(), SL("_templatesBefore"), _3$$4 TSRMLS_CC); + zephir_read_property(&_2, this_ptr, SL("_templatesBefore"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_2) == IS_NULL) { + ZEPHIR_INIT_VAR(&_3$$4); + array_init(&_3$$4); + zephir_update_property_zval(this_ptr, SL("_templatesBefore"), &_3$$4); } - _4 = zephir_fetch_nproperty_this(this_ptr, SL("_viewsDirs"), PH_NOISY_CC); - if (Z_TYPE_P(_4) == IS_NULL) { - ZEPHIR_INIT_VAR(_5$$5); - array_init(_5$$5); - zephir_update_property_this(getThis(), SL("_viewsDirs"), _5$$5 TSRMLS_CC); + zephir_read_property(&_4, this_ptr, SL("_viewsDirs"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_4) == IS_NULL) { + ZEPHIR_INIT_VAR(&_5$$5); + array_init(&_5$$5); + zephir_update_property_zval(this_ptr, SL("_viewsDirs"), &_5$$5); } - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_viewParams"), PH_NOISY_CC); - if (Z_TYPE_P(_6) == IS_NULL) { - ZEPHIR_INIT_VAR(_7$$6); - array_init(_7$$6); - zephir_update_property_this(getThis(), SL("_viewParams"), _7$$6 TSRMLS_CC); + zephir_read_property(&_6, this_ptr, SL("_viewParams"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_6) == IS_NULL) { + ZEPHIR_INIT_VAR(&_7$$6); + array_init(&_7$$6); + zephir_update_property_zval(this_ptr, SL("_viewParams"), &_7$$6); } ZEPHIR_MM_RESTORE(); - return retval; + return Z_OBJ_P(this_ptr); } } diff --git a/ext/phalcon/mvc/view.zep.h b/ext/phalcon/mvc/view.zep.h index da43a67b737..ed9dbec44e4 100644 --- a/ext/phalcon/mvc/view.zep.h +++ b/ext/phalcon/mvc/view.zep.h @@ -60,173 +60,525 @@ PHP_METHOD(Phalcon_Mvc_View, __get); PHP_METHOD(Phalcon_Mvc_View, isDisabled); PHP_METHOD(Phalcon_Mvc_View, __isset); PHP_METHOD(Phalcon_Mvc_View, getViewsDirs); -zend_object_value zephir_init_properties_Phalcon_Mvc_View(zend_class_entry *class_type TSRMLS_DC); +zend_object *zephir_init_properties_Phalcon_Mvc_View(zend_class_entry *class_type TSRMLS_DC); + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getregisteredengines, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getregisteredengines, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view___construct, 0, 0, 0) - ZEND_ARG_ARRAY_INFO(0, options, 1) + ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view__isabsolutepath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setviewsdir, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setviewsdir, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setviewsdir, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif ZEND_ARG_INFO(0, viewsDir) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setlayoutsdir, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setlayoutsdir, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setlayoutsdir, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, layoutsDir, IS_STRING, 0) +#else ZEND_ARG_INFO(0, layoutsDir) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getlayoutsdir, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getlayoutsdir, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setpartialsdir, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setpartialsdir, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setpartialsdir, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, partialsDir, IS_STRING, 0) +#else ZEND_ARG_INFO(0, partialsDir) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getpartialsdir, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getpartialsdir, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setbasepath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setbasepath, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setbasepath, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, basePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, basePath) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setrenderlevel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getbasepath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getbasepath, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setrenderlevel, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setrenderlevel, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) +#else ZEND_ARG_INFO(0, level) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_disablelevel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_disablelevel, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_disablelevel, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif ZEND_ARG_INFO(0, level) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setmainview, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setmainview, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setmainview, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewPath) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getmainview, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getmainview, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setlayout, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setlayout, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setlayout, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, layout, IS_STRING, 0) +#else ZEND_ARG_INFO(0, layout) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getlayout, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getlayout, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_settemplatebefore, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_settemplatebefore, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_settemplatebefore, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif ZEND_ARG_INFO(0, templateBefore) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_settemplateafter, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_cleantemplatebefore, 0, 0, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_cleantemplatebefore, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_settemplateafter, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_settemplateafter, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif ZEND_ARG_INFO(0, templateAfter) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setparamtoview, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_cleantemplateafter, 0, 0, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_cleantemplateafter, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setparamtoview, 0, 2, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setparamtoview, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setvars, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setvars, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setvars, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif ZEND_ARG_ARRAY_INFO(0, params, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setvar, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setvar, 0, 2, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setvar, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_getvar, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getparamstoview, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getparamstoview, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getcontrollername, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getcontrollername, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getactionname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getactionname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getparams, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getparams, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_start, 0, 0, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_start, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view__loadtemplateengines, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view__loadtemplateengines, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view__enginerender, 0, 0, 4) ZEND_ARG_INFO(0, engines) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewPath) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, silence, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, silence) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, mustClean, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, mustClean) +#endif ZEND_ARG_OBJ_INFO(0, cache, Phalcon\\Cache\\BackendInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_registerengines, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_registerengines, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_registerengines, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif ZEND_ARG_ARRAY_INFO(0, engines, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_exists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_exists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_exists, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, view, IS_STRING, 0) +#else ZEND_ARG_INFO(0, view) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_render, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_pick, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_pick, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_pick, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif ZEND_ARG_INFO(0, renderView) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_getpartial, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getpartial, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getpartial, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, partialPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, partialPath) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_partial, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, partialPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, partialPath) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_getrender, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getrender, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getrender, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif ZEND_ARG_INFO(0, params) ZEND_ARG_INFO(0, configCallback) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_cache, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_finish, 0, 0, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_finish, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view__createcache, 0, 0, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view__createcache, 0, 0, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_iscaching, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_iscaching, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_getcache, 0, 0, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getcache, 0, 0, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_cache, 0, 0, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_cache, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_setcontent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_setcontent, 0, 1, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_setcontent, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getcontent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getcontent, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_disable, 0, 0, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_disable, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_enable, 0, 0, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_enable, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_reset, 0, 0, Phalcon\\Mvc\\View, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_reset, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View", 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view___set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view___get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_isdisabled, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_isdisabled, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view___isset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view___isset, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view___isset, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getviewsdirs, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_getviewsdirs, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_view_method_entry) { PHP_ME(Phalcon_Mvc_View, getRenderLevel, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, getCurrentRenderLevel, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getRegisteredEngines, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getRegisteredEngines, arginfo_phalcon_mvc_view_getregisteredengines, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, __construct, arginfo_phalcon_mvc_view___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_View, _isAbsolutePath, arginfo_phalcon_mvc_view__isabsolutepath, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_View, setViewsDir, arginfo_phalcon_mvc_view_setviewsdir, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, getViewsDir, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setLayoutsDir, arginfo_phalcon_mvc_view_setlayoutsdir, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getLayoutsDir, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getLayoutsDir, arginfo_phalcon_mvc_view_getlayoutsdir, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setPartialsDir, arginfo_phalcon_mvc_view_setpartialsdir, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getPartialsDir, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getPartialsDir, arginfo_phalcon_mvc_view_getpartialsdir, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setBasePath, arginfo_phalcon_mvc_view_setbasepath, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getBasePath, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getBasePath, arginfo_phalcon_mvc_view_getbasepath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setRenderLevel, arginfo_phalcon_mvc_view_setrenderlevel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, disableLevel, arginfo_phalcon_mvc_view_disablelevel, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setMainView, arginfo_phalcon_mvc_view_setmainview, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getMainView, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getMainView, arginfo_phalcon_mvc_view_getmainview, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setLayout, arginfo_phalcon_mvc_view_setlayout, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getLayout, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getLayout, arginfo_phalcon_mvc_view_getlayout, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setTemplateBefore, arginfo_phalcon_mvc_view_settemplatebefore, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, cleanTemplateBefore, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, cleanTemplateBefore, arginfo_phalcon_mvc_view_cleantemplatebefore, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setTemplateAfter, arginfo_phalcon_mvc_view_settemplateafter, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, cleanTemplateAfter, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, cleanTemplateAfter, arginfo_phalcon_mvc_view_cleantemplateafter, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setParamToView, arginfo_phalcon_mvc_view_setparamtoview, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setVars, arginfo_phalcon_mvc_view_setvars, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setVar, arginfo_phalcon_mvc_view_setvar, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, getVar, arginfo_phalcon_mvc_view_getvar, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getParamsToView, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getControllerName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getActionName, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getParams, NULL, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, start, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, _loadTemplateEngines, NULL, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_View, getParamsToView, arginfo_phalcon_mvc_view_getparamstoview, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getControllerName, arginfo_phalcon_mvc_view_getcontrollername, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getActionName, arginfo_phalcon_mvc_view_getactionname, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getParams, arginfo_phalcon_mvc_view_getparams, ZEND_ACC_DEPRECATED|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, start, arginfo_phalcon_mvc_view_start, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, _loadTemplateEngines, arginfo_phalcon_mvc_view__loadtemplateengines, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_View, _engineRender, arginfo_phalcon_mvc_view__enginerender, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_View, registerEngines, arginfo_phalcon_mvc_view_registerengines, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, exists, arginfo_phalcon_mvc_view_exists, ZEND_ACC_PUBLIC) @@ -235,21 +587,21 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_view_method_entry) { PHP_ME(Phalcon_Mvc_View, getPartial, arginfo_phalcon_mvc_view_getpartial, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, partial, arginfo_phalcon_mvc_view_partial, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, getRender, arginfo_phalcon_mvc_view_getrender, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, finish, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, _createCache, NULL, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_View, isCaching, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getCache, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, finish, arginfo_phalcon_mvc_view_finish, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, _createCache, arginfo_phalcon_mvc_view__createcache, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_View, isCaching, arginfo_phalcon_mvc_view_iscaching, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getCache, arginfo_phalcon_mvc_view_getcache, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, cache, arginfo_phalcon_mvc_view_cache, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, setContent, arginfo_phalcon_mvc_view_setcontent, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getContent, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, getContent, arginfo_phalcon_mvc_view_getcontent, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, getActiveRenderPath, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, disable, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, enable, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, reset, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, disable, arginfo_phalcon_mvc_view_disable, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, enable, arginfo_phalcon_mvc_view_enable, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, reset, arginfo_phalcon_mvc_view_reset, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, __set, arginfo_phalcon_mvc_view___set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, __get, arginfo_phalcon_mvc_view___get, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, isDisabled, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View, isDisabled, arginfo_phalcon_mvc_view_isdisabled, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View, __isset, arginfo_phalcon_mvc_view___isset, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View, getViewsDirs, NULL, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_View, getViewsDirs, arginfo_phalcon_mvc_view_getviewsdirs, ZEND_ACC_PROTECTED) PHP_FE_END }; diff --git a/ext/phalcon/mvc/view/engine.zep.c b/ext/phalcon/mvc/view/engine.zep.c index 82ca95e508c..9a0430ac0ed 100644 --- a/ext/phalcon/mvc/view/engine.zep.c +++ b/ext/phalcon/mvc/view/engine.zep.c @@ -42,17 +42,23 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine) { */ PHP_METHOD(Phalcon_Mvc_View_Engine, __construct) { - zval *view, *dependencyInjector = NULL; + zval *view, view_sub, *dependencyInjector = NULL, dependencyInjector_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&view_sub); + ZVAL_UNDEF(&dependencyInjector_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 1, 1, &view, &dependencyInjector); if (!dependencyInjector) { - dependencyInjector = ZEPHIR_GLOBAL(global_null); + dependencyInjector = &dependencyInjector_sub; + dependencyInjector = &__$null; } - zephir_update_property_this(getThis(), SL("_view"), view TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_view"), view); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -61,13 +67,16 @@ PHP_METHOD(Phalcon_Mvc_View_Engine, __construct) { */ PHP_METHOD(Phalcon_Mvc_View_Engine, getContent) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_view"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "getcontent", NULL, 0); + zephir_read_property(&_0, this_ptr, SL("_view"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "getcontent", NULL, 0); zephir_check_call_status(); RETURN_MM(); @@ -83,29 +92,36 @@ PHP_METHOD(Phalcon_Mvc_View_Engine, getContent) { PHP_METHOD(Phalcon_Mvc_View_Engine, partial) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *partialPath_param = NULL, *params = NULL, *_0; - zval *partialPath = NULL; + zval *partialPath_param = NULL, *params = NULL, params_sub, __$null, _0; + zval partialPath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&partialPath); + ZVAL_UNDEF(¶ms_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &partialPath_param, ¶ms); if (UNEXPECTED(Z_TYPE_P(partialPath_param) != IS_STRING && Z_TYPE_P(partialPath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(partialPath_param) == IS_STRING)) { - zephir_get_strval(partialPath, partialPath_param); + zephir_get_strval(&partialPath, partialPath_param); } else { - ZEPHIR_INIT_VAR(partialPath); - ZVAL_EMPTY_STRING(partialPath); + ZEPHIR_INIT_VAR(&partialPath); + ZVAL_EMPTY_STRING(&partialPath); } if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_view"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "partial", NULL, 0, partialPath, params); + zephir_read_property(&_0, this_ptr, SL("_view"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "partial", NULL, 0, &partialPath, params); zephir_check_call_status(); RETURN_MM(); @@ -116,7 +132,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine, partial) { */ PHP_METHOD(Phalcon_Mvc_View_Engine, getView) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_view"); diff --git a/ext/phalcon/mvc/view/engine.zep.h b/ext/phalcon/mvc/view/engine.zep.h index cd6a34e1971..41fdd2cce40 100644 --- a/ext/phalcon/mvc/view/engine.zep.h +++ b/ext/phalcon/mvc/view/engine.zep.h @@ -13,15 +13,37 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine___construct, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_partial, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_getcontent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_getcontent, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_partial, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_partial, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, partialPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, partialPath) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_engine_getview, 0, 0, Phalcon\\Mvc\\ViewBaseInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_getview, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\ViewBaseInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_view_engine_method_entry) { PHP_ME(Phalcon_Mvc_View_Engine, __construct, arginfo_phalcon_mvc_view_engine___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Mvc_View_Engine, getContent, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine, getContent, arginfo_phalcon_mvc_view_engine_getcontent, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine, partial, arginfo_phalcon_mvc_view_engine_partial, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine, getView, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine, getView, arginfo_phalcon_mvc_view_engine_getview, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/view/engine/php.zep.c b/ext/phalcon/mvc/view/engine/php.zep.c index fa38b0bb17d..5b8a004c374 100644 --- a/ext/phalcon/mvc/view/engine/php.zep.c +++ b/ext/phalcon/mvc/view/engine/php.zep.c @@ -39,25 +39,34 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Php) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Php, render) { - HashTable *_1$$4; - HashPosition _0$$4; + zend_string *_2$$4; + zend_ulong _1$$4; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool mustClean; - zval *path_param = NULL, *params, *mustClean_param = NULL, *key = NULL, *value = NULL, **_2$$4, *_3$$5 = NULL, *_4$$6, *_5$$6 = NULL; - zval *path = NULL; + zval *path_param = NULL, *params, params_sub, *mustClean_param = NULL, key, value, *_0$$4, _3$$5, _4$$6, _5$$6; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(¶ms_sub); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &path_param, ¶ms, &mustClean_param); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } if (!mustClean_param) { mustClean = 0; @@ -67,31 +76,37 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Php, render) { if (mustClean == 1) { - ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 403); + ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 357); zephir_check_call_status(); } if (Z_TYPE_P(params) == IS_ARRAY) { - zephir_is_iterable(params, &_1$$4, &_0$$4, 0, 0, "phalcon/mvc/view/engine/php.zep", 50); - for ( - ; zend_hash_get_current_data_ex(_1$$4, (void**) &_2$$4, &_0$$4) == SUCCESS - ; zend_hash_move_forward_ex(_1$$4, &_0$$4) - ) { - ZEPHIR_GET_HMKEY(key, _1$$4, _0$$4); - ZEPHIR_GET_HVALUE(value, _2$$4); - ZEPHIR_CPY_WRT(_3$$5, value); - if (zephir_set_symbol(key, _3$$5 TSRMLS_CC) == FAILURE) { + zephir_is_iterable(params, 0, "phalcon/mvc/view/engine/php.zep", 50); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(params), _1$$4, _2$$4, _0$$4) + { + ZEPHIR_INIT_NVAR(&key); + if (_2$$4 != NULL) { + ZVAL_STR_COPY(&key, _2$$4); + } else { + ZVAL_LONG(&key, _1$$4); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0$$4); + ZEPHIR_CPY_WRT(&_3$$5, &value); + if (zephir_set_symbol(&key, &_3$$5 TSRMLS_CC) == FAILURE) { return; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } - if (zephir_require_zval(path TSRMLS_CC) == FAILURE) { + if (zephir_require_zval(&path TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } if (mustClean == 1) { - _4$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_view"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_5$$6, "ob_get_contents", NULL, 141); + zephir_read_property(&_4$$6, this_ptr, SL("_view"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_5$$6, "ob_get_contents", NULL, 122); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _4$$6, "setcontent", NULL, 0, _5$$6); + ZEPHIR_CALL_METHOD(NULL, &_4$$6, "setcontent", NULL, 0, &_5$$6); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/mvc/view/engine/php.zep.h b/ext/phalcon/mvc/view/engine/php.zep.h index 1457c9cd669..4eb0279d98e 100644 --- a/ext/phalcon/mvc/view/engine/php.zep.h +++ b/ext/phalcon/mvc/view/engine/php.zep.h @@ -6,9 +6,17 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Php); PHP_METHOD(Phalcon_Mvc_View_Engine_Php, render); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_php_render, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, params) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, mustClean, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, mustClean) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_view_engine_php_method_entry) { diff --git a/ext/phalcon/mvc/view/engine/volt.zep.c b/ext/phalcon/mvc/view/engine/volt.zep.c index 3345223a288..9a44ac380b5 100644 --- a/ext/phalcon/mvc/view/engine/volt.zep.c +++ b/ext/phalcon/mvc/view/engine/volt.zep.c @@ -49,14 +49,19 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Volt) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, setOptions) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &options_param); + ZVAL_UNDEF(&options); - options = options_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &options_param); + + ZEPHIR_OBS_COPY_OR_DUP(&options, options_param); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &options); + ZEPHIR_MM_RESTORE(); } @@ -65,7 +70,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, setOptions) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, getOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -76,34 +82,41 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, getOptions) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, getCompiler) { - zval *compiler = NULL, *dependencyInjector = NULL, *options = NULL, *_0$$3, *_1$$3; + zval compiler, dependencyInjector, options, _0$$3, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&compiler); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(compiler); - zephir_read_property_this(&compiler, this_ptr, SL("_compiler"), PH_NOISY_CC); - if (Z_TYPE_P(compiler) != IS_OBJECT) { - ZEPHIR_INIT_NVAR(compiler); - object_init_ex(compiler, phalcon_mvc_view_engine_volt_compiler_ce); - _0$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_view"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, compiler, "__construct", NULL, 404, _0$$3); + ZEPHIR_OBS_VAR(&compiler); + zephir_read_property(&compiler, this_ptr, SL("_compiler"), PH_NOISY_CC); + if (Z_TYPE_P(&compiler) != IS_OBJECT) { + ZEPHIR_INIT_NVAR(&compiler); + object_init_ex(&compiler, phalcon_mvc_view_engine_volt_compiler_ce); + zephir_read_property(&_0$$3, this_ptr, SL("_view"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &compiler, "__construct", NULL, 358, &_0$$3); zephir_check_call_status(); - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _1$$3); - if (Z_TYPE_P(dependencyInjector) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(NULL, compiler, "setdi", NULL, 405, dependencyInjector); + zephir_read_property(&_1$$3, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_1$$3); + if (Z_TYPE_P(&dependencyInjector) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(NULL, &compiler, "setdi", NULL, 359, &dependencyInjector); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(NULL, compiler, "setoptions", NULL, 406, options); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + if (Z_TYPE_P(&options) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(NULL, &compiler, "setoptions", NULL, 360, &options); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_compiler"), compiler TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_compiler"), &compiler); } - RETURN_CCTOR(compiler); + RETURN_CCTOR(&compiler); } @@ -112,25 +125,36 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, getCompiler) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, render) { - HashTable *_1$$4; - HashPosition _0$$4; + zend_string *_2$$4; + zend_ulong _1$$4; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool mustClean; - zval *templatePath_param = NULL, *params, *mustClean_param = NULL, *compiler = NULL, *compiledTemplatePath = NULL, *key = NULL, *value = NULL, **_2$$4, *_3$$5 = NULL, *_4$$6, *_5$$6 = NULL; - zval *templatePath = NULL; + zval *templatePath_param = NULL, *params, params_sub, *mustClean_param = NULL, compiler, compiledTemplatePath, key, value, *_0$$4, _3$$5, _4$$6, _5$$6; + zval templatePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&templatePath); + ZVAL_UNDEF(¶ms_sub); + ZVAL_UNDEF(&compiler); + ZVAL_UNDEF(&compiledTemplatePath); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_5$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &templatePath_param, ¶ms, &mustClean_param); if (UNEXPECTED(Z_TYPE_P(templatePath_param) != IS_STRING && Z_TYPE_P(templatePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'templatePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'templatePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(templatePath_param) == IS_STRING)) { - zephir_get_strval(templatePath, templatePath_param); + zephir_get_strval(&templatePath, templatePath_param); } else { - ZEPHIR_INIT_VAR(templatePath); - ZVAL_EMPTY_STRING(templatePath); + ZEPHIR_INIT_VAR(&templatePath); + ZVAL_EMPTY_STRING(&templatePath); } if (!mustClean_param) { mustClean = 0; @@ -140,37 +164,43 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, render) { if (mustClean) { - ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 403); + ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 357); zephir_check_call_status(); } ZEPHIR_CALL_METHOD(&compiler, this_ptr, "getcompiler", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, compiler, "compile", NULL, 0, templatePath); + ZEPHIR_CALL_METHOD(NULL, &compiler, "compile", NULL, 0, &templatePath); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&compiledTemplatePath, compiler, "getcompiledtemplatepath", NULL, 0); + ZEPHIR_CALL_METHOD(&compiledTemplatePath, &compiler, "getcompiledtemplatepath", NULL, 0); zephir_check_call_status(); if (Z_TYPE_P(params) == IS_ARRAY) { - zephir_is_iterable(params, &_1$$4, &_0$$4, 0, 0, "phalcon/mvc/view/engine/volt.zep", 116); - for ( - ; zend_hash_get_current_data_ex(_1$$4, (void**) &_2$$4, &_0$$4) == SUCCESS - ; zend_hash_move_forward_ex(_1$$4, &_0$$4) - ) { - ZEPHIR_GET_HMKEY(key, _1$$4, _0$$4); - ZEPHIR_GET_HVALUE(value, _2$$4); - ZEPHIR_CPY_WRT(_3$$5, value); - if (zephir_set_symbol(key, _3$$5 TSRMLS_CC) == FAILURE) { + zephir_is_iterable(params, 0, "phalcon/mvc/view/engine/volt.zep", 116); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(params), _1$$4, _2$$4, _0$$4) + { + ZEPHIR_INIT_NVAR(&key); + if (_2$$4 != NULL) { + ZVAL_STR_COPY(&key, _2$$4); + } else { + ZVAL_LONG(&key, _1$$4); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0$$4); + ZEPHIR_CPY_WRT(&_3$$5, &value); + if (zephir_set_symbol(&key, &_3$$5 TSRMLS_CC) == FAILURE) { return; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); } - if (zephir_require_zval(compiledTemplatePath TSRMLS_CC) == FAILURE) { + if (zephir_require_zval(&compiledTemplatePath TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } if (mustClean) { - _4$$6 = zephir_fetch_nproperty_this(this_ptr, SL("_view"), PH_NOISY_CC); - ZEPHIR_CALL_FUNCTION(&_5$$6, "ob_get_contents", NULL, 141); + zephir_read_property(&_4$$6, this_ptr, SL("_view"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_5$$6, "ob_get_contents", NULL, 122); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _4$$6, "setcontent", NULL, 0, _5$$6); + ZEPHIR_CALL_METHOD(NULL, &_4$$6, "setcontent", NULL, 0, &_5$$6); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -184,7 +214,10 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *item; + zval *item, item_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&item_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &item); @@ -198,8 +231,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) { if (_0) { RETURN_MM_LONG(zephir_fast_count_int(item TSRMLS_CC)); } - if ((zephir_function_exists_ex(SS("mb_strlen") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 238, item); + if ((zephir_function_exists_ex(SL("mb_strlen") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_FUNCTION("mb_strlen", NULL, 200, item); zephir_check_call_status(); RETURN_MM(); } @@ -213,7 +246,13 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, length) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, isIncluded) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *needle, *haystack, *_0$$5 = NULL, *_1$$4; + zval *needle, needle_sub, *haystack, haystack_sub, _0$$5, _1$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&needle_sub); + ZVAL_UNDEF(&haystack_sub); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &needle, &haystack); @@ -224,14 +263,14 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, isIncluded) { RETURN_MM_BOOL(zephir_fast_in_array(needle, haystack TSRMLS_CC)); } if (Z_TYPE_P(haystack) == IS_STRING) { - if ((zephir_function_exists_ex(SS("mb_strpos") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_FUNCTION(&_0$$5, "mb_strpos", NULL, 407, haystack, needle); + if ((zephir_function_exists_ex(SL("mb_strpos") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_FUNCTION(&_0$$5, "mb_strpos", NULL, 361, haystack, needle); zephir_check_call_status(); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(_0$$5)); + RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_0$$5)); } - ZEPHIR_INIT_VAR(_1$$4); - zephir_fast_strpos(_1$$4, haystack, needle, 0 ); - RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(_1$$4)); + ZEPHIR_INIT_VAR(&_1$$4); + zephir_fast_strpos(&_1$$4, haystack, needle, 0 ); + RETURN_MM_BOOL(!ZEPHIR_IS_FALSE_IDENTICAL(&_1$$4)); } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "Invalid haystack", "phalcon/mvc/view/engine/volt.zep", 158); return; @@ -246,59 +285,64 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, convertEncoding) { zend_bool _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; zval *text_param = NULL, *from_param = NULL, *to_param = NULL; - zval *text = NULL, *from = NULL, *to = NULL; + zval text, from, to; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&from); + ZVAL_UNDEF(&to); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &text_param, &from_param, &to_param); - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); if (UNEXPECTED(Z_TYPE_P(from_param) != IS_STRING && Z_TYPE_P(from_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'from' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'from' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(from_param) == IS_STRING)) { - zephir_get_strval(from, from_param); + zephir_get_strval(&from, from_param); } else { - ZEPHIR_INIT_VAR(from); - ZVAL_EMPTY_STRING(from); + ZEPHIR_INIT_VAR(&from); + ZVAL_EMPTY_STRING(&from); } if (UNEXPECTED(Z_TYPE_P(to_param) != IS_STRING && Z_TYPE_P(to_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'to' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'to' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(to_param) == IS_STRING)) { - zephir_get_strval(to, to_param); + zephir_get_strval(&to, to_param); } else { - ZEPHIR_INIT_VAR(to); - ZVAL_EMPTY_STRING(to); + ZEPHIR_INIT_VAR(&to); + ZVAL_EMPTY_STRING(&to); } - _0 = ZEPHIR_IS_STRING(from, "latin1"); + _0 = ZEPHIR_IS_STRING(&from, "latin1"); if (!(_0)) { - _0 = ZEPHIR_IS_STRING(to, "utf8"); + _0 = ZEPHIR_IS_STRING(&to, "utf8"); } if (_0) { - ZEPHIR_RETURN_CALL_FUNCTION("utf8_encode", NULL, 408, text); + ZEPHIR_RETURN_CALL_FUNCTION("utf8_encode", NULL, 362, &text); zephir_check_call_status(); RETURN_MM(); } - _1 = ZEPHIR_IS_STRING(to, "latin1"); + _1 = ZEPHIR_IS_STRING(&to, "latin1"); if (!(_1)) { - _1 = ZEPHIR_IS_STRING(from, "utf8"); + _1 = ZEPHIR_IS_STRING(&from, "utf8"); } if (_1) { - ZEPHIR_RETURN_CALL_FUNCTION("utf8_decode", NULL, 409, text); + ZEPHIR_RETURN_CALL_FUNCTION("utf8_decode", NULL, 363, &text); zephir_check_call_status(); RETURN_MM(); } - if ((zephir_function_exists_ex(SS("mb_convert_encoding") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_encoding", NULL, 203, text, from, to); + if ((zephir_function_exists_ex(SL("mb_convert_encoding") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_FUNCTION("mb_convert_encoding", NULL, 179, &text, &from, &to); zephir_check_call_status(); RETURN_MM(); } - if ((zephir_function_exists_ex(SS("iconv") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_RETURN_CALL_FUNCTION("iconv", NULL, 410, from, to, text); + if ((zephir_function_exists_ex(SL("iconv") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_RETURN_CALL_FUNCTION("iconv", NULL, 364, &from, &to, &text); zephir_check_call_status(); RETURN_MM(); } @@ -315,7 +359,21 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, slice) { zend_bool _1$$5; zephir_fcall_cache_entry *_3 = NULL, *_4 = NULL; zend_long start, ZEPHIR_LAST_CALL_STATUS, position = 0; - zval *value, *start_param = NULL, *end = NULL, *length = NULL, *slice = NULL, _9, *_0$$3 = NULL, *_2$$6 = NULL, _5$$9, _6$$11, _7$$10, _8$$12; + zval *value, value_sub, *start_param = NULL, *end = NULL, end_sub, __$null, length, slice, _9, _0$$3, _2$$6, _5$$9, _6$$11, _7$$10, _8$$12; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&end_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&length); + ZVAL_UNDEF(&slice); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_6$$11); + ZVAL_UNDEF(&_7$$10); + ZVAL_UNDEF(&_8$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, &value, &start_param, &end); @@ -326,7 +384,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, slice) { start = zephir_get_intval(start_param); } if (!end) { - ZEPHIR_CPY_WRT(end, ZEPHIR_GLOBAL(global_null)); + end = &end_sub; + ZEPHIR_CPY_WRT(end, &__$null); } else { ZEPHIR_SEPARATE_PARAM(end); } @@ -338,14 +397,14 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, slice) { ZVAL_LONG(end, (zephir_fast_count_int(value TSRMLS_CC) - 1)); } position = 0; - ZEPHIR_INIT_VAR(slice); - array_init(slice); + ZEPHIR_INIT_VAR(&slice); + array_init(&slice); ZEPHIR_CALL_METHOD(NULL, value, "rewind", NULL, 0); zephir_check_call_status(); while (1) { ZEPHIR_CALL_METHOD(&_0$$3, value, "valid", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_0$$3))) { + if (!(zephir_is_true(&_0$$3))) { break; } _1$$5 = position >= start; @@ -355,48 +414,43 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, slice) { if (_1$$5) { ZEPHIR_CALL_METHOD(&_2$$6, value, "current", &_3, 0); zephir_check_call_status(); - zephir_array_append(&slice, _2$$6, PH_SEPARATE, "phalcon/mvc/view/engine/volt.zep", 223); + zephir_array_append(&slice, &_2$$6, PH_SEPARATE, "phalcon/mvc/view/engine/volt.zep", 223); } ZEPHIR_CALL_METHOD(NULL, value, "next", &_4, 0); zephir_check_call_status(); position++; } - RETURN_CCTOR(slice); + RETURN_CCTOR(&slice); } - ZEPHIR_INIT_VAR(length); + ZEPHIR_INIT_VAR(&length); if (Z_TYPE_P(end) != IS_NULL) { - ZVAL_LONG(length, (((zephir_get_numberval(end) - start)) + 1)); + ZVAL_LONG(&length, (((zephir_get_numberval(end) - start)) + 1)); } else { - ZVAL_NULL(length); + ZVAL_NULL(&length); } if (Z_TYPE_P(value) == IS_ARRAY) { - ZEPHIR_SINIT_VAR(_5$$9); ZVAL_LONG(&_5$$9, start); - ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 411, value, &_5$$9, length); + ZEPHIR_RETURN_CALL_FUNCTION("array_slice", NULL, 365, value, &_5$$9, &length); zephir_check_call_status(); RETURN_MM(); } - if ((zephir_function_exists_ex(SS("mb_substr") TSRMLS_CC) == SUCCESS)) { - if (Z_TYPE_P(length) != IS_NULL) { - ZEPHIR_SINIT_VAR(_6$$11); + if ((zephir_function_exists_ex(SL("mb_substr") TSRMLS_CC) == SUCCESS)) { + if (Z_TYPE_P(&length) != IS_NULL) { ZVAL_LONG(&_6$$11, start); - ZEPHIR_RETURN_CALL_FUNCTION("mb_substr", NULL, 160, value, &_6$$11, length); + ZEPHIR_RETURN_CALL_FUNCTION("mb_substr", NULL, 140, value, &_6$$11, &length); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_SINIT_VAR(_7$$10); ZVAL_LONG(&_7$$10, start); - ZEPHIR_RETURN_CALL_FUNCTION("mb_substr", NULL, 160, value, &_7$$10); + ZEPHIR_RETURN_CALL_FUNCTION("mb_substr", NULL, 140, value, &_7$$10); zephir_check_call_status(); RETURN_MM(); } - if (Z_TYPE_P(length) != IS_NULL) { - ZEPHIR_SINIT_VAR(_8$$12); + if (Z_TYPE_P(&length) != IS_NULL) { ZVAL_LONG(&_8$$12, start); - zephir_substr(return_value, value, zephir_get_intval(&_8$$12), zephir_get_intval(length), 0); + zephir_substr(return_value, value, zephir_get_intval(&_8$$12), zephir_get_intval(&length), 0); RETURN_MM(); } - ZEPHIR_SINIT_VAR(_9); ZVAL_LONG(&_9, start); zephir_substr(return_value, value, zephir_get_intval(&_9), 0, ZEPHIR_SUBSTR_NO_LENGTH); RETURN_MM(); @@ -410,19 +464,22 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, sort) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *value_param = NULL; - zval *value = NULL; + zval value; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&value); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &value_param); - zephir_get_arrval(value, value_param); + zephir_get_arrval(&value, value_param); - ZEPHIR_MAKE_REF(value); - ZEPHIR_CALL_FUNCTION(NULL, "asort", NULL, 412, value); - ZEPHIR_UNREF(value); + ZEPHIR_MAKE_REF(&value); + ZEPHIR_CALL_FUNCTION(NULL, "asort", NULL, 366, &value); + ZEPHIR_UNREF(&value); zephir_check_call_status(); - RETURN_CTOR(value); + RETURN_CTOR(&value); } @@ -432,45 +489,53 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, sort) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt, callMacro) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *arguments = NULL; - zval *name_param = NULL, *arguments_param = NULL, *macro = NULL, *_0, *_1$$3; - zval *name = NULL, *_2$$3; + zval arguments; + zval *name_param = NULL, *arguments_param = NULL, macro, _0, _1$$3; + zval name, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(¯o); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&arguments); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &arguments_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!arguments_param) { - ZEPHIR_INIT_VAR(arguments); - array_init(arguments); + ZEPHIR_INIT_VAR(&arguments); + array_init(&arguments); } else { - zephir_get_arrval(arguments, arguments_param); + zephir_get_arrval(&arguments, arguments_param); } - ZEPHIR_OBS_VAR(macro); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_macros"), PH_NOISY_CC); - if (!(zephir_array_isset_fetch(¯o, _0, name, 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_mvc_view_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SVS(_2$$3, "Macro '", name, "' does not exist"); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _2$$3); + ZEPHIR_OBS_VAR(¯o); + zephir_read_property(&_0, this_ptr, SL("_macros"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(¯o, &_0, &name, 0 TSRMLS_CC))) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_mvc_view_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SVS(&_2$$3, "Macro '", &name, "' does not exist"); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/mvc/view/engine/volt.zep", 287 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/mvc/view/engine/volt.zep", 287 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_RETURN_CALL_FUNCTION("call_user_func", NULL, 311, macro, arguments); + ZEPHIR_RETURN_CALL_FUNCTION("call_user_func", NULL, 271, ¯o, &arguments); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/mvc/view/engine/volt.zep.h b/ext/phalcon/mvc/view/engine/volt.zep.h index 5cf3d3b12f4..ab7448e66df 100644 --- a/ext/phalcon/mvc/view/engine/volt.zep.h +++ b/ext/phalcon/mvc/view/engine/volt.zep.h @@ -18,46 +18,104 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_setoptions, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_getoptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_getoptions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_getcompiler, 0, 0, Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_getcompiler, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_render, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, templatePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, templatePath) +#endif ZEND_ARG_INFO(0, params) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, mustClean, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, mustClean) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_length, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_length, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_length, 0, 1, IS_LONG, NULL, 0) +#endif ZEND_ARG_INFO(0, item) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_isincluded, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_isincluded, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_isincluded, 0, 2, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, needle) ZEND_ARG_INFO(0, haystack) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_convertencoding, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_convertencoding, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_convertencoding, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, from, IS_STRING, 0) +#else ZEND_ARG_INFO(0, from) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, to, IS_STRING, 0) +#else ZEND_ARG_INFO(0, to) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_slice, 0, 0, 1) ZEND_ARG_INFO(0, value) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, start, IS_LONG, 0) +#else ZEND_ARG_INFO(0, start) +#endif ZEND_ARG_INFO(0, end) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_sort, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_sort, 0, 1, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_sort, 0, 1, IS_ARRAY, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, value, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_callmacro, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) - ZEND_ARG_ARRAY_INFO(0, arguments, 1) +#endif + ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_view_engine_volt_method_entry) { PHP_ME(Phalcon_Mvc_View_Engine_Volt, setOptions, arginfo_phalcon_mvc_view_engine_volt_setoptions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt, getOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt, getCompiler, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt, getOptions, arginfo_phalcon_mvc_view_engine_volt_getoptions, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt, getCompiler, arginfo_phalcon_mvc_view_engine_volt_getcompiler, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt, render, arginfo_phalcon_mvc_view_engine_volt_render, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt, length, arginfo_phalcon_mvc_view_engine_volt_length, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt, isIncluded, arginfo_phalcon_mvc_view_engine_volt_isincluded, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/mvc/view/engine/volt/compiler.zep.c b/ext/phalcon/mvc/view/engine/volt/compiler.zep.c index 5acf196e2bb..7a29718f0c5 100644 --- a/ext/phalcon/mvc/view/engine/volt/compiler.zep.c +++ b/ext/phalcon/mvc/view/engine/volt/compiler.zep.c @@ -98,17 +98,22 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Volt_Compiler) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, __construct) { - zval *view = NULL; + zval *view = NULL, view_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&view_sub); + ZVAL_NULL(&__$null); zephir_fetch_params(0, 0, 1, &view); if (!view) { - view = ZEPHIR_GLOBAL(global_null); + view = &view_sub; + view = &__$null; } if (Z_TYPE_P(view) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_view"), view TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_view"), view); } } @@ -118,13 +123,16 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, __construct) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -133,7 +141,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setDI) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -145,14 +154,19 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getDI) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setOptions) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &options_param); + ZVAL_UNDEF(&options); - options = options_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &options_param); + + ZEPHIR_OBS_COPY_OR_DUP(&options, options_param); - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &options); + ZEPHIR_MM_RESTORE(); } @@ -164,25 +178,29 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setOptions) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setOption) { - zval *option_param = NULL, *value; - zval *option = NULL; + zval *option_param = NULL, *value, value_sub; + zval option; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &option_param, &value); if (UNEXPECTED(Z_TYPE_P(option_param) != IS_STRING && Z_TYPE_P(option_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(option_param) == IS_STRING)) { - zephir_get_strval(option, option_param); + zephir_get_strval(&option, option_param); } else { - ZEPHIR_INIT_VAR(option); - ZVAL_EMPTY_STRING(option); + ZEPHIR_INIT_VAR(&option); + ZVAL_EMPTY_STRING(&option); } - zephir_update_property_array(this_ptr, SL("_options"), option, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_options"), &option, value TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -195,27 +213,32 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setOption) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getOption) { - zval *option_param = NULL, *value = NULL, *_0; - zval *option = NULL; + zval *option_param = NULL, value, _0; + zval option; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&option); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &option_param); if (UNEXPECTED(Z_TYPE_P(option_param) != IS_STRING && Z_TYPE_P(option_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'option' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(option_param) == IS_STRING)) { - zephir_get_strval(option, option_param); + zephir_get_strval(&option, option_param); } else { - ZEPHIR_INIT_VAR(option); - ZVAL_EMPTY_STRING(option); + ZEPHIR_INIT_VAR(&option); + ZVAL_EMPTY_STRING(&option); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_options"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&value, _0, option, 1 TSRMLS_CC)) { - RETURN_CTOR(value); + zephir_read_property(&_0, this_ptr, SL("_options"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&value, &_0, &option, 1 TSRMLS_CC)) { + RETURN_CTOR(&value); } RETURN_MM_NULL(); @@ -226,7 +249,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getOption) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -241,63 +265,72 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getOptions) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, fireExtensionEvent) { - zval *_3$$6 = NULL, *_4$$7 = NULL; - HashTable *_1$$3; - HashPosition _0$$3; + zval _1$$6, _2$$7; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *name_param = NULL, *arguments = NULL, *extensions = NULL, *extension = NULL, *status = NULL, **_2$$3; - zval *name = NULL; + zval *name_param = NULL, *arguments = NULL, arguments_sub, __$null, extensions, extension, status, *_0$$3; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&arguments_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&extensions); + ZVAL_UNDEF(&extension); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&_1$$6); + ZVAL_UNDEF(&_2$$7); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &name_param, &arguments); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } if (!arguments) { - arguments = ZEPHIR_GLOBAL(global_null); + arguments = &arguments_sub; + arguments = &__$null; } - ZEPHIR_OBS_VAR(extensions); - zephir_read_property_this(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); - if (Z_TYPE_P(extensions) == IS_ARRAY) { - zephir_is_iterable(extensions, &_1$$3, &_0$$3, 0, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 189); - for ( - ; zend_hash_get_current_data_ex(_1$$3, (void**) &_2$$3, &_0$$3) == SUCCESS - ; zend_hash_move_forward_ex(_1$$3, &_0$$3) - ) { - ZEPHIR_GET_HVALUE(extension, _2$$3); - if ((zephir_method_exists(extension, name TSRMLS_CC) == SUCCESS)) { + ZEPHIR_OBS_VAR(&extensions); + zephir_read_property(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); + if (Z_TYPE_P(&extensions) == IS_ARRAY) { + zephir_is_iterable(&extensions, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 189); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&extensions), _0$$3) + { + ZEPHIR_INIT_NVAR(&extension); + ZVAL_COPY(&extension, _0$$3); + if ((zephir_method_exists(&extension, &name TSRMLS_CC) == SUCCESS)) { if (Z_TYPE_P(arguments) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_3$$6); - zephir_create_array(_3$$6, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_3$$6, extension); - zephir_array_fast_append(_3$$6, name); - ZEPHIR_INIT_NVAR(status); - ZEPHIR_CALL_USER_FUNC_ARRAY(status, _3$$6, arguments); + ZEPHIR_INIT_NVAR(&_1$$6); + zephir_create_array(&_1$$6, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_1$$6, &extension); + zephir_array_fast_append(&_1$$6, &name); + ZEPHIR_INIT_NVAR(&status); + ZEPHIR_CALL_USER_FUNC_ARRAY(&status, &_1$$6, arguments); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(_4$$7); - zephir_create_array(_4$$7, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_4$$7, extension); - zephir_array_fast_append(_4$$7, name); - ZEPHIR_INIT_NVAR(status); - ZEPHIR_CALL_USER_FUNC(status, _4$$7); + ZEPHIR_INIT_NVAR(&_2$$7); + zephir_create_array(&_2$$7, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_2$$7, &extension); + zephir_array_fast_append(&_2$$7, &name); + ZEPHIR_INIT_NVAR(&status); + ZEPHIR_CALL_USER_FUNC(&status, &_2$$7); zephir_check_call_status(); } - if (Z_TYPE_P(status) == IS_STRING) { - RETURN_CCTOR(status); + if (Z_TYPE_P(&status) == IS_STRING) { + RETURN_CCTOR(&status); } } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&extension); } ZEPHIR_MM_RESTORE(); @@ -309,7 +342,10 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, fireExtensionEvent) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addExtension) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *extension; + zval *extension, extension_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&extension_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &extension); @@ -320,7 +356,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addExtension) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "The extension is not valid", "phalcon/mvc/view/engine/volt/compiler.zep", 198); return; } - if ((zephir_method_exists_ex(extension, SS("initialize") TSRMLS_CC) == SUCCESS)) { + if ((zephir_method_exists_ex(extension, SL("initialize") TSRMLS_CC) == SUCCESS)) { ZEPHIR_CALL_METHOD(NULL, extension, "initialize", NULL, 0, this_ptr); zephir_check_call_status(); } @@ -334,7 +370,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addExtension) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getExtensions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_extensions"); @@ -345,25 +382,29 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getExtensions) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addFunction) { - zval *name_param = NULL, *definition; - zval *name = NULL; + zval *name_param = NULL, *definition, definition_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&definition_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &definition); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - zephir_update_property_array(this_ptr, SL("_functions"), name, definition TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_functions"), &name, definition TSRMLS_CC); RETURN_THIS(); } @@ -373,7 +414,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addFunction) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getFunctions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_functions"); @@ -384,25 +426,29 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getFunctions) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addFilter) { - zval *name_param = NULL, *definition; - zval *name = NULL; + zval *name_param = NULL, *definition, definition_sub; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&definition_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &name_param, &definition); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - zephir_update_property_array(this_ptr, SL("_filters"), name, definition TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_filters"), &name, definition TSRMLS_CC); RETURN_THIS(); } @@ -412,7 +458,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, addFilter) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getFilters) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_filters"); @@ -424,24 +471,27 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getFilters) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setUniquePrefix) { zval *prefix_param = NULL; - zval *prefix = NULL; + zval prefix; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&prefix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &prefix_param); if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) { - zephir_get_strval(prefix, prefix_param); + zephir_get_strval(&prefix, prefix_param); } else { - ZEPHIR_INIT_VAR(prefix); - ZVAL_EMPTY_STRING(prefix); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_EMPTY_STRING(&prefix); } - zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_prefix"), &prefix); RETURN_THIS(); } @@ -451,38 +501,49 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, setUniquePrefix) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getUniquePrefix) { - zval *_7$$5; - zval *_0, *_3, *_8, *_1$$3, *_2$$3, *_4$$4, *_5$$5, *_6$$5; + zval _7$$5; + zval _0, _3, _8, _1$$3, _2$$3, _4$$4, _5$$5, _6$$5; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - if (!(zephir_is_true(_0))) { - ZEPHIR_INIT_VAR(_1$$3); - _2$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_currentPath"), PH_NOISY_CC); - zephir_unique_path_key(_1$$3, _2$$3 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_prefix"), _1$$3 TSRMLS_CC); - } - ZEPHIR_OBS_VAR(_3); - zephir_read_property_this(&_3, this_ptr, SL("_prefix"), PH_NOISY_CC); - if (Z_TYPE_P(_3) == IS_OBJECT) { - ZEPHIR_OBS_VAR(_4$$4); - zephir_read_property_this(&_4$$4, this_ptr, SL("_prefix"), PH_NOISY_CC); - if (zephir_instance_of_ev(_4$$4, zend_ce_closure TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_5$$5); - _6$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_prefix"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_7$$5); - zephir_create_array(_7$$5, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_7$$5, this_ptr); - ZEPHIR_CALL_USER_FUNC_ARRAY(_5$$5, _6$$5, _7$$5); + zephir_read_property(&_0, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_is_true(&_0))) { + ZEPHIR_INIT_VAR(&_1$$3); + zephir_read_property(&_2$$3, this_ptr, SL("_currentPath"), PH_NOISY_CC | PH_READONLY); + zephir_unique_path_key(&_1$$3, &_2$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_prefix"), &_1$$3); + } + ZEPHIR_OBS_VAR(&_3); + zephir_read_property(&_3, this_ptr, SL("_prefix"), PH_NOISY_CC); + if (Z_TYPE_P(&_3) == IS_OBJECT) { + ZEPHIR_OBS_VAR(&_4$$4); + zephir_read_property(&_4$$4, this_ptr, SL("_prefix"), PH_NOISY_CC); + if (zephir_instance_of_ev(&_4$$4, zend_ce_closure TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_5$$5); + zephir_read_property(&_6$$5, this_ptr, SL("_prefix"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_7$$5); + zephir_create_array(&_7$$5, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_7$$5, this_ptr); + ZEPHIR_CALL_USER_FUNC_ARRAY(&_5$$5, &_6$$5, &_7$$5); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_prefix"), _5$$5 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_prefix"), &_5$$5); } } - ZEPHIR_OBS_VAR(_8); - zephir_read_property_this(&_8, this_ptr, SL("_prefix"), PH_NOISY_CC); - if (Z_TYPE_P(_8) != IS_STRING) { + ZEPHIR_OBS_VAR(&_8); + zephir_read_property(&_8, this_ptr, SL("_prefix"), PH_NOISY_CC); + if (Z_TYPE_P(&_8) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "The unique compilation prefix is invalid", "phalcon/mvc/view/engine/volt/compiler.zep", 285); return; } @@ -497,79 +558,99 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, attributeReader) { zend_bool _3$$5, _7$$8; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *exprCode = NULL, *left = NULL, *leftType = NULL, *variable = NULL, *level = NULL, *dependencyInjector = NULL, *leftCode = NULL, *right = NULL, *_0, *_8, *_1$$4 = NULL, *_2$$4, *_4$$5 = NULL, *_5$$6, *_6$$7, *_9$$11, *_10$$12 = NULL; - zval *expr = NULL; + zval *expr_param = NULL, exprCode, left, leftType, variable, level, dependencyInjector, leftCode, right, _0, _8, _1$$4, _2$$4, _4$$5, _5$$6, _6$$7, _9$$11, _10$$12; + zval expr; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&exprCode); + ZVAL_UNDEF(&left); + ZVAL_UNDEF(&leftType); + ZVAL_UNDEF(&variable); + ZVAL_UNDEF(&level); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&leftCode); + ZVAL_UNDEF(&right); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_6$$7); + ZVAL_UNDEF(&_9$$11); + ZVAL_UNDEF(&_10$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &expr_param); - expr = expr_param; + ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param); - ZEPHIR_INIT_VAR(exprCode); - ZVAL_NULL(exprCode); - ZEPHIR_OBS_VAR(left); - zephir_array_fetch_string(&left, expr, SL("left"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 301 TSRMLS_CC); - zephir_array_fetch_string(&_0, left, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 303 TSRMLS_CC); - if (ZEPHIR_IS_LONG(_0, 265)) { - ZEPHIR_OBS_VAR(variable); - zephir_array_fetch_string(&variable, left, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 305 TSRMLS_CC); - if (ZEPHIR_IS_STRING(variable, "loop")) { - ZEPHIR_OBS_VAR(level); - zephir_read_property_this(&level, this_ptr, SL("_foreachLevel"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&exprCode); + ZVAL_NULL(&exprCode); + ZEPHIR_OBS_VAR(&left); + zephir_array_fetch_string(&left, &expr, SL("left"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 301 TSRMLS_CC); + zephir_array_fetch_string(&_0, &left, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 303 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&_0, 265)) { + ZEPHIR_OBS_VAR(&variable); + zephir_array_fetch_string(&variable, &left, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 305 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&variable, "loop")) { + ZEPHIR_OBS_VAR(&level); + zephir_read_property(&level, this_ptr, SL("_foreachLevel"), PH_NOISY_CC); ZEPHIR_CALL_METHOD(&_1$$4, this_ptr, "getuniqueprefix", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_2$$4); - ZEPHIR_CONCAT_SVVS(_2$$4, "$", _1$$4, level, "loop"); - zephir_concat_self(&exprCode, _2$$4 TSRMLS_CC); - zephir_update_property_array(this_ptr, SL("_loopPointers"), level, level TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$4); + ZEPHIR_CONCAT_SVVS(&_2$$4, "$", &_1$$4, &level, "loop"); + zephir_concat_self(&exprCode, &_2$$4 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_loopPointers"), &level, &level TSRMLS_CC); } else { - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - _3$$5 = Z_TYPE_P(dependencyInjector) == IS_OBJECT; + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + _3$$5 = Z_TYPE_P(&dependencyInjector) == IS_OBJECT; if (_3$$5) { - ZEPHIR_CALL_METHOD(&_4$$5, dependencyInjector, "has", NULL, 0, variable); + ZEPHIR_CALL_METHOD(&_4$$5, &dependencyInjector, "has", NULL, 0, &variable); zephir_check_call_status(); - _3$$5 = zephir_is_true(_4$$5); + _3$$5 = zephir_is_true(&_4$$5); } if (_3$$5) { - ZEPHIR_INIT_VAR(_5$$6); - ZEPHIR_CONCAT_SV(_5$$6, "$this->", variable); - zephir_concat_self(&exprCode, _5$$6 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$6); + ZEPHIR_CONCAT_SV(&_5$$6, "$this->", &variable); + zephir_concat_self(&exprCode, &_5$$6 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_6$$7); - ZEPHIR_CONCAT_SV(_6$$7, "$", variable); - zephir_concat_self(&exprCode, _6$$7 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$7); + ZEPHIR_CONCAT_SV(&_6$$7, "$", &variable); + zephir_concat_self(&exprCode, &_6$$7 TSRMLS_CC); } } } else { - ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", NULL, 413, left); + ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", NULL, 367, &left); zephir_check_call_status(); - ZEPHIR_OBS_VAR(leftType); - zephir_array_fetch_string(&leftType, left, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 328 TSRMLS_CC); - _7$$8 = !ZEPHIR_IS_LONG(leftType, '.'); + ZEPHIR_OBS_VAR(&leftType); + zephir_array_fetch_string(&leftType, &left, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 328 TSRMLS_CC); + _7$$8 = !ZEPHIR_IS_LONG(&leftType, '.'); if (_7$$8) { - _7$$8 = !ZEPHIR_IS_LONG(leftType, 350); + _7$$8 = !ZEPHIR_IS_LONG(&leftType, 350); } if (_7$$8) { - zephir_concat_self(&exprCode, leftCode TSRMLS_CC); + zephir_concat_self(&exprCode, &leftCode TSRMLS_CC); } else { - zephir_concat_self(&exprCode, leftCode TSRMLS_CC); + zephir_concat_self(&exprCode, &leftCode TSRMLS_CC); } } zephir_concat_self_str(&exprCode, SL("->") TSRMLS_CC); - ZEPHIR_OBS_VAR(right); - zephir_array_fetch_string(&right, expr, SL("right"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 338 TSRMLS_CC); - zephir_array_fetch_string(&_8, right, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 340 TSRMLS_CC); - if (ZEPHIR_IS_LONG(_8, 265)) { - zephir_array_fetch_string(&_9$$11, right, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 341 TSRMLS_CC); - zephir_concat_self(&exprCode, _9$$11 TSRMLS_CC); + ZEPHIR_OBS_VAR(&right); + zephir_array_fetch_string(&right, &expr, SL("right"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 338 TSRMLS_CC); + zephir_array_fetch_string(&_8, &right, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 340 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&_8, 265)) { + zephir_array_fetch_string(&_9$$11, &right, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 341 TSRMLS_CC); + zephir_concat_self(&exprCode, &_9$$11 TSRMLS_CC); } else { - ZEPHIR_CALL_METHOD(&_10$$12, this_ptr, "expression", NULL, 413, right); + ZEPHIR_CALL_METHOD(&_10$$12, this_ptr, "expression", NULL, 367, &right); zephir_check_call_status(); - zephir_concat_self(&exprCode, _10$$12 TSRMLS_CC); + zephir_concat_self(&exprCode, &_10$$12 TSRMLS_CC); } - RETURN_CCTOR(exprCode); + RETURN_CCTOR(&exprCode); } @@ -580,214 +661,243 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) { zend_bool _7$$5; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *code = NULL, *funcArguments = NULL, *arguments = NULL, *nameExpr = NULL, *nameType = NULL, *name = NULL, *extensions = NULL, *functions = NULL, *definition = NULL, *extendedBlocks = NULL, *block = NULL, *currentBlock = NULL, *exprLevel = NULL, *escapedCode = NULL, *method = NULL, *arrayHelpers = NULL, *className = NULL, *_9 = NULL, *_1$$6, *_3$$9, *_4$$9, *_5$$9, *_6$$9, *_8$$5; - zval *expr = NULL, *_0$$6, *_2$$12; + zval *expr_param = NULL, __$true, code, funcArguments, arguments, nameExpr, nameType, name, extensions, functions, definition, extendedBlocks, block, currentBlock, exprLevel, escapedCode, method, arrayHelpers, className, _9, _1$$6, _3$$9, _4$$9, _5$$9, _6$$9, _8$$5; + zval expr, _0$$6, _2$$12; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_0$$6); + ZVAL_UNDEF(&_2$$12); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&funcArguments); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&nameExpr); + ZVAL_UNDEF(&nameType); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&extensions); + ZVAL_UNDEF(&functions); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&extendedBlocks); + ZVAL_UNDEF(&block); + ZVAL_UNDEF(¤tBlock); + ZVAL_UNDEF(&exprLevel); + ZVAL_UNDEF(&escapedCode); + ZVAL_UNDEF(&method); + ZVAL_UNDEF(&arrayHelpers); + ZVAL_UNDEF(&className); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_1$$6); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_6$$9); + ZVAL_UNDEF(&_8$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &expr_param); - expr = expr_param; + ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param); - ZEPHIR_INIT_VAR(code); - ZVAL_NULL(code); - ZEPHIR_INIT_VAR(funcArguments); - ZVAL_NULL(funcArguments); - ZEPHIR_OBS_NVAR(funcArguments); - if (zephir_array_isset_string_fetch(&funcArguments, expr, SS("arguments"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 413, funcArguments); + ZEPHIR_INIT_VAR(&code); + ZVAL_NULL(&code); + ZEPHIR_INIT_VAR(&funcArguments); + ZVAL_NULL(&funcArguments); + ZEPHIR_OBS_NVAR(&funcArguments); + if (zephir_array_isset_string_fetch(&funcArguments, &expr, SL("arguments"), 0)) { + ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 367, &funcArguments); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(arguments); - ZVAL_STRING(arguments, "", 1); - } - ZEPHIR_OBS_VAR(nameExpr); - zephir_array_fetch_string(&nameExpr, expr, SL("name"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 368 TSRMLS_CC); - ZEPHIR_OBS_VAR(nameType); - zephir_array_fetch_string(&nameType, nameExpr, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 368 TSRMLS_CC); - if (ZEPHIR_IS_LONG(nameType, 265)) { - ZEPHIR_OBS_VAR(name); - zephir_array_fetch_string(&name, nameExpr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 375 TSRMLS_CC); - ZEPHIR_OBS_VAR(extensions); - zephir_read_property_this(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); - if (Z_TYPE_P(extensions) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$6); - zephir_create_array(_0$$6, 3, 0 TSRMLS_CC); - zephir_array_fast_append(_0$$6, name); - zephir_array_fast_append(_0$$6, arguments); - zephir_array_fast_append(_0$$6, funcArguments); - ZEPHIR_INIT_VAR(_1$$6); - ZVAL_STRING(_1$$6, "compileFunction", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 414, _1$$6, _0$$6); - zephir_check_temp_parameter(_1$$6); + ZEPHIR_INIT_NVAR(&arguments); + ZVAL_STRING(&arguments, ""); + } + ZEPHIR_OBS_VAR(&nameExpr); + zephir_array_fetch_string(&nameExpr, &expr, SL("name"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 368 TSRMLS_CC); + ZEPHIR_OBS_VAR(&nameType); + zephir_array_fetch_string(&nameType, &nameExpr, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 368 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&nameType, 265)) { + ZEPHIR_OBS_VAR(&name); + zephir_array_fetch_string(&name, &nameExpr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 375 TSRMLS_CC); + ZEPHIR_OBS_VAR(&extensions); + zephir_read_property(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); + if (Z_TYPE_P(&extensions) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$6); + zephir_create_array(&_0$$6, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&_0$$6, &name); + zephir_array_fast_append(&_0$$6, &arguments); + zephir_array_fast_append(&_0$$6, &funcArguments); + ZEPHIR_INIT_VAR(&_1$$6); + ZVAL_STRING(&_1$$6, "compileFunction"); + ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 368, &_1$$6, &_0$$6); zephir_check_call_status(); - if (Z_TYPE_P(code) == IS_STRING) { - RETURN_CCTOR(code); + if (Z_TYPE_P(&code) == IS_STRING) { + RETURN_CCTOR(&code); } } - ZEPHIR_OBS_VAR(functions); - zephir_read_property_this(&functions, this_ptr, SL("_functions"), PH_NOISY_CC); - if (Z_TYPE_P(functions) == IS_ARRAY) { - ZEPHIR_OBS_VAR(definition); - if (zephir_array_isset_fetch(&definition, functions, name, 0 TSRMLS_CC)) { - if (Z_TYPE_P(definition) == IS_STRING) { - ZEPHIR_CONCAT_VSVS(return_value, definition, "(", arguments, ")"); + ZEPHIR_OBS_VAR(&functions); + zephir_read_property(&functions, this_ptr, SL("_functions"), PH_NOISY_CC); + if (Z_TYPE_P(&functions) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&definition); + if (zephir_array_isset_fetch(&definition, &functions, &name, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&definition) == IS_STRING) { + ZEPHIR_CONCAT_VSVS(return_value, &definition, "(", &arguments, ")"); RETURN_MM(); } - if (Z_TYPE_P(definition) == IS_OBJECT) { - if (zephir_instance_of_ev(definition, zend_ce_closure TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_2$$12); - zephir_create_array(_2$$12, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_2$$12, arguments); - zephir_array_fast_append(_2$$12, funcArguments); - ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, definition, _2$$12); + if (Z_TYPE_P(&definition) == IS_OBJECT) { + if (zephir_instance_of_ev(&definition, zend_ce_closure TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_2$$12); + zephir_create_array(&_2$$12, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_2$$12, &arguments); + zephir_array_fast_append(&_2$$12, &funcArguments); + ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &definition, &_2$$12); zephir_check_call_status(); RETURN_MM(); } } - ZEPHIR_INIT_VAR(_3$$9); - object_init_ex(_3$$9, phalcon_mvc_view_engine_volt_exception_ce); - zephir_array_fetch_string(&_4$$9, expr, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 417 TSRMLS_CC); - zephir_array_fetch_string(&_5$$9, expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 418 TSRMLS_CC); - ZEPHIR_INIT_VAR(_6$$9); - ZEPHIR_CONCAT_SVSVSV(_6$$9, "Invalid definition for user function '", name, "' in ", _4$$9, " on line ", _5$$9); - ZEPHIR_CALL_METHOD(NULL, _3$$9, "__construct", NULL, 415, _6$$9); + ZEPHIR_INIT_VAR(&_3$$9); + object_init_ex(&_3$$9, phalcon_mvc_view_engine_volt_exception_ce); + zephir_array_fetch_string(&_4$$9, &expr, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 417 TSRMLS_CC); + zephir_array_fetch_string(&_5$$9, &expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 418 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$9); + ZEPHIR_CONCAT_SVSVSV(&_6$$9, "Invalid definition for user function '", &name, "' in ", &_4$$9, " on line ", &_5$$9); + ZEPHIR_CALL_METHOD(NULL, &_3$$9, "__construct", NULL, 369, &_6$$9); zephir_check_call_status(); - zephir_throw_exception_debug(_3$$9, "phalcon/mvc/view/engine/volt/compiler.zep", 418 TSRMLS_CC); + zephir_throw_exception_debug(&_3$$9, "phalcon/mvc/view/engine/volt/compiler.zep", 418 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - _7$$5 = ZEPHIR_IS_STRING(name, "get_content"); + _7$$5 = ZEPHIR_IS_STRING(&name, "get_content"); if (!(_7$$5)) { - _7$$5 = ZEPHIR_IS_STRING(name, "content"); + _7$$5 = ZEPHIR_IS_STRING(&name, "content"); } if (_7$$5) { - RETURN_MM_STRING("$this->getContent()", 1); + RETURN_MM_STRING("$this->getContent()"); } - if (ZEPHIR_IS_STRING(name, "partial")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->partial(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "partial")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->partial(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "super")) { - ZEPHIR_OBS_VAR(extendedBlocks); - zephir_read_property_this(&extendedBlocks, this_ptr, SL("_extendedBlocks"), PH_NOISY_CC); - if (Z_TYPE_P(extendedBlocks) == IS_ARRAY) { - ZEPHIR_OBS_VAR(currentBlock); - zephir_read_property_this(¤tBlock, this_ptr, SL("_currentBlock"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(block); - if (zephir_array_isset_fetch(&block, extendedBlocks, currentBlock, 0 TSRMLS_CC)) { - ZEPHIR_OBS_VAR(exprLevel); - zephir_read_property_this(&exprLevel, this_ptr, SL("_exprLevel"), PH_NOISY_CC); - if (Z_TYPE_P(block) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&code, this_ptr, "_statementlistorextends", NULL, 416, block); + if (ZEPHIR_IS_STRING(&name, "super")) { + ZEPHIR_OBS_VAR(&extendedBlocks); + zephir_read_property(&extendedBlocks, this_ptr, SL("_extendedBlocks"), PH_NOISY_CC); + if (Z_TYPE_P(&extendedBlocks) == IS_ARRAY) { + ZEPHIR_OBS_VAR(¤tBlock); + zephir_read_property(¤tBlock, this_ptr, SL("_currentBlock"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&block); + if (zephir_array_isset_fetch(&block, &extendedBlocks, ¤tBlock, 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&exprLevel); + zephir_read_property(&exprLevel, this_ptr, SL("_exprLevel"), PH_NOISY_CC); + if (Z_TYPE_P(&block) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(&code, this_ptr, "_statementlistorextends", NULL, 370, &block); zephir_check_call_status(); - if (ZEPHIR_IS_LONG(exprLevel, 1)) { - ZEPHIR_CPY_WRT(escapedCode, code); + if (ZEPHIR_IS_LONG(&exprLevel, 1)) { + ZEPHIR_CPY_WRT(&escapedCode, &code); } else { - ZEPHIR_INIT_NVAR(escapedCode); - zephir_addslashes(escapedCode, code TSRMLS_CC); + ZEPHIR_INIT_NVAR(&escapedCode); + zephir_addslashes(&escapedCode, &code TSRMLS_CC); } } else { - if (ZEPHIR_IS_LONG(exprLevel, 1)) { - ZEPHIR_CPY_WRT(escapedCode, block); + if (ZEPHIR_IS_LONG(&exprLevel, 1)) { + ZEPHIR_CPY_WRT(&escapedCode, &block); } else { - ZEPHIR_INIT_NVAR(escapedCode); - zephir_addslashes(escapedCode, block TSRMLS_CC); + ZEPHIR_INIT_NVAR(&escapedCode); + zephir_addslashes(&escapedCode, &block TSRMLS_CC); } } - if (ZEPHIR_IS_LONG(exprLevel, 1)) { - RETURN_CCTOR(escapedCode); + if (ZEPHIR_IS_LONG(&exprLevel, 1)) { + RETURN_CCTOR(&escapedCode); } - ZEPHIR_CONCAT_SVS(return_value, "'", escapedCode, "'"); + ZEPHIR_CONCAT_SVS(return_value, "'", &escapedCode, "'"); RETURN_MM(); } } - RETURN_MM_STRING("''", 1); + RETURN_MM_STRING("''"); } - ZEPHIR_INIT_VAR(_8$$5); - zephir_camelize(_8$$5, name, NULL ); - ZEPHIR_CALL_FUNCTION(&method, "lcfirst", NULL, 71, _8$$5); + ZEPHIR_INIT_VAR(&_8$$5); + zephir_camelize(&_8$$5, &name, NULL ); + ZEPHIR_CALL_FUNCTION(&method, "lcfirst", NULL, 64, &_8$$5); zephir_check_call_status(); - ZEPHIR_INIT_VAR(className); - ZVAL_STRING(className, "Phalcon\\Tag", 1); - if ((zephir_method_exists(className, method TSRMLS_CC) == SUCCESS)) { - ZEPHIR_OBS_VAR(arrayHelpers); - zephir_read_property_this(&arrayHelpers, this_ptr, SL("_arrayHelpers"), PH_NOISY_CC); - if (Z_TYPE_P(arrayHelpers) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(arrayHelpers); - zephir_create_array(arrayHelpers, 27, 0 TSRMLS_CC); - zephir_array_update_string(&arrayHelpers, SL("check_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("color_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("date_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("date_time_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("date_time_local_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("email_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("file_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("form"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("hidden_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("image"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("image_input"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("link_to"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("month_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("numeric_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("password_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("radio_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("range_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("search_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("select"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("select_static"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("submit_button"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("tel_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("text_area"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("text_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("time_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("url_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&arrayHelpers, SL("week_field"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_arrayHelpers"), arrayHelpers TSRMLS_CC); - } - if (zephir_array_isset(arrayHelpers, name)) { - ZEPHIR_CONCAT_SVSVS(return_value, "$this->tag->", method, "([", arguments, "])"); + ZEPHIR_INIT_VAR(&className); + ZVAL_STRING(&className, "Phalcon\\Tag"); + if ((zephir_method_exists(&className, &method TSRMLS_CC) == SUCCESS)) { + ZEPHIR_OBS_VAR(&arrayHelpers); + zephir_read_property(&arrayHelpers, this_ptr, SL("_arrayHelpers"), PH_NOISY_CC); + if (Z_TYPE_P(&arrayHelpers) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&arrayHelpers); + zephir_create_array(&arrayHelpers, 27, 0 TSRMLS_CC); + zephir_array_update_string(&arrayHelpers, SL("check_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("color_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("date_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("date_time_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("date_time_local_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("email_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("file_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("form"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("hidden_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("image"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("image_input"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("link_to"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("month_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("numeric_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("password_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("radio_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("range_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("search_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("select"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("select_static"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("submit_button"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("tel_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("text_area"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("text_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("time_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("url_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&arrayHelpers, SL("week_field"), &__$true, PH_COPY | PH_SEPARATE); + zephir_update_property_zval(this_ptr, SL("_arrayHelpers"), &arrayHelpers); + } + if (zephir_array_isset(&arrayHelpers, &name)) { + ZEPHIR_CONCAT_SVSVS(return_value, "$this->tag->", &method, "([", &arguments, "])"); RETURN_MM(); } - ZEPHIR_CONCAT_SVSVS(return_value, "$this->tag->", method, "(", arguments, ")"); + ZEPHIR_CONCAT_SVSVS(return_value, "$this->tag->", &method, "(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "url")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->url->get(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "url")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->url->get(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "static_url")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->url->getStatic(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "static_url")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->url->getStatic(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "date")) { - ZEPHIR_CONCAT_SVS(return_value, "date(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "date")) { + ZEPHIR_CONCAT_SVS(return_value, "date(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "time")) { - RETURN_MM_STRING("time()", 1); + if (ZEPHIR_IS_STRING(&name, "time")) { + RETURN_MM_STRING("time()"); } - if (ZEPHIR_IS_STRING(name, "dump")) { - ZEPHIR_CONCAT_SVS(return_value, "var_dump(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "dump")) { + ZEPHIR_CONCAT_SVS(return_value, "var_dump(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "version")) { - RETURN_MM_STRING("Phalcon\\Version::get()", 1); + if (ZEPHIR_IS_STRING(&name, "version")) { + RETURN_MM_STRING("Phalcon\\Version::get()"); } - if (ZEPHIR_IS_STRING(name, "version_id")) { - RETURN_MM_STRING("Phalcon\\Version::getId()", 1); + if (ZEPHIR_IS_STRING(&name, "version_id")) { + RETURN_MM_STRING("Phalcon\\Version::getId()"); } - if (ZEPHIR_IS_STRING(name, "constant")) { - ZEPHIR_CONCAT_SVS(return_value, "constant(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "constant")) { + ZEPHIR_CONCAT_SVS(return_value, "constant(", &arguments, ")"); RETURN_MM(); } - ZEPHIR_CONCAT_SVSVS(return_value, "$this->callMacro('", name, "', [", arguments, "])"); + ZEPHIR_CONCAT_SVSVS(return_value, "$this->callMacro('", &name, "', [", &arguments, "])"); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&_9, this_ptr, "expression", NULL, 413, nameExpr); + ZEPHIR_CALL_METHOD(&_9, this_ptr, "expression", NULL, 367, &nameExpr); zephir_check_call_status(); - ZEPHIR_CONCAT_VSVS(return_value, _9, "(", arguments, ")"); + ZEPHIR_CONCAT_VSVS(return_value, &_9, "(", &arguments, ")"); RETURN_MM(); } @@ -798,78 +908,92 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveTest) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *left = NULL; - zval *test_param = NULL, *left_param = NULL, *type = NULL, *name = NULL, *testName = NULL, *_6 = NULL, *_0$$12 = NULL, *_1$$12, *_2$$13 = NULL, *_3$$13, *_4$$14 = NULL, *_5$$14; - zval *test = NULL; + zval left; + zval *test_param = NULL, *left_param = NULL, type, name, testName, _6, _0$$12, _1$$12, _2$$13, _3$$13, _4$$14, _5$$14; + zval test; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&test); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&testName); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_0$$12); + ZVAL_UNDEF(&_1$$12); + ZVAL_UNDEF(&_2$$13); + ZVAL_UNDEF(&_3$$13); + ZVAL_UNDEF(&_4$$14); + ZVAL_UNDEF(&_5$$14); + ZVAL_UNDEF(&left); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &test_param, &left_param); - test = test_param; - zephir_get_strval(left, left_param); + ZEPHIR_OBS_COPY_OR_DUP(&test, test_param); + zephir_get_strval(&left, left_param); - ZEPHIR_OBS_VAR(type); - zephir_array_fetch_string(&type, test, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 579 TSRMLS_CC); - if (ZEPHIR_IS_LONG(type, 265)) { - ZEPHIR_OBS_VAR(name); - zephir_array_fetch_string(&name, test, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 586 TSRMLS_CC); - if (ZEPHIR_IS_STRING(name, "empty")) { - ZEPHIR_CONCAT_SVS(return_value, "empty(", left, ")"); + ZEPHIR_OBS_VAR(&type); + zephir_array_fetch_string(&type, &test, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 579 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&type, 265)) { + ZEPHIR_OBS_VAR(&name); + zephir_array_fetch_string(&name, &test, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 586 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&name, "empty")) { + ZEPHIR_CONCAT_SVS(return_value, "empty(", &left, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "even")) { - ZEPHIR_CONCAT_SVS(return_value, "(((", left, ") % 2) == 0)"); + if (ZEPHIR_IS_STRING(&name, "even")) { + ZEPHIR_CONCAT_SVS(return_value, "(((", &left, ") % 2) == 0)"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "odd")) { - ZEPHIR_CONCAT_SVS(return_value, "(((", left, ") % 2) != 0)"); + if (ZEPHIR_IS_STRING(&name, "odd")) { + ZEPHIR_CONCAT_SVS(return_value, "(((", &left, ") % 2) != 0)"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "numeric")) { - ZEPHIR_CONCAT_SVS(return_value, "is_numeric(", left, ")"); + if (ZEPHIR_IS_STRING(&name, "numeric")) { + ZEPHIR_CONCAT_SVS(return_value, "is_numeric(", &left, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "scalar")) { - ZEPHIR_CONCAT_SVS(return_value, "is_scalar(", left, ")"); + if (ZEPHIR_IS_STRING(&name, "scalar")) { + ZEPHIR_CONCAT_SVS(return_value, "is_scalar(", &left, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "iterable")) { - ZEPHIR_CONCAT_SVSVS(return_value, "(is_array(", left, ") || (", left, ") instanceof Traversable)"); + if (ZEPHIR_IS_STRING(&name, "iterable")) { + ZEPHIR_CONCAT_SVSVS(return_value, "(is_array(", &left, ") || (", &left, ") instanceof Traversable)"); RETURN_MM(); } } - if (ZEPHIR_IS_LONG(type, 350)) { - ZEPHIR_OBS_VAR(testName); - zephir_array_fetch_string(&testName, test, SL("name"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 637 TSRMLS_CC); - ZEPHIR_OBS_NVAR(name); - if (zephir_array_isset_string_fetch(&name, testName, SS("value"), 0 TSRMLS_CC)) { - if (ZEPHIR_IS_STRING(name, "divisibleby")) { - zephir_array_fetch_string(&_1$$12, test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 641 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_0$$12, this_ptr, "expression", NULL, 413, _1$$12); + if (ZEPHIR_IS_LONG(&type, 350)) { + ZEPHIR_OBS_VAR(&testName); + zephir_array_fetch_string(&testName, &test, SL("name"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 637 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&name); + if (zephir_array_isset_string_fetch(&name, &testName, SL("value"), 0)) { + if (ZEPHIR_IS_STRING(&name, "divisibleby")) { + zephir_array_fetch_string(&_1$$12, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 641 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_0$$12, this_ptr, "expression", NULL, 367, &_1$$12); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "(((", left, ") % (", _0$$12, ")) == 0)"); + ZEPHIR_CONCAT_SVSVS(return_value, "(((", &left, ") % (", &_0$$12, ")) == 0)"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "sameas")) { - zephir_array_fetch_string(&_3$$13, test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 648 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_2$$13, this_ptr, "expression", NULL, 413, _3$$13); + if (ZEPHIR_IS_STRING(&name, "sameas")) { + zephir_array_fetch_string(&_3$$13, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 648 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_2$$13, this_ptr, "expression", NULL, 367, &_3$$13); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "(", left, ") === (", _2$$13, ")"); + ZEPHIR_CONCAT_SVSVS(return_value, "(", &left, ") === (", &_2$$13, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "type")) { - zephir_array_fetch_string(&_5$$14, test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 655 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_4$$14, this_ptr, "expression", NULL, 413, _5$$14); + if (ZEPHIR_IS_STRING(&name, "type")) { + zephir_array_fetch_string(&_5$$14, &test, SL("arguments"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 655 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_4$$14, this_ptr, "expression", NULL, 367, &_5$$14); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "gettype(", left, ") === (", _4$$14, ")"); + ZEPHIR_CONCAT_SVSVS(return_value, "gettype(", &left, ") === (", &_4$$14, ")"); RETURN_MM(); } } } - ZEPHIR_CALL_METHOD(&_6, this_ptr, "expression", NULL, 413, test); + ZEPHIR_CALL_METHOD(&_6, this_ptr, "expression", NULL, 367, &test); zephir_check_call_status(); - ZEPHIR_CONCAT_VSV(return_value, left, " == ", _6); + ZEPHIR_CONCAT_VSV(return_value, &left, " == ", &_6); RETURN_MM(); } @@ -881,250 +1005,281 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) { zend_bool _13, _14, _15; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *left = NULL; - zval *filter_param = NULL, *left_param = NULL, *code = NULL, *type = NULL, *functionName = NULL, *name = NULL, *file = NULL, *line = NULL, *extensions = NULL, *filters = NULL, *funcArguments = NULL, *arguments = NULL, *definition = NULL, *_16, *_17, *_18, *_19, *_0$$5, *_1$$5, *_2$$5, *_3$$5, *_7$$9, *_9$$12, *_10$$12, *_11$$12, *_12$$12; - zval *filter = NULL, *_4$$7, *_5$$7, *_6$$9, *_8$$15; + zval left; + zval *filter_param = NULL, *left_param = NULL, code, type, functionName, name, file, line, extensions, filters, funcArguments, arguments, definition, _16, _17, _18, _19, _0$$5, _1$$5, _2$$5, _3$$5, _7$$9, _9$$12, _10$$12, _11$$12, _12$$12; + zval filter, _4$$7, _5$$7, _6$$9, _8$$15; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&filter); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$9); + ZVAL_UNDEF(&_8$$15); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&functionName); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&file); + ZVAL_UNDEF(&line); + ZVAL_UNDEF(&extensions); + ZVAL_UNDEF(&filters); + ZVAL_UNDEF(&funcArguments); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&definition); + ZVAL_UNDEF(&_16); + ZVAL_UNDEF(&_17); + ZVAL_UNDEF(&_18); + ZVAL_UNDEF(&_19); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_9$$12); + ZVAL_UNDEF(&_10$$12); + ZVAL_UNDEF(&_11$$12); + ZVAL_UNDEF(&_12$$12); + ZVAL_UNDEF(&left); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &filter_param, &left_param); - filter = filter_param; - zephir_get_strval(left, left_param); + ZEPHIR_OBS_COPY_OR_DUP(&filter, filter_param); + zephir_get_strval(&left, left_param); - ZEPHIR_INIT_VAR(code); - ZVAL_NULL(code); - ZEPHIR_OBS_VAR(type); - zephir_array_fetch_string(&type, filter, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 674 TSRMLS_CC); - if (ZEPHIR_IS_LONG(type, 265)) { - ZEPHIR_OBS_VAR(name); - zephir_array_fetch_string(&name, filter, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 680 TSRMLS_CC); + ZEPHIR_INIT_VAR(&code); + ZVAL_NULL(&code); + ZEPHIR_OBS_VAR(&type); + zephir_array_fetch_string(&type, &filter, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 674 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&type, 265)) { + ZEPHIR_OBS_VAR(&name); + zephir_array_fetch_string(&name, &filter, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 680 TSRMLS_CC); } else { - if (!ZEPHIR_IS_LONG(type, 350)) { - ZEPHIR_INIT_VAR(_0$$5); - object_init_ex(_0$$5, phalcon_mvc_view_engine_volt_exception_ce); - zephir_array_fetch_string(&_1$$5, filter, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 688 TSRMLS_CC); - zephir_array_fetch_string(&_2$$5, filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 688 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3$$5); - ZEPHIR_CONCAT_SVSV(_3$$5, "Unknown filter type in ", _1$$5, " on line ", _2$$5); - ZEPHIR_CALL_METHOD(NULL, _0$$5, "__construct", NULL, 415, _3$$5); + if (!ZEPHIR_IS_LONG(&type, 350)) { + ZEPHIR_INIT_VAR(&_0$$5); + object_init_ex(&_0$$5, phalcon_mvc_view_engine_volt_exception_ce); + zephir_array_fetch_string(&_1$$5, &filter, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 688 TSRMLS_CC); + zephir_array_fetch_string(&_2$$5, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 688 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$5); + ZEPHIR_CONCAT_SVSV(&_3$$5, "Unknown filter type in ", &_1$$5, " on line ", &_2$$5); + ZEPHIR_CALL_METHOD(NULL, &_0$$5, "__construct", NULL, 369, &_3$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$5, "phalcon/mvc/view/engine/volt/compiler.zep", 688 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$5, "phalcon/mvc/view/engine/volt/compiler.zep", 688 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_OBS_VAR(functionName); - zephir_array_fetch_string(&functionName, filter, SL("name"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 691 TSRMLS_CC); - ZEPHIR_OBS_NVAR(name); - zephir_array_fetch_string(&name, functionName, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 692 TSRMLS_CC); - } - ZEPHIR_INIT_VAR(funcArguments); - ZVAL_NULL(funcArguments); - ZEPHIR_INIT_VAR(arguments); - ZVAL_NULL(arguments); - ZEPHIR_OBS_NVAR(funcArguments); - if (zephir_array_isset_string_fetch(&funcArguments, filter, SS("arguments"), 0 TSRMLS_CC)) { - if (!ZEPHIR_IS_STRING(name, "default")) { - ZEPHIR_OBS_VAR(file); - zephir_array_fetch_string(&file, filter, SL("file"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 707 TSRMLS_CC); - ZEPHIR_OBS_VAR(line); - zephir_array_fetch_string(&line, filter, SL("line"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 707 TSRMLS_CC); - ZEPHIR_INIT_VAR(_4$$7); - zephir_create_array(_4$$7, 3, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_5$$7); - zephir_create_array(_5$$7, 4, 0 TSRMLS_CC); - add_assoc_long_ex(_5$$7, SS("type"), 364); + ZEPHIR_OBS_VAR(&functionName); + zephir_array_fetch_string(&functionName, &filter, SL("name"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 691 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&name); + zephir_array_fetch_string(&name, &functionName, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 692 TSRMLS_CC); + } + ZEPHIR_INIT_VAR(&funcArguments); + ZVAL_NULL(&funcArguments); + ZEPHIR_INIT_VAR(&arguments); + ZVAL_NULL(&arguments); + ZEPHIR_OBS_NVAR(&funcArguments); + if (zephir_array_isset_string_fetch(&funcArguments, &filter, SL("arguments"), 0)) { + if (!ZEPHIR_IS_STRING(&name, "default")) { + ZEPHIR_OBS_VAR(&file); + zephir_array_fetch_string(&file, &filter, SL("file"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 707 TSRMLS_CC); + ZEPHIR_OBS_VAR(&line); + zephir_array_fetch_string(&line, &filter, SL("line"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 707 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$7); + zephir_create_array(&_4$$7, 3, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_5$$7); + zephir_create_array(&_5$$7, 4, 0 TSRMLS_CC); + add_assoc_long_ex(&_5$$7, SL("type"), 364); zephir_array_update_string(&_5$$7, SL("value"), &left, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_5$$7, SL("file"), &file, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_5$$7, SL("line"), &line, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_4$$7, SL("expr"), &_5$$7, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_4$$7, SL("file"), &file, PH_COPY | PH_SEPARATE); zephir_array_update_string(&_4$$7, SL("line"), &line, PH_COPY | PH_SEPARATE); - ZEPHIR_MAKE_REF(funcArguments); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 417, funcArguments, _4$$7); - ZEPHIR_UNREF(funcArguments); + ZEPHIR_MAKE_REF(&funcArguments); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 371, &funcArguments, &_4$$7); + ZEPHIR_UNREF(&funcArguments); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 413, funcArguments); + ZEPHIR_CALL_METHOD(&arguments, this_ptr, "expression", NULL, 367, &funcArguments); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(arguments, left); - } - ZEPHIR_OBS_VAR(extensions); - zephir_read_property_this(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); - if (Z_TYPE_P(extensions) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_6$$9); - zephir_create_array(_6$$9, 3, 0 TSRMLS_CC); - zephir_array_fast_append(_6$$9, name); - zephir_array_fast_append(_6$$9, arguments); - zephir_array_fast_append(_6$$9, funcArguments); - ZEPHIR_INIT_VAR(_7$$9); - ZVAL_STRING(_7$$9, "compileFilter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 414, _7$$9, _6$$9); - zephir_check_temp_parameter(_7$$9); + ZEPHIR_CPY_WRT(&arguments, &left); + } + ZEPHIR_OBS_VAR(&extensions); + zephir_read_property(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); + if (Z_TYPE_P(&extensions) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_6$$9); + zephir_create_array(&_6$$9, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&_6$$9, &name); + zephir_array_fast_append(&_6$$9, &arguments); + zephir_array_fast_append(&_6$$9, &funcArguments); + ZEPHIR_INIT_VAR(&_7$$9); + ZVAL_STRING(&_7$$9, "compileFilter"); + ZEPHIR_CALL_METHOD(&code, this_ptr, "fireextensionevent", NULL, 368, &_7$$9, &_6$$9); zephir_check_call_status(); - if (Z_TYPE_P(code) == IS_STRING) { - RETURN_CCTOR(code); + if (Z_TYPE_P(&code) == IS_STRING) { + RETURN_CCTOR(&code); } } - ZEPHIR_OBS_VAR(filters); - zephir_read_property_this(&filters, this_ptr, SL("_filters"), PH_NOISY_CC); - if (Z_TYPE_P(filters) == IS_ARRAY) { - ZEPHIR_OBS_VAR(definition); - if (zephir_array_isset_fetch(&definition, filters, name, 0 TSRMLS_CC)) { - if (Z_TYPE_P(definition) == IS_STRING) { - ZEPHIR_CONCAT_VSVS(return_value, definition, "(", arguments, ")"); + ZEPHIR_OBS_VAR(&filters); + zephir_read_property(&filters, this_ptr, SL("_filters"), PH_NOISY_CC); + if (Z_TYPE_P(&filters) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&definition); + if (zephir_array_isset_fetch(&definition, &filters, &name, 0 TSRMLS_CC)) { + if (Z_TYPE_P(&definition) == IS_STRING) { + ZEPHIR_CONCAT_VSVS(return_value, &definition, "(", &arguments, ")"); RETURN_MM(); } - if (Z_TYPE_P(definition) == IS_OBJECT) { - if (zephir_instance_of_ev(definition, zend_ce_closure TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_8$$15); - zephir_create_array(_8$$15, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_8$$15, arguments); - zephir_array_fast_append(_8$$15, funcArguments); - ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, definition, _8$$15); + if (Z_TYPE_P(&definition) == IS_OBJECT) { + if (zephir_instance_of_ev(&definition, zend_ce_closure TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_8$$15); + zephir_create_array(&_8$$15, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_8$$15, &arguments); + zephir_array_fast_append(&_8$$15, &funcArguments); + ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &definition, &_8$$15); zephir_check_call_status(); RETURN_MM(); } } - ZEPHIR_INIT_VAR(_9$$12); - object_init_ex(_9$$12, phalcon_mvc_view_engine_volt_exception_ce); - zephir_array_fetch_string(&_10$$12, filter, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 771 TSRMLS_CC); - zephir_array_fetch_string(&_11$$12, filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 772 TSRMLS_CC); - ZEPHIR_INIT_VAR(_12$$12); - ZEPHIR_CONCAT_SVSVSV(_12$$12, "Invalid definition for user filter '", name, "' in ", _10$$12, " on line ", _11$$12); - ZEPHIR_CALL_METHOD(NULL, _9$$12, "__construct", NULL, 415, _12$$12); + ZEPHIR_INIT_VAR(&_9$$12); + object_init_ex(&_9$$12, phalcon_mvc_view_engine_volt_exception_ce); + zephir_array_fetch_string(&_10$$12, &filter, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 771 TSRMLS_CC); + zephir_array_fetch_string(&_11$$12, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 772 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_12$$12); + ZEPHIR_CONCAT_SVSVSV(&_12$$12, "Invalid definition for user filter '", &name, "' in ", &_10$$12, " on line ", &_11$$12); + ZEPHIR_CALL_METHOD(NULL, &_9$$12, "__construct", NULL, 369, &_12$$12); zephir_check_call_status(); - zephir_throw_exception_debug(_9$$12, "phalcon/mvc/view/engine/volt/compiler.zep", 772 TSRMLS_CC); + zephir_throw_exception_debug(&_9$$12, "phalcon/mvc/view/engine/volt/compiler.zep", 772 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - if (ZEPHIR_IS_STRING(name, "length")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->length(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "length")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->length(", &arguments, ")"); RETURN_MM(); } - _13 = ZEPHIR_IS_STRING(name, "e"); + _13 = ZEPHIR_IS_STRING(&name, "e"); if (!(_13)) { - _13 = ZEPHIR_IS_STRING(name, "escape"); + _13 = ZEPHIR_IS_STRING(&name, "escape"); } if (_13) { - ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeHtml(", arguments, ")"); + ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeHtml(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "escape_css")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeCss(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "escape_css")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeCss(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "escape_js")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeJs(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "escape_js")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeJs(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "escape_attr")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeHtmlAttr(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "escape_attr")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->escaper->escapeHtmlAttr(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "trim")) { - ZEPHIR_CONCAT_SVS(return_value, "trim(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "trim")) { + ZEPHIR_CONCAT_SVS(return_value, "trim(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "left_trim")) { - ZEPHIR_CONCAT_SVS(return_value, "ltrim(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "left_trim")) { + ZEPHIR_CONCAT_SVS(return_value, "ltrim(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "right_trim")) { - ZEPHIR_CONCAT_SVS(return_value, "rtrim(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "right_trim")) { + ZEPHIR_CONCAT_SVS(return_value, "rtrim(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "striptags")) { - ZEPHIR_CONCAT_SVS(return_value, "strip_tags(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "striptags")) { + ZEPHIR_CONCAT_SVS(return_value, "strip_tags(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "url_encode")) { - ZEPHIR_CONCAT_SVS(return_value, "urlencode(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "url_encode")) { + ZEPHIR_CONCAT_SVS(return_value, "urlencode(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "slashes")) { - ZEPHIR_CONCAT_SVS(return_value, "addslashes(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "slashes")) { + ZEPHIR_CONCAT_SVS(return_value, "addslashes(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "stripslashes")) { - ZEPHIR_CONCAT_SVS(return_value, "stripslashes(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "stripslashes")) { + ZEPHIR_CONCAT_SVS(return_value, "stripslashes(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "nl2br")) { - ZEPHIR_CONCAT_SVS(return_value, "nl2br(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "nl2br")) { + ZEPHIR_CONCAT_SVS(return_value, "nl2br(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "keys")) { - ZEPHIR_CONCAT_SVS(return_value, "array_keys(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "keys")) { + ZEPHIR_CONCAT_SVS(return_value, "array_keys(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "join")) { - ZEPHIR_CONCAT_SVS(return_value, "join(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "join")) { + ZEPHIR_CONCAT_SVS(return_value, "join(", &arguments, ")"); RETURN_MM(); } - _14 = ZEPHIR_IS_STRING(name, "lower"); + _14 = ZEPHIR_IS_STRING(&name, "lower"); if (!(_14)) { - _14 = ZEPHIR_IS_STRING(name, "lowercase"); + _14 = ZEPHIR_IS_STRING(&name, "lowercase"); } if (_14) { - ZEPHIR_CONCAT_SVS(return_value, "Phalcon\\Text::lower(", arguments, ")"); + ZEPHIR_CONCAT_SVS(return_value, "Phalcon\\Text::lower(", &arguments, ")"); RETURN_MM(); } - _15 = ZEPHIR_IS_STRING(name, "upper"); + _15 = ZEPHIR_IS_STRING(&name, "upper"); if (!(_15)) { - _15 = ZEPHIR_IS_STRING(name, "uppercase"); + _15 = ZEPHIR_IS_STRING(&name, "uppercase"); } if (_15) { - ZEPHIR_CONCAT_SVS(return_value, "Phalcon\\Text::upper(", arguments, ")"); + ZEPHIR_CONCAT_SVS(return_value, "Phalcon\\Text::upper(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "capitalize")) { - ZEPHIR_CONCAT_SVS(return_value, "ucwords(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "capitalize")) { + ZEPHIR_CONCAT_SVS(return_value, "ucwords(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "sort")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->sort(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "sort")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->sort(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "json_encode")) { - ZEPHIR_CONCAT_SVS(return_value, "json_encode(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "json_encode")) { + ZEPHIR_CONCAT_SVS(return_value, "json_encode(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "json_decode")) { - ZEPHIR_CONCAT_SVS(return_value, "json_decode(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "json_decode")) { + ZEPHIR_CONCAT_SVS(return_value, "json_decode(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "format")) { - ZEPHIR_CONCAT_SVS(return_value, "sprintf(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "format")) { + ZEPHIR_CONCAT_SVS(return_value, "sprintf(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "abs")) { - ZEPHIR_CONCAT_SVS(return_value, "abs(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "abs")) { + ZEPHIR_CONCAT_SVS(return_value, "abs(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "slice")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->slice(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "slice")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->slice(", &arguments, ")"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "default")) { - ZEPHIR_CONCAT_SVSVSVS(return_value, "(empty(", left, ") ? (", arguments, ") : (", left, "))"); + if (ZEPHIR_IS_STRING(&name, "default")) { + ZEPHIR_CONCAT_SVSVSVS(return_value, "(empty(", &left, ") ? (", &arguments, ") : (", &left, "))"); RETURN_MM(); } - if (ZEPHIR_IS_STRING(name, "convert_encoding")) { - ZEPHIR_CONCAT_SVS(return_value, "$this->convertEncoding(", arguments, ")"); + if (ZEPHIR_IS_STRING(&name, "convert_encoding")) { + ZEPHIR_CONCAT_SVS(return_value, "$this->convertEncoding(", &arguments, ")"); RETURN_MM(); } - ZEPHIR_INIT_VAR(_16); - object_init_ex(_16, phalcon_mvc_view_engine_volt_exception_ce); - zephir_array_fetch_string(&_17, filter, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 961 TSRMLS_CC); - zephir_array_fetch_string(&_18, filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 961 TSRMLS_CC); - ZEPHIR_INIT_VAR(_19); - ZEPHIR_CONCAT_SVSVSV(_19, "Unknown filter \"", name, "\" in ", _17, " on line ", _18); - ZEPHIR_CALL_METHOD(NULL, _16, "__construct", NULL, 415, _19); + ZEPHIR_INIT_VAR(&_16); + object_init_ex(&_16, phalcon_mvc_view_engine_volt_exception_ce); + zephir_array_fetch_string(&_17, &filter, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 961 TSRMLS_CC); + zephir_array_fetch_string(&_18, &filter, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 961 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_19); + ZEPHIR_CONCAT_SVSVSV(&_19, "Unknown filter \"", &name, "\" in ", &_17, " on line ", &_18); + ZEPHIR_CALL_METHOD(NULL, &_16, "__construct", NULL, 369, &_19); zephir_check_call_status(); - zephir_throw_exception_debug(_16, "phalcon/mvc/view/engine/volt/compiler.zep", 961 TSRMLS_CC); + zephir_throw_exception_debug(&_16, "phalcon/mvc/view/engine/volt/compiler.zep", 961 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; @@ -1135,394 +1290,426 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveFilter) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) { - HashTable *_4$$6; - HashPosition _3$$6; - zephir_fcall_cache_entry *_2 = NULL, *_7 = NULL, *_9 = NULL, *_11 = NULL, *_13 = NULL, *_19 = NULL, *_26 = NULL; + zephir_fcall_cache_entry *_2 = NULL, *_5 = NULL, *_7 = NULL, *_9 = NULL, *_11 = NULL, *_17 = NULL, *_24 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *expr_param = NULL, *exprCode = NULL, *extensions = NULL, *items = NULL, *singleExpr = NULL, *singleExprCode = NULL, *name = NULL, *left = NULL, *leftCode = NULL, *right = NULL, *rightCode = NULL, *type = NULL, *startCode = NULL, *endCode = NULL, *start = NULL, *end = NULL, *_1$$4 = NULL, **_5$$6, *_6$$7, *_8$$8 = NULL, *_10$$12, *_12$$13, *_14$$31 = NULL, *_15$$31, _16$$31 = zval_used_for_init, _17$$31 = zval_used_for_init, *_18$$35, *_20$$69 = NULL, *_21$$69, *_22$$73 = NULL, *_23$$73, *_24$$73, *_25$$73 = NULL; - zval *expr = NULL, *_0$$4 = NULL; + zval *expr_param = NULL, exprCode, extensions, items, singleExpr, singleExprCode, name, left, leftCode, right, rightCode, type, startCode, endCode, start, end, _1$$4, *_3$$6, _4$$7, _6$$8, _8$$12, _10$$13, _12$$31, _13$$31, _14$$31, _15$$31, _16$$35, _18$$69, _19$$69, _20$$73, _21$$73, _22$$73, _23$$73; + zval expr, _0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&exprCode); + ZVAL_UNDEF(&extensions); + ZVAL_UNDEF(&items); + ZVAL_UNDEF(&singleExpr); + ZVAL_UNDEF(&singleExprCode); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&left); + ZVAL_UNDEF(&leftCode); + ZVAL_UNDEF(&right); + ZVAL_UNDEF(&rightCode); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&startCode); + ZVAL_UNDEF(&endCode); + ZVAL_UNDEF(&start); + ZVAL_UNDEF(&end); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_6$$8); + ZVAL_UNDEF(&_8$$12); + ZVAL_UNDEF(&_10$$13); + ZVAL_UNDEF(&_12$$31); + ZVAL_UNDEF(&_13$$31); + ZVAL_UNDEF(&_14$$31); + ZVAL_UNDEF(&_15$$31); + ZVAL_UNDEF(&_16$$35); + ZVAL_UNDEF(&_18$$69); + ZVAL_UNDEF(&_19$$69); + ZVAL_UNDEF(&_20$$73); + ZVAL_UNDEF(&_21$$73); + ZVAL_UNDEF(&_22$$73); + ZVAL_UNDEF(&_23$$73); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &expr_param); - expr = expr_param; + ZEPHIR_OBS_COPY_OR_DUP(&expr, expr_param); - ZEPHIR_INIT_VAR(exprCode); - ZVAL_NULL(exprCode); + ZEPHIR_INIT_VAR(&exprCode); + ZVAL_NULL(&exprCode); RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_exprLevel") TSRMLS_CC)); - ZEPHIR_OBS_VAR(extensions); - zephir_read_property_this(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&extensions); + zephir_read_property(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); while (1) { - if (Z_TYPE_P(extensions) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_0$$4); - zephir_create_array(_0$$4, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_0$$4, expr); - ZEPHIR_INIT_NVAR(_1$$4); - ZVAL_STRING(_1$$4, "resolveExpression", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "fireextensionevent", &_2, 414, _1$$4, _0$$4); - zephir_check_temp_parameter(_1$$4); + if (Z_TYPE_P(&extensions) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_0$$4); + zephir_create_array(&_0$$4, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_0$$4, &expr); + ZEPHIR_INIT_NVAR(&_1$$4); + ZVAL_STRING(&_1$$4, "resolveExpression"); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "fireextensionevent", &_2, 368, &_1$$4, &_0$$4); zephir_check_call_status(); - if (Z_TYPE_P(exprCode) == IS_STRING) { - break; - } - } - ZEPHIR_OBS_NVAR(type); - if (!(zephir_array_isset_string_fetch(&type, expr, SS("type"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(items); - array_init(items); - zephir_is_iterable(expr, &_4$$6, &_3$$6, 0, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 1002); - for ( - ; zend_hash_get_current_data_ex(_4$$6, (void**) &_5$$6, &_3$$6) == SUCCESS - ; zend_hash_move_forward_ex(_4$$6, &_3$$6) - ) { - ZEPHIR_GET_HVALUE(singleExpr, _5$$6); - zephir_array_fetch_string(&_6$$7, singleExpr, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 995 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_7, 413, _6$$7); + if (Z_TYPE_P(&exprCode) == IS_STRING) { + break; + } + } + ZEPHIR_OBS_NVAR(&type); + if (!(zephir_array_isset_string_fetch(&type, &expr, SL("type"), 0))) { + ZEPHIR_INIT_NVAR(&items); + array_init(&items); + zephir_is_iterable(&expr, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 1002); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&expr), _3$$6) + { + ZEPHIR_INIT_NVAR(&singleExpr); + ZVAL_COPY(&singleExpr, _3$$6); + zephir_array_fetch_string(&_4$$7, &singleExpr, SL("expr"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 995 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&singleExprCode, this_ptr, "expression", &_5, 367, &_4$$7); zephir_check_call_status(); - ZEPHIR_OBS_NVAR(name); - if (zephir_array_isset_string_fetch(&name, singleExpr, SS("name"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_LNVAR(_8$$8); - ZEPHIR_CONCAT_SVSV(_8$$8, "'", name, "' => ", singleExprCode); - zephir_array_append(&items, _8$$8, PH_SEPARATE, "phalcon/mvc/view/engine/volt/compiler.zep", 997); + ZEPHIR_OBS_NVAR(&name); + if (zephir_array_isset_string_fetch(&name, &singleExpr, SL("name"), 0)) { + ZEPHIR_INIT_LNVAR(_6$$8); + ZEPHIR_CONCAT_SVSV(&_6$$8, "'", &name, "' => ", &singleExprCode); + zephir_array_append(&items, &_6$$8, PH_SEPARATE, "phalcon/mvc/view/engine/volt/compiler.zep", 997); } else { - zephir_array_append(&items, singleExprCode, PH_SEPARATE, "phalcon/mvc/view/engine/volt/compiler.zep", 999); + zephir_array_append(&items, &singleExprCode, PH_SEPARATE, "phalcon/mvc/view/engine/volt/compiler.zep", 999); } - } - ZEPHIR_INIT_NVAR(exprCode); - zephir_fast_join_str(exprCode, SL(", "), items TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&singleExpr); + ZEPHIR_INIT_NVAR(&exprCode); + zephir_fast_join_str(&exprCode, SL(", "), &items TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, '.')) { - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "attributereader", &_9, 0, expr); + if (ZEPHIR_IS_LONG(&type, '.')) { + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "attributereader", &_7, 0, &expr); zephir_check_call_status(); break; } - ZEPHIR_OBS_NVAR(left); - if (zephir_array_isset_string_fetch(&left, expr, SS("left"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", &_7, 413, left); + ZEPHIR_OBS_NVAR(&left); + if (zephir_array_isset_string_fetch(&left, &expr, SL("left"), 0)) { + ZEPHIR_CALL_METHOD(&leftCode, this_ptr, "expression", &_5, 367, &left); zephir_check_call_status(); } - if (ZEPHIR_IS_LONG(type, 311)) { - zephir_array_fetch_string(&_10$$12, expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1025 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvetest", &_11, 0, _10$$12, leftCode); + if (ZEPHIR_IS_LONG(&type, 311)) { + zephir_array_fetch_string(&_8$$12, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1025 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvetest", &_9, 0, &_8$$12, &leftCode); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(type, 124)) { - zephir_array_fetch_string(&_12$$13, expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1033 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvefilter", &_13, 418, _12$$13, leftCode); + if (ZEPHIR_IS_LONG(&type, 124)) { + zephir_array_fetch_string(&_10$$13, &expr, SL("right"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1033 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "resolvefilter", &_11, 372, &_10$$13, &leftCode); zephir_check_call_status(); break; } - ZEPHIR_OBS_NVAR(right); - if (zephir_array_isset_string_fetch(&right, expr, SS("right"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&rightCode, this_ptr, "expression", &_7, 413, right); + ZEPHIR_OBS_NVAR(&right); + if (zephir_array_isset_string_fetch(&right, &expr, SL("right"), 0)) { + ZEPHIR_CALL_METHOD(&rightCode, this_ptr, "expression", &_5, 367, &right); zephir_check_call_status(); } - ZEPHIR_INIT_NVAR(exprCode); - ZVAL_NULL(exprCode); + ZEPHIR_INIT_NVAR(&exprCode); + ZVAL_NULL(&exprCode); do { - if (ZEPHIR_IS_LONG(type, '!')) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SV(exprCode, "!", rightCode); + if (ZEPHIR_IS_LONG(&type, '!')) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SV(&exprCode, "!", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, '*')) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " * ", rightCode); + if (ZEPHIR_IS_LONG(&type, '*')) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " * ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, '+')) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " + ", rightCode); + if (ZEPHIR_IS_LONG(&type, '+')) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " + ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, '-')) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " - ", rightCode); + if (ZEPHIR_IS_LONG(&type, '-')) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " - ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, '/')) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " / ", rightCode); + if (ZEPHIR_IS_LONG(&type, '/')) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " / ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 37)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " % ", rightCode); + if (ZEPHIR_IS_LONG(&type, 37)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " % ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, '<')) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " < ", rightCode); + if (ZEPHIR_IS_LONG(&type, '<')) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " < ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 61)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " > ", rightCode); + if (ZEPHIR_IS_LONG(&type, 61)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " > ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 62)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " > ", rightCode); + if (ZEPHIR_IS_LONG(&type, 62)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " > ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 126)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " . ", rightCode); + if (ZEPHIR_IS_LONG(&type, 126)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " . ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 278)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVSVS(exprCode, "pow(", leftCode, ", ", rightCode, ")"); + if (ZEPHIR_IS_LONG(&type, 278)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVSVS(&exprCode, "pow(", &leftCode, ", ", &rightCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 360)) { - ZEPHIR_INIT_NVAR(exprCode); - if (zephir_array_isset_string(expr, SS("left"))) { - ZEPHIR_CONCAT_SVS(exprCode, "[", leftCode, "]"); + if (ZEPHIR_IS_LONG(&type, 360)) { + ZEPHIR_INIT_NVAR(&exprCode); + if (zephir_array_isset_string(&expr, SL("left"))) { + ZEPHIR_CONCAT_SVS(&exprCode, "[", &leftCode, "]"); } else { - ZVAL_STRING(exprCode, "[]", 1); + ZVAL_STRING(&exprCode, "[]"); } break; } - if (ZEPHIR_IS_LONG(type, 258)) { - ZEPHIR_OBS_NVAR(exprCode); - zephir_array_fetch_string(&exprCode, expr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1100 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&type, 258)) { + ZEPHIR_OBS_NVAR(&exprCode); + zephir_array_fetch_string(&exprCode, &expr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1100 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 259)) { - ZEPHIR_OBS_NVAR(exprCode); - zephir_array_fetch_string(&exprCode, expr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1104 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&type, 259)) { + ZEPHIR_OBS_NVAR(&exprCode); + zephir_array_fetch_string(&exprCode, &expr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1104 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 260)) { - ZEPHIR_INIT_NVAR(_14$$31); - zephir_array_fetch_string(&_15$$31, expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1108 TSRMLS_CC); - ZEPHIR_SINIT_NVAR(_16$$31); - ZVAL_STRING(&_16$$31, "'", 0); - ZEPHIR_SINIT_NVAR(_17$$31); - ZVAL_STRING(&_17$$31, "\\'", 0); - zephir_fast_str_replace(&_14$$31, &_16$$31, &_17$$31, _15$$31 TSRMLS_CC); - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "'", _14$$31, "'"); + if (ZEPHIR_IS_LONG(&type, 260)) { + ZEPHIR_INIT_NVAR(&_12$$31); + zephir_array_fetch_string(&_13$$31, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1108 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_14$$31); + ZVAL_STRING(&_14$$31, "'"); + ZEPHIR_INIT_NVAR(&_15$$31); + ZVAL_STRING(&_15$$31, "\\'"); + zephir_fast_str_replace(&_12$$31, &_14$$31, &_15$$31, &_13$$31 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "'", &_12$$31, "'"); break; } - if (ZEPHIR_IS_LONG(type, 261)) { - ZEPHIR_INIT_NVAR(exprCode); - ZVAL_STRING(exprCode, "null", 1); + if (ZEPHIR_IS_LONG(&type, 261)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZVAL_STRING(&exprCode, "null"); break; } - if (ZEPHIR_IS_LONG(type, 262)) { - ZEPHIR_INIT_NVAR(exprCode); - ZVAL_STRING(exprCode, "false", 1); + if (ZEPHIR_IS_LONG(&type, 262)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZVAL_STRING(&exprCode, "false"); break; } - if (ZEPHIR_IS_LONG(type, 263)) { - ZEPHIR_INIT_NVAR(exprCode); - ZVAL_STRING(exprCode, "true", 1); + if (ZEPHIR_IS_LONG(&type, 263)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZVAL_STRING(&exprCode, "true"); break; } - if (ZEPHIR_IS_LONG(type, 265)) { - zephir_array_fetch_string(&_18$$35, expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1124 TSRMLS_CC); - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SV(exprCode, "$", _18$$35); + if (ZEPHIR_IS_LONG(&type, 265)) { + zephir_array_fetch_string(&_16$$35, &expr, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1124 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SV(&exprCode, "$", &_16$$35); break; } - if (ZEPHIR_IS_LONG(type, 266)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " && ", rightCode); + if (ZEPHIR_IS_LONG(&type, 266)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " && ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 267)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " || ", rightCode); + if (ZEPHIR_IS_LONG(&type, 267)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " || ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 270)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " <= ", rightCode); + if (ZEPHIR_IS_LONG(&type, 270)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " <= ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 271)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " >= ", rightCode); + if (ZEPHIR_IS_LONG(&type, 271)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " >= ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 272)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " == ", rightCode); + if (ZEPHIR_IS_LONG(&type, 272)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " == ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 273)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " != ", rightCode); + if (ZEPHIR_IS_LONG(&type, 273)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " != ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 274)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " === ", rightCode); + if (ZEPHIR_IS_LONG(&type, 274)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " === ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 275)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSV(exprCode, leftCode, " !== ", rightCode); + if (ZEPHIR_IS_LONG(&type, 275)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSV(&exprCode, &leftCode, " !== ", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 276)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVSVS(exprCode, "range(", leftCode, ", ", rightCode, ")"); + if (ZEPHIR_IS_LONG(&type, 276)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVSVS(&exprCode, "range(", &leftCode, ", ", &rightCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 350)) { - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "functioncall", &_19, 0, expr); + if (ZEPHIR_IS_LONG(&type, 350)) { + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "functioncall", &_17, 0, &expr); zephir_check_call_status(); break; } - if (ZEPHIR_IS_LONG(type, 356)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "(", leftCode, ")"); + if (ZEPHIR_IS_LONG(&type, 356)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "(", &leftCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 361)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_VSVS(exprCode, leftCode, "[", rightCode, "]"); + if (ZEPHIR_IS_LONG(&type, 361)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_VSVS(&exprCode, &leftCode, "[", &rightCode, "]"); break; } - if (ZEPHIR_IS_LONG(type, 365)) { - ZEPHIR_OBS_NVAR(start); - if (zephir_array_isset_string_fetch(&start, expr, SS("start"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&startCode, this_ptr, "expression", &_7, 413, start); + if (ZEPHIR_IS_LONG(&type, 365)) { + ZEPHIR_OBS_NVAR(&start); + if (zephir_array_isset_string_fetch(&start, &expr, SL("start"), 0)) { + ZEPHIR_CALL_METHOD(&startCode, this_ptr, "expression", &_5, 367, &start); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(startCode); - ZVAL_STRING(startCode, "null", 1); + ZEPHIR_INIT_NVAR(&startCode); + ZVAL_STRING(&startCode, "null"); } - ZEPHIR_OBS_NVAR(end); - if (zephir_array_isset_string_fetch(&end, expr, SS("end"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&endCode, this_ptr, "expression", &_7, 413, end); + ZEPHIR_OBS_NVAR(&end); + if (zephir_array_isset_string_fetch(&end, &expr, SL("end"), 0)) { + ZEPHIR_CALL_METHOD(&endCode, this_ptr, "expression", &_5, 367, &end); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(endCode); - ZVAL_STRING(endCode, "null", 1); + ZEPHIR_INIT_NVAR(&endCode); + ZVAL_STRING(&endCode, "null"); } - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVSVSVS(exprCode, "$this->slice(", leftCode, ", ", startCode, ", ", endCode, ")"); + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVSVSVS(&exprCode, "$this->slice(", &leftCode, ", ", &startCode, ", ", &endCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 362)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "!isset(", leftCode, ")"); + if (ZEPHIR_IS_LONG(&type, 362)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "!isset(", &leftCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 363)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "isset(", leftCode, ")"); + if (ZEPHIR_IS_LONG(&type, 363)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "isset(", &leftCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 392)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "!empty(", leftCode, ")"); + if (ZEPHIR_IS_LONG(&type, 392)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "!empty(", &leftCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 386)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "empty(", leftCode, ")"); + if (ZEPHIR_IS_LONG(&type, 386)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "empty(", &leftCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 393)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "!(((", leftCode, ") % 2) == 0)"); + if (ZEPHIR_IS_LONG(&type, 393)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "!(((", &leftCode, ") % 2) == 0)"); break; } - if (ZEPHIR_IS_LONG(type, 387)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "(((", leftCode, ") % 2) == 0)"); + if (ZEPHIR_IS_LONG(&type, 387)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "(((", &leftCode, ") % 2) == 0)"); break; } - if (ZEPHIR_IS_LONG(type, 394)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "!(((", leftCode, ") % 2) != 0)"); + if (ZEPHIR_IS_LONG(&type, 394)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "!(((", &leftCode, ") % 2) != 0)"); break; } - if (ZEPHIR_IS_LONG(type, 388)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "(((", leftCode, ") % 2) != 0)"); + if (ZEPHIR_IS_LONG(&type, 388)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "(((", &leftCode, ") % 2) != 0)"); break; } - if (ZEPHIR_IS_LONG(type, 395)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "!is_numeric(", leftCode, ")"); + if (ZEPHIR_IS_LONG(&type, 395)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "!is_numeric(", &leftCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 389)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "is_numeric(", leftCode, ")"); + if (ZEPHIR_IS_LONG(&type, 389)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "is_numeric(", &leftCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 396)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "!is_scalar(", leftCode, ")"); + if (ZEPHIR_IS_LONG(&type, 396)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "!is_scalar(", &leftCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 390)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVS(exprCode, "is_scalar(", leftCode, ")"); + if (ZEPHIR_IS_LONG(&type, 390)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVS(&exprCode, "is_scalar(", &leftCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 397)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVSVS(exprCode, "!(is_array(", leftCode, ") || (", leftCode, ") instanceof Traversable)"); + if (ZEPHIR_IS_LONG(&type, 397)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVSVS(&exprCode, "!(is_array(", &leftCode, ") || (", &leftCode, ") instanceof Traversable)"); break; } - if (ZEPHIR_IS_LONG(type, 391)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVSVS(exprCode, "(is_array(", leftCode, ") || (", leftCode, ") instanceof Traversable)"); + if (ZEPHIR_IS_LONG(&type, 391)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVSVS(&exprCode, "(is_array(", &leftCode, ") || (", &leftCode, ") instanceof Traversable)"); break; } - if (ZEPHIR_IS_LONG(type, 309)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVSVS(exprCode, "$this->isIncluded(", leftCode, ", ", rightCode, ")"); + if (ZEPHIR_IS_LONG(&type, 309)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVSVS(&exprCode, "$this->isIncluded(", &leftCode, ", ", &rightCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 367)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVSVS(exprCode, "!$this->isIncluded(", leftCode, ", ", rightCode, ")"); + if (ZEPHIR_IS_LONG(&type, 367)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVSVS(&exprCode, "!$this->isIncluded(", &leftCode, ", ", &rightCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 366)) { - zephir_array_fetch_string(&_21$$69, expr, SL("ternary"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1263 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_20$$69, this_ptr, "expression", &_7, 413, _21$$69); + if (ZEPHIR_IS_LONG(&type, 366)) { + zephir_array_fetch_string(&_19$$69, &expr, SL("ternary"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1263 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_18$$69, this_ptr, "expression", &_5, 367, &_19$$69); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SVSVSVS(exprCode, "(", _20$$69, " ? ", leftCode, " : ", rightCode, ")"); + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SVSVSVS(&exprCode, "(", &_18$$69, " ? ", &leftCode, " : ", &rightCode, ")"); break; } - if (ZEPHIR_IS_LONG(type, 368)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SV(exprCode, "-", rightCode); + if (ZEPHIR_IS_LONG(&type, 368)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SV(&exprCode, "-", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 369)) { - ZEPHIR_INIT_NVAR(exprCode); - ZEPHIR_CONCAT_SV(exprCode, "+", rightCode); + if (ZEPHIR_IS_LONG(&type, 369)) { + ZEPHIR_INIT_NVAR(&exprCode); + ZEPHIR_CONCAT_SV(&exprCode, "+", &rightCode); break; } - if (ZEPHIR_IS_LONG(type, 364)) { - ZEPHIR_OBS_NVAR(exprCode); - zephir_array_fetch_string(&exprCode, expr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1275 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&type, 364)) { + ZEPHIR_OBS_NVAR(&exprCode); + zephir_array_fetch_string(&exprCode, &expr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1275 TSRMLS_CC); break; } - ZEPHIR_INIT_NVAR(_22$$73); - object_init_ex(_22$$73, phalcon_mvc_view_engine_volt_exception_ce); - zephir_array_fetch_string(&_23$$73, expr, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1279 TSRMLS_CC); - zephir_array_fetch_string(&_24$$73, expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1279 TSRMLS_CC); - ZEPHIR_INIT_LNVAR(_25$$73); - ZEPHIR_CONCAT_SVSVSV(_25$$73, "Unknown expression ", type, " in ", _23$$73, " on line ", _24$$73); - ZEPHIR_CALL_METHOD(NULL, _22$$73, "__construct", &_26, 415, _25$$73); + ZEPHIR_INIT_NVAR(&_20$$73); + object_init_ex(&_20$$73, phalcon_mvc_view_engine_volt_exception_ce); + zephir_array_fetch_string(&_21$$73, &expr, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1279 TSRMLS_CC); + zephir_array_fetch_string(&_22$$73, &expr, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1279 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_23$$73); + ZEPHIR_CONCAT_SVSVSV(&_23$$73, "Unknown expression ", &type, " in ", &_21$$73, " on line ", &_22$$73); + ZEPHIR_CALL_METHOD(NULL, &_20$$73, "__construct", &_24, 369, &_23$$73); zephir_check_call_status(); - zephir_throw_exception_debug(_22$$73, "phalcon/mvc/view/engine/volt/compiler.zep", 1279 TSRMLS_CC); + zephir_throw_exception_debug(&_20$$73, "phalcon/mvc/view/engine/volt/compiler.zep", 1279 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); @@ -1530,7 +1717,7 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) { break; } RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_exprLevel") TSRMLS_CC)); - RETURN_CCTOR(exprCode); + RETURN_CCTOR(&exprCode); } @@ -1542,11 +1729,13 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, expression) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _statementListOrExtends) { - HashTable *_1$$4; - HashPosition _0$$4; zend_bool isStatementList = 0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *statements, *statement = NULL, **_2$$4; + zval *statements, statements_sub, statement, *_0$$4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statements_sub); + ZVAL_UNDEF(&statement); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &statements); @@ -1558,21 +1747,21 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _statementListOrExtends) { RETURN_MM(); } isStatementList = 1; - if (!(zephir_array_isset_string(statements, SS("type")))) { - zephir_is_iterable(statements, &_1$$4, &_0$$4, 0, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 1319); - for ( - ; zend_hash_get_current_data_ex(_1$$4, (void**) &_2$$4, &_0$$4) == SUCCESS - ; zend_hash_move_forward_ex(_1$$4, &_0$$4) - ) { - ZEPHIR_GET_HVALUE(statement, _2$$4); - if (Z_TYPE_P(statement) != IS_ARRAY) { + if (!(zephir_array_isset_string(statements, SL("type")))) { + zephir_is_iterable(statements, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 1319); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(statements), _0$$4) + { + ZEPHIR_INIT_NVAR(&statement); + ZVAL_COPY(&statement, _0$$4); + if (Z_TYPE_P(&statement) != IS_ARRAY) { isStatementList = 0; break; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&statement); } if (isStatementList == 1) { - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_statementlist", NULL, 419, statements); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_statementlist", NULL, 373, statements); zephir_check_call_status(); RETURN_MM(); } @@ -1586,17 +1775,57 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _statementListOrExtends) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach) { - HashTable *_1$$4; - HashPosition _0$$4; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *statement_param = NULL, *extendsMode_param = NULL, *compilation = NULL, *prefix = NULL, *level = NULL, *prefixLevel = NULL, *expr = NULL, *exprCode = NULL, *bstatement = NULL, *type = NULL, *blockStatements = NULL, *forElse = NULL, *code = NULL, *loopContext = NULL, *iterator = NULL, *key = NULL, *ifExpr = NULL, *variable = NULL, *_4, **_2$$4, *_3$$8 = NULL, *_5$$9, *_6$$9, *_7$$9, *_8$$9, *_9$$9, *_10$$9, *_11$$9, *_12$$9, *_13$$9, *_14$$11, *_15$$12, *_16$$13 = NULL, *_17$$13, *_18$$15, *_19$$15, *_20$$15, *_21$$15, *_22$$15, *_23$$15, *_24$$16, *_25$$20; - zval *statement = NULL; + zval *statement_param = NULL, *extendsMode_param = NULL, compilation, prefix, level, prefixLevel, expr, exprCode, bstatement, type, blockStatements, forElse, code, loopContext, iterator, key, ifExpr, variable, _2, *_0$$4, _1$$8, _3$$9, _4$$9, _5$$9, _6$$9, _7$$9, _8$$9, _9$$9, _10$$9, _11$$9, _12$$11, _13$$12, _14$$13, _15$$13, _16$$15, _17$$15, _18$$15, _19$$15, _20$$15, _21$$15, _22$$16, _23$$20; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&level); + ZVAL_UNDEF(&prefixLevel); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&exprCode); + ZVAL_UNDEF(&bstatement); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&blockStatements); + ZVAL_UNDEF(&forElse); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&loopContext); + ZVAL_UNDEF(&iterator); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&ifExpr); + ZVAL_UNDEF(&variable); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$8); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$9); + ZVAL_UNDEF(&_5$$9); + ZVAL_UNDEF(&_6$$9); + ZVAL_UNDEF(&_7$$9); + ZVAL_UNDEF(&_8$$9); + ZVAL_UNDEF(&_9$$9); + ZVAL_UNDEF(&_10$$9); + ZVAL_UNDEF(&_11$$9); + ZVAL_UNDEF(&_12$$11); + ZVAL_UNDEF(&_13$$12); + ZVAL_UNDEF(&_14$$13); + ZVAL_UNDEF(&_15$$13); + ZVAL_UNDEF(&_16$$15); + ZVAL_UNDEF(&_17$$15); + ZVAL_UNDEF(&_18$$15); + ZVAL_UNDEF(&_19$$15); + ZVAL_UNDEF(&_20$$15); + ZVAL_UNDEF(&_21$$15); + ZVAL_UNDEF(&_22$$16); + ZVAL_UNDEF(&_23$$20); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &statement_param, &extendsMode_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); if (!extendsMode_param) { extendsMode = 0; } else { @@ -1604,160 +1833,159 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach) { } - if (!(zephir_array_isset_string(statement, SS("expr")))) { + if (!(zephir_array_isset_string(&statement, SL("expr")))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/mvc/view/engine/volt/compiler.zep", 1347); return; } - ZEPHIR_INIT_VAR(compilation); - ZVAL_STRING(compilation, "", 1); - ZEPHIR_INIT_VAR(forElse); - ZVAL_NULL(forElse); + ZEPHIR_INIT_VAR(&compilation); + ZVAL_STRING(&compilation, ""); + ZEPHIR_INIT_VAR(&forElse); + ZVAL_NULL(&forElse); RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_foreachLevel") TSRMLS_CC)); ZEPHIR_CALL_METHOD(&prefix, this_ptr, "getuniqueprefix", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(level); - zephir_read_property_this(&level, this_ptr, SL("_foreachLevel"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(prefixLevel); - ZEPHIR_CONCAT_VV(prefixLevel, prefix, level); - ZEPHIR_OBS_VAR(expr); - zephir_array_fetch_string(&expr, statement, SL("expr"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1365 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_OBS_VAR(&level); + zephir_read_property(&level, this_ptr, SL("_foreachLevel"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&prefixLevel); + ZEPHIR_CONCAT_VV(&prefixLevel, &prefix, &level); + ZEPHIR_OBS_VAR(&expr); + zephir_array_fetch_string(&expr, &statement, SL("expr"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1365 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - ZEPHIR_OBS_VAR(blockStatements); - zephir_array_fetch_string(&blockStatements, statement, SL("block_statements"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1371 TSRMLS_CC); - ZEPHIR_INIT_NVAR(forElse); - ZVAL_BOOL(forElse, 0); - if (Z_TYPE_P(blockStatements) == IS_ARRAY) { - zephir_is_iterable(blockStatements, &_1$$4, &_0$$4, 0, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 1397); - for ( - ; zend_hash_get_current_data_ex(_1$$4, (void**) &_2$$4, &_0$$4) == SUCCESS - ; zend_hash_move_forward_ex(_1$$4, &_0$$4) - ) { - ZEPHIR_GET_HVALUE(bstatement, _2$$4); - if (Z_TYPE_P(bstatement) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&blockStatements); + zephir_array_fetch_string(&blockStatements, &statement, SL("block_statements"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1371 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&forElse); + ZVAL_BOOL(&forElse, 0); + if (Z_TYPE_P(&blockStatements) == IS_ARRAY) { + zephir_is_iterable(&blockStatements, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 1397); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&blockStatements), _0$$4) + { + ZEPHIR_INIT_NVAR(&bstatement); + ZVAL_COPY(&bstatement, _0$$4); + if (Z_TYPE_P(&bstatement) != IS_ARRAY) { break; } - ZEPHIR_OBS_NVAR(type); - if (!(zephir_array_isset_string_fetch(&type, bstatement, SS("type"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&type); + if (!(zephir_array_isset_string_fetch(&type, &bstatement, SL("type"), 0))) { break; } - if (ZEPHIR_IS_LONG(type, 321)) { - ZEPHIR_INIT_LNVAR(_3$$8); - ZEPHIR_CONCAT_SVS(_3$$8, ""); - zephir_concat_self(&compilation, _3$$8 TSRMLS_CC); - ZEPHIR_CPY_WRT(forElse, prefixLevel); - zephir_update_property_array(this_ptr, SL("_forElsePointers"), level, forElse TSRMLS_CC); + if (ZEPHIR_IS_LONG(&type, 321)) { + ZEPHIR_INIT_LNVAR(_1$$8); + ZEPHIR_CONCAT_SVS(&_1$$8, ""); + zephir_concat_self(&compilation, &_1$$8 TSRMLS_CC); + ZEPHIR_CPY_WRT(&forElse, &prefixLevel); + zephir_update_property_array(this_ptr, SL("_forElsePointers"), &level, &forElse TSRMLS_CC); break; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&bstatement); } - ZEPHIR_INIT_VAR(_4); if (extendsMode) { - ZVAL_BOOL(_4, 1); + ZVAL_BOOL(&_2, 1); } else { - ZVAL_BOOL(_4, 0); + ZVAL_BOOL(&_2, 0); } - ZEPHIR_CALL_METHOD(&code, this_ptr, "_statementlist", NULL, 419, blockStatements, _4); + ZEPHIR_CALL_METHOD(&code, this_ptr, "_statementlist", NULL, 373, &blockStatements, &_2); zephir_check_call_status(); - ZEPHIR_OBS_VAR(loopContext); - zephir_read_property_this(&loopContext, this_ptr, SL("_loopPointers"), PH_NOISY_CC); - if (zephir_array_isset(loopContext, level)) { - ZEPHIR_INIT_VAR(_5$$9); - ZEPHIR_CONCAT_SVSVS(_5$$9, "self = &$", prefixLevel, "loop; "); - zephir_concat_self(&compilation, _8$$9 TSRMLS_CC); - ZEPHIR_INIT_VAR(_9$$9); - ZEPHIR_CONCAT_SVSVS(_9$$9, "$", prefixLevel, "loop->length = count($", prefixLevel, "iterator); "); - zephir_concat_self(&compilation, _9$$9 TSRMLS_CC); - ZEPHIR_INIT_VAR(_10$$9); - ZEPHIR_CONCAT_SVS(_10$$9, "$", prefixLevel, "loop->index = 1; "); - zephir_concat_self(&compilation, _10$$9 TSRMLS_CC); - ZEPHIR_INIT_VAR(_11$$9); - ZEPHIR_CONCAT_SVS(_11$$9, "$", prefixLevel, "loop->index0 = 1; "); - zephir_concat_self(&compilation, _11$$9 TSRMLS_CC); - ZEPHIR_INIT_VAR(_12$$9); - ZEPHIR_CONCAT_SVSVS(_12$$9, "$", prefixLevel, "loop->revindex = $", prefixLevel, "loop->length; "); - zephir_concat_self(&compilation, _12$$9 TSRMLS_CC); - ZEPHIR_INIT_VAR(_13$$9); - ZEPHIR_CONCAT_SVSVS(_13$$9, "$", prefixLevel, "loop->revindex0 = $", prefixLevel, "loop->length - 1; ?>"); - zephir_concat_self(&compilation, _13$$9 TSRMLS_CC); - ZEPHIR_INIT_VAR(iterator); - ZEPHIR_CONCAT_SVS(iterator, "$", prefixLevel, "iterator"); + ZEPHIR_OBS_VAR(&loopContext); + zephir_read_property(&loopContext, this_ptr, SL("_loopPointers"), PH_NOISY_CC); + if (zephir_array_isset(&loopContext, &level)) { + ZEPHIR_INIT_VAR(&_3$$9); + ZEPHIR_CONCAT_SVSVS(&_3$$9, "self = &$", &prefixLevel, "loop; "); + zephir_concat_self(&compilation, &_6$$9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_7$$9); + ZEPHIR_CONCAT_SVSVS(&_7$$9, "$", &prefixLevel, "loop->length = count($", &prefixLevel, "iterator); "); + zephir_concat_self(&compilation, &_7$$9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_8$$9); + ZEPHIR_CONCAT_SVS(&_8$$9, "$", &prefixLevel, "loop->index = 1; "); + zephir_concat_self(&compilation, &_8$$9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_9$$9); + ZEPHIR_CONCAT_SVS(&_9$$9, "$", &prefixLevel, "loop->index0 = 1; "); + zephir_concat_self(&compilation, &_9$$9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_10$$9); + ZEPHIR_CONCAT_SVSVS(&_10$$9, "$", &prefixLevel, "loop->revindex = $", &prefixLevel, "loop->length; "); + zephir_concat_self(&compilation, &_10$$9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_11$$9); + ZEPHIR_CONCAT_SVSVS(&_11$$9, "$", &prefixLevel, "loop->revindex0 = $", &prefixLevel, "loop->length - 1; ?>"); + zephir_concat_self(&compilation, &_11$$9 TSRMLS_CC); + ZEPHIR_INIT_VAR(&iterator); + ZEPHIR_CONCAT_SVS(&iterator, "$", &prefixLevel, "iterator"); } else { - ZEPHIR_CPY_WRT(iterator, exprCode); - } - ZEPHIR_OBS_VAR(variable); - zephir_array_fetch_string(&variable, statement, SL("variable"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1427 TSRMLS_CC); - ZEPHIR_OBS_VAR(key); - if (zephir_array_isset_string_fetch(&key, statement, SS("key"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_14$$11); - ZEPHIR_CONCAT_SVSVSVS(_14$$11, " $", variable, ") { "); - zephir_concat_self(&compilation, _14$$11 TSRMLS_CC); + ZEPHIR_CPY_WRT(&iterator, &exprCode); + } + ZEPHIR_OBS_VAR(&variable); + zephir_array_fetch_string(&variable, &statement, SL("variable"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1427 TSRMLS_CC); + ZEPHIR_OBS_VAR(&key); + if (zephir_array_isset_string_fetch(&key, &statement, SL("key"), 0)) { + ZEPHIR_INIT_VAR(&_12$$11); + ZEPHIR_CONCAT_SVSVSVS(&_12$$11, " $", &variable, ") { "); + zephir_concat_self(&compilation, &_12$$11 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_15$$12); - ZEPHIR_CONCAT_SVSVS(_15$$12, ""); - zephir_concat_self(&compilation, _17$$13 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_15$$13); + ZEPHIR_CONCAT_SVS(&_15$$13, "if (", &_14$$13, ") { ?>"); + zephir_concat_self(&compilation, &_15$$13 TSRMLS_CC); } else { zephir_concat_self_str(&compilation, SL("?>") TSRMLS_CC); } - if (zephir_array_isset(loopContext, level)) { - ZEPHIR_INIT_VAR(_18$$15); - ZEPHIR_CONCAT_SVSVS(_18$$15, "first = ($", prefixLevel, "incr == 0); "); - zephir_concat_self(&compilation, _18$$15 TSRMLS_CC); - ZEPHIR_INIT_VAR(_19$$15); - ZEPHIR_CONCAT_SVSVS(_19$$15, "$", prefixLevel, "loop->index = $", prefixLevel, "incr + 1; "); - zephir_concat_self(&compilation, _19$$15 TSRMLS_CC); - ZEPHIR_INIT_VAR(_20$$15); - ZEPHIR_CONCAT_SVSVS(_20$$15, "$", prefixLevel, "loop->index0 = $", prefixLevel, "incr; "); - zephir_concat_self(&compilation, _20$$15 TSRMLS_CC); - ZEPHIR_INIT_VAR(_21$$15); - ZEPHIR_CONCAT_SVSVSVS(_21$$15, "$", prefixLevel, "loop->revindex = $", prefixLevel, "loop->length - $", prefixLevel, "incr; "); - zephir_concat_self(&compilation, _21$$15 TSRMLS_CC); - ZEPHIR_INIT_VAR(_22$$15); - ZEPHIR_CONCAT_SVSVSVS(_22$$15, "$", prefixLevel, "loop->revindex0 = $", prefixLevel, "loop->length - ($", prefixLevel, "incr + 1); "); - zephir_concat_self(&compilation, _22$$15 TSRMLS_CC); - ZEPHIR_INIT_VAR(_23$$15); - ZEPHIR_CONCAT_SVSVSVS(_23$$15, "$", prefixLevel, "loop->last = ($", prefixLevel, "incr == ($", prefixLevel, "loop->length - 1)); ?>"); - zephir_concat_self(&compilation, _23$$15 TSRMLS_CC); - } - if (Z_TYPE_P(forElse) == IS_STRING) { - ZEPHIR_INIT_VAR(_24$$16); - ZEPHIR_CONCAT_SVS(_24$$16, ""); - zephir_concat_self(&compilation, _24$$16 TSRMLS_CC); - } - zephir_concat_self(&compilation, code TSRMLS_CC); - if (zephir_array_isset_string(statement, SS("if_expr"))) { + if (zephir_array_isset(&loopContext, &level)) { + ZEPHIR_INIT_VAR(&_16$$15); + ZEPHIR_CONCAT_SVSVS(&_16$$15, "first = ($", &prefixLevel, "incr == 0); "); + zephir_concat_self(&compilation, &_16$$15 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_17$$15); + ZEPHIR_CONCAT_SVSVS(&_17$$15, "$", &prefixLevel, "loop->index = $", &prefixLevel, "incr + 1; "); + zephir_concat_self(&compilation, &_17$$15 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_18$$15); + ZEPHIR_CONCAT_SVSVS(&_18$$15, "$", &prefixLevel, "loop->index0 = $", &prefixLevel, "incr; "); + zephir_concat_self(&compilation, &_18$$15 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_19$$15); + ZEPHIR_CONCAT_SVSVSVS(&_19$$15, "$", &prefixLevel, "loop->revindex = $", &prefixLevel, "loop->length - $", &prefixLevel, "incr; "); + zephir_concat_self(&compilation, &_19$$15 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_20$$15); + ZEPHIR_CONCAT_SVSVSVS(&_20$$15, "$", &prefixLevel, "loop->revindex0 = $", &prefixLevel, "loop->length - ($", &prefixLevel, "incr + 1); "); + zephir_concat_self(&compilation, &_20$$15 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_21$$15); + ZEPHIR_CONCAT_SVSVSVS(&_21$$15, "$", &prefixLevel, "loop->last = ($", &prefixLevel, "incr == ($", &prefixLevel, "loop->length - 1)); ?>"); + zephir_concat_self(&compilation, &_21$$15 TSRMLS_CC); + } + if (Z_TYPE_P(&forElse) == IS_STRING) { + ZEPHIR_INIT_VAR(&_22$$16); + ZEPHIR_CONCAT_SVS(&_22$$16, ""); + zephir_concat_self(&compilation, &_22$$16 TSRMLS_CC); + } + zephir_concat_self(&compilation, &code TSRMLS_CC); + if (zephir_array_isset_string(&statement, SL("if_expr"))) { zephir_concat_self_str(&compilation, SL("") TSRMLS_CC); } - if (Z_TYPE_P(forElse) == IS_STRING) { + if (Z_TYPE_P(&forElse) == IS_STRING) { zephir_concat_self_str(&compilation, SL("") TSRMLS_CC); } else { - if (zephir_array_isset(loopContext, level)) { - ZEPHIR_INIT_VAR(_25$$20); - ZEPHIR_CONCAT_SVS(_25$$20, ""); - zephir_concat_self(&compilation, _25$$20 TSRMLS_CC); + if (zephir_array_isset(&loopContext, &level)) { + ZEPHIR_INIT_VAR(&_23$$20); + ZEPHIR_CONCAT_SVS(&_23$$20, ""); + zephir_concat_self(&compilation, &_23$$20 TSRMLS_CC); } else { zephir_concat_self_str(&compilation, SL("") TSRMLS_CC); } } RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_foreachLevel") TSRMLS_CC)); - RETURN_CCTOR(compilation); + RETURN_CCTOR(&compilation); } @@ -1766,21 +1994,27 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForElse) { - zval *level = NULL, *prefix = NULL, *_0, *_1$$3; + zval level, prefix, _0, _1$$3; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&level); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); - level = zephir_fetch_nproperty_this(this_ptr, SL("_foreachLevel"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_forElsePointers"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&prefix, _0, level, 1 TSRMLS_CC)) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_loopPointers"), PH_NOISY_CC); - if (zephir_array_isset(_1$$3, level)) { - ZEPHIR_CONCAT_SVSVS(return_value, ""); + + zephir_read_property(&level, this_ptr, SL("_foreachLevel"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_0, this_ptr, SL("_forElsePointers"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&prefix, &_0, &level, 1 TSRMLS_CC)) { + zephir_read_property(&_1$$3, this_ptr, SL("_loopPointers"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_1$$3, &level)) { + ZEPHIR_CONCAT_SVSVS(return_value, ""); return; } - ZEPHIR_CONCAT_SVS(return_value, ""); + ZEPHIR_CONCAT_SVS(return_value, ""); return; } - RETURN_STRING("", 1); + RETURN_STRING(""); } @@ -1791,13 +2025,28 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *statement_param = NULL, *extendsMode_param = NULL, *compilation = NULL, *blockStatements = NULL, *expr = NULL, *_2 = NULL, *_3 = NULL, *_4, *_5, *_0$$3, *_1$$3, *_6$$4 = NULL, *_7$$4, *_8$$4; - zval *statement = NULL; + zval *statement_param = NULL, *extendsMode_param = NULL, compilation, blockStatements, expr, _2, _3, _4, _5, _0$$3, _1$$3, _6$$4, _7$$4, _8$$4; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&blockStatements); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_6$$4); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&_8$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &statement_param, &extendsMode_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); if (!extendsMode_param) { extendsMode = 0; } else { @@ -1805,48 +2054,45 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf) { } - ZEPHIR_OBS_VAR(expr); - if (!(zephir_array_isset_string_fetch(&expr, statement, SS("expr"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "Corrupt statement", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 415, _1$$3, statement); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_OBS_VAR(&expr); + if (!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "Corrupt statement"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 369, &_1$$3, &statement); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1518 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1518 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - zephir_array_fetch_string(&_4, statement, SL("true_statements"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1524 TSRMLS_CC); - ZEPHIR_INIT_VAR(_5); + zephir_array_fetch_string(&_4, &statement, SL("true_statements"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1524 TSRMLS_CC); if (extendsMode) { - ZVAL_BOOL(_5, 1); + ZVAL_BOOL(&_5, 1); } else { - ZVAL_BOOL(_5, 0); + ZVAL_BOOL(&_5, 0); } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "_statementlist", NULL, 419, _4, _5); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "_statementlist", NULL, 373, &_4, &_5); zephir_check_call_status(); - ZEPHIR_INIT_VAR(compilation); - ZEPHIR_CONCAT_SVSV(compilation, "", _3); - ZEPHIR_OBS_VAR(blockStatements); - if (zephir_array_isset_string_fetch(&blockStatements, statement, SS("false_statements"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_7$$4); + ZEPHIR_INIT_VAR(&compilation); + ZEPHIR_CONCAT_SVSV(&compilation, "", &_3); + ZEPHIR_OBS_VAR(&blockStatements); + if (zephir_array_isset_string_fetch(&blockStatements, &statement, SL("false_statements"), 0)) { if (extendsMode) { - ZVAL_BOOL(_7$$4, 1); + ZVAL_BOOL(&_7$$4, 1); } else { - ZVAL_BOOL(_7$$4, 0); + ZVAL_BOOL(&_7$$4, 0); } - ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "_statementlist", NULL, 419, blockStatements, _7$$4); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "_statementlist", NULL, 373, &blockStatements, &_7$$4); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_8$$4); - ZEPHIR_CONCAT_SV(_8$$4, "", _6$$4); - zephir_concat_self(&compilation, _8$$4 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_8$$4); + ZEPHIR_CONCAT_SV(&_8$$4, "", &_6$$4); + zephir_concat_self(&compilation, &_8$$4 TSRMLS_CC); } zephir_concat_self_str(&compilation, SL("") TSRMLS_CC); - RETURN_CCTOR(compilation); + RETURN_CCTOR(&compilation); } @@ -1857,13 +2103,27 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSwitch) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *statement_param = NULL, *extendsMode_param = NULL, *compilation = NULL, *caseClauses = NULL, *expr = NULL, *lines = NULL, *_2 = NULL, *_0$$3, *_1$$3, *_3$$4, *_4$$5, *_5$$5, *_6$$5 = NULL; - zval *statement = NULL; + zval *statement_param = NULL, *extendsMode_param = NULL, compilation, caseClauses, expr, lines, _2, _0$$3, _1$$3, _3$$4, _4$$5, _5$$5, _6$$5; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&caseClauses); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&lines); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &statement_param, &extendsMode_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); if (!extendsMode_param) { extendsMode = 0; } else { @@ -1871,48 +2131,44 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSwitch) { } - ZEPHIR_OBS_VAR(expr); - if (!(zephir_array_isset_string_fetch(&expr, statement, SS("expr"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "Corrupt statement", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 415, _1$$3, statement); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_OBS_VAR(&expr); + if (!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "Corrupt statement"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 369, &_1$$3, &statement); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1553 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1553 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - ZEPHIR_INIT_VAR(compilation); - ZEPHIR_CONCAT_SVS(compilation, ""); - ZEPHIR_OBS_VAR(caseClauses); - if (zephir_array_isset_string_fetch(&caseClauses, statement, SS("case_clauses"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_3$$4); + ZEPHIR_INIT_VAR(&compilation); + ZEPHIR_CONCAT_SVS(&compilation, ""); + ZEPHIR_OBS_VAR(&caseClauses); + if (zephir_array_isset_string_fetch(&caseClauses, &statement, SL("case_clauses"), 0)) { if (extendsMode) { - ZVAL_BOOL(_3$$4, 1); + ZVAL_BOOL(&_3$$4, 1); } else { - ZVAL_BOOL(_3$$4, 0); + ZVAL_BOOL(&_3$$4, 0); } - ZEPHIR_CALL_METHOD(&lines, this_ptr, "_statementlist", NULL, 419, caseClauses, _3$$4); + ZEPHIR_CALL_METHOD(&lines, this_ptr, "_statementlist", NULL, 373, &caseClauses, &_3$$4); zephir_check_call_status(); - if (zephir_fast_strlen_ev(lines) != 0) { - ZEPHIR_INIT_VAR(_4$$5); - ZVAL_STRING(_4$$5, "/(*ANYCRLF)^\\h+|\\h+$|(\\h){2,}/mu", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_5$$5); - ZVAL_STRING(_5$$5, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_6$$5, "preg_replace", NULL, 42, _4$$5, _5$$5, lines); - zephir_check_temp_parameter(_4$$5); - zephir_check_temp_parameter(_5$$5); + if (zephir_fast_strlen_ev(&lines) != 0) { + ZEPHIR_INIT_VAR(&_4$$5); + ZVAL_STRING(&_4$$5, "/(*ANYCRLF)^\\h+|\\h+$|(\\h){2,}/mu"); + ZEPHIR_INIT_VAR(&_5$$5); + ZVAL_STRING(&_5$$5, ""); + ZEPHIR_CALL_FUNCTION(&_6$$5, "preg_replace", NULL, 35, &_4$$5, &_5$$5, &lines); zephir_check_call_status(); - ZEPHIR_CPY_WRT(lines, _6$$5); + ZEPHIR_CPY_WRT(&lines, &_6$$5); } - zephir_concat_self(&compilation, lines TSRMLS_CC); + zephir_concat_self(&compilation, &lines TSRMLS_CC); } zephir_concat_self_str(&compilation, SL("") TSRMLS_CC); - RETURN_CCTOR(compilation); + RETURN_CCTOR(&compilation); } @@ -1923,13 +2179,20 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCase) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool caseClause; - zval *statement_param = NULL, *caseClause_param = NULL, *expr = NULL, *_2 = NULL, *_0$$4, *_1$$4; - zval *statement = NULL; + zval *statement_param = NULL, *caseClause_param = NULL, expr, _2, _0$$4, _1$$4; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &statement_param, &caseClause_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); if (!caseClause_param) { caseClause = 1; } else { @@ -1938,24 +2201,23 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCase) { if (UNEXPECTED(caseClause == 0)) { - RETURN_MM_STRING("", 1); - } - ZEPHIR_OBS_VAR(expr); - if (!(zephir_array_isset_string_fetch(&expr, statement, SS("expr"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$4); - object_init_ex(_0$$4, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_STRING(_1$$4, "Corrupt statement", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0$$4, "__construct", NULL, 415, _1$$4, statement); - zephir_check_temp_parameter(_1$$4); + RETURN_MM_STRING(""); + } + ZEPHIR_OBS_VAR(&expr); + if (!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0))) { + ZEPHIR_INIT_VAR(&_0$$4); + object_init_ex(&_0$$4, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_STRING(&_1$$4, "Corrupt statement"); + ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 369, &_1$$4, &statement); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$4, "phalcon/mvc/view/engine/volt/compiler.zep", 1613 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$4, "phalcon/mvc/view/engine/volt/compiler.zep", 1613 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, ""); + ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); } @@ -1966,31 +2228,37 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCase) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileElseIf) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *statement_param = NULL, *expr = NULL, *_2 = NULL, *_0$$3, *_1$$3; - zval *statement = NULL; + zval *statement_param = NULL, expr, _2, _0$$3, _1$$3; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &statement_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); - ZEPHIR_OBS_VAR(expr); - if (!(zephir_array_isset_string_fetch(&expr, statement, SS("expr"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "Corrupt statement", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 415, _1$$3, statement); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_OBS_VAR(&expr); + if (!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "Corrupt statement"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 369, &_1$$3, &statement); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1633 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1633 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, ""); + ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); } @@ -2002,13 +2270,41 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCache) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *statement_param = NULL, *extendsMode_param = NULL, *compilation = NULL, *expr = NULL, *exprCode = NULL, *lifetime = NULL, *_2 = NULL, *_10, *_11 = NULL, *_12, *_13, *_0$$3, *_1$$3, *_3$$4, *_4$$4, *_5$$5, *_6$$5, *_7$$6, *_8$$6, *_9$$7, *_14$$8, *_19$$8, *_15$$9, *_16$$9, *_17$$10, *_18$$10, *_20$$11; - zval *statement = NULL; + zval *statement_param = NULL, *extendsMode_param = NULL, compilation, expr, exprCode, lifetime, _2, _10, _11, _12, _13, _0$$3, _1$$3, _3$$4, _4$$4, _5$$5, _6$$5, _7$$6, _8$$6, _9$$7, _14$$8, _19$$8, _15$$9, _16$$9, _17$$10, _18$$10, _20$$11; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&exprCode); + ZVAL_UNDEF(&lifetime); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_8$$6); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_14$$8); + ZVAL_UNDEF(&_19$$8); + ZVAL_UNDEF(&_15$$9); + ZVAL_UNDEF(&_16$$9); + ZVAL_UNDEF(&_17$$10); + ZVAL_UNDEF(&_18$$10); + ZVAL_UNDEF(&_20$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &statement_param, &extendsMode_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); if (!extendsMode_param) { extendsMode = 0; } else { @@ -2016,83 +2312,81 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCache) { } - ZEPHIR_OBS_VAR(expr); - if (!(zephir_array_isset_string_fetch(&expr, statement, SS("expr"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "Corrupt statement", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 415, _1$$3, statement); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_OBS_VAR(&expr); + if (!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "Corrupt statement"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 369, &_1$$3, &statement); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1653 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1653 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - ZEPHIR_INIT_VAR(compilation); - ZEPHIR_CONCAT_SVS(compilation, "di->get('viewCache'); "); - ZEPHIR_OBS_VAR(lifetime); - if (zephir_array_isset_string_fetch(&lifetime, statement, SS("lifetime"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_3$$4); - ZEPHIR_CONCAT_SVS(_3$$4, "$_cacheKey[", exprCode, "]"); - zephir_concat_self(&compilation, _3$$4 TSRMLS_CC); - zephir_array_fetch_string(&_4$$4, lifetime, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1663 TSRMLS_CC); - if (ZEPHIR_IS_LONG(_4$$4, 265)) { - zephir_array_fetch_string(&_5$$5, lifetime, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1664 TSRMLS_CC); - ZEPHIR_INIT_VAR(_6$$5); - ZEPHIR_CONCAT_SVSVSVS(_6$$5, " = $_cache[", exprCode, "]->start(", exprCode, ", $", _5$$5, "); "); - zephir_concat_self(&compilation, _6$$5 TSRMLS_CC); + ZEPHIR_INIT_VAR(&compilation); + ZEPHIR_CONCAT_SVS(&compilation, "di->get('viewCache'); "); + ZEPHIR_OBS_VAR(&lifetime); + if (zephir_array_isset_string_fetch(&lifetime, &statement, SL("lifetime"), 0)) { + ZEPHIR_INIT_VAR(&_3$$4); + ZEPHIR_CONCAT_SVS(&_3$$4, "$_cacheKey[", &exprCode, "]"); + zephir_concat_self(&compilation, &_3$$4 TSRMLS_CC); + zephir_array_fetch_string(&_4$$4, &lifetime, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1663 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&_4$$4, 265)) { + zephir_array_fetch_string(&_5$$5, &lifetime, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1664 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$5); + ZEPHIR_CONCAT_SVSVSVS(&_6$$5, " = $_cache[", &exprCode, "]->start(", &exprCode, ", $", &_5$$5, "); "); + zephir_concat_self(&compilation, &_6$$5 TSRMLS_CC); } else { - zephir_array_fetch_string(&_7$$6, lifetime, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1666 TSRMLS_CC); - ZEPHIR_INIT_VAR(_8$$6); - ZEPHIR_CONCAT_SVSVSVS(_8$$6, " = $_cache[", exprCode, "]->start(", exprCode, ", ", _7$$6, "); "); - zephir_concat_self(&compilation, _8$$6 TSRMLS_CC); + zephir_array_fetch_string(&_7$$6, &lifetime, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1666 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_8$$6); + ZEPHIR_CONCAT_SVSVSVS(&_8$$6, " = $_cache[", &exprCode, "]->start(", &exprCode, ", ", &_7$$6, "); "); + zephir_concat_self(&compilation, &_8$$6 TSRMLS_CC); } } else { - ZEPHIR_INIT_VAR(_9$$7); - ZEPHIR_CONCAT_SVSVSVS(_9$$7, "$_cacheKey[", exprCode, "] = $_cache[", exprCode, "]->start(", exprCode, "); "); - zephir_concat_self(&compilation, _9$$7 TSRMLS_CC); - } - ZEPHIR_INIT_VAR(_10); - ZEPHIR_CONCAT_SVS(_10, "if ($_cacheKey[", exprCode, "] === null) { ?>"); - zephir_concat_self(&compilation, _10 TSRMLS_CC); - zephir_array_fetch_string(&_12, statement, SL("block_statements"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1676 TSRMLS_CC); - ZEPHIR_INIT_VAR(_13); + ZEPHIR_INIT_VAR(&_9$$7); + ZEPHIR_CONCAT_SVSVSVS(&_9$$7, "$_cacheKey[", &exprCode, "] = $_cache[", &exprCode, "]->start(", &exprCode, "); "); + zephir_concat_self(&compilation, &_9$$7 TSRMLS_CC); + } + ZEPHIR_INIT_VAR(&_10); + ZEPHIR_CONCAT_SVS(&_10, "if ($_cacheKey[", &exprCode, "] === null) { ?>"); + zephir_concat_self(&compilation, &_10 TSRMLS_CC); + zephir_array_fetch_string(&_12, &statement, SL("block_statements"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1676 TSRMLS_CC); if (extendsMode) { - ZVAL_BOOL(_13, 1); + ZVAL_BOOL(&_13, 1); } else { - ZVAL_BOOL(_13, 0); + ZVAL_BOOL(&_13, 0); } - ZEPHIR_CALL_METHOD(&_11, this_ptr, "_statementlist", NULL, 419, _12, _13); + ZEPHIR_CALL_METHOD(&_11, this_ptr, "_statementlist", NULL, 373, &_12, &_13); zephir_check_call_status(); - zephir_concat_self(&compilation, _11 TSRMLS_CC); - ZEPHIR_OBS_NVAR(lifetime); - if (zephir_array_isset_string_fetch(&lifetime, statement, SS("lifetime"), 0 TSRMLS_CC)) { - zephir_array_fetch_string(&_14$$8, lifetime, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1682 TSRMLS_CC); - if (ZEPHIR_IS_LONG(_14$$8, 265)) { - zephir_array_fetch_string(&_15$$9, lifetime, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1683 TSRMLS_CC); - ZEPHIR_INIT_VAR(_16$$9); - ZEPHIR_CONCAT_SVSVSVS(_16$$9, "save(", exprCode, ", null, $", _15$$9, "); "); - zephir_concat_self(&compilation, _16$$9 TSRMLS_CC); + zephir_concat_self(&compilation, &_11 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&lifetime); + if (zephir_array_isset_string_fetch(&lifetime, &statement, SL("lifetime"), 0)) { + zephir_array_fetch_string(&_14$$8, &lifetime, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1682 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&_14$$8, 265)) { + zephir_array_fetch_string(&_15$$9, &lifetime, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1683 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_16$$9); + ZEPHIR_CONCAT_SVSVSVS(&_16$$9, "save(", &exprCode, ", null, $", &_15$$9, "); "); + zephir_concat_self(&compilation, &_16$$9 TSRMLS_CC); } else { - zephir_array_fetch_string(&_17$$10, lifetime, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1685 TSRMLS_CC); - ZEPHIR_INIT_VAR(_18$$10); - ZEPHIR_CONCAT_SVSVSVS(_18$$10, "save(", exprCode, ", null, ", _17$$10, "); "); - zephir_concat_self(&compilation, _18$$10 TSRMLS_CC); - } - ZEPHIR_INIT_VAR(_19$$8); - ZEPHIR_CONCAT_SVS(_19$$8, "} else { echo $_cacheKey[", exprCode, "]; } ?>"); - zephir_concat_self(&compilation, _19$$8 TSRMLS_CC); + zephir_array_fetch_string(&_17$$10, &lifetime, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1685 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_18$$10); + ZEPHIR_CONCAT_SVSVSVS(&_18$$10, "save(", &exprCode, ", null, ", &_17$$10, "); "); + zephir_concat_self(&compilation, &_18$$10 TSRMLS_CC); + } + ZEPHIR_INIT_VAR(&_19$$8); + ZEPHIR_CONCAT_SVS(&_19$$8, "} else { echo $_cacheKey[", &exprCode, "]; } ?>"); + zephir_concat_self(&compilation, &_19$$8 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_20$$11); - ZEPHIR_CONCAT_SVSVSVS(_20$$11, "save(", exprCode, "); } else { echo $_cacheKey[", exprCode, "]; } ?>"); - zephir_concat_self(&compilation, _20$$11 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_20$$11); + ZEPHIR_CONCAT_SVSVSVS(&_20$$11, "save(", &exprCode, "); } else { echo $_cacheKey[", &exprCode, "]; } ?>"); + zephir_concat_self(&compilation, &_20$$11 TSRMLS_CC); } - RETURN_CCTOR(compilation); + RETURN_CCTOR(&compilation); } @@ -2101,73 +2395,87 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCache) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSet) { - HashTable *_1; - HashPosition _0; - zephir_fcall_cache_entry *_4 = NULL; + zephir_fcall_cache_entry *_2 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *statement_param = NULL, *assignments = NULL, *assignment = NULL, *exprCode = NULL, *target = NULL, *compilation = NULL, **_2, *_3$$4, *_5$$4, *_6$$4, *_7$$5 = NULL, *_8$$6 = NULL, *_9$$7 = NULL, *_10$$8 = NULL, *_11$$9 = NULL; - zval *statement = NULL; + zval *statement_param = NULL, assignments, assignment, exprCode, target, compilation, *_0, _1$$4, _3$$4, _4$$4, _5$$5, _6$$6, _7$$7, _8$$8, _9$$9; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&assignments); + ZVAL_UNDEF(&assignment); + ZVAL_UNDEF(&exprCode); + ZVAL_UNDEF(&target); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$7); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &statement_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); - ZEPHIR_OBS_VAR(assignments); - if (!(zephir_array_isset_string_fetch(&assignments, statement, SS("assignments"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&assignments); + if (!(zephir_array_isset_string_fetch(&assignments, &statement, SL("assignments"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/mvc/view/engine/volt/compiler.zep", 1706); return; } - ZEPHIR_INIT_VAR(compilation); - ZVAL_STRING(compilation, "") TSRMLS_CC); - RETURN_CCTOR(compilation); + RETURN_CCTOR(&compilation); } @@ -2177,23 +2485,28 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSet) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileDo) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *statement_param = NULL, *expr = NULL, *_0 = NULL; - zval *statement = NULL; + zval *statement_param = NULL, expr, _0; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &statement_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); - ZEPHIR_OBS_VAR(expr); - if (!(zephir_array_isset_string_fetch(&expr, statement, SS("expr"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&expr); + if (!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/mvc/view/engine/volt/compiler.zep", 1767); return; } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, ""); + ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); } @@ -2204,23 +2517,28 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileDo) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileReturn) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *statement_param = NULL, *expr = NULL, *_0 = NULL; - zval *statement = NULL; + zval *statement_param = NULL, expr, _0; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &statement_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); - ZEPHIR_OBS_VAR(expr); - if (!(zephir_array_isset_string_fetch(&expr, statement, SS("expr"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&expr); + if (!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/mvc/view/engine/volt/compiler.zep", 1787); return; } - ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - ZEPHIR_CONCAT_SVS(return_value, ""); + ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); } @@ -2232,35 +2550,42 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileAutoEscape) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *statement_param = NULL, *extendsMode_param = NULL, *autoescape = NULL, *oldAutoescape = NULL, *compilation = NULL, *_0, *_1; - zval *statement = NULL; + zval *statement_param = NULL, *extendsMode_param = NULL, autoescape, oldAutoescape, compilation, _0, _1; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&autoescape); + ZVAL_UNDEF(&oldAutoescape); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &statement_param, &extendsMode_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); extendsMode = zephir_get_boolval(extendsMode_param); - ZEPHIR_OBS_VAR(autoescape); - if (!(zephir_array_isset_string_fetch(&autoescape, statement, SS("enable"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&autoescape); + if (!(zephir_array_isset_string_fetch(&autoescape, &statement, SL("enable"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/mvc/view/engine/volt/compiler.zep", 1807); return; } - ZEPHIR_OBS_VAR(oldAutoescape); - zephir_read_property_this(&oldAutoescape, this_ptr, SL("_autoescape"), PH_NOISY_CC); - zephir_update_property_this(getThis(), SL("_autoescape"), autoescape TSRMLS_CC); - zephir_array_fetch_string(&_0, statement, SL("block_statements"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1816 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); + ZEPHIR_OBS_VAR(&oldAutoescape); + zephir_read_property(&oldAutoescape, this_ptr, SL("_autoescape"), PH_NOISY_CC); + zephir_update_property_zval(this_ptr, SL("_autoescape"), &autoescape); + zephir_array_fetch_string(&_0, &statement, SL("block_statements"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1816 TSRMLS_CC); if (extendsMode) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_CALL_METHOD(&compilation, this_ptr, "_statementlist", NULL, 419, _0, _1); + ZEPHIR_CALL_METHOD(&compilation, this_ptr, "_statementlist", NULL, 373, &_0, &_1); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_autoescape"), oldAutoescape TSRMLS_CC); - RETURN_CCTOR(compilation); + zephir_update_property_zval(this_ptr, SL("_autoescape"), &oldAutoescape); + RETURN_CCTOR(&compilation); } @@ -2274,47 +2599,58 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileAutoEscape) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileEcho) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *statement_param = NULL, *expr = NULL, *exprCode = NULL, *name = NULL, *_2, *_5, *_0$$3, *_1$$3, *_3$$4, *_4$$5; - zval *statement = NULL; + zval *statement_param = NULL, expr, exprCode, name, _2, _5, _0$$3, _1$$3, _3$$4, _4$$5; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&expr); + ZVAL_UNDEF(&exprCode); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &statement_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); - ZEPHIR_OBS_VAR(expr); - if (!(zephir_array_isset_string_fetch(&expr, statement, SS("expr"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_VAR(_0$$3); - object_init_ex(_0$$3, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "Corrupt statement", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, _0$$3, "__construct", NULL, 415, _1$$3, statement); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_OBS_VAR(&expr); + if (!(zephir_array_isset_string_fetch(&expr, &statement, SL("expr"), 0))) { + ZEPHIR_INIT_VAR(&_0$$3); + object_init_ex(&_0$$3, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "Corrupt statement"); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", NULL, 369, &_1$$3, &statement); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1837 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$3, "phalcon/mvc/view/engine/volt/compiler.zep", 1837 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 413, expr); + ZEPHIR_CALL_METHOD(&exprCode, this_ptr, "expression", NULL, 367, &expr); zephir_check_call_status(); - zephir_array_fetch_string(&_2, expr, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1845 TSRMLS_CC); - if (ZEPHIR_IS_LONG(_2, 350)) { - zephir_array_fetch_string(&name, expr, SL("name"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1847 TSRMLS_CC); - zephir_array_fetch_string(&_3$$4, name, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1849 TSRMLS_CC); - if (ZEPHIR_IS_LONG(_3$$4, 265)) { - zephir_array_fetch_string(&_4$$5, name, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1854 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_4$$5, "super")) { - RETURN_CCTOR(exprCode); + zephir_array_fetch_string(&_2, &expr, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1845 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&_2, 350)) { + zephir_array_fetch_string(&name, &expr, SL("name"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1847 TSRMLS_CC); + zephir_array_fetch_string(&_3$$4, &name, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1849 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&_3$$4, 265)) { + zephir_array_fetch_string(&_4$$5, &name, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1854 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_4$$5, "super")) { + RETURN_CCTOR(&exprCode); } } } - _5 = zephir_fetch_nproperty_this(this_ptr, SL("_autoescape"), PH_NOISY_CC); - if (zephir_is_true(_5)) { - ZEPHIR_CONCAT_SVS(return_value, "escaper->escapeHtml(", exprCode, ") ?>"); + zephir_read_property(&_5, this_ptr, SL("_autoescape"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_5)) { + ZEPHIR_CONCAT_SVS(return_value, "escaper->escapeHtml(", &exprCode, ") ?>"); RETURN_MM(); } - ZEPHIR_CONCAT_SVS(return_value, ""); + ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); } @@ -2325,54 +2661,66 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileEcho) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileInclude) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *statement_param = NULL, *pathExpr = NULL, *path = NULL, *subCompiler = NULL, *finalPath = NULL, *compilation = NULL, *params = NULL, *_0, *_3 = NULL, *_1$$5, *_2$$6 = NULL; - zval *statement = NULL; + zval *statement_param = NULL, pathExpr, path, subCompiler, finalPath, compilation, params, _0, _3, _1$$5, _2$$6; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&pathExpr); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&subCompiler); + ZVAL_UNDEF(&finalPath); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &statement_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); - ZEPHIR_OBS_VAR(pathExpr); - if (!(zephir_array_isset_string_fetch(&pathExpr, statement, SS("path"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&pathExpr); + if (!(zephir_array_isset_string_fetch(&pathExpr, &statement, SL("path"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/mvc/view/engine/volt/compiler.zep", 1882); return; } - zephir_array_fetch_string(&_0, pathExpr, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1889 TSRMLS_CC); - if (ZEPHIR_IS_LONG(_0, 260)) { - if (!(zephir_array_isset_string(statement, SS("params")))) { - ZEPHIR_OBS_VAR(path); - zephir_array_fetch_string(&path, pathExpr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1899 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&finalPath, this_ptr, "getfinalpath", NULL, 0, path); + zephir_array_fetch_string(&_0, &pathExpr, SL("type"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 1889 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&_0, 260)) { + if (!(zephir_array_isset_string(&statement, SL("params")))) { + ZEPHIR_OBS_VAR(&path); + zephir_array_fetch_string(&path, &pathExpr, SL("value"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1899 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&finalPath, this_ptr, "getfinalpath", NULL, 0, &path); zephir_check_call_status(); - ZEPHIR_INIT_VAR(subCompiler); - if (zephir_clone(subCompiler, this_ptr TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&subCompiler); + if (zephir_clone(&subCompiler, this_ptr TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_BOOL(_1$$5, 0); - ZEPHIR_CALL_METHOD(&compilation, subCompiler, "compile", NULL, 0, finalPath, _1$$5); + ZVAL_BOOL(&_1$$5, 0); + ZEPHIR_CALL_METHOD(&compilation, &subCompiler, "compile", NULL, 0, &finalPath, &_1$$5); zephir_check_call_status(); - if (Z_TYPE_P(compilation) == IS_NULL) { - ZEPHIR_CALL_METHOD(&_2$$6, subCompiler, "getcompiledtemplatepath", NULL, 0); + if (Z_TYPE_P(&compilation) == IS_NULL) { + ZEPHIR_CALL_METHOD(&_2$$6, &subCompiler, "getcompiledtemplatepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(compilation); - zephir_file_get_contents(compilation, _2$$6 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&compilation); + zephir_file_get_contents(&compilation, &_2$$6 TSRMLS_CC); } - RETURN_CCTOR(compilation); + RETURN_CCTOR(&compilation); } } - ZEPHIR_CALL_METHOD(&path, this_ptr, "expression", NULL, 413, pathExpr); + ZEPHIR_CALL_METHOD(&path, this_ptr, "expression", NULL, 367, &pathExpr); zephir_check_call_status(); - ZEPHIR_OBS_VAR(params); - if (!(zephir_array_isset_string_fetch(¶ms, statement, SS("params"), 0 TSRMLS_CC))) { - ZEPHIR_CONCAT_SVS(return_value, "partial(", path, "); ?>"); + ZEPHIR_OBS_VAR(¶ms); + if (!(zephir_array_isset_string_fetch(¶ms, &statement, SL("params"), 0))) { + ZEPHIR_CONCAT_SVS(return_value, "partial(", &path, "); ?>"); RETURN_MM(); } - ZEPHIR_CALL_METHOD(&_3, this_ptr, "expression", NULL, 413, params); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "expression", NULL, 367, ¶ms); zephir_check_call_status(); - ZEPHIR_CONCAT_SVSVS(return_value, "partial(", path, ", ", _3, "); ?>"); + ZEPHIR_CONCAT_SVSVS(return_value, "partial(", &path, ", ", &_3, "); ?>"); RETURN_MM(); } @@ -2382,111 +2730,144 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileInclude) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileMacro) { - HashTable *_6$$6; - HashPosition _5$$6; + zend_string *_7$$6; + zend_ulong _6$$6; zephir_fcall_cache_entry *_13 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *statement_param = NULL, *extendsMode_param = NULL, *code = NULL, *name = NULL, *defaultValue = NULL, *macroName = NULL, *parameters = NULL, *position = NULL, *parameter = NULL, *variableName = NULL, *blockStatements = NULL, *_0, *_19, *_1$$4, *_2$$4, *_3$$5, *_4$$6, **_7$$6, *_8$$7 = NULL, *_9$$7 = NULL, *_10$$7 = NULL, *_11$$7 = NULL, *_12$$8 = NULL, *_14$$8 = NULL, *_15$$9 = NULL, *_16$$10 = NULL, *_17$$10, *_18$$10; - zval *statement = NULL; + zval *statement_param = NULL, *extendsMode_param = NULL, code, name, defaultValue, macroName, parameters, position, parameter, variableName, blockStatements, _0, _19, _1$$4, _2$$4, _3$$5, _4$$6, *_5$$6, _8$$7, _9$$7, _10$$7, _11$$7, _12$$8, _14$$8, _15$$9, _16$$10, _17$$10, _18$$10; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&defaultValue); + ZVAL_UNDEF(¯oName); + ZVAL_UNDEF(¶meters); + ZVAL_UNDEF(&position); + ZVAL_UNDEF(¶meter); + ZVAL_UNDEF(&variableName); + ZVAL_UNDEF(&blockStatements); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_19); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$6); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_10$$7); + ZVAL_UNDEF(&_11$$7); + ZVAL_UNDEF(&_12$$8); + ZVAL_UNDEF(&_14$$8); + ZVAL_UNDEF(&_15$$9); + ZVAL_UNDEF(&_16$$10); + ZVAL_UNDEF(&_17$$10); + ZVAL_UNDEF(&_18$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &statement_param, &extendsMode_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); extendsMode = zephir_get_boolval(extendsMode_param); - ZEPHIR_OBS_VAR(name); - if (!(zephir_array_isset_string_fetch(&name, statement, SS("name"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&name); + if (!(zephir_array_isset_string_fetch(&name, &statement, SL("name"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/mvc/view/engine/volt/compiler.zep", 1949); return; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_macros"), PH_NOISY_CC); - if (zephir_array_isset(_0, name)) { - ZEPHIR_INIT_VAR(_1$$4); - object_init_ex(_1$$4, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_2$$4); - ZEPHIR_CONCAT_SVS(_2$$4, "Macro '", name, "' is already defined"); - ZEPHIR_CALL_METHOD(NULL, _1$$4, "__construct", NULL, 415, _2$$4); + zephir_read_property(&_0, this_ptr, SL("_macros"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset(&_0, &name)) { + ZEPHIR_INIT_VAR(&_1$$4); + object_init_ex(&_1$$4, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_2$$4); + ZEPHIR_CONCAT_SVS(&_2$$4, "Macro '", &name, "' is already defined"); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "__construct", NULL, 369, &_2$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$4, "phalcon/mvc/view/engine/volt/compiler.zep", 1956 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$4, "phalcon/mvc/view/engine/volt/compiler.zep", 1956 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_update_property_array(this_ptr, SL("_macros"), name, name TSRMLS_CC); - ZEPHIR_INIT_VAR(macroName); - ZEPHIR_CONCAT_SVS(macroName, "$this->_macros['", name, "']"); - ZEPHIR_INIT_VAR(code); - ZVAL_STRING(code, ""); - zephir_concat_self(&code, _3$$5 TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_macros"), &name, &name TSRMLS_CC); + ZEPHIR_INIT_VAR(¯oName); + ZEPHIR_CONCAT_SVS(¯oName, "$this->_macros['", &name, "']"); + ZEPHIR_INIT_VAR(&code); + ZVAL_STRING(&code, ""); + zephir_concat_self(&code, &_3$$5 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_4$$6); - ZEPHIR_CONCAT_VS(_4$$6, macroName, " = function($__p = null) { "); - zephir_concat_self(&code, _4$$6 TSRMLS_CC); - zephir_is_iterable(parameters, &_6$$6, &_5$$6, 0, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 1994); - for ( - ; zend_hash_get_current_data_ex(_6$$6, (void**) &_7$$6, &_5$$6) == SUCCESS - ; zend_hash_move_forward_ex(_6$$6, &_5$$6) - ) { - ZEPHIR_GET_HMKEY(position, _6$$6, _5$$6); - ZEPHIR_GET_HVALUE(parameter, _7$$6); - ZEPHIR_OBS_NVAR(variableName); - zephir_array_fetch_string(&variableName, parameter, SL("variable"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1978 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_4$$6); + ZEPHIR_CONCAT_VS(&_4$$6, ¯oName, " = function($__p = null) { "); + zephir_concat_self(&code, &_4$$6 TSRMLS_CC); + zephir_is_iterable(¶meters, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 1994); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(¶meters), _6$$6, _7$$6, _5$$6) + { + ZEPHIR_INIT_NVAR(&position); + if (_7$$6 != NULL) { + ZVAL_STR_COPY(&position, _7$$6); + } else { + ZVAL_LONG(&position, _6$$6); + } + ZEPHIR_INIT_NVAR(¶meter); + ZVAL_COPY(¶meter, _5$$6); + ZEPHIR_OBS_NVAR(&variableName); + zephir_array_fetch_string(&variableName, ¶meter, SL("variable"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 1978 TSRMLS_CC); ZEPHIR_INIT_LNVAR(_8$$7); - ZEPHIR_CONCAT_SVS(_8$$7, "if (isset($__p[", position, "])) { "); - zephir_concat_self(&code, _8$$7 TSRMLS_CC); + ZEPHIR_CONCAT_SVS(&_8$$7, "if (isset($__p[", &position, "])) { "); + zephir_concat_self(&code, &_8$$7 TSRMLS_CC); ZEPHIR_INIT_LNVAR(_9$$7); - ZEPHIR_CONCAT_SVSVS(_9$$7, "$", variableName, " = $__p[", position, "];"); - zephir_concat_self(&code, _9$$7 TSRMLS_CC); + ZEPHIR_CONCAT_SVSVS(&_9$$7, "$", &variableName, " = $__p[", &position, "];"); + zephir_concat_self(&code, &_9$$7 TSRMLS_CC); zephir_concat_self_str(&code, SL(" } else { ") TSRMLS_CC); ZEPHIR_INIT_LNVAR(_10$$7); - ZEPHIR_CONCAT_SVS(_10$$7, "if (isset($__p[\"", variableName, "\"])) { "); - zephir_concat_self(&code, _10$$7 TSRMLS_CC); + ZEPHIR_CONCAT_SVS(&_10$$7, "if (isset($__p[\"", &variableName, "\"])) { "); + zephir_concat_self(&code, &_10$$7 TSRMLS_CC); ZEPHIR_INIT_LNVAR(_11$$7); - ZEPHIR_CONCAT_SVSVS(_11$$7, "$", variableName, " = $__p[\"", variableName, "\"];"); - zephir_concat_self(&code, _11$$7 TSRMLS_CC); + ZEPHIR_CONCAT_SVSVS(&_11$$7, "$", &variableName, " = $__p[\"", &variableName, "\"];"); + zephir_concat_self(&code, &_11$$7 TSRMLS_CC); zephir_concat_self_str(&code, SL(" } else { ") TSRMLS_CC); - ZEPHIR_OBS_NVAR(defaultValue); - if (zephir_array_isset_string_fetch(&defaultValue, parameter, SS("default"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(&_12$$8, this_ptr, "expression", &_13, 413, defaultValue); + ZEPHIR_OBS_NVAR(&defaultValue); + if (zephir_array_isset_string_fetch(&defaultValue, ¶meter, SL("default"), 0)) { + ZEPHIR_CALL_METHOD(&_12$$8, this_ptr, "expression", &_13, 367, &defaultValue); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_14$$8); - ZEPHIR_CONCAT_SVSVS(_14$$8, "$", variableName, " = ", _12$$8, ";"); - zephir_concat_self(&code, _14$$8 TSRMLS_CC); + ZEPHIR_CONCAT_SVSVS(&_14$$8, "$", &variableName, " = ", &_12$$8, ";"); + zephir_concat_self(&code, &_14$$8 TSRMLS_CC); } else { ZEPHIR_INIT_LNVAR(_15$$9); - ZEPHIR_CONCAT_SVSVS(_15$$9, " throw new \\Phalcon\\Mvc\\View\\Exception(\"Macro '", name, "' was called without parameter: ", variableName, "\"); "); - zephir_concat_self(&code, _15$$9 TSRMLS_CC); + ZEPHIR_CONCAT_SVSVS(&_15$$9, " throw new \\Phalcon\\Mvc\\View\\Exception(\"Macro '", &name, "' was called without parameter: ", &variableName, "\"); "); + zephir_concat_self(&code, &_15$$9 TSRMLS_CC); } zephir_concat_self_str(&code, SL(" } } ") TSRMLS_CC); - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(¶meter); + ZEPHIR_INIT_NVAR(&position); zephir_concat_self_str(&code, SL(" ?>") TSRMLS_CC); } - ZEPHIR_OBS_VAR(blockStatements); - if (zephir_array_isset_string_fetch(&blockStatements, statement, SS("block_statements"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_17$$10); + ZEPHIR_OBS_VAR(&blockStatements); + if (zephir_array_isset_string_fetch(&blockStatements, &statement, SL("block_statements"), 0)) { if (extendsMode) { - ZVAL_BOOL(_17$$10, 1); + ZVAL_BOOL(&_17$$10, 1); } else { - ZVAL_BOOL(_17$$10, 0); + ZVAL_BOOL(&_17$$10, 0); } - ZEPHIR_CALL_METHOD(&_16$$10, this_ptr, "_statementlist", NULL, 419, blockStatements, _17$$10); + ZEPHIR_CALL_METHOD(&_16$$10, this_ptr, "_statementlist", NULL, 373, &blockStatements, &_17$$10); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_18$$10); - ZEPHIR_CONCAT_VS(_18$$10, _16$$10, ""); - zephir_concat_self(&code, _19 TSRMLS_CC); - RETURN_CCTOR(code); + ZEPHIR_INIT_VAR(&_19); + ZEPHIR_CONCAT_VSVS(&_19, ¯oName, " = \\Closure::bind(", ¯oName, ", $this); ?>"); + zephir_concat_self(&code, &_19 TSRMLS_CC); + RETURN_CCTOR(&code); } @@ -2501,11 +2882,15 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCall) { zend_bool extendsMode; zval *statement_param = NULL, *extendsMode_param = NULL; - zval *statement = NULL; + zval statement; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); - zephir_fetch_params(0, 2, 0, &statement_param, &extendsMode_param); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 2, 0, &statement_param, &extendsMode_param); - statement = statement_param; + ZEPHIR_OBS_COPY_OR_DUP(&statement, statement_param); extendsMode = zephir_get_boolval(extendsMode_param); @@ -2517,18 +2902,74 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCall) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _statementList) { - HashTable *_2; - HashPosition _1; - zephir_fcall_cache_entry *_8 = NULL, *_11 = NULL, *_15 = NULL, *_17 = NULL, *_20 = NULL, *_22 = NULL, *_27 = NULL, *_29 = NULL, *_31 = NULL, *_34 = NULL, *_36 = NULL, *_39 = NULL, *_42 = NULL, *_44 = NULL, *_46 = NULL, *_49 = NULL, *_51 = NULL, *_54 = NULL, *_57 = NULL; + zephir_fcall_cache_entry *_6 = NULL, *_9 = NULL, *_13 = NULL, *_15 = NULL, *_18 = NULL, *_20 = NULL, *_25 = NULL, *_27 = NULL, *_29 = NULL, *_32 = NULL, *_34 = NULL, *_37 = NULL, *_40 = NULL, *_42 = NULL, *_44 = NULL, *_47 = NULL, *_49 = NULL, *_52 = NULL, *_55 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode, _0; - zval *statements_param = NULL, *extendsMode_param = NULL, *extended = NULL, *blockMode = NULL, *compilation = NULL, *extensions = NULL, *statement = NULL, *tempCompilation = NULL, *type = NULL, *blockName = NULL, *blockStatements = NULL, *blocks = NULL, *path = NULL, *finalPath = NULL, *subCompiler = NULL, *level = NULL, **_3, *_4$$7 = NULL, *_5$$7, *_6$$7, *_7$$7 = NULL, *_10$$8 = NULL, *_12$$10, *_13$$11 = NULL, *_14$$11 = NULL, *_16$$12 = NULL, *_18$$13 = NULL, *_19$$13 = NULL, *_21$$14 = NULL, *_23$$15 = NULL, *_24$$15 = NULL, *_25$$16 = NULL, *_26$$16 = NULL, *_28$$17 = NULL, *_30$$18 = NULL, *_32$$24 = NULL, *_33$$24 = NULL, *_35$$25, *_37$$26 = NULL, *_38$$27 = NULL, *_40$$28 = NULL, *_41$$28 = NULL, *_43$$29 = NULL, *_45$$30 = NULL, *_47$$31 = NULL, *_48$$31 = NULL, *_50$$34 = NULL, *_52$$35 = NULL, *_53$$35 = NULL, *_55$$36 = NULL, *_56$$36 = NULL, *_58$$38 = NULL, *_59$$38, *_60$$38, *_61$$38 = NULL; - zval *statements = NULL, *_9$$8 = NULL; + zval *statements_param = NULL, *extendsMode_param = NULL, __$true, __$false, extended, blockMode, compilation, extensions, statement, tempCompilation, type, blockName, blockStatements, blocks, path, finalPath, subCompiler, level, *_1, _2$$7, _3$$7, _4$$7, _5$$7, _8$$8, _10$$10, _11$$11, _12$$11, _14$$12, _16$$13, _17$$13, _19$$14, _21$$15, _22$$15, _23$$16, _24$$16, _26$$17, _28$$18, _30$$24, _31$$24, _33$$25, _35$$26, _36$$27, _38$$28, _39$$28, _41$$29, _43$$30, _45$$31, _46$$31, _48$$34, _50$$35, _51$$35, _53$$36, _54$$36, _56$$38, _57$$38, _58$$38, _59$$38; + zval statements, _7$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statements); + ZVAL_UNDEF(&_7$$8); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&extended); + ZVAL_UNDEF(&blockMode); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&extensions); + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&tempCompilation); + ZVAL_UNDEF(&type); + ZVAL_UNDEF(&blockName); + ZVAL_UNDEF(&blockStatements); + ZVAL_UNDEF(&blocks); + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&finalPath); + ZVAL_UNDEF(&subCompiler); + ZVAL_UNDEF(&level); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_3$$7); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_10$$10); + ZVAL_UNDEF(&_11$$11); + ZVAL_UNDEF(&_12$$11); + ZVAL_UNDEF(&_14$$12); + ZVAL_UNDEF(&_16$$13); + ZVAL_UNDEF(&_17$$13); + ZVAL_UNDEF(&_19$$14); + ZVAL_UNDEF(&_21$$15); + ZVAL_UNDEF(&_22$$15); + ZVAL_UNDEF(&_23$$16); + ZVAL_UNDEF(&_24$$16); + ZVAL_UNDEF(&_26$$17); + ZVAL_UNDEF(&_28$$18); + ZVAL_UNDEF(&_30$$24); + ZVAL_UNDEF(&_31$$24); + ZVAL_UNDEF(&_33$$25); + ZVAL_UNDEF(&_35$$26); + ZVAL_UNDEF(&_36$$27); + ZVAL_UNDEF(&_38$$28); + ZVAL_UNDEF(&_39$$28); + ZVAL_UNDEF(&_41$$29); + ZVAL_UNDEF(&_43$$30); + ZVAL_UNDEF(&_45$$31); + ZVAL_UNDEF(&_46$$31); + ZVAL_UNDEF(&_48$$34); + ZVAL_UNDEF(&_50$$35); + ZVAL_UNDEF(&_51$$35); + ZVAL_UNDEF(&_53$$36); + ZVAL_UNDEF(&_54$$36); + ZVAL_UNDEF(&_56$$38); + ZVAL_UNDEF(&_57$$38); + ZVAL_UNDEF(&_58$$38); + ZVAL_UNDEF(&_59$$38); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &statements_param, &extendsMode_param); - statements = statements_param; + ZEPHIR_OBS_COPY_OR_DUP(&statements, statements_param); if (!extendsMode_param) { extendsMode = 0; } else { @@ -2536,309 +2977,299 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _statementList) { } - if (!(zephir_fast_count_int(statements TSRMLS_CC))) { - RETURN_MM_STRING("", 1); + if (!(zephir_fast_count_int(&statements TSRMLS_CC))) { + RETURN_MM_STRING(""); } - ZEPHIR_OBS_VAR(extended); - zephir_read_property_this(&extended, this_ptr, SL("_extended"), PH_NOISY_CC); - _0 = zephir_is_true(extended); + ZEPHIR_OBS_VAR(&extended); + zephir_read_property(&extended, this_ptr, SL("_extended"), PH_NOISY_CC); + _0 = zephir_is_true(&extended); if (!(_0)) { _0 = extendsMode; } - ZEPHIR_INIT_VAR(blockMode); - ZVAL_BOOL(blockMode, _0); - if (ZEPHIR_IS_TRUE_IDENTICAL(blockMode)) { + ZEPHIR_INIT_VAR(&blockMode); + ZVAL_BOOL(&blockMode, _0); + if (ZEPHIR_IS_TRUE_IDENTICAL(&blockMode)) { RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_blockLevel") TSRMLS_CC)); } RETURN_ON_FAILURE(zephir_property_incr(this_ptr, SL("_level") TSRMLS_CC)); - ZEPHIR_INIT_VAR(compilation); - ZVAL_NULL(compilation); - ZEPHIR_OBS_VAR(extensions); - zephir_read_property_this(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); - zephir_is_iterable(statements, &_2, &_1, 0, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 2273); - for ( - ; zend_hash_get_current_data_ex(_2, (void**) &_3, &_1) == SUCCESS - ; zend_hash_move_forward_ex(_2, &_1) - ) { - ZEPHIR_GET_HVALUE(statement, _3); - if (Z_TYPE_P(statement) != IS_ARRAY) { + ZEPHIR_INIT_VAR(&compilation); + ZVAL_NULL(&compilation); + ZEPHIR_OBS_VAR(&extensions); + zephir_read_property(&extensions, this_ptr, SL("_extensions"), PH_NOISY_CC); + zephir_is_iterable(&statements, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 2273); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&statements), _1) + { + ZEPHIR_INIT_NVAR(&statement); + ZVAL_COPY(&statement, _1); + if (Z_TYPE_P(&statement) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Corrupted statement", "phalcon/mvc/view/engine/volt/compiler.zep", 2066); return; } - if (!(zephir_array_isset_string(statement, SS("type")))) { - ZEPHIR_INIT_NVAR(_4$$7); - object_init_ex(_4$$7, phalcon_mvc_view_engine_volt_exception_ce); - zephir_array_fetch_string(&_5$$7, statement, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2073 TSRMLS_CC); - zephir_array_fetch_string(&_6$$7, statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2073 TSRMLS_CC); - ZEPHIR_INIT_LNVAR(_7$$7); - ZEPHIR_CONCAT_SVSV(_7$$7, "Invalid statement in ", _5$$7, " on line ", _6$$7); - ZEPHIR_CALL_METHOD(NULL, _4$$7, "__construct", &_8, 415, _7$$7, statement); + if (!(zephir_array_isset_string(&statement, SL("type")))) { + ZEPHIR_INIT_NVAR(&_2$$7); + object_init_ex(&_2$$7, phalcon_mvc_view_engine_volt_exception_ce); + zephir_array_fetch_string(&_3$$7, &statement, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2073 TSRMLS_CC); + zephir_array_fetch_string(&_4$$7, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2073 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_5$$7); + ZEPHIR_CONCAT_SVSV(&_5$$7, "Invalid statement in ", &_3$$7, " on line ", &_4$$7); + ZEPHIR_CALL_METHOD(NULL, &_2$$7, "__construct", &_6, 369, &_5$$7, &statement); zephir_check_call_status(); - zephir_throw_exception_debug(_4$$7, "phalcon/mvc/view/engine/volt/compiler.zep", 2073 TSRMLS_CC); + zephir_throw_exception_debug(&_2$$7, "phalcon/mvc/view/engine/volt/compiler.zep", 2073 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (Z_TYPE_P(extensions) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_9$$8); - zephir_create_array(_9$$8, 1, 0 TSRMLS_CC); - zephir_array_fast_append(_9$$8, statement); - ZEPHIR_INIT_NVAR(_10$$8); - ZVAL_STRING(_10$$8, "compileStatement", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_11, 414, _10$$8, _9$$8); - zephir_check_temp_parameter(_10$$8); + if (Z_TYPE_P(&extensions) == IS_ARRAY) { + ZEPHIR_INIT_NVAR(&_7$$8); + zephir_create_array(&_7$$8, 1, 0 TSRMLS_CC); + zephir_array_fast_append(&_7$$8, &statement); + ZEPHIR_INIT_NVAR(&_8$$8); + ZVAL_STRING(&_8$$8, "compileStatement"); + ZEPHIR_CALL_METHOD(&tempCompilation, this_ptr, "fireextensionevent", &_9, 368, &_8$$8, &_7$$8); zephir_check_call_status(); - if (Z_TYPE_P(tempCompilation) == IS_STRING) { - zephir_concat_self(&compilation, tempCompilation TSRMLS_CC); + if (Z_TYPE_P(&tempCompilation) == IS_STRING) { + zephir_concat_self(&compilation, &tempCompilation TSRMLS_CC); continue; } } - ZEPHIR_OBS_NVAR(type); - zephir_array_fetch_string(&type, statement, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2094 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&type); + zephir_array_fetch_string(&type, &statement, SL("type"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2094 TSRMLS_CC); do { - if (ZEPHIR_IS_LONG(type, 357)) { - zephir_array_fetch_string(&_12$$10, statement, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2102 TSRMLS_CC); - zephir_concat_self(&compilation, _12$$10 TSRMLS_CC); + if (ZEPHIR_IS_LONG(&type, 357)) { + zephir_array_fetch_string(&_10$$10, &statement, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2102 TSRMLS_CC); + zephir_concat_self(&compilation, &_10$$10 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 300)) { - ZEPHIR_INIT_NVAR(_14$$11); + if (ZEPHIR_IS_LONG(&type, 300)) { if (extendsMode) { - ZVAL_BOOL(_14$$11, 1); + ZVAL_BOOL(&_12$$11, 1); } else { - ZVAL_BOOL(_14$$11, 0); + ZVAL_BOOL(&_12$$11, 0); } - ZEPHIR_CALL_METHOD(&_13$$11, this_ptr, "compileif", &_15, 0, statement, _14$$11); + ZEPHIR_CALL_METHOD(&_11$$11, this_ptr, "compileif", &_13, 0, &statement, &_12$$11); zephir_check_call_status(); - zephir_concat_self(&compilation, _13$$11 TSRMLS_CC); + zephir_concat_self(&compilation, &_11$$11 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 302)) { - ZEPHIR_CALL_METHOD(&_16$$12, this_ptr, "compileelseif", &_17, 0, statement); + if (ZEPHIR_IS_LONG(&type, 302)) { + ZEPHIR_CALL_METHOD(&_14$$12, this_ptr, "compileelseif", &_15, 0, &statement); zephir_check_call_status(); - zephir_concat_self(&compilation, _16$$12 TSRMLS_CC); + zephir_concat_self(&compilation, &_14$$12 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 411)) { - ZEPHIR_INIT_NVAR(_19$$13); + if (ZEPHIR_IS_LONG(&type, 411)) { if (extendsMode) { - ZVAL_BOOL(_19$$13, 1); + ZVAL_BOOL(&_17$$13, 1); } else { - ZVAL_BOOL(_19$$13, 0); + ZVAL_BOOL(&_17$$13, 0); } - ZEPHIR_CALL_METHOD(&_18$$13, this_ptr, "compileswitch", &_20, 0, statement, _19$$13); + ZEPHIR_CALL_METHOD(&_16$$13, this_ptr, "compileswitch", &_18, 0, &statement, &_17$$13); zephir_check_call_status(); - zephir_concat_self(&compilation, _18$$13 TSRMLS_CC); + zephir_concat_self(&compilation, &_16$$13 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 412)) { - ZEPHIR_CALL_METHOD(&_21$$14, this_ptr, "compilecase", &_22, 0, statement); + if (ZEPHIR_IS_LONG(&type, 412)) { + ZEPHIR_CALL_METHOD(&_19$$14, this_ptr, "compilecase", &_20, 0, &statement); zephir_check_call_status(); - zephir_concat_self(&compilation, _21$$14 TSRMLS_CC); + zephir_concat_self(&compilation, &_19$$14 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 413)) { - ZEPHIR_INIT_NVAR(_24$$15); - ZVAL_BOOL(_24$$15, 0); - ZEPHIR_CALL_METHOD(&_23$$15, this_ptr, "compilecase", &_22, 0, statement, _24$$15); + if (ZEPHIR_IS_LONG(&type, 413)) { + ZVAL_BOOL(&_22$$15, 0); + ZEPHIR_CALL_METHOD(&_21$$15, this_ptr, "compilecase", &_20, 0, &statement, &_22$$15); zephir_check_call_status(); - zephir_concat_self(&compilation, _23$$15 TSRMLS_CC); + zephir_concat_self(&compilation, &_21$$15 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 304)) { - ZEPHIR_INIT_NVAR(_26$$16); + if (ZEPHIR_IS_LONG(&type, 304)) { if (extendsMode) { - ZVAL_BOOL(_26$$16, 1); + ZVAL_BOOL(&_24$$16, 1); } else { - ZVAL_BOOL(_26$$16, 0); + ZVAL_BOOL(&_24$$16, 0); } - ZEPHIR_CALL_METHOD(&_25$$16, this_ptr, "compileforeach", &_27, 0, statement, _26$$16); + ZEPHIR_CALL_METHOD(&_23$$16, this_ptr, "compileforeach", &_25, 0, &statement, &_24$$16); zephir_check_call_status(); - zephir_concat_self(&compilation, _25$$16 TSRMLS_CC); + zephir_concat_self(&compilation, &_23$$16 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 306)) { - ZEPHIR_CALL_METHOD(&_28$$17, this_ptr, "compileset", &_29, 0, statement); + if (ZEPHIR_IS_LONG(&type, 306)) { + ZEPHIR_CALL_METHOD(&_26$$17, this_ptr, "compileset", &_27, 0, &statement); zephir_check_call_status(); - zephir_concat_self(&compilation, _28$$17 TSRMLS_CC); + zephir_concat_self(&compilation, &_26$$17 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 359)) { - ZEPHIR_CALL_METHOD(&_30$$18, this_ptr, "compileecho", &_31, 0, statement); + if (ZEPHIR_IS_LONG(&type, 359)) { + ZEPHIR_CALL_METHOD(&_28$$18, this_ptr, "compileecho", &_29, 0, &statement); zephir_check_call_status(); - zephir_concat_self(&compilation, _30$$18 TSRMLS_CC); - break; - } - if (ZEPHIR_IS_LONG(type, 307)) { - ZEPHIR_OBS_NVAR(blockName); - zephir_array_fetch_string(&blockName, statement, SL("name"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2142 TSRMLS_CC); - ZEPHIR_OBS_NVAR(blockStatements); - zephir_array_isset_string_fetch(&blockStatements, statement, SS("block_statements"), 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(blocks); - zephir_read_property_this(&blocks, this_ptr, SL("_blocks"), PH_NOISY_CC); - if (zephir_is_true(blockMode)) { - if (Z_TYPE_P(blocks) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(blocks); - array_init(blocks); + zephir_concat_self(&compilation, &_28$$18 TSRMLS_CC); + break; + } + if (ZEPHIR_IS_LONG(&type, 307)) { + ZEPHIR_OBS_NVAR(&blockName); + zephir_array_fetch_string(&blockName, &statement, SL("name"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2142 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&blockStatements); + zephir_array_isset_string_fetch(&blockStatements, &statement, SL("block_statements"), 0); + ZEPHIR_OBS_NVAR(&blocks); + zephir_read_property(&blocks, this_ptr, SL("_blocks"), PH_NOISY_CC); + if (zephir_is_true(&blockMode)) { + if (Z_TYPE_P(&blocks) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&blocks); + array_init(&blocks); } - if (Z_TYPE_P(compilation) != IS_NULL) { - zephir_array_append(&blocks, compilation, PH_SEPARATE, "phalcon/mvc/view/engine/volt/compiler.zep", 2157); - ZEPHIR_INIT_NVAR(compilation); - ZVAL_NULL(compilation); + if (Z_TYPE_P(&compilation) != IS_NULL) { + zephir_array_append(&blocks, &compilation, PH_SEPARATE, "phalcon/mvc/view/engine/volt/compiler.zep", 2157); + ZEPHIR_INIT_NVAR(&compilation); + ZVAL_NULL(&compilation); } - zephir_array_update_zval(&blocks, blockName, &blockStatements, PH_COPY | PH_SEPARATE); - zephir_update_property_this(getThis(), SL("_blocks"), blocks TSRMLS_CC); + zephir_array_update_zval(&blocks, &blockName, &blockStatements, PH_COPY | PH_SEPARATE); + zephir_update_property_zval(this_ptr, SL("_blocks"), &blocks); } else { - if (Z_TYPE_P(blockStatements) == IS_ARRAY) { - ZEPHIR_INIT_NVAR(_33$$24); + if (Z_TYPE_P(&blockStatements) == IS_ARRAY) { if (extendsMode) { - ZVAL_BOOL(_33$$24, 1); + ZVAL_BOOL(&_31$$24, 1); } else { - ZVAL_BOOL(_33$$24, 0); + ZVAL_BOOL(&_31$$24, 0); } - ZEPHIR_CALL_METHOD(&_32$$24, this_ptr, "_statementlist", &_34, 419, blockStatements, _33$$24); + ZEPHIR_CALL_METHOD(&_30$$24, this_ptr, "_statementlist", &_32, 373, &blockStatements, &_31$$24); zephir_check_call_status(); - zephir_concat_self(&compilation, _32$$24 TSRMLS_CC); + zephir_concat_self(&compilation, &_30$$24 TSRMLS_CC); } } break; } - if (ZEPHIR_IS_LONG(type, 310)) { - ZEPHIR_OBS_NVAR(path); - zephir_array_fetch_string(&path, statement, SL("path"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2179 TSRMLS_CC); - zephir_array_fetch_string(&_35$$25, path, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2181 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&finalPath, this_ptr, "getfinalpath", &_36, 0, _35$$25); + if (ZEPHIR_IS_LONG(&type, 310)) { + ZEPHIR_OBS_NVAR(&path); + zephir_array_fetch_string(&path, &statement, SL("path"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2179 TSRMLS_CC); + zephir_array_fetch_string(&_33$$25, &path, SL("value"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2181 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&finalPath, this_ptr, "getfinalpath", &_34, 0, &_33$$25); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(extended); - ZVAL_BOOL(extended, 1); - ZEPHIR_INIT_NVAR(subCompiler); - if (zephir_clone(subCompiler, this_ptr TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_NVAR(&extended); + ZVAL_BOOL(&extended, 1); + ZEPHIR_INIT_NVAR(&subCompiler); + if (zephir_clone(&subCompiler, this_ptr TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_CALL_METHOD(&tempCompilation, subCompiler, "compile", NULL, 0, finalPath, extended); + ZEPHIR_CALL_METHOD(&tempCompilation, &subCompiler, "compile", NULL, 0, &finalPath, &extended); zephir_check_call_status(); - if (Z_TYPE_P(tempCompilation) == IS_NULL) { - ZEPHIR_CALL_METHOD(&_37$$26, subCompiler, "getcompiledtemplatepath", NULL, 0); + if (Z_TYPE_P(&tempCompilation) == IS_NULL) { + ZEPHIR_CALL_METHOD(&_35$$26, &subCompiler, "getcompiledtemplatepath", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(tempCompilation); - zephir_file_get_contents(tempCompilation, _37$$26 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&tempCompilation); + zephir_file_get_contents(&tempCompilation, &_35$$26 TSRMLS_CC); } if (1) { - zephir_update_property_this(getThis(), SL("_extended"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_extended"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_extended"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_extended"), &__$false); } - zephir_update_property_this(getThis(), SL("_extendedBlocks"), tempCompilation TSRMLS_CC); - ZEPHIR_CPY_WRT(blockMode, extended); + zephir_update_property_zval(this_ptr, SL("_extendedBlocks"), &tempCompilation); + ZEPHIR_CPY_WRT(&blockMode, &extended); break; } - if (ZEPHIR_IS_LONG(type, 313)) { - ZEPHIR_CALL_METHOD(&_38$$27, this_ptr, "compileinclude", &_39, 0, statement); + if (ZEPHIR_IS_LONG(&type, 313)) { + ZEPHIR_CALL_METHOD(&_36$$27, this_ptr, "compileinclude", &_37, 0, &statement); zephir_check_call_status(); - zephir_concat_self(&compilation, _38$$27 TSRMLS_CC); + zephir_concat_self(&compilation, &_36$$27 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 314)) { - ZEPHIR_INIT_NVAR(_41$$28); + if (ZEPHIR_IS_LONG(&type, 314)) { if (extendsMode) { - ZVAL_BOOL(_41$$28, 1); + ZVAL_BOOL(&_39$$28, 1); } else { - ZVAL_BOOL(_41$$28, 0); + ZVAL_BOOL(&_39$$28, 0); } - ZEPHIR_CALL_METHOD(&_40$$28, this_ptr, "compilecache", &_42, 0, statement, _41$$28); + ZEPHIR_CALL_METHOD(&_38$$28, this_ptr, "compilecache", &_40, 0, &statement, &_39$$28); zephir_check_call_status(); - zephir_concat_self(&compilation, _40$$28 TSRMLS_CC); + zephir_concat_self(&compilation, &_38$$28 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 316)) { - ZEPHIR_CALL_METHOD(&_43$$29, this_ptr, "compiledo", &_44, 0, statement); + if (ZEPHIR_IS_LONG(&type, 316)) { + ZEPHIR_CALL_METHOD(&_41$$29, this_ptr, "compiledo", &_42, 0, &statement); zephir_check_call_status(); - zephir_concat_self(&compilation, _43$$29 TSRMLS_CC); + zephir_concat_self(&compilation, &_41$$29 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 327)) { - ZEPHIR_CALL_METHOD(&_45$$30, this_ptr, "compilereturn", &_46, 0, statement); + if (ZEPHIR_IS_LONG(&type, 327)) { + ZEPHIR_CALL_METHOD(&_43$$30, this_ptr, "compilereturn", &_44, 0, &statement); zephir_check_call_status(); - zephir_concat_self(&compilation, _45$$30 TSRMLS_CC); + zephir_concat_self(&compilation, &_43$$30 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 317)) { - ZEPHIR_INIT_NVAR(_48$$31); + if (ZEPHIR_IS_LONG(&type, 317)) { if (extendsMode) { - ZVAL_BOOL(_48$$31, 1); + ZVAL_BOOL(&_46$$31, 1); } else { - ZVAL_BOOL(_48$$31, 0); + ZVAL_BOOL(&_46$$31, 0); } - ZEPHIR_CALL_METHOD(&_47$$31, this_ptr, "compileautoescape", &_49, 0, statement, _48$$31); + ZEPHIR_CALL_METHOD(&_45$$31, this_ptr, "compileautoescape", &_47, 0, &statement, &_46$$31); zephir_check_call_status(); - zephir_concat_self(&compilation, _47$$31 TSRMLS_CC); + zephir_concat_self(&compilation, &_45$$31 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 319)) { + if (ZEPHIR_IS_LONG(&type, 319)) { zephir_concat_self_str(&compilation, SL("") TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 320)) { + if (ZEPHIR_IS_LONG(&type, 320)) { zephir_concat_self_str(&compilation, SL("") TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 321)) { - ZEPHIR_CALL_METHOD(&_50$$34, this_ptr, "compileforelse", &_51, 0); + if (ZEPHIR_IS_LONG(&type, 321)) { + ZEPHIR_CALL_METHOD(&_48$$34, this_ptr, "compileforelse", &_49, 0); zephir_check_call_status(); - zephir_concat_self(&compilation, _50$$34 TSRMLS_CC); + zephir_concat_self(&compilation, &_48$$34 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 322)) { - ZEPHIR_INIT_NVAR(_53$$35); + if (ZEPHIR_IS_LONG(&type, 322)) { if (extendsMode) { - ZVAL_BOOL(_53$$35, 1); + ZVAL_BOOL(&_51$$35, 1); } else { - ZVAL_BOOL(_53$$35, 0); + ZVAL_BOOL(&_51$$35, 0); } - ZEPHIR_CALL_METHOD(&_52$$35, this_ptr, "compilemacro", &_54, 0, statement, _53$$35); + ZEPHIR_CALL_METHOD(&_50$$35, this_ptr, "compilemacro", &_52, 0, &statement, &_51$$35); zephir_check_call_status(); - zephir_concat_self(&compilation, _52$$35 TSRMLS_CC); + zephir_concat_self(&compilation, &_50$$35 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 325)) { - ZEPHIR_INIT_NVAR(_56$$36); + if (ZEPHIR_IS_LONG(&type, 325)) { if (extendsMode) { - ZVAL_BOOL(_56$$36, 1); + ZVAL_BOOL(&_54$$36, 1); } else { - ZVAL_BOOL(_56$$36, 0); + ZVAL_BOOL(&_54$$36, 0); } - ZEPHIR_CALL_METHOD(&_55$$36, this_ptr, "compilecall", &_57, 0, statement, _56$$36); + ZEPHIR_CALL_METHOD(&_53$$36, this_ptr, "compilecall", &_55, 0, &statement, &_54$$36); zephir_check_call_status(); - zephir_concat_self(&compilation, _55$$36 TSRMLS_CC); + zephir_concat_self(&compilation, &_53$$36 TSRMLS_CC); break; } - if (ZEPHIR_IS_LONG(type, 358)) { + if (ZEPHIR_IS_LONG(&type, 358)) { break; } - ZEPHIR_INIT_NVAR(_58$$38); - object_init_ex(_58$$38, phalcon_mvc_view_engine_volt_exception_ce); - zephir_array_fetch_string(&_59$$38, statement, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2265 TSRMLS_CC); - zephir_array_fetch_string(&_60$$38, statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2265 TSRMLS_CC); - ZEPHIR_INIT_LNVAR(_61$$38); - ZEPHIR_CONCAT_SVSVSV(_61$$38, "Unknown statement ", type, " in ", _59$$38, " on line ", _60$$38); - ZEPHIR_CALL_METHOD(NULL, _58$$38, "__construct", &_8, 415, _61$$38); + ZEPHIR_INIT_NVAR(&_56$$38); + object_init_ex(&_56$$38, phalcon_mvc_view_engine_volt_exception_ce); + zephir_array_fetch_string(&_57$$38, &statement, SL("file"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2265 TSRMLS_CC); + zephir_array_fetch_string(&_58$$38, &statement, SL("line"), PH_NOISY | PH_READONLY, "phalcon/mvc/view/engine/volt/compiler.zep", 2265 TSRMLS_CC); + ZEPHIR_INIT_LNVAR(_59$$38); + ZEPHIR_CONCAT_SVSVSV(&_59$$38, "Unknown statement ", &type, " in ", &_57$$38, " on line ", &_58$$38); + ZEPHIR_CALL_METHOD(NULL, &_56$$38, "__construct", &_6, 369, &_59$$38); zephir_check_call_status(); - zephir_throw_exception_debug(_58$$38, "phalcon/mvc/view/engine/volt/compiler.zep", 2265 TSRMLS_CC); + zephir_throw_exception_debug(&_56$$38, "phalcon/mvc/view/engine/volt/compiler.zep", 2265 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } while(0); - } - if (ZEPHIR_IS_TRUE_IDENTICAL(blockMode)) { - level = zephir_fetch_nproperty_this(this_ptr, SL("_blockLevel"), PH_NOISY_CC); - if (ZEPHIR_IS_LONG(level, 1)) { - if (Z_TYPE_P(compilation) != IS_NULL) { - zephir_update_property_array_append(this_ptr, SL("_blocks"), compilation TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&statement); + if (ZEPHIR_IS_TRUE_IDENTICAL(&blockMode)) { + zephir_read_property(&level, this_ptr, SL("_blockLevel"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_LONG(&level, 1)) { + if (Z_TYPE_P(&compilation) != IS_NULL) { + zephir_update_property_array_append(this_ptr, SL("_blocks"), &compilation TSRMLS_CC); } } RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_blockLevel") TSRMLS_CC)); } RETURN_ON_FAILURE(zephir_property_decr(this_ptr, SL("_level") TSRMLS_CC)); - RETURN_CCTOR(compilation); + RETURN_CCTOR(&compilation); } @@ -2847,25 +3278,42 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _statementList) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _compileSource) { - HashTable *_2$$7; - HashPosition _1$$7; + zend_string *_3$$7; + zend_ulong _2$$7; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *viewCode_param = NULL, *extendsMode_param = NULL, *currentPath = NULL, *intermediate = NULL, *extended = NULL, *finalCompilation = NULL, *blocks = NULL, *extendedBlocks = NULL, *name = NULL, *block = NULL, *blockCompilation = NULL, *localBlock = NULL, *compilation = NULL, *options = NULL, *autoescape = NULL, *_0, **_3$$7; - zval *viewCode = NULL; + zval *viewCode_param = NULL, *extendsMode_param = NULL, currentPath, intermediate, extended, finalCompilation, blocks, extendedBlocks, name, block, blockCompilation, localBlock, compilation, options, autoescape, _0, *_1$$7; + zval viewCode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewCode); + ZVAL_UNDEF(¤tPath); + ZVAL_UNDEF(&intermediate); + ZVAL_UNDEF(&extended); + ZVAL_UNDEF(&finalCompilation); + ZVAL_UNDEF(&blocks); + ZVAL_UNDEF(&extendedBlocks); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&block); + ZVAL_UNDEF(&blockCompilation); + ZVAL_UNDEF(&localBlock); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&autoescape); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &viewCode_param, &extendsMode_param); if (UNEXPECTED(Z_TYPE_P(viewCode_param) != IS_STRING && Z_TYPE_P(viewCode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewCode' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewCode' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewCode_param) == IS_STRING)) { - zephir_get_strval(viewCode, viewCode_param); + zephir_get_strval(&viewCode, viewCode_param); } else { - ZEPHIR_INIT_VAR(viewCode); - ZVAL_EMPTY_STRING(viewCode); + ZEPHIR_INIT_VAR(&viewCode); + ZVAL_EMPTY_STRING(&viewCode); } if (!extendsMode_param) { extendsMode = 0; @@ -2874,89 +3322,94 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, _compileSource) { } - ZEPHIR_OBS_VAR(currentPath); - zephir_read_property_this(¤tPath, this_ptr, SL("_currentPath"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - ZEPHIR_OBS_VAR(autoescape); - if (zephir_array_isset_string_fetch(&autoescape, options, SS("autoescape"), 0 TSRMLS_CC)) { - if (Z_TYPE_P(autoescape) != IS_BOOL) { + ZEPHIR_OBS_VAR(¤tPath); + zephir_read_property(¤tPath, this_ptr, SL("_currentPath"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + if (Z_TYPE_P(&options) == IS_ARRAY) { + ZEPHIR_OBS_VAR(&autoescape); + if (zephir_array_isset_string_fetch(&autoescape, &options, SL("autoescape"), 0)) { + if (((Z_TYPE_P(&autoescape) == IS_TRUE || Z_TYPE_P(&autoescape) == IS_FALSE) != 1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'autoescape' must be boolean", "phalcon/mvc/view/engine/volt/compiler.zep", 2310); return; } - zephir_update_property_this(getThis(), SL("_autoescape"), autoescape TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_autoescape"), &autoescape); } } - ZEPHIR_INIT_VAR(intermediate); - ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(intermediate, viewCode, currentPath TSRMLS_CC); + ZEPHIR_INIT_VAR(&intermediate); + ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(&intermediate, &viewCode, ¤tPath TSRMLS_CC); zephir_check_call_status(); - if (Z_TYPE_P(intermediate) != IS_ARRAY) { + if (Z_TYPE_P(&intermediate) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Invalid intermediate representation", "phalcon/mvc/view/engine/volt/compiler.zep", 2322); return; } - ZEPHIR_INIT_VAR(_0); if (extendsMode) { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } else { - ZVAL_BOOL(_0, 0); + ZVAL_BOOL(&_0, 0); } - ZEPHIR_CALL_METHOD(&compilation, this_ptr, "_statementlist", NULL, 419, intermediate, _0); + ZEPHIR_CALL_METHOD(&compilation, this_ptr, "_statementlist", NULL, 373, &intermediate, &_0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(extended); - zephir_read_property_this(&extended, this_ptr, SL("_extended"), PH_NOISY_CC); - if (ZEPHIR_IS_TRUE_IDENTICAL(extended)) { - ZEPHIR_INIT_VAR(finalCompilation); + ZEPHIR_OBS_VAR(&extended); + zephir_read_property(&extended, this_ptr, SL("_extended"), PH_NOISY_CC); + if (ZEPHIR_IS_TRUE_IDENTICAL(&extended)) { + ZEPHIR_INIT_VAR(&finalCompilation); if (extendsMode == 1) { - array_init(finalCompilation); + array_init(&finalCompilation); } else { - ZVAL_NULL(finalCompilation); - } - ZEPHIR_OBS_VAR(blocks); - zephir_read_property_this(&blocks, this_ptr, SL("_blocks"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(extendedBlocks); - zephir_read_property_this(&extendedBlocks, this_ptr, SL("_extendedBlocks"), PH_NOISY_CC); - zephir_is_iterable(extendedBlocks, &_2$$7, &_1$$7, 0, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 2388); - for ( - ; zend_hash_get_current_data_ex(_2$$7, (void**) &_3$$7, &_1$$7) == SUCCESS - ; zend_hash_move_forward_ex(_2$$7, &_1$$7) - ) { - ZEPHIR_GET_HMKEY(name, _2$$7, _1$$7); - ZEPHIR_GET_HVALUE(block, _3$$7); - if (Z_TYPE_P(name) == IS_STRING) { - if (zephir_array_isset(blocks, name)) { - ZEPHIR_OBS_NVAR(localBlock); - zephir_array_fetch(&localBlock, blocks, name, PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2356 TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_currentBlock"), name TSRMLS_CC); - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "_statementlist", NULL, 419, localBlock); + ZVAL_NULL(&finalCompilation); + } + ZEPHIR_OBS_VAR(&blocks); + zephir_read_property(&blocks, this_ptr, SL("_blocks"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&extendedBlocks); + zephir_read_property(&extendedBlocks, this_ptr, SL("_extendedBlocks"), PH_NOISY_CC); + zephir_is_iterable(&extendedBlocks, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 2388); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&extendedBlocks), _2$$7, _3$$7, _1$$7) + { + ZEPHIR_INIT_NVAR(&name); + if (_3$$7 != NULL) { + ZVAL_STR_COPY(&name, _3$$7); + } else { + ZVAL_LONG(&name, _2$$7); + } + ZEPHIR_INIT_NVAR(&block); + ZVAL_COPY(&block, _1$$7); + if (Z_TYPE_P(&name) == IS_STRING) { + if (zephir_array_isset(&blocks, &name)) { + ZEPHIR_OBS_NVAR(&localBlock); + zephir_array_fetch(&localBlock, &blocks, &name, PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2356 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_currentBlock"), &name); + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "_statementlist", NULL, 373, &localBlock); zephir_check_call_status(); } else { - if (Z_TYPE_P(block) == IS_ARRAY) { - ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "_statementlist", NULL, 419, block); + if (Z_TYPE_P(&block) == IS_ARRAY) { + ZEPHIR_CALL_METHOD(&blockCompilation, this_ptr, "_statementlist", NULL, 373, &block); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(blockCompilation, block); + ZEPHIR_CPY_WRT(&blockCompilation, &block); } } if (extendsMode == 1) { - zephir_array_update_zval(&finalCompilation, name, &blockCompilation, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(&finalCompilation, &name, &blockCompilation, PH_COPY | PH_SEPARATE); } else { - zephir_concat_self(&finalCompilation, blockCompilation TSRMLS_CC); + zephir_concat_self(&finalCompilation, &blockCompilation TSRMLS_CC); } } else { if (extendsMode == 1) { - zephir_array_append(&finalCompilation, block, PH_SEPARATE, "phalcon/mvc/view/engine/volt/compiler.zep", 2381); + zephir_array_append(&finalCompilation, &block, PH_SEPARATE, "phalcon/mvc/view/engine/volt/compiler.zep", 2381); } else { - zephir_concat_self(&finalCompilation, block TSRMLS_CC); + zephir_concat_self(&finalCompilation, &block TSRMLS_CC); } } - } - RETURN_CCTOR(finalCompilation); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&block); + ZEPHIR_INIT_NVAR(&name); + RETURN_CCTOR(&finalCompilation); } if (extendsMode == 1) { RETURN_MM_MEMBER(getThis(), "_blocks"); } - RETURN_CCTOR(compilation); + RETURN_CCTOR(&compilation); } @@ -2971,21 +3424,26 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileString) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *viewCode_param = NULL, *extendsMode_param = NULL, *_0, *_1; - zval *viewCode = NULL; + zval *viewCode_param = NULL, *extendsMode_param = NULL, _0, _1; + zval viewCode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewCode); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &viewCode_param, &extendsMode_param); if (UNEXPECTED(Z_TYPE_P(viewCode_param) != IS_STRING && Z_TYPE_P(viewCode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewCode' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewCode' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewCode_param) == IS_STRING)) { - zephir_get_strval(viewCode, viewCode_param); + zephir_get_strval(&viewCode, viewCode_param); } else { - ZEPHIR_INIT_VAR(viewCode); - ZVAL_EMPTY_STRING(viewCode); + ZEPHIR_INIT_VAR(&viewCode); + ZVAL_EMPTY_STRING(&viewCode); } if (!extendsMode_param) { extendsMode = 0; @@ -2994,16 +3452,16 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileString) { } - ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_STRING(_0, "eval code", 1); - zephir_update_property_this(getThis(), SL("_currentPath"), _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "eval code"); + zephir_update_property_zval(this_ptr, SL("_currentPath"), &_0); if (extendsMode) { - ZVAL_BOOL(_1, 1); + ZVAL_BOOL(&_1, 1); } else { - ZVAL_BOOL(_1, 0); + ZVAL_BOOL(&_1, 0); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_compilesource", NULL, 0, viewCode, _1); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "_compilesource", NULL, 0, &viewCode, &_1); zephir_check_call_status(); RETURN_MM(); @@ -3025,31 +3483,44 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileFile) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *path_param = NULL, *compiledPath_param = NULL, *extendsMode_param = NULL, *viewCode = NULL, *compilation = NULL, *finalCompilation = NULL, *_4, *_5, *_0$$4, *_2$$5; - zval *path = NULL, *compiledPath = NULL, *_1$$4, *_3$$5; + zval *path_param = NULL, *compiledPath_param = NULL, *extendsMode_param = NULL, viewCode, compilation, finalCompilation, _4, _5, _0$$4, _2$$5; + zval path, compiledPath, _1$$4, _3$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&compiledPath); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&viewCode); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&finalCompilation); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_2$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &path_param, &compiledPath_param, &extendsMode_param); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } if (UNEXPECTED(Z_TYPE_P(compiledPath_param) != IS_STRING && Z_TYPE_P(compiledPath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'compiledPath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'compiledPath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(compiledPath_param) == IS_STRING)) { - zephir_get_strval(compiledPath, compiledPath_param); + zephir_get_strval(&compiledPath, compiledPath_param); } else { - ZEPHIR_INIT_VAR(compiledPath); - ZVAL_EMPTY_STRING(compiledPath); + ZEPHIR_INIT_VAR(&compiledPath); + ZVAL_EMPTY_STRING(&compiledPath); } if (!extendsMode_param) { extendsMode = 0; @@ -3058,56 +3529,55 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileFile) { } - if (ZEPHIR_IS_EQUAL(path, compiledPath)) { + if (ZEPHIR_IS_EQUAL(&path, &compiledPath)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Template path and compilation template path cannot be the same", "phalcon/mvc/view/engine/volt/compiler.zep", 2430); return; } - if (!((zephir_file_exists(path TSRMLS_CC) == SUCCESS))) { - ZEPHIR_INIT_VAR(_0$$4); - object_init_ex(_0$$4, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_1$$4); - ZEPHIR_CONCAT_SVS(_1$$4, "Template file ", path, " does not exist"); - ZEPHIR_CALL_METHOD(NULL, _0$$4, "__construct", NULL, 415, _1$$4); + if (!((zephir_file_exists(&path TSRMLS_CC) == SUCCESS))) { + ZEPHIR_INIT_VAR(&_0$$4); + object_init_ex(&_0$$4, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_1$$4); + ZEPHIR_CONCAT_SVS(&_1$$4, "Template file ", &path, " does not exist"); + ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 369, &_1$$4); zephir_check_call_status(); - zephir_throw_exception_debug(_0$$4, "phalcon/mvc/view/engine/volt/compiler.zep", 2437 TSRMLS_CC); + zephir_throw_exception_debug(&_0$$4, "phalcon/mvc/view/engine/volt/compiler.zep", 2437 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - ZEPHIR_INIT_VAR(viewCode); - zephir_file_get_contents(viewCode, path TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(viewCode)) { - ZEPHIR_INIT_VAR(_2$$5); - object_init_ex(_2$$5, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_3$$5); - ZEPHIR_CONCAT_SVS(_3$$5, "Template file ", path, " could not be opened"); - ZEPHIR_CALL_METHOD(NULL, _2$$5, "__construct", NULL, 415, _3$$5); + ZEPHIR_INIT_VAR(&viewCode); + zephir_file_get_contents(&viewCode, &path TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&viewCode)) { + ZEPHIR_INIT_VAR(&_2$$5); + object_init_ex(&_2$$5, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_3$$5); + ZEPHIR_CONCAT_SVS(&_3$$5, "Template file ", &path, " could not be opened"); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 369, &_3$$5); zephir_check_call_status(); - zephir_throw_exception_debug(_2$$5, "phalcon/mvc/view/engine/volt/compiler.zep", 2445 TSRMLS_CC); + zephir_throw_exception_debug(&_2$$5, "phalcon/mvc/view/engine/volt/compiler.zep", 2445 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - zephir_update_property_this(getThis(), SL("_currentPath"), path TSRMLS_CC); - ZEPHIR_INIT_VAR(_4); + zephir_update_property_zval(this_ptr, SL("_currentPath"), &path); if (extendsMode) { - ZVAL_BOOL(_4, 1); + ZVAL_BOOL(&_4, 1); } else { - ZVAL_BOOL(_4, 0); + ZVAL_BOOL(&_4, 0); } - ZEPHIR_CALL_METHOD(&compilation, this_ptr, "_compilesource", NULL, 0, viewCode, _4); + ZEPHIR_CALL_METHOD(&compilation, this_ptr, "_compilesource", NULL, 0, &viewCode, &_4); zephir_check_call_status(); - if (Z_TYPE_P(compilation) == IS_ARRAY) { - ZEPHIR_CALL_FUNCTION(&finalCompilation, "serialize", NULL, 68, compilation); + if (Z_TYPE_P(&compilation) == IS_ARRAY) { + ZEPHIR_CALL_FUNCTION(&finalCompilation, "serialize", NULL, 61, &compilation); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(finalCompilation, compilation); + ZEPHIR_CPY_WRT(&finalCompilation, &compilation); } - ZEPHIR_INIT_VAR(_5); - zephir_file_put_contents(_5, compiledPath, finalCompilation TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_5)) { + ZEPHIR_INIT_VAR(&_5); + zephir_file_put_contents(&_5, &compiledPath, &finalCompilation TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_5)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "Volt directory can't be written", "phalcon/mvc/view/engine/volt/compiler.zep", 2465); return; } - RETURN_CCTOR(compilation); + RETURN_CCTOR(&compilation); } @@ -3123,24 +3593,53 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compileFile) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compile) { - zval *_2$$23; + zval _2$$23; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool extendsMode; - zval *templatePath_param = NULL, *extendsMode_param = NULL, *stat = NULL, *compileAlways = NULL, *prefix = NULL, *compiledPath = NULL, *compiledSeparator = NULL, *blocksCode = NULL, *compiledExtension = NULL, *compilation = NULL, *options = NULL, *realCompiledPath = NULL, *compiledTemplatePath = NULL, *templateSepPath = NULL, *_0, *_1$$17 = NULL, *_3$$23, *_4$$26, *_5$$29, *_6$$30, *_7$$33, *_8$$33, *_9$$36, *_10$$38; - zval *templatePath = NULL; + zval *templatePath_param = NULL, *extendsMode_param = NULL, __$true, __$false, __$null, stat, compileAlways, prefix, compiledPath, compiledSeparator, blocksCode, compiledExtension, compilation, options, realCompiledPath, compiledTemplatePath, templateSepPath, _0, _1$$17, _3$$23, _4$$26, _5$$29, _6$$30, _7$$33, _8$$33, _9$$36, _10$$38; + zval templatePath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&templatePath); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&stat); + ZVAL_UNDEF(&compileAlways); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&compiledPath); + ZVAL_UNDEF(&compiledSeparator); + ZVAL_UNDEF(&blocksCode); + ZVAL_UNDEF(&compiledExtension); + ZVAL_UNDEF(&compilation); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&realCompiledPath); + ZVAL_UNDEF(&compiledTemplatePath); + ZVAL_UNDEF(&templateSepPath); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$17); + ZVAL_UNDEF(&_3$$23); + ZVAL_UNDEF(&_4$$26); + ZVAL_UNDEF(&_5$$29); + ZVAL_UNDEF(&_6$$30); + ZVAL_UNDEF(&_7$$33); + ZVAL_UNDEF(&_8$$33); + ZVAL_UNDEF(&_9$$36); + ZVAL_UNDEF(&_10$$38); + ZVAL_UNDEF(&_2$$23); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &templatePath_param, &extendsMode_param); if (UNEXPECTED(Z_TYPE_P(templatePath_param) != IS_STRING && Z_TYPE_P(templatePath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'templatePath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'templatePath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(templatePath_param) == IS_STRING)) { - zephir_get_strval(templatePath, templatePath_param); + zephir_get_strval(&templatePath, templatePath_param); } else { - ZEPHIR_INIT_VAR(templatePath); - ZVAL_EMPTY_STRING(templatePath); + ZEPHIR_INIT_VAR(&templatePath); + ZVAL_EMPTY_STRING(&templatePath); } if (!extendsMode_param) { extendsMode = 0; @@ -3150,121 +3649,121 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compile) { if (0) { - zephir_update_property_this(getThis(), SL("_extended"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_extended"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_extended"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_extended"), &__$false); } if (0) { - zephir_update_property_this(getThis(), SL("_extendedBlocks"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_extendedBlocks"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_extendedBlocks"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_extendedBlocks"), &__$false); } - zephir_update_property_this(getThis(), SL("_blocks"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_blocks"), &__$null); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_level"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_level"), &_0); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_foreachLevel"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_foreachLevel"), &_0); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_blockLevel"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_blockLevel"), &_0); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, 0); - zephir_update_property_this(getThis(), SL("_exprLevel"), _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(stat); - ZVAL_BOOL(stat, 1); - ZEPHIR_INIT_VAR(compileAlways); - ZVAL_BOOL(compileAlways, 0); - ZEPHIR_INIT_VAR(compiledPath); - ZVAL_STRING(compiledPath, "", 1); - ZEPHIR_INIT_VAR(prefix); - ZVAL_NULL(prefix); - ZEPHIR_INIT_VAR(compiledSeparator); - ZVAL_STRING(compiledSeparator, "%%", 1); - ZEPHIR_INIT_VAR(compiledExtension); - ZVAL_STRING(compiledExtension, ".php", 1); - ZEPHIR_INIT_VAR(compilation); - ZVAL_NULL(compilation); - ZEPHIR_OBS_VAR(options); - zephir_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC); - if (Z_TYPE_P(options) == IS_ARRAY) { - if (zephir_array_isset_string(options, SS("compileAlways"))) { - ZEPHIR_OBS_NVAR(compileAlways); - zephir_array_fetch_string(&compileAlways, options, SL("compileAlways"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2513 TSRMLS_CC); - if (Z_TYPE_P(compileAlways) != IS_BOOL) { + ZVAL_LONG(&_0, 0); + zephir_update_property_zval(this_ptr, SL("_exprLevel"), &_0); + ZEPHIR_INIT_VAR(&stat); + ZVAL_BOOL(&stat, 1); + ZEPHIR_INIT_VAR(&compileAlways); + ZVAL_BOOL(&compileAlways, 0); + ZEPHIR_INIT_VAR(&compiledPath); + ZVAL_STRING(&compiledPath, ""); + ZEPHIR_INIT_VAR(&prefix); + ZVAL_NULL(&prefix); + ZEPHIR_INIT_VAR(&compiledSeparator); + ZVAL_STRING(&compiledSeparator, "%%"); + ZEPHIR_INIT_VAR(&compiledExtension); + ZVAL_STRING(&compiledExtension, ".php"); + ZEPHIR_INIT_VAR(&compilation); + ZVAL_NULL(&compilation); + ZEPHIR_OBS_VAR(&options); + zephir_read_property(&options, this_ptr, SL("_options"), PH_NOISY_CC); + if (Z_TYPE_P(&options) == IS_ARRAY) { + if (zephir_array_isset_string(&options, SL("compileAlways"))) { + ZEPHIR_OBS_NVAR(&compileAlways); + zephir_array_fetch_string(&compileAlways, &options, SL("compileAlways"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2513 TSRMLS_CC); + if (((Z_TYPE_P(&compileAlways) == IS_TRUE || Z_TYPE_P(&compileAlways) == IS_FALSE) != 1)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'compileAlways' must be a bool value", "phalcon/mvc/view/engine/volt/compiler.zep", 2515); return; } } - if (zephir_array_isset_string(options, SS("prefix"))) { - ZEPHIR_OBS_NVAR(prefix); - zephir_array_fetch_string(&prefix, options, SL("prefix"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2523 TSRMLS_CC); - if (Z_TYPE_P(prefix) != IS_STRING) { + if (zephir_array_isset_string(&options, SL("prefix"))) { + ZEPHIR_OBS_NVAR(&prefix); + zephir_array_fetch_string(&prefix, &options, SL("prefix"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2523 TSRMLS_CC); + if (Z_TYPE_P(&prefix) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'prefix' must be a string", "phalcon/mvc/view/engine/volt/compiler.zep", 2525); return; } } - if (zephir_array_isset_string(options, SS("compiledPath"))) { - ZEPHIR_OBS_NVAR(compiledPath); - zephir_array_fetch_string(&compiledPath, options, SL("compiledPath"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2533 TSRMLS_CC); - if (Z_TYPE_P(compiledPath) != IS_STRING) { - if (Z_TYPE_P(compiledPath) != IS_OBJECT) { + if (zephir_array_isset_string(&options, SL("compiledPath"))) { + ZEPHIR_OBS_NVAR(&compiledPath); + zephir_array_fetch_string(&compiledPath, &options, SL("compiledPath"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2533 TSRMLS_CC); + if (Z_TYPE_P(&compiledPath) != IS_STRING) { + if (Z_TYPE_P(&compiledPath) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'compiledPath' must be a string or a closure", "phalcon/mvc/view/engine/volt/compiler.zep", 2536); return; } } } - if (zephir_array_isset_string(options, SS("compiledSeparator"))) { - ZEPHIR_OBS_NVAR(compiledSeparator); - zephir_array_fetch_string(&compiledSeparator, options, SL("compiledSeparator"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2545 TSRMLS_CC); - if (Z_TYPE_P(compiledSeparator) != IS_STRING) { + if (zephir_array_isset_string(&options, SL("compiledSeparator"))) { + ZEPHIR_OBS_NVAR(&compiledSeparator); + zephir_array_fetch_string(&compiledSeparator, &options, SL("compiledSeparator"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2545 TSRMLS_CC); + if (Z_TYPE_P(&compiledSeparator) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'compiledSeparator' must be a string", "phalcon/mvc/view/engine/volt/compiler.zep", 2547); return; } } - if (zephir_array_isset_string(options, SS("compiledExtension"))) { - ZEPHIR_OBS_NVAR(compiledExtension); - zephir_array_fetch_string(&compiledExtension, options, SL("compiledExtension"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2555 TSRMLS_CC); - if (Z_TYPE_P(compiledExtension) != IS_STRING) { + if (zephir_array_isset_string(&options, SL("compiledExtension"))) { + ZEPHIR_OBS_NVAR(&compiledExtension); + zephir_array_fetch_string(&compiledExtension, &options, SL("compiledExtension"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2555 TSRMLS_CC); + if (Z_TYPE_P(&compiledExtension) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "'compiledExtension' must be a string", "phalcon/mvc/view/engine/volt/compiler.zep", 2557); return; } } - if (zephir_array_isset_string(options, SS("stat"))) { - ZEPHIR_OBS_NVAR(stat); - zephir_array_fetch_string(&stat, options, SL("stat"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2565 TSRMLS_CC); + if (zephir_array_isset_string(&options, SL("stat"))) { + ZEPHIR_OBS_NVAR(&stat); + zephir_array_fetch_string(&stat, &options, SL("stat"), PH_NOISY, "phalcon/mvc/view/engine/volt/compiler.zep", 2565 TSRMLS_CC); } } - if (Z_TYPE_P(compiledPath) == IS_STRING) { - if (!(ZEPHIR_IS_EMPTY(compiledPath))) { - ZEPHIR_CALL_FUNCTION(&_1$$17, "realpath", NULL, 67, templatePath); + if (Z_TYPE_P(&compiledPath) == IS_STRING) { + if (!(ZEPHIR_IS_EMPTY(&compiledPath))) { + ZEPHIR_CALL_FUNCTION(&_1$$17, "realpath", NULL, 60, &templatePath); zephir_check_call_status(); - ZEPHIR_INIT_VAR(templateSepPath); - zephir_prepare_virtual_path(templateSepPath, _1$$17, compiledSeparator TSRMLS_CC); + ZEPHIR_INIT_VAR(&templateSepPath); + zephir_prepare_virtual_path(&templateSepPath, &_1$$17, &compiledSeparator TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(templateSepPath, templatePath); + ZEPHIR_CPY_WRT(&templateSepPath, &templatePath); } - ZEPHIR_INIT_VAR(compiledTemplatePath); + ZEPHIR_INIT_VAR(&compiledTemplatePath); if (extendsMode == 1) { - ZEPHIR_CONCAT_VVVVSVV(compiledTemplatePath, compiledPath, prefix, templateSepPath, compiledSeparator, "e", compiledSeparator, compiledExtension); + ZEPHIR_CONCAT_VVVVSVV(&compiledTemplatePath, &compiledPath, &prefix, &templateSepPath, &compiledSeparator, "e", &compiledSeparator, &compiledExtension); } else { - ZEPHIR_CONCAT_VVVV(compiledTemplatePath, compiledPath, prefix, templateSepPath, compiledExtension); + ZEPHIR_CONCAT_VVVV(&compiledTemplatePath, &compiledPath, &prefix, &templateSepPath, &compiledExtension); } } else { - if (Z_TYPE_P(compiledPath) == IS_OBJECT) { - if (zephir_instance_of_ev(compiledPath, zend_ce_closure TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_2$$23); - zephir_create_array(_2$$23, 3, 0 TSRMLS_CC); - zephir_array_fast_append(_2$$23, templatePath); - zephir_array_fast_append(_2$$23, options); - ZEPHIR_INIT_VAR(_3$$23); - ZVAL_BOOL(_3$$23, extendsMode); - zephir_array_fast_append(_2$$23, _3$$23); - ZEPHIR_INIT_NVAR(compiledTemplatePath); - ZEPHIR_CALL_USER_FUNC_ARRAY(compiledTemplatePath, compiledPath, _2$$23); + if (Z_TYPE_P(&compiledPath) == IS_OBJECT) { + if (zephir_instance_of_ev(&compiledPath, zend_ce_closure TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_2$$23); + zephir_create_array(&_2$$23, 3, 0 TSRMLS_CC); + zephir_array_fast_append(&_2$$23, &templatePath); + zephir_array_fast_append(&_2$$23, &options); + ZEPHIR_INIT_VAR(&_3$$23); + ZVAL_BOOL(&_3$$23, extendsMode); + zephir_array_fast_append(&_2$$23, &_3$$23); + ZEPHIR_INIT_NVAR(&compiledTemplatePath); + ZEPHIR_CALL_USER_FUNC_ARRAY(&compiledTemplatePath, &compiledPath, &_2$$23); zephir_check_call_status(); - if (Z_TYPE_P(compiledTemplatePath) != IS_STRING) { + if (Z_TYPE_P(&compiledTemplatePath) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_engine_volt_exception_ce, "compiledPath closure didn't return a valid string", "phalcon/mvc/view/engine/volt/compiler.zep", 2610); return; } @@ -3274,78 +3773,74 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compile) { } } } - ZEPHIR_CPY_WRT(realCompiledPath, compiledTemplatePath); - if (zephir_is_true(compileAlways)) { - ZEPHIR_INIT_VAR(_4$$26); + ZEPHIR_CPY_WRT(&realCompiledPath, &compiledTemplatePath); + if (zephir_is_true(&compileAlways)) { if (extendsMode) { - ZVAL_BOOL(_4$$26, 1); + ZVAL_BOOL(&_4$$26, 1); } else { - ZVAL_BOOL(_4$$26, 0); + ZVAL_BOOL(&_4$$26, 0); } - ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, templatePath, realCompiledPath, _4$$26); + ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, &templatePath, &realCompiledPath, &_4$$26); zephir_check_call_status(); } else { - if (ZEPHIR_IS_TRUE_IDENTICAL(stat)) { - if ((zephir_file_exists(compiledTemplatePath TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_VAR(_5$$29); - if (zephir_compare_mtime(templatePath, realCompiledPath TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_6$$30); + if (ZEPHIR_IS_TRUE_IDENTICAL(&stat)) { + if ((zephir_file_exists(&compiledTemplatePath TSRMLS_CC) == SUCCESS)) { + ZEPHIR_INIT_VAR(&_5$$29); + if (zephir_compare_mtime(&templatePath, &realCompiledPath TSRMLS_CC)) { if (extendsMode) { - ZVAL_BOOL(_6$$30, 1); + ZVAL_BOOL(&_6$$30, 1); } else { - ZVAL_BOOL(_6$$30, 0); + ZVAL_BOOL(&_6$$30, 0); } - ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, templatePath, realCompiledPath, _6$$30); + ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, &templatePath, &realCompiledPath, &_6$$30); zephir_check_call_status(); } else { if (extendsMode == 1) { - ZEPHIR_INIT_VAR(blocksCode); - zephir_file_get_contents(blocksCode, realCompiledPath TSRMLS_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(blocksCode)) { - ZEPHIR_INIT_VAR(_7$$33); - object_init_ex(_7$$33, phalcon_mvc_view_engine_volt_exception_ce); - ZEPHIR_INIT_VAR(_8$$33); - ZEPHIR_CONCAT_SVS(_8$$33, "Extends compilation file ", realCompiledPath, " could not be opened"); - ZEPHIR_CALL_METHOD(NULL, _7$$33, "__construct", NULL, 415, _8$$33); + ZEPHIR_INIT_VAR(&blocksCode); + zephir_file_get_contents(&blocksCode, &realCompiledPath TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&blocksCode)) { + ZEPHIR_INIT_VAR(&_7$$33); + object_init_ex(&_7$$33, phalcon_mvc_view_engine_volt_exception_ce); + ZEPHIR_INIT_VAR(&_8$$33); + ZEPHIR_CONCAT_SVS(&_8$$33, "Extends compilation file ", &realCompiledPath, " could not be opened"); + ZEPHIR_CALL_METHOD(NULL, &_7$$33, "__construct", NULL, 369, &_8$$33); zephir_check_call_status(); - zephir_throw_exception_debug(_7$$33, "phalcon/mvc/view/engine/volt/compiler.zep", 2647 TSRMLS_CC); + zephir_throw_exception_debug(&_7$$33, "phalcon/mvc/view/engine/volt/compiler.zep", 2647 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_is_true(blocksCode)) { - ZEPHIR_CALL_FUNCTION(&compilation, "unserialize", NULL, 69, blocksCode); + if (zephir_is_true(&blocksCode)) { + ZEPHIR_CALL_FUNCTION(&compilation, "unserialize", NULL, 62, &blocksCode); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(compilation); - array_init(compilation); + ZEPHIR_INIT_NVAR(&compilation); + array_init(&compilation); } } } } else { - ZEPHIR_INIT_VAR(_9$$36); if (extendsMode) { - ZVAL_BOOL(_9$$36, 1); + ZVAL_BOOL(&_9$$36, 1); } else { - ZVAL_BOOL(_9$$36, 0); + ZVAL_BOOL(&_9$$36, 0); } - ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, templatePath, realCompiledPath, _9$$36); + ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, &templatePath, &realCompiledPath, &_9$$36); zephir_check_call_status(); } } else { - if (!((zephir_file_exists(realCompiledPath TSRMLS_CC) == SUCCESS))) { - ZEPHIR_INIT_VAR(_10$$38); + if (!((zephir_file_exists(&realCompiledPath TSRMLS_CC) == SUCCESS))) { if (extendsMode) { - ZVAL_BOOL(_10$$38, 1); + ZVAL_BOOL(&_10$$38, 1); } else { - ZVAL_BOOL(_10$$38, 0); + ZVAL_BOOL(&_10$$38, 0); } - ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, templatePath, realCompiledPath, _10$$38); + ZEPHIR_CALL_METHOD(&compilation, this_ptr, "compilefile", NULL, 0, &templatePath, &realCompiledPath, &_10$$38); zephir_check_call_status(); } } } - zephir_update_property_this(getThis(), SL("_compiledTemplatePath"), realCompiledPath TSRMLS_CC); - RETURN_CCTOR(compilation); + zephir_update_property_zval(this_ptr, SL("_compiledTemplatePath"), &realCompiledPath); + RETURN_CCTOR(&compilation); } @@ -3354,7 +3849,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, compile) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getTemplatePath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_currentPath"); @@ -3365,7 +3861,8 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getTemplatePath) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getCompiledTemplatePath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_compiledTemplatePath"); @@ -3386,27 +3883,31 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getCompiledTemplatePath) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, parse) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *viewCode_param = NULL, *currentPath = NULL; - zval *viewCode = NULL; + zval *viewCode_param = NULL, currentPath; + zval viewCode; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewCode); + ZVAL_UNDEF(¤tPath); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &viewCode_param); if (UNEXPECTED(Z_TYPE_P(viewCode_param) != IS_STRING && Z_TYPE_P(viewCode_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewCode' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewCode' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewCode_param) == IS_STRING)) { - zephir_get_strval(viewCode, viewCode_param); + zephir_get_strval(&viewCode, viewCode_param); } else { - ZEPHIR_INIT_VAR(viewCode); - ZVAL_EMPTY_STRING(viewCode); + ZEPHIR_INIT_VAR(&viewCode); + ZVAL_EMPTY_STRING(&viewCode); } - ZEPHIR_INIT_VAR(currentPath); - ZVAL_STRING(currentPath, "eval code", 1); - ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(return_value, viewCode, currentPath TSRMLS_CC); + ZEPHIR_INIT_VAR(¤tPath); + ZVAL_STRING(¤tPath, "eval code"); + ZEPHIR_LAST_CALL_STATUS = phvolt_parse_view(return_value, &viewCode, ¤tPath TSRMLS_CC); zephir_check_call_status(); RETURN_MM(); @@ -3417,45 +3918,50 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, parse) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Compiler, getFinalPath) { - HashTable *_1$$4; - HashPosition _0$$4; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, *view = NULL, *viewsDirs = NULL, *viewsDir = NULL, **_2$$4, *_3$$5 = NULL; - zval *path = NULL; + zval *path_param = NULL, view, viewsDirs, viewsDir, *_0$$4, _1$$5; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(&view); + ZVAL_UNDEF(&viewsDirs); + ZVAL_UNDEF(&viewsDir); + ZVAL_UNDEF(&_1$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &path_param); - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); - ZEPHIR_OBS_VAR(view); - zephir_read_property_this(&view, this_ptr, SL("_view"), PH_NOISY_CC); - if (Z_TYPE_P(view) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&viewsDirs, view, "getviewsdir", NULL, 0); + ZEPHIR_OBS_VAR(&view); + zephir_read_property(&view, this_ptr, SL("_view"), PH_NOISY_CC); + if (Z_TYPE_P(&view) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&viewsDirs, &view, "getviewsdir", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(viewsDirs) == IS_ARRAY) { - zephir_is_iterable(viewsDirs, &_1$$4, &_0$$4, 0, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 2740); - for ( - ; zend_hash_get_current_data_ex(_1$$4, (void**) &_2$$4, &_0$$4) == SUCCESS - ; zend_hash_move_forward_ex(_1$$4, &_0$$4) - ) { - ZEPHIR_GET_HVALUE(viewsDir, _2$$4); - ZEPHIR_INIT_LNVAR(_3$$5); - ZEPHIR_CONCAT_VV(_3$$5, viewsDir, path); - if ((zephir_file_exists(_3$$5 TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CONCAT_VV(return_value, viewsDir, path); + if (Z_TYPE_P(&viewsDirs) == IS_ARRAY) { + zephir_is_iterable(&viewsDirs, 0, "phalcon/mvc/view/engine/volt/compiler.zep", 2740); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&viewsDirs), _0$$4) + { + ZEPHIR_INIT_NVAR(&viewsDir); + ZVAL_COPY(&viewsDir, _0$$4); + ZEPHIR_INIT_LNVAR(_1$$5); + ZEPHIR_CONCAT_VV(&_1$$5, &viewsDir, &path); + if ((zephir_file_exists(&_1$$5 TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CONCAT_VV(return_value, &viewsDir, &path); RETURN_MM(); } - } - ZEPHIR_CONCAT_VV(return_value, viewsDir, path); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&viewsDir); + ZEPHIR_CONCAT_VV(return_value, &viewsDir, &path); RETURN_MM(); } else { - ZEPHIR_CONCAT_VV(return_value, viewsDirs, path); + ZEPHIR_CONCAT_VV(return_value, &viewsDirs, &path); RETURN_MM(); } } - RETURN_CTOR(path); + RETURN_CTOR(&path); } diff --git a/ext/phalcon/mvc/view/engine/volt/compiler.zep.h b/ext/phalcon/mvc/view/engine/volt/compiler.zep.h index a0ea7335816..d4fc7d8a5f9 100644 --- a/ext/phalcon/mvc/view/engine/volt/compiler.zep.h +++ b/ext/phalcon/mvc/view/engine/volt/compiler.zep.h @@ -58,61 +58,171 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_setdi, 0, 0 ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_setoptions, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_setoption, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +#else ZEND_ARG_INFO(0, option) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getoption, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0) +#else ZEND_ARG_INFO(0, option) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getoptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getoptions, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_fireextensionevent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, arguments) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_addextension, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_addextension, 0, 1, Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_addextension, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler", 0) +#endif ZEND_ARG_INFO(0, extension) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_addfunction, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getextensions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getextensions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_addfunction, 0, 2, Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_addfunction, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, definition) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_addfilter, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getfunctions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getfunctions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_addfilter, 0, 2, Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_addfilter, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_ARG_INFO(0, definition) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_setuniqueprefix, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getfilters, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getfilters, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_setuniqueprefix, 0, 1, Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_setuniqueprefix, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, prefix, IS_STRING, 0) +#else ZEND_ARG_INFO(0, prefix) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getuniqueprefix, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getuniqueprefix, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_attributereader, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_attributereader, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_attributereader, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expr, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_functioncall, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_functioncall, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_functioncall, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expr, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_resolvetest, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_resolvetest, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_resolvetest, 0, 2, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, test, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, left, IS_STRING, 0) +#else ZEND_ARG_INFO(0, left) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_resolvefilter, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_resolvefilter, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_resolvefilter, 0, 2, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, filter, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, left, IS_STRING, 0) +#else ZEND_ARG_INFO(0, left) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_expression, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_expression, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_expression, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, expr, 0) ZEND_END_ARG_INFO() @@ -120,121 +230,286 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler__statementl ZEND_ARG_INFO(0, statements) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileforeach, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileforeach, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileforeach, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileforelse, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileforelse, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileif, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileif, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileif, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileswitch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileswitch, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileswitch, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilecase, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilecase, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilecase, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, caseClause, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, caseClause) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileelseif, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileelseif, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileelseif, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilecache, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilecache, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilecache, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileset, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileset, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compiledo, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compiledo, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compiledo, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilereturn, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilereturn, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilereturn, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileautoescape, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileautoescape, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileautoescape, 0, 2, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileecho, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileecho, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileecho, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileinclude, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileinclude, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compileinclude, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilemacro, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilemacro, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilemacro, 0, 2, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statement, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilecall, 0, 0, 2) ZEND_ARG_ARRAY_INFO(0, statement, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler__statementlist, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler__statementlist, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler__statementlist, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_ARRAY_INFO(0, statements, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler__compilesource, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler__compilesource, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler__compilesource, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewCode, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewCode) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilestring, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilestring, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilestring, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewCode, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewCode) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compilefile, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, compiledPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, compiledPath) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_compile, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, templatePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, templatePath) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, extendsMode, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, extendsMode) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_gettemplatepath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_gettemplatepath, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getcompiledtemplatepath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getcompiledtemplatepath, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_parse, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewCode, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewCode) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_compiler_getfinalpath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_view_engine_volt_compiler_method_entry) { PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, __construct, arginfo_phalcon_mvc_view_engine_volt_compiler___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, setDI, arginfo_phalcon_mvc_view_engine_volt_compiler_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getDI, arginfo_phalcon_mvc_view_engine_volt_compiler_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, setOptions, arginfo_phalcon_mvc_view_engine_volt_compiler_setoptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, setOption, arginfo_phalcon_mvc_view_engine_volt_compiler_setoption, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getOption, arginfo_phalcon_mvc_view_engine_volt_compiler_getoption, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getOptions, arginfo_phalcon_mvc_view_engine_volt_compiler_getoptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, fireExtensionEvent, arginfo_phalcon_mvc_view_engine_volt_compiler_fireextensionevent, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, addExtension, arginfo_phalcon_mvc_view_engine_volt_compiler_addextension, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getExtensions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getExtensions, arginfo_phalcon_mvc_view_engine_volt_compiler_getextensions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, addFunction, arginfo_phalcon_mvc_view_engine_volt_compiler_addfunction, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getFunctions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getFunctions, arginfo_phalcon_mvc_view_engine_volt_compiler_getfunctions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, addFilter, arginfo_phalcon_mvc_view_engine_volt_compiler_addfilter, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getFilters, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getFilters, arginfo_phalcon_mvc_view_engine_volt_compiler_getfilters, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, setUniquePrefix, arginfo_phalcon_mvc_view_engine_volt_compiler_setuniqueprefix, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getUniquePrefix, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getUniquePrefix, arginfo_phalcon_mvc_view_engine_volt_compiler_getuniqueprefix, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, attributeReader, arginfo_phalcon_mvc_view_engine_volt_compiler_attributereader, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, functionCall, arginfo_phalcon_mvc_view_engine_volt_compiler_functioncall, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, resolveTest, arginfo_phalcon_mvc_view_engine_volt_compiler_resolvetest, ZEND_ACC_PUBLIC) @@ -242,7 +517,7 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_view_engine_volt_compiler_method_entry) { PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, expression, arginfo_phalcon_mvc_view_engine_volt_compiler_expression, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, _statementListOrExtends, arginfo_phalcon_mvc_view_engine_volt_compiler__statementlistorextends, ZEND_ACC_FINAL|ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForeach, arginfo_phalcon_mvc_view_engine_volt_compiler_compileforeach, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForElse, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, compileForElse, arginfo_phalcon_mvc_view_engine_volt_compiler_compileforelse, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, compileIf, arginfo_phalcon_mvc_view_engine_volt_compiler_compileif, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, compileSwitch, arginfo_phalcon_mvc_view_engine_volt_compiler_compileswitch, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, compileCase, arginfo_phalcon_mvc_view_engine_volt_compiler_compilecase, ZEND_ACC_PUBLIC) @@ -261,8 +536,8 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_view_engine_volt_compiler_method_entry) { PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, compileString, arginfo_phalcon_mvc_view_engine_volt_compiler_compilestring, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, compileFile, arginfo_phalcon_mvc_view_engine_volt_compiler_compilefile, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, compile, arginfo_phalcon_mvc_view_engine_volt_compiler_compile, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getTemplatePath, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getCompiledTemplatePath, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getTemplatePath, arginfo_phalcon_mvc_view_engine_volt_compiler_gettemplatepath, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getCompiledTemplatePath, arginfo_phalcon_mvc_view_engine_volt_compiler_getcompiledtemplatepath, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, parse, arginfo_phalcon_mvc_view_engine_volt_compiler_parse, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Engine_Volt_Compiler, getFinalPath, arginfo_phalcon_mvc_view_engine_volt_compiler_getfinalpath, ZEND_ACC_PROTECTED) PHP_FE_END diff --git a/ext/phalcon/mvc/view/engine/volt/exception.zep.c b/ext/phalcon/mvc/view/engine/volt/exception.zep.c index 9bb737cab76..321af88962a 100644 --- a/ext/phalcon/mvc/view/engine/volt/exception.zep.c +++ b/ext/phalcon/mvc/view/engine/volt/exception.zep.c @@ -36,24 +36,31 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Engine_Volt_Exception) { PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Exception, __construct) { zend_long code, ZEPHIR_LAST_CALL_STATUS; - zval *statement = NULL; - zval *message_param = NULL, *statement_param = NULL, *code_param = NULL, *previous = NULL, *_0; - zval *message = NULL; + zval statement; + zval *message_param = NULL, *statement_param = NULL, *code_param = NULL, *previous = NULL, previous_sub, __$null, _0; + zval message; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&message); + ZVAL_UNDEF(&previous_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&statement); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 4, &message_param, &statement_param, &code_param, &previous); if (!message_param) { - ZEPHIR_INIT_VAR(message); - ZVAL_STRING(message, "", 1); + ZEPHIR_INIT_VAR(&message); + ZVAL_STRING(&message, ""); } else { - zephir_get_strval(message, message_param); + zephir_get_strval(&message, message_param); } if (!statement_param) { - ZEPHIR_INIT_VAR(statement); - array_init(statement); + ZEPHIR_INIT_VAR(&statement); + array_init(&statement); } else { - zephir_get_arrval(statement, statement_param); + zephir_get_arrval(&statement, statement_param); } if (!code_param) { code = 0; @@ -61,14 +68,14 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Exception, __construct) { code = zephir_get_intval(code_param); } if (!previous) { - previous = ZEPHIR_GLOBAL(global_null); + previous = &previous_sub; + previous = &__$null; } - zephir_update_property_this(getThis(), SL("statement"), statement TSRMLS_CC); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, code); - ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_view_engine_volt_exception_ce, getThis(), "__construct", NULL, 0, message, _0, previous); + zephir_update_property_zval(this_ptr, SL("statement"), &statement); + ZVAL_LONG(&_0, code); + ZEPHIR_CALL_PARENT(NULL, phalcon_mvc_view_engine_volt_exception_ce, getThis(), "__construct", NULL, 0, &message, &_0, previous); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -79,17 +86,21 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Exception, __construct) { */ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Exception, getStatement) { - zval *statement = NULL, *_0; + zval statement, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&statement); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("statement"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(statement, _0); - if (Z_TYPE_P(statement) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(statement); - array_init(statement); + zephir_read_property(&_0, this_ptr, SL("statement"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&statement, &_0); + if (Z_TYPE_P(&statement) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&statement); + array_init(&statement); } - RETURN_CCTOR(statement); + RETURN_CCTOR(&statement); } diff --git a/ext/phalcon/mvc/view/engine/volt/exception.zep.h b/ext/phalcon/mvc/view/engine/volt/exception.zep.h index e6f6af14e62..0e436b20ee4 100644 --- a/ext/phalcon/mvc/view/engine/volt/exception.zep.h +++ b/ext/phalcon/mvc/view/engine/volt/exception.zep.h @@ -7,14 +7,29 @@ PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Exception, __construct); PHP_METHOD(Phalcon_Mvc_View_Engine_Volt_Exception, getStatement); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_exception___construct, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) +#else ZEND_ARG_INFO(0, message) - ZEND_ARG_ARRAY_INFO(0, statement, 1) +#endif + ZEND_ARG_ARRAY_INFO(0, statement, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) +#else ZEND_ARG_INFO(0, code) +#endif ZEND_ARG_OBJ_INFO(0, previous, Exception, 1) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_exception_getstatement, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engine_volt_exception_getstatement, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_mvc_view_engine_volt_exception_method_entry) { PHP_ME(Phalcon_Mvc_View_Engine_Volt_Exception, __construct, arginfo_phalcon_mvc_view_engine_volt_exception___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Mvc_View_Engine_Volt_Exception, getStatement, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Engine_Volt_Exception, getStatement, arginfo_phalcon_mvc_view_engine_volt_exception_getstatement, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/mvc/view/engineinterface.zep.h b/ext/phalcon/mvc/view/engineinterface.zep.h index 93a6cfb3c9c..91920733227 100644 --- a/ext/phalcon/mvc/view/engineinterface.zep.h +++ b/ext/phalcon/mvc/view/engineinterface.zep.h @@ -3,19 +3,42 @@ extern zend_class_entry *phalcon_mvc_view_engineinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_EngineInterface); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engineinterface_partial, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engineinterface_getcontent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engineinterface_getcontent, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engineinterface_partial, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_engineinterface_partial, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, partialPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, partialPath) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_engineinterface_render, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, params) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, mustClean, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, mustClean) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_view_engineinterface_method_entry) { - PHP_ABSTRACT_ME(Phalcon_Mvc_View_EngineInterface, getContent, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_View_EngineInterface, getContent, arginfo_phalcon_mvc_view_engineinterface_getcontent) PHP_ABSTRACT_ME(Phalcon_Mvc_View_EngineInterface, partial, arginfo_phalcon_mvc_view_engineinterface_partial) PHP_ABSTRACT_ME(Phalcon_Mvc_View_EngineInterface, render, arginfo_phalcon_mvc_view_engineinterface_render) PHP_FE_END diff --git a/ext/phalcon/mvc/view/simple.zep.c b/ext/phalcon/mvc/view/simple.zep.c index e9b15a7755f..56811529e25 100644 --- a/ext/phalcon/mvc/view/simple.zep.c +++ b/ext/phalcon/mvc/view/simple.zep.c @@ -91,7 +91,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Mvc_View_Simple) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, getRegisteredEngines) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_registeredEngines"); @@ -103,20 +104,23 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, getRegisteredEngines) { PHP_METHOD(Phalcon_Mvc_View_Simple, __construct) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options_param); if (!options_param) { - ZEPHIR_INIT_VAR(options); - array_init(options); + ZEPHIR_INIT_VAR(&options); + array_init(&options); } else { - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); } - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &options); ZEPHIR_MM_RESTORE(); } @@ -127,24 +131,27 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, __construct) { PHP_METHOD(Phalcon_Mvc_View_Simple, setViewsDir) { zval *viewsDir_param = NULL; - zval *viewsDir = NULL; + zval viewsDir; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&viewsDir); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &viewsDir_param); if (UNEXPECTED(Z_TYPE_P(viewsDir_param) != IS_STRING && Z_TYPE_P(viewsDir_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewsDir' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'viewsDir' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(viewsDir_param) == IS_STRING)) { - zephir_get_strval(viewsDir, viewsDir_param); + zephir_get_strval(&viewsDir, viewsDir_param); } else { - ZEPHIR_INIT_VAR(viewsDir); - ZVAL_EMPTY_STRING(viewsDir); + ZEPHIR_INIT_VAR(&viewsDir); + ZVAL_EMPTY_STRING(&viewsDir); } - zephir_update_property_this(getThis(), SL("_viewsDir"), viewsDir TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_viewsDir"), &viewsDir); ZEPHIR_MM_RESTORE(); } @@ -154,7 +161,8 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, setViewsDir) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, getViewsDir) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_viewsDir"); @@ -176,14 +184,19 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, getViewsDir) { PHP_METHOD(Phalcon_Mvc_View_Simple, registerEngines) { zval *engines_param = NULL; - zval *engines = NULL; + zval engines; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&engines); - zephir_fetch_params(0, 1, 0, &engines_param); + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &engines_param); - engines = engines_param; + ZEPHIR_OBS_COPY_OR_DUP(&engines, engines_param); - zephir_update_property_this(getThis(), SL("_registeredEngines"), engines TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_registeredEngines"), &engines); + ZEPHIR_MM_RESTORE(); } @@ -194,78 +207,96 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, registerEngines) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, _loadTemplateEngines) { - HashTable *_2$$5; - HashPosition _1$$5; - zval *engines = NULL, *dependencyInjector = NULL, *registeredEngines = NULL, *arguments = NULL, *extension = NULL, *engineService = NULL, *engineObject = NULL, *_0$$4, **_3$$5, *_5$$13 = NULL, *_6$$13 = NULL; + zend_string *_3$$5; + zend_ulong _2$$5; + zval engines, dependencyInjector, registeredEngines, arguments, extension, engineService, engineObject, _0$$4, *_1$$5, _5$$13, _6$$13; zephir_fcall_cache_entry *_4 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&engines); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(®isteredEngines); + ZVAL_UNDEF(&arguments); + ZVAL_UNDEF(&extension); + ZVAL_UNDEF(&engineService); + ZVAL_UNDEF(&engineObject); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_5$$13); + ZVAL_UNDEF(&_6$$13); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(engines); - zephir_read_property_this(&engines, this_ptr, SL("_engines"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(engines)) { - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(engines); - array_init(engines); - ZEPHIR_OBS_VAR(registeredEngines); - zephir_read_property_this(®isteredEngines, this_ptr, SL("_registeredEngines"), PH_NOISY_CC); - if (Z_TYPE_P(registeredEngines) != IS_ARRAY) { - ZEPHIR_INIT_VAR(_0$$4); - object_init_ex(_0$$4, phalcon_mvc_view_engine_php_ce); - ZEPHIR_CALL_METHOD(NULL, _0$$4, "__construct", NULL, 401, this_ptr, dependencyInjector); + ZEPHIR_OBS_VAR(&engines); + zephir_read_property(&engines, this_ptr, SL("_engines"), PH_NOISY_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&engines)) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + ZEPHIR_INIT_NVAR(&engines); + array_init(&engines); + ZEPHIR_OBS_VAR(®isteredEngines); + zephir_read_property(®isteredEngines, this_ptr, SL("_registeredEngines"), PH_NOISY_CC); + if (Z_TYPE_P(®isteredEngines) != IS_ARRAY) { + ZEPHIR_INIT_VAR(&_0$$4); + object_init_ex(&_0$$4, phalcon_mvc_view_engine_php_ce); + ZEPHIR_CALL_METHOD(NULL, &_0$$4, "__construct", NULL, 355, this_ptr, &dependencyInjector); zephir_check_call_status(); zephir_array_update_string(&engines, SL(".phtml"), &_0$$4, PH_COPY | PH_SEPARATE); } else { - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the application services", "phalcon/mvc/view/simple.zep", 159); return; } - ZEPHIR_INIT_VAR(arguments); - zephir_create_array(arguments, 2, 0 TSRMLS_CC); - zephir_array_fast_append(arguments, this_ptr); - zephir_array_fast_append(arguments, dependencyInjector); - zephir_is_iterable(registeredEngines, &_2$$5, &_1$$5, 0, 0, "phalcon/mvc/view/simple.zep", 191); - for ( - ; zend_hash_get_current_data_ex(_2$$5, (void**) &_3$$5, &_1$$5) == SUCCESS - ; zend_hash_move_forward_ex(_2$$5, &_1$$5) - ) { - ZEPHIR_GET_HMKEY(extension, _2$$5, _1$$5); - ZEPHIR_GET_HVALUE(engineService, _3$$5); - if (Z_TYPE_P(engineService) == IS_OBJECT) { - if (zephir_instance_of_ev(engineService, zend_ce_closure TSRMLS_CC)) { - ZEPHIR_INIT_NVAR(engineObject); - ZEPHIR_CALL_USER_FUNC_ARRAY(engineObject, engineService, arguments); + ZEPHIR_INIT_VAR(&arguments); + zephir_create_array(&arguments, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&arguments, this_ptr); + zephir_array_fast_append(&arguments, &dependencyInjector); + zephir_is_iterable(®isteredEngines, 0, "phalcon/mvc/view/simple.zep", 191); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(®isteredEngines), _2$$5, _3$$5, _1$$5) + { + ZEPHIR_INIT_NVAR(&extension); + if (_3$$5 != NULL) { + ZVAL_STR_COPY(&extension, _3$$5); + } else { + ZVAL_LONG(&extension, _2$$5); + } + ZEPHIR_INIT_NVAR(&engineService); + ZVAL_COPY(&engineService, _1$$5); + if (Z_TYPE_P(&engineService) == IS_OBJECT) { + if (zephir_instance_of_ev(&engineService, zend_ce_closure TSRMLS_CC)) { + ZEPHIR_INIT_NVAR(&engineObject); + ZEPHIR_CALL_USER_FUNC_ARRAY(&engineObject, &engineService, &arguments); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(engineObject, engineService); + ZEPHIR_CPY_WRT(&engineObject, &engineService); } } else { - if (Z_TYPE_P(engineService) == IS_STRING) { - ZEPHIR_CALL_METHOD(&engineObject, dependencyInjector, "getshared", &_4, 0, engineService, arguments); + if (Z_TYPE_P(&engineService) == IS_STRING) { + ZEPHIR_CALL_METHOD(&engineObject, &dependencyInjector, "getshared", &_4, 0, &engineService, &arguments); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(_5$$13); - object_init_ex(_5$$13, phalcon_mvc_view_exception_ce); + ZEPHIR_INIT_NVAR(&_5$$13); + object_init_ex(&_5$$13, phalcon_mvc_view_exception_ce); ZEPHIR_INIT_LNVAR(_6$$13); - ZEPHIR_CONCAT_SV(_6$$13, "Invalid template engine registration for extension: ", extension); - ZEPHIR_CALL_METHOD(NULL, _5$$13, "__construct", &_7, 9, _6$$13); + ZEPHIR_CONCAT_SV(&_6$$13, "Invalid template engine registration for extension: ", &extension); + ZEPHIR_CALL_METHOD(NULL, &_5$$13, "__construct", &_7, 4, &_6$$13); zephir_check_call_status(); - zephir_throw_exception_debug(_5$$13, "phalcon/mvc/view/simple.zep", 185 TSRMLS_CC); + zephir_throw_exception_debug(&_5$$13, "phalcon/mvc/view/simple.zep", 185 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } } - zephir_array_update_zval(&engines, extension, &engineObject, PH_COPY | PH_SEPARATE); - } + zephir_array_update_zval(&engines, &extension, &engineObject, PH_COPY | PH_SEPARATE); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&engineService); + ZEPHIR_INIT_NVAR(&extension); } - zephir_update_property_this(getThis(), SL("_engines"), engines TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_engines"), &engines); } else { - ZEPHIR_OBS_NVAR(engines); - zephir_read_property_this(&engines, this_ptr, SL("_engines"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&engines); + zephir_read_property(&engines, this_ptr, SL("_engines"), PH_NOISY_CC); } - RETURN_CCTOR(engines); + RETURN_CCTOR(&engines); } @@ -277,129 +308,152 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, _loadTemplateEngines) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, _internalRender) { - HashTable *_4; - HashPosition _3; + zend_string *_5; + zend_ulong _4; zend_bool notExists = 0, mustClean = 0, _7$$8, _10$$8; zephir_fcall_cache_entry *_13 = NULL, *_16 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, *params, *eventsManager = NULL, *engines = NULL, *extension = NULL, *engine = NULL, *viewEnginePath = NULL, *viewsDirPath = NULL, *_2, **_5, *_0$$4 = NULL, *_1$$4, *_6$$6 = NULL, _8$$8 = zval_used_for_init, *_9$$8 = NULL, *_11$$12 = NULL, *_12$$12 = NULL, *_14$$11 = NULL, *_15$$14 = NULL, *_17$$15, *_18$$15, *_19$$16; - zval *path = NULL; + zval *path_param = NULL, *params, params_sub, eventsManager, engines, extension, engine, viewEnginePath, viewsDirPath, _2, *_3, _0$$4, _1$$4, _6$$6, _8$$8, _9$$8, _11$$12, _12$$12, _14$$11, _15$$14, _17$$15, _18$$15, _19$$16; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(¶ms_sub); + ZVAL_UNDEF(&eventsManager); + ZVAL_UNDEF(&engines); + ZVAL_UNDEF(&extension); + ZVAL_UNDEF(&engine); + ZVAL_UNDEF(&viewEnginePath); + ZVAL_UNDEF(&viewsDirPath); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_8$$8); + ZVAL_UNDEF(&_9$$8); + ZVAL_UNDEF(&_11$$12); + ZVAL_UNDEF(&_12$$12); + ZVAL_UNDEF(&_14$$11); + ZVAL_UNDEF(&_15$$14); + ZVAL_UNDEF(&_17$$15); + ZVAL_UNDEF(&_18$$15); + ZVAL_UNDEF(&_19$$16); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &path_param, ¶ms); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } - ZEPHIR_OBS_VAR(eventsManager); - zephir_read_property_this(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - zephir_update_property_this(getThis(), SL("_activeRenderPath"), path TSRMLS_CC); + ZEPHIR_OBS_VAR(&eventsManager); + zephir_read_property(&eventsManager, this_ptr, SL("_eventsManager"), PH_NOISY_CC); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_activeRenderPath"), &path); } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_STRING(_1$$4, "view:beforeRender", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0$$4, eventsManager, "fire", NULL, 0, _1$$4, this_ptr); - zephir_check_temp_parameter(_1$$4); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_STRING(&_1$$4, "view:beforeRender"); + ZEPHIR_CALL_METHOD(&_0$$4, &eventsManager, "fire", NULL, 0, &_1$$4, this_ptr); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$4)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0$$4)) { RETURN_MM_NULL(); } } notExists = 1; mustClean = 1; - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_viewsDir"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(viewsDirPath); - ZEPHIR_CONCAT_VV(viewsDirPath, _2, path); + zephir_read_property(&_2, this_ptr, SL("_viewsDir"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&viewsDirPath); + ZEPHIR_CONCAT_VV(&viewsDirPath, &_2, &path); ZEPHIR_CALL_METHOD(&engines, this_ptr, "_loadtemplateengines", NULL, 0); zephir_check_call_status(); - zephir_is_iterable(engines, &_4, &_3, 0, 0, "phalcon/mvc/view/simple.zep", 282); - for ( - ; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS - ; zend_hash_move_forward_ex(_4, &_3) - ) { - ZEPHIR_GET_HMKEY(extension, _4, _3); - ZEPHIR_GET_HVALUE(engine, _5); + zephir_is_iterable(&engines, 0, "phalcon/mvc/view/simple.zep", 282); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&engines), _4, _5, _3) + { + ZEPHIR_INIT_NVAR(&extension); + if (_5 != NULL) { + ZVAL_STR_COPY(&extension, _5); + } else { + ZVAL_LONG(&extension, _4); + } + ZEPHIR_INIT_NVAR(&engine); + ZVAL_COPY(&engine, _3); ZEPHIR_INIT_LNVAR(_6$$6); - ZEPHIR_CONCAT_VV(_6$$6, viewsDirPath, extension); - if ((zephir_file_exists(_6$$6 TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_NVAR(viewEnginePath); - ZEPHIR_CONCAT_VV(viewEnginePath, viewsDirPath, extension); + ZEPHIR_CONCAT_VV(&_6$$6, &viewsDirPath, &extension); + if ((zephir_file_exists(&_6$$6 TSRMLS_CC) == SUCCESS)) { + ZEPHIR_INIT_NVAR(&viewEnginePath); + ZEPHIR_CONCAT_VV(&viewEnginePath, &viewsDirPath, &extension); } else { - _7$$8 = zephir_is_true(extension); + _7$$8 = zephir_is_true(&extension); if (_7$$8) { - ZEPHIR_SINIT_NVAR(_8$$8); - ZVAL_LONG(&_8$$8, -zephir_fast_strlen_ev(extension)); - ZEPHIR_INIT_NVAR(_9$$8); - zephir_substr(_9$$8, viewsDirPath, zephir_get_intval(&_8$$8), 0, ZEPHIR_SUBSTR_NO_LENGTH); - _7$$8 = ZEPHIR_IS_EQUAL(_9$$8, extension); + ZVAL_LONG(&_8$$8, -zephir_fast_strlen_ev(&extension)); + ZEPHIR_INIT_NVAR(&_9$$8); + zephir_substr(&_9$$8, &viewsDirPath, zephir_get_intval(&_8$$8), 0, ZEPHIR_SUBSTR_NO_LENGTH); + _7$$8 = ZEPHIR_IS_EQUAL(&_9$$8, &extension); } _10$$8 = _7$$8; if (_10$$8) { - _10$$8 = (zephir_file_exists(viewsDirPath TSRMLS_CC) == SUCCESS); + _10$$8 = (zephir_file_exists(&viewsDirPath TSRMLS_CC) == SUCCESS); } if (_10$$8) { - ZEPHIR_CPY_WRT(viewEnginePath, viewsDirPath); + ZEPHIR_CPY_WRT(&viewEnginePath, &viewsDirPath); } else { - ZEPHIR_INIT_NVAR(viewEnginePath); - ZVAL_STRING(viewEnginePath, "", 1); + ZEPHIR_INIT_NVAR(&viewEnginePath); + ZVAL_STRING(&viewEnginePath, ""); } } - if (zephir_is_true(viewEnginePath)) { - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_12$$12); - ZVAL_STRING(_12$$12, "view:beforeRenderView", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_11$$12, eventsManager, "fire", &_13, 0, _12$$12, this_ptr, viewEnginePath); - zephir_check_temp_parameter(_12$$12); + if (zephir_is_true(&viewEnginePath)) { + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_12$$12); + ZVAL_STRING(&_12$$12, "view:beforeRenderView"); + ZEPHIR_CALL_METHOD(&_11$$12, &eventsManager, "fire", &_13, 0, &_12$$12, this_ptr, &viewEnginePath); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_11$$12)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&_11$$12)) { continue; } } - ZEPHIR_INIT_NVAR(_14$$11); if (mustClean) { - ZVAL_BOOL(_14$$11, 1); + ZVAL_BOOL(&_14$$11, 1); } else { - ZVAL_BOOL(_14$$11, 0); + ZVAL_BOOL(&_14$$11, 0); } - ZEPHIR_CALL_METHOD(NULL, engine, "render", NULL, 0, viewEnginePath, params, _14$$11); + ZEPHIR_CALL_METHOD(NULL, &engine, "render", NULL, 0, &viewEnginePath, params, &_14$$11); zephir_check_call_status(); notExists = 0; - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_NVAR(_15$$14); - ZVAL_STRING(_15$$14, "view:afterRenderView", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", &_16, 0, _15$$14, this_ptr); - zephir_check_temp_parameter(_15$$14); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_NVAR(&_15$$14); + ZVAL_STRING(&_15$$14, "view:afterRenderView"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", &_16, 0, &_15$$14, this_ptr); zephir_check_call_status(); } break; } - } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&engine); + ZEPHIR_INIT_NVAR(&extension); if (notExists == 1) { - ZEPHIR_INIT_VAR(_17$$15); - object_init_ex(_17$$15, phalcon_mvc_view_exception_ce); - ZEPHIR_INIT_VAR(_18$$15); - ZEPHIR_CONCAT_SVS(_18$$15, "View '", viewsDirPath, "' was not found in the views directory"); - ZEPHIR_CALL_METHOD(NULL, _17$$15, "__construct", NULL, 9, _18$$15); + ZEPHIR_INIT_VAR(&_17$$15); + object_init_ex(&_17$$15, phalcon_mvc_view_exception_ce); + ZEPHIR_INIT_VAR(&_18$$15); + ZEPHIR_CONCAT_SVS(&_18$$15, "View '", &viewsDirPath, "' was not found in the views directory"); + ZEPHIR_CALL_METHOD(NULL, &_17$$15, "__construct", NULL, 4, &_18$$15); zephir_check_call_status(); - zephir_throw_exception_debug(_17$$15, "phalcon/mvc/view/simple.zep", 283 TSRMLS_CC); + zephir_throw_exception_debug(&_17$$15, "phalcon/mvc/view/simple.zep", 283 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (Z_TYPE_P(eventsManager) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_19$$16); - ZVAL_STRING(_19$$16, "view:afterRender", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, eventsManager, "fire", NULL, 0, _19$$16, this_ptr); - zephir_check_temp_parameter(_19$$16); + if (Z_TYPE_P(&eventsManager) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_19$$16); + ZVAL_STRING(&_19$$16, "view:afterRender"); + ZEPHIR_CALL_METHOD(NULL, &eventsManager, "fire", NULL, 0, &_19$$16, this_ptr); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -416,94 +470,111 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, render) { zend_bool _3$$12; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *path_param = NULL, *params = NULL, *cache = NULL, *key = NULL, *lifetime = NULL, *cacheOptions = NULL, *content = NULL, *viewParams = NULL, *mergedParams = NULL, *_1, *_0$$3 = NULL, *_2$$12 = NULL, *_4$$12 = NULL; - zval *path = NULL; + zval *path_param = NULL, *params = NULL, params_sub, __$null, cache, key, lifetime, cacheOptions, content, viewParams, mergedParams, _1, _0$$3, _2$$12, _4$$12; + zval path; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&path); + ZVAL_UNDEF(¶ms_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&cache); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&lifetime); + ZVAL_UNDEF(&cacheOptions); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&viewParams); + ZVAL_UNDEF(&mergedParams); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$12); + ZVAL_UNDEF(&_4$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &path_param, ¶ms); if (UNEXPECTED(Z_TYPE_P(path_param) != IS_STRING && Z_TYPE_P(path_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'path' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(path_param) == IS_STRING)) { - zephir_get_strval(path, path_param); + zephir_get_strval(&path, path_param); } else { - ZEPHIR_INIT_VAR(path); - ZVAL_EMPTY_STRING(path); + ZEPHIR_INIT_VAR(&path); + ZVAL_EMPTY_STRING(&path); } if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } ZEPHIR_CALL_METHOD(&cache, this_ptr, "getcache", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(cache) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_0$$3, cache, "isstarted", NULL, 0); + if (Z_TYPE_P(&cache) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&_0$$3, &cache, "isstarted", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0$$3)) { - ZEPHIR_INIT_VAR(key); - ZVAL_NULL(key); - ZEPHIR_INIT_VAR(lifetime); - ZVAL_NULL(lifetime); - ZEPHIR_OBS_VAR(cacheOptions); - zephir_read_property_this(&cacheOptions, this_ptr, SL("_cacheOptions"), PH_NOISY_CC); - if (Z_TYPE_P(cacheOptions) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(key); - zephir_array_isset_string_fetch(&key, cacheOptions, SS("key"), 0 TSRMLS_CC); - ZEPHIR_OBS_NVAR(lifetime); - zephir_array_isset_string_fetch(&lifetime, cacheOptions, SS("lifetime"), 0 TSRMLS_CC); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0$$3)) { + ZEPHIR_INIT_VAR(&key); + ZVAL_NULL(&key); + ZEPHIR_INIT_VAR(&lifetime); + ZVAL_NULL(&lifetime); + ZEPHIR_OBS_VAR(&cacheOptions); + zephir_read_property(&cacheOptions, this_ptr, SL("_cacheOptions"), PH_NOISY_CC); + if (Z_TYPE_P(&cacheOptions) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&key); + zephir_array_isset_string_fetch(&key, &cacheOptions, SL("key"), 0); + ZEPHIR_OBS_NVAR(&lifetime); + zephir_array_isset_string_fetch(&lifetime, &cacheOptions, SL("lifetime"), 0); } - if (Z_TYPE_P(key) == IS_NULL) { - ZEPHIR_INIT_NVAR(key); - zephir_md5(key, path); + if (Z_TYPE_P(&key) == IS_NULL) { + ZEPHIR_INIT_NVAR(&key); + zephir_md5(&key, &path); } - ZEPHIR_CALL_METHOD(&content, cache, "start", NULL, 0, key, lifetime); + ZEPHIR_CALL_METHOD(&content, &cache, "start", NULL, 0, &key, &lifetime); zephir_check_call_status(); - if (Z_TYPE_P(content) != IS_NULL) { - zephir_update_property_this(getThis(), SL("_content"), content TSRMLS_CC); - RETURN_CCTOR(content); + if (Z_TYPE_P(&content) != IS_NULL) { + zephir_update_property_zval(this_ptr, SL("_content"), &content); + RETURN_CCTOR(&content); } } } - ZEPHIR_INIT_VAR(_1); + ZEPHIR_INIT_VAR(&_1); zephir_create_symbol_table(TSRMLS_C); - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 140); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 121); zephir_check_call_status(); - ZEPHIR_OBS_VAR(viewParams); - zephir_read_property_this(&viewParams, this_ptr, SL("_viewParams"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&viewParams); + zephir_read_property(&viewParams, this_ptr, SL("_viewParams"), PH_NOISY_CC); if (Z_TYPE_P(params) == IS_ARRAY) { - if (Z_TYPE_P(viewParams) == IS_ARRAY) { - ZEPHIR_INIT_VAR(mergedParams); - zephir_fast_array_merge(mergedParams, &(viewParams), &(params) TSRMLS_CC); + if (Z_TYPE_P(&viewParams) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&mergedParams); + zephir_fast_array_merge(&mergedParams, &viewParams, params TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(mergedParams, params); + ZEPHIR_CPY_WRT(&mergedParams, params); } } else { - ZEPHIR_CPY_WRT(mergedParams, viewParams); + ZEPHIR_CPY_WRT(&mergedParams, &viewParams); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_internalrender", NULL, 420, path, mergedParams); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_internalrender", NULL, 374, &path, &mergedParams); zephir_check_call_status(); - if (Z_TYPE_P(cache) == IS_OBJECT) { - ZEPHIR_CALL_METHOD(&_2$$12, cache, "isstarted", NULL, 0); + if (Z_TYPE_P(&cache) == IS_OBJECT) { + ZEPHIR_CALL_METHOD(&_2$$12, &cache, "isstarted", NULL, 0); zephir_check_call_status(); - _3$$12 = zephir_is_true(_2$$12); + _3$$12 = zephir_is_true(&_2$$12); if (_3$$12) { - ZEPHIR_CALL_METHOD(&_4$$12, cache, "isfresh", NULL, 0); + ZEPHIR_CALL_METHOD(&_4$$12, &cache, "isfresh", NULL, 0); zephir_check_call_status(); - _3$$12 = zephir_is_true(_4$$12); + _3$$12 = zephir_is_true(&_4$$12); } if (_3$$12) { - ZEPHIR_CALL_METHOD(NULL, cache, "save", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &cache, "save", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(NULL, cache, "stop", NULL, 0); + ZEPHIR_CALL_METHOD(NULL, &cache, "stop", NULL, 0); zephir_check_call_status(); } } - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 142); + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 123); zephir_check_call_status(); RETURN_MM_MEMBER(getThis(), "_content"); @@ -530,53 +601,63 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, render) { PHP_METHOD(Phalcon_Mvc_View_Simple, partial) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *partialPath_param = NULL, *params = NULL, *viewParams = NULL, *mergedParams = NULL, *_1, *_0$$3; - zval *partialPath = NULL; + zval *partialPath_param = NULL, *params = NULL, params_sub, __$null, viewParams, mergedParams, _1, _0$$3; + zval partialPath; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&partialPath); + ZVAL_UNDEF(¶ms_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&viewParams); + ZVAL_UNDEF(&mergedParams); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &partialPath_param, ¶ms); if (UNEXPECTED(Z_TYPE_P(partialPath_param) != IS_STRING && Z_TYPE_P(partialPath_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'partialPath' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(partialPath_param) == IS_STRING)) { - zephir_get_strval(partialPath, partialPath_param); + zephir_get_strval(&partialPath, partialPath_param); } else { - ZEPHIR_INIT_VAR(partialPath); - ZVAL_EMPTY_STRING(partialPath); + ZEPHIR_INIT_VAR(&partialPath); + ZVAL_EMPTY_STRING(&partialPath); } if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } - ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 140); + ZEPHIR_CALL_FUNCTION(NULL, "ob_start", NULL, 121); zephir_check_call_status(); if (Z_TYPE_P(params) == IS_ARRAY) { - ZEPHIR_OBS_VAR(viewParams); - zephir_read_property_this(&viewParams, this_ptr, SL("_viewParams"), PH_NOISY_CC); - if (Z_TYPE_P(viewParams) == IS_ARRAY) { - ZEPHIR_INIT_VAR(mergedParams); - zephir_fast_array_merge(mergedParams, &(viewParams), &(params) TSRMLS_CC); + ZEPHIR_OBS_VAR(&viewParams); + zephir_read_property(&viewParams, this_ptr, SL("_viewParams"), PH_NOISY_CC); + if (Z_TYPE_P(&viewParams) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&mergedParams); + zephir_fast_array_merge(&mergedParams, &viewParams, params TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(mergedParams, params); + ZEPHIR_CPY_WRT(&mergedParams, params); } - ZEPHIR_INIT_VAR(_0$$3); + ZEPHIR_INIT_VAR(&_0$$3); zephir_create_symbol_table(TSRMLS_C); } else { - ZEPHIR_CPY_WRT(mergedParams, params); + ZEPHIR_CPY_WRT(&mergedParams, params); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "_internalrender", NULL, 420, partialPath, mergedParams); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "_internalrender", NULL, 374, &partialPath, &mergedParams); zephir_check_call_status(); if (Z_TYPE_P(params) == IS_ARRAY) { - zephir_update_property_this(getThis(), SL("_viewParams"), viewParams TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_viewParams"), &viewParams); } - ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 142); + ZEPHIR_CALL_FUNCTION(NULL, "ob_end_clean", NULL, 123); zephir_check_call_status(); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_content"), PH_NOISY_CC); - zend_print_zval(_1, 0); + zephir_read_property(&_1, this_ptr, SL("_content"), PH_NOISY_CC | PH_READONLY); + zend_print_zval(&_1, 0); ZEPHIR_MM_RESTORE(); } @@ -587,15 +668,18 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, partial) { PHP_METHOD(Phalcon_Mvc_View_Simple, setCacheOptions) { zval *options_param = NULL; - zval *options = NULL; + zval options; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &options_param); - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); - zephir_update_property_this(getThis(), SL("_cacheOptions"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cacheOptions"), &options); RETURN_THIS(); } @@ -607,7 +691,8 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, setCacheOptions) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, getCacheOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_cacheOptions"); @@ -618,35 +703,42 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, getCacheOptions) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, _createCache) { - zval *dependencyInjector = NULL, *cacheService = NULL, *cacheOptions = NULL, *viewCache = NULL, *_0 = NULL; + zval dependencyInjector, cacheService, cacheOptions, viewCache, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&cacheService); + ZVAL_UNDEF(&cacheOptions); + ZVAL_UNDEF(&viewCache); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "A dependency injector container is required to obtain the view cache services", "phalcon/mvc/view/simple.zep", 493); return; } - ZEPHIR_INIT_VAR(cacheService); - ZVAL_STRING(cacheService, "viewCache", 1); - ZEPHIR_OBS_VAR(cacheOptions); - zephir_read_property_this(&cacheOptions, this_ptr, SL("_cacheOptions"), PH_NOISY_CC); - if (Z_TYPE_P(cacheOptions) == IS_ARRAY) { - if (zephir_array_isset_string(cacheOptions, SS("service"))) { - ZEPHIR_OBS_NVAR(cacheService); - zephir_array_isset_string_fetch(&cacheService, cacheOptions, SS("service"), 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&cacheService); + ZVAL_STRING(&cacheService, "viewCache"); + ZEPHIR_OBS_VAR(&cacheOptions); + zephir_read_property(&cacheOptions, this_ptr, SL("_cacheOptions"), PH_NOISY_CC); + if (Z_TYPE_P(&cacheOptions) == IS_ARRAY) { + if (zephir_array_isset_string(&cacheOptions, SL("service"))) { + ZEPHIR_OBS_NVAR(&cacheService); + zephir_array_isset_string_fetch(&cacheService, &cacheOptions, SL("service"), 0); } } - ZEPHIR_CALL_METHOD(&_0, dependencyInjector, "getshared", NULL, 0, cacheService); + ZEPHIR_CALL_METHOD(&_0, &dependencyInjector, "getshared", NULL, 0, &cacheService); zephir_check_call_status(); - ZEPHIR_CPY_WRT(viewCache, _0); - if (Z_TYPE_P(viewCache) != IS_OBJECT) { + ZEPHIR_CPY_WRT(&viewCache, &_0); + if (Z_TYPE_P(&viewCache) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_view_exception_ce, "The injected caching service is invalid", "phalcon/mvc/view/simple.zep", 510); return; } - RETURN_CCTOR(viewCache); + RETURN_CCTOR(&viewCache); } @@ -656,22 +748,27 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, _createCache) { PHP_METHOD(Phalcon_Mvc_View_Simple, getCache) { zend_bool _1; - zval *_0, *_2, *_3$$3 = NULL; + zval _0, _2, _3$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_cache"), PH_NOISY_CC); - _1 = zephir_is_true(_0); + zephir_read_property(&_0, this_ptr, SL("_cache"), PH_NOISY_CC | PH_READONLY); + _1 = zephir_is_true(&_0); if (_1) { - ZEPHIR_OBS_VAR(_2); - zephir_read_property_this(&_2, this_ptr, SL("_cache"), PH_NOISY_CC); - _1 = Z_TYPE_P(_2) != IS_OBJECT; + ZEPHIR_OBS_VAR(&_2); + zephir_read_property(&_2, this_ptr, SL("_cache"), PH_NOISY_CC); + _1 = Z_TYPE_P(&_2) != IS_OBJECT; } if (_1) { ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "_createcache", NULL, 0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_cache"), _3$$3 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &_3$$3); } RETURN_MM_MEMBER(getThis(), "_cache"); @@ -691,34 +788,40 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, getCache) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, cache) { - zval *options = NULL; + zval *options = NULL, options_sub, __$true, __$false; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); zephir_fetch_params(0, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_true); + options = &options_sub; + options = &__$true; } if (Z_TYPE_P(options) == IS_ARRAY) { if (1) { - zephir_update_property_this(getThis(), SL("_cache"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_cache"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &__$false); } - zephir_update_property_this(getThis(), SL("_cacheOptions"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cacheOptions"), options); } else { if (zephir_is_true(options)) { if (1) { - zephir_update_property_this(getThis(), SL("_cache"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_cache"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &__$false); } } else { if (0) { - zephir_update_property_this(getThis(), SL("_cache"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_cache"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_cache"), &__$false); } } } @@ -735,25 +838,29 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, cache) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, setParamToView) { - zval *key_param = NULL, *value; - zval *key = NULL; + zval *key_param = NULL, *value, value_sub; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &value); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - zephir_update_property_array(this_ptr, SL("_viewParams"), key, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_viewParams"), &key, value TSRMLS_CC); RETURN_THIS(); } @@ -772,13 +879,19 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, setParamToView) { PHP_METHOD(Phalcon_Mvc_View_Simple, setVars) { zend_bool merge, _0; - zval *params_param = NULL, *merge_param = NULL, *_1, *_2$$3, *_3$$3; - zval *params = NULL; + zval *params_param = NULL, *merge_param = NULL, _1, _2$$3, _3$$3; + zval params; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, ¶ms_param, &merge_param); - params = params_param; + ZEPHIR_OBS_COPY_OR_DUP(¶ms, params_param); if (!merge_param) { merge = 1; } else { @@ -788,17 +901,17 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, setVars) { _0 = merge; if (_0) { - ZEPHIR_OBS_VAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_viewParams"), PH_NOISY_CC); - _0 = Z_TYPE_P(_1) == IS_ARRAY; + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_viewParams"), PH_NOISY_CC); + _0 = Z_TYPE_P(&_1) == IS_ARRAY; } if (_0) { - ZEPHIR_INIT_VAR(_2$$3); - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_viewParams"), PH_NOISY_CC); - zephir_fast_array_merge(_2$$3, &(_3$$3), &(params) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_viewParams"), _2$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$3); + zephir_read_property(&_3$$3, this_ptr, SL("_viewParams"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_2$$3, &_3$$3, ¶ms TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_viewParams"), &_2$$3); } else { - zephir_update_property_this(getThis(), SL("_viewParams"), params TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_viewParams"), ¶ms); } RETURN_THIS(); @@ -813,25 +926,29 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, setVars) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, setVar) { - zval *key_param = NULL, *value; - zval *key = NULL; + zval *key_param = NULL, *value, value_sub; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &value); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - zephir_update_property_array(this_ptr, SL("_viewParams"), key, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_viewParams"), &key, value TSRMLS_CC); RETURN_THIS(); } @@ -841,27 +958,32 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, setVar) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, getVar) { - zval *key_param = NULL, *value = NULL, *_0; - zval *key = NULL; + zval *key_param = NULL, value, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_viewParams"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&value, _0, key, 1 TSRMLS_CC)) { - RETURN_CTOR(value); + zephir_read_property(&_0, this_ptr, SL("_viewParams"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&value, &_0, &key, 1 TSRMLS_CC)) { + RETURN_CTOR(&value); } RETURN_MM_NULL(); @@ -874,7 +996,8 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, getVar) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, getParamsToView) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_viewParams"); @@ -890,24 +1013,27 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, getParamsToView) { PHP_METHOD(Phalcon_Mvc_View_Simple, setContent) { zval *content_param = NULL; - zval *content = NULL; + zval content; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&content); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &content_param); if (UNEXPECTED(Z_TYPE_P(content_param) != IS_STRING && Z_TYPE_P(content_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(content_param) == IS_STRING)) { - zephir_get_strval(content, content_param); + zephir_get_strval(&content, content_param); } else { - ZEPHIR_INIT_VAR(content); - ZVAL_EMPTY_STRING(content); + ZEPHIR_INIT_VAR(&content); + ZVAL_EMPTY_STRING(&content); } - zephir_update_property_this(getThis(), SL("_content"), content TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_content"), &content); RETURN_THIS(); } @@ -917,7 +1043,8 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, setContent) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, getContent) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_content"); @@ -930,7 +1057,8 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, getContent) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, getActiveRenderPath) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_activeRenderPath"); @@ -945,25 +1073,29 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, getActiveRenderPath) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, __set) { - zval *key_param = NULL, *value; - zval *key = NULL; + zval *key_param = NULL, *value, value_sub; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &value); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - zephir_update_property_array(this_ptr, SL("_viewParams"), key, value TSRMLS_CC); + zephir_update_property_array(this_ptr, SL("_viewParams"), &key, value TSRMLS_CC); ZEPHIR_MM_RESTORE(); } @@ -977,27 +1109,32 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, __set) { */ PHP_METHOD(Phalcon_Mvc_View_Simple, __get) { - zval *key_param = NULL, *value = NULL, *_0; - zval *key = NULL; + zval *key_param = NULL, value, _0; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_viewParams"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&value, _0, key, 1 TSRMLS_CC)) { - RETURN_CTOR(value); + zephir_read_property(&_0, this_ptr, SL("_viewParams"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&value, &_0, &key, 1 TSRMLS_CC)) { + RETURN_CTOR(&value); } RETURN_MM_NULL(); diff --git a/ext/phalcon/mvc/view/simple.zep.h b/ext/phalcon/mvc/view/simple.zep.h index 3c2e8f16b2c..83be5107cde 100644 --- a/ext/phalcon/mvc/view/simple.zep.h +++ b/ext/phalcon/mvc/view/simple.zep.h @@ -28,12 +28,30 @@ PHP_METHOD(Phalcon_Mvc_View_Simple, getActiveRenderPath); PHP_METHOD(Phalcon_Mvc_View_Simple, __set); PHP_METHOD(Phalcon_Mvc_View_Simple, __get); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_getregisteredengines, 0, 0, IS_ARRAY, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_getregisteredengines, 0, 0, IS_ARRAY, NULL, 1) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple___construct, 0, 0, 0) - ZEND_ARG_ARRAY_INFO(0, options, 1) + ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_setviewsdir, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewsDir, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewsDir) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_getviewsdir, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_getviewsdir, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_registerengines, 0, 0, 1) @@ -41,65 +59,161 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_registerengines, 0, 0, 1) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple__internalrender, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_render, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_render, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_render, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0) +#else ZEND_ARG_INFO(0, path) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_partial, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, partialPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, partialPath) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_setcacheoptions, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_simple_setcacheoptions, 0, 1, Phalcon\\Mvc\\View\\Simple, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_setcacheoptions, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View\\Simple", 0) +#endif ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_cache, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_simple__createcache, 0, 0, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple__createcache, 0, 0, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_simple_getcache, 0, 0, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_getcache, 0, 0, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_simple_cache, 0, 0, Phalcon\\Mvc\\View\\Simple, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_cache, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\View\\Simple", 0) +#endif ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_setparamtoview, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_simple_setparamtoview, 0, 2, Phalcon\\Mvc\\View\\Simple, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_setparamtoview, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\View\\Simple", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_setvars, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_simple_setvars, 0, 1, Phalcon\\Mvc\\View\\Simple, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_setvars, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View\\Simple", 0) +#endif ZEND_ARG_ARRAY_INFO(0, params, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_setvar, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_simple_setvar, 0, 2, Phalcon\\Mvc\\View\\Simple, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_setvar, 0, 2, IS_OBJECT, "Phalcon\\Mvc\\View\\Simple", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_getvar, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_getparamstoview, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_getparamstoview, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple_setcontent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_view_simple_setcontent, 0, 1, Phalcon\\Mvc\\View\\Simple, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_setcontent, 0, 1, IS_OBJECT, "Phalcon\\Mvc\\View\\Simple", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_getcontent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_view_simple_getcontent, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple___set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_view_simple___get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_view_simple_method_entry) { - PHP_ME(Phalcon_Mvc_View_Simple, getRegisteredEngines, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Simple, getRegisteredEngines, arginfo_phalcon_mvc_view_simple_getregisteredengines, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, __construct, arginfo_phalcon_mvc_view_simple___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Mvc_View_Simple, setViewsDir, arginfo_phalcon_mvc_view_simple_setviewsdir, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Simple, getViewsDir, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Simple, getViewsDir, arginfo_phalcon_mvc_view_simple_getviewsdir, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, registerEngines, arginfo_phalcon_mvc_view_simple_registerengines, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, _loadTemplateEngines, NULL, ZEND_ACC_PROTECTED) PHP_ME(Phalcon_Mvc_View_Simple, _internalRender, arginfo_phalcon_mvc_view_simple__internalrender, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL) @@ -107,16 +221,16 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_view_simple_method_entry) { PHP_ME(Phalcon_Mvc_View_Simple, partial, arginfo_phalcon_mvc_view_simple_partial, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, setCacheOptions, arginfo_phalcon_mvc_view_simple_setcacheoptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, getCacheOptions, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Simple, _createCache, NULL, ZEND_ACC_PROTECTED) - PHP_ME(Phalcon_Mvc_View_Simple, getCache, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Simple, _createCache, arginfo_phalcon_mvc_view_simple__createcache, ZEND_ACC_PROTECTED) + PHP_ME(Phalcon_Mvc_View_Simple, getCache, arginfo_phalcon_mvc_view_simple_getcache, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, cache, arginfo_phalcon_mvc_view_simple_cache, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, setParamToView, arginfo_phalcon_mvc_view_simple_setparamtoview, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, setVars, arginfo_phalcon_mvc_view_simple_setvars, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, setVar, arginfo_phalcon_mvc_view_simple_setvar, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, getVar, arginfo_phalcon_mvc_view_simple_getvar, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Simple, getParamsToView, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Simple, getParamsToView, arginfo_phalcon_mvc_view_simple_getparamstoview, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, setContent, arginfo_phalcon_mvc_view_simple_setcontent, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Mvc_View_Simple, getContent, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Mvc_View_Simple, getContent, arginfo_phalcon_mvc_view_simple_getcontent, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, getActiveRenderPath, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, __set, arginfo_phalcon_mvc_view_simple___set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Mvc_View_Simple, __get, arginfo_phalcon_mvc_view_simple___get, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/mvc/viewbaseinterface.zep.h b/ext/phalcon/mvc/viewbaseinterface.zep.h index 016281b0806..77a99d850ea 100644 --- a/ext/phalcon/mvc/viewbaseinterface.zep.h +++ b/ext/phalcon/mvc/viewbaseinterface.zep.h @@ -4,29 +4,70 @@ extern zend_class_entry *phalcon_mvc_viewbaseinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_ViewBaseInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_setviewsdir, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewsDir, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewsDir) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_setparamtoview, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_setvar, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_getparamstoview, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_getparamstoview, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_getcache, 0, 0, Phalcon\\Cache\\BackendInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_getcache, 0, 0, IS_OBJECT, "Phalcon\\Cache\\BackendInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_cache, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_setcontent, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) +#else ZEND_ARG_INFO(0, content) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_getcontent, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_getcontent, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewbaseinterface_partial, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, partialPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, partialPath) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() @@ -35,11 +76,11 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_viewbaseinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, getViewsDir, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, setParamToView, arginfo_phalcon_mvc_viewbaseinterface_setparamtoview) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, setVar, arginfo_phalcon_mvc_viewbaseinterface_setvar) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, getParamsToView, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, getCache, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, getParamsToView, arginfo_phalcon_mvc_viewbaseinterface_getparamstoview) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, getCache, arginfo_phalcon_mvc_viewbaseinterface_getcache) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, cache, arginfo_phalcon_mvc_viewbaseinterface_cache) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, setContent, arginfo_phalcon_mvc_viewbaseinterface_setcontent) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, getContent, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, getContent, arginfo_phalcon_mvc_viewbaseinterface_getcontent) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewBaseInterface, partial, arginfo_phalcon_mvc_viewbaseinterface_partial) PHP_FE_END }; diff --git a/ext/phalcon/mvc/viewinterface.zep.h b/ext/phalcon/mvc/viewinterface.zep.h index 266ecc2ace9..42be544959a 100644 --- a/ext/phalcon/mvc/viewinterface.zep.h +++ b/ext/phalcon/mvc/viewinterface.zep.h @@ -4,27 +4,86 @@ extern zend_class_entry *phalcon_mvc_viewinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Mvc_ViewInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_setlayoutsdir, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, layoutsDir, IS_STRING, 0) +#else ZEND_ARG_INFO(0, layoutsDir) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getlayoutsdir, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getlayoutsdir, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_setpartialsdir, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, partialsDir, IS_STRING, 0) +#else ZEND_ARG_INFO(0, partialsDir) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getpartialsdir, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getpartialsdir, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_setbasepath, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, basePath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, basePath) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getbasepath, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getbasepath, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_setrenderlevel, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) +#else ZEND_ARG_INFO(0, level) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_setmainview, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, viewPath, IS_STRING, 0) +#else ZEND_ARG_INFO(0, viewPath) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getmainview, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getmainview, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_setlayout, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, layout, IS_STRING, 0) +#else ZEND_ARG_INFO(0, layout) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getlayout, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getlayout, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_settemplatebefore, 0, 0, 1) @@ -35,39 +94,79 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_settemplateafter, 0, 0, ZEND_ARG_INFO(0, templateAfter) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getcontrollername, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getcontrollername, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getactionname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getactionname, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getparams, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_getparams, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_registerengines, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, engines, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_render, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, controllerName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, controllerName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, actionName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, actionName) +#endif ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_mvc_viewinterface_pick, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, renderView, IS_STRING, 0) +#else ZEND_ARG_INFO(0, renderView) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_isdisabled, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_mvc_viewinterface_isdisabled, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_mvc_viewinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, setLayoutsDir, arginfo_phalcon_mvc_viewinterface_setlayoutsdir) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getLayoutsDir, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getLayoutsDir, arginfo_phalcon_mvc_viewinterface_getlayoutsdir) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, setPartialsDir, arginfo_phalcon_mvc_viewinterface_setpartialsdir) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getPartialsDir, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getPartialsDir, arginfo_phalcon_mvc_viewinterface_getpartialsdir) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, setBasePath, arginfo_phalcon_mvc_viewinterface_setbasepath) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getBasePath, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getBasePath, arginfo_phalcon_mvc_viewinterface_getbasepath) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, setRenderLevel, arginfo_phalcon_mvc_viewinterface_setrenderlevel) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, setMainView, arginfo_phalcon_mvc_viewinterface_setmainview) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getMainView, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getMainView, arginfo_phalcon_mvc_viewinterface_getmainview) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, setLayout, arginfo_phalcon_mvc_viewinterface_setlayout) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getLayout, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getLayout, arginfo_phalcon_mvc_viewinterface_getlayout) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, setTemplateBefore, arginfo_phalcon_mvc_viewinterface_settemplatebefore) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, cleanTemplateBefore, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, setTemplateAfter, arginfo_phalcon_mvc_viewinterface_settemplateafter) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, cleanTemplateAfter, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getControllerName, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getActionName, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getParams, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getControllerName, arginfo_phalcon_mvc_viewinterface_getcontrollername) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getActionName, arginfo_phalcon_mvc_viewinterface_getactionname) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, getParams, arginfo_phalcon_mvc_viewinterface_getparams) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, start, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, registerEngines, arginfo_phalcon_mvc_viewinterface_registerengines) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, render, arginfo_phalcon_mvc_viewinterface_render) @@ -77,6 +176,6 @@ ZEPHIR_INIT_FUNCS(phalcon_mvc_viewinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, disable, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, enable, NULL) PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, reset, NULL) - PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, isDisabled, NULL) + PHP_ABSTRACT_ME(Phalcon_Mvc_ViewInterface, isDisabled, arginfo_phalcon_mvc_viewinterface_isdisabled) PHP_FE_END }; diff --git a/ext/phalcon/paginator/adapter.zep.c b/ext/phalcon/paginator/adapter.zep.c index 1738a68992b..d949848080b 100644 --- a/ext/phalcon/paginator/adapter.zep.c +++ b/ext/phalcon/paginator/adapter.zep.c @@ -44,7 +44,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Paginator_Adapter) { */ PHP_METHOD(Phalcon_Paginator_Adapter, getLimit) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_limitRows"); @@ -55,8 +56,11 @@ PHP_METHOD(Phalcon_Paginator_Adapter, getLimit) { */ PHP_METHOD(Phalcon_Paginator_Adapter, setCurrentPage) { - zval *page_param = NULL, *_0; + zval *page_param = NULL, _0; zend_long page; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &page_param); @@ -64,8 +68,8 @@ PHP_METHOD(Phalcon_Paginator_Adapter, setCurrentPage) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, page); - zephir_update_property_this(getThis(), SL("_page"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, page); + zephir_update_property_zval(this_ptr, SL("_page"), &_0); RETURN_THISW(); } @@ -75,8 +79,11 @@ PHP_METHOD(Phalcon_Paginator_Adapter, setCurrentPage) { */ PHP_METHOD(Phalcon_Paginator_Adapter, setLimit) { - zval *limitRows_param = NULL, *_0; + zval *limitRows_param = NULL, _0; zend_long limitRows; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &limitRows_param); @@ -84,8 +91,8 @@ PHP_METHOD(Phalcon_Paginator_Adapter, setLimit) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, limitRows); - zephir_update_property_this(getThis(), SL("_limitRows"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, limitRows); + zephir_update_property_zval(this_ptr, SL("_limitRows"), &_0); RETURN_THISW(); } diff --git a/ext/phalcon/paginator/adapter.zep.h b/ext/phalcon/paginator/adapter.zep.h index 9283d3027bf..0089d14f355 100644 --- a/ext/phalcon/paginator/adapter.zep.h +++ b/ext/phalcon/paginator/adapter.zep.h @@ -7,16 +7,39 @@ PHP_METHOD(Phalcon_Paginator_Adapter, getLimit); PHP_METHOD(Phalcon_Paginator_Adapter, setCurrentPage); PHP_METHOD(Phalcon_Paginator_Adapter, setLimit); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_paginator_adapter_setcurrentpage, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_getlimit, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_getlimit, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_setcurrentpage, 0, 1, Phalcon\\Paginator\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_setcurrentpage, 0, 1, IS_OBJECT, "Phalcon\\Paginator\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, page, IS_LONG, 0) +#else ZEND_ARG_INFO(0, page) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_paginator_adapter_setlimit, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_setlimit, 0, 1, Phalcon\\Paginator\\Adapter, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_setlimit, 0, 1, IS_OBJECT, "Phalcon\\Paginator\\Adapter", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, limitRows, IS_LONG, 0) +#else ZEND_ARG_INFO(0, limitRows) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_paginator_adapter_method_entry) { - PHP_ME(Phalcon_Paginator_Adapter, getLimit, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Paginator_Adapter, getLimit, arginfo_phalcon_paginator_adapter_getlimit, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Paginator_Adapter, setCurrentPage, arginfo_phalcon_paginator_adapter_setcurrentpage, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Paginator_Adapter, setLimit, arginfo_phalcon_paginator_adapter_setlimit, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/paginator/adapter/model.zep.c b/ext/phalcon/paginator/adapter/model.zep.c index 4952eb0be4b..39a3622ae14 100644 --- a/ext/phalcon/paginator/adapter/model.zep.c +++ b/ext/phalcon/paginator/adapter/model.zep.c @@ -58,21 +58,28 @@ ZEPHIR_INIT_CLASS(Phalcon_Paginator_Adapter_Model) { */ PHP_METHOD(Phalcon_Paginator_Adapter_Model, __construct) { - zval *config_param = NULL, *page = NULL, *limit = NULL; - zval *config = NULL; + zval *config_param = NULL, page, limit; + zval config; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &config_param); + ZVAL_UNDEF(&config); + ZVAL_UNDEF(&page); + ZVAL_UNDEF(&limit); - config = config_param; + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &config_param); + + ZEPHIR_OBS_COPY_OR_DUP(&config, config_param); - zephir_update_property_this(getThis(), SL("_config"), config TSRMLS_CC); - if (zephir_array_isset_string_fetch(&limit, config, SS("limit"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_limitRows"), limit TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_config"), &config); + if (zephir_array_isset_string_fetch(&limit, &config, SL("limit"), 1)) { + zephir_update_property_zval(this_ptr, SL("_limitRows"), &limit); } - if (zephir_array_isset_string_fetch(&page, config, SS("page"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_page"), page TSRMLS_CC); + if (zephir_array_isset_string_fetch(&page, &config, SL("page"), 1)) { + zephir_update_property_zval(this_ptr, SL("_page"), &page); } + ZEPHIR_MM_RESTORE(); } @@ -84,6 +91,8 @@ PHP_METHOD(Phalcon_Paginator_Adapter_Model, __construct) { PHP_METHOD(Phalcon_Paginator_Adapter_Model, getPaginate) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -98,23 +107,36 @@ PHP_METHOD(Phalcon_Paginator_Adapter_Model, getPaginate) { */ PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate) { - zval *config = NULL, *items = NULL, *pageItems = NULL, *page = NULL, *_0, *_1, *_8, *_2$$9, *_3$$10, *_4$$8 = NULL, *_5$$11 = NULL; + zval config, items, pageItems, page, _0, _1, _8, _2$$9, _3$$10, _4$$8, _5$$11; zephir_fcall_cache_entry *_6 = NULL, *_7 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, pageNumber = 0, show = 0, n = 0, start = 0, lastShowPage = 0, i = 0, next = 0, totalPages = 0, previous = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config); + ZVAL_UNDEF(&items); + ZVAL_UNDEF(&pageItems); + ZVAL_UNDEF(&page); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_2$$9); + ZVAL_UNDEF(&_3$$10); + ZVAL_UNDEF(&_4$$8); + ZVAL_UNDEF(&_5$$11); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_limitRows"), PH_NOISY_CC); - show = zephir_get_intval(_0); - ZEPHIR_OBS_VAR(config); - zephir_read_property_this(&config, this_ptr, SL("_config"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(items); - zephir_array_fetch_string(&items, config, SL("data"), PH_NOISY, "phalcon/paginator/adapter/model.zep", 92 TSRMLS_CC); - ZEPHIR_OBS_VAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_page"), PH_NOISY_CC); - pageNumber = zephir_get_intval(_1); - if (Z_TYPE_P(items) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_limitRows"), PH_NOISY_CC); + show = zephir_get_intval(&_0); + ZEPHIR_OBS_VAR(&config); + zephir_read_property(&config, this_ptr, SL("_config"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&items); + zephir_array_fetch_string(&items, &config, SL("data"), PH_NOISY, "phalcon/paginator/adapter/model.zep", 92 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_page"), PH_NOISY_CC); + pageNumber = zephir_get_intval(&_1); + if (Z_TYPE_P(&items) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Invalid data for paginator", "phalcon/paginator/adapter/model.zep", 96); return; } @@ -125,11 +147,11 @@ PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "The start page number is zero or less", "phalcon/paginator/adapter/model.zep", 106); return; } - n = zephir_fast_count_int(items TSRMLS_CC); + n = zephir_fast_count_int(&items TSRMLS_CC); lastShowPage = (pageNumber - 1); start = (show * lastShowPage); - ZEPHIR_INIT_VAR(pageItems); - array_init(pageItems); + ZEPHIR_INIT_VAR(&pageItems); + array_init(&pageItems); if (zephir_safe_mod_long_long(n, show TSRMLS_CC) != 0) { totalPages = (int) ((zephir_safe_div_long_long(n, show TSRMLS_CC) + (double) (1))); } else { @@ -137,32 +159,30 @@ PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate) { } if (n > 0) { if (start <= n) { - ZEPHIR_INIT_VAR(_2$$9); - ZVAL_LONG(_2$$9, start); - ZEPHIR_CALL_METHOD(NULL, items, "seek", NULL, 0, _2$$9); + ZVAL_LONG(&_2$$9, start); + ZEPHIR_CALL_METHOD(NULL, &items, "seek", NULL, 0, &_2$$9); zephir_check_call_status(); } else { - ZEPHIR_INIT_VAR(_3$$10); - ZVAL_LONG(_3$$10, 0); - ZEPHIR_CALL_METHOD(NULL, items, "seek", NULL, 0, _3$$10); + ZVAL_LONG(&_3$$10, 0); + ZEPHIR_CALL_METHOD(NULL, &items, "seek", NULL, 0, &_3$$10); zephir_check_call_status(); pageNumber = 1; } i = 1; while (1) { - ZEPHIR_CALL_METHOD(&_4$$8, items, "valid", NULL, 0); + ZEPHIR_CALL_METHOD(&_4$$8, &items, "valid", NULL, 0); zephir_check_call_status(); - if (!(zephir_is_true(_4$$8))) { + if (!(zephir_is_true(&_4$$8))) { break; } - ZEPHIR_CALL_METHOD(&_5$$11, items, "current", &_6, 0); + ZEPHIR_CALL_METHOD(&_5$$11, &items, "current", &_6, 0); zephir_check_call_status(); - zephir_array_append(&pageItems, _5$$11, PH_SEPARATE, "phalcon/paginator/adapter/model.zep", 133); + zephir_array_append(&pageItems, &_5$$11, PH_SEPARATE, "phalcon/paginator/adapter/model.zep", 133); if (i >= show) { break; } i++; - ZEPHIR_CALL_METHOD(NULL, items, "next", &_7, 0); + ZEPHIR_CALL_METHOD(NULL, &items, "next", &_7, 0); zephir_check_call_status(); } } @@ -175,36 +195,36 @@ PHP_METHOD(Phalcon_Paginator_Adapter_Model, paginate) { } else { previous = 1; } - ZEPHIR_INIT_VAR(page); - object_init(page); - zephir_update_property_zval(page, SL("items"), pageItems TSRMLS_CC); + ZEPHIR_INIT_VAR(&page); + object_init(&page); + zephir_update_property_zval(&page, SL("items"), &pageItems); ZEPHIR_INIT_ZVAL_NREF(_8); - ZVAL_LONG(_8, 1); - zephir_update_property_zval(page, SL("first"), _8 TSRMLS_CC); + ZVAL_LONG(&_8, 1); + zephir_update_property_zval(&page, SL("first"), &_8); ZEPHIR_INIT_ZVAL_NREF(_8); - ZVAL_LONG(_8, previous); - zephir_update_property_zval(page, SL("before"), _8 TSRMLS_CC); + ZVAL_LONG(&_8, previous); + zephir_update_property_zval(&page, SL("before"), &_8); ZEPHIR_INIT_ZVAL_NREF(_8); - ZVAL_LONG(_8, previous); - zephir_update_property_zval(page, SL("previous"), _8 TSRMLS_CC); + ZVAL_LONG(&_8, previous); + zephir_update_property_zval(&page, SL("previous"), &_8); ZEPHIR_INIT_ZVAL_NREF(_8); - ZVAL_LONG(_8, pageNumber); - zephir_update_property_zval(page, SL("current"), _8 TSRMLS_CC); + ZVAL_LONG(&_8, pageNumber); + zephir_update_property_zval(&page, SL("current"), &_8); ZEPHIR_INIT_ZVAL_NREF(_8); - ZVAL_LONG(_8, totalPages); - zephir_update_property_zval(page, SL("last"), _8 TSRMLS_CC); + ZVAL_LONG(&_8, totalPages); + zephir_update_property_zval(&page, SL("last"), &_8); ZEPHIR_INIT_ZVAL_NREF(_8); - ZVAL_LONG(_8, next); - zephir_update_property_zval(page, SL("next"), _8 TSRMLS_CC); + ZVAL_LONG(&_8, next); + zephir_update_property_zval(&page, SL("next"), &_8); ZEPHIR_INIT_ZVAL_NREF(_8); - ZVAL_LONG(_8, totalPages); - zephir_update_property_zval(page, SL("total_pages"), _8 TSRMLS_CC); + ZVAL_LONG(&_8, totalPages); + zephir_update_property_zval(&page, SL("total_pages"), &_8); ZEPHIR_INIT_ZVAL_NREF(_8); - ZVAL_LONG(_8, n); - zephir_update_property_zval(page, SL("total_items"), _8 TSRMLS_CC); - _8 = zephir_fetch_nproperty_this(this_ptr, SL("_limitRows"), PH_NOISY_CC); - zephir_update_property_zval(page, SL("limit"), _8 TSRMLS_CC); - RETURN_CCTOR(page); + ZVAL_LONG(&_8, n); + zephir_update_property_zval(&page, SL("total_items"), &_8); + zephir_read_property(&_8, this_ptr, SL("_limitRows"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(&page, SL("limit"), &_8); + RETURN_CCTOR(&page); } diff --git a/ext/phalcon/paginator/adapter/model.zep.h b/ext/phalcon/paginator/adapter/model.zep.h index 8b5efe96d10..4f1f19de8ed 100644 --- a/ext/phalcon/paginator/adapter/model.zep.h +++ b/ext/phalcon/paginator/adapter/model.zep.h @@ -11,9 +11,23 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_paginator_adapter_model___construct, 0, 0 ZEND_ARG_ARRAY_INFO(0, config, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_model_getpaginate, 0, 0, stdClass, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_model_getpaginate, 0, 0, IS_OBJECT, "stdClass", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_model_paginate, 0, 0, stdClass, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_model_paginate, 0, 0, IS_OBJECT, "stdClass", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_paginator_adapter_model_method_entry) { PHP_ME(Phalcon_Paginator_Adapter_Model, __construct, arginfo_phalcon_paginator_adapter_model___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Paginator_Adapter_Model, getPaginate, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Paginator_Adapter_Model, paginate, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Paginator_Adapter_Model, getPaginate, arginfo_phalcon_paginator_adapter_model_getpaginate, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Paginator_Adapter_Model, paginate, arginfo_phalcon_paginator_adapter_model_paginate, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/paginator/adapter/nativearray.zep.c b/ext/phalcon/paginator/adapter/nativearray.zep.c index 0caa1e92c50..48bcda30971 100644 --- a/ext/phalcon/paginator/adapter/nativearray.zep.c +++ b/ext/phalcon/paginator/adapter/nativearray.zep.c @@ -61,21 +61,26 @@ ZEPHIR_INIT_CLASS(Phalcon_Paginator_Adapter_NativeArray) { */ PHP_METHOD(Phalcon_Paginator_Adapter_NativeArray, __construct) { - zval *config_param = NULL, *page = NULL, *limit = NULL; - zval *config = NULL; + zval *config_param = NULL, page, limit; + zval config; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config); + ZVAL_UNDEF(&page); + ZVAL_UNDEF(&limit); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config_param); - zephir_get_arrval(config, config_param); + zephir_get_arrval(&config, config_param); - zephir_update_property_this(getThis(), SL("_config"), config TSRMLS_CC); - if (zephir_array_isset_string_fetch(&limit, config, SS("limit"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_limitRows"), limit TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_config"), &config); + if (zephir_array_isset_string_fetch(&limit, &config, SL("limit"), 1)) { + zephir_update_property_zval(this_ptr, SL("_limitRows"), &limit); } - if (zephir_array_isset_string_fetch(&page, config, SS("page"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_page"), page TSRMLS_CC); + if (zephir_array_isset_string_fetch(&page, &config, SL("page"), 1)) { + zephir_update_property_zval(this_ptr, SL("_page"), &page); } ZEPHIR_MM_RESTORE(); @@ -89,6 +94,8 @@ PHP_METHOD(Phalcon_Paginator_Adapter_NativeArray, __construct) { PHP_METHOD(Phalcon_Paginator_Adapter_NativeArray, getPaginate) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -104,45 +111,53 @@ PHP_METHOD(Phalcon_Paginator_Adapter_NativeArray, getPaginate) { PHP_METHOD(Phalcon_Paginator_Adapter_NativeArray, paginate) { double roundedTotal = 0; - zval *config = NULL, *items = NULL, *page = NULL, *_0, *_1, _2 = zval_used_for_init, *_3 = NULL, _4, *_5 = NULL, *_6; + zval config, items, page, _0, _1, _2, _3, _4, _5; zend_long ZEPHIR_LAST_CALL_STATUS, show = 0, pageNumber = 0, totalPages = 0, number = 0, previous = 0, next = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config); + ZVAL_UNDEF(&items); + ZVAL_UNDEF(&page); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(config); - zephir_read_property_this(&config, this_ptr, SL("_config"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(items); - zephir_array_fetch_string(&items, config, SL("data"), PH_NOISY, "phalcon/paginator/adapter/nativearray.zep", 97 TSRMLS_CC); - if (Z_TYPE_P(items) != IS_ARRAY) { + ZEPHIR_OBS_VAR(&config); + zephir_read_property(&config, this_ptr, SL("_config"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&items); + zephir_array_fetch_string(&items, &config, SL("data"), PH_NOISY, "phalcon/paginator/adapter/nativearray.zep", 97 TSRMLS_CC); + if (Z_TYPE_P(&items) != IS_ARRAY) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Invalid data for paginator", "phalcon/paginator/adapter/nativearray.zep", 100); return; } - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_limitRows"), PH_NOISY_CC); - show = zephir_get_intval(_0); - ZEPHIR_OBS_VAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_page"), PH_NOISY_CC); - pageNumber = zephir_get_intval(_1); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_limitRows"), PH_NOISY_CC); + show = zephir_get_intval(&_0); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_page"), PH_NOISY_CC); + pageNumber = zephir_get_intval(&_1); if (pageNumber <= 0) { pageNumber = 1; } - number = zephir_fast_count_int(items TSRMLS_CC); - ZEPHIR_SINIT_VAR(_2); + number = zephir_fast_count_int(&items TSRMLS_CC); ZVAL_LONG(&_2, show); - ZEPHIR_CALL_FUNCTION(&_3, "floatval", NULL, 335, &_2); + ZEPHIR_CALL_FUNCTION(&_3, "floatval", NULL, 295, &_2); zephir_check_call_status(); - roundedTotal = zephir_safe_div_long_zval(number, _3 TSRMLS_CC); + roundedTotal = zephir_safe_div_long_zval(number, &_3 TSRMLS_CC); totalPages = (int) (roundedTotal); if (totalPages != roundedTotal) { totalPages++; } - ZEPHIR_SINIT_NVAR(_2); ZVAL_LONG(&_2, (show * ((pageNumber - 1)))); - ZEPHIR_SINIT_VAR(_4); ZVAL_LONG(&_4, show); - ZEPHIR_CALL_FUNCTION(&_5, "array_slice", NULL, 411, items, &_2, &_4); + ZEPHIR_CALL_FUNCTION(&_5, "array_slice", NULL, 365, &items, &_2, &_4); zephir_check_call_status(); - ZEPHIR_CPY_WRT(items, _5); + ZEPHIR_CPY_WRT(&items, &_5); if (pageNumber < totalPages) { next = (pageNumber + 1); } else { @@ -153,36 +168,36 @@ PHP_METHOD(Phalcon_Paginator_Adapter_NativeArray, paginate) { } else { previous = 1; } - ZEPHIR_INIT_VAR(page); - object_init(page); - zephir_update_property_zval(page, SL("items"), items TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_6); - ZVAL_LONG(_6, 1); - zephir_update_property_zval(page, SL("first"), _6 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_6); - ZVAL_LONG(_6, previous); - zephir_update_property_zval(page, SL("before"), _6 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_6); - ZVAL_LONG(_6, previous); - zephir_update_property_zval(page, SL("previous"), _6 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_6); - ZVAL_LONG(_6, pageNumber); - zephir_update_property_zval(page, SL("current"), _6 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_6); - ZVAL_LONG(_6, totalPages); - zephir_update_property_zval(page, SL("last"), _6 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_6); - ZVAL_LONG(_6, next); - zephir_update_property_zval(page, SL("next"), _6 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_6); - ZVAL_LONG(_6, totalPages); - zephir_update_property_zval(page, SL("total_pages"), _6 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_6); - ZVAL_LONG(_6, number); - zephir_update_property_zval(page, SL("total_items"), _6 TSRMLS_CC); - _6 = zephir_fetch_nproperty_this(this_ptr, SL("_limitRows"), PH_NOISY_CC); - zephir_update_property_zval(page, SL("limit"), _6 TSRMLS_CC); - RETURN_CCTOR(page); + ZEPHIR_INIT_VAR(&page); + object_init(&page); + zephir_update_property_zval(&page, SL("items"), &items); + ZEPHIR_INIT_ZVAL_NREF(_2); + ZVAL_LONG(&_2, 1); + zephir_update_property_zval(&page, SL("first"), &_2); + ZEPHIR_INIT_ZVAL_NREF(_2); + ZVAL_LONG(&_2, previous); + zephir_update_property_zval(&page, SL("before"), &_2); + ZEPHIR_INIT_ZVAL_NREF(_2); + ZVAL_LONG(&_2, previous); + zephir_update_property_zval(&page, SL("previous"), &_2); + ZEPHIR_INIT_ZVAL_NREF(_2); + ZVAL_LONG(&_2, pageNumber); + zephir_update_property_zval(&page, SL("current"), &_2); + ZEPHIR_INIT_ZVAL_NREF(_2); + ZVAL_LONG(&_2, totalPages); + zephir_update_property_zval(&page, SL("last"), &_2); + ZEPHIR_INIT_ZVAL_NREF(_2); + ZVAL_LONG(&_2, next); + zephir_update_property_zval(&page, SL("next"), &_2); + ZEPHIR_INIT_ZVAL_NREF(_2); + ZVAL_LONG(&_2, totalPages); + zephir_update_property_zval(&page, SL("total_pages"), &_2); + ZEPHIR_INIT_ZVAL_NREF(_2); + ZVAL_LONG(&_2, number); + zephir_update_property_zval(&page, SL("total_items"), &_2); + zephir_read_property(&_2, this_ptr, SL("_limitRows"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(&page, SL("limit"), &_2); + RETURN_CCTOR(&page); } diff --git a/ext/phalcon/paginator/adapter/nativearray.zep.h b/ext/phalcon/paginator/adapter/nativearray.zep.h index 0cec54035bd..00d3250a81f 100644 --- a/ext/phalcon/paginator/adapter/nativearray.zep.h +++ b/ext/phalcon/paginator/adapter/nativearray.zep.h @@ -11,9 +11,23 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_paginator_adapter_nativearray___construct ZEND_ARG_ARRAY_INFO(0, config, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_nativearray_getpaginate, 0, 0, stdClass, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_nativearray_getpaginate, 0, 0, IS_OBJECT, "stdClass", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_nativearray_paginate, 0, 0, stdClass, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_nativearray_paginate, 0, 0, IS_OBJECT, "stdClass", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_paginator_adapter_nativearray_method_entry) { PHP_ME(Phalcon_Paginator_Adapter_NativeArray, __construct, arginfo_phalcon_paginator_adapter_nativearray___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Paginator_Adapter_NativeArray, getPaginate, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Paginator_Adapter_NativeArray, paginate, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Paginator_Adapter_NativeArray, getPaginate, arginfo_phalcon_paginator_adapter_nativearray_getpaginate, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Paginator_Adapter_NativeArray, paginate, arginfo_phalcon_paginator_adapter_nativearray_paginate, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/paginator/adapter/querybuilder.zep.c b/ext/phalcon/paginator/adapter/querybuilder.zep.c index 0e11e8c55f7..8c40bc00333 100644 --- a/ext/phalcon/paginator/adapter/querybuilder.zep.c +++ b/ext/phalcon/paginator/adapter/querybuilder.zep.c @@ -74,37 +74,44 @@ ZEPHIR_INIT_CLASS(Phalcon_Paginator_Adapter_QueryBuilder) { PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config_param = NULL, *builder = NULL, *limit = NULL, *page = NULL, *columns = NULL; - zval *config = NULL; + zval *config_param = NULL, builder, limit, page, columns; + zval config; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config); + ZVAL_UNDEF(&builder); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&page); + ZVAL_UNDEF(&columns); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config_param); - zephir_get_arrval(config, config_param); + zephir_get_arrval(&config, config_param); - zephir_update_property_this(getThis(), SL("_config"), config TSRMLS_CC); - ZEPHIR_OBS_VAR(builder); - if (!(zephir_array_isset_string_fetch(&builder, config, SS("builder"), 0 TSRMLS_CC))) { + zephir_update_property_zval(this_ptr, SL("_config"), &config); + ZEPHIR_OBS_VAR(&builder); + if (!(zephir_array_isset_string_fetch(&builder, &config, SL("builder"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Parameter 'builder' is required", "phalcon/paginator/adapter/querybuilder.zep", 76); return; } - ZEPHIR_OBS_VAR(limit); - if (!(zephir_array_isset_string_fetch(&limit, config, SS("limit"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&limit); + if (!(zephir_array_isset_string_fetch(&limit, &config, SL("limit"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "Parameter 'limit' is required", "phalcon/paginator/adapter/querybuilder.zep", 80); return; } - ZEPHIR_OBS_VAR(columns); - if (zephir_array_isset_string_fetch(&columns, config, SS("columns"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_columns"), columns TSRMLS_CC); + ZEPHIR_OBS_VAR(&columns); + if (zephir_array_isset_string_fetch(&columns, &config, SL("columns"), 0)) { + zephir_update_property_zval(this_ptr, SL("_columns"), &columns); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setquerybuilder", NULL, 0, builder); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setquerybuilder", NULL, 0, &builder); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setlimit", NULL, 0, limit); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setlimit", NULL, 0, &limit); zephir_check_call_status(); - ZEPHIR_OBS_VAR(page); - if (zephir_array_isset_string_fetch(&page, config, SS("page"), 0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcurrentpage", NULL, 0, page); + ZEPHIR_OBS_VAR(&page); + if (zephir_array_isset_string_fetch(&page, &config, SL("page"), 0)) { + ZEPHIR_CALL_METHOD(NULL, this_ptr, "setcurrentpage", NULL, 0, &page); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -116,7 +123,8 @@ PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, __construct) { */ PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, getCurrentPage) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_page"); @@ -127,13 +135,16 @@ PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, getCurrentPage) { */ PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, setQueryBuilder) { - zval *builder; + zval *builder, builder_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&builder_sub); zephir_fetch_params(0, 1, 0, &builder); - zephir_update_property_this(getThis(), SL("_builder"), builder TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_builder"), builder); RETURN_THISW(); } @@ -143,7 +154,8 @@ PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, setQueryBuilder) { */ PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, getQueryBuilder) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_builder"); @@ -157,6 +169,8 @@ PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, getQueryBuilder) { PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, getPaginate) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); @@ -172,205 +186,245 @@ PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, getPaginate) { PHP_METHOD(Phalcon_Paginator_Adapter_QueryBuilder, paginate) { zend_class_entry *_14$$16; - zval *_6$$14, *_8$$15; + zval _6$$14, _8$$15; zend_bool hasHaving = 0, hasGroup = 0, _2; - zval *originalBuilder = NULL, *builder = NULL, *totalBuilder = NULL, *totalPages = NULL, *limit = NULL, *number = NULL, *query = NULL, *page = NULL, *items = NULL, *totalQuery = NULL, *result = NULL, *row = NULL, *rowcount = NULL, *next = NULL, *sql = NULL, *columns = NULL, *db = NULL, *model = NULL, *modelClass = NULL, *dbService = NULL, *_0, *_1 = NULL, *groups = NULL, *_10, *_26, *_3$$10, *groupColumn$$11 = NULL, *_4$$14 = NULL, *_5$$14, *_7$$14, *_9$$15, *_11$$17 = NULL, *_12$$17, *_13$$16 = NULL, *_15$$16 = NULL, *_16$$16, *_17$$16, *_18$$16, *_19$$16, *_20$$16, _21$$16, _22$$16, *_23$$18, _24$$18, _25$$18; + zval originalBuilder, builder, totalBuilder, totalPages, limit, number, query, page, items, totalQuery, result, row, rowcount, next, sql, columns, db, model, modelClass, dbService, _0, _1, groups, _10, _3$$10, groupColumn$$11, _4$$14, _5$$14, _7$$14, _9$$15, _11$$17, _12$$17, _13$$16, _15$$16, _16$$16, _17$$16, _18$$16, _19$$16, _20$$16, _21$$16, _22$$18, _23$$18, _24$$18; zend_long ZEPHIR_LAST_CALL_STATUS, numberPage = 0, previous = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&originalBuilder); + ZVAL_UNDEF(&builder); + ZVAL_UNDEF(&totalBuilder); + ZVAL_UNDEF(&totalPages); + ZVAL_UNDEF(&limit); + ZVAL_UNDEF(&number); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&page); + ZVAL_UNDEF(&items); + ZVAL_UNDEF(&totalQuery); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&row); + ZVAL_UNDEF(&rowcount); + ZVAL_UNDEF(&next); + ZVAL_UNDEF(&sql); + ZVAL_UNDEF(&columns); + ZVAL_UNDEF(&db); + ZVAL_UNDEF(&model); + ZVAL_UNDEF(&modelClass); + ZVAL_UNDEF(&dbService); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&groups); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_3$$10); + ZVAL_UNDEF(&groupColumn$$11); + ZVAL_UNDEF(&_4$$14); + ZVAL_UNDEF(&_5$$14); + ZVAL_UNDEF(&_7$$14); + ZVAL_UNDEF(&_9$$15); + ZVAL_UNDEF(&_11$$17); + ZVAL_UNDEF(&_12$$17); + ZVAL_UNDEF(&_13$$16); + ZVAL_UNDEF(&_15$$16); + ZVAL_UNDEF(&_16$$16); + ZVAL_UNDEF(&_17$$16); + ZVAL_UNDEF(&_18$$16); + ZVAL_UNDEF(&_19$$16); + ZVAL_UNDEF(&_20$$16); + ZVAL_UNDEF(&_21$$16); + ZVAL_UNDEF(&_22$$18); + ZVAL_UNDEF(&_23$$18); + ZVAL_UNDEF(&_24$$18); + ZVAL_UNDEF(&_6$$14); + ZVAL_UNDEF(&_8$$15); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(originalBuilder); - zephir_read_property_this(&originalBuilder, this_ptr, SL("_builder"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(columns); - zephir_read_property_this(&columns, this_ptr, SL("_columns"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(builder); - if (zephir_clone(builder, originalBuilder TSRMLS_CC) == FAILURE) { + ZEPHIR_OBS_VAR(&originalBuilder); + zephir_read_property(&originalBuilder, this_ptr, SL("_builder"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&columns); + zephir_read_property(&columns, this_ptr, SL("_columns"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&builder); + if (zephir_clone(&builder, &originalBuilder TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_INIT_VAR(totalBuilder); - if (zephir_clone(totalBuilder, builder TSRMLS_CC) == FAILURE) { + ZEPHIR_INIT_VAR(&totalBuilder); + if (zephir_clone(&totalBuilder, &builder TSRMLS_CC) == FAILURE) { RETURN_MM(); } - ZEPHIR_OBS_VAR(limit); - zephir_read_property_this(&limit, this_ptr, SL("_limitRows"), PH_NOISY_CC); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_page"), PH_NOISY_CC); - numberPage = zephir_get_intval(_0); + ZEPHIR_OBS_VAR(&limit); + zephir_read_property(&limit, this_ptr, SL("_limitRows"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_page"), PH_NOISY_CC); + numberPage = zephir_get_intval(&_0); if (!(numberPage)) { numberPage = 1; } - ZEPHIR_INIT_VAR(number); - ZVAL_LONG(number, (zephir_get_numberval(limit) * ((numberPage - 1)))); - if (ZEPHIR_LT(number, limit)) { - ZEPHIR_CALL_METHOD(NULL, builder, "limit", NULL, 0, limit); + ZEPHIR_INIT_VAR(&number); + ZVAL_LONG(&number, (zephir_get_numberval(&limit) * ((numberPage - 1)))); + if (ZEPHIR_LT(&number, &limit)) { + ZEPHIR_CALL_METHOD(NULL, &builder, "limit", NULL, 0, &limit); zephir_check_call_status(); } else { - ZEPHIR_CALL_METHOD(NULL, builder, "limit", NULL, 0, limit, number); + ZEPHIR_CALL_METHOD(NULL, &builder, "limit", NULL, 0, &limit, &number); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&query, builder, "getquery", NULL, 0); + ZEPHIR_CALL_METHOD(&query, &builder, "getquery", NULL, 0); zephir_check_call_status(); if (numberPage == 1) { previous = 1; } else { previous = (numberPage - 1); } - ZEPHIR_CALL_METHOD(&items, query, "execute", NULL, 0); + ZEPHIR_CALL_METHOD(&items, &query, "execute", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_1, totalBuilder, "gethaving", NULL, 0); + ZEPHIR_CALL_METHOD(&_1, &totalBuilder, "gethaving", NULL, 0); zephir_check_call_status(); - hasHaving = !(ZEPHIR_IS_EMPTY(_1)); - ZEPHIR_CALL_METHOD(&groups, totalBuilder, "getgroupby", NULL, 0); + hasHaving = !(ZEPHIR_IS_EMPTY(&_1)); + ZEPHIR_CALL_METHOD(&groups, &totalBuilder, "getgroupby", NULL, 0); zephir_check_call_status(); - hasGroup = !(ZEPHIR_IS_EMPTY(groups)); + hasGroup = !(ZEPHIR_IS_EMPTY(&groups)); _2 = hasHaving; if (_2) { _2 = !hasGroup; } if (_2) { - if (ZEPHIR_IS_EMPTY(columns)) { + if (ZEPHIR_IS_EMPTY(&columns)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_paginator_exception_ce, "When having is set there should be columns option provided for which calculate row count", "phalcon/paginator/adapter/querybuilder.zep", 197); return; } - ZEPHIR_CALL_METHOD(NULL, totalBuilder, "columns", NULL, 0, columns); + ZEPHIR_CALL_METHOD(NULL, &totalBuilder, "columns", NULL, 0, &columns); zephir_check_call_status(); } else { - ZEPHIR_INIT_VAR(_3$$10); - ZVAL_STRING(_3$$10, "COUNT(*) [rowcount]", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, totalBuilder, "columns", NULL, 0, _3$$10); - zephir_check_temp_parameter(_3$$10); + ZEPHIR_INIT_VAR(&_3$$10); + ZVAL_STRING(&_3$$10, "COUNT(*) [rowcount]"); + ZEPHIR_CALL_METHOD(NULL, &totalBuilder, "columns", NULL, 0, &_3$$10); zephir_check_call_status(); } if (hasGroup) { - if (Z_TYPE_P(groups) == IS_ARRAY) { - ZEPHIR_INIT_VAR(groupColumn$$11); - zephir_fast_join_str(groupColumn$$11, SL(", "), groups TSRMLS_CC); + if (Z_TYPE_P(&groups) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&groupColumn$$11); + zephir_fast_join_str(&groupColumn$$11, SL(", "), &groups TSRMLS_CC); } else { - ZEPHIR_CPY_WRT(groupColumn$$11, groups); + ZEPHIR_CPY_WRT(&groupColumn$$11, &groups); } if (!(hasHaving)) { - ZEPHIR_INIT_VAR(_5$$14); - ZVAL_NULL(_5$$14); - ZEPHIR_CALL_METHOD(&_4$$14, totalBuilder, "groupby", NULL, 0, _5$$14); + ZVAL_NULL(&_5$$14); + ZEPHIR_CALL_METHOD(&_4$$14, &totalBuilder, "groupby", NULL, 0, &_5$$14); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_6$$14); - zephir_create_array(_6$$14, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_7$$14); - ZEPHIR_CONCAT_SVS(_7$$14, "COUNT(DISTINCT ", groupColumn$$11, ") AS [rowcount]"); - zephir_array_fast_append(_6$$14, _7$$14); - ZEPHIR_CALL_METHOD(NULL, _4$$14, "columns", NULL, 0, _6$$14); + ZEPHIR_INIT_VAR(&_6$$14); + zephir_create_array(&_6$$14, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_7$$14); + ZEPHIR_CONCAT_SVS(&_7$$14, "COUNT(DISTINCT ", &groupColumn$$11, ") AS [rowcount]"); + zephir_array_fast_append(&_6$$14, &_7$$14); + ZEPHIR_CALL_METHOD(NULL, &_4$$14, "columns", NULL, 0, &_6$$14); zephir_check_call_status(); } else { - ZEPHIR_INIT_VAR(_8$$15); - zephir_create_array(_8$$15, 1, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_9$$15); - ZEPHIR_CONCAT_SV(_9$$15, "DISTINCT ", groupColumn$$11); - zephir_array_fast_append(_8$$15, _9$$15); - ZEPHIR_CALL_METHOD(NULL, totalBuilder, "columns", NULL, 0, _8$$15); + ZEPHIR_INIT_VAR(&_8$$15); + zephir_create_array(&_8$$15, 1, 0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_9$$15); + ZEPHIR_CONCAT_SV(&_9$$15, "DISTINCT ", &groupColumn$$11); + zephir_array_fast_append(&_8$$15, &_9$$15); + ZEPHIR_CALL_METHOD(NULL, &totalBuilder, "columns", NULL, 0, &_8$$15); zephir_check_call_status(); } } - ZEPHIR_INIT_VAR(_10); - ZVAL_NULL(_10); - ZEPHIR_CALL_METHOD(NULL, totalBuilder, "orderby", NULL, 0, _10); + ZVAL_NULL(&_10); + ZEPHIR_CALL_METHOD(NULL, &totalBuilder, "orderby", NULL, 0, &_10); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&totalQuery, totalBuilder, "getquery", NULL, 0); + ZEPHIR_CALL_METHOD(&totalQuery, &totalBuilder, "getquery", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(rowcount); + ZEPHIR_INIT_VAR(&rowcount); if (hasHaving) { - ZEPHIR_CALL_METHOD(&sql, totalQuery, "getsql", NULL, 0); + ZEPHIR_CALL_METHOD(&sql, &totalQuery, "getsql", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(modelClass); - zephir_read_property(&modelClass, builder, SL("_models"), PH_NOISY_CC); - if (Z_TYPE_P(modelClass) == IS_ARRAY) { - ZEPHIR_CALL_FUNCTION(&_11$$17, "array_values", NULL, 235, modelClass); + ZEPHIR_OBS_VAR(&modelClass); + zephir_read_property(&modelClass, &builder, SL("_models"), PH_NOISY_CC); + if (Z_TYPE_P(&modelClass) == IS_ARRAY) { + ZEPHIR_CALL_FUNCTION(&_11$$17, "array_values", NULL, 197, &modelClass); zephir_check_call_status(); - zephir_array_fetch_long(&_12$$17, _11$$17, 0, PH_NOISY | PH_READONLY, "phalcon/paginator/adapter/querybuilder.zep", 241 TSRMLS_CC); - ZEPHIR_CPY_WRT(modelClass, _12$$17); + zephir_array_fetch_long(&_12$$17, &_11$$17, 0, PH_NOISY | PH_READONLY, "phalcon/paginator/adapter/querybuilder.zep", 241 TSRMLS_CC); + ZEPHIR_CPY_WRT(&modelClass, &_12$$17); } - ZEPHIR_INIT_VAR(model); - zephir_fetch_safe_class(_13$$16, modelClass); - _14$$16 = zend_fetch_class(Z_STRVAL_P(_13$$16), Z_STRLEN_P(_13$$16), ZEND_FETCH_CLASS_AUTO TSRMLS_CC); - object_init_ex(model, _14$$16); - if (zephir_has_constructor(model TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, model, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&model); + zephir_fetch_safe_class(&_13$$16, &modelClass); + _14$$16 = zephir_fetch_class_str_ex(Z_STRVAL_P(&_13$$16), Z_STRLEN_P(&_13$$16), ZEND_FETCH_CLASS_AUTO); + object_init_ex(&model, _14$$16); + if (zephir_has_constructor(&model TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &model, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(&dbService, model, "getreadconnectionservice", NULL, 0); + ZEPHIR_CALL_METHOD(&dbService, &model, "getreadconnectionservice", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_15$$16, totalBuilder, "getdi", NULL, 0); + ZEPHIR_CALL_METHOD(&_15$$16, &totalBuilder, "getdi", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&db, _15$$16, "get", NULL, 0, dbService); + ZEPHIR_CALL_METHOD(&db, &_15$$16, "get", NULL, 0, &dbService); zephir_check_call_status(); - zephir_array_fetch_string(&_16$$16, sql, SL("sql"), PH_NOISY | PH_READONLY, "phalcon/paginator/adapter/querybuilder.zep", 247 TSRMLS_CC); - ZEPHIR_INIT_VAR(_17$$16); - ZEPHIR_CONCAT_SVS(_17$$16, "SELECT COUNT(*) as \"rowcount\" FROM (", _16$$16, ") as T1"); - zephir_array_fetch_string(&_18$$16, sql, SL("bind"), PH_NOISY | PH_READONLY, "phalcon/paginator/adapter/querybuilder.zep", 247 TSRMLS_CC); - ZEPHIR_INIT_VAR(_19$$16); - ZVAL_LONG(_19$$16, 2); - ZEPHIR_CALL_METHOD(&row, db, "fetchone", NULL, 0, _17$$16, _19$$16, _18$$16); + zephir_array_fetch_string(&_16$$16, &sql, SL("sql"), PH_NOISY | PH_READONLY, "phalcon/paginator/adapter/querybuilder.zep", 247 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_17$$16); + ZEPHIR_CONCAT_SVS(&_17$$16, "SELECT COUNT(*) as \"rowcount\" FROM (", &_16$$16, ") as T1"); + zephir_array_fetch_string(&_18$$16, &sql, SL("bind"), PH_NOISY | PH_READONLY, "phalcon/paginator/adapter/querybuilder.zep", 247 TSRMLS_CC); + ZVAL_LONG(&_19$$16, 2); + ZEPHIR_CALL_METHOD(&row, &db, "fetchone", NULL, 0, &_17$$16, &_19$$16, &_18$$16); zephir_check_call_status(); - if (zephir_is_true(row)) { - zephir_array_fetch_string(&_20$$16, row, SL("rowcount"), PH_NOISY | PH_READONLY, "phalcon/paginator/adapter/querybuilder.zep", 248 TSRMLS_CC); - ZVAL_LONG(rowcount, zephir_get_intval(_20$$16)); + if (zephir_is_true(&row)) { + zephir_array_fetch_string(&_20$$16, &row, SL("rowcount"), PH_NOISY | PH_READONLY, "phalcon/paginator/adapter/querybuilder.zep", 248 TSRMLS_CC); + ZVAL_LONG(&rowcount, zephir_get_intval(&_20$$16)); } else { - ZVAL_LONG(rowcount, 0); + ZVAL_LONG(&rowcount, 0); } ZEPHIR_SINIT_VAR(_21$$16); - div_function(&_21$$16, rowcount, limit TSRMLS_CC); - ZEPHIR_SINIT_VAR(_22$$16); - ZVAL_DOUBLE(&_22$$16, zephir_ceil(&_21$$16 TSRMLS_CC)); - ZEPHIR_INIT_VAR(totalPages); - ZVAL_LONG(totalPages, zephir_get_intval(&_22$$16)); + div_function(&_21$$16, &rowcount, &limit TSRMLS_CC); + ZVAL_DOUBLE(&_19$$16, zephir_ceil(&_21$$16 TSRMLS_CC)); + ZEPHIR_INIT_VAR(&totalPages); + ZVAL_LONG(&totalPages, zephir_get_intval(&_19$$16)); } else { - ZEPHIR_CALL_METHOD(&result, totalQuery, "execute", NULL, 0); + ZEPHIR_CALL_METHOD(&result, &totalQuery, "execute", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&row, result, "getfirst", NULL, 0); + ZEPHIR_CALL_METHOD(&row, &result, "getfirst", NULL, 0); zephir_check_call_status(); - if (zephir_is_true(row)) { - ZEPHIR_OBS_VAR(_23$$18); - zephir_read_property(&_23$$18, row, SL("rowcount"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(rowcount); - ZVAL_LONG(rowcount, zephir_get_intval(_23$$18)); + if (zephir_is_true(&row)) { + zephir_read_property(&_22$$18, &row, SL("rowcount"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_NVAR(&rowcount); + ZVAL_LONG(&rowcount, zephir_get_intval(&_22$$18)); } else { - ZEPHIR_INIT_NVAR(rowcount); - ZVAL_LONG(rowcount, 0); + ZEPHIR_INIT_NVAR(&rowcount); + ZVAL_LONG(&rowcount, 0); } - ZEPHIR_SINIT_VAR(_24$$18); - div_function(&_24$$18, rowcount, limit TSRMLS_CC); - ZEPHIR_SINIT_VAR(_25$$18); - ZVAL_DOUBLE(&_25$$18, zephir_ceil(&_24$$18 TSRMLS_CC)); - ZEPHIR_INIT_NVAR(totalPages); - ZVAL_LONG(totalPages, zephir_get_intval(&_25$$18)); + ZEPHIR_SINIT_VAR(_23$$18); + div_function(&_23$$18, &rowcount, &limit TSRMLS_CC); + ZVAL_DOUBLE(&_24$$18, zephir_ceil(&_23$$18 TSRMLS_CC)); + ZEPHIR_INIT_NVAR(&totalPages); + ZVAL_LONG(&totalPages, zephir_get_intval(&_24$$18)); } - if (ZEPHIR_GT_LONG(totalPages, numberPage)) { - ZEPHIR_INIT_VAR(next); - ZVAL_LONG(next, (numberPage + 1)); + if (ZEPHIR_GT_LONG(&totalPages, numberPage)) { + ZEPHIR_INIT_VAR(&next); + ZVAL_LONG(&next, (numberPage + 1)); } else { - ZEPHIR_CPY_WRT(next, totalPages); + ZEPHIR_CPY_WRT(&next, &totalPages); } - ZEPHIR_INIT_VAR(page); - object_init(page); - zephir_update_property_zval(page, SL("items"), items TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_26); - ZVAL_LONG(_26, 1); - zephir_update_property_zval(page, SL("first"), _26 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_26); - ZVAL_LONG(_26, previous); - zephir_update_property_zval(page, SL("before"), _26 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_26); - ZVAL_LONG(_26, previous); - zephir_update_property_zval(page, SL("previous"), _26 TSRMLS_CC); - ZEPHIR_INIT_ZVAL_NREF(_26); - ZVAL_LONG(_26, numberPage); - zephir_update_property_zval(page, SL("current"), _26 TSRMLS_CC); - zephir_update_property_zval(page, SL("last"), totalPages TSRMLS_CC); - zephir_update_property_zval(page, SL("next"), next TSRMLS_CC); - zephir_update_property_zval(page, SL("total_pages"), totalPages TSRMLS_CC); - zephir_update_property_zval(page, SL("total_items"), rowcount TSRMLS_CC); - _26 = zephir_fetch_nproperty_this(this_ptr, SL("_limitRows"), PH_NOISY_CC); - zephir_update_property_zval(page, SL("limit"), _26 TSRMLS_CC); - RETURN_CCTOR(page); + ZEPHIR_INIT_VAR(&page); + object_init(&page); + zephir_update_property_zval(&page, SL("items"), &items); + ZEPHIR_INIT_ZVAL_NREF(_10); + ZVAL_LONG(&_10, 1); + zephir_update_property_zval(&page, SL("first"), &_10); + ZEPHIR_INIT_ZVAL_NREF(_10); + ZVAL_LONG(&_10, previous); + zephir_update_property_zval(&page, SL("before"), &_10); + ZEPHIR_INIT_ZVAL_NREF(_10); + ZVAL_LONG(&_10, previous); + zephir_update_property_zval(&page, SL("previous"), &_10); + ZEPHIR_INIT_ZVAL_NREF(_10); + ZVAL_LONG(&_10, numberPage); + zephir_update_property_zval(&page, SL("current"), &_10); + zephir_update_property_zval(&page, SL("last"), &totalPages); + zephir_update_property_zval(&page, SL("next"), &next); + zephir_update_property_zval(&page, SL("total_pages"), &totalPages); + zephir_update_property_zval(&page, SL("total_items"), &rowcount); + zephir_read_property(&_10, this_ptr, SL("_limitRows"), PH_NOISY_CC | PH_READONLY); + zephir_update_property_zval(&page, SL("limit"), &_10); + RETURN_CCTOR(&page); } diff --git a/ext/phalcon/paginator/adapter/querybuilder.zep.h b/ext/phalcon/paginator/adapter/querybuilder.zep.h index 3569a71ebe2..855cd2657cb 100644 --- a/ext/phalcon/paginator/adapter/querybuilder.zep.h +++ b/ext/phalcon/paginator/adapter/querybuilder.zep.h @@ -14,16 +14,48 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder___construc ZEND_ARG_ARRAY_INFO(0, config, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_setquerybuilder, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_getcurrentpage, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_getcurrentpage, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_setquerybuilder, 0, 1, Phalcon\\Paginator\\Adapter\\QueryBuilder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_setquerybuilder, 0, 1, IS_OBJECT, "Phalcon\\Paginator\\Adapter\\QueryBuilder", 0) +#endif ZEND_ARG_OBJ_INFO(0, builder, Phalcon\\Mvc\\Model\\Query\\Builder, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_getquerybuilder, 0, 0, Phalcon\\Mvc\\Model\\Query\\Builder, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_getquerybuilder, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\Model\\Query\\Builder", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_getpaginate, 0, 0, stdClass, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_getpaginate, 0, 0, IS_OBJECT, "stdClass", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_paginate, 0, 0, stdClass, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapter_querybuilder_paginate, 0, 0, IS_OBJECT, "stdClass", 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_paginator_adapter_querybuilder_method_entry) { PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, __construct, arginfo_phalcon_paginator_adapter_querybuilder___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, getCurrentPage, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, getCurrentPage, arginfo_phalcon_paginator_adapter_querybuilder_getcurrentpage, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, setQueryBuilder, arginfo_phalcon_paginator_adapter_querybuilder_setquerybuilder, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, getQueryBuilder, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, getPaginate, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, paginate, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, getQueryBuilder, arginfo_phalcon_paginator_adapter_querybuilder_getquerybuilder, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, getPaginate, arginfo_phalcon_paginator_adapter_querybuilder_getpaginate, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Paginator_Adapter_QueryBuilder, paginate, arginfo_phalcon_paginator_adapter_querybuilder_paginate, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/paginator/adapterinterface.zep.h b/ext/phalcon/paginator/adapterinterface.zep.h index 557dff847ca..8132ab0383a 100644 --- a/ext/phalcon/paginator/adapterinterface.zep.h +++ b/ext/phalcon/paginator/adapterinterface.zep.h @@ -4,17 +4,39 @@ extern zend_class_entry *phalcon_paginator_adapterinterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Paginator_AdapterInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_paginator_adapterinterface_setcurrentpage, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, page, IS_LONG, 0) +#else ZEND_ARG_INFO(0, page) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_adapterinterface_getpaginate, 0, 0, stdClass, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapterinterface_getpaginate, 0, 0, IS_OBJECT, "stdClass", 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_paginator_adapterinterface_setlimit, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, limit, IS_LONG, 0) +#else ZEND_ARG_INFO(0, limit) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapterinterface_getlimit, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_adapterinterface_getlimit, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_paginator_adapterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Paginator_AdapterInterface, setCurrentPage, arginfo_phalcon_paginator_adapterinterface_setcurrentpage) - PHP_ABSTRACT_ME(Phalcon_Paginator_AdapterInterface, getPaginate, NULL) + PHP_ABSTRACT_ME(Phalcon_Paginator_AdapterInterface, getPaginate, arginfo_phalcon_paginator_adapterinterface_getpaginate) PHP_ABSTRACT_ME(Phalcon_Paginator_AdapterInterface, setLimit, arginfo_phalcon_paginator_adapterinterface_setlimit) - PHP_ABSTRACT_ME(Phalcon_Paginator_AdapterInterface, getLimit, NULL) + PHP_ABSTRACT_ME(Phalcon_Paginator_AdapterInterface, getLimit, arginfo_phalcon_paginator_adapterinterface_getlimit) PHP_FE_END }; diff --git a/ext/phalcon/paginator/factory.zep.c b/ext/phalcon/paginator/factory.zep.c index 658a51c52e0..ac668e6ce0d 100644 --- a/ext/phalcon/paginator/factory.zep.c +++ b/ext/phalcon/paginator/factory.zep.c @@ -49,17 +49,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Paginator_Factory) { PHP_METHOD(Phalcon_Paginator_Factory, load) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *_0; + zval *config, config_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Phalcon\\Paginator\\Adapter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, _0, config); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Phalcon\\Paginator\\Adapter"); + ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, &_0, config); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/paginator/factory.zep.h b/ext/phalcon/paginator/factory.zep.h index f129940aaa2..b27a12d9328 100644 --- a/ext/phalcon/paginator/factory.zep.h +++ b/ext/phalcon/paginator/factory.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Paginator_Factory); PHP_METHOD(Phalcon_Paginator_Factory, load); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_paginator_factory_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_paginator_factory_load, 0, 1, Phalcon\\Paginator\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_paginator_factory_load, 0, 1, IS_OBJECT, "Phalcon\\Paginator\\AdapterInterface", 0) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/queue/beanstalk.zep.c b/ext/phalcon/queue/beanstalk.zep.c index 822caeae0d6..3a2a0242cff 100644 --- a/ext/phalcon/queue/beanstalk.zep.c +++ b/ext/phalcon/queue/beanstalk.zep.c @@ -66,7 +66,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Queue_Beanstalk) { * * @const integer */ - zend_declare_class_constant_long(phalcon_queue_beanstalk_ce, SL("DEFAULT_DELAY"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_queue_beanstalk_ce, SL("DEFAULT_DELAY"), 0); /** * Jobs with smaller priority values will be scheduled before jobs with larger priorities. @@ -74,7 +74,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Queue_Beanstalk) { * * @const integer */ - zend_declare_class_constant_long(phalcon_queue_beanstalk_ce, SL("DEFAULT_PRIORITY"), 100 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_queue_beanstalk_ce, SL("DEFAULT_PRIORITY"), 100); /** * Time to run - number of seconds to allow a worker to run this job. @@ -82,25 +82,25 @@ ZEPHIR_INIT_CLASS(Phalcon_Queue_Beanstalk) { * * @const integer */ - zend_declare_class_constant_long(phalcon_queue_beanstalk_ce, SL("DEFAULT_TTR"), 86400 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_queue_beanstalk_ce, SL("DEFAULT_TTR"), 86400); /** * Default tube name * @const string */ - zend_declare_class_constant_string(phalcon_queue_beanstalk_ce, SL("DEFAULT_TUBE"), "default" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_queue_beanstalk_ce, SL("DEFAULT_TUBE"), "default"); /** * Default connected host * @const string */ - zend_declare_class_constant_string(phalcon_queue_beanstalk_ce, SL("DEFAULT_HOST"), "127.0.0.1" TSRMLS_CC); + zephir_declare_class_constant_string(phalcon_queue_beanstalk_ce, SL("DEFAULT_HOST"), "127.0.0.1"); /** * Default connected port * @const integer */ - zend_declare_class_constant_long(phalcon_queue_beanstalk_ce, SL("DEFAULT_PORT"), 11300 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_queue_beanstalk_ce, SL("DEFAULT_PORT"), 11300); return SUCCESS; @@ -111,34 +111,40 @@ ZEPHIR_INIT_CLASS(Phalcon_Queue_Beanstalk) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, __construct) { - zval *parameters_param = NULL, *_0$$3, *_1$$4; - zval *parameters = NULL; + zval *parameters_param = NULL, __$false, _0$$3, _1$$4; + zval parameters; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, ¶meters_param); if (!parameters_param) { - ZEPHIR_INIT_VAR(parameters); - array_init(parameters); + ZEPHIR_INIT_VAR(¶meters); + array_init(¶meters); } else { - zephir_get_arrval(parameters, parameters_param); + zephir_get_arrval(¶meters, parameters_param); } - if (!(zephir_array_isset_string(parameters, SS("host")))) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_STRING(_0$$3, "127.0.0.1", 1); + if (!(zephir_array_isset_string(¶meters, SL("host")))) { + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "127.0.0.1"); zephir_array_update_string(¶meters, SL("host"), &_0$$3, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(parameters, SS("port")))) { - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_LONG(_1$$4, 11300); + if (!(zephir_array_isset_string(¶meters, SL("port")))) { + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_LONG(&_1$$4, 11300); zephir_array_update_string(¶meters, SL("port"), &_1$$4, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(parameters, SS("persistent")))) { - zephir_array_update_string(¶meters, SL("persistent"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(¶meters, SL("persistent")))) { + zephir_array_update_string(¶meters, SL("persistent"), &__$false, PH_COPY | PH_SEPARATE); } - zephir_update_property_this(getThis(), SL("_parameters"), parameters TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_parameters"), ¶meters); ZEPHIR_MM_RESTORE(); } @@ -148,57 +154,67 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, __construct) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, connect) { - zval *connection = NULL, *parameters = NULL, *_0, _9, *_1$$4, *_2$$4, *_3$$4, *_4$$4, *_5$$5, *_6$$5, *_7$$5, *_8$$5; + zval __$null, connection, parameters, _0, _9, _1$$4, _2$$4, _3$$4, _4$$4, _5$$5, _6$$5, _7$$5, _8$$5; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(¶meters); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$4); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$5); + ZVAL_UNDEF(&_7$$5); + ZVAL_UNDEF(&_8$$5); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(connection); - zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); - if (Z_TYPE_P(connection) == IS_RESOURCE) { + ZEPHIR_OBS_VAR(&connection); + zephir_read_property(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); + if (Z_TYPE_P(&connection) == IS_RESOURCE) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "disconnect", NULL, 0); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(parameters); - zephir_read_property_this(¶meters, this_ptr, SL("_parameters"), PH_NOISY_CC); - zephir_array_fetch_string(&_0, parameters, SL("persistent"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 139 TSRMLS_CC); - if (zephir_is_true(_0)) { - zephir_array_fetch_string(&_1$$4, parameters, SL("host"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 140 TSRMLS_CC); - zephir_array_fetch_string(&_2$$4, parameters, SL("port"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 140 TSRMLS_CC); - ZEPHIR_INIT_VAR(_3$$4); - ZVAL_NULL(_3$$4); - ZEPHIR_INIT_VAR(_4$$4); - ZVAL_NULL(_4$$4); - ZEPHIR_MAKE_REF(_3$$4); - ZEPHIR_MAKE_REF(_4$$4); - ZEPHIR_CALL_FUNCTION(&connection, "pfsockopen", NULL, 421, _1$$4, _2$$4, _3$$4, _4$$4); - ZEPHIR_UNREF(_3$$4); - ZEPHIR_UNREF(_4$$4); + ZEPHIR_OBS_VAR(¶meters); + zephir_read_property(¶meters, this_ptr, SL("_parameters"), PH_NOISY_CC); + zephir_array_fetch_string(&_0, ¶meters, SL("persistent"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 139 TSRMLS_CC); + if (zephir_is_true(&_0)) { + zephir_array_fetch_string(&_1$$4, ¶meters, SL("host"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 140 TSRMLS_CC); + zephir_array_fetch_string(&_2$$4, ¶meters, SL("port"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 140 TSRMLS_CC); + ZVAL_NULL(&_3$$4); + ZVAL_NULL(&_4$$4); + ZEPHIR_MAKE_REF(&_3$$4); + ZEPHIR_MAKE_REF(&_4$$4); + ZEPHIR_CALL_FUNCTION(&connection, "pfsockopen", NULL, 375, &_1$$4, &_2$$4, &_3$$4, &_4$$4); + ZEPHIR_UNREF(&_3$$4); + ZEPHIR_UNREF(&_4$$4); zephir_check_call_status(); } else { - zephir_array_fetch_string(&_5$$5, parameters, SL("host"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 142 TSRMLS_CC); - zephir_array_fetch_string(&_6$$5, parameters, SL("port"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 142 TSRMLS_CC); - ZEPHIR_INIT_VAR(_7$$5); - ZVAL_NULL(_7$$5); - ZEPHIR_INIT_VAR(_8$$5); - ZVAL_NULL(_8$$5); - ZEPHIR_MAKE_REF(_7$$5); - ZEPHIR_MAKE_REF(_8$$5); - ZEPHIR_CALL_FUNCTION(&connection, "fsockopen", NULL, 422, _5$$5, _6$$5, _7$$5, _8$$5); - ZEPHIR_UNREF(_7$$5); - ZEPHIR_UNREF(_8$$5); + zephir_array_fetch_string(&_5$$5, ¶meters, SL("host"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 142 TSRMLS_CC); + zephir_array_fetch_string(&_6$$5, ¶meters, SL("port"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 142 TSRMLS_CC); + ZVAL_NULL(&_7$$5); + ZVAL_NULL(&_8$$5); + ZEPHIR_MAKE_REF(&_7$$5); + ZEPHIR_MAKE_REF(&_8$$5); + ZEPHIR_CALL_FUNCTION(&connection, "fsockopen", NULL, 376, &_5$$5, &_6$$5, &_7$$5, &_8$$5); + ZEPHIR_UNREF(&_7$$5); + ZEPHIR_UNREF(&_8$$5); zephir_check_call_status(); } - if (Z_TYPE_P(connection) != IS_RESOURCE) { + if (Z_TYPE_P(&connection) != IS_RESOURCE) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "Can't connect to Beanstalk server", "phalcon/queue/beanstalk.zep", 146); return; } - ZEPHIR_SINIT_VAR(_9); ZVAL_LONG(&_9, -1); - ZEPHIR_CALL_FUNCTION(NULL, "stream_set_timeout", NULL, 423, connection, &_9, ZEPHIR_GLOBAL(global_null)); + ZEPHIR_CALL_FUNCTION(NULL, "stream_set_timeout", NULL, 377, &connection, &_9, &__$null); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_connection"), connection TSRMLS_CC); - RETURN_CCTOR(connection); + zephir_update_property_zval(this_ptr, SL("_connection"), &connection); + RETURN_CCTOR(&connection); } @@ -209,56 +225,69 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, put) { zend_bool _1; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *options = NULL; - zval *data, *options_param = NULL, *priority = NULL, *delay = NULL, *ttr = NULL, *serialized = NULL, *response = NULL, *status = NULL, *length = NULL, *_0, *_2; + zval options; + zval *data, data_sub, *options_param = NULL, priority, delay, ttr, serialized, response, status, length, _0, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data_sub); + ZVAL_UNDEF(&priority); + ZVAL_UNDEF(&delay); + ZVAL_UNDEF(&ttr); + ZVAL_UNDEF(&serialized); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&length); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&options); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &data, &options_param); if (!options_param) { - ZEPHIR_INIT_VAR(options); - array_init(options); + ZEPHIR_INIT_VAR(&options); + array_init(&options); } else { - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); } - ZEPHIR_OBS_VAR(priority); - if (!(zephir_array_isset_string_fetch(&priority, options, SS("priority"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(priority); - ZVAL_LONG(priority, 100); + ZEPHIR_OBS_VAR(&priority); + if (!(zephir_array_isset_string_fetch(&priority, &options, SL("priority"), 0))) { + ZEPHIR_INIT_NVAR(&priority); + ZVAL_LONG(&priority, 100); } - ZEPHIR_OBS_VAR(delay); - if (!(zephir_array_isset_string_fetch(&delay, options, SS("delay"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(delay); - ZVAL_LONG(delay, 0); + ZEPHIR_OBS_VAR(&delay); + if (!(zephir_array_isset_string_fetch(&delay, &options, SL("delay"), 0))) { + ZEPHIR_INIT_NVAR(&delay); + ZVAL_LONG(&delay, 0); } - ZEPHIR_OBS_VAR(ttr); - if (!(zephir_array_isset_string_fetch(&ttr, options, SS("ttr"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(ttr); - ZVAL_LONG(ttr, 86400); + ZEPHIR_OBS_VAR(&ttr); + if (!(zephir_array_isset_string_fetch(&ttr, &options, SL("ttr"), 0))) { + ZEPHIR_INIT_NVAR(&ttr); + ZVAL_LONG(&ttr, 86400); } - ZEPHIR_CALL_FUNCTION(&serialized, "serialize", NULL, 68, data); + ZEPHIR_CALL_FUNCTION(&serialized, "serialize", NULL, 61, data); zephir_check_call_status(); - ZEPHIR_INIT_VAR(length); - ZVAL_LONG(length, zephir_fast_strlen_ev(serialized)); - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_SVSVSVSVSV(_0, "put ", priority, " ", delay, " ", ttr, " ", length, "\r\n", serialized); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); + ZEPHIR_INIT_VAR(&length); + ZVAL_LONG(&length, zephir_fast_strlen_ev(&serialized)); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_SVSVSVSVSV(&_0, "put ", &priority, " ", &delay, " ", &ttr, " ", &length, "\r\n", &serialized); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&status, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 190 TSRMLS_CC); - _1 = !ZEPHIR_IS_STRING(status, "INSERTED"); + zephir_array_fetch_long(&status, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 190 TSRMLS_CC); + _1 = !ZEPHIR_IS_STRING(&status, "INSERTED"); if (_1) { - _1 = !ZEPHIR_IS_STRING(status, "BURIED"); + _1 = !ZEPHIR_IS_STRING(&status, "BURIED"); } if (_1) { RETURN_MM_BOOL(0); } - ZEPHIR_OBS_VAR(_2); - zephir_array_fetch_long(&_2, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 196 TSRMLS_CC); - RETURN_MM_LONG(zephir_get_intval(_2)); + ZEPHIR_OBS_VAR(&_2); + zephir_array_fetch_long(&_2, &response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 196 TSRMLS_CC); + RETURN_MM_LONG(zephir_get_intval(&_2)); } @@ -268,38 +297,50 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, put) { PHP_METHOD(Phalcon_Queue_Beanstalk, reserve) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *timeout = NULL, *command = NULL, *response = NULL, *_0, *_1, *_2 = NULL, *_3, *_4 = NULL; + zval *timeout = NULL, timeout_sub, __$null, command, response, _0, _1, _2, _3, _4; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&timeout_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&command); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &timeout); if (!timeout) { - timeout = ZEPHIR_GLOBAL(global_null); + timeout = &timeout_sub; + timeout = &__$null; } - ZEPHIR_INIT_VAR(command); + ZEPHIR_INIT_VAR(&command); if (Z_TYPE_P(timeout) != IS_NULL) { - ZEPHIR_CONCAT_SV(command, "reserve-with-timeout ", timeout); + ZEPHIR_CONCAT_SV(&command, "reserve-with-timeout ", timeout); } else { - ZVAL_STRING(command, "reserve", 1); + ZVAL_STRING(&command, "reserve"); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, command); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &command); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_0, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 215 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_0, "RESERVED")) { + zephir_array_fetch_long(&_0, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 215 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_0, "RESERVED")) { RETURN_MM_BOOL(0); } object_init_ex(return_value, phalcon_queue_beanstalk_job_ce); - zephir_array_fetch_long(&_1, response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 225 TSRMLS_CC); - zephir_array_fetch_long(&_3, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 225 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_2, this_ptr, "read", NULL, 0, _3); + zephir_array_fetch_long(&_1, &response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 225 TSRMLS_CC); + zephir_array_fetch_long(&_3, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 225 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_2, this_ptr, "read", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_4, "unserialize", NULL, 69, _2); + ZEPHIR_CALL_FUNCTION(&_4, "unserialize", NULL, 62, &_2); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 425, this_ptr, _1, _4); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 379, this_ptr, &_1, &_4); zephir_check_call_status(); RETURN_MM(); @@ -311,36 +352,43 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, reserve) { PHP_METHOD(Phalcon_Queue_Beanstalk, choose) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tube_param = NULL, *response = NULL, *_1, *_2; - zval *tube = NULL, *_0; + zval *tube_param = NULL, response, _1, _2; + zval tube, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tube); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &tube_param); if (UNEXPECTED(Z_TYPE_P(tube_param) != IS_STRING && Z_TYPE_P(tube_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tube_param) == IS_STRING)) { - zephir_get_strval(tube, tube_param); + zephir_get_strval(&tube, tube_param); } else { - ZEPHIR_INIT_VAR(tube); - ZVAL_EMPTY_STRING(tube); + ZEPHIR_INIT_VAR(&tube); + ZVAL_EMPTY_STRING(&tube); } - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_SV(_0, "use ", tube); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_SV(&_0, "use ", &tube); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 238 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "USING")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 238 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "USING")) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_2, response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 242 TSRMLS_CC); - RETURN_CTOR(_2); + zephir_array_fetch_long(&_2, &response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 242 TSRMLS_CC); + RETURN_CTOR(&_2); } @@ -350,37 +398,44 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, choose) { PHP_METHOD(Phalcon_Queue_Beanstalk, watch) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tube_param = NULL, *response = NULL, *_1, *_2; - zval *tube = NULL, *_0; + zval *tube_param = NULL, response, _1, _2; + zval tube, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tube); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &tube_param); if (UNEXPECTED(Z_TYPE_P(tube_param) != IS_STRING && Z_TYPE_P(tube_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tube_param) == IS_STRING)) { - zephir_get_strval(tube, tube_param); + zephir_get_strval(&tube, tube_param); } else { - ZEPHIR_INIT_VAR(tube); - ZVAL_EMPTY_STRING(tube); + ZEPHIR_INIT_VAR(&tube); + ZVAL_EMPTY_STRING(&tube); } - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_SV(_0, "watch ", tube); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_SV(&_0, "watch ", &tube); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 255 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "WATCHING")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 255 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "WATCHING")) { RETURN_MM_BOOL(0); } - ZEPHIR_OBS_VAR(_2); - zephir_array_fetch_long(&_2, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 259 TSRMLS_CC); - RETURN_MM_LONG(zephir_get_intval(_2)); + ZEPHIR_OBS_VAR(&_2); + zephir_array_fetch_long(&_2, &response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 259 TSRMLS_CC); + RETURN_MM_LONG(zephir_get_intval(&_2)); } @@ -390,37 +445,44 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, watch) { PHP_METHOD(Phalcon_Queue_Beanstalk, ignore) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tube_param = NULL, *response = NULL, *_1, *_2; - zval *tube = NULL, *_0; + zval *tube_param = NULL, response, _1, _2; + zval tube, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tube); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &tube_param); if (UNEXPECTED(Z_TYPE_P(tube_param) != IS_STRING && Z_TYPE_P(tube_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tube_param) == IS_STRING)) { - zephir_get_strval(tube, tube_param); + zephir_get_strval(&tube, tube_param); } else { - ZEPHIR_INIT_VAR(tube); - ZVAL_EMPTY_STRING(tube); + ZEPHIR_INIT_VAR(&tube); + ZVAL_EMPTY_STRING(&tube); } - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_SV(_0, "ignore ", tube); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_SV(&_0, "ignore ", &tube); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 272 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "WATCHING")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 272 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "WATCHING")) { RETURN_MM_BOOL(0); } - ZEPHIR_OBS_VAR(_2); - zephir_array_fetch_long(&_2, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 276 TSRMLS_CC); - RETURN_MM_LONG(zephir_get_intval(_2)); + ZEPHIR_OBS_VAR(&_2); + zephir_array_fetch_long(&_2, &response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 276 TSRMLS_CC); + RETURN_MM_LONG(zephir_get_intval(&_2)); } @@ -430,35 +492,42 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, ignore) { PHP_METHOD(Phalcon_Queue_Beanstalk, pauseTube) { zend_long delay, ZEPHIR_LAST_CALL_STATUS; - zval *tube_param = NULL, *delay_param = NULL, *response = NULL, _0, *_2; - zval *tube = NULL, *_1; + zval *tube_param = NULL, *delay_param = NULL, response, _0, _2; + zval tube, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tube); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &tube_param, &delay_param); if (UNEXPECTED(Z_TYPE_P(tube_param) != IS_STRING && Z_TYPE_P(tube_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tube_param) == IS_STRING)) { - zephir_get_strval(tube, tube_param); + zephir_get_strval(&tube, tube_param); } else { - ZEPHIR_INIT_VAR(tube); - ZVAL_EMPTY_STRING(tube); + ZEPHIR_INIT_VAR(&tube); + ZVAL_EMPTY_STRING(&tube); } delay = zephir_get_intval(delay_param); ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, delay); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SVSV(_1, "pause-tube ", tube, " ", &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _1); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SVSV(&_1, "pause-tube ", &tube, " ", &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_2, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 289 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_2, "PAUSED")) { + zephir_array_fetch_long(&_2, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 289 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_2, "PAUSED")) { RETURN_MM_BOOL(0); } RETURN_MM_BOOL(1); @@ -470,9 +539,16 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, pauseTube) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, kick) { - zval *_1; - zval *bound_param = NULL, *response = NULL, _0, *_2, *_3; + zval _1; + zval *bound_param = NULL, response, _0, _2, _3; zend_long bound, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &bound_param); @@ -482,19 +558,19 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, kick) { ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, bound); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, "kick ", &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _1); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, "kick ", &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_2, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 306 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_2, "KICKED")) { + zephir_array_fetch_long(&_2, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 306 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_2, "KICKED")) { RETURN_MM_BOOL(0); } - ZEPHIR_OBS_VAR(_3); - zephir_array_fetch_long(&_3, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 310 TSRMLS_CC); - RETURN_MM_LONG(zephir_get_intval(_3)); + ZEPHIR_OBS_VAR(&_3); + zephir_array_fetch_long(&_3, &response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 310 TSRMLS_CC); + RETURN_MM_LONG(zephir_get_intval(&_3)); } @@ -503,24 +579,29 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, kick) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, stats) { - zval *response = NULL, *_0, *_1, *_2; + zval response, _0, _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "stats", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "stats"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readyaml", NULL, 426); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readyaml", NULL, 380); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 323 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "OK")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 323 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "OK")) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_2, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 327 TSRMLS_CC); - RETURN_CTOR(_2); + zephir_array_fetch_long(&_2, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 327 TSRMLS_CC); + RETURN_CTOR(&_2); } @@ -530,36 +611,43 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, stats) { PHP_METHOD(Phalcon_Queue_Beanstalk, statsTube) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tube_param = NULL, *response = NULL, *_1, *_2; - zval *tube = NULL, *_0; + zval *tube_param = NULL, response, _1, _2; + zval tube, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tube); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &tube_param); if (UNEXPECTED(Z_TYPE_P(tube_param) != IS_STRING && Z_TYPE_P(tube_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'tube' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(tube_param) == IS_STRING)) { - zephir_get_strval(tube, tube_param); + zephir_get_strval(&tube, tube_param); } else { - ZEPHIR_INIT_VAR(tube); - ZVAL_EMPTY_STRING(tube); + ZEPHIR_INIT_VAR(&tube); + ZVAL_EMPTY_STRING(&tube); } - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_SV(_0, "stats-tube ", tube); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_SV(&_0, "stats-tube ", &tube); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readyaml", NULL, 426); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readyaml", NULL, 380); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 340 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "OK")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 340 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "OK")) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_2, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 344 TSRMLS_CC); - RETURN_CTOR(_2); + zephir_array_fetch_long(&_2, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 344 TSRMLS_CC); + RETURN_CTOR(&_2); } @@ -568,24 +656,29 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, statsTube) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, listTubes) { - zval *response = NULL, *_0, *_1, *_2; + zval response, _0, _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "list-tubes", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "list-tubes"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readyaml", NULL, 426); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readyaml", NULL, 380); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 357 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "OK")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 357 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "OK")) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_2, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 361 TSRMLS_CC); - RETURN_CTOR(_2); + zephir_array_fetch_long(&_2, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 361 TSRMLS_CC); + RETURN_CTOR(&_2); } @@ -594,24 +687,29 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, listTubes) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, listTubeUsed) { - zval *response = NULL, *_0, *_1, *_2; + zval response, _0, _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "list-tube-used", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "list-tube-used"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 374 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "USING")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 374 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "USING")) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_2, response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 378 TSRMLS_CC); - RETURN_CTOR(_2); + zephir_array_fetch_long(&_2, &response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 378 TSRMLS_CC); + RETURN_CTOR(&_2); } @@ -620,24 +718,29 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, listTubeUsed) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, listTubesWatched) { - zval *response = NULL, *_0, *_1, *_2; + zval response, _0, _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "list-tubes-watched", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "list-tubes-watched"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readyaml", NULL, 426); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readyaml", NULL, 380); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 391 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "OK")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 391 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "OK")) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_2, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 395 TSRMLS_CC); - RETURN_CTOR(_2); + zephir_array_fetch_long(&_2, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 395 TSRMLS_CC); + RETURN_CTOR(&_2); } @@ -646,30 +749,38 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, listTubesWatched) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, peekReady) { - zval *response = NULL, *_0, *_1, *_2, *_3 = NULL, *_4, *_5 = NULL; + zval response, _0, _1, _2, _3, _4, _5; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "peek-ready", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "peek-ready"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 408 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "FOUND")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 408 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "FOUND")) { RETURN_MM_BOOL(0); } object_init_ex(return_value, phalcon_queue_beanstalk_job_ce); - zephir_array_fetch_long(&_2, response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 412 TSRMLS_CC); - zephir_array_fetch_long(&_4, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 412 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "read", NULL, 0, _4); + zephir_array_fetch_long(&_2, &response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 412 TSRMLS_CC); + zephir_array_fetch_long(&_4, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 412 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "read", NULL, 0, &_4); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_5, "unserialize", NULL, 69, _3); + ZEPHIR_CALL_FUNCTION(&_5, "unserialize", NULL, 62, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 425, this_ptr, _2, _5); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 379, this_ptr, &_2, &_5); zephir_check_call_status(); RETURN_MM(); @@ -680,30 +791,38 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, peekReady) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, peekBuried) { - zval *response = NULL, *_0, *_1, *_2, *_3 = NULL, *_4, *_5 = NULL; + zval response, _0, _1, _2, _3, _4, _5; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "peek-buried", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "peek-buried"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_1, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 425 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_1, "FOUND")) { + zephir_array_fetch_long(&_1, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 425 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_1, "FOUND")) { RETURN_MM_BOOL(0); } object_init_ex(return_value, phalcon_queue_beanstalk_job_ce); - zephir_array_fetch_long(&_2, response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 429 TSRMLS_CC); - zephir_array_fetch_long(&_4, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 429 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_3, this_ptr, "read", NULL, 0, _4); + zephir_array_fetch_long(&_2, &response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 429 TSRMLS_CC); + zephir_array_fetch_long(&_4, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 429 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_3, this_ptr, "read", NULL, 0, &_4); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_5, "unserialize", NULL, 69, _3); + ZEPHIR_CALL_FUNCTION(&_5, "unserialize", NULL, 62, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 425, this_ptr, _2, _5); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 379, this_ptr, &_2, &_5); zephir_check_call_status(); RETURN_MM(); @@ -714,33 +833,42 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, peekBuried) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, peekDelayed) { - zval *response = NULL, *_0 = NULL, *_1, *_2, *_3, *_4 = NULL, *_5, *_6 = NULL; + zval response, _0, _1, _2, _3, _4, _5, _6; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "peek-delayed", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "write", NULL, 0, _1); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "peek-delayed"); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "write", NULL, 0, &_1); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { + if (!(zephir_is_true(&_0))) { RETURN_MM_BOOL(0); } - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_2, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 444 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_2, "FOUND")) { + zephir_array_fetch_long(&_2, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 444 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_2, "FOUND")) { RETURN_MM_BOOL(0); } object_init_ex(return_value, phalcon_queue_beanstalk_job_ce); - zephir_array_fetch_long(&_3, response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 448 TSRMLS_CC); - zephir_array_fetch_long(&_5, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 448 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "read", NULL, 0, _5); + zephir_array_fetch_long(&_3, &response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 448 TSRMLS_CC); + zephir_array_fetch_long(&_5, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 448 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "read", NULL, 0, &_5); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_6, "unserialize", NULL, 69, _4); + ZEPHIR_CALL_FUNCTION(&_6, "unserialize", NULL, 62, &_4); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 425, this_ptr, _3, _6); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 379, this_ptr, &_3, &_6); zephir_check_call_status(); RETURN_MM(); @@ -751,9 +879,19 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, peekDelayed) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, jobPeek) { - zval *_1; - zval *id_param = NULL, *response = NULL, _0, *_2, *_3, *_4 = NULL, *_5, *_6 = NULL; + zval _1; + zval *id_param = NULL, response, _0, _2, _3, _4, _5, _6; zend_long id, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &id_param); @@ -763,24 +901,24 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, jobPeek) { ZEPHIR_SINIT_VAR(_0); ZVAL_LONG(&_0, id); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, "peek ", &_0); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _1); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, "peek ", &_0); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - zephir_array_fetch_long(&_2, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 462 TSRMLS_CC); - if (!ZEPHIR_IS_STRING(_2, "FOUND")) { + zephir_array_fetch_long(&_2, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 462 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&_2, "FOUND")) { RETURN_MM_BOOL(0); } object_init_ex(return_value, phalcon_queue_beanstalk_job_ce); - zephir_array_fetch_long(&_3, response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 466 TSRMLS_CC); - zephir_array_fetch_long(&_5, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 466 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_4, this_ptr, "read", NULL, 0, _5); + zephir_array_fetch_long(&_3, &response, 1, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 466 TSRMLS_CC); + zephir_array_fetch_long(&_5, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 466 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_4, this_ptr, "read", NULL, 0, &_5); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_6, "unserialize", NULL, 69, _4); + ZEPHIR_CALL_FUNCTION(&_6, "unserialize", NULL, 62, &_4); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 425, this_ptr, _3, _6); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 379, this_ptr, &_3, &_6); zephir_check_call_status(); RETURN_MM(); @@ -791,18 +929,21 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, jobPeek) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, readStatus) { - zval *status = NULL; + zval status; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&status); ZEPHIR_MM_GROW(); ZEPHIR_CALL_METHOD(&status, this_ptr, "read", NULL, 0); zephir_check_call_status(); - if (ZEPHIR_IS_FALSE_IDENTICAL(status)) { + if (ZEPHIR_IS_FALSE_IDENTICAL(&status)) { array_init(return_value); RETURN_MM(); } - zephir_fast_explode_str(return_value, SL(" "), status, LONG_MAX TSRMLS_CC); + zephir_fast_explode_str(return_value, SL(" "), &status, LONG_MAX TSRMLS_CC); RETURN_MM(); } @@ -812,32 +953,38 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, readStatus) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, readYaml) { - zval *response = NULL, *status = NULL, *numberOfBytes = NULL, *data = NULL; + zval response, status, numberOfBytes, data; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&status); + ZVAL_UNDEF(&numberOfBytes); + ZVAL_UNDEF(&data); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 424); + ZEPHIR_CALL_METHOD(&response, this_ptr, "readstatus", NULL, 378); zephir_check_call_status(); - ZEPHIR_OBS_VAR(status); - zephir_array_fetch_long(&status, response, 0, PH_NOISY, "phalcon/queue/beanstalk.zep", 491 TSRMLS_CC); - if (zephir_fast_count_int(response TSRMLS_CC) > 1) { - ZEPHIR_OBS_VAR(numberOfBytes); - zephir_array_fetch_long(&numberOfBytes, response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 494 TSRMLS_CC); + ZEPHIR_OBS_VAR(&status); + zephir_array_fetch_long(&status, &response, 0, PH_NOISY, "phalcon/queue/beanstalk.zep", 491 TSRMLS_CC); + if (zephir_fast_count_int(&response TSRMLS_CC) > 1) { + ZEPHIR_OBS_VAR(&numberOfBytes); + zephir_array_fetch_long(&numberOfBytes, &response, 1, PH_NOISY, "phalcon/queue/beanstalk.zep", 494 TSRMLS_CC); ZEPHIR_CALL_METHOD(&response, this_ptr, "read", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&data, "yaml_parse", NULL, 427, response); + ZEPHIR_CALL_FUNCTION(&data, "yaml_parse", NULL, 381, &response); zephir_check_call_status(); } else { - ZEPHIR_INIT_NVAR(numberOfBytes); - ZVAL_LONG(numberOfBytes, 0); - ZEPHIR_INIT_NVAR(data); - array_init(data); + ZEPHIR_INIT_NVAR(&numberOfBytes); + ZVAL_LONG(&numberOfBytes, 0); + ZEPHIR_INIT_NVAR(&data); + array_init(&data); } zephir_create_array(return_value, 3, 0 TSRMLS_CC); - zephir_array_fast_append(return_value, status); - zephir_array_fast_append(return_value, numberOfBytes); - zephir_array_fast_append(return_value, data); + zephir_array_fast_append(return_value, &status); + zephir_array_fast_append(return_value, &numberOfBytes); + zephir_array_fast_append(return_value, &data); RETURN_MM(); } @@ -848,8 +995,19 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, readYaml) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, read) { - zval *length_param = NULL, *connection = NULL, *data = NULL, _0$$5 = zval_used_for_init, *_1$$5 = NULL, *_2$$5 = NULL, *_3$$5, _4$$8, _5$$8; + zval *length_param = NULL, connection, data, _0$$5, _1$$5, _2$$5, _3$$5, _4$$5, _5$$8, _6$$8; zend_long length, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$8); + ZVAL_UNDEF(&_6$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &length_param); @@ -861,59 +1019,57 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, read) { } - ZEPHIR_OBS_VAR(connection); - zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); - if (Z_TYPE_P(connection) != IS_RESOURCE) { + ZEPHIR_OBS_VAR(&connection); + zephir_read_property(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); + if (Z_TYPE_P(&connection) != IS_RESOURCE) { ZEPHIR_CALL_METHOD(&connection, this_ptr, "connect", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(connection) != IS_RESOURCE) { + if (Z_TYPE_P(&connection) != IS_RESOURCE) { RETURN_MM_BOOL(0); } } if (length) { - if (zephir_feof(connection TSRMLS_CC)) { + if (zephir_feof(&connection TSRMLS_CC)) { RETURN_MM_BOOL(0); } - ZEPHIR_SINIT_VAR(_0$$5); ZVAL_LONG(&_0$$5, (length + 2)); - ZEPHIR_CALL_FUNCTION(&_1$$5, "stream_get_line", NULL, 428, connection, &_0$$5); + ZEPHIR_CALL_FUNCTION(&_1$$5, "stream_get_line", NULL, 382, &connection, &_0$$5); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_0$$5); - ZVAL_STRING(&_0$$5, "\r\n", 0); - ZEPHIR_INIT_VAR(data); - zephir_fast_trim(data, _1$$5, &_0$$5, ZEPHIR_TRIM_RIGHT TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_2$$5, "stream_get_meta_data", NULL, 429, connection); + ZEPHIR_INIT_VAR(&_2$$5); + ZVAL_STRING(&_2$$5, "\r\n"); + ZEPHIR_INIT_VAR(&data); + zephir_fast_trim(&data, &_1$$5, &_2$$5, ZEPHIR_TRIM_RIGHT TSRMLS_CC); + ZEPHIR_CALL_FUNCTION(&_3$$5, "stream_get_meta_data", NULL, 383, &connection); zephir_check_call_status(); - zephir_array_fetch_string(&_3$$5, _2$$5, SL("timed_out"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 535 TSRMLS_CC); - if (zephir_is_true(_3$$5)) { + zephir_array_fetch_string(&_4$$5, &_3$$5, SL("timed_out"), PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk.zep", 535 TSRMLS_CC); + if (zephir_is_true(&_4$$5)) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "Connection timed out", "phalcon/queue/beanstalk.zep", 536); return; } } else { - ZEPHIR_SINIT_VAR(_4$$8); - ZVAL_LONG(&_4$$8, 16384); - ZEPHIR_SINIT_VAR(_5$$8); - ZVAL_STRING(&_5$$8, "\r\n", 0); - ZEPHIR_CALL_FUNCTION(&data, "stream_get_line", NULL, 428, connection, &_4$$8, &_5$$8); + ZVAL_LONG(&_5$$8, 16384); + ZEPHIR_INIT_VAR(&_6$$8); + ZVAL_STRING(&_6$$8, "\r\n"); + ZEPHIR_CALL_FUNCTION(&data, "stream_get_line", NULL, 382, &connection, &_5$$8, &_6$$8); zephir_check_call_status(); } - if (ZEPHIR_IS_STRING_IDENTICAL(data, "UNKNOWN_COMMAND")) { + if (ZEPHIR_IS_STRING_IDENTICAL(&data, "UNKNOWN_COMMAND")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "UNKNOWN_COMMAND", "phalcon/queue/beanstalk.zep", 544); return; } - if (ZEPHIR_IS_STRING_IDENTICAL(data, "JOB_TOO_BIG")) { + if (ZEPHIR_IS_STRING_IDENTICAL(&data, "JOB_TOO_BIG")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "JOB_TOO_BIG", "phalcon/queue/beanstalk.zep", 548); return; } - if (ZEPHIR_IS_STRING_IDENTICAL(data, "BAD_FORMAT")) { + if (ZEPHIR_IS_STRING_IDENTICAL(&data, "BAD_FORMAT")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "BAD_FORMAT", "phalcon/queue/beanstalk.zep", 552); return; } - if (ZEPHIR_IS_STRING_IDENTICAL(data, "OUT_OF_MEMORY")) { + if (ZEPHIR_IS_STRING_IDENTICAL(&data, "OUT_OF_MEMORY")) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "OUT_OF_MEMORY", "phalcon/queue/beanstalk.zep", 556); return; } - RETURN_CCTOR(data); + RETURN_CCTOR(&data); } @@ -923,30 +1079,36 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, read) { PHP_METHOD(Phalcon_Queue_Beanstalk, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *data_param = NULL, *connection = NULL, *packet = NULL, _1; - zval *data = NULL, *_0; + zval *data_param = NULL, connection, packet, _1; + zval data, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&connection); + ZVAL_UNDEF(&packet); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &data_param); - zephir_get_strval(data, data_param); + zephir_get_strval(&data, data_param); - ZEPHIR_OBS_VAR(connection); - zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); - if (Z_TYPE_P(connection) != IS_RESOURCE) { + ZEPHIR_OBS_VAR(&connection); + zephir_read_property(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); + if (Z_TYPE_P(&connection) != IS_RESOURCE) { ZEPHIR_CALL_METHOD(&connection, this_ptr, "connect", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(connection) != IS_RESOURCE) { + if (Z_TYPE_P(&connection) != IS_RESOURCE) { RETURN_MM_BOOL(0); } } - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_VS(_0, data, "\r\n"); - ZEPHIR_CPY_WRT(packet, _0); - ZEPHIR_SINIT_VAR(_1); - ZVAL_LONG(&_1, zephir_fast_strlen_ev(packet)); - ZEPHIR_RETURN_CALL_FUNCTION("fwrite", NULL, 430, connection, packet, &_1); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_VS(&_0, &data, "\r\n"); + ZEPHIR_CPY_WRT(&packet, &_0); + ZVAL_LONG(&_1, zephir_fast_strlen_ev(&packet)); + ZEPHIR_RETURN_CALL_FUNCTION("fwrite", NULL, 384, &connection, &packet, &_1); zephir_check_call_status(); RETURN_MM(); @@ -957,17 +1119,21 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, write) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, disconnect) { - zval *connection = NULL; + zval __$null, connection; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&connection); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(connection); - zephir_read_property_this(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); - if (Z_TYPE_P(connection) != IS_RESOURCE) { + ZEPHIR_OBS_VAR(&connection); + zephir_read_property(&connection, this_ptr, SL("_connection"), PH_NOISY_CC); + if (Z_TYPE_P(&connection) != IS_RESOURCE) { RETURN_MM_BOOL(0); } - zephir_fclose(connection TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_connection"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_fclose(&connection TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_connection"), &__$null); RETURN_MM_BOOL(1); } @@ -977,21 +1143,24 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, disconnect) { */ PHP_METHOD(Phalcon_Queue_Beanstalk, quit) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "quit", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, _0); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "quit"); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "write", NULL, 0, &_0); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, this_ptr, "disconnect", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_connection"), PH_NOISY_CC); - RETURN_MM_BOOL(Z_TYPE_P(_1) != IS_RESOURCE); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_connection"), PH_NOISY_CC); + RETURN_MM_BOOL(Z_TYPE_P(&_1) != IS_RESOURCE); } diff --git a/ext/phalcon/queue/beanstalk.zep.h b/ext/phalcon/queue/beanstalk.zep.h index 2cbfad34373..e0f0f5be380 100644 --- a/ext/phalcon/queue/beanstalk.zep.h +++ b/ext/phalcon/queue/beanstalk.zep.h @@ -29,7 +29,7 @@ PHP_METHOD(Phalcon_Queue_Beanstalk, disconnect); PHP_METHOD(Phalcon_Queue_Beanstalk, quit); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk___construct, 0, 0, 0) - ZEND_ARG_ARRAY_INFO(0, parameters, 1) + ZEND_ARG_ARRAY_INFO(0, parameters, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_put, 0, 0, 1) @@ -42,40 +42,112 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_reserve, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_choose, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tube, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tube) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_watch, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tube, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tube) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_ignore, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tube, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tube) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_pausetube, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_pausetube, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_pausetube, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tube, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tube) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, delay, IS_LONG, 0) +#else ZEND_ARG_INFO(0, delay) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_kick, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, bound, IS_LONG, 0) +#else ZEND_ARG_INFO(0, bound) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_statstube, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tube, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tube) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_jobpeek, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, id, IS_LONG, 0) +#else ZEND_ARG_INFO(0, id) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_readstatus, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_readstatus, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_readyaml, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_readyaml, 0, 0, IS_ARRAY, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_read, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) +#else ZEND_ARG_INFO(0, length) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_write, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) +#else ZEND_ARG_INFO(0, data) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_disconnect, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_disconnect, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_quit, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_quit, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_queue_beanstalk_method_entry) { @@ -97,11 +169,11 @@ ZEPHIR_INIT_FUNCS(phalcon_queue_beanstalk_method_entry) { PHP_ME(Phalcon_Queue_Beanstalk, peekBuried, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk, peekDelayed, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk, jobPeek, arginfo_phalcon_queue_beanstalk_jobpeek, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Queue_Beanstalk, readStatus, NULL, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Queue_Beanstalk, readYaml, NULL, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Queue_Beanstalk, readStatus, arginfo_phalcon_queue_beanstalk_readstatus, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Queue_Beanstalk, readYaml, arginfo_phalcon_queue_beanstalk_readyaml, ZEND_ACC_FINAL|ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk, read, arginfo_phalcon_queue_beanstalk_read, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk, write, arginfo_phalcon_queue_beanstalk_write, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Queue_Beanstalk, disconnect, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Queue_Beanstalk, quit, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Queue_Beanstalk, disconnect, arginfo_phalcon_queue_beanstalk_disconnect, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Queue_Beanstalk, quit, arginfo_phalcon_queue_beanstalk_quit, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/queue/beanstalk/job.zep.c b/ext/phalcon/queue/beanstalk/job.zep.c index 20831974fea..a0746597c68 100644 --- a/ext/phalcon/queue/beanstalk/job.zep.c +++ b/ext/phalcon/queue/beanstalk/job.zep.c @@ -50,7 +50,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Queue_Beanstalk_Job) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, getId) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_id"); @@ -60,7 +61,8 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, getId) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, getBody) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_body"); @@ -71,18 +73,23 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, getBody) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, __construct) { - zval *id = NULL; - zval *queue, *id_param = NULL, *body; + zval id; + zval *queue, queue_sub, *id_param = NULL, *body, body_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&queue_sub); + ZVAL_UNDEF(&body_sub); + ZVAL_UNDEF(&id); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 0, &queue, &id_param, &body); - zephir_get_strval(id, id_param); + zephir_get_strval(&id, id_param); - zephir_update_property_this(getThis(), SL("_queue"), queue TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_id"), id TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_body"), body TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_queue"), queue); + zephir_update_property_zval(this_ptr, SL("_id"), &id); + zephir_update_property_zval(this_ptr, SL("_body"), body); ZEPHIR_MM_RESTORE(); } @@ -92,22 +99,29 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, __construct) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, delete) { - zval *queue = NULL, *_0, *_1, *_2 = NULL, *_3; + zval queue, _0, _1, _2, _3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&queue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(queue); - zephir_read_property_this(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_id"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, "delete ", _0); - ZEPHIR_CALL_METHOD(NULL, queue, "write", NULL, 0, _1); + ZEPHIR_OBS_VAR(&queue); + zephir_read_property(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_id"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, "delete ", &_0); + ZEPHIR_CALL_METHOD(NULL, &queue, "write", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2, queue, "readstatus", NULL, 0); + ZEPHIR_CALL_METHOD(&_2, &queue, "readstatus", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_long(&_3, _2, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 64 TSRMLS_CC); - RETURN_MM_BOOL(ZEPHIR_IS_STRING(_3, "DELETED")); + zephir_array_fetch_long(&_3, &_2, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 64 TSRMLS_CC); + RETURN_MM_BOOL(ZEPHIR_IS_STRING(&_3, "DELETED")); } @@ -118,8 +132,17 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, delete) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, release) { - zval *priority_param = NULL, *delay_param = NULL, *queue = NULL, *_0, _1, _2, *_3, *_4 = NULL, *_5; + zval *priority_param = NULL, *delay_param = NULL, queue, _0, _1, _2, _3, _4, _5; zend_long priority, delay, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&queue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &priority_param, &delay_param); @@ -136,21 +159,21 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, release) { } - ZEPHIR_OBS_VAR(queue); - zephir_read_property_this(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_id"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&queue); + zephir_read_property(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_id"), PH_NOISY_CC | PH_READONLY); ZEPHIR_SINIT_VAR(_1); ZVAL_LONG(&_1, priority); ZEPHIR_SINIT_VAR(_2); ZVAL_LONG(&_2, delay); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_CONCAT_SVSVSV(_3, "release ", _0, " ", &_1, " ", &_2); - ZEPHIR_CALL_METHOD(NULL, queue, "write", NULL, 0, _3); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_CONCAT_SVSVSV(&_3, "release ", &_0, " ", &_1, " ", &_2); + ZEPHIR_CALL_METHOD(NULL, &queue, "write", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_4, queue, "readstatus", NULL, 0); + ZEPHIR_CALL_METHOD(&_4, &queue, "readstatus", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_long(&_5, _4, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 78 TSRMLS_CC); - RETURN_MM_BOOL(ZEPHIR_IS_STRING(_5, "RELEASED")); + zephir_array_fetch_long(&_5, &_4, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 78 TSRMLS_CC); + RETURN_MM_BOOL(ZEPHIR_IS_STRING(&_5, "RELEASED")); } @@ -161,8 +184,16 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, release) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, bury) { - zval *priority_param = NULL, *queue = NULL, *_0, _1, *_2, *_3 = NULL, *_4; + zval *priority_param = NULL, queue, _0, _1, _2, _3, _4; zend_long priority, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&queue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &priority_param); @@ -174,19 +205,19 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, bury) { } - ZEPHIR_OBS_VAR(queue); - zephir_read_property_this(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_id"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&queue); + zephir_read_property(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_id"), PH_NOISY_CC | PH_READONLY); ZEPHIR_SINIT_VAR(_1); ZVAL_LONG(&_1, priority); - ZEPHIR_INIT_VAR(_2); - ZEPHIR_CONCAT_SVSV(_2, "bury ", _0, " ", &_1); - ZEPHIR_CALL_METHOD(NULL, queue, "write", NULL, 0, _2); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVSV(&_2, "bury ", &_0, " ", &_1); + ZEPHIR_CALL_METHOD(NULL, &queue, "write", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_3, queue, "readstatus", NULL, 0); + ZEPHIR_CALL_METHOD(&_3, &queue, "readstatus", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_long(&_4, _3, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 92 TSRMLS_CC); - RETURN_MM_BOOL(ZEPHIR_IS_STRING(_4, "BURIED")); + zephir_array_fetch_long(&_4, &_3, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 92 TSRMLS_CC); + RETURN_MM_BOOL(ZEPHIR_IS_STRING(&_4, "BURIED")); } @@ -200,22 +231,29 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, bury) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, touch) { - zval *queue = NULL, *_0, *_1, *_2 = NULL, *_3; + zval queue, _0, _1, _2, _3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&queue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(queue); - zephir_read_property_this(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_id"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, "touch ", _0); - ZEPHIR_CALL_METHOD(NULL, queue, "write", NULL, 0, _1); + ZEPHIR_OBS_VAR(&queue); + zephir_read_property(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_id"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, "touch ", &_0); + ZEPHIR_CALL_METHOD(NULL, &queue, "write", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2, queue, "readstatus", NULL, 0); + ZEPHIR_CALL_METHOD(&_2, &queue, "readstatus", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_long(&_3, _2, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 109 TSRMLS_CC); - RETURN_MM_BOOL(ZEPHIR_IS_STRING(_3, "TOUCHED")); + zephir_array_fetch_long(&_3, &_2, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 109 TSRMLS_CC); + RETURN_MM_BOOL(ZEPHIR_IS_STRING(&_3, "TOUCHED")); } @@ -224,22 +262,29 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, touch) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, kick) { - zval *queue = NULL, *_0, *_1, *_2 = NULL, *_3; + zval queue, _0, _1, _2, _3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&queue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(queue); - zephir_read_property_this(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_id"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, "kick-job ", _0); - ZEPHIR_CALL_METHOD(NULL, queue, "write", NULL, 0, _1); + ZEPHIR_OBS_VAR(&queue); + zephir_read_property(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_id"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, "kick-job ", &_0); + ZEPHIR_CALL_METHOD(NULL, &queue, "write", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_2, queue, "readstatus", NULL, 0); + ZEPHIR_CALL_METHOD(&_2, &queue, "readstatus", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_long(&_3, _2, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 121 TSRMLS_CC); - RETURN_MM_BOOL(ZEPHIR_IS_STRING(_3, "KICKED")); + zephir_array_fetch_long(&_3, &_2, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 121 TSRMLS_CC); + RETURN_MM_BOOL(ZEPHIR_IS_STRING(&_3, "KICKED")); } @@ -248,26 +293,34 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, kick) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, stats) { - zval *queue = NULL, *response = NULL, *_0, *_1, *_2, *_3; + zval queue, response, _0, _1, _2, _3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&queue); + ZVAL_UNDEF(&response); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(queue); - zephir_read_property_this(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_id"), PH_NOISY_CC); - ZEPHIR_INIT_VAR(_1); - ZEPHIR_CONCAT_SV(_1, "stats-job ", _0); - ZEPHIR_CALL_METHOD(NULL, queue, "write", NULL, 0, _1); + ZEPHIR_OBS_VAR(&queue); + zephir_read_property(&queue, this_ptr, SL("_queue"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_id"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_INIT_VAR(&_1); + ZEPHIR_CONCAT_SV(&_1, "stats-job ", &_0); + ZEPHIR_CALL_METHOD(NULL, &queue, "write", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&response, queue, "readyaml", NULL, 0); + ZEPHIR_CALL_METHOD(&response, &queue, "readyaml", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_long(&_2, response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 135 TSRMLS_CC); - if (ZEPHIR_IS_STRING(_2, "NOT_FOUND")) { + zephir_array_fetch_long(&_2, &response, 0, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 135 TSRMLS_CC); + if (ZEPHIR_IS_STRING(&_2, "NOT_FOUND")) { RETURN_MM_BOOL(0); } - zephir_array_fetch_long(&_3, response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 139 TSRMLS_CC); - RETURN_CTOR(_3); + zephir_array_fetch_long(&_3, &response, 2, PH_NOISY | PH_READONLY, "phalcon/queue/beanstalk/job.zep", 139 TSRMLS_CC); + RETURN_CTOR(&_3); } @@ -276,13 +329,16 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, stats) { */ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, __wakeup) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(_0); - zephir_read_property_this(&_0, this_ptr, SL("_id"), PH_NOISY_CC); - if (Z_TYPE_P(_0) != IS_STRING) { + ZEPHIR_OBS_VAR(&_0); + zephir_read_property(&_0, this_ptr, SL("_id"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_queue_beanstalk_exception_ce, "Unexpected inconsistency in Phalcon\\Queue\\Beanstalk\\Job::__wakeup() - possible break-in attempt!", "phalcon/queue/beanstalk/job.zep", 150); return; } diff --git a/ext/phalcon/queue/beanstalk/job.zep.h b/ext/phalcon/queue/beanstalk/job.zep.h index 3988e79e1dd..38bb8c7dd70 100644 --- a/ext/phalcon/queue/beanstalk/job.zep.h +++ b/ext/phalcon/queue/beanstalk/job.zep.h @@ -14,30 +14,82 @@ PHP_METHOD(Phalcon_Queue_Beanstalk_Job, kick); PHP_METHOD(Phalcon_Queue_Beanstalk_Job, stats); PHP_METHOD(Phalcon_Queue_Beanstalk_Job, __wakeup); +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_getid, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_getid, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_job___construct, 0, 0, 3) ZEND_ARG_OBJ_INFO(0, queue, Phalcon\\Queue\\Beanstalk, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) +#else ZEND_ARG_INFO(0, id) +#endif ZEND_ARG_INFO(0, body) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_job_release, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_delete, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_delete, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_release, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_release, 0, 0, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 0) +#else ZEND_ARG_INFO(0, priority) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, delay, IS_LONG, 0) +#else ZEND_ARG_INFO(0, delay) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_queue_beanstalk_job_bury, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_bury, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_bury, 0, 0, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, priority, IS_LONG, 0) +#else ZEND_ARG_INFO(0, priority) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_touch, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_touch, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_kick, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_queue_beanstalk_job_kick, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_queue_beanstalk_job_method_entry) { - PHP_ME(Phalcon_Queue_Beanstalk_Job, getId, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Queue_Beanstalk_Job, getId, arginfo_phalcon_queue_beanstalk_job_getid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk_Job, getBody, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk_Job, __construct, arginfo_phalcon_queue_beanstalk_job___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Queue_Beanstalk_Job, delete, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Queue_Beanstalk_Job, delete, arginfo_phalcon_queue_beanstalk_job_delete, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk_Job, release, arginfo_phalcon_queue_beanstalk_job_release, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk_Job, bury, arginfo_phalcon_queue_beanstalk_job_bury, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Queue_Beanstalk_Job, touch, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Queue_Beanstalk_Job, kick, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Queue_Beanstalk_Job, touch, arginfo_phalcon_queue_beanstalk_job_touch, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Queue_Beanstalk_Job, kick, arginfo_phalcon_queue_beanstalk_job_kick, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk_Job, stats, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Queue_Beanstalk_Job, __wakeup, NULL, ZEND_ACC_PUBLIC) PHP_FE_END diff --git a/ext/phalcon/registry.zep.c b/ext/phalcon/registry.zep.c index d2e85408330..adb5ced3974 100644 --- a/ext/phalcon/registry.zep.c +++ b/ext/phalcon/registry.zep.c @@ -90,13 +90,16 @@ ZEPHIR_INIT_CLASS(Phalcon_Registry) { */ PHP_METHOD(Phalcon_Registry, __construct) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_property_this(getThis(), SL("_data"), _0 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zephir_update_property_zval(this_ptr, SL("_data"), &_0); ZEPHIR_MM_RESTORE(); } @@ -106,14 +109,18 @@ PHP_METHOD(Phalcon_Registry, __construct) { */ PHP_METHOD(Phalcon_Registry, offsetExists) { - zval *offset, *_0; + zval *offset, offset_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&offset_sub); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &offset); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - RETURN_BOOL(zephir_array_isset(_0, offset)); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + RETURN_BOOL(zephir_array_isset(&_0, offset)); } @@ -122,15 +129,20 @@ PHP_METHOD(Phalcon_Registry, offsetExists) { */ PHP_METHOD(Phalcon_Registry, offsetGet) { - zval *offset, *_0, *_1; + zval *offset, offset_sub, _0, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&offset_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); zephir_fetch_params(0, 1, 0, &offset); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - zephir_array_fetch(&_1, _0, offset, PH_NOISY | PH_READONLY, "phalcon/registry.zep", 98 TSRMLS_CC); - RETURN_CTORW(_1); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + zephir_array_fetch(&_1, &_0, offset, PH_NOISY | PH_READONLY, "phalcon/registry.zep", 98 TSRMLS_CC); + RETURN_CTORW(&_1); } @@ -139,7 +151,11 @@ PHP_METHOD(Phalcon_Registry, offsetGet) { */ PHP_METHOD(Phalcon_Registry, offsetSet) { - zval *offset, *value; + zval *offset, offset_sub, *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&offset_sub); + ZVAL_UNDEF(&value_sub); zephir_fetch_params(0, 2, 0, &offset, &value); @@ -154,13 +170,17 @@ PHP_METHOD(Phalcon_Registry, offsetSet) { */ PHP_METHOD(Phalcon_Registry, offsetUnset) { - zval *offset, *_0; + zval *offset, offset_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&offset_sub); + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &offset); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); zephir_array_unset(&_0, offset, PH_SEPARATE); } @@ -170,11 +190,14 @@ PHP_METHOD(Phalcon_Registry, offsetUnset) { */ PHP_METHOD(Phalcon_Registry, count) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - RETURN_LONG(zephir_fast_count_int(_0 TSRMLS_CC)); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + RETURN_LONG(zephir_fast_count_int(&_0 TSRMLS_CC)); } @@ -183,15 +206,18 @@ PHP_METHOD(Phalcon_Registry, count) { */ PHP_METHOD(Phalcon_Registry, next) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - ZEPHIR_MAKE_REF(_0); - ZEPHIR_CALL_FUNCTION(NULL, "next", NULL, 431, _0); - ZEPHIR_UNREF(_0); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_MAKE_REF(&_0); + ZEPHIR_CALL_FUNCTION(NULL, "next", NULL, 385, &_0); + ZEPHIR_UNREF(&_0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -202,15 +228,16 @@ PHP_METHOD(Phalcon_Registry, next) { */ PHP_METHOD(Phalcon_Registry, key) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - ZEPHIR_MAKE_REF(_0); - ZEPHIR_RETURN_CALL_FUNCTION("key", NULL, 432, _0); - ZEPHIR_UNREF(_0); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_FUNCTION("key", NULL, 386, &_0); zephir_check_call_status(); RETURN_MM(); @@ -221,15 +248,18 @@ PHP_METHOD(Phalcon_Registry, key) { */ PHP_METHOD(Phalcon_Registry, rewind) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - ZEPHIR_MAKE_REF(_0); - ZEPHIR_CALL_FUNCTION(NULL, "reset", NULL, 433, _0); - ZEPHIR_UNREF(_0); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_MAKE_REF(&_0); + ZEPHIR_CALL_FUNCTION(NULL, "reset", NULL, 387, &_0); + ZEPHIR_UNREF(&_0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -240,17 +270,19 @@ PHP_METHOD(Phalcon_Registry, rewind) { */ PHP_METHOD(Phalcon_Registry, valid) { - zval *_0, *_1 = NULL; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - ZEPHIR_MAKE_REF(_0); - ZEPHIR_CALL_FUNCTION(&_1, "key", NULL, 432, _0); - ZEPHIR_UNREF(_0); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_FUNCTION(&_1, "key", NULL, 386, &_0); zephir_check_call_status(); - RETURN_MM_BOOL(Z_TYPE_P(_1) != IS_NULL); + RETURN_MM_BOOL(Z_TYPE_P(&_1) != IS_NULL); } @@ -259,15 +291,16 @@ PHP_METHOD(Phalcon_Registry, valid) { */ PHP_METHOD(Phalcon_Registry, current) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - ZEPHIR_MAKE_REF(_0); - ZEPHIR_RETURN_CALL_FUNCTION("current", NULL, 434, _0); - ZEPHIR_UNREF(_0); + zephir_read_property(&_0, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_FUNCTION("current", NULL, 388, &_0); zephir_check_call_status(); RETURN_MM(); @@ -279,25 +312,29 @@ PHP_METHOD(Phalcon_Registry, current) { PHP_METHOD(Phalcon_Registry, __set) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *key_param = NULL, *value; - zval *key = NULL; + zval *key_param = NULL, *value, value_sub; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &key_param, &value); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "offsetset", NULL, 435, key, value); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "offsetset", NULL, 389, &key, value); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -310,24 +347,27 @@ PHP_METHOD(Phalcon_Registry, __get) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *key_param = NULL; - zval *key = NULL; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "offsetget", NULL, 436, key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "offsetget", NULL, 390, &key); zephir_check_call_status(); RETURN_MM(); @@ -337,24 +377,27 @@ PHP_METHOD(Phalcon_Registry, __isset) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *key_param = NULL; - zval *key = NULL; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "offsetexists", NULL, 437, key); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "offsetexists", NULL, 391, &key); zephir_check_call_status(); RETURN_MM(); @@ -364,24 +407,27 @@ PHP_METHOD(Phalcon_Registry, __unset) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *key_param = NULL; - zval *key = NULL; + zval key; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&key); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &key_param); if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) { - zephir_get_strval(key, key_param); + zephir_get_strval(&key, key_param); } else { - ZEPHIR_INIT_VAR(key); - ZVAL_EMPTY_STRING(key); + ZEPHIR_INIT_VAR(&key); + ZVAL_EMPTY_STRING(&key); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "offsetunset", NULL, 438, key); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "offsetunset", NULL, 392, &key); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/phalcon/registry.zep.h b/ext/phalcon/registry.zep.h index 68897f63ea2..72cc0b45e25 100644 --- a/ext/phalcon/registry.zep.h +++ b/ext/phalcon/registry.zep.h @@ -19,7 +19,11 @@ PHP_METHOD(Phalcon_Registry, __get); PHP_METHOD(Phalcon_Registry, __isset); PHP_METHOD(Phalcon_Registry, __unset); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_registry_offsetexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry_offsetexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry_offsetexists, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() @@ -36,21 +40,62 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_registry_offsetunset, 0, 0, 1) ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry_count, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry_key, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry_key, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry_valid, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry_valid, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_registry___set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_registry___get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_registry___isset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry___isset, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_registry___isset, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_registry___unset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_registry_method_entry) { @@ -59,11 +104,11 @@ ZEPHIR_INIT_FUNCS(phalcon_registry_method_entry) { PHP_ME(Phalcon_Registry, offsetGet, arginfo_phalcon_registry_offsetget, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Registry, offsetSet, arginfo_phalcon_registry_offsetset, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Registry, offsetUnset, arginfo_phalcon_registry_offsetunset, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Registry, count, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Registry, count, arginfo_phalcon_registry_count, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Registry, next, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Registry, key, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Registry, key, arginfo_phalcon_registry_key, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Registry, rewind, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Registry, valid, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Registry, valid, arginfo_phalcon_registry_valid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Registry, current, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Registry, __set, arginfo_phalcon_registry___set, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Registry, __get, arginfo_phalcon_registry___get, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) diff --git a/ext/phalcon/security.zep.c b/ext/phalcon/security.zep.c index b89949a18d5..077b7e3490c 100644 --- a/ext/phalcon/security.zep.c +++ b/ext/phalcon/security.zep.c @@ -63,25 +63,25 @@ ZEPHIR_INIT_CLASS(Phalcon_Security) { zend_declare_property_null(phalcon_security_ce, SL("_defaultHash"), ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_DEFAULT"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_DEFAULT"), 0); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_STD_DES"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_STD_DES"), 1); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_EXT_DES"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_EXT_DES"), 2); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_MD5"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_MD5"), 3); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_BLOWFISH"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_BLOWFISH"), 4); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_BLOWFISH_A"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_BLOWFISH_A"), 5); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_BLOWFISH_X"), 6 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_BLOWFISH_X"), 6); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_BLOWFISH_Y"), 7 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_BLOWFISH_Y"), 7); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_SHA256"), 8 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_SHA256"), 8); - zend_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_SHA512"), 9 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_security_ce, SL("CRYPT_SHA512"), 9); zend_class_implements(phalcon_security_ce TSRMLS_CC, 1, phalcon_di_injectionawareinterface_ce); return SUCCESS; @@ -90,20 +90,24 @@ ZEPHIR_INIT_CLASS(Phalcon_Security) { PHP_METHOD(Phalcon_Security, setWorkFactor) { - zval *workFactor; + zval *workFactor, workFactor_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&workFactor_sub); zephir_fetch_params(0, 1, 0, &workFactor); - zephir_update_property_this(getThis(), SL("_workFactor"), workFactor TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_workFactor"), workFactor); RETURN_THISW(); } PHP_METHOD(Phalcon_Security, getWorkFactor) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_workFactor"); @@ -114,18 +118,21 @@ PHP_METHOD(Phalcon_Security, getWorkFactor) { */ PHP_METHOD(Phalcon_Security, __construct) { - zval *_0; + zval _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - object_init_ex(_0, phalcon_security_random_ce); - if (zephir_has_constructor(_0 TSRMLS_CC)) { - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 0); + ZEPHIR_INIT_VAR(&_0); + object_init_ex(&_0, phalcon_security_random_ce); + if (zephir_has_constructor(&_0 TSRMLS_CC)) { + ZEPHIR_CALL_METHOD(NULL, &_0, "__construct", NULL, 0); zephir_check_call_status(); } - zephir_update_property_this(getThis(), SL("_random"), _0 TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_random"), &_0); ZEPHIR_MM_RESTORE(); } @@ -135,13 +142,16 @@ PHP_METHOD(Phalcon_Security, __construct) { */ PHP_METHOD(Phalcon_Security, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -150,7 +160,8 @@ PHP_METHOD(Phalcon_Security, setDI) { */ PHP_METHOD(Phalcon_Security, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -161,21 +172,24 @@ PHP_METHOD(Phalcon_Security, getDI) { */ PHP_METHOD(Phalcon_Security, setRandomBytes) { - zval *randomBytes_param = NULL, *_0; + zval *randomBytes_param = NULL, _0; long randomBytes; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &randomBytes_param); if (UNEXPECTED(Z_TYPE_P(randomBytes_param) != IS_LONG)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'randomBytes' must be a long") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'randomBytes' must be of the type long") TSRMLS_CC); RETURN_NULL(); } randomBytes = Z_LVAL_P(randomBytes_param); ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, randomBytes); - zephir_update_property_this(getThis(), SL("_numberBytes"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, randomBytes); + zephir_update_property_zval(this_ptr, SL("_numberBytes"), &_0); RETURN_THISW(); } @@ -185,7 +199,8 @@ PHP_METHOD(Phalcon_Security, setRandomBytes) { */ PHP_METHOD(Phalcon_Security, getRandomBytes) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_numberBytes"); @@ -196,7 +211,8 @@ PHP_METHOD(Phalcon_Security, getRandomBytes) { */ PHP_METHOD(Phalcon_Security, getRandom) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_random"); @@ -208,8 +224,14 @@ PHP_METHOD(Phalcon_Security, getRandom) { PHP_METHOD(Phalcon_Security, getSaltBytes) { zend_bool _3$$4; - zval *numberBytes_param = NULL, *safeBytes = NULL, *_0$$3, *_1$$4, *_2$$4 = NULL; + zval *numberBytes_param = NULL, safeBytes, _0$$3, _1$$4, _2$$4; zend_long numberBytes, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&safeBytes); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &numberBytes_param); @@ -222,26 +244,25 @@ PHP_METHOD(Phalcon_Security, getSaltBytes) { if (!(numberBytes)) { - ZEPHIR_OBS_VAR(_0$$3); - zephir_read_property_this(&_0$$3, this_ptr, SL("_numberBytes"), PH_NOISY_CC); - numberBytes = zephir_get_intval(_0$$3); + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property(&_0$$3, this_ptr, SL("_numberBytes"), PH_NOISY_CC); + numberBytes = zephir_get_intval(&_0$$3); } while (1) { - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_random"), PH_NOISY_CC); - ZEPHIR_INIT_NVAR(_2$$4); - ZVAL_LONG(_2$$4, numberBytes); - ZEPHIR_CALL_METHOD(&safeBytes, _1$$4, "base64safe", NULL, 0, _2$$4); + zephir_read_property(&_1$$4, this_ptr, SL("_random"), PH_NOISY_CC | PH_READONLY); + ZVAL_LONG(&_2$$4, numberBytes); + ZEPHIR_CALL_METHOD(&safeBytes, &_1$$4, "base64safe", NULL, 0, &_2$$4); zephir_check_call_status(); - _3$$4 = !zephir_is_true(safeBytes); + _3$$4 = !zephir_is_true(&safeBytes); if (!(_3$$4)) { - _3$$4 = zephir_fast_strlen_ev(safeBytes) < numberBytes; + _3$$4 = zephir_fast_strlen_ev(&safeBytes) < numberBytes; } if (_3$$4) { continue; } break; } - RETURN_CCTOR(safeBytes); + RETURN_CCTOR(&safeBytes); } @@ -251,13 +272,29 @@ PHP_METHOD(Phalcon_Security, getSaltBytes) { PHP_METHOD(Phalcon_Security, hash) { zend_long workFactor, ZEPHIR_LAST_CALL_STATUS, hash = 0; - zval *password_param = NULL, *workFactor_param = NULL, *saltBytes = NULL, *_1, *_0$$3, *_2$$12 = NULL, *_3$$12, *_4$$13, *_5$$15 = NULL, *_6$$15, *_7$$17, _8$$17, _9$$17, *_10$$17 = NULL, *_11$$17; - zval *password = NULL, *variant = NULL; + zval *password_param = NULL, *workFactor_param = NULL, saltBytes, _1, _0$$3, _2$$12, _3$$12, _4$$13, _5$$15, _6$$15, _7$$17, _8$$17, _9$$17, _10$$17; + zval password, variant; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&password); + ZVAL_UNDEF(&variant); + ZVAL_UNDEF(&saltBytes); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_2$$12); + ZVAL_UNDEF(&_3$$12); + ZVAL_UNDEF(&_4$$13); + ZVAL_UNDEF(&_5$$15); + ZVAL_UNDEF(&_6$$15); + ZVAL_UNDEF(&_7$$17); + ZVAL_UNDEF(&_8$$17); + ZVAL_UNDEF(&_9$$17); + ZVAL_UNDEF(&_10$$17); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &password_param, &workFactor_param); - zephir_get_strval(password, password_param); + zephir_get_strval(&password, password_param); if (!workFactor_param) { workFactor = 0; } else { @@ -266,98 +303,95 @@ PHP_METHOD(Phalcon_Security, hash) { if (!(workFactor)) { - ZEPHIR_OBS_VAR(_0$$3); - zephir_read_property_this(&_0$$3, this_ptr, SL("_workFactor"), PH_NOISY_CC); - workFactor = zephir_get_intval(_0$$3); + ZEPHIR_OBS_VAR(&_0$$3); + zephir_read_property(&_0$$3, this_ptr, SL("_workFactor"), PH_NOISY_CC); + workFactor = zephir_get_intval(&_0$$3); } - ZEPHIR_OBS_VAR(_1); - zephir_read_property_this(&_1, this_ptr, SL("_defaultHash"), PH_NOISY_CC); - hash = zephir_get_intval(_1); + ZEPHIR_OBS_VAR(&_1); + zephir_read_property(&_1, this_ptr, SL("_defaultHash"), PH_NOISY_CC); + hash = zephir_get_intval(&_1); do { if (hash == 5) { - ZEPHIR_INIT_VAR(variant); - ZVAL_STRING(variant, "a", 1); + ZEPHIR_INIT_VAR(&variant); + ZVAL_STRING(&variant, "a"); break; } if (hash == 6) { - ZEPHIR_INIT_NVAR(variant); - ZVAL_STRING(variant, "x", 1); + ZEPHIR_INIT_NVAR(&variant); + ZVAL_STRING(&variant, "x"); break; } if (hash == 7) { - ZEPHIR_INIT_NVAR(variant); - ZVAL_STRING(variant, "y", 1); + ZEPHIR_INIT_NVAR(&variant); + ZVAL_STRING(&variant, "y"); break; } if (hash == 3) { - ZEPHIR_INIT_NVAR(variant); - ZVAL_STRING(variant, "1", 1); + ZEPHIR_INIT_NVAR(&variant); + ZVAL_STRING(&variant, "1"); break; } if (hash == 8) { - ZEPHIR_INIT_NVAR(variant); - ZVAL_STRING(variant, "5", 1); + ZEPHIR_INIT_NVAR(&variant); + ZVAL_STRING(&variant, "5"); break; } if (hash == 9) { - ZEPHIR_INIT_NVAR(variant); - ZVAL_STRING(variant, "6", 1); + ZEPHIR_INIT_NVAR(&variant); + ZVAL_STRING(&variant, "6"); break; } - ZEPHIR_INIT_NVAR(variant); - ZVAL_STRING(variant, "y", 1); + ZEPHIR_INIT_NVAR(&variant); + ZVAL_STRING(&variant, "y"); break; } while(0); do { if (hash == 1 || hash == 2) { if (hash == 2) { - ZEPHIR_INIT_VAR(_3$$12); - ZVAL_LONG(_3$$12, 8); - ZEPHIR_CALL_METHOD(&_2$$12, this_ptr, "getsaltbytes", NULL, 0, _3$$12); + ZVAL_LONG(&_3$$12, 8); + ZEPHIR_CALL_METHOD(&_2$$12, this_ptr, "getsaltbytes", NULL, 0, &_3$$12); zephir_check_call_status(); - ZEPHIR_INIT_VAR(saltBytes); - ZEPHIR_CONCAT_SV(saltBytes, "_", _2$$12); + ZEPHIR_INIT_VAR(&saltBytes); + ZEPHIR_CONCAT_SV(&saltBytes, "_", &_2$$12); } else { - ZEPHIR_INIT_VAR(_4$$13); - ZVAL_LONG(_4$$13, 2); - ZEPHIR_CALL_METHOD(&saltBytes, this_ptr, "getsaltbytes", NULL, 0, _4$$13); + ZVAL_LONG(&_4$$13, 2); + ZEPHIR_CALL_METHOD(&saltBytes, this_ptr, "getsaltbytes", NULL, 0, &_4$$13); zephir_check_call_status(); } - if (Z_TYPE_P(saltBytes) != IS_STRING) { + if (Z_TYPE_P(&saltBytes) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "Unable to get random bytes for the salt", "phalcon/security.zep", 222); return; } - ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 439, password, saltBytes); + ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 393, &password, &saltBytes); zephir_check_call_status(); RETURN_MM(); } if (hash == 3 || hash == 8 || hash == 9) { - ZEPHIR_INIT_VAR(_5$$15); + ZEPHIR_INIT_VAR(&_5$$15); if (hash == 3) { - ZEPHIR_INIT_NVAR(_5$$15); - ZVAL_LONG(_5$$15, 12); + ZEPHIR_INIT_NVAR(&_5$$15); + ZVAL_LONG(&_5$$15, 12); } else { - ZEPHIR_INIT_NVAR(_5$$15); - ZVAL_LONG(_5$$15, 16); + ZEPHIR_INIT_NVAR(&_5$$15); + ZVAL_LONG(&_5$$15, 16); } - ZEPHIR_CALL_METHOD(&saltBytes, this_ptr, "getsaltbytes", NULL, 0, _5$$15); + ZEPHIR_CALL_METHOD(&saltBytes, this_ptr, "getsaltbytes", NULL, 0, &_5$$15); zephir_check_call_status(); - if (Z_TYPE_P(saltBytes) != IS_STRING) { + if (Z_TYPE_P(&saltBytes) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "Unable to get random bytes for the salt", "phalcon/security.zep", 239); return; } - ZEPHIR_INIT_VAR(_6$$15); - ZEPHIR_CONCAT_SVSVS(_6$$15, "$", variant, "$", saltBytes, "$"); - ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 439, password, _6$$15); + ZEPHIR_INIT_VAR(&_6$$15); + ZEPHIR_CONCAT_SVSVS(&_6$$15, "$", &variant, "$", &saltBytes, "$"); + ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 393, &password, &_6$$15); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_INIT_VAR(_7$$17); - ZVAL_LONG(_7$$17, 22); - ZEPHIR_CALL_METHOD(&saltBytes, this_ptr, "getsaltbytes", NULL, 0, _7$$17); + ZVAL_LONG(&_7$$17, 22); + ZEPHIR_CALL_METHOD(&saltBytes, this_ptr, "getsaltbytes", NULL, 0, &_7$$17); zephir_check_call_status(); - if (Z_TYPE_P(saltBytes) != IS_STRING) { + if (Z_TYPE_P(&saltBytes) != IS_STRING) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "Unable to get random bytes for the salt", "phalcon/security.zep", 262); return; } @@ -368,20 +402,19 @@ PHP_METHOD(Phalcon_Security, hash) { workFactor = 31; } } - ZEPHIR_SINIT_VAR(_8$$17); - ZVAL_STRING(&_8$$17, "%02s", 0); - ZEPHIR_SINIT_VAR(_9$$17); - ZVAL_LONG(&_9$$17, workFactor); - ZEPHIR_CALL_FUNCTION(&_10$$17, "sprintf", NULL, 164, &_8$$17, &_9$$17); + ZEPHIR_INIT_VAR(&_8$$17); + ZVAL_STRING(&_8$$17, "%02s"); + ZVAL_LONG(&_7$$17, workFactor); + ZEPHIR_CALL_FUNCTION(&_9$$17, "sprintf", NULL, 145, &_8$$17, &_7$$17); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_11$$17); - ZEPHIR_CONCAT_SVSVSVS(_11$$17, "$2", variant, "$", _10$$17, "$", saltBytes, "$"); - ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 439, password, _11$$17); + ZEPHIR_INIT_VAR(&_10$$17); + ZEPHIR_CONCAT_SVSVSVS(&_10$$17, "$2", &variant, "$", &_9$$17, "$", &saltBytes, "$"); + ZEPHIR_RETURN_CALL_FUNCTION("crypt", NULL, 393, &password, &_10$$17); zephir_check_call_status(); RETURN_MM(); } while(0); - RETURN_MM_STRING("", 1); + RETURN_MM_STRING(""); } @@ -395,14 +428,21 @@ PHP_METHOD(Phalcon_Security, checkHash) { long _3; char ch = 0; zend_long maxPassLength, ZEPHIR_LAST_CALL_STATUS, i = 0, sum = 0, cryptedLength = 0, passwordLength = 0; - zval *password_param = NULL, *passwordHash_param = NULL, *maxPassLength_param = NULL, *_1 = NULL; - zval *password = NULL, *passwordHash = NULL, *cryptedHash = NULL, *_2 = NULL; + zval *password_param = NULL, *passwordHash_param = NULL, *maxPassLength_param = NULL, _1; + zval password, passwordHash, cryptedHash, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&password); + ZVAL_UNDEF(&passwordHash); + ZVAL_UNDEF(&cryptedHash); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &password_param, &passwordHash_param, &maxPassLength_param); - zephir_get_strval(password, password_param); - zephir_get_strval(passwordHash, passwordHash_param); + zephir_get_strval(&password, password_param); + zephir_get_strval(&passwordHash, passwordHash_param); if (!maxPassLength_param) { maxPassLength = 0; } else { @@ -413,24 +453,24 @@ PHP_METHOD(Phalcon_Security, checkHash) { if (maxPassLength) { _0$$3 = maxPassLength > 0; if (_0$$3) { - _0$$3 = zephir_fast_strlen_ev(password) > maxPassLength; + _0$$3 = zephir_fast_strlen_ev(&password) > maxPassLength; } if (_0$$3) { RETURN_MM_BOOL(0); } } - ZEPHIR_CALL_FUNCTION(&_1, "crypt", NULL, 439, password, passwordHash); + ZEPHIR_CALL_FUNCTION(&_1, "crypt", NULL, 393, &password, &passwordHash); zephir_check_call_status(); - zephir_get_strval(_2, _1); - ZEPHIR_CPY_WRT(cryptedHash, _2); - cryptedLength = zephir_fast_strlen_ev(cryptedHash); - passwordLength = zephir_fast_strlen_ev(passwordHash); - zephir_concat_self(&cryptedHash, passwordHash TSRMLS_CC); + zephir_get_strval(&_2, &_1); + ZEPHIR_CPY_WRT(&cryptedHash, &_2); + cryptedLength = zephir_fast_strlen_ev(&cryptedHash); + passwordLength = zephir_fast_strlen_ev(&passwordHash); + zephir_concat_self(&cryptedHash, &passwordHash TSRMLS_CC); sum = (cryptedLength - passwordLength); - for (_3 = 0; _3 < Z_STRLEN_P(passwordHash); _3++) { + for (_3 = 0; _3 < Z_STRLEN_P(&passwordHash); _3++) { i = _3; - ch = ZEPHIR_STRING_OFFSET(passwordHash, _3); - _4$$5 = ZEPHIR_STRING_OFFSET(cryptedHash, i); + ch = ZEPHIR_STRING_OFFSET(&passwordHash, _3); + _4$$5 = ZEPHIR_STRING_OFFSET(&cryptedHash, i); sum = (sum | ((_4$$5 ^ ch))); } RETURN_MM_BOOL(0 == sum); @@ -443,15 +483,18 @@ PHP_METHOD(Phalcon_Security, checkHash) { PHP_METHOD(Phalcon_Security, isLegacyHash) { zval *passwordHash_param = NULL; - zval *passwordHash = NULL; + zval passwordHash; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&passwordHash); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &passwordHash_param); - zephir_get_strval(passwordHash, passwordHash_param); + zephir_get_strval(&passwordHash, passwordHash_param); - RETURN_MM_BOOL(zephir_start_with_str(passwordHash, SL("$2a$"))); + RETURN_MM_BOOL(zephir_start_with_str(&passwordHash, SL("$2a$"))); } @@ -460,33 +503,44 @@ PHP_METHOD(Phalcon_Security, isLegacyHash) { */ PHP_METHOD(Phalcon_Security, getTokenKey) { - zval *dependencyInjector = NULL, *session = NULL, *_0, *_1$$3, *_2$$3 = NULL, *_3$$3, *_4$$3 = NULL, *_5$$3, *_6$$3, *_7$$3; + zval dependencyInjector, session, _0, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_tokenKey"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _1$$3); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_tokenKey"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + zephir_read_property(&_1$$3, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_1$$3); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/security.zep", 327); return; } - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_random"), PH_NOISY_CC); - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_numberBytes"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2$$3, _1$$3, "base64safe", NULL, 0, _3$$3); + zephir_read_property(&_1$$3, this_ptr, SL("_random"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_3$$3, this_ptr, SL("_numberBytes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "base64safe", NULL, 0, &_3$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_tokenKey"), _2$$3 TSRMLS_CC); - ZEPHIR_INIT_VAR(_5$$3); - ZVAL_STRING(_5$$3, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_4$$3, dependencyInjector, "getshared", NULL, 0, _5$$3); - zephir_check_temp_parameter(_5$$3); + zephir_update_property_zval(this_ptr, SL("_tokenKey"), &_2$$3); + ZEPHIR_INIT_VAR(&_5$$3); + ZVAL_STRING(&_5$$3, "session"); + ZEPHIR_CALL_METHOD(&_4$$3, &dependencyInjector, "getshared", NULL, 0, &_5$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(session, _4$$3); - _6$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_tokenKeySessionID"), PH_NOISY_CC); - _7$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_tokenKey"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, session, "set", NULL, 0, _6$$3, _7$$3); + ZEPHIR_CPY_WRT(&session, &_4$$3); + zephir_read_property(&_6$$3, this_ptr, SL("_tokenKeySessionID"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_7$$3, this_ptr, SL("_tokenKey"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &session, "set", NULL, 0, &_6$$3, &_7$$3); zephir_check_call_status(); } RETURN_MM_MEMBER(getThis(), "_tokenKey"); @@ -498,33 +552,44 @@ PHP_METHOD(Phalcon_Security, getTokenKey) { */ PHP_METHOD(Phalcon_Security, getToken) { - zval *dependencyInjector = NULL, *session = NULL, *_0, *_1$$3, *_2$$3 = NULL, *_3$$3, *_4$$3, *_5$$3 = NULL, *_6$$3, *_7$$3; + zval dependencyInjector, session, _0, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_6$$3); + ZVAL_UNDEF(&_7$$3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_token"), PH_NOISY_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_random"), PH_NOISY_CC); - _3$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_numberBytes"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2$$3, _1$$3, "base64safe", NULL, 0, _3$$3); + zephir_read_property(&_0, this_ptr, SL("_token"), PH_NOISY_CC | PH_READONLY); + if (Z_TYPE_P(&_0) == IS_NULL) { + zephir_read_property(&_1$$3, this_ptr, SL("_random"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_3$$3, this_ptr, SL("_numberBytes"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2$$3, &_1$$3, "base64safe", NULL, 0, &_3$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_token"), _2$$3 TSRMLS_CC); - _4$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _4$$3); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_update_property_zval(this_ptr, SL("_token"), &_2$$3); + zephir_read_property(&_4$$3, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_4$$3); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/security.zep", 351); return; } - ZEPHIR_INIT_VAR(_6$$3); - ZVAL_STRING(_6$$3, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_5$$3, dependencyInjector, "getshared", NULL, 0, _6$$3); - zephir_check_temp_parameter(_6$$3); + ZEPHIR_INIT_VAR(&_6$$3); + ZVAL_STRING(&_6$$3, "session"); + ZEPHIR_CALL_METHOD(&_5$$3, &dependencyInjector, "getshared", NULL, 0, &_6$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(session, _5$$3); - _4$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_tokenValueSessionID"), PH_NOISY_CC); - _7$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_token"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, session, "set", NULL, 0, _4$$3, _7$$3); + ZEPHIR_CPY_WRT(&session, &_5$$3); + zephir_read_property(&_4$$3, this_ptr, SL("_tokenValueSessionID"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_7$$3, this_ptr, SL("_token"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &session, "set", NULL, 0, &_4$$3, &_7$$3); zephir_check_call_status(); } RETURN_MM_MEMBER(getThis(), "_token"); @@ -538,18 +603,36 @@ PHP_METHOD(Phalcon_Security, checkToken) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool destroyIfValid, _5; - zval *tokenKey = NULL, *tokenValue = NULL, *destroyIfValid_param = NULL, *dependencyInjector = NULL, *session = NULL, *request = NULL, *equals = NULL, *userToken = NULL, *knownToken = NULL, *_0, *_1 = NULL, *_2, *_3$$4, *_4$$6; + zval *tokenKey = NULL, tokenKey_sub, *tokenValue = NULL, tokenValue_sub, *destroyIfValid_param = NULL, __$null, dependencyInjector, session, request, equals, userToken, knownToken, _0, _1, _2, _3$$4, _4$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tokenKey_sub); + ZVAL_UNDEF(&tokenValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&request); + ZVAL_UNDEF(&equals); + ZVAL_UNDEF(&userToken); + ZVAL_UNDEF(&knownToken); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 3, &tokenKey, &tokenValue, &destroyIfValid_param); if (!tokenKey) { - ZEPHIR_CPY_WRT(tokenKey, ZEPHIR_GLOBAL(global_null)); + tokenKey = &tokenKey_sub; + ZEPHIR_CPY_WRT(tokenKey, &__$null); } else { ZEPHIR_SEPARATE_PARAM(tokenKey); } if (!tokenValue) { - tokenValue = ZEPHIR_GLOBAL(global_null); + tokenValue = &tokenValue_sub; + tokenValue = &__$null; } if (!destroyIfValid_param) { destroyIfValid = 1; @@ -558,44 +641,42 @@ PHP_METHOD(Phalcon_Security, checkToken) { } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/security.zep", 371); return; } - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "getshared", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "session"); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "getshared", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_CPY_WRT(session, _1); + ZEPHIR_CPY_WRT(&session, &_1); if (!(zephir_is_true(tokenKey))) { - _3$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_tokenKeySessionID"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&tokenKey, session, "get", NULL, 0, _3$$4); + zephir_read_property(&_3$$4, this_ptr, SL("_tokenKeySessionID"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(tokenKey, &session, "get", NULL, 0, &_3$$4); zephir_check_call_status(); } if (!(zephir_is_true(tokenKey))) { RETURN_MM_BOOL(0); } if (!(zephir_is_true(tokenValue))) { - ZEPHIR_INIT_VAR(_4$$6); - ZVAL_STRING(_4$$6, "request", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&request, dependencyInjector, "getshared", NULL, 0, _4$$6); - zephir_check_temp_parameter(_4$$6); + ZEPHIR_INIT_VAR(&_4$$6); + ZVAL_STRING(&_4$$6, "request"); + ZEPHIR_CALL_METHOD(&request, &dependencyInjector, "getshared", NULL, 0, &_4$$6); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&userToken, request, "getpost", NULL, 0, tokenKey); + ZEPHIR_CALL_METHOD(&userToken, &request, "getpost", NULL, 0, tokenKey); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(userToken, tokenValue); + ZEPHIR_CPY_WRT(&userToken, tokenValue); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_tokenValueSessionID"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&knownToken, session, "get", NULL, 0, _0); + zephir_read_property(&_0, this_ptr, SL("_tokenValueSessionID"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&knownToken, &session, "get", NULL, 0, &_0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(equals); - ZEPHIR_INIT_NVAR(equals); - ZVAL_BOOL(equals, zephir_hash_equals(knownToken, userToken)); - _5 = zephir_is_true(equals); + ZEPHIR_INIT_VAR(&equals); + ZEPHIR_INIT_NVAR(&equals); + ZVAL_BOOL(&equals, zephir_hash_equals(&knownToken, &userToken)); + _5 = zephir_is_true(&equals); if (_5) { _5 = destroyIfValid; } @@ -603,7 +684,7 @@ PHP_METHOD(Phalcon_Security, checkToken) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "destroytoken", NULL, 0); zephir_check_call_status(); } - RETURN_CCTOR(equals); + RETURN_CCTOR(&equals); } @@ -612,25 +693,31 @@ PHP_METHOD(Phalcon_Security, checkToken) { */ PHP_METHOD(Phalcon_Security, getSessionToken) { - zval *dependencyInjector = NULL, *session = NULL, *_0, *_1 = NULL, *_2; + zval dependencyInjector, session, _0, _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/security.zep", 424); return; } - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "getshared", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "session"); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "getshared", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_CPY_WRT(session, _1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_tokenValueSessionID"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(session, "get", NULL, 0, _0); + ZEPHIR_CPY_WRT(&session, &_1); + zephir_read_property(&_0, this_ptr, SL("_tokenValueSessionID"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&session, "get", NULL, 0, &_0); zephir_check_call_status(); RETURN_MM(); @@ -641,31 +728,39 @@ PHP_METHOD(Phalcon_Security, getSessionToken) { */ PHP_METHOD(Phalcon_Security, destroyToken) { - zval *dependencyInjector = NULL, *session = NULL, *_0, *_1 = NULL, *_2, *_3; + zval __$null, dependencyInjector, session, _0, _1, _2, _3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - ZEPHIR_CPY_WRT(dependencyInjector, _0); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + zephir_read_property(&_0, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CPY_WRT(&dependencyInjector, &_0); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "A dependency injection container is required to access the 'session' service", "phalcon/security.zep", 442); return; } - ZEPHIR_INIT_VAR(_2); - ZVAL_STRING(_2, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_1, dependencyInjector, "getshared", NULL, 0, _2); - zephir_check_temp_parameter(_2); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "session"); + ZEPHIR_CALL_METHOD(&_1, &dependencyInjector, "getshared", NULL, 0, &_2); zephir_check_call_status(); - ZEPHIR_CPY_WRT(session, _1); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_tokenKeySessionID"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, session, "remove", NULL, 0, _0); + ZEPHIR_CPY_WRT(&session, &_1); + zephir_read_property(&_0, this_ptr, SL("_tokenKeySessionID"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &session, "remove", NULL, 0, &_0); zephir_check_call_status(); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_tokenValueSessionID"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, session, "remove", NULL, 0, _3); + zephir_read_property(&_3, this_ptr, SL("_tokenValueSessionID"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &session, "remove", NULL, 0, &_3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_token"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); - zephir_update_property_this(getThis(), SL("_tokenKey"), ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_token"), &__$null); + zephir_update_property_zval(this_ptr, SL("_tokenKey"), &__$null); RETURN_THIS(); } @@ -677,15 +772,24 @@ PHP_METHOD(Phalcon_Security, computeHmac) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool raw; - zval *data_param = NULL, *key_param = NULL, *algo_param = NULL, *raw_param = NULL, *hmac = NULL, _0, *_1$$3; - zval *data = NULL, *key = NULL, *algo = NULL, *_2$$3; + zval *data_param = NULL, *key_param = NULL, *algo_param = NULL, *raw_param = NULL, hmac, _0, _1$$3; + zval data, key, algo, _2$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&algo); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&hmac); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 3, 1, &data_param, &key_param, &algo_param, &raw_param); - zephir_get_strval(data, data_param); - zephir_get_strval(key, key_param); - zephir_get_strval(algo, algo_param); + zephir_get_strval(&data, data_param); + zephir_get_strval(&key, key_param); + zephir_get_strval(&algo, algo_param); if (!raw_param) { raw = 0; } else { @@ -693,22 +797,21 @@ PHP_METHOD(Phalcon_Security, computeHmac) { } - ZEPHIR_SINIT_VAR(_0); ZVAL_BOOL(&_0, (raw ? 1 : 0)); - ZEPHIR_CALL_FUNCTION(&hmac, "hash_hmac", NULL, 159, algo, data, key, &_0); + ZEPHIR_CALL_FUNCTION(&hmac, "hash_hmac", NULL, 139, &algo, &data, &key, &_0); zephir_check_call_status(); - if (!(zephir_is_true(hmac))) { - ZEPHIR_INIT_VAR(_1$$3); - object_init_ex(_1$$3, phalcon_security_exception_ce); - ZEPHIR_INIT_VAR(_2$$3); - ZEPHIR_CONCAT_SV(_2$$3, "Unknown hashing algorithm: %s", algo); - ZEPHIR_CALL_METHOD(NULL, _1$$3, "__construct", NULL, 9, _2$$3); + if (!(zephir_is_true(&hmac))) { + ZEPHIR_INIT_VAR(&_1$$3); + object_init_ex(&_1$$3, phalcon_security_exception_ce); + ZEPHIR_INIT_VAR(&_2$$3); + ZEPHIR_CONCAT_SV(&_2$$3, "Unknown hashing algorithm: %s", &algo); + ZEPHIR_CALL_METHOD(NULL, &_1$$3, "__construct", NULL, 4, &_2$$3); zephir_check_call_status(); - zephir_throw_exception_debug(_1$$3, "phalcon/security.zep", 465 TSRMLS_CC); + zephir_throw_exception_debug(&_1$$3, "phalcon/security.zep", 465 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - RETURN_CCTOR(hmac); + RETURN_CCTOR(&hmac); } @@ -717,8 +820,11 @@ PHP_METHOD(Phalcon_Security, computeHmac) { */ PHP_METHOD(Phalcon_Security, setDefaultHash) { - zval *defaultHash_param = NULL, *_0; + zval *defaultHash_param = NULL, _0; zend_long defaultHash; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &defaultHash_param); @@ -726,8 +832,8 @@ PHP_METHOD(Phalcon_Security, setDefaultHash) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_LONG(_0, defaultHash); - zephir_update_property_this(getThis(), SL("_defaultHash"), _0 TSRMLS_CC); + ZVAL_LONG(&_0, defaultHash); + zephir_update_property_zval(this_ptr, SL("_defaultHash"), &_0); RETURN_THISW(); } @@ -737,7 +843,8 @@ PHP_METHOD(Phalcon_Security, setDefaultHash) { */ PHP_METHOD(Phalcon_Security, getDefaultHash) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_defaultHash"); @@ -750,25 +857,31 @@ PHP_METHOD(Phalcon_Security, getDefaultHash) { */ PHP_METHOD(Phalcon_Security, hasLibreSsl) { - zval _0 = zval_used_for_init, *_1 = NULL, *_2, *_3; + zval _0, _1, _2, _3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "OPENSSL_VERSION_TEXT", 0); - ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 37, &_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "OPENSSL_VERSION_TEXT"); + ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 31, &_0); zephir_check_call_status(); - if (!(zephir_is_true(_1))) { + if (!(zephir_is_true(&_1))) { RETURN_MM_BOOL(0); } - ZEPHIR_INIT_VAR(_2); - ZEPHIR_GET_CONSTANT(_2, "OPENSSL_VERSION_TEXT"); - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "LibreSSL", 0); - ZEPHIR_INIT_VAR(_3); - zephir_fast_strpos(_3, _2, &_0, 0 ); - RETURN_MM_BOOL(ZEPHIR_IS_LONG_IDENTICAL(_3, 0)); + ZEPHIR_INIT_NVAR(&_0); + ZEPHIR_GET_CONSTANT(&_0, "OPENSSL_VERSION_TEXT"); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "LibreSSL"); + ZEPHIR_INIT_VAR(&_3); + zephir_fast_strpos(&_3, &_0, &_2, 0 ); + RETURN_MM_BOOL(ZEPHIR_IS_LONG_IDENTICAL(&_3, 0)); } @@ -789,39 +902,52 @@ PHP_METHOD(Phalcon_Security, hasLibreSsl) { */ PHP_METHOD(Phalcon_Security, getSslVersionNumber) { - zval *matches = NULL, _0 = zval_used_for_init, *_1 = NULL, *_2, *_3, *_4, *_5, *_6$$5; + zval matches, _0, _1, _2, _3, _4, _5, _6, _7$$5; zend_long ZEPHIR_LAST_CALL_STATUS, major = 0, minor = 0, patch = 0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&matches); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7$$5); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(matches); - ZVAL_NULL(matches); - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "OPENSSL_VERSION_TEXT", 0); - ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 37, &_0); + ZEPHIR_INIT_VAR(&matches); + ZVAL_NULL(&matches); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "OPENSSL_VERSION_TEXT"); + ZEPHIR_CALL_FUNCTION(&_1, "defined", NULL, 31, &_0); zephir_check_call_status(); - if (!(zephir_is_true(_1))) { + if (!(zephir_is_true(&_1))) { RETURN_MM_LONG(0); } - ZEPHIR_INIT_VAR(_2); - ZEPHIR_INIT_VAR(_3); - ZEPHIR_GET_CONSTANT(_3, "OPENSSL_VERSION_TEXT"); - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "#(?:Libre|Open)SSL ([\\d]+)\\.([\\d]+)(?:\\.([\\d]+))?#", 0); - zephir_preg_match(_2, &_0, _3, matches, 0, 0 , 0 TSRMLS_CC); - if (!(zephir_array_isset_long(matches, 2))) { + ZEPHIR_INIT_NVAR(&_0); + ZEPHIR_GET_CONSTANT(&_0, "OPENSSL_VERSION_TEXT"); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "#(?:Libre|Open)SSL ([\\d]+)\\.([\\d]+)(?:\\.([\\d]+))?#"); + ZEPHIR_INIT_VAR(&_3); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "#(?:Libre|Open)SSL ([\\d]+)\\.([\\d]+)(?:\\.([\\d]+))?#"); + zephir_preg_match(&_3, &_4, &_0, &matches, 0, 0 , 0 TSRMLS_CC); + if (!(zephir_array_isset_long(&matches, 2))) { RETURN_MM_LONG(0); } - ZEPHIR_OBS_VAR(_4); - zephir_array_fetch_long(&_4, matches, 1, PH_NOISY, "phalcon/security.zep", 532 TSRMLS_CC); - major = zephir_get_intval(_4); - ZEPHIR_OBS_VAR(_5); - zephir_array_fetch_long(&_5, matches, 2, PH_NOISY, "phalcon/security.zep", 533 TSRMLS_CC); - minor = zephir_get_intval(_5); - if (zephir_array_isset_long(matches, 3)) { - ZEPHIR_OBS_VAR(_6$$5); - zephir_array_fetch_long(&_6$$5, matches, 3, PH_NOISY, "phalcon/security.zep", 536 TSRMLS_CC); - patch = zephir_get_intval(_6$$5); + ZEPHIR_OBS_VAR(&_5); + zephir_array_fetch_long(&_5, &matches, 1, PH_NOISY, "phalcon/security.zep", 532 TSRMLS_CC); + major = zephir_get_intval(&_5); + ZEPHIR_OBS_VAR(&_6); + zephir_array_fetch_long(&_6, &matches, 2, PH_NOISY, "phalcon/security.zep", 533 TSRMLS_CC); + minor = zephir_get_intval(&_6); + if (zephir_array_isset_long(&matches, 3)) { + ZEPHIR_OBS_VAR(&_7$$5); + zephir_array_fetch_long(&_7$$5, &matches, 3, PH_NOISY, "phalcon/security.zep", 536 TSRMLS_CC); + patch = zephir_get_intval(&_7$$5); } RETURN_MM_LONG((((10000 * major) + (100 * minor)) + patch)); diff --git a/ext/phalcon/security.zep.h b/ext/phalcon/security.zep.h index 9f655fe99f3..6c89e1a4b87 100644 --- a/ext/phalcon/security.zep.h +++ b/ext/phalcon/security.zep.h @@ -34,44 +34,202 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_setrandombytes, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_security_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_security_setrandombytes, 0, 1, Phalcon\\Security, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_setrandombytes, 0, 1, IS_OBJECT, "Phalcon\\Security", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, randomBytes, IS_LONG, 0) +#else ZEND_ARG_INFO(0, randomBytes) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getrandombytes, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getrandombytes, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_security_getrandom, 0, 0, Phalcon\\Security\\Random, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getrandom, 0, 0, IS_OBJECT, "Phalcon\\Security\\Random", 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_getsaltbytes, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getsaltbytes, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getsaltbytes, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, numberBytes, IS_LONG, 0) +#else ZEND_ARG_INFO(0, numberBytes) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_hash, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_hash, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_hash, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) +#else ZEND_ARG_INFO(0, password) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, workFactor, IS_LONG, 0) +#else ZEND_ARG_INFO(0, workFactor) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_checkhash, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_checkhash, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_checkhash, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, password, IS_STRING, 0) +#else ZEND_ARG_INFO(0, password) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, passwordHash, IS_STRING, 0) +#else ZEND_ARG_INFO(0, passwordHash) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, maxPassLength, IS_LONG, 0) +#else ZEND_ARG_INFO(0, maxPassLength) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_islegacyhash, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_islegacyhash, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_islegacyhash, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, passwordHash, IS_STRING, 0) +#else ZEND_ARG_INFO(0, passwordHash) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_gettokenkey, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_gettokenkey, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_gettoken, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_gettoken, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_checktoken, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_checktoken, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_checktoken, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, tokenKey) ZEND_ARG_INFO(0, tokenValue) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, destroyIfValid, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, destroyIfValid) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_computehmac, 0, 0, 3) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getsessiontoken, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getsessiontoken, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_security_destroytoken, 0, 0, Phalcon\\Security, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_destroytoken, 0, 0, IS_OBJECT, "Phalcon\\Security", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_computehmac, 0, 3, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_computehmac, 0, 3, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) +#else ZEND_ARG_INFO(0, data) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0) +#else ZEND_ARG_INFO(0, key) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0) +#else ZEND_ARG_INFO(0, algo) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, raw, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, raw) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_setdefaulthash, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_security_setdefaulthash, 0, 1, Phalcon\\Security, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_setdefaulthash, 0, 1, IS_OBJECT, "Phalcon\\Security", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, defaultHash, IS_LONG, 0) +#else ZEND_ARG_INFO(0, defaultHash) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getdefaulthash, 0, 0, IS_LONG, 1) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getdefaulthash, 0, 0, IS_LONG, NULL, 1) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_haslibressl, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_haslibressl, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getsslversionnumber, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_getsslversionnumber, 0, 0, IS_LONG, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_security_method_entry) { @@ -79,23 +237,23 @@ ZEPHIR_INIT_FUNCS(phalcon_security_method_entry) { PHP_ME(Phalcon_Security, getWorkFactor, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Security, setDI, arginfo_phalcon_security_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, getDI, arginfo_phalcon_security_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security, setRandomBytes, arginfo_phalcon_security_setrandombytes, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, getRandomBytes, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, getRandom, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, getRandomBytes, arginfo_phalcon_security_getrandombytes, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, getRandom, arginfo_phalcon_security_getrandom, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security, getSaltBytes, arginfo_phalcon_security_getsaltbytes, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security, hash, arginfo_phalcon_security_hash, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security, checkHash, arginfo_phalcon_security_checkhash, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security, isLegacyHash, arginfo_phalcon_security_islegacyhash, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, getTokenKey, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, getToken, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, getTokenKey, arginfo_phalcon_security_gettokenkey, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, getToken, arginfo_phalcon_security_gettoken, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security, checkToken, arginfo_phalcon_security_checktoken, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, getSessionToken, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, destroyToken, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, getSessionToken, arginfo_phalcon_security_getsessiontoken, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, destroyToken, arginfo_phalcon_security_destroytoken, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security, computeHmac, arginfo_phalcon_security_computehmac, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security, setDefaultHash, arginfo_phalcon_security_setdefaulthash, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, getDefaultHash, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, hasLibreSsl, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security, getSslVersionNumber, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, getDefaultHash, arginfo_phalcon_security_getdefaulthash, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, hasLibreSsl, arginfo_phalcon_security_haslibressl, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security, getSslVersionNumber, arginfo_phalcon_security_getsslversionnumber, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/security/random.zep.c b/ext/phalcon/security/random.zep.c index f7e1cecaa4f..4e1ff538513 100644 --- a/ext/phalcon/security/random.zep.c +++ b/ext/phalcon/security/random.zep.c @@ -13,9 +13,9 @@ #include "kernel/main.h" #include "kernel/object.h" -#include "kernel/memory.h" #include "kernel/fcall.h" #include "kernel/file.h" +#include "kernel/memory.h" #include "kernel/operators.h" #include "kernel/string.h" #include "kernel/exception.h" @@ -124,8 +124,19 @@ ZEPHIR_INIT_CLASS(Phalcon_Security_Random) { */ PHP_METHOD(Phalcon_Security_Random, bytes) { - zval *len_param = NULL, *handle = NULL, *ret = NULL, _3, _0$$4, *_1$$5, *_2$$6, _4$$7, _5$$7, _6$$8 = zval_used_for_init; + zval *len_param = NULL, handle, ret, _3, _0$$4, _1$$5, _2$$6, _4$$7, _5$$7, _6$$8; zend_long len, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&handle); + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$6); + ZVAL_UNDEF(&_4$$7); + ZVAL_UNDEF(&_5$$7); + ZVAL_UNDEF(&_6$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &len_param); @@ -140,51 +151,46 @@ PHP_METHOD(Phalcon_Security_Random, bytes) { if (len <= 0) { len = 16; } - if ((zephir_function_exists_ex(SS("random_bytes") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_SINIT_VAR(_0$$4); + if ((zephir_function_exists_ex(SL("random_bytes") TSRMLS_CC) == SUCCESS)) { ZVAL_LONG(&_0$$4, len); - ZEPHIR_RETURN_CALL_FUNCTION("random_bytes", NULL, 440, &_0$$4); + ZEPHIR_RETURN_CALL_FUNCTION("random_bytes", NULL, 394, &_0$$4); zephir_check_call_status(); RETURN_MM(); } - if ((zephir_function_exists_ex(SS("\\sodium\\randombytes_buf") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_VAR(_1$$5); - ZVAL_LONG(_1$$5, len); - ZEPHIR_RETURN_CALL_FUNCTION("\\sodium\\randombytes_buf", NULL, 0, _1$$5); + if ((zephir_function_exists_ex(SL("\\sodium\\randombytes_buf") TSRMLS_CC) == SUCCESS)) { + ZVAL_LONG(&_1$$5, len); + ZEPHIR_RETURN_CALL_FUNCTION("\\sodium\\randombytes_buf", NULL, 0, &_1$$5); zephir_check_call_status(); RETURN_MM(); } - if ((zephir_function_exists_ex(SS("openssl_random_pseudo_bytes") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_VAR(_2$$6); - ZVAL_LONG(_2$$6, len); - ZEPHIR_RETURN_CALL_FUNCTION("openssl_random_pseudo_bytes", NULL, 157, _2$$6); + if ((zephir_function_exists_ex(SL("openssl_random_pseudo_bytes") TSRMLS_CC) == SUCCESS)) { + ZVAL_LONG(&_2$$6, len); + ZEPHIR_RETURN_CALL_FUNCTION("openssl_random_pseudo_bytes", NULL, 137, &_2$$6); zephir_check_call_status(); RETURN_MM(); } - ZEPHIR_SINIT_VAR(_3); - ZVAL_STRING(&_3, "/dev/urandom", 0); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "/dev/urandom"); if ((zephir_file_exists(&_3 TSRMLS_CC) == SUCCESS)) { - ZEPHIR_SINIT_VAR(_4$$7); - ZVAL_STRING(&_4$$7, "/dev/urandom", 0); - ZEPHIR_SINIT_VAR(_5$$7); - ZVAL_STRING(&_5$$7, "rb", 0); - ZEPHIR_CALL_FUNCTION(&handle, "fopen", NULL, 308, &_4$$7, &_5$$7); + ZEPHIR_INIT_VAR(&_4$$7); + ZVAL_STRING(&_4$$7, "/dev/urandom"); + ZEPHIR_INIT_VAR(&_5$$7); + ZVAL_STRING(&_5$$7, "rb"); + ZEPHIR_CALL_FUNCTION(&handle, "fopen", NULL, 268, &_4$$7, &_5$$7); zephir_check_call_status(); - if (!ZEPHIR_IS_FALSE_IDENTICAL(handle)) { - ZEPHIR_SINIT_VAR(_6$$8); + if (!ZEPHIR_IS_FALSE_IDENTICAL(&handle)) { ZVAL_LONG(&_6$$8, 0); - ZEPHIR_CALL_FUNCTION(NULL, "stream_set_read_buffer", NULL, 441, handle, &_6$$8); + ZEPHIR_CALL_FUNCTION(NULL, "stream_set_read_buffer", NULL, 395, &handle, &_6$$8); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_6$$8); ZVAL_LONG(&_6$$8, len); - ZEPHIR_CALL_FUNCTION(&ret, "fread", NULL, 442, handle, &_6$$8); + ZEPHIR_CALL_FUNCTION(&ret, "fread", NULL, 396, &handle, &_6$$8); zephir_check_call_status(); - zephir_fclose(handle TSRMLS_CC); - if (zephir_fast_strlen_ev(ret) != len) { + zephir_fclose(&handle TSRMLS_CC); + if (zephir_fast_strlen_ev(&ret) != len) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "Unexpected partial read from random device", "phalcon/security/random.zep", 143); return; } - RETURN_CCTOR(ret); + RETURN_CCTOR(&ret); } } ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "No random device available", "phalcon/security/random.zep", 150); @@ -208,8 +214,14 @@ PHP_METHOD(Phalcon_Security_Random, bytes) { */ PHP_METHOD(Phalcon_Security_Random, hex) { - zval *len_param = NULL, *_0 = NULL, *_1, _2, *_3 = NULL; + zval *len_param = NULL, _0, _1, _2, _3; zend_long len, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &len_param); @@ -221,17 +233,16 @@ PHP_METHOD(Phalcon_Security_Random, hex) { } - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, len); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, _1); + ZVAL_LONG(&_1, len); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_2); - ZVAL_STRING(&_2, "H*", 0); - ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 443, &_2, _0); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "H*"); + ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 397, &_2, &_0); zephir_check_call_status(); - ZEPHIR_MAKE_REF(_3); - ZEPHIR_RETURN_CALL_FUNCTION("array_shift", NULL, 19, _3); - ZEPHIR_UNREF(_3); + ZEPHIR_MAKE_REF(&_3); + ZEPHIR_RETURN_CALL_FUNCTION("array_shift", NULL, 14, &_3); + ZEPHIR_UNREF(&_3); zephir_check_call_status(); RETURN_MM(); @@ -258,8 +269,13 @@ PHP_METHOD(Phalcon_Security_Random, hex) { */ PHP_METHOD(Phalcon_Security_Random, base58) { - zval *len_param = NULL, *_0, *_1, *_2; + zval *len_param = NULL, _0, _1, _2; zend_long len, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &len_param); @@ -271,14 +287,11 @@ PHP_METHOD(Phalcon_Security_Random, base58) { } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 58); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, len); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "base", NULL, 0, _0, _1, _2); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"); + ZVAL_LONG(&_1, 58); + ZVAL_LONG(&_2, len); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "base", NULL, 0, &_0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); @@ -303,8 +316,13 @@ PHP_METHOD(Phalcon_Security_Random, base58) { */ PHP_METHOD(Phalcon_Security_Random, base62) { - zval *len_param = NULL, *_0, *_1, *_2; + zval *len_param = NULL, _0, _1, _2; zend_long len, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &len_param); @@ -316,14 +334,11 @@ PHP_METHOD(Phalcon_Security_Random, base62) { } - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 62); - ZEPHIR_INIT_VAR(_2); - ZVAL_LONG(_2, len); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "base", NULL, 0, _0, _1, _2); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); + ZVAL_LONG(&_1, 62); + ZVAL_LONG(&_2, len); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "base", NULL, 0, &_0, &_1, &_2); zephir_check_call_status(); RETURN_MM(); @@ -346,8 +361,12 @@ PHP_METHOD(Phalcon_Security_Random, base62) { */ PHP_METHOD(Phalcon_Security_Random, base64) { - zval *len_param = NULL, *_0 = NULL, *_1; + zval *len_param = NULL, _0, _1; zend_long len, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &len_param); @@ -359,11 +378,10 @@ PHP_METHOD(Phalcon_Security_Random, base64) { } - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, len); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, _1); + ZVAL_LONG(&_1, len); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 134, _0); + ZEPHIR_RETURN_CALL_FUNCTION("base64_encode", NULL, 115, &_0); zephir_check_call_status(); RETURN_MM(); @@ -391,8 +409,18 @@ PHP_METHOD(Phalcon_Security_Random, base64) { PHP_METHOD(Phalcon_Security_Random, base64Safe) { zend_bool padding; - zval *len_param = NULL, *padding_param = NULL, *s = NULL, *_0 = NULL, *_1 = NULL, *_2 = NULL, _3, _4, *_5, *_6 = NULL, _7$$3; + zval *len_param = NULL, *padding_param = NULL, s, _0, _1, _2, _3, _4, _5, _6$$3; zend_long len, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&s); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, &len_param, &padding_param); @@ -409,34 +437,31 @@ PHP_METHOD(Phalcon_Security_Random, base64Safe) { } - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, len); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "base64", NULL, 0, _1); + ZVAL_LONG(&_1, len); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "base64", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&_2, "base64_encode", NULL, 134, _0); + ZEPHIR_CALL_FUNCTION(&_2, "base64_encode", NULL, 115, &_0); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_3); - ZVAL_STRING(&_3, "+/", 0); - ZEPHIR_SINIT_VAR(_4); - ZVAL_STRING(&_4, "-_", 0); - ZEPHIR_CALL_FUNCTION(&s, "strtr", NULL, 27, _2, &_3, &_4); + ZEPHIR_INIT_VAR(&_3); + ZVAL_STRING(&_3, "+/"); + ZEPHIR_INIT_VAR(&_4); + ZVAL_STRING(&_4, "-_"); + ZEPHIR_CALL_FUNCTION(&s, "strtr", NULL, 22, &_2, &_3, &_4); zephir_check_call_status(); - ZEPHIR_INIT_NVAR(_1); - ZVAL_STRING(_1, "#[^a-z0-9_=-]+#i", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_5); - ZVAL_STRING(_5, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_6, "preg_replace", NULL, 42, _1, _5, s); - zephir_check_temp_parameter(_1); - zephir_check_temp_parameter(_5); + ZEPHIR_INIT_NVAR(&_3); + ZVAL_STRING(&_3, "#[^a-z0-9_=-]+#i"); + ZEPHIR_INIT_NVAR(&_4); + ZVAL_STRING(&_4, ""); + ZEPHIR_CALL_FUNCTION(&_5, "preg_replace", NULL, 35, &_3, &_4, &s); zephir_check_call_status(); - ZEPHIR_CPY_WRT(s, _6); + ZEPHIR_CPY_WRT(&s, &_5); if (!(padding)) { - ZEPHIR_SINIT_VAR(_7$$3); - ZVAL_STRING(&_7$$3, "=", 0); - zephir_fast_trim(return_value, s, &_7$$3, ZEPHIR_TRIM_RIGHT TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6$$3); + ZVAL_STRING(&_6$$3, "="); + zephir_fast_trim(return_value, &s, &_6$$3, ZEPHIR_TRIM_RIGHT TSRMLS_CC); RETURN_MM(); } - RETURN_CCTOR(s); + RETURN_CCTOR(&s); } @@ -462,39 +487,48 @@ PHP_METHOD(Phalcon_Security_Random, base64Safe) { */ PHP_METHOD(Phalcon_Security_Random, uuid) { - zval *ary = NULL, *_0 = NULL, *_1 = NULL, _2 = zval_used_for_init, *_3 = NULL, *_4, *_5, *_6, *_7; + zval ary, _0, _1, _2, _3, _4, _5, _6, _7; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&ary); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_1); - ZVAL_LONG(_1, 16); - ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, _1); + ZVAL_LONG(&_1, 16); + ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_2); - ZVAL_STRING(&_2, "N1a/n1b/n1c/n1d/n1e/N1f", 0); - ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 443, &_2, _0); + ZEPHIR_INIT_VAR(&_2); + ZVAL_STRING(&_2, "N1a/n1b/n1c/n1d/n1e/N1f"); + ZEPHIR_CALL_FUNCTION(&_3, "unpack", NULL, 397, &_2, &_0); zephir_check_call_status(); - ZEPHIR_CALL_FUNCTION(&ary, "array_values", NULL, 235, _3); + ZEPHIR_CALL_FUNCTION(&ary, "array_values", NULL, 197, &_3); zephir_check_call_status(); - zephir_array_fetch_long(&_4, ary, 2, PH_NOISY | PH_READONLY, "phalcon/security/random.zep", 296 TSRMLS_CC); - ZEPHIR_INIT_NVAR(_1); - ZVAL_LONG(_1, ((((int) (zephir_get_numberval(_4)) & 0x0fff)) | 0x4000)); - zephir_array_update_long(&ary, 2, &_1, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - zephir_array_fetch_long(&_5, ary, 3, PH_NOISY | PH_READONLY, "phalcon/security/random.zep", 297 TSRMLS_CC); - ZEPHIR_INIT_VAR(_6); - ZVAL_LONG(_6, ((((int) (zephir_get_numberval(_5)) & 0x3fff)) | 0x8000)); + zephir_array_fetch_long(&_4, &ary, 2, PH_NOISY | PH_READONLY, "phalcon/security/random.zep", 296 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_2); + ZVAL_LONG(&_2, ((((int) (zephir_get_numberval(&_4)) & 0x0fff)) | 0x4000)); + zephir_array_update_long(&ary, 2, &_2, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); + zephir_array_fetch_long(&_5, &ary, 3, PH_NOISY | PH_READONLY, "phalcon/security/random.zep", 297 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_6); + ZVAL_LONG(&_6, ((((int) (zephir_get_numberval(&_5)) & 0x3fff)) | 0x8000)); zephir_array_update_long(&ary, 3, &_6, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); - ZEPHIR_INIT_VAR(_7); - ZVAL_STRING(_7, "%08x-%04x-%04x-%04x-%04x%08x", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_MAKE_REF(ary); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 417, ary, _7); - zephir_check_temp_parameter(_7); - ZEPHIR_UNREF(ary); + ZEPHIR_INIT_VAR(&_7); + ZVAL_STRING(&_7, "%08x-%04x-%04x-%04x-%04x%08x"); + ZEPHIR_MAKE_REF(&ary); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", NULL, 371, &ary, &_7); + ZEPHIR_UNREF(&ary); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_2); - ZVAL_STRING(&_2, "sprintf", 0); - ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_2, ary); + ZEPHIR_INIT_NVAR(&_7); + ZVAL_STRING(&_7, "sprintf"); + ZEPHIR_CALL_USER_FUNC_ARRAY(return_value, &_7, &ary); zephir_check_call_status(); RETURN_MM(); @@ -514,11 +548,35 @@ PHP_METHOD(Phalcon_Security_Random, uuid) { */ PHP_METHOD(Phalcon_Security_Random, number) { - unsigned char _7; - zval *bin; - zephir_fcall_cache_entry *_12 = NULL, *_17 = NULL, *_21 = NULL; - zval *len_param = NULL, *hex = NULL, *mask = NULL, *rnd = NULL, *ret = NULL, _4 = zval_used_for_init, *_6 = NULL, *_22 = NULL, _0$$4, _1$$4, *_2$$5, *_3$$5 = NULL, *_5$$6, *_11$$7 = NULL, _13$$7 = zval_used_for_init, _14$$7 = zval_used_for_init, *_15$$7 = NULL, _16$$7 = zval_used_for_init, _18$$7 = zval_used_for_init, _19$$7 = zval_used_for_init, *_20$$7 = NULL; - zend_long len, ZEPHIR_LAST_CALL_STATUS, _8, _9, _10; + unsigned char _8; + zval bin; + zephir_fcall_cache_entry *_13 = NULL, *_18 = NULL, *_22 = NULL; + zval *len_param = NULL, hex, mask, rnd, ret, _4, _6, _7, _23, _0$$4, _1$$4, _2$$5, _3$$5, _5$$6, _12$$7, _14$$7, _15$$7, _16$$7, _17$$7, _19$$7, _20$$7, _21$$7; + zend_long len, ZEPHIR_LAST_CALL_STATUS, _9, _10, _11; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&hex); + ZVAL_UNDEF(&mask); + ZVAL_UNDEF(&rnd); + ZVAL_UNDEF(&ret); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_23); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_5$$6); + ZVAL_UNDEF(&_12$$7); + ZVAL_UNDEF(&_14$$7); + ZVAL_UNDEF(&_15$$7); + ZVAL_UNDEF(&_16$$7); + ZVAL_UNDEF(&_17$$7); + ZVAL_UNDEF(&_19$$7); + ZVAL_UNDEF(&_20$$7); + ZVAL_UNDEF(&_21$$7); + ZVAL_UNDEF(&bin); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &len_param); @@ -526,90 +584,81 @@ PHP_METHOD(Phalcon_Security_Random, number) { len = zephir_get_intval(len_param); - ZEPHIR_INIT_VAR(bin); - ZVAL_EMPTY_STRING(bin); + ZEPHIR_INIT_VAR(&bin); + ZVAL_STRING(&bin, ""); if (len <= 0) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_security_exception_ce, "Require a positive integer > 0", "phalcon/security/random.zep", 322); return; } - if ((zephir_function_exists_ex(SS("random_int") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_SINIT_VAR(_0$$4); + if ((zephir_function_exists_ex(SL("random_int") TSRMLS_CC) == SUCCESS)) { ZVAL_LONG(&_0$$4, 0); - ZEPHIR_SINIT_VAR(_1$$4); ZVAL_LONG(&_1$$4, len); - ZEPHIR_RETURN_CALL_FUNCTION("random_int", NULL, 444, &_0$$4, &_1$$4); + ZEPHIR_RETURN_CALL_FUNCTION("random_int", NULL, 398, &_0$$4, &_1$$4); zephir_check_call_status(); RETURN_MM(); } - if ((zephir_function_exists_ex(SS("\\sodium\\randombytes_uniform") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_INIT_VAR(_2$$5); - ZVAL_LONG(_2$$5, len); - ZEPHIR_CALL_FUNCTION(&_3$$5, "\\sodium\\randombytes_uniform", NULL, 0, _2$$5); + if ((zephir_function_exists_ex(SL("\\sodium\\randombytes_uniform") TSRMLS_CC) == SUCCESS)) { + ZVAL_LONG(&_2$$5, len); + ZEPHIR_CALL_FUNCTION(&_3$$5, "\\sodium\\randombytes_uniform", NULL, 0, &_2$$5); zephir_check_call_status(); - RETURN_MM_LONG((zephir_get_numberval(_3$$5) + 1)); + RETURN_MM_LONG((zephir_get_numberval(&_3$$5) + 1)); } - ZEPHIR_SINIT_VAR(_4); ZVAL_LONG(&_4, len); - ZEPHIR_CALL_FUNCTION(&hex, "dechex", NULL, 445, &_4); + ZEPHIR_CALL_FUNCTION(&hex, "dechex", NULL, 399, &_4); zephir_check_call_status(); - if (((zephir_fast_strlen_ev(hex) & 1)) == 1) { - ZEPHIR_INIT_VAR(_5$$6); - ZEPHIR_CONCAT_SV(_5$$6, "0", hex); - ZEPHIR_CPY_WRT(hex, _5$$6); + if (((zephir_fast_strlen_ev(&hex) & 1)) == 1) { + ZEPHIR_INIT_VAR(&_5$$6); + ZEPHIR_CONCAT_SV(&_5$$6, "0", &hex); + ZEPHIR_CPY_WRT(&hex, &_5$$6); } - ZEPHIR_SINIT_NVAR(_4); - ZVAL_STRING(&_4, "H*", 0); - ZEPHIR_CALL_FUNCTION(&_6, "pack", NULL, 446, &_4, hex); + ZEPHIR_INIT_VAR(&_6); + ZVAL_STRING(&_6, "H*"); + ZEPHIR_CALL_FUNCTION(&_7, "pack", NULL, 400, &_6, &hex); zephir_check_call_status(); - zephir_concat_self(&bin, _6 TSRMLS_CC); - _7 = ZEPHIR_STRING_OFFSET(bin, 0); - ZEPHIR_SINIT_NVAR(_4); - ZVAL_STRINGL(&_4, &_7, 1, 1); - ZEPHIR_CALL_FUNCTION(&mask, "ord", NULL, 154, &_4); + zephir_concat_self(&bin, &_7 TSRMLS_CC); + _8 = ZEPHIR_STRING_OFFSET(&bin, 0); + ZEPHIR_INIT_NVAR(&_6); + ZVAL_STRINGL(&_6, &_8, 1); + ZEPHIR_CALL_FUNCTION(&mask, "ord", NULL, 134, &_6); zephir_check_call_status(); - _8 = ((int) (zephir_get_numberval(mask)) | (((int) (zephir_get_numberval(mask)) >> 1))); - ZEPHIR_INIT_NVAR(mask); - ZVAL_LONG(mask, _8); - _9 = ((int) (zephir_get_numberval(mask)) | (((int) (zephir_get_numberval(mask)) >> 2))); - ZEPHIR_INIT_NVAR(mask); - ZVAL_LONG(mask, _9); - _10 = ((int) (zephir_get_numberval(mask)) | (((int) (zephir_get_numberval(mask)) >> 4))); - ZEPHIR_INIT_NVAR(mask); - ZVAL_LONG(mask, _10); + _9 = ((int) (zephir_get_numberval(&mask)) | (((int) (zephir_get_numberval(&mask)) >> 1))); + ZEPHIR_INIT_NVAR(&mask); + ZVAL_LONG(&mask, _9); + _10 = ((int) (zephir_get_numberval(&mask)) | (((int) (zephir_get_numberval(&mask)) >> 2))); + ZEPHIR_INIT_NVAR(&mask); + ZVAL_LONG(&mask, _10); + _11 = ((int) (zephir_get_numberval(&mask)) | (((int) (zephir_get_numberval(&mask)) >> 4))); + ZEPHIR_INIT_NVAR(&mask); + ZVAL_LONG(&mask, _11); do { - ZEPHIR_INIT_NVAR(_11$$7); - ZVAL_LONG(_11$$7, zephir_fast_strlen_ev(bin)); - ZEPHIR_CALL_METHOD(&rnd, this_ptr, "bytes", &_12, 0, _11$$7); + ZVAL_LONG(&_12$$7, zephir_fast_strlen_ev(&bin)); + ZEPHIR_CALL_METHOD(&rnd, this_ptr, "bytes", &_13, 0, &_12$$7); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_13$$7); - ZVAL_LONG(&_13$$7, 0); - ZEPHIR_SINIT_NVAR(_14$$7); + ZVAL_LONG(&_12$$7, 0); ZVAL_LONG(&_14$$7, 1); - ZEPHIR_INIT_NVAR(_11$$7); - zephir_substr(_11$$7, rnd, 0 , 1 , 0); - ZEPHIR_CALL_FUNCTION(&_15$$7, "ord", NULL, 154, _11$$7); + ZEPHIR_INIT_NVAR(&_15$$7); + zephir_substr(&_15$$7, &rnd, 0 , 1 , 0); + ZEPHIR_CALL_FUNCTION(&_16$$7, "ord", NULL, 134, &_15$$7); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_16$$7); - zephir_bitwise_and_function(&_16$$7, _15$$7, mask TSRMLS_CC); - ZEPHIR_CALL_FUNCTION(&_15$$7, "chr", &_17, 152, &_16$$7); + ZEPHIR_SINIT_NVAR(_17$$7); + zephir_bitwise_and_function(&_17$$7, &_16$$7, &mask TSRMLS_CC); + ZEPHIR_CALL_FUNCTION(&_16$$7, "chr", &_18, 132, &_17$$7); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_18$$7); - ZVAL_LONG(&_18$$7, 0); - ZEPHIR_SINIT_NVAR(_19$$7); - ZVAL_LONG(&_19$$7, 1); - ZEPHIR_CALL_FUNCTION(&_20$$7, "substr_replace", &_21, 447, rnd, _15$$7, &_18$$7, &_19$$7); + ZVAL_LONG(&_19$$7, 0); + ZVAL_LONG(&_20$$7, 1); + ZEPHIR_CALL_FUNCTION(&_21$$7, "substr_replace", &_22, 401, &rnd, &_16$$7, &_19$$7, &_20$$7); zephir_check_call_status(); - ZEPHIR_CPY_WRT(rnd, _20$$7); - } while (ZEPHIR_LT(bin, rnd)); - ZEPHIR_SINIT_NVAR(_4); - ZVAL_STRING(&_4, "H*", 0); - ZEPHIR_CALL_FUNCTION(&ret, "unpack", NULL, 443, &_4, rnd); + ZEPHIR_CPY_WRT(&rnd, &_21$$7); + } while (ZEPHIR_LT(&bin, &rnd)); + ZEPHIR_INIT_NVAR(&_6); + ZVAL_STRING(&_6, "H*"); + ZEPHIR_CALL_FUNCTION(&ret, "unpack", NULL, 397, &_6, &rnd); zephir_check_call_status(); - ZEPHIR_MAKE_REF(ret); - ZEPHIR_CALL_FUNCTION(&_22, "array_shift", NULL, 19, ret); - ZEPHIR_UNREF(ret); + ZEPHIR_MAKE_REF(&ret); + ZEPHIR_CALL_FUNCTION(&_23, "array_shift", NULL, 14, &ret); + ZEPHIR_UNREF(&ret); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("hexdec", NULL, 448, _22); + ZEPHIR_RETURN_CALL_FUNCTION("hexdec", NULL, 402, &_23); zephir_check_call_status(); RETURN_MM(); @@ -624,52 +673,61 @@ PHP_METHOD(Phalcon_Security_Random, number) { */ PHP_METHOD(Phalcon_Security_Random, base) { - unsigned char _8$$3; - double _5$$3; - HashTable *_3; - HashPosition _2; - zephir_fcall_cache_entry *_7 = NULL; + unsigned char _6$$3; + double _3$$3; + zephir_fcall_cache_entry *_5 = NULL; zend_long base, ZEPHIR_LAST_CALL_STATUS; - zval *alphabet_param = NULL, *base_param = NULL, *n = NULL, *bytes = NULL, *idx = NULL, *_0 = NULL, _1, **_4, *_6$$4 = NULL; - zval *alphabet = NULL, *byteString; + zval *alphabet_param = NULL, *base_param = NULL, *n = NULL, n_sub, __$null, bytes, idx, _0, _1, *_2, _4$$4; + zval alphabet, byteString; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&alphabet); + ZVAL_UNDEF(&byteString); + ZVAL_UNDEF(&n_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&bytes); + ZVAL_UNDEF(&idx); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_4$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &alphabet_param, &base_param, &n); - zephir_get_strval(alphabet, alphabet_param); + zephir_get_strval(&alphabet, alphabet_param); base = zephir_get_intval(base_param); if (!n) { - n = ZEPHIR_GLOBAL(global_null); + n = &n_sub; + n = &__$null; } - ZEPHIR_INIT_VAR(byteString); - ZVAL_EMPTY_STRING(byteString); + ZEPHIR_INIT_VAR(&byteString); + ZVAL_STRING(&byteString, ""); ZEPHIR_CALL_METHOD(&_0, this_ptr, "bytes", NULL, 0, n); zephir_check_call_status(); - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "C*", 0); - ZEPHIR_CALL_FUNCTION(&bytes, "unpack", NULL, 443, &_1, _0); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "C*"); + ZEPHIR_CALL_FUNCTION(&bytes, "unpack", NULL, 397, &_1, &_0); zephir_check_call_status(); - zephir_is_iterable(bytes, &_3, &_2, 0, 0, "phalcon/security/random.zep", 381); - for ( - ; zend_hash_get_current_data_ex(_3, (void**) &_4, &_2) == SUCCESS - ; zend_hash_move_forward_ex(_3, &_2) - ) { - ZEPHIR_GET_HVALUE(idx, _4); - _5$$3 = zephir_safe_mod_zval_long(idx, 64 TSRMLS_CC); - ZEPHIR_INIT_NVAR(idx); - ZVAL_DOUBLE(idx, _5$$3); - if (ZEPHIR_GE_LONG(idx, base)) { - ZEPHIR_INIT_NVAR(_6$$4); - ZVAL_LONG(_6$$4, (base - 1)); - ZEPHIR_CALL_METHOD(&idx, this_ptr, "number", &_7, 0, _6$$4); + zephir_is_iterable(&bytes, 0, "phalcon/security/random.zep", 381); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&bytes), _2) + { + ZEPHIR_INIT_NVAR(&idx); + ZVAL_COPY(&idx, _2); + _3$$3 = zephir_safe_mod_zval_long(&idx, 64 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&idx); + ZVAL_DOUBLE(&idx, _3$$3); + if (ZEPHIR_GE_LONG(&idx, base)) { + ZVAL_LONG(&_4$$4, (base - 1)); + ZEPHIR_CALL_METHOD(&idx, this_ptr, "number", &_5, 0, &_4$$4); zephir_check_call_status(); } - _8$$3 = ZEPHIR_STRING_OFFSET(alphabet, zephir_get_intval(idx)); - zephir_concat_self_char(&byteString, _8$$3 TSRMLS_CC); - } - RETURN_CTOR(byteString); + _6$$3 = ZEPHIR_STRING_OFFSET(&alphabet, zephir_get_intval(&idx)); + zephir_concat_self_char(&byteString, _6$$3 TSRMLS_CC); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&idx); + RETURN_CTOR(&byteString); } diff --git a/ext/phalcon/security/random.zep.h b/ext/phalcon/security/random.zep.h index 1a431fc3f9b..5c2ee08c501 100644 --- a/ext/phalcon/security/random.zep.h +++ b/ext/phalcon/security/random.zep.h @@ -13,38 +13,117 @@ PHP_METHOD(Phalcon_Security_Random, uuid); PHP_METHOD(Phalcon_Security_Random, number); PHP_METHOD(Phalcon_Security_Random, base); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_random_bytes, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_bytes, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_bytes, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 0) +#else ZEND_ARG_INFO(0, len) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_random_hex, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_hex, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_hex, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 1) +#else ZEND_ARG_INFO(0, len) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_random_base58, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base58, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base58, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 1) +#else ZEND_ARG_INFO(0, len) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_random_base62, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base62, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base62, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 1) +#else ZEND_ARG_INFO(0, len) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_random_base64, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base64, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base64, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 1) +#else ZEND_ARG_INFO(0, len) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_random_base64safe, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base64safe, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base64safe, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 1) +#else ZEND_ARG_INFO(0, len) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, padding, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, padding) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_random_number, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_uuid, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_uuid, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_number, 0, 1, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_number, 0, 1, IS_LONG, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, len, IS_LONG, 0) +#else ZEND_ARG_INFO(0, len) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_security_random_base, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_security_random_base, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, alphabet, IS_STRING, 0) +#else ZEND_ARG_INFO(0, alphabet) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, base, IS_LONG, 0) +#else ZEND_ARG_INFO(0, base) +#endif ZEND_ARG_INFO(0, n) ZEND_END_ARG_INFO() @@ -55,7 +134,7 @@ ZEPHIR_INIT_FUNCS(phalcon_security_random_method_entry) { PHP_ME(Phalcon_Security_Random, base62, arginfo_phalcon_security_random_base62, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security_Random, base64, arginfo_phalcon_security_random_base64, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security_Random, base64Safe, arginfo_phalcon_security_random_base64safe, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Security_Random, uuid, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Security_Random, uuid, arginfo_phalcon_security_random_uuid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security_Random, number, arginfo_phalcon_security_random_number, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Security_Random, base, arginfo_phalcon_security_random_base, ZEND_ACC_PROTECTED) PHP_FE_END diff --git a/ext/phalcon/session/adapter.zep.c b/ext/phalcon/session/adapter.zep.c index e9181c48402..52a6537c605 100644 --- a/ext/phalcon/session/adapter.zep.c +++ b/ext/phalcon/session/adapter.zep.c @@ -38,11 +38,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter) { zend_declare_property_null(phalcon_session_adapter_ce, SL("_options"), ZEND_ACC_PROTECTED TSRMLS_CC); - zend_declare_class_constant_long(phalcon_session_adapter_ce, SL("SESSION_ACTIVE"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_session_adapter_ce, SL("SESSION_ACTIVE"), 2); - zend_declare_class_constant_long(phalcon_session_adapter_ce, SL("SESSION_NONE"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_session_adapter_ce, SL("SESSION_NONE"), 1); - zend_declare_class_constant_long(phalcon_session_adapter_ce, SL("SESSION_DISABLED"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_session_adapter_ce, SL("SESSION_DISABLED"), 0); zend_class_implements(phalcon_session_adapter_ce TSRMLS_CC, 1, phalcon_session_adapterinterface_ce); return SUCCESS; @@ -57,13 +57,18 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter) { PHP_METHOD(Phalcon_Session_Adapter, __construct) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *options = NULL; + zval *options = NULL, options_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options); if (!options) { - options = ZEPHIR_GLOBAL(global_null); + options = &options_sub; + options = &__$null; } @@ -81,28 +86,35 @@ PHP_METHOD(Phalcon_Session_Adapter, __construct) { PHP_METHOD(Phalcon_Session_Adapter, start) { zend_bool _2$$3; - zval *_0 = NULL, *_1$$3, *_3$$3 = NULL; + zval __$true, __$false, _0, _1$$3, _3$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 28); + ZEPHIR_CALL_FUNCTION(&_0, "headers_sent", NULL, 23); zephir_check_call_status(); - if (!(zephir_is_true(_0))) { - _1$$3 = zephir_fetch_nproperty_this(this_ptr, SL("_started"), PH_NOISY_CC); - _2$$3 = !zephir_is_true(_1$$3); + if (!(zephir_is_true(&_0))) { + zephir_read_property(&_1$$3, this_ptr, SL("_started"), PH_NOISY_CC | PH_READONLY); + _2$$3 = !zephir_is_true(&_1$$3); if (_2$$3) { ZEPHIR_CALL_METHOD(&_3$$3, this_ptr, "status", NULL, 0); zephir_check_call_status(); - _2$$3 = !ZEPHIR_IS_LONG_IDENTICAL(_3$$3, 2); + _2$$3 = !ZEPHIR_IS_LONG_IDENTICAL(&_3$$3, 2); } if (_2$$3) { - ZEPHIR_CALL_FUNCTION(NULL, "session_start", NULL, 29); + ZEPHIR_CALL_FUNCTION(NULL, "session_start", NULL, 24); zephir_check_call_status(); if (1) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } RETURN_MM_BOOL(1); } @@ -124,18 +136,24 @@ PHP_METHOD(Phalcon_Session_Adapter, start) { */ PHP_METHOD(Phalcon_Session_Adapter, setOptions) { - zval *options_param = NULL, *uniqueId = NULL; - zval *options = NULL; + zval *options_param = NULL, uniqueId; + zval options; + zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &options_param); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&uniqueId); + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &options_param); - options = options_param; + ZEPHIR_OBS_COPY_OR_DUP(&options, options_param); - if (zephir_array_isset_string_fetch(&uniqueId, options, SS("uniqueId"), 1 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_uniqueId"), uniqueId TSRMLS_CC); + if (zephir_array_isset_string_fetch(&uniqueId, &options, SL("uniqueId"), 1)) { + zephir_update_property_zval(this_ptr, SL("_uniqueId"), &uniqueId); } - zephir_update_property_this(getThis(), SL("_options"), options TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_options"), &options); + ZEPHIR_MM_RESTORE(); } @@ -144,7 +162,8 @@ PHP_METHOD(Phalcon_Session_Adapter, setOptions) { */ PHP_METHOD(Phalcon_Session_Adapter, getOptions) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_options"); @@ -157,15 +176,18 @@ PHP_METHOD(Phalcon_Session_Adapter, setName) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *name_param = NULL; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); - ZEPHIR_CALL_FUNCTION(NULL, "session_name", NULL, 30, name); + ZEPHIR_CALL_FUNCTION(NULL, "session_name", NULL, 25, &name); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -177,10 +199,12 @@ PHP_METHOD(Phalcon_Session_Adapter, setName) { PHP_METHOD(Phalcon_Session_Adapter, getName) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_FUNCTION("session_name", NULL, 30); + ZEPHIR_RETURN_CALL_FUNCTION("session_name", NULL, 25); zephir_check_call_status(); RETURN_MM(); @@ -194,6 +218,9 @@ PHP_METHOD(Phalcon_Session_Adapter, regenerateId) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *deleteOldSession_param = NULL, _0; zend_bool deleteOldSession; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &deleteOldSession_param); @@ -205,9 +232,8 @@ PHP_METHOD(Phalcon_Session_Adapter, regenerateId) { } - ZEPHIR_SINIT_VAR(_0); ZVAL_BOOL(&_0, (deleteOldSession ? 1 : 0)); - ZEPHIR_CALL_FUNCTION(NULL, "session_regenerate_id", NULL, 31, &_0); + ZEPHIR_CALL_FUNCTION(NULL, "session_regenerate_id", NULL, 26, &_0); zephir_check_call_status(); RETURN_THIS(); @@ -223,16 +249,25 @@ PHP_METHOD(Phalcon_Session_Adapter, regenerateId) { PHP_METHOD(Phalcon_Session_Adapter, get) { zend_bool remove; - zval *index_param = NULL, *defaultValue = NULL, *remove_param = NULL, *_SESSION, *value = NULL, *key = NULL, *uniqueId = NULL; - zval *index = NULL; + zval *index_param = NULL, *defaultValue = NULL, defaultValue_sub, *remove_param = NULL, *_SESSION, __$null, value, key, uniqueId; + zval index; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&uniqueId); ZEPHIR_MM_GROW(); - zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC); + zephir_get_global(&_SESSION, SL("_SESSION")); zephir_fetch_params(1, 1, 2, &index_param, &defaultValue, &remove_param); - zephir_get_strval(index, index_param); + zephir_get_strval(&index, index_param); if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } if (!remove_param) { remove = 0; @@ -241,19 +276,19 @@ PHP_METHOD(Phalcon_Session_Adapter, get) { } - uniqueId = zephir_fetch_nproperty_this(this_ptr, SL("_uniqueId"), PH_NOISY_CC); - if (!(ZEPHIR_IS_EMPTY(uniqueId))) { - ZEPHIR_INIT_VAR(key); - ZEPHIR_CONCAT_VSV(key, uniqueId, "#", index); + zephir_read_property(&uniqueId, this_ptr, SL("_uniqueId"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_IS_EMPTY(&uniqueId))) { + ZEPHIR_INIT_VAR(&key); + ZEPHIR_CONCAT_VSV(&key, &uniqueId, "#", &index); } else { - ZEPHIR_CPY_WRT(key, index); + ZEPHIR_CPY_WRT(&key, &index); } - ZEPHIR_OBS_VAR(value); - if (zephir_array_isset_fetch(&value, _SESSION, key, 0 TSRMLS_CC)) { + ZEPHIR_OBS_VAR(&value); + if (zephir_array_isset_fetch(&value, _SESSION, &key, 0 TSRMLS_CC)) { if (remove) { - zephir_array_unset(&_SESSION, key, PH_SEPARATE); + zephir_array_unset(_SESSION, &key, PH_SEPARATE); } - RETURN_CCTOR(value); + RETURN_CCTOR(&value); } RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); @@ -269,24 +304,30 @@ PHP_METHOD(Phalcon_Session_Adapter, get) { */ PHP_METHOD(Phalcon_Session_Adapter, set) { - zval *index_param = NULL, *value, *_SESSION, *uniqueId = NULL, *_0$$3; - zval *index = NULL; + zval *index_param = NULL, *value, value_sub, *_SESSION, uniqueId, _0$$3; + zval index; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&uniqueId); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); - zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC); + zephir_get_global(&_SESSION, SL("_SESSION")); zephir_fetch_params(1, 2, 0, &index_param, &value); - zephir_get_strval(index, index_param); + zephir_get_strval(&index, index_param); - uniqueId = zephir_fetch_nproperty_this(this_ptr, SL("_uniqueId"), PH_NOISY_CC); - if (!(ZEPHIR_IS_EMPTY(uniqueId))) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_VSV(_0$$3, uniqueId, "#", index); - zephir_array_update_zval(&_SESSION, _0$$3, &value, PH_COPY | PH_SEPARATE); + zephir_read_property(&uniqueId, this_ptr, SL("_uniqueId"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_IS_EMPTY(&uniqueId))) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_VSV(&_0$$3, &uniqueId, "#", &index); + zephir_array_update_zval(_SESSION, &_0$$3, value, PH_COPY | PH_SEPARATE); RETURN_MM_NULL(); } - zephir_array_update_zval(&_SESSION, index, &value, PH_COPY | PH_SEPARATE); + zephir_array_update_zval(_SESSION, &index, value, PH_COPY | PH_SEPARATE); ZEPHIR_MM_RESTORE(); } @@ -302,23 +343,28 @@ PHP_METHOD(Phalcon_Session_Adapter, set) { */ PHP_METHOD(Phalcon_Session_Adapter, has) { - zval *index_param = NULL, *_SESSION, *uniqueId = NULL, *_0$$3; - zval *index = NULL; + zval *index_param = NULL, *_SESSION, uniqueId, _0$$3; + zval index; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&uniqueId); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); - zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC); + zephir_get_global(&_SESSION, SL("_SESSION")); zephir_fetch_params(1, 1, 0, &index_param); - zephir_get_strval(index, index_param); + zephir_get_strval(&index, index_param); - uniqueId = zephir_fetch_nproperty_this(this_ptr, SL("_uniqueId"), PH_NOISY_CC); - if (!(ZEPHIR_IS_EMPTY(uniqueId))) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_VSV(_0$$3, uniqueId, "#", index); - RETURN_MM_BOOL(zephir_array_isset(_SESSION, _0$$3)); + zephir_read_property(&uniqueId, this_ptr, SL("_uniqueId"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_IS_EMPTY(&uniqueId))) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_VSV(&_0$$3, &uniqueId, "#", &index); + RETURN_MM_BOOL(zephir_array_isset(_SESSION, &_0$$3)); } - RETURN_MM_BOOL(zephir_array_isset(_SESSION, index)); + RETURN_MM_BOOL(zephir_array_isset(_SESSION, &index)); } @@ -331,24 +377,29 @@ PHP_METHOD(Phalcon_Session_Adapter, has) { */ PHP_METHOD(Phalcon_Session_Adapter, remove) { - zval *index_param = NULL, *_SESSION, *uniqueId = NULL, *_0$$3; - zval *index = NULL; + zval *index_param = NULL, *_SESSION, uniqueId, _0$$3; + zval index; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&uniqueId); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); - zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC); + zephir_get_global(&_SESSION, SL("_SESSION")); zephir_fetch_params(1, 1, 0, &index_param); - zephir_get_strval(index, index_param); + zephir_get_strval(&index, index_param); - uniqueId = zephir_fetch_nproperty_this(this_ptr, SL("_uniqueId"), PH_NOISY_CC); - if (!(ZEPHIR_IS_EMPTY(uniqueId))) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_CONCAT_VSV(_0$$3, uniqueId, "#", index); - zephir_array_unset(&_SESSION, _0$$3, PH_SEPARATE); + zephir_read_property(&uniqueId, this_ptr, SL("_uniqueId"), PH_NOISY_CC | PH_READONLY); + if (!(ZEPHIR_IS_EMPTY(&uniqueId))) { + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_CONCAT_VSV(&_0$$3, &uniqueId, "#", &index); + zephir_array_unset(_SESSION, &_0$$3, PH_SEPARATE); RETURN_MM_NULL(); } - zephir_array_unset(&_SESSION, index, PH_SEPARATE); + zephir_array_unset(_SESSION, &index, PH_SEPARATE); ZEPHIR_MM_RESTORE(); } @@ -363,10 +414,12 @@ PHP_METHOD(Phalcon_Session_Adapter, remove) { PHP_METHOD(Phalcon_Session_Adapter, getId) { zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_FUNCTION("session_id", NULL, 32); + ZEPHIR_RETURN_CALL_FUNCTION("session_id", NULL, 27); zephir_check_call_status(); RETURN_MM(); @@ -383,15 +436,18 @@ PHP_METHOD(Phalcon_Session_Adapter, setId) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *id_param = NULL; - zval *id = NULL; + zval id; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &id_param); - zephir_get_strval(id, id_param); + zephir_get_strval(&id, id_param); - ZEPHIR_CALL_FUNCTION(NULL, "session_id", NULL, 32, id); + ZEPHIR_CALL_FUNCTION(NULL, "session_id", NULL, 27, &id); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -408,7 +464,8 @@ PHP_METHOD(Phalcon_Session_Adapter, setId) { */ PHP_METHOD(Phalcon_Session_Adapter, isStarted) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_started"); @@ -431,13 +488,20 @@ PHP_METHOD(Phalcon_Session_Adapter, destroy) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *removeData = NULL; + zval *removeData = NULL, removeData_sub, __$true, __$false, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&removeData_sub); + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &removeData); if (!removeData) { - removeData = ZEPHIR_GLOBAL(global_null); + removeData = &removeData_sub; + removeData = &__$null; } @@ -450,11 +514,11 @@ PHP_METHOD(Phalcon_Session_Adapter, destroy) { zephir_check_call_status(); } if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } - ZEPHIR_RETURN_CALL_FUNCTION("session_destroy", NULL, 33); + ZEPHIR_RETURN_CALL_FUNCTION("session_destroy", NULL, 28); zephir_check_call_status(); RETURN_MM(); @@ -475,18 +539,21 @@ PHP_METHOD(Phalcon_Session_Adapter, destroy) { */ PHP_METHOD(Phalcon_Session_Adapter, status) { - zval *status = NULL; + zval status; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&status); ZEPHIR_MM_GROW(); - ZEPHIR_CALL_FUNCTION(&status, "session_status", NULL, 34); + ZEPHIR_CALL_FUNCTION(&status, "session_status", NULL, 29); zephir_check_call_status(); do { - if (ZEPHIR_IS_LONG(status, 0)) { + if (ZEPHIR_IS_LONG(&status, 0)) { RETURN_MM_LONG(0); } - if (ZEPHIR_IS_LONG(status, 2)) { + if (ZEPHIR_IS_LONG(&status, 2)) { RETURN_MM_LONG(2); } } while(0); @@ -502,15 +569,18 @@ PHP_METHOD(Phalcon_Session_Adapter, __get) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *index_param = NULL; - zval *index = NULL; + zval index; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index_param); - zephir_get_strval(index, index_param); + zephir_get_strval(&index, index_param); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0, index); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0, &index); zephir_check_call_status(); RETURN_MM(); @@ -522,16 +592,20 @@ PHP_METHOD(Phalcon_Session_Adapter, __get) { PHP_METHOD(Phalcon_Session_Adapter, __set) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *index_param = NULL, *value; - zval *index = NULL; + zval *index_param = NULL, *value, value_sub; + zval index; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &index_param, &value); - zephir_get_strval(index, index_param); + zephir_get_strval(&index, index_param); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, index, value); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "set", NULL, 0, &index, value); zephir_check_call_status(); RETURN_MM(); @@ -544,15 +618,18 @@ PHP_METHOD(Phalcon_Session_Adapter, __isset) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *index_param = NULL; - zval *index = NULL; + zval index; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index_param); - zephir_get_strval(index, index_param); + zephir_get_strval(&index, index_param); - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, index); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, &index); zephir_check_call_status(); RETURN_MM(); @@ -569,15 +646,18 @@ PHP_METHOD(Phalcon_Session_Adapter, __unset) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *index_param = NULL; - zval *index = NULL; + zval index; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&index); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &index_param); - zephir_get_strval(index, index_param); + zephir_get_strval(&index, index_param); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "remove", NULL, 0, index); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "remove", NULL, 0, &index); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -585,19 +665,24 @@ PHP_METHOD(Phalcon_Session_Adapter, __unset) { PHP_METHOD(Phalcon_Session_Adapter, __destruct) { - zval *_0; + zval __$true, __$false, _0; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_started"), PH_NOISY_CC); - if (zephir_is_true(_0)) { - ZEPHIR_CALL_FUNCTION(NULL, "session_write_close", NULL, 35); + zephir_read_property(&_0, this_ptr, SL("_started"), PH_NOISY_CC | PH_READONLY); + if (zephir_is_true(&_0)) { + ZEPHIR_CALL_FUNCTION(NULL, "session_write_close", NULL, 30); zephir_check_call_status(); if (0) { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_started"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_started"), &__$false); } } ZEPHIR_MM_RESTORE(); @@ -606,35 +691,45 @@ PHP_METHOD(Phalcon_Session_Adapter, __destruct) { PHP_METHOD(Phalcon_Session_Adapter, removeSessionData) { - HashTable *_2$$4; - HashPosition _1$$4; - zval *_SESSION = NULL, *uniqueId = NULL, *key = NULL, *_0$$4 = NULL, **_3$$4, *_4$$5 = NULL; + zend_string *_3$$4; + zend_ulong _2$$4; + zval *_SESSION = NULL, uniqueId, key, _0$$4, *_1$$4, _4$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&uniqueId); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&_0$$4); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); - zephir_get_global(&_SESSION, SS("_SESSION") TSRMLS_CC); + zephir_get_global(&_SESSION, SL("_SESSION")); - ZEPHIR_OBS_VAR(uniqueId); - zephir_read_property_this(&uniqueId, this_ptr, SL("_uniqueId"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&uniqueId); + zephir_read_property(&uniqueId, this_ptr, SL("_uniqueId"), PH_NOISY_CC); if (ZEPHIR_IS_EMPTY(_SESSION)) { RETURN_MM_NULL(); } - if (!(ZEPHIR_IS_EMPTY(uniqueId))) { - ZEPHIR_INIT_VAR(_0$$4); - zephir_is_iterable(_SESSION, &_2$$4, &_1$$4, 1, 0, "phalcon/session/adapter.zep", 363); - for ( - ; zend_hash_get_current_data_ex(_2$$4, (void**) &_3$$4, &_1$$4) == SUCCESS - ; zend_hash_move_forward_ex(_2$$4, &_1$$4) - ) { - ZEPHIR_GET_HMKEY(key, _2$$4, _1$$4); - ZEPHIR_GET_HVALUE(_0$$4, _3$$4); + if (!(ZEPHIR_IS_EMPTY(&uniqueId))) { + ZEPHIR_INIT_VAR(&_0$$4); + zephir_is_iterable(_SESSION, 1, "phalcon/session/adapter.zep", 363); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(_SESSION), _2$$4, _3$$4, _1$$4) + { + ZEPHIR_INIT_NVAR(&key); + if (_3$$4 != NULL) { + ZVAL_STR_COPY(&key, _3$$4); + } else { + ZVAL_LONG(&key, _2$$4); + } + ZEPHIR_INIT_NVAR(&_0$$4); + ZVAL_COPY(&_0$$4, _1$$4); ZEPHIR_INIT_LNVAR(_4$$5); - ZEPHIR_CONCAT_VS(_4$$5, uniqueId, "#"); - if (zephir_start_with(key, _4$$5, NULL)) { - zephir_array_unset(&_SESSION, key, PH_SEPARATE); + ZEPHIR_CONCAT_VS(&_4$$5, &uniqueId, "#"); + if (zephir_start_with(&key, &_4$$5, NULL)) { + zephir_array_unset(_SESSION, &key, PH_SEPARATE); } - } - zend_hash_destroy(_2$$4); - FREE_HASHTABLE(_2$$4); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&_0$$4); + ZEPHIR_INIT_NVAR(&key); } else { ZEPHIR_INIT_NVAR(_SESSION); array_init(_SESSION); diff --git a/ext/phalcon/session/adapter.zep.h b/ext/phalcon/session/adapter.zep.h index e44496bb955..46d20aebaae 100644 --- a/ext/phalcon/session/adapter.zep.h +++ b/ext/phalcon/session/adapter.zep.h @@ -30,79 +30,185 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter___construct, 0, 0, 0) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_start, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_start, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_setoptions, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_getoptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_getoptions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_setname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_getname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_regenerateid, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_adapter_regenerateid, 0, 0, Phalcon\\Session\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_regenerateid, 0, 0, IS_OBJECT, "Phalcon\\Session\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, deleteOldSession, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, deleteOldSession) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_ARG_INFO(0, defaultValue) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, remove, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, remove) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_remove, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_getid, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_getid, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_setid, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) +#else ZEND_ARG_INFO(0, id) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_isstarted, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_isstarted, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_destroy, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_destroy, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_destroy, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, removeData) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_status, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_status, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter___get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter___set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter___isset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter___isset, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter___isset, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter___unset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_session_adapter_method_entry) { PHP_ME(Phalcon_Session_Adapter, __construct, arginfo_phalcon_session_adapter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Session_Adapter, start, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter, start, arginfo_phalcon_session_adapter_start, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, setOptions, arginfo_phalcon_session_adapter_setoptions, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter, getOptions, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter, getOptions, arginfo_phalcon_session_adapter_getoptions, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, setName, arginfo_phalcon_session_adapter_setname, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter, getName, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter, getName, arginfo_phalcon_session_adapter_getname, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, regenerateId, arginfo_phalcon_session_adapter_regenerateid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, get, arginfo_phalcon_session_adapter_get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, set, arginfo_phalcon_session_adapter_set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, has, arginfo_phalcon_session_adapter_has, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, remove, arginfo_phalcon_session_adapter_remove, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter, getId, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter, getId, arginfo_phalcon_session_adapter_getid, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, setId, arginfo_phalcon_session_adapter_setid, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter, isStarted, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter, isStarted, arginfo_phalcon_session_adapter_isstarted, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, destroy, arginfo_phalcon_session_adapter_destroy, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter, status, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter, status, arginfo_phalcon_session_adapter_status, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, __get, arginfo_phalcon_session_adapter___get, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, __set, arginfo_phalcon_session_adapter___set, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter, __isset, arginfo_phalcon_session_adapter___isset, ZEND_ACC_PUBLIC) diff --git a/ext/phalcon/session/adapter/libmemcached.zep.c b/ext/phalcon/session/adapter/libmemcached.zep.c index b016772c6ef..a832b3d7286 100644 --- a/ext/phalcon/session/adapter/libmemcached.zep.c +++ b/ext/phalcon/session/adapter/libmemcached.zep.c @@ -67,7 +67,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Libmemcached) { PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, getLibmemcached) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_libmemcached"); @@ -75,7 +76,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, getLibmemcached) { PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, getLifetime) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lifetime"); @@ -88,112 +90,134 @@ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, getLifetime) { */ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, __construct) { - zephir_fcall_cache_entry *_13 = NULL; + zephir_fcall_cache_entry *_14 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *options_param = NULL, *servers = NULL, *client = NULL, *lifetime = NULL, *prefix = NULL, *statsKey = NULL, *persistentId = NULL, *_0 = NULL, *_1 = NULL, *_2, *_4, *_7 = NULL; - zval *options = NULL, *_3, *_5, *_6, *_8, *_9, *_10, *_11, *_12; + zval *options_param = NULL, servers, client, lifetime, prefix, statsKey, persistentId, _0, _1, _2, _3, _5, _8; + zval options, _4, _6, _7, _9, _10, _11, _12, _13; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&servers); + ZVAL_UNDEF(&client); + ZVAL_UNDEF(&lifetime); + ZVAL_UNDEF(&prefix); + ZVAL_UNDEF(&statsKey); + ZVAL_UNDEF(&persistentId); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &options_param); - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); - ZEPHIR_OBS_VAR(servers); - if (!(zephir_array_isset_string_fetch(&servers, options, SS("servers"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&servers); + if (!(zephir_array_isset_string_fetch(&servers, &options, SL("servers"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "No servers given in options", "phalcon/session/adapter/libmemcached.zep", 76); return; } - ZEPHIR_OBS_VAR(client); - if (!(zephir_array_isset_string_fetch(&client, options, SS("client"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(client); - ZVAL_NULL(client); + ZEPHIR_OBS_VAR(&client); + if (!(zephir_array_isset_string_fetch(&client, &options, SL("client"), 0))) { + ZEPHIR_INIT_NVAR(&client); + ZVAL_NULL(&client); } - ZEPHIR_OBS_VAR(lifetime); - if (!(zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(lifetime); - ZVAL_LONG(lifetime, 8600); + ZEPHIR_OBS_VAR(&lifetime); + if (!(zephir_array_isset_string_fetch(&lifetime, &options, SL("lifetime"), 0))) { + ZEPHIR_INIT_NVAR(&lifetime); + ZVAL_LONG(&lifetime, 8600); } - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 2592000); - ZEPHIR_CALL_FUNCTION(&_1, "min", NULL, 449, lifetime, _0); + ZVAL_LONG(&_0, 2592000); + ZEPHIR_CALL_FUNCTION(&_1, "min", NULL, 403, &lifetime, &_0); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_lifetime"), _1 TSRMLS_CC); - ZEPHIR_OBS_VAR(prefix); - if (!(zephir_array_isset_string_fetch(&prefix, options, SS("prefix"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(prefix); - ZVAL_NULL(prefix); + zephir_update_property_zval(this_ptr, SL("_lifetime"), &_1); + ZEPHIR_OBS_VAR(&prefix); + if (!(zephir_array_isset_string_fetch(&prefix, &options, SL("prefix"), 0))) { + ZEPHIR_INIT_NVAR(&prefix); + ZVAL_NULL(&prefix); } - ZEPHIR_OBS_VAR(statsKey); - if (!(zephir_array_isset_string_fetch(&statsKey, options, SS("statsKey"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(statsKey); - ZVAL_STRING(statsKey, "", 1); + ZEPHIR_OBS_VAR(&statsKey); + if (!(zephir_array_isset_string_fetch(&statsKey, &options, SL("statsKey"), 0))) { + ZEPHIR_INIT_NVAR(&statsKey); + ZVAL_STRING(&statsKey, ""); } - ZEPHIR_OBS_VAR(persistentId); - if (!(zephir_array_isset_string_fetch(&persistentId, options, SS("persistent_id"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(persistentId); - ZVAL_STRING(persistentId, "phalcon-session", 1); + ZEPHIR_OBS_VAR(&persistentId); + if (!(zephir_array_isset_string_fetch(&persistentId, &options, SL("persistent_id"), 0))) { + ZEPHIR_INIT_NVAR(&persistentId); + ZVAL_STRING(&persistentId, "phalcon-session"); } - ZEPHIR_INIT_NVAR(_0); - object_init_ex(_0, phalcon_cache_backend_libmemcached_ce); - ZEPHIR_INIT_VAR(_2); - object_init_ex(_2, phalcon_cache_frontend_data_ce); - ZEPHIR_INIT_VAR(_3); - zephir_create_array(_3, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_4); - zephir_read_property_this(&_4, this_ptr, SL("_lifetime"), PH_NOISY_CC); - zephir_array_update_string(&_3, SL("lifetime"), &_4, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 350, _3); + ZEPHIR_INIT_VAR(&_2); + object_init_ex(&_2, phalcon_cache_backend_libmemcached_ce); + ZEPHIR_INIT_VAR(&_3); + object_init_ex(&_3, phalcon_cache_frontend_data_ce); + ZEPHIR_INIT_VAR(&_4); + zephir_create_array(&_4, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_5); + zephir_read_property(&_5, this_ptr, SL("_lifetime"), PH_NOISY_CC); + zephir_array_update_string(&_4, SL("lifetime"), &_5, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, &_3, "__construct", NULL, 309, &_4); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_5); - zephir_create_array(_5, 5, 0 TSRMLS_CC); - zephir_array_update_string(&_5, SL("servers"), &servers, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_5, SL("client"), &client, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_5, SL("prefix"), &prefix, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_5, SL("statsKey"), &statsKey, PH_COPY | PH_SEPARATE); - zephir_array_update_string(&_5, SL("persistent_id"), &persistentId, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _0, "__construct", NULL, 351, _2, _5); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 5, 0 TSRMLS_CC); + zephir_array_update_string(&_6, SL("servers"), &servers, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_6, SL("client"), &client, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_6, SL("prefix"), &prefix, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_6, SL("statsKey"), &statsKey, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&_6, SL("persistent_id"), &persistentId, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 310, &_3, &_6); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_libmemcached"), _0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_6, this_ptr); - ZEPHIR_INIT_VAR(_7); - ZVAL_STRING(_7, "open", 1); - zephir_array_fast_append(_6, _7); - ZEPHIR_INIT_VAR(_8); - zephir_create_array(_8, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_8, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "close", 1); - zephir_array_fast_append(_8, _7); - ZEPHIR_INIT_VAR(_9); - zephir_create_array(_9, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_9, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "read", 1); - zephir_array_fast_append(_9, _7); - ZEPHIR_INIT_VAR(_10); - zephir_create_array(_10, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_10, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "write", 1); - zephir_array_fast_append(_10, _7); - ZEPHIR_INIT_VAR(_11); - zephir_create_array(_11, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_11, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "destroy", 1); - zephir_array_fast_append(_11, _7); - ZEPHIR_INIT_VAR(_12); - zephir_create_array(_12, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_12, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "gc", 1); - zephir_array_fast_append(_12, _7); - ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 450, _6, _8, _9, _10, _11, _12); + zephir_update_property_zval(this_ptr, SL("_libmemcached"), &_2); + ZEPHIR_INIT_VAR(&_7); + zephir_create_array(&_7, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_7, this_ptr); + ZEPHIR_INIT_VAR(&_8); + ZVAL_STRING(&_8, "open"); + zephir_array_fast_append(&_7, &_8); + ZEPHIR_INIT_VAR(&_9); + zephir_create_array(&_9, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_9, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "close"); + zephir_array_fast_append(&_9, &_8); + ZEPHIR_INIT_VAR(&_10); + zephir_create_array(&_10, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_10, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "read"); + zephir_array_fast_append(&_10, &_8); + ZEPHIR_INIT_VAR(&_11); + zephir_create_array(&_11, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_11, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "write"); + zephir_array_fast_append(&_11, &_8); + ZEPHIR_INIT_VAR(&_12); + zephir_create_array(&_12, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_12, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "destroy"); + zephir_array_fast_append(&_12, &_8); + ZEPHIR_INIT_VAR(&_13); + zephir_create_array(&_13, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_13, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "gc"); + zephir_array_fast_append(&_13, &_8); + ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 404, &_7, &_9, &_10, &_11, &_12, &_13); zephir_check_call_status(); - ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_libmemcached_ce, getThis(), "__construct", &_13, 451, options); + ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_libmemcached_ce, getThis(), "__construct", &_14, 0, &options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -201,7 +225,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, __construct) { PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, open) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); @@ -209,7 +234,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, open) { PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, close) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); @@ -221,21 +247,28 @@ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, close) { PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sessionId_param = NULL, *_0, *_1 = NULL, *_2; - zval *sessionId = NULL, *_3 = NULL; + zval *sessionId_param = NULL, _0, _1, _2; + zval sessionId, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sessionId); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sessionId_param); - zephir_get_strval(sessionId, sessionId_param); + zephir_get_strval(&sessionId, sessionId_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_libmemcached"), PH_NOISY_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_lifetime"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "get", NULL, 0, sessionId, _2); + zephir_read_property(&_0, this_ptr, SL("_libmemcached"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_2, this_ptr, SL("_lifetime"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &sessionId, &_2); zephir_check_call_status(); - zephir_get_strval(_3, _1); - RETURN_CTOR(_3); + zephir_get_strval(&_3, &_1); + RETURN_CTOR(&_3); } @@ -245,19 +278,25 @@ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, read) { PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sessionId_param = NULL, *data_param = NULL, *_0, *_1; - zval *sessionId = NULL, *data = NULL; + zval *sessionId_param = NULL, *data_param = NULL, _0, _1; + zval sessionId, data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sessionId); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &sessionId_param, &data_param); - zephir_get_strval(sessionId, sessionId_param); - zephir_get_strval(data, data_param); + zephir_get_strval(&sessionId, sessionId_param); + zephir_get_strval(&data, data_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_libmemcached"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_lifetime"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "save", NULL, 0, sessionId, data, _1); + zephir_read_property(&_0, this_ptr, SL("_libmemcached"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_lifetime"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "save", NULL, 0, &sessionId, &data, &_1); zephir_check_call_status(); RETURN_MM(); @@ -270,13 +309,23 @@ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, destroy) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sessionId = NULL, *id = NULL, *_1, *_2 = NULL, *_3$$5, *_4$$5 = NULL; + zval *sessionId = NULL, sessionId_sub, __$null, id, _1, _2, _3$$5, _4$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sessionId_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &sessionId); if (!sessionId) { - sessionId = ZEPHIR_GLOBAL(global_null); + sessionId = &sessionId_sub; + sessionId = &__$null; } @@ -284,22 +333,22 @@ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, destroy) { ZEPHIR_CALL_METHOD(&id, this_ptr, "getid", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(id, sessionId); + ZEPHIR_CPY_WRT(&id, sessionId); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "removesessiondata", NULL, 0); zephir_check_call_status(); - _0 = !(ZEPHIR_IS_EMPTY(id)); + _0 = !(ZEPHIR_IS_EMPTY(&id)); if (_0) { - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_libmemcached"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "exists", NULL, 0, id); + zephir_read_property(&_1, this_ptr, SL("_libmemcached"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "exists", NULL, 0, &id); zephir_check_call_status(); - _0 = zephir_is_true(_2); + _0 = zephir_is_true(&_2); } if (_0) { - _3$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_libmemcached"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_4$$5, _3$$5, "delete", NULL, 0, id); + zephir_read_property(&_3$$5, this_ptr, SL("_libmemcached"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_4$$5, &_3$$5, "delete", NULL, 0, &id); zephir_check_call_status(); - RETURN_MM_BOOL(zephir_get_boolval(_4$$5)); + RETURN_MM_BOOL(zephir_get_boolval(&_4$$5)); } RETURN_MM_BOOL(1); @@ -310,7 +359,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, destroy) { */ PHP_METHOD(Phalcon_Session_Adapter_Libmemcached, gc) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); diff --git a/ext/phalcon/session/adapter/libmemcached.zep.h b/ext/phalcon/session/adapter/libmemcached.zep.h index 32fa57be249..8cdc9d66bd5 100644 --- a/ext/phalcon/session/adapter/libmemcached.zep.h +++ b/ext/phalcon/session/adapter/libmemcached.zep.h @@ -17,28 +17,73 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_libmemcached___construct, ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_open, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_open, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_read, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_read, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sessionId, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sessionId) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_write, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_write, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sessionId, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sessionId) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) +#else ZEND_ARG_INFO(0, data) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_destroy, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_destroy, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_destroy, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_gc, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_libmemcached_gc, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_session_adapter_libmemcached_method_entry) { PHP_ME(Phalcon_Session_Adapter_Libmemcached, getLibmemcached, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Libmemcached, getLifetime, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Libmemcached, __construct, arginfo_phalcon_session_adapter_libmemcached___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Session_Adapter_Libmemcached, open, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter_Libmemcached, close, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Libmemcached, open, arginfo_phalcon_session_adapter_libmemcached_open, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Libmemcached, close, arginfo_phalcon_session_adapter_libmemcached_close, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Libmemcached, read, arginfo_phalcon_session_adapter_libmemcached_read, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Libmemcached, write, arginfo_phalcon_session_adapter_libmemcached_write, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Libmemcached, destroy, arginfo_phalcon_session_adapter_libmemcached_destroy, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter_Libmemcached, gc, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Libmemcached, gc, arginfo_phalcon_session_adapter_libmemcached_gc, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/session/adapter/memcache.zep.c b/ext/phalcon/session/adapter/memcache.zep.c index 213b4618a29..a339c1b4114 100644 --- a/ext/phalcon/session/adapter/memcache.zep.c +++ b/ext/phalcon/session/adapter/memcache.zep.c @@ -59,7 +59,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Memcache) { PHP_METHOD(Phalcon_Session_Adapter_Memcache, getMemcache) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_memcache"); @@ -67,7 +68,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, getMemcache) { PHP_METHOD(Phalcon_Session_Adapter_Memcache, getLifetime) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lifetime"); @@ -80,92 +82,110 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, __construct) { zephir_fcall_cache_entry *_14 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *options_param = NULL, *lifetime = NULL, *_3, *_4, *_6, *_8 = NULL, *_0$$3, *_1$$4, *_2$$5; - zval *options = NULL, *_5, *_7, *_9, *_10, *_11, *_12, *_13; + zval *options_param = NULL, lifetime, _3, _4, _6, _8, _0$$3, _1$$4, _2$$5; + zval options, _5, _7, _9, _10, _11, _12, _13; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_13); + ZVAL_UNDEF(&lifetime); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options_param); if (!options_param) { - ZEPHIR_INIT_VAR(options); - array_init(options); + ZEPHIR_INIT_VAR(&options); + array_init(&options); } else { - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); } - if (!(zephir_array_isset_string(options, SS("host")))) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_STRING(_0$$3, "127.0.0.1", 1); + if (!(zephir_array_isset_string(&options, SL("host")))) { + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "127.0.0.1"); zephir_array_update_string(&options, SL("host"), &_0$$3, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("port")))) { - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_LONG(_1$$4, 11211); + if (!(zephir_array_isset_string(&options, SL("port")))) { + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_LONG(&_1$$4, 11211); zephir_array_update_string(&options, SL("port"), &_1$$4, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("persistent")))) { - ZEPHIR_INIT_VAR(_2$$5); - ZVAL_LONG(_2$$5, 0); + if (!(zephir_array_isset_string(&options, SL("persistent")))) { + ZEPHIR_INIT_VAR(&_2$$5); + ZVAL_LONG(&_2$$5, 0); zephir_array_update_string(&options, SL("persistent"), &_2$$5, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(lifetime); - if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_lifetime"), lifetime TSRMLS_CC); + ZEPHIR_OBS_VAR(&lifetime); + if (zephir_array_isset_string_fetch(&lifetime, &options, SL("lifetime"), 0)) { + zephir_update_property_zval(this_ptr, SL("_lifetime"), &lifetime); } - ZEPHIR_INIT_VAR(_3); - object_init_ex(_3, phalcon_cache_backend_memcache_ce); - ZEPHIR_INIT_VAR(_4); - object_init_ex(_4, phalcon_cache_frontend_data_ce); - ZEPHIR_INIT_VAR(_5); - zephir_create_array(_5, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_6); - zephir_read_property_this(&_6, this_ptr, SL("_lifetime"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_3); + object_init_ex(&_3, phalcon_cache_backend_memcache_ce); + ZEPHIR_INIT_VAR(&_4); + object_init_ex(&_4, phalcon_cache_frontend_data_ce); + ZEPHIR_INIT_VAR(&_5); + zephir_create_array(&_5, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_6); + zephir_read_property(&_6, this_ptr, SL("_lifetime"), PH_NOISY_CC); zephir_array_update_string(&_5, SL("lifetime"), &_6, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 350, _5); + ZEPHIR_CALL_METHOD(NULL, &_4, "__construct", NULL, 309, &_5); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, _3, "__construct", NULL, 353, _4, options); + ZEPHIR_CALL_METHOD(NULL, &_3, "__construct", NULL, 311, &_4, &options); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_memcache"), _3 TSRMLS_CC); - ZEPHIR_INIT_VAR(_7); - zephir_create_array(_7, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_7, this_ptr); - ZEPHIR_INIT_VAR(_8); - ZVAL_STRING(_8, "open", 1); - zephir_array_fast_append(_7, _8); - ZEPHIR_INIT_VAR(_9); - zephir_create_array(_9, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_9, this_ptr); - ZEPHIR_INIT_NVAR(_8); - ZVAL_STRING(_8, "close", 1); - zephir_array_fast_append(_9, _8); - ZEPHIR_INIT_VAR(_10); - zephir_create_array(_10, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_10, this_ptr); - ZEPHIR_INIT_NVAR(_8); - ZVAL_STRING(_8, "read", 1); - zephir_array_fast_append(_10, _8); - ZEPHIR_INIT_VAR(_11); - zephir_create_array(_11, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_11, this_ptr); - ZEPHIR_INIT_NVAR(_8); - ZVAL_STRING(_8, "write", 1); - zephir_array_fast_append(_11, _8); - ZEPHIR_INIT_VAR(_12); - zephir_create_array(_12, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_12, this_ptr); - ZEPHIR_INIT_NVAR(_8); - ZVAL_STRING(_8, "destroy", 1); - zephir_array_fast_append(_12, _8); - ZEPHIR_INIT_VAR(_13); - zephir_create_array(_13, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_13, this_ptr); - ZEPHIR_INIT_NVAR(_8); - ZVAL_STRING(_8, "gc", 1); - zephir_array_fast_append(_13, _8); - ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 450, _7, _9, _10, _11, _12, _13); + zephir_update_property_zval(this_ptr, SL("_memcache"), &_3); + ZEPHIR_INIT_VAR(&_7); + zephir_create_array(&_7, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_7, this_ptr); + ZEPHIR_INIT_VAR(&_8); + ZVAL_STRING(&_8, "open"); + zephir_array_fast_append(&_7, &_8); + ZEPHIR_INIT_VAR(&_9); + zephir_create_array(&_9, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_9, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "close"); + zephir_array_fast_append(&_9, &_8); + ZEPHIR_INIT_VAR(&_10); + zephir_create_array(&_10, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_10, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "read"); + zephir_array_fast_append(&_10, &_8); + ZEPHIR_INIT_VAR(&_11); + zephir_create_array(&_11, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_11, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "write"); + zephir_array_fast_append(&_11, &_8); + ZEPHIR_INIT_VAR(&_12); + zephir_create_array(&_12, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_12, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "destroy"); + zephir_array_fast_append(&_12, &_8); + ZEPHIR_INIT_VAR(&_13); + zephir_create_array(&_13, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_13, this_ptr); + ZEPHIR_INIT_NVAR(&_8); + ZVAL_STRING(&_8, "gc"); + zephir_array_fast_append(&_13, &_8); + ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 404, &_7, &_9, &_10, &_11, &_12, &_13); zephir_check_call_status(); - ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_memcache_ce, getThis(), "__construct", &_14, 451, options); + ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_memcache_ce, getThis(), "__construct", &_14, 0, &options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -173,7 +193,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, __construct) { PHP_METHOD(Phalcon_Session_Adapter_Memcache, open) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); @@ -181,7 +202,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, open) { PHP_METHOD(Phalcon_Session_Adapter_Memcache, close) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); @@ -193,21 +215,28 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, close) { PHP_METHOD(Phalcon_Session_Adapter_Memcache, read) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sessionId_param = NULL, *_0, *_1 = NULL, *_2; - zval *sessionId = NULL, *_3 = NULL; + zval *sessionId_param = NULL, _0, _1, _2; + zval sessionId, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sessionId); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sessionId_param); - zephir_get_strval(sessionId, sessionId_param); + zephir_get_strval(&sessionId, sessionId_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_lifetime"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "get", NULL, 0, sessionId, _2); + zephir_read_property(&_0, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_2, this_ptr, SL("_lifetime"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, &sessionId, &_2); zephir_check_call_status(); - zephir_get_strval(_3, _1); - RETURN_CTOR(_3); + zephir_get_strval(&_3, &_1); + RETURN_CTOR(&_3); } @@ -217,19 +246,25 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, read) { PHP_METHOD(Phalcon_Session_Adapter_Memcache, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sessionId_param = NULL, *data_param = NULL, *_0, *_1; - zval *sessionId = NULL, *data = NULL; + zval *sessionId_param = NULL, *data_param = NULL, _0, _1; + zval sessionId, data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sessionId); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &sessionId_param, &data_param); - zephir_get_strval(sessionId, sessionId_param); - zephir_get_strval(data, data_param); + zephir_get_strval(&sessionId, sessionId_param); + zephir_get_strval(&data, data_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_lifetime"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "save", NULL, 0, sessionId, data, _1); + zephir_read_property(&_0, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_lifetime"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "save", NULL, 0, &sessionId, &data, &_1); zephir_check_call_status(); RETURN_MM(); @@ -242,13 +277,23 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, destroy) { zend_bool _0; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sessionId = NULL, *id = NULL, *_1, *_2 = NULL, *_3$$5, *_4$$5 = NULL; + zval *sessionId = NULL, sessionId_sub, __$null, id, _1, _2, _3$$5, _4$$5; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sessionId_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3$$5); + ZVAL_UNDEF(&_4$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &sessionId); if (!sessionId) { - sessionId = ZEPHIR_GLOBAL(global_null); + sessionId = &sessionId_sub; + sessionId = &__$null; } @@ -256,22 +301,22 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, destroy) { ZEPHIR_CALL_METHOD(&id, this_ptr, "getid", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(id, sessionId); + ZEPHIR_CPY_WRT(&id, sessionId); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "removesessiondata", NULL, 0); zephir_check_call_status(); - _0 = !(ZEPHIR_IS_EMPTY(id)); + _0 = !(ZEPHIR_IS_EMPTY(&id)); if (_0) { - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "exists", NULL, 0, id); + zephir_read_property(&_1, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "exists", NULL, 0, &id); zephir_check_call_status(); - _0 = zephir_is_true(_2); + _0 = zephir_is_true(&_2); } if (_0) { - _3$$5 = zephir_fetch_nproperty_this(this_ptr, SL("_memcache"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_4$$5, _3$$5, "delete", NULL, 0, id); + zephir_read_property(&_3$$5, this_ptr, SL("_memcache"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_4$$5, &_3$$5, "delete", NULL, 0, &id); zephir_check_call_status(); - RETURN_MM_BOOL(zephir_get_boolval(_4$$5)); + RETURN_MM_BOOL(zephir_get_boolval(&_4$$5)); } RETURN_MM_BOOL(1); @@ -282,7 +327,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, destroy) { */ PHP_METHOD(Phalcon_Session_Adapter_Memcache, gc) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); diff --git a/ext/phalcon/session/adapter/memcache.zep.h b/ext/phalcon/session/adapter/memcache.zep.h index c12ba5fd8e6..95650257d8f 100644 --- a/ext/phalcon/session/adapter/memcache.zep.h +++ b/ext/phalcon/session/adapter/memcache.zep.h @@ -14,31 +14,76 @@ PHP_METHOD(Phalcon_Session_Adapter_Memcache, destroy); PHP_METHOD(Phalcon_Session_Adapter_Memcache, gc); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_memcache___construct, 0, 0, 0) - ZEND_ARG_ARRAY_INFO(0, options, 1) + ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_memcache_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_open, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_open, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_read, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_read, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sessionId, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sessionId) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_memcache_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_write, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_write, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sessionId, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sessionId) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) +#else ZEND_ARG_INFO(0, data) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_memcache_destroy, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_destroy, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_destroy, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_gc, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_memcache_gc, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_session_adapter_memcache_method_entry) { PHP_ME(Phalcon_Session_Adapter_Memcache, getMemcache, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Memcache, getLifetime, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Memcache, __construct, arginfo_phalcon_session_adapter_memcache___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Session_Adapter_Memcache, open, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter_Memcache, close, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Memcache, open, arginfo_phalcon_session_adapter_memcache_open, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Memcache, close, arginfo_phalcon_session_adapter_memcache_close, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Memcache, read, arginfo_phalcon_session_adapter_memcache_read, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Memcache, write, arginfo_phalcon_session_adapter_memcache_write, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Memcache, destroy, arginfo_phalcon_session_adapter_memcache_destroy, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter_Memcache, gc, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Memcache, gc, arginfo_phalcon_session_adapter_memcache_gc, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/session/adapter/redis.zep.c b/ext/phalcon/session/adapter/redis.zep.c index 521be0963bb..2a5c1a6b0f8 100644 --- a/ext/phalcon/session/adapter/redis.zep.c +++ b/ext/phalcon/session/adapter/redis.zep.c @@ -61,7 +61,8 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Adapter_Redis) { PHP_METHOD(Phalcon_Session_Adapter_Redis, getRedis) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_redis"); @@ -69,7 +70,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, getRedis) { PHP_METHOD(Phalcon_Session_Adapter_Redis, getLifetime) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_lifetime"); @@ -82,92 +84,110 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, __construct) { zephir_fcall_cache_entry *_13 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *options_param = NULL, *lifetime = NULL, *_2, *_3, *_5, *_7 = NULL, *_0$$3, *_1$$4; - zval *options = NULL, *_4, *_6, *_8, *_9, *_10, *_11, *_12; + zval *options_param = NULL, __$false, lifetime, _2, _3, _5, _7, _0$$3, _1$$4; + zval options, _4, _6, _8, _9, _10, _11, _12; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_8); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_12); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&lifetime); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &options_param); if (!options_param) { - ZEPHIR_INIT_VAR(options); - array_init(options); + ZEPHIR_INIT_VAR(&options); + array_init(&options); } else { - zephir_get_arrval(options, options_param); + zephir_get_arrval(&options, options_param); } - if (!(zephir_array_isset_string(options, SS("host")))) { - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_STRING(_0$$3, "127.0.0.1", 1); + if (!(zephir_array_isset_string(&options, SL("host")))) { + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_STRING(&_0$$3, "127.0.0.1"); zephir_array_update_string(&options, SL("host"), &_0$$3, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("port")))) { - ZEPHIR_INIT_VAR(_1$$4); - ZVAL_LONG(_1$$4, 6379); + if (!(zephir_array_isset_string(&options, SL("port")))) { + ZEPHIR_INIT_VAR(&_1$$4); + ZVAL_LONG(&_1$$4, 6379); zephir_array_update_string(&options, SL("port"), &_1$$4, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(options, SS("persistent")))) { - zephir_array_update_string(&options, SL("persistent"), &ZEPHIR_GLOBAL(global_false), PH_COPY | PH_SEPARATE); + if (!(zephir_array_isset_string(&options, SL("persistent")))) { + zephir_array_update_string(&options, SL("persistent"), &__$false, PH_COPY | PH_SEPARATE); } - ZEPHIR_OBS_VAR(lifetime); - if (zephir_array_isset_string_fetch(&lifetime, options, SS("lifetime"), 0 TSRMLS_CC)) { - zephir_update_property_this(getThis(), SL("_lifetime"), lifetime TSRMLS_CC); + ZEPHIR_OBS_VAR(&lifetime); + if (zephir_array_isset_string_fetch(&lifetime, &options, SL("lifetime"), 0)) { + zephir_update_property_zval(this_ptr, SL("_lifetime"), &lifetime); } - ZEPHIR_INIT_VAR(_2); - object_init_ex(_2, phalcon_cache_backend_redis_ce); - ZEPHIR_INIT_VAR(_3); - object_init_ex(_3, phalcon_cache_frontend_none_ce); - if (zephir_has_constructor(_3 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_4); - zephir_create_array(_4, 1, 0 TSRMLS_CC); - ZEPHIR_OBS_VAR(_5); - zephir_read_property_this(&_5, this_ptr, SL("_lifetime"), PH_NOISY_CC); + ZEPHIR_INIT_VAR(&_2); + object_init_ex(&_2, phalcon_cache_backend_redis_ce); + ZEPHIR_INIT_VAR(&_3); + object_init_ex(&_3, phalcon_cache_frontend_none_ce); + if (zephir_has_constructor(&_3 TSRMLS_CC)) { + ZEPHIR_INIT_VAR(&_4); + zephir_create_array(&_4, 1, 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_5); + zephir_read_property(&_5, this_ptr, SL("_lifetime"), PH_NOISY_CC); zephir_array_update_string(&_4, SL("lifetime"), &_5, PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_METHOD(NULL, _3, "__construct", NULL, 0, _4); + ZEPHIR_CALL_METHOD(NULL, &_3, "__construct", NULL, 0, &_4); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, _2, "__construct", NULL, 354, _3, options); + ZEPHIR_CALL_METHOD(NULL, &_2, "__construct", NULL, 312, &_3, &options); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_redis"), _2 TSRMLS_CC); - ZEPHIR_INIT_VAR(_6); - zephir_create_array(_6, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_6, this_ptr); - ZEPHIR_INIT_VAR(_7); - ZVAL_STRING(_7, "open", 1); - zephir_array_fast_append(_6, _7); - ZEPHIR_INIT_VAR(_8); - zephir_create_array(_8, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_8, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "close", 1); - zephir_array_fast_append(_8, _7); - ZEPHIR_INIT_VAR(_9); - zephir_create_array(_9, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_9, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "read", 1); - zephir_array_fast_append(_9, _7); - ZEPHIR_INIT_VAR(_10); - zephir_create_array(_10, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_10, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "write", 1); - zephir_array_fast_append(_10, _7); - ZEPHIR_INIT_VAR(_11); - zephir_create_array(_11, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_11, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "destroy", 1); - zephir_array_fast_append(_11, _7); - ZEPHIR_INIT_VAR(_12); - zephir_create_array(_12, 2, 0 TSRMLS_CC); - zephir_array_fast_append(_12, this_ptr); - ZEPHIR_INIT_NVAR(_7); - ZVAL_STRING(_7, "gc", 1); - zephir_array_fast_append(_12, _7); - ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 450, _6, _8, _9, _10, _11, _12); + zephir_update_property_zval(this_ptr, SL("_redis"), &_2); + ZEPHIR_INIT_VAR(&_6); + zephir_create_array(&_6, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_6, this_ptr); + ZEPHIR_INIT_VAR(&_7); + ZVAL_STRING(&_7, "open"); + zephir_array_fast_append(&_6, &_7); + ZEPHIR_INIT_VAR(&_8); + zephir_create_array(&_8, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_8, this_ptr); + ZEPHIR_INIT_NVAR(&_7); + ZVAL_STRING(&_7, "close"); + zephir_array_fast_append(&_8, &_7); + ZEPHIR_INIT_VAR(&_9); + zephir_create_array(&_9, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_9, this_ptr); + ZEPHIR_INIT_NVAR(&_7); + ZVAL_STRING(&_7, "read"); + zephir_array_fast_append(&_9, &_7); + ZEPHIR_INIT_VAR(&_10); + zephir_create_array(&_10, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_10, this_ptr); + ZEPHIR_INIT_NVAR(&_7); + ZVAL_STRING(&_7, "write"); + zephir_array_fast_append(&_10, &_7); + ZEPHIR_INIT_VAR(&_11); + zephir_create_array(&_11, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_11, this_ptr); + ZEPHIR_INIT_NVAR(&_7); + ZVAL_STRING(&_7, "destroy"); + zephir_array_fast_append(&_11, &_7); + ZEPHIR_INIT_VAR(&_12); + zephir_create_array(&_12, 2, 0 TSRMLS_CC); + zephir_array_fast_append(&_12, this_ptr); + ZEPHIR_INIT_NVAR(&_7); + ZVAL_STRING(&_7, "gc"); + zephir_array_fast_append(&_12, &_7); + ZEPHIR_CALL_FUNCTION(NULL, "session_set_save_handler", NULL, 404, &_6, &_8, &_9, &_10, &_11, &_12); zephir_check_call_status(); - ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_redis_ce, getThis(), "__construct", &_13, 451, options); + ZEPHIR_CALL_PARENT(NULL, phalcon_session_adapter_redis_ce, getThis(), "__construct", &_13, 0, &options); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -178,7 +198,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, __construct) { */ PHP_METHOD(Phalcon_Session_Adapter_Redis, open) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); @@ -189,7 +210,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, open) { */ PHP_METHOD(Phalcon_Session_Adapter_Redis, close) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); @@ -200,21 +222,28 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, close) { */ PHP_METHOD(Phalcon_Session_Adapter_Redis, read) { - zval *_3 = NULL; + zval _3; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sessionId, *_0, *_1 = NULL, *_2; + zval *sessionId, sessionId_sub, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sessionId_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &sessionId); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_redis"), PH_NOISY_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_lifetime"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_1, _0, "get", NULL, 0, sessionId, _2); + zephir_read_property(&_0, this_ptr, SL("_redis"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_2, this_ptr, SL("_lifetime"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_1, &_0, "get", NULL, 0, sessionId, &_2); zephir_check_call_status(); - zephir_get_strval(_3, _1); - RETURN_CTOR(_3); + zephir_get_strval(&_3, &_1); + RETURN_CTOR(&_3); } @@ -224,19 +253,25 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, read) { PHP_METHOD(Phalcon_Session_Adapter_Redis, write) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sessionId_param = NULL, *data_param = NULL, *_0, *_1; - zval *sessionId = NULL, *data = NULL; + zval *sessionId_param = NULL, *data_param = NULL, _0, _1; + zval sessionId, data; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sessionId); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &sessionId_param, &data_param); - zephir_get_strval(sessionId, sessionId_param); - zephir_get_strval(data, data_param); + zephir_get_strval(&sessionId, sessionId_param); + zephir_get_strval(&data, data_param); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_redis"), PH_NOISY_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_lifetime"), PH_NOISY_CC); - ZEPHIR_RETURN_CALL_METHOD(_0, "save", NULL, 0, sessionId, data, _1); + zephir_read_property(&_0, this_ptr, SL("_redis"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_1, this_ptr, SL("_lifetime"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_RETURN_CALL_METHOD(&_0, "save", NULL, 0, &sessionId, &data, &_1); zephir_check_call_status(); RETURN_MM(); @@ -248,13 +283,23 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, write) { PHP_METHOD(Phalcon_Session_Adapter_Redis, destroy) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *sessionId = NULL, *id = NULL, *_0 = NULL, *_1, *_2 = NULL, *_3; + zval *sessionId = NULL, sessionId_sub, __$null, id, _0, _1, _2, _3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&sessionId_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &sessionId); if (!sessionId) { - sessionId = ZEPHIR_GLOBAL(global_null); + sessionId = &sessionId_sub; + sessionId = &__$null; } @@ -262,22 +307,22 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, destroy) { ZEPHIR_CALL_METHOD(&id, this_ptr, "getid", NULL, 0); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(id, sessionId); + ZEPHIR_CPY_WRT(&id, sessionId); } ZEPHIR_CALL_METHOD(NULL, this_ptr, "removesessiondata", NULL, 0); zephir_check_call_status(); - ZEPHIR_INIT_VAR(_0); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_redis"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_2, _1, "exists", NULL, 0, id); + ZEPHIR_INIT_VAR(&_0); + zephir_read_property(&_1, this_ptr, SL("_redis"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_2, &_1, "exists", NULL, 0, &id); zephir_check_call_status(); - if (zephir_is_true(_2)) { - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_redis"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&_0, _3, "delete", NULL, 0, id); + if (zephir_is_true(&_2)) { + zephir_read_property(&_3, this_ptr, SL("_redis"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&_0, &_3, "delete", NULL, 0, &id); zephir_check_call_status(); } else { - ZVAL_BOOL(_0, 1); + ZVAL_BOOL(&_0, 1); } - RETURN_CCTOR(_0); + RETURN_CCTOR(&_0); } @@ -286,7 +331,8 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, destroy) { */ PHP_METHOD(Phalcon_Session_Adapter_Redis, gc) { - + zval *this_ptr = getThis(); + RETURN_BOOL(1); diff --git a/ext/phalcon/session/adapter/redis.zep.h b/ext/phalcon/session/adapter/redis.zep.h index 364db3eaf6b..f1e64e2e1df 100644 --- a/ext/phalcon/session/adapter/redis.zep.h +++ b/ext/phalcon/session/adapter/redis.zep.h @@ -14,31 +14,72 @@ PHP_METHOD(Phalcon_Session_Adapter_Redis, destroy); PHP_METHOD(Phalcon_Session_Adapter_Redis, gc); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_redis___construct, 0, 0, 0) - ZEND_ARG_ARRAY_INFO(0, options, 1) + ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_redis_read, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_open, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_open, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_close, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_close, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_read, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_read, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_redis_write, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_write, 0, 2, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_write, 0, 2, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, sessionId, IS_STRING, 0) +#else ZEND_ARG_INFO(0, sessionId) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) +#else ZEND_ARG_INFO(0, data) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapter_redis_destroy, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_destroy, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_destroy, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, sessionId) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_gc, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapter_redis_gc, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEPHIR_INIT_FUNCS(phalcon_session_adapter_redis_method_entry) { PHP_ME(Phalcon_Session_Adapter_Redis, getRedis, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Redis, getLifetime, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Redis, __construct, arginfo_phalcon_session_adapter_redis___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) - PHP_ME(Phalcon_Session_Adapter_Redis, open, NULL, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter_Redis, close, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Redis, open, arginfo_phalcon_session_adapter_redis_open, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Redis, close, arginfo_phalcon_session_adapter_redis_close, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Redis, read, arginfo_phalcon_session_adapter_redis_read, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Redis, write, arginfo_phalcon_session_adapter_redis_write, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Adapter_Redis, destroy, arginfo_phalcon_session_adapter_redis_destroy, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Adapter_Redis, gc, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Adapter_Redis, gc, arginfo_phalcon_session_adapter_redis_gc, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/ext/phalcon/session/adapterinterface.zep.h b/ext/phalcon/session/adapterinterface.zep.h index f51e9156e4d..672efe60c72 100644 --- a/ext/phalcon/session/adapterinterface.zep.h +++ b/ext/phalcon/session/adapterinterface.zep.h @@ -7,49 +7,113 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_setoptions, 0, 0 ZEND_ARG_ARRAY_INFO(0, options, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_getoptions, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_getoptions, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_remove, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, index, IS_STRING, 0) +#else ZEND_ARG_INFO(0, index) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_getid, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_getid, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_destroy, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_isstarted, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_isstarted, 0, 0, _IS_BOOL, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_destroy, 0, 0, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_destroy, 0, 0, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, removeData) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_regenerateid, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_adapterinterface_regenerateid, 0, 0, Phalcon\\Session\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_regenerateid, 0, 0, IS_OBJECT, "Phalcon\\Session\\AdapterInterface", 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, deleteOldSession, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, deleteOldSession) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_adapterinterface_setname, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_getname, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_adapterinterface_getname, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_session_adapterinterface_method_entry) { PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, start, NULL) PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, setOptions, arginfo_phalcon_session_adapterinterface_setoptions) - PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, getOptions, NULL) + PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, getOptions, arginfo_phalcon_session_adapterinterface_getoptions) PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, get, arginfo_phalcon_session_adapterinterface_get) PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, set, arginfo_phalcon_session_adapterinterface_set) PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, has, arginfo_phalcon_session_adapterinterface_has) PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, remove, arginfo_phalcon_session_adapterinterface_remove) - PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, getId, NULL) - PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, isStarted, NULL) + PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, getId, arginfo_phalcon_session_adapterinterface_getid) + PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, isStarted, arginfo_phalcon_session_adapterinterface_isstarted) PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, destroy, arginfo_phalcon_session_adapterinterface_destroy) PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, regenerateId, arginfo_phalcon_session_adapterinterface_regenerateid) PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, setName, arginfo_phalcon_session_adapterinterface_setname) - PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, getName, NULL) + PHP_ABSTRACT_ME(Phalcon_Session_AdapterInterface, getName, arginfo_phalcon_session_adapterinterface_getname) PHP_FE_END }; diff --git a/ext/phalcon/session/bag.zep.c b/ext/phalcon/session/bag.zep.c index eeafc12bffe..0b20ca9b921 100644 --- a/ext/phalcon/session/bag.zep.c +++ b/ext/phalcon/session/bag.zep.c @@ -64,24 +64,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Bag) { PHP_METHOD(Phalcon_Session_Bag, __construct) { zval *name_param = NULL; - zval *name = NULL; + zval name; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &name_param); if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) { - zephir_get_strval(name, name_param); + zephir_get_strval(&name, name_param); } else { - ZEPHIR_INIT_VAR(name); - ZVAL_EMPTY_STRING(name); + ZEPHIR_INIT_VAR(&name); + ZVAL_EMPTY_STRING(&name); } - zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_name"), &name); ZEPHIR_MM_RESTORE(); } @@ -91,13 +94,16 @@ PHP_METHOD(Phalcon_Session_Bag, __construct) { */ PHP_METHOD(Phalcon_Session_Bag, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_property_this(getThis(), SL("_dependencyInjector"), dependencyInjector TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_dependencyInjector"), dependencyInjector); } @@ -106,7 +112,8 @@ PHP_METHOD(Phalcon_Session_Bag, setDI) { */ PHP_METHOD(Phalcon_Session_Bag, getDI) { - + zval *this_ptr = getThis(); + RETURN_MEMBER(getThis(), "_dependencyInjector"); @@ -118,44 +125,52 @@ PHP_METHOD(Phalcon_Session_Bag, getDI) { */ PHP_METHOD(Phalcon_Session_Bag, initialize) { - zval *session = NULL, *dependencyInjector = NULL, *data = NULL, *_2, *_1$$3; + zval __$true, __$false, session, dependencyInjector, data, _2, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_BOOL(&__$false, 0); + ZVAL_UNDEF(&session); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(session); - zephir_read_property_this(&session, this_ptr, SL("_session"), PH_NOISY_CC); - if (Z_TYPE_P(session) != IS_OBJECT) { - ZEPHIR_OBS_VAR(dependencyInjector); - zephir_read_property_this(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_OBS_VAR(&session); + zephir_read_property(&session, this_ptr, SL("_session"), PH_NOISY_CC); + if (Z_TYPE_P(&session) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&dependencyInjector); + zephir_read_property(&dependencyInjector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { + ZEPHIR_CALL_CE_STATIC(&dependencyInjector, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_session_exception_ce, "A dependency injection object is required to access the 'session' service", "phalcon/session/bag.zep", 91); return; } } - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "session", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&session, dependencyInjector, "getshared", NULL, 0, _1$$3); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "session"); + ZEPHIR_CALL_METHOD(&session, &dependencyInjector, "getshared", NULL, 0, &_1$$3); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_session"), session TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_session"), &session); } - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_name"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(&data, session, "get", NULL, 0, _2); + zephir_read_property(&_2, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&data, &session, "get", NULL, 0, &_2); zephir_check_call_status(); - if (Z_TYPE_P(data) != IS_ARRAY) { - ZEPHIR_INIT_NVAR(data); - array_init(data); + if (Z_TYPE_P(&data) != IS_ARRAY) { + ZEPHIR_INIT_NVAR(&data); + array_init(&data); } - zephir_update_property_this(getThis(), SL("_data"), data TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_data"), &data); if (1) { - zephir_update_property_this(getThis(), SL("_initialized"), ZEPHIR_GLOBAL(global_true) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_initialized"), &__$true); } else { - zephir_update_property_this(getThis(), SL("_initialized"), ZEPHIR_GLOBAL(global_false) TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_initialized"), &__$false); } ZEPHIR_MM_RESTORE(); @@ -170,22 +185,28 @@ PHP_METHOD(Phalcon_Session_Bag, initialize) { */ PHP_METHOD(Phalcon_Session_Bag, destroy) { - zval *_0, *_1, *_2, *_3; + zval _0, _1, _2, _3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_1); - array_init(_1); - zephir_update_property_this(getThis(), SL("_data"), _1 TSRMLS_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_session"), PH_NOISY_CC); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_name"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _2, "remove", NULL, 0, _3); + ZEPHIR_INIT_VAR(&_1); + array_init(&_1); + zephir_update_property_zval(this_ptr, SL("_data"), &_1); + zephir_read_property(&_2, this_ptr, SL("_session"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_3, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_2, "remove", NULL, 0, &_3); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -201,34 +222,42 @@ PHP_METHOD(Phalcon_Session_Bag, destroy) { PHP_METHOD(Phalcon_Session_Bag, set) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property_param = NULL, *value, *_0, *_1, *_2, *_3; - zval *property = NULL; + zval *property_param = NULL, *value, value_sub, _0, _1, _2, _3; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &property_param, &value); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } - zephir_update_property_array(this_ptr, SL("_data"), property, value TSRMLS_CC); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_session"), PH_NOISY_CC); - _2 = zephir_fetch_nproperty_this(this_ptr, SL("_name"), PH_NOISY_CC); - _3 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _1, "set", NULL, 0, _2, _3); + zephir_update_property_array(this_ptr, SL("_data"), &property, value TSRMLS_CC); + zephir_read_property(&_1, this_ptr, SL("_session"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_2, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_3, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_1, "set", NULL, 0, &_2, &_3); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -244,25 +273,29 @@ PHP_METHOD(Phalcon_Session_Bag, set) { PHP_METHOD(Phalcon_Session_Bag, __set) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property_param = NULL, *value; - zval *property = NULL; + zval *property_param = NULL, *value, value_sub; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &property_param, &value); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } - ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, property, value); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "set", NULL, 0, &property, value); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -278,35 +311,44 @@ PHP_METHOD(Phalcon_Session_Bag, __set) { PHP_METHOD(Phalcon_Session_Bag, get) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property_param = NULL, *defaultValue = NULL, *value = NULL, *_0, *_1; - zval *property = NULL; + zval *property_param = NULL, *defaultValue = NULL, defaultValue_sub, __$null, value, _0, _1; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&defaultValue_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &property_param, &defaultValue); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } if (!defaultValue) { - defaultValue = ZEPHIR_GLOBAL(global_null); + defaultValue = &defaultValue_sub; + defaultValue = &__$null; } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - if (zephir_array_isset_fetch(&value, _1, property, 1 TSRMLS_CC)) { - RETURN_CTOR(value); + zephir_read_property(&_1, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + if (zephir_array_isset_fetch(&value, &_1, &property, 1 TSRMLS_CC)) { + RETURN_CTOR(&value); } RETVAL_ZVAL(defaultValue, 1, 0); RETURN_MM(); @@ -324,24 +366,27 @@ PHP_METHOD(Phalcon_Session_Bag, __get) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *property_param = NULL; - zval *property = NULL; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property_param); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0, property); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "get", NULL, 0, &property); zephir_check_call_status(); RETURN_MM(); @@ -359,31 +404,36 @@ PHP_METHOD(Phalcon_Session_Bag, __get) { PHP_METHOD(Phalcon_Session_Bag, has) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property_param = NULL, *_0, *_1; - zval *property = NULL; + zval *property_param = NULL, _0, _1; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property_param); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - RETURN_MM_BOOL(zephir_array_isset(_1, property)); + zephir_read_property(&_1, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_BOOL(zephir_array_isset(&_1, &property)); } @@ -400,24 +450,27 @@ PHP_METHOD(Phalcon_Session_Bag, __isset) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *property_param = NULL; - zval *property = NULL; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property_param); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, property); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "has", NULL, 0, &property); zephir_check_call_status(); RETURN_MM(); @@ -433,38 +486,45 @@ PHP_METHOD(Phalcon_Session_Bag, __isset) { PHP_METHOD(Phalcon_Session_Bag, remove) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property_param = NULL, *_0, *data = NULL, *_1$$4, *_2$$4; - zval *property = NULL; + zval *property_param = NULL, _0, data, _1$$4, _2$$4; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&data); + ZVAL_UNDEF(&_1$$4); + ZVAL_UNDEF(&_2$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property_param); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } - ZEPHIR_OBS_VAR(data); - zephir_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC); - if (zephir_array_isset(data, property)) { - zephir_array_unset(&data, property, PH_SEPARATE); - _1$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_session"), PH_NOISY_CC); - _2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_name"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, _1$$4, "set", NULL, 0, _2$$4, data); + ZEPHIR_OBS_VAR(&data); + zephir_read_property(&data, this_ptr, SL("_data"), PH_NOISY_CC); + if (zephir_array_isset(&data, &property)) { + zephir_array_unset(&data, &property, PH_SEPARATE); + zephir_read_property(&_1$$4, this_ptr, SL("_session"), PH_NOISY_CC | PH_READONLY); + zephir_read_property(&_2$$4, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, &_1$$4, "set", NULL, 0, &_2$$4, &data); zephir_check_call_status(); - zephir_update_property_this(getThis(), SL("_data"), data TSRMLS_CC); + zephir_update_property_zval(this_ptr, SL("_data"), &data); RETURN_MM_BOOL(1); } RETURN_MM_BOOL(0); @@ -482,24 +542,27 @@ PHP_METHOD(Phalcon_Session_Bag, __unset) { zend_long ZEPHIR_LAST_CALL_STATUS; zval *property_param = NULL; - zval *property = NULL; + zval property; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property_param); if (UNEXPECTED(Z_TYPE_P(property_param) != IS_STRING && Z_TYPE_P(property_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'property' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(property_param) == IS_STRING)) { - zephir_get_strval(property, property_param); + zephir_get_strval(&property, property_param); } else { - ZEPHIR_INIT_VAR(property); - ZVAL_EMPTY_STRING(property); + ZEPHIR_INIT_VAR(&property); + ZVAL_EMPTY_STRING(&property); } - ZEPHIR_RETURN_CALL_METHOD(this_ptr, "remove", NULL, 0, property); + ZEPHIR_RETURN_CALL_METHOD(this_ptr, "remove", NULL, 0, &property); zephir_check_call_status(); RETURN_MM(); @@ -514,18 +577,22 @@ PHP_METHOD(Phalcon_Session_Bag, __unset) { */ PHP_METHOD(Phalcon_Session_Bag, count) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - RETURN_MM_LONG(zephir_fast_count_int(_1 TSRMLS_CC)); + zephir_read_property(&_1, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + RETURN_MM_LONG(zephir_fast_count_int(&_1 TSRMLS_CC)); } @@ -534,19 +601,23 @@ PHP_METHOD(Phalcon_Session_Bag, count) { */ PHP_METHOD(Phalcon_Session_Bag, getIterator) { - zval *_0, *_1; + zval _0, _1; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_nproperty_this(this_ptr, SL("_initialized"), PH_NOISY_CC); - if (ZEPHIR_IS_FALSE_IDENTICAL(_0)) { + zephir_read_property(&_0, this_ptr, SL("_initialized"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_IS_FALSE_IDENTICAL(&_0)) { ZEPHIR_CALL_METHOD(NULL, this_ptr, "initialize", NULL, 0); zephir_check_call_status(); } - object_init_ex(return_value, zephir_get_internal_ce(SS("arrayiterator") TSRMLS_CC)); - _1 = zephir_fetch_nproperty_this(this_ptr, SL("_data"), PH_NOISY_CC); - ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 452, _1); + object_init_ex(return_value, zephir_get_internal_ce(SL("arrayiterator"))); + zephir_read_property(&_1, this_ptr, SL("_data"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(NULL, return_value, "__construct", NULL, 405, &_1); zephir_check_call_status(); RETURN_MM(); @@ -555,7 +626,11 @@ PHP_METHOD(Phalcon_Session_Bag, getIterator) { PHP_METHOD(Phalcon_Session_Bag, offsetSet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property, *value; + zval *property, property_sub, *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property_sub); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &property, &value); @@ -571,7 +646,10 @@ PHP_METHOD(Phalcon_Session_Bag, offsetSet) { PHP_METHOD(Phalcon_Session_Bag, offsetExists) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property; + zval *property, property_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property); @@ -587,7 +665,10 @@ PHP_METHOD(Phalcon_Session_Bag, offsetExists) { PHP_METHOD(Phalcon_Session_Bag, offsetUnset) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property; + zval *property, property_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property); @@ -603,7 +684,10 @@ PHP_METHOD(Phalcon_Session_Bag, offsetUnset) { PHP_METHOD(Phalcon_Session_Bag, offsetGet) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *property; + zval *property, property_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&property_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &property); diff --git a/ext/phalcon/session/bag.zep.h b/ext/phalcon/session/bag.zep.h index de9659599c0..bf1f43d52a6 100644 --- a/ext/phalcon/session/bag.zep.h +++ b/ext/phalcon/session/bag.zep.h @@ -24,46 +24,119 @@ PHP_METHOD(Phalcon_Session_Bag, offsetUnset); PHP_METHOD(Phalcon_Session_Bag, offsetGet); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag___construct, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) +#else ZEND_ARG_INFO(0, name) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_bag_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag___set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag___get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag___isset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag___isset, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag___isset, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag_remove, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_remove, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_remove, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag___unset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag___unset, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag___unset, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_count, 0, 0, IS_LONG, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_count, 0, 0, IS_LONG, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_bag_getiterator, 0, 0, ArrayIterator, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_getiterator, 0, 0, IS_OBJECT, "ArrayIterator", 0) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag_offsetset, 0, 0, 2) @@ -71,7 +144,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag_offsetset, 0, 0, 2) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_bag_offsetexists, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_offsetexists, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_bag_offsetexists, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, property) ZEND_END_ARG_INFO() @@ -86,7 +163,7 @@ ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_session_bag_method_entry) { PHP_ME(Phalcon_Session_Bag, __construct, arginfo_phalcon_session_bag___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(Phalcon_Session_Bag, setDI, arginfo_phalcon_session_bag_setdi, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Bag, getDI, NULL, ZEND_ACC_PUBLIC) + PHP_ME(Phalcon_Session_Bag, getDI, arginfo_phalcon_session_bag_getdi, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Bag, initialize, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Bag, destroy, NULL, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Bag, set, arginfo_phalcon_session_bag_set, ZEND_ACC_PUBLIC) @@ -97,8 +174,8 @@ ZEPHIR_INIT_FUNCS(phalcon_session_bag_method_entry) { PHP_ME(Phalcon_Session_Bag, __isset, arginfo_phalcon_session_bag___isset, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Bag, remove, arginfo_phalcon_session_bag_remove, ZEND_ACC_PUBLIC) PHP_ME(Phalcon_Session_Bag, __unset, arginfo_phalcon_session_bag___unset, ZEND_ACC_PUBLIC) - PHP_ME(Phalcon_Session_Bag, count, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) - PHP_ME(Phalcon_Session_Bag, getIterator, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Session_Bag, count, arginfo_phalcon_session_bag_count, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) + PHP_ME(Phalcon_Session_Bag, getIterator, arginfo_phalcon_session_bag_getiterator, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Session_Bag, offsetSet, arginfo_phalcon_session_bag_offsetset, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Session_Bag, offsetExists, arginfo_phalcon_session_bag_offsetexists, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) PHP_ME(Phalcon_Session_Bag, offsetUnset, arginfo_phalcon_session_bag_offsetunset, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL) diff --git a/ext/phalcon/session/baginterface.zep.h b/ext/phalcon/session/baginterface.zep.h index 46896d5227d..0a4db31bd53 100644 --- a/ext/phalcon/session/baginterface.zep.h +++ b/ext/phalcon/session/baginterface.zep.h @@ -4,30 +4,62 @@ extern zend_class_entry *phalcon_session_baginterface_ce; ZEPHIR_INIT_CLASS(Phalcon_Session_BagInterface); ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface_set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface_get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_ARG_INFO(0, defaultValue) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface_has, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_has, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface_has, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface___set, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface___get, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_baginterface___isset, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface___isset, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_baginterface___isset, 0, 1, _IS_BOOL, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, property, IS_STRING, 0) +#else ZEND_ARG_INFO(0, property) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_session_baginterface_method_entry) { diff --git a/ext/phalcon/session/factory.zep.c b/ext/phalcon/session/factory.zep.c index dd84a8ff7f5..6b34da9d086 100644 --- a/ext/phalcon/session/factory.zep.c +++ b/ext/phalcon/session/factory.zep.c @@ -48,17 +48,20 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Factory) { PHP_METHOD(Phalcon_Session_Factory, load) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *config, *_0; + zval *config, config_sub, _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&config_sub); + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &config); - ZEPHIR_INIT_VAR(_0); - ZVAL_STRING(_0, "Phalcon\\Session\\Adapter", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, _0, config); - zephir_check_temp_parameter(_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "Phalcon\\Session\\Adapter"); + ZEPHIR_RETURN_CALL_SELF("loadclass", NULL, 0, &_0, config); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/phalcon/session/factory.zep.h b/ext/phalcon/session/factory.zep.h index 0b522814129..4852a4b3332 100644 --- a/ext/phalcon/session/factory.zep.h +++ b/ext/phalcon/session/factory.zep.h @@ -5,7 +5,11 @@ ZEPHIR_INIT_CLASS(Phalcon_Session_Factory); PHP_METHOD(Phalcon_Session_Factory, load); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_session_factory_load, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_session_factory_load, 0, 1, Phalcon\\Session\\AdapterInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_session_factory_load, 0, 1, IS_OBJECT, "Phalcon\\Session\\AdapterInterface", 0) +#endif ZEND_ARG_INFO(0, config) ZEND_END_ARG_INFO() diff --git a/ext/phalcon/tag.zep.c b/ext/phalcon/tag.zep.c index cd2eeb4573b..57eb5951c8d 100644 --- a/ext/phalcon/tag.zep.c +++ b/ext/phalcon/tag.zep.c @@ -65,27 +65,27 @@ ZEPHIR_INIT_CLASS(Phalcon_Tag) { zend_declare_property_bool(phalcon_tag_ce, SL("_autoEscape"), 1, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC TSRMLS_CC); - zend_declare_class_constant_long(phalcon_tag_ce, SL("HTML32"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("HTML32"), 1); - zend_declare_class_constant_long(phalcon_tag_ce, SL("HTML401_STRICT"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("HTML401_STRICT"), 2); - zend_declare_class_constant_long(phalcon_tag_ce, SL("HTML401_TRANSITIONAL"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("HTML401_TRANSITIONAL"), 3); - zend_declare_class_constant_long(phalcon_tag_ce, SL("HTML401_FRAMESET"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("HTML401_FRAMESET"), 4); - zend_declare_class_constant_long(phalcon_tag_ce, SL("HTML5"), 5 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("HTML5"), 5); - zend_declare_class_constant_long(phalcon_tag_ce, SL("XHTML10_STRICT"), 6 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("XHTML10_STRICT"), 6); - zend_declare_class_constant_long(phalcon_tag_ce, SL("XHTML10_TRANSITIONAL"), 7 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("XHTML10_TRANSITIONAL"), 7); - zend_declare_class_constant_long(phalcon_tag_ce, SL("XHTML10_FRAMESET"), 8 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("XHTML10_FRAMESET"), 8); - zend_declare_class_constant_long(phalcon_tag_ce, SL("XHTML11"), 9 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("XHTML11"), 9); - zend_declare_class_constant_long(phalcon_tag_ce, SL("XHTML20"), 10 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("XHTML20"), 10); - zend_declare_class_constant_long(phalcon_tag_ce, SL("XHTML5"), 11 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_tag_ce, SL("XHTML5"), 11); return SUCCESS; @@ -100,21 +100,25 @@ ZEPHIR_INIT_CLASS(Phalcon_Tag) { PHP_METHOD(Phalcon_Tag, getEscaper) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *params_param = NULL, *autoescape = NULL; - zval *params = NULL; + zval *params_param = NULL, autoescape; + zval params; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&autoescape); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶ms_param); - params = params_param; + ZEPHIR_OBS_COPY_OR_DUP(¶ms, params_param); - ZEPHIR_OBS_VAR(autoescape); - if (!(zephir_array_isset_string_fetch(&autoescape, params, SS("escape"), 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(autoescape); - zephir_read_static_property_ce(&autoescape, phalcon_tag_ce, SL("_autoEscape") TSRMLS_CC); + ZEPHIR_OBS_VAR(&autoescape); + if (!(zephir_array_isset_string_fetch(&autoescape, ¶ms, SL("escape"), 0))) { + ZEPHIR_OBS_NVAR(&autoescape); + zephir_read_static_property_ce(&autoescape, phalcon_tag_ce, SL("_autoEscape"), PH_NOISY_CC); } - if (!(zephir_is_true(autoescape))) { + if (!(zephir_is_true(&autoescape))) { RETURN_MM_NULL(); } ZEPHIR_RETURN_CALL_SELF("getescaperservice", NULL, 0); @@ -129,113 +133,149 @@ PHP_METHOD(Phalcon_Tag, getEscaper) { PHP_METHOD(Phalcon_Tag, renderAttributes) { zend_bool _10$$7, _11$$8; - HashTable *_1, *_4, *_8; - HashPosition _0, _3, _7; + zend_string *_2, *_5, *_9; + zend_ulong _1, _4, _8; zephir_fcall_cache_entry *_15 = NULL, *_16 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *attributes = NULL; - zval *code_param = NULL, *attributes_param = NULL, *order = NULL, *escaper = NULL, *attrs = NULL, *attribute = NULL, *value = NULL, *escaped = NULL, *key = NULL, *newCode = NULL, **_2, **_5, *_6 = NULL, **_9, *_17$$8 = NULL, *_12$$9 = NULL, *_13$$9 = NULL, *_14$$9 = NULL; - zval *code = NULL; + zval attributes; + zval *code_param = NULL, *attributes_param = NULL, __$null, order, escaper, attrs, attribute, value, escaped, key, newCode, *_0, *_3, _6, *_7, _17$$8, _12$$9, _13$$9, _14$$9; + zval code; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&code); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&order); + ZVAL_UNDEF(&escaper); + ZVAL_UNDEF(&attrs); + ZVAL_UNDEF(&attribute); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&escaped); + ZVAL_UNDEF(&key); + ZVAL_UNDEF(&newCode); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_17$$8); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_14$$9); + ZVAL_UNDEF(&attributes); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &code_param, &attributes_param); if (UNEXPECTED(Z_TYPE_P(code_param) != IS_STRING && Z_TYPE_P(code_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'code' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'code' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(code_param) == IS_STRING)) { - zephir_get_strval(code, code_param); + zephir_get_strval(&code, code_param); } else { - ZEPHIR_INIT_VAR(code); - ZVAL_EMPTY_STRING(code); - } - attributes = attributes_param; - - - ZEPHIR_INIT_VAR(order); - zephir_create_array(order, 10, 0 TSRMLS_CC); - zephir_array_update_string(&order, SL("rel"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("type"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("for"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("src"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("href"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("action"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("id"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("name"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("value"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - zephir_array_update_string(&order, SL("class"), &ZEPHIR_GLOBAL(global_null), PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(attrs); - array_init(attrs); - zephir_is_iterable(order, &_1, &_0, 0, 0, "phalcon/tag.zep", 137); - for ( - ; zend_hash_get_current_data_ex(_1, (void**) &_2, &_0) == SUCCESS - ; zend_hash_move_forward_ex(_1, &_0) - ) { - ZEPHIR_GET_HMKEY(key, _1, _0); - ZEPHIR_GET_HVALUE(value, _2); - ZEPHIR_OBS_NVAR(attribute); - if (zephir_array_isset_fetch(&attribute, attributes, key, 0 TSRMLS_CC)) { - zephir_array_update_zval(&attrs, key, &attribute, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&code); + ZVAL_EMPTY_STRING(&code); + } + ZEPHIR_OBS_COPY_OR_DUP(&attributes, attributes_param); + + + ZEPHIR_INIT_VAR(&order); + zephir_create_array(&order, 10, 0 TSRMLS_CC); + zephir_array_update_string(&order, SL("rel"), &__$null, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&order, SL("type"), &__$null, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&order, SL("for"), &__$null, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&order, SL("src"), &__$null, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&order, SL("href"), &__$null, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&order, SL("action"), &__$null, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&order, SL("id"), &__$null, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&order, SL("name"), &__$null, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&order, SL("value"), &__$null, PH_COPY | PH_SEPARATE); + zephir_array_update_string(&order, SL("class"), &__$null, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_VAR(&attrs); + array_init(&attrs); + zephir_is_iterable(&order, 0, "phalcon/tag.zep", 137); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&order), _1, _2, _0) + { + ZEPHIR_INIT_NVAR(&key); + if (_2 != NULL) { + ZVAL_STR_COPY(&key, _2); + } else { + ZVAL_LONG(&key, _1); } - } - zephir_is_iterable(attributes, &_4, &_3, 0, 0, "phalcon/tag.zep", 143); - for ( - ; zend_hash_get_current_data_ex(_4, (void**) &_5, &_3) == SUCCESS - ; zend_hash_move_forward_ex(_4, &_3) - ) { - ZEPHIR_GET_HMKEY(key, _4, _3); - ZEPHIR_GET_HVALUE(value, _5); - if (!(zephir_array_isset(attrs, key))) { - zephir_array_update_zval(&attrs, key, &value, PH_COPY | PH_SEPARATE); + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _0); + ZEPHIR_OBS_NVAR(&attribute); + if (zephir_array_isset_fetch(&attribute, &attributes, &key, 0 TSRMLS_CC)) { + zephir_array_update_zval(&attrs, &key, &attribute, PH_COPY | PH_SEPARATE); } - } - ZEPHIR_CALL_SELF(&_6, "getescaper", NULL, 0, attributes); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + zephir_is_iterable(&attributes, 0, "phalcon/tag.zep", 143); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attributes), _4, _5, _3) + { + ZEPHIR_INIT_NVAR(&key); + if (_5 != NULL) { + ZVAL_STR_COPY(&key, _5); + } else { + ZVAL_LONG(&key, _4); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _3); + if (!(zephir_array_isset(&attrs, &key))) { + zephir_array_update_zval(&attrs, &key, &value, PH_COPY | PH_SEPARATE); + } + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + ZEPHIR_CALL_SELF(&_6, "getescaper", NULL, 0, &attributes); zephir_check_call_status(); - ZEPHIR_CPY_WRT(escaper, _6); - zephir_array_unset_string(&attrs, SS("escape"), PH_SEPARATE); - ZEPHIR_CPY_WRT(newCode, code); - zephir_is_iterable(attrs, &_8, &_7, 0, 0, "phalcon/tag.zep", 162); - for ( - ; zend_hash_get_current_data_ex(_8, (void**) &_9, &_7) == SUCCESS - ; zend_hash_move_forward_ex(_8, &_7) - ) { - ZEPHIR_GET_HMKEY(key, _8, _7); - ZEPHIR_GET_HVALUE(value, _9); - _10$$7 = Z_TYPE_P(key) == IS_STRING; + ZEPHIR_CPY_WRT(&escaper, &_6); + zephir_array_unset_string(&attrs, SL("escape"), PH_SEPARATE); + ZEPHIR_CPY_WRT(&newCode, &code); + zephir_is_iterable(&attrs, 0, "phalcon/tag.zep", 162); + ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&attrs), _8, _9, _7) + { + ZEPHIR_INIT_NVAR(&key); + if (_9 != NULL) { + ZVAL_STR_COPY(&key, _9); + } else { + ZVAL_LONG(&key, _8); + } + ZEPHIR_INIT_NVAR(&value); + ZVAL_COPY(&value, _7); + _10$$7 = Z_TYPE_P(&key) == IS_STRING; if (_10$$7) { - _10$$7 = Z_TYPE_P(value) != IS_NULL; + _10$$7 = Z_TYPE_P(&value) != IS_NULL; } if (_10$$7) { - _11$$8 = Z_TYPE_P(value) == IS_ARRAY; + _11$$8 = Z_TYPE_P(&value) == IS_ARRAY; if (!(_11$$8)) { - _11$$8 = Z_TYPE_P(value) == IS_RESOURCE; + _11$$8 = Z_TYPE_P(&value) == IS_RESOURCE; } if (_11$$8) { - ZEPHIR_INIT_NVAR(_12$$9); - object_init_ex(_12$$9, phalcon_tag_exception_ce); - ZEPHIR_INIT_NVAR(_13$$9); - zephir_gettype(_13$$9, value TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_12$$9); + object_init_ex(&_12$$9, phalcon_tag_exception_ce); + ZEPHIR_INIT_NVAR(&_13$$9); + zephir_gettype(&_13$$9, &value TSRMLS_CC); ZEPHIR_INIT_LNVAR(_14$$9); - ZEPHIR_CONCAT_SVSVS(_14$$9, "Value at index: '", key, "' type: '", _13$$9, "' cannot be rendered"); - ZEPHIR_CALL_METHOD(NULL, _12$$9, "__construct", &_15, 9, _14$$9); + ZEPHIR_CONCAT_SVSVS(&_14$$9, "Value at index: '", &key, "' type: '", &_13$$9, "' cannot be rendered"); + ZEPHIR_CALL_METHOD(NULL, &_12$$9, "__construct", &_15, 4, &_14$$9); zephir_check_call_status(); - zephir_throw_exception_debug(_12$$9, "phalcon/tag.zep", 151 TSRMLS_CC); + zephir_throw_exception_debug(&_12$$9, "phalcon/tag.zep", 151 TSRMLS_CC); ZEPHIR_MM_RESTORE(); return; } - if (zephir_is_true(escaper)) { - ZEPHIR_CALL_METHOD(&escaped, escaper, "escapehtmlattr", &_16, 0, value); + if (zephir_is_true(&escaper)) { + ZEPHIR_CALL_METHOD(&escaped, &escaper, "escapehtmlattr", &_16, 0, &value); zephir_check_call_status(); } else { - ZEPHIR_CPY_WRT(escaped, value); + ZEPHIR_CPY_WRT(&escaped, &value); } ZEPHIR_INIT_LNVAR(_17$$8); - ZEPHIR_CONCAT_SVSVS(_17$$8, " ", key, "=\"", escaped, "\""); - zephir_concat_self(&newCode, _17$$8 TSRMLS_CC); + ZEPHIR_CONCAT_SVSVS(&_17$$8, " ", &key, "=\"", &escaped, "\""); + zephir_concat_self(&newCode, &_17$$8 TSRMLS_CC); } - } - RETURN_CCTOR(newCode); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&value); + ZEPHIR_INIT_NVAR(&key); + RETURN_CCTOR(&newCode); } @@ -244,13 +284,16 @@ PHP_METHOD(Phalcon_Tag, renderAttributes) { */ PHP_METHOD(Phalcon_Tag, setDI) { - zval *dependencyInjector; + zval *dependencyInjector, dependencyInjector_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&dependencyInjector_sub); zephir_fetch_params(0, 1, 0, &dependencyInjector); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_dependencyInjector"), &dependencyInjector TSRMLS_CC); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_dependencyInjector"), dependencyInjector); } @@ -259,19 +302,22 @@ PHP_METHOD(Phalcon_Tag, setDI) { */ PHP_METHOD(Phalcon_Tag, getDI) { - zval *di = NULL; + zval di; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&di); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(di); - zephir_read_static_property_ce(&di, phalcon_tag_ce, SL("_dependencyInjector") TSRMLS_CC); - if (Z_TYPE_P(di) != IS_OBJECT) { - ZEPHIR_CALL_CE_STATIC(&di, phalcon_di_ce, "getdefault", &_0, 1); + ZEPHIR_OBS_VAR(&di); + zephir_read_static_property_ce(&di, phalcon_tag_ce, SL("_dependencyInjector"), PH_NOISY_CC); + if (Z_TYPE_P(&di) != IS_OBJECT) { + ZEPHIR_CALL_CE_STATIC(&di, phalcon_di_ce, "getdefault", &_0, 0); zephir_check_call_status(); } - RETURN_CCTOR(di); + RETURN_CCTOR(&di); } @@ -280,29 +326,34 @@ PHP_METHOD(Phalcon_Tag, getDI) { */ PHP_METHOD(Phalcon_Tag, getUrlService) { - zval *url = NULL, *dependencyInjector = NULL, *_0$$3 = NULL, *_1$$3; + zval url, dependencyInjector, _0$$3, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&url); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(url); - zephir_read_static_property_ce(&url, phalcon_tag_ce, SL("_urlService") TSRMLS_CC); - if (Z_TYPE_P(url) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&url); + zephir_read_static_property_ce(&url, phalcon_tag_ce, SL("_urlService"), PH_NOISY_CC); + if (Z_TYPE_P(&url) != IS_OBJECT) { ZEPHIR_CALL_SELF(&dependencyInjector, "getdi", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "A dependency injector container is required to obtain the 'url' service", "phalcon/tag.zep", 199); return; } - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "url", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0$$3, dependencyInjector, "getshared", NULL, 0, _1$$3); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "url"); + ZEPHIR_CALL_METHOD(&_0$$3, &dependencyInjector, "getshared", NULL, 0, &_1$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(url, _0$$3); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_urlService"), &url TSRMLS_CC); + ZEPHIR_CPY_WRT(&url, &_0$$3); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_urlService"), &url); } - RETURN_CCTOR(url); + RETURN_CCTOR(&url); } @@ -311,29 +362,34 @@ PHP_METHOD(Phalcon_Tag, getUrlService) { */ PHP_METHOD(Phalcon_Tag, getEscaperService) { - zval *escaper = NULL, *dependencyInjector = NULL, *_0$$3 = NULL, *_1$$3; + zval escaper, dependencyInjector, _0$$3, _1$$3; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&escaper); + ZVAL_UNDEF(&dependencyInjector); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - ZEPHIR_OBS_VAR(escaper); - zephir_read_static_property_ce(&escaper, phalcon_tag_ce, SL("_escaperService") TSRMLS_CC); - if (Z_TYPE_P(escaper) != IS_OBJECT) { + ZEPHIR_OBS_VAR(&escaper); + zephir_read_static_property_ce(&escaper, phalcon_tag_ce, SL("_escaperService"), PH_NOISY_CC); + if (Z_TYPE_P(&escaper) != IS_OBJECT) { ZEPHIR_CALL_SELF(&dependencyInjector, "getdi", NULL, 0); zephir_check_call_status(); - if (Z_TYPE_P(dependencyInjector) != IS_OBJECT) { + if (Z_TYPE_P(&dependencyInjector) != IS_OBJECT) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "A dependency injector container is required to obtain the 'escaper' service", "phalcon/tag.zep", 221); return; } - ZEPHIR_INIT_VAR(_1$$3); - ZVAL_STRING(_1$$3, "escaper", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_METHOD(&_0$$3, dependencyInjector, "getshared", NULL, 0, _1$$3); - zephir_check_temp_parameter(_1$$3); + ZEPHIR_INIT_VAR(&_1$$3); + ZVAL_STRING(&_1$$3, "escaper"); + ZEPHIR_CALL_METHOD(&_0$$3, &dependencyInjector, "getshared", NULL, 0, &_1$$3); zephir_check_call_status(); - ZEPHIR_CPY_WRT(escaper, _0$$3); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_escaperService"), &escaper TSRMLS_CC); + ZEPHIR_CPY_WRT(&escaper, &_0$$3); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_escaperService"), &escaper); } - RETURN_CCTOR(escaper); + RETURN_CCTOR(&escaper); } @@ -342,8 +398,11 @@ PHP_METHOD(Phalcon_Tag, getEscaperService) { */ PHP_METHOD(Phalcon_Tag, setAutoescape) { - zval *autoescape_param = NULL, *_0; + zval *autoescape_param = NULL, _0; zend_bool autoescape; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); zephir_fetch_params(0, 1, 0, &autoescape_param); @@ -351,8 +410,8 @@ PHP_METHOD(Phalcon_Tag, setAutoescape) { ZEPHIR_INIT_ZVAL_NREF(_0); - ZVAL_BOOL(_0, autoescape); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_autoEscape"), &_0 TSRMLS_CC); + ZVAL_BOOL(&_0, autoescape); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_autoEscape"), &_0); } @@ -373,21 +432,25 @@ PHP_METHOD(Phalcon_Tag, setAutoescape) { PHP_METHOD(Phalcon_Tag, setDefault) { zend_bool _0$$3; - zval *id_param = NULL, *value; - zval *id = NULL; + zval *id_param = NULL, *value, value_sub; + zval id; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &id_param, &value); if (UNEXPECTED(Z_TYPE_P(id_param) != IS_STRING && Z_TYPE_P(id_param) != IS_NULL)) { - zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be a string") TSRMLS_CC); + zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'id' must be of the type string") TSRMLS_CC); RETURN_MM_NULL(); } if (EXPECTED(Z_TYPE_P(id_param) == IS_STRING)) { - zephir_get_strval(id, id_param); + zephir_get_strval(&id, id_param); } else { - ZEPHIR_INIT_VAR(id); - ZVAL_EMPTY_STRING(id); + ZEPHIR_INIT_VAR(&id); + ZVAL_EMPTY_STRING(&id); } @@ -401,7 +464,7 @@ PHP_METHOD(Phalcon_Tag, setDefault) { return; } } - zephir_update_static_property_array_multi_ce(phalcon_tag_ce, SL("_displayValues"), &value TSRMLS_CC, SL("z"), 1, id); + zephir_update_static_property_array_multi_ce(phalcon_tag_ce, SL("_displayValues"), value TSRMLS_CC, SL("z"), 1, &id); ZEPHIR_MM_RESTORE(); } @@ -424,13 +487,19 @@ PHP_METHOD(Phalcon_Tag, setDefault) { PHP_METHOD(Phalcon_Tag, setDefaults) { zend_bool merge, _0; - zval *values_param = NULL, *merge_param = NULL, *_1, *_2$$3, *_3$$3; - zval *values = NULL; + zval *values_param = NULL, *merge_param = NULL, _1, _2$$3, _3$$3; + zval values; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&values); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &values_param, &merge_param); - values = values_param; + ZEPHIR_OBS_COPY_OR_DUP(&values, values_param); if (!merge_param) { merge = 0; } else { @@ -440,17 +509,17 @@ PHP_METHOD(Phalcon_Tag, setDefaults) { _0 = merge; if (_0) { - ZEPHIR_OBS_VAR(_1); - zephir_read_static_property_ce(&_1, phalcon_tag_ce, SL("_displayValues") TSRMLS_CC); - _0 = Z_TYPE_P(_1) == IS_ARRAY; + ZEPHIR_OBS_VAR(&_1); + zephir_read_static_property_ce(&_1, phalcon_tag_ce, SL("_displayValues"), PH_NOISY_CC); + _0 = Z_TYPE_P(&_1) == IS_ARRAY; } if (_0) { - ZEPHIR_INIT_VAR(_2$$3); - _3$$3 = zephir_fetch_static_property_ce(phalcon_tag_ce, SL("_displayValues") TSRMLS_CC); - zephir_fast_array_merge(_2$$3, &(_3$$3), &(values) TSRMLS_CC); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_displayValues"), &_2$$3 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$3); + zephir_read_static_property_ce(&_3$$3, phalcon_tag_ce, SL("_displayValues"), PH_NOISY_CC | PH_READONLY); + zephir_fast_array_merge(&_2$$3, &_3$$3, &values TSRMLS_CC); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_displayValues"), &_2$$3); } else { - zephir_update_static_property_ce(phalcon_tag_ce, SL("_displayValues"), &values TSRMLS_CC); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_displayValues"), &values); } ZEPHIR_MM_RESTORE(); @@ -465,7 +534,11 @@ PHP_METHOD(Phalcon_Tag, setDefaults) { PHP_METHOD(Phalcon_Tag, displayTo) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *id, *value; + zval *id, id_sub, *value, value_sub; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&id_sub); + ZVAL_UNDEF(&value_sub); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &id, &value); @@ -487,20 +560,23 @@ PHP_METHOD(Phalcon_Tag, displayTo) { PHP_METHOD(Phalcon_Tag, hasValue) { zend_bool _1; - zval *name, *_POST, *_0; + zval *name, name_sub, *_POST, _0; + zval *this_ptr = getThis(); - ZEPHIR_MM_GROW(); - zephir_get_global(&_POST, SS("_POST") TSRMLS_CC); + ZVAL_UNDEF(&name_sub); + ZVAL_UNDEF(&_0); + + zephir_get_global(&_POST, SL("_POST")); zephir_fetch_params(0, 1, 0, &name); - _0 = zephir_fetch_static_property_ce(phalcon_tag_ce, SL("_displayValues") TSRMLS_CC); - _1 = zephir_array_isset(_0, name); + zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("_displayValues"), PH_NOISY_CC | PH_READONLY); + _1 = zephir_array_isset(&_0, name); if (!(_1)) { _1 = zephir_array_isset(_POST, name); } - RETURN_MM_BOOL(_1); + RETURN_BOOL(_1); } @@ -515,33 +591,41 @@ PHP_METHOD(Phalcon_Tag, hasValue) { PHP_METHOD(Phalcon_Tag, getValue) { zend_bool _0; - zval *name, *params = NULL, *_POST, *value = NULL, *_1$$3; + zval *name, name_sub, *params = NULL, params_sub, *_POST, __$null, value, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&name_sub); + ZVAL_UNDEF(¶ms_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); - zephir_get_global(&_POST, SS("_POST") TSRMLS_CC); + zephir_get_global(&_POST, SL("_POST")); zephir_fetch_params(1, 1, 1, &name, ¶ms); if (!params) { - params = ZEPHIR_GLOBAL(global_null); + params = ¶ms_sub; + params = &__$null; } _0 = !zephir_is_true(params); if (!(_0)) { - ZEPHIR_OBS_VAR(value); - _0 = !(zephir_array_isset_string_fetch(&value, params, SS("value"), 0 TSRMLS_CC)); + ZEPHIR_OBS_VAR(&value); + _0 = !(zephir_array_isset_string_fetch(&value, params, SL("value"), 0)); } if (_0) { - ZEPHIR_OBS_NVAR(value); - _1$$3 = zephir_fetch_static_property_ce(phalcon_tag_ce, SL("_displayValues") TSRMLS_CC); - if (!(zephir_array_isset_fetch(&value, _1$$3, name, 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(value); + ZEPHIR_OBS_NVAR(&value); + zephir_read_static_property_ce(&_1$$3, phalcon_tag_ce, SL("_displayValues"), PH_NOISY_CC | PH_READONLY); + if (!(zephir_array_isset_fetch(&value, &_1$$3, name, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&value); if (!(zephir_array_isset_fetch(&value, _POST, name, 0 TSRMLS_CC))) { RETURN_MM_NULL(); } } } - RETURN_CCTOR(value); + RETURN_CCTOR(&value); } @@ -551,21 +635,27 @@ PHP_METHOD(Phalcon_Tag, getValue) { */ PHP_METHOD(Phalcon_Tag, resetInput) { - zval *_0, *_1, *_2; + zval __$null, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); - ZEPHIR_INIT_VAR(_0); - array_init(_0); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_displayValues"), &_0 TSRMLS_CC); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentTitle"), &ZEPHIR_GLOBAL(global_null) TSRMLS_CC); - ZEPHIR_INIT_VAR(_1); - array_init(_1); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentAppendTitle"), &_1 TSRMLS_CC); - ZEPHIR_INIT_VAR(_2); - array_init(_2); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentPrependTitle"), &_2 TSRMLS_CC); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentTitleSeparator"), &ZEPHIR_GLOBAL(global_null) TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + array_init(&_0); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_displayValues"), &_0); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentTitle"), &__$null); + ZEPHIR_INIT_VAR(&_1); + array_init(&_1); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentAppendTitle"), &_1); + ZEPHIR_INIT_VAR(&_2); + array_init(&_2); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentPrependTitle"), &_2); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentTitleSeparator"), &__$null); ZEPHIR_MM_RESTORE(); } @@ -627,83 +717,99 @@ PHP_METHOD(Phalcon_Tag, resetInput) { PHP_METHOD(Phalcon_Tag, linkTo) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters, *text = NULL, *local = NULL, *params = NULL, *action = NULL, *query = NULL, *url = NULL, *code = NULL, *_0 = NULL, *_1, *_2; + zval *parameters, parameters_sub, *text = NULL, text_sub, *local = NULL, local_sub, __$null, __$true, params, action, query, url, code, _0, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&text_sub); + ZVAL_UNDEF(&local_sub); + ZVAL_NULL(&__$null); + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&action); + ZVAL_UNDEF(&query); + ZVAL_UNDEF(&url); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 2, ¶meters, &text, &local); if (!text) { - ZEPHIR_CPY_WRT(text, ZEPHIR_GLOBAL(global_null)); + text = &text_sub; + ZEPHIR_CPY_WRT(text, &__$null); } else { ZEPHIR_SEPARATE_PARAM(text); } if (!local) { - ZEPHIR_CPY_WRT(local, ZEPHIR_GLOBAL(global_true)); + local = &local_sub; + ZEPHIR_CPY_WRT(local, &__$true); } else { ZEPHIR_SEPARATE_PARAM(local); } if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - zephir_create_array(params, 3, 0 TSRMLS_CC); - zephir_array_fast_append(params, parameters); - zephir_array_fast_append(params, text); - zephir_array_fast_append(params, local); + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 3, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, parameters); + zephir_array_fast_append(¶ms, text); + zephir_array_fast_append(¶ms, local); } else { - ZEPHIR_CPY_WRT(params, parameters); - } - ZEPHIR_OBS_VAR(action); - if (!(zephir_array_isset_long_fetch(&action, params, 0, 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(action); - if (!(zephir_array_isset_string_fetch(&action, params, SS("action"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(action); - ZVAL_STRING(action, "", 1); + ZEPHIR_CPY_WRT(¶ms, parameters); + } + ZEPHIR_OBS_VAR(&action); + if (!(zephir_array_isset_long_fetch(&action, ¶ms, 0, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(&action); + if (!(zephir_array_isset_string_fetch(&action, ¶ms, SL("action"), 0))) { + ZEPHIR_INIT_NVAR(&action); + ZVAL_STRING(&action, ""); } else { - zephir_array_unset_string(¶ms, SS("action"), PH_SEPARATE); + zephir_array_unset_string(¶ms, SL("action"), PH_SEPARATE); } } ZEPHIR_OBS_NVAR(text); - if (!(zephir_array_isset_long_fetch(&text, params, 1, 0 TSRMLS_CC))) { + if (!(zephir_array_isset_long_fetch(text, ¶ms, 1, 0 TSRMLS_CC))) { ZEPHIR_OBS_NVAR(text); - if (!(zephir_array_isset_string_fetch(&text, params, SS("text"), 0 TSRMLS_CC))) { + if (!(zephir_array_isset_string_fetch(text, ¶ms, SL("text"), 0))) { ZEPHIR_INIT_NVAR(text); - ZVAL_STRING(text, "", 1); + ZVAL_STRING(text, ""); } else { - zephir_array_unset_string(¶ms, SS("text"), PH_SEPARATE); + zephir_array_unset_string(¶ms, SL("text"), PH_SEPARATE); } } ZEPHIR_OBS_NVAR(local); - if (!(zephir_array_isset_long_fetch(&local, params, 2, 0 TSRMLS_CC))) { + if (!(zephir_array_isset_long_fetch(local, ¶ms, 2, 0 TSRMLS_CC))) { ZEPHIR_OBS_NVAR(local); - if (!(zephir_array_isset_string_fetch(&local, params, SS("local"), 0 TSRMLS_CC))) { + if (!(zephir_array_isset_string_fetch(local, ¶ms, SL("local"), 0))) { ZEPHIR_INIT_NVAR(local); ZVAL_BOOL(local, 1); } else { - zephir_array_unset_string(¶ms, SS("local"), PH_SEPARATE); + zephir_array_unset_string(¶ms, SL("local"), PH_SEPARATE); } } - ZEPHIR_OBS_VAR(query); - if (zephir_array_isset_string_fetch(&query, params, SS("query"), 0 TSRMLS_CC)) { - zephir_array_unset_string(¶ms, SS("query"), PH_SEPARATE); + ZEPHIR_OBS_VAR(&query); + if (zephir_array_isset_string_fetch(&query, ¶ms, SL("query"), 0)) { + zephir_array_unset_string(¶ms, SL("query"), PH_SEPARATE); } else { - ZEPHIR_INIT_NVAR(query); - ZVAL_NULL(query); + ZEPHIR_INIT_NVAR(&query); + ZVAL_NULL(&query); } ZEPHIR_CALL_SELF(&url, "geturlservice", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&_0, url, "get", NULL, 0, action, query, local); + ZEPHIR_CALL_METHOD(&_0, &url, "get", NULL, 0, &action, &query, local); zephir_check_call_status(); zephir_array_update_string(¶ms, SL("href"), &_0, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "", text, ""); - zephir_concat_self(&code, _2 TSRMLS_CC); - RETURN_CCTOR(code); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVS(&_2, ">", text, ""); + zephir_concat_self(&code, &_2 TSRMLS_CC); + RETURN_CCTOR(&code); } @@ -719,13 +825,26 @@ PHP_METHOD(Phalcon_Tag, _inputField) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool asValue, _1$$10; - zval *type_param = NULL, *parameters, *asValue_param = NULL, *params = NULL, *id = NULL, *value = NULL, *code = NULL, *name = NULL, *_3, *_4, *_0$$6, *_2$$5 = NULL; - zval *type = NULL; + zval *type_param = NULL, *parameters, parameters_sub, *asValue_param = NULL, params, id, value, code, name, _3, _4, _0$$6, _2$$5; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_0$$6); + ZVAL_UNDEF(&_2$$5); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 1, &type_param, ¶meters, &asValue_param); - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); if (!asValue_param) { asValue = 0; } else { @@ -733,60 +852,59 @@ PHP_METHOD(Phalcon_Tag, _inputField) { } - ZEPHIR_INIT_VAR(params); - array_init(params); + ZEPHIR_INIT_VAR(¶ms); + array_init(¶ms); if (Z_TYPE_P(parameters) != IS_ARRAY) { zephir_array_append(¶ms, parameters, PH_SEPARATE, "phalcon/tag.zep", 470); } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } if (asValue == 0) { - ZEPHIR_OBS_VAR(id); - if (!(zephir_array_isset_long_fetch(&id, params, 0, 0 TSRMLS_CC))) { - zephir_array_fetch_string(&_0$$6, params, SL("id"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 478 TSRMLS_CC); + ZEPHIR_OBS_VAR(&id); + if (!(zephir_array_isset_long_fetch(&id, ¶ms, 0, 0 TSRMLS_CC))) { + zephir_array_fetch_string(&_0$$6, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 478 TSRMLS_CC); zephir_array_update_long(¶ms, 0, &_0$$6, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } - ZEPHIR_OBS_VAR(name); - if (zephir_array_isset_string_fetch(&name, params, SS("name"), 0 TSRMLS_CC)) { - if (ZEPHIR_IS_EMPTY(name)) { + ZEPHIR_OBS_VAR(&name); + if (zephir_array_isset_string_fetch(&name, ¶ms, SL("name"), 0)) { + if (ZEPHIR_IS_EMPTY(&name)) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } } else { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } - if (Z_TYPE_P(id) == IS_STRING) { - _1$$10 = !(zephir_memnstr_str(id, SL("["), "phalcon/tag.zep", 493)); + if (Z_TYPE_P(&id) == IS_STRING) { + _1$$10 = !(zephir_memnstr_str(&id, SL("["), "phalcon/tag.zep", 493)); if (_1$$10) { - _1$$10 = !(zephir_array_isset_string(params, SS("id"))); + _1$$10 = !(zephir_array_isset_string(¶ms, SL("id"))); } if (_1$$10) { zephir_array_update_string(¶ms, SL("id"), &id, PH_COPY | PH_SEPARATE); } } - ZEPHIR_CALL_SELF(&_2$$5, "getvalue", NULL, 0, id, params); + ZEPHIR_CALL_SELF(&_2$$5, "getvalue", NULL, 0, &id, ¶ms); zephir_check_call_status(); zephir_array_update_string(¶ms, SL("value"), &_2$$5, PH_COPY | PH_SEPARATE); } else { - if (!(zephir_array_isset_string(params, SS("value")))) { - ZEPHIR_OBS_VAR(value); - if (zephir_array_isset_long_fetch(&value, params, 0, 0 TSRMLS_CC)) { + if (!(zephir_array_isset_string(¶ms, SL("value")))) { + ZEPHIR_OBS_VAR(&value); + if (zephir_array_isset_long_fetch(&value, ¶ms, 0, 0 TSRMLS_CC)) { zephir_array_update_string(¶ms, SL("value"), &value, PH_COPY | PH_SEPARATE); } } } zephir_array_update_string(¶ms, SL("type"), &type, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_3); - ZVAL_STRING(_3, "") TSRMLS_CC); } else { zephir_concat_self_str(&code, SL(">") TSRMLS_CC); } - RETURN_CCTOR(code); + RETURN_CCTOR(&code); } @@ -801,84 +919,100 @@ PHP_METHOD(Phalcon_Tag, _inputFieldChecked) { zend_bool _3$$11; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *type_param = NULL, *parameters, *params = NULL, *value = NULL, *id = NULL, *code = NULL, *name = NULL, *currentValue = NULL, _1, *_2, *_6, *_7, *_0$$5, *_4$$12, *_5$$14; - zval *type = NULL; + zval *type_param = NULL, *parameters, parameters_sub, params, value, id, code, name, currentValue, _1, _2, _6, _7, _0$$5, _4$$12, _5$$14; + zval type; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&type); + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(¤tValue); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_7); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_4$$12); + ZVAL_UNDEF(&_5$$14); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 2, 0, &type_param, ¶meters); - zephir_get_strval(type, type_param); + zephir_get_strval(&type, type_param); if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - zephir_create_array(params, 1, 0 TSRMLS_CC); - zephir_array_fast_append(params, parameters); + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 1, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, parameters); } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - if (!(zephir_array_isset_long(params, 0))) { - zephir_array_fetch_string(&_0$$5, params, SL("id"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 544 TSRMLS_CC); + if (!(zephir_array_isset_long(¶ms, 0))) { + zephir_array_fetch_string(&_0$$5, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 544 TSRMLS_CC); zephir_array_update_long(¶ms, 0, &_0$$5, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } - ZEPHIR_OBS_VAR(id); - zephir_array_fetch_long(&id, params, 0, PH_NOISY, "phalcon/tag.zep", 547 TSRMLS_CC); - if (!(zephir_array_isset_string(params, SS("name")))) { + ZEPHIR_OBS_VAR(&id); + zephir_array_fetch_long(&id, ¶ms, 0, PH_NOISY, "phalcon/tag.zep", 547 TSRMLS_CC); + if (!(zephir_array_isset_string(¶ms, SL("name")))) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_OBS_VAR(name); - zephir_array_fetch_string(&name, params, SL("name"), PH_NOISY, "phalcon/tag.zep", 551 TSRMLS_CC); - if (ZEPHIR_IS_EMPTY(name)) { + ZEPHIR_OBS_VAR(&name); + zephir_array_fetch_string(&name, ¶ms, SL("name"), PH_NOISY, "phalcon/tag.zep", 551 TSRMLS_CC); + if (ZEPHIR_IS_EMPTY(&name)) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } } - ZEPHIR_SINIT_VAR(_1); - ZVAL_STRING(&_1, "[", 0); - ZEPHIR_INIT_VAR(_2); - zephir_fast_strpos(_2, id, &_1, 0 ); - if (!(zephir_is_true(_2))) { - if (!(zephir_array_isset_string(params, SS("id")))) { + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "["); + ZEPHIR_INIT_VAR(&_2); + zephir_fast_strpos(&_2, &id, &_1, 0 ); + if (!(zephir_is_true(&_2))) { + if (!(zephir_array_isset_string(¶ms, SL("id")))) { zephir_array_update_string(¶ms, SL("id"), &id, PH_COPY | PH_SEPARATE); } } - ZEPHIR_OBS_VAR(currentValue); - if (zephir_array_isset_string_fetch(¤tValue, params, SS("value"), 0 TSRMLS_CC)) { - zephir_array_unset_string(¶ms, SS("value"), PH_SEPARATE); - ZEPHIR_CALL_SELF(&value, "getvalue", NULL, 0, id, params); + ZEPHIR_OBS_VAR(¤tValue); + if (zephir_array_isset_string_fetch(¤tValue, ¶ms, SL("value"), 0)) { + zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE); + ZEPHIR_CALL_SELF(&value, "getvalue", NULL, 0, &id, ¶ms); zephir_check_call_status(); - _3$$11 = Z_TYPE_P(value) != IS_NULL; + _3$$11 = Z_TYPE_P(&value) != IS_NULL; if (_3$$11) { - _3$$11 = ZEPHIR_IS_EQUAL(currentValue, value); + _3$$11 = ZEPHIR_IS_EQUAL(¤tValue, &value); } if (_3$$11) { - ZEPHIR_INIT_VAR(_4$$12); - ZVAL_STRING(_4$$12, "checked", 1); + ZEPHIR_INIT_VAR(&_4$$12); + ZVAL_STRING(&_4$$12, "checked"); zephir_array_update_string(¶ms, SL("checked"), &_4$$12, PH_COPY | PH_SEPARATE); } zephir_array_update_string(¶ms, SL("value"), ¤tValue, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_CALL_SELF(&value, "getvalue", NULL, 0, id, params); + ZEPHIR_CALL_SELF(&value, "getvalue", NULL, 0, &id, ¶ms); zephir_check_call_status(); - if (Z_TYPE_P(value) != IS_NULL) { - ZEPHIR_INIT_VAR(_5$$14); - ZVAL_STRING(_5$$14, "checked", 1); + if (Z_TYPE_P(&value) != IS_NULL) { + ZEPHIR_INIT_VAR(&_5$$14); + ZVAL_STRING(&_5$$14, "checked"); zephir_array_update_string(¶ms, SL("checked"), &_5$$14, PH_COPY | PH_SEPARATE); } zephir_array_update_string(¶ms, SL("value"), &value, PH_COPY | PH_SEPARATE); } zephir_array_update_string(¶ms, SL("type"), &type, PH_COPY | PH_SEPARATE); - ZEPHIR_INIT_VAR(_6); - ZVAL_STRING(_6, "") TSRMLS_CC); } else { zephir_concat_self_str(&code, SL(">") TSRMLS_CC); } - RETURN_CCTOR(code); + RETURN_CCTOR(&code); } @@ -892,17 +1026,20 @@ PHP_METHOD(Phalcon_Tag, colorField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "color", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "color"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -927,17 +1064,20 @@ PHP_METHOD(Phalcon_Tag, textField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "text", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "text"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -963,17 +1103,20 @@ PHP_METHOD(Phalcon_Tag, numericField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "number", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "number"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -989,17 +1132,20 @@ PHP_METHOD(Phalcon_Tag, rangeField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "range", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "range"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1019,17 +1165,20 @@ PHP_METHOD(Phalcon_Tag, emailField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "email", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "email"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1054,17 +1203,20 @@ PHP_METHOD(Phalcon_Tag, dateField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "date", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "date"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1080,17 +1232,20 @@ PHP_METHOD(Phalcon_Tag, dateTimeField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "datetime", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "datetime"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1106,17 +1261,20 @@ PHP_METHOD(Phalcon_Tag, dateTimeLocalField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "datetime-local", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "datetime-local"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1132,17 +1290,20 @@ PHP_METHOD(Phalcon_Tag, monthField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "month", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "month"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1158,17 +1319,20 @@ PHP_METHOD(Phalcon_Tag, timeField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "time", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "time"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1184,17 +1348,20 @@ PHP_METHOD(Phalcon_Tag, weekField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "week", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "week"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1219,17 +1386,20 @@ PHP_METHOD(Phalcon_Tag, passwordField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "password", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "password"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1254,17 +1424,20 @@ PHP_METHOD(Phalcon_Tag, hiddenField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "hidden", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "hidden"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1284,17 +1457,20 @@ PHP_METHOD(Phalcon_Tag, fileField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "file", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "file"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1310,17 +1486,20 @@ PHP_METHOD(Phalcon_Tag, searchField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "search", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "search"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1336,17 +1515,20 @@ PHP_METHOD(Phalcon_Tag, telField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "tel", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "tel"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1362,17 +1544,20 @@ PHP_METHOD(Phalcon_Tag, urlField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "url", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "url"); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1402,17 +1587,20 @@ PHP_METHOD(Phalcon_Tag, checkField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "checkbox", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfieldchecked", &_0, 454, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "checkbox"); + ZEPHIR_RETURN_CALL_SELF("_inputfieldchecked", &_0, 407, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1442,17 +1630,20 @@ PHP_METHOD(Phalcon_Tag, radioField) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1; + zval *parameters, parameters_sub, _1; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "radio", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_RETURN_CALL_SELF("_inputfieldchecked", &_0, 454, _1, parameters); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "radio"); + ZEPHIR_RETURN_CALL_SELF("_inputfieldchecked", &_0, 407, &_1, parameters); zephir_check_call_status(); RETURN_MM(); @@ -1481,19 +1672,22 @@ PHP_METHOD(Phalcon_Tag, imageInput) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1, *_2; + zval *parameters, parameters_sub, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "image", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_2); - ZVAL_BOOL(_2, 1); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters, _2); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "image"); + ZVAL_BOOL(&_2, 1); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters, &_2); zephir_check_call_status(); RETURN_MM(); @@ -1518,19 +1712,22 @@ PHP_METHOD(Phalcon_Tag, submitButton) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *_1, *_2; + zval *parameters, parameters_sub, _1, _2; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "submit", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_2); - ZVAL_BOOL(_2, 1); - ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 453, _1, parameters, _2); - zephir_check_temp_parameter(_1); + ZEPHIR_INIT_VAR(&_1); + ZVAL_STRING(&_1, "submit"); + ZVAL_BOOL(&_2, 1); + ZEPHIR_RETURN_CALL_SELF("_inputfield", &_0, 406, &_1, parameters, &_2); zephir_check_call_status(); RETURN_MM(); @@ -1557,17 +1754,23 @@ PHP_METHOD(Phalcon_Tag, selectStatic) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *data = NULL; + zval *parameters, parameters_sub, *data = NULL, data_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, ¶meters, &data); if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", &_0, 227, parameters, data); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", &_0, 0, parameters, data); zephir_check_call_status(); RETURN_MM(); @@ -1599,17 +1802,23 @@ PHP_METHOD(Phalcon_Tag, select) { zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; - zval *parameters, *data = NULL; + zval *parameters, parameters_sub, *data = NULL, data_sub, __$null; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_NULL(&__$null); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, ¶meters, &data); if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } - ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", &_0, 227, parameters, data); + ZEPHIR_RETURN_CALL_CE_STATIC(phalcon_tag_select_ce, "selectfield", &_0, 0, parameters, data); zephir_check_call_status(); RETURN_MM(); @@ -1639,7 +1848,18 @@ PHP_METHOD(Phalcon_Tag, select) { PHP_METHOD(Phalcon_Tag, textArea) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters, *params = NULL, *id = NULL, *name = NULL, *content = NULL, *code = NULL, *_1, *_2, *_0$$6; + zval *parameters, parameters_sub, params, id, name, content, code, _1, _2, _0$$6; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&content); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_0$$6); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); @@ -1647,49 +1867,48 @@ PHP_METHOD(Phalcon_Tag, textArea) { if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - zephir_create_array(params, 1, 0 TSRMLS_CC); - zephir_array_fast_append(params, parameters); + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 1, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, parameters); } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - if (!(zephir_array_isset_long(params, 0))) { - if (zephir_array_isset_string(params, SS("id"))) { - zephir_array_fetch_string(&_0$$6, params, SL("id"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1027 TSRMLS_CC); + if (!(zephir_array_isset_long(¶ms, 0))) { + if (zephir_array_isset_string(¶ms, SL("id"))) { + zephir_array_fetch_string(&_0$$6, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1027 TSRMLS_CC); zephir_array_update_long(¶ms, 0, &_0$$6, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } } - ZEPHIR_OBS_VAR(id); - zephir_array_fetch_long(&id, params, 0, PH_NOISY, "phalcon/tag.zep", 1031 TSRMLS_CC); - if (!(zephir_array_isset_string(params, SS("name")))) { + ZEPHIR_OBS_VAR(&id); + zephir_array_fetch_long(&id, ¶ms, 0, PH_NOISY, "phalcon/tag.zep", 1031 TSRMLS_CC); + if (!(zephir_array_isset_string(¶ms, SL("name")))) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_OBS_VAR(name); - zephir_array_fetch_string(&name, params, SL("name"), PH_NOISY, "phalcon/tag.zep", 1035 TSRMLS_CC); - if (ZEPHIR_IS_EMPTY(name)) { + ZEPHIR_OBS_VAR(&name); + zephir_array_fetch_string(&name, ¶ms, SL("name"), PH_NOISY, "phalcon/tag.zep", 1035 TSRMLS_CC); + if (ZEPHIR_IS_EMPTY(&name)) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } } - if (!(zephir_array_isset_string(params, SS("id")))) { + if (!(zephir_array_isset_string(¶ms, SL("id")))) { zephir_array_update_string(¶ms, SL("id"), &id, PH_COPY | PH_SEPARATE); } - if (zephir_array_isset_string(params, SS("value"))) { - ZEPHIR_OBS_VAR(content); - zephir_array_fetch_string(&content, params, SL("value"), PH_NOISY, "phalcon/tag.zep", 1046 TSRMLS_CC); - zephir_array_unset_string(¶ms, SS("value"), PH_SEPARATE); + if (zephir_array_isset_string(¶ms, SL("value"))) { + ZEPHIR_OBS_VAR(&content); + zephir_array_fetch_string(&content, ¶ms, SL("value"), PH_NOISY, "phalcon/tag.zep", 1046 TSRMLS_CC); + zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE); } else { - ZEPHIR_CALL_SELF(&content, "getvalue", NULL, 0, id, params); + ZEPHIR_CALL_SELF(&content, "getvalue", NULL, 0, &id, ¶ms); zephir_check_call_status(); } - ZEPHIR_INIT_VAR(_1); - ZVAL_STRING(_1, "", content, ""); - zephir_concat_self(&code, _2 TSRMLS_CC); - RETURN_CCTOR(code); + ZEPHIR_INIT_VAR(&_2); + ZEPHIR_CONCAT_SVS(&_2, ">", &content, ""); + zephir_concat_self(&code, &_2 TSRMLS_CC); + RETURN_CCTOR(&code); } @@ -1719,7 +1938,18 @@ PHP_METHOD(Phalcon_Tag, textArea) { PHP_METHOD(Phalcon_Tag, form) { zend_long ZEPHIR_LAST_CALL_STATUS; - zval *parameters = NULL, *params = NULL, *paramsAction = NULL, *action = NULL, *code = NULL, *_3, *_0$$6, *_1$$7 = NULL, *_2$$8; + zval *parameters = NULL, parameters_sub, params, paramsAction, action, code, _3, _0$$6, _1$$7, _2$$8; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(¶msAction); + ZVAL_UNDEF(&action); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_0$$6); + ZVAL_UNDEF(&_1$$7); + ZVAL_UNDEF(&_2$$8); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, ¶meters); @@ -1728,47 +1958,46 @@ PHP_METHOD(Phalcon_Tag, form) { if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - zephir_create_array(params, 1, 0 TSRMLS_CC); - zephir_array_fast_append(params, parameters); + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 1, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, parameters); } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_OBS_VAR(paramsAction); - if (!(zephir_array_isset_long_fetch(¶msAction, params, 0, 0 TSRMLS_CC))) { - ZEPHIR_OBS_NVAR(paramsAction); - zephir_array_isset_string_fetch(¶msAction, params, SS("action"), 0 TSRMLS_CC); + ZEPHIR_OBS_VAR(¶msAction); + if (!(zephir_array_isset_long_fetch(¶msAction, ¶ms, 0, 0 TSRMLS_CC))) { + ZEPHIR_OBS_NVAR(¶msAction); + zephir_array_isset_string_fetch(¶msAction, ¶ms, SL("action"), 0); } - if (!(zephir_array_isset_string(params, SS("method")))) { - ZEPHIR_INIT_VAR(_0$$6); - ZVAL_STRING(_0$$6, "post", 1); + if (!(zephir_array_isset_string(¶ms, SL("method")))) { + ZEPHIR_INIT_VAR(&_0$$6); + ZVAL_STRING(&_0$$6, "post"); zephir_array_update_string(¶ms, SL("method"), &_0$$6, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(action); - ZVAL_NULL(action); - if (!(ZEPHIR_IS_EMPTY(paramsAction))) { + ZEPHIR_INIT_VAR(&action); + ZVAL_NULL(&action); + if (!(ZEPHIR_IS_EMPTY(¶msAction))) { ZEPHIR_CALL_SELF(&_1$$7, "geturlservice", NULL, 0); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&action, _1$$7, "get", NULL, 0, paramsAction); + ZEPHIR_CALL_METHOD(&action, &_1$$7, "get", NULL, 0, ¶msAction); zephir_check_call_status(); } ZEPHIR_OBS_NVAR(parameters); - if (zephir_array_isset_string_fetch(¶meters, params, SS("parameters"), 0 TSRMLS_CC)) { - ZEPHIR_INIT_VAR(_2$$8); - ZEPHIR_CONCAT_SV(_2$$8, "?", parameters); - zephir_concat_self(&action, _2$$8 TSRMLS_CC); - zephir_array_unset_string(¶ms, SS("parameters"), PH_SEPARATE); + if (zephir_array_isset_string_fetch(parameters, ¶ms, SL("parameters"), 0)) { + ZEPHIR_INIT_VAR(&_2$$8); + ZEPHIR_CONCAT_SV(&_2$$8, "?", parameters); + zephir_concat_self(&action, &_2$$8 TSRMLS_CC); + zephir_array_unset_string(¶ms, SL("parameters"), PH_SEPARATE); } - if (!(ZEPHIR_IS_EMPTY(action))) { + if (!(ZEPHIR_IS_EMPTY(&action))) { zephir_array_update_string(¶ms, SL("action"), &action, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(_3); - ZVAL_STRING(_3, "") TSRMLS_CC); - RETURN_CCTOR(code); + RETURN_CCTOR(&code); } @@ -1777,9 +2006,10 @@ PHP_METHOD(Phalcon_Tag, form) { */ PHP_METHOD(Phalcon_Tag, endForm) { - + zval *this_ptr = getThis(); + - RETURN_STRING("", 1); + RETURN_STRING(""); } @@ -1793,15 +2023,18 @@ PHP_METHOD(Phalcon_Tag, endForm) { PHP_METHOD(Phalcon_Tag, setTitle) { zval *title_param = NULL; - zval *title = NULL; + zval title; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&title); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &title_param); - zephir_get_strval(title, title_param); + zephir_get_strval(&title, title_param); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentTitle"), &title TSRMLS_CC); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentTitle"), &title); ZEPHIR_MM_RESTORE(); } @@ -1816,15 +2049,18 @@ PHP_METHOD(Phalcon_Tag, setTitle) { PHP_METHOD(Phalcon_Tag, setTitleSeparator) { zval *titleSeparator_param = NULL; - zval *titleSeparator = NULL; + zval titleSeparator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&titleSeparator); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &titleSeparator_param); - zephir_get_strval(titleSeparator, titleSeparator_param); + zephir_get_strval(&titleSeparator, titleSeparator_param); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentTitleSeparator"), &titleSeparator TSRMLS_CC); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentTitleSeparator"), &titleSeparator); ZEPHIR_MM_RESTORE(); } @@ -1834,24 +2070,29 @@ PHP_METHOD(Phalcon_Tag, setTitleSeparator) { */ PHP_METHOD(Phalcon_Tag, appendTitle) { - zval *title, *_0, *_1$$3; + zval *title, title_sub, _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&title_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &title); - ZEPHIR_OBS_VAR(_0); - zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("_documentAppendTitle") TSRMLS_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentAppendTitle"), &_1$$3 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_0); + zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("_documentAppendTitle"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentAppendTitle"), &_1$$3); } if (Z_TYPE_P(title) == IS_ARRAY) { - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentAppendTitle"), &title TSRMLS_CC); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentAppendTitle"), title); } else { - zephir_update_static_property_array_multi_ce(phalcon_tag_ce, SL("_documentAppendTitle"), &title TSRMLS_CC, SL("a"), 1); + zephir_update_static_property_array_multi_ce(phalcon_tag_ce, SL("_documentAppendTitle"), title TSRMLS_CC, SL("a"), 1); } ZEPHIR_MM_RESTORE(); @@ -1862,24 +2103,29 @@ PHP_METHOD(Phalcon_Tag, appendTitle) { */ PHP_METHOD(Phalcon_Tag, prependTitle) { - zval *title, *_0, *_1$$3; + zval *title, title_sub, _0, _1$$3; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&title_sub); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &title); - ZEPHIR_OBS_VAR(_0); - zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("_documentPrependTitle") TSRMLS_CC); - if (Z_TYPE_P(_0) == IS_NULL) { - ZEPHIR_INIT_VAR(_1$$3); - array_init(_1$$3); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentPrependTitle"), &_1$$3 TSRMLS_CC); + ZEPHIR_OBS_VAR(&_0); + zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("_documentPrependTitle"), PH_NOISY_CC); + if (Z_TYPE_P(&_0) == IS_NULL) { + ZEPHIR_INIT_VAR(&_1$$3); + array_init(&_1$$3); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentPrependTitle"), &_1$$3); } if (Z_TYPE_P(title) == IS_ARRAY) { - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentPrependTitle"), &title TSRMLS_CC); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentPrependTitle"), title); } else { - zephir_update_static_property_array_multi_ce(phalcon_tag_ce, SL("_documentPrependTitle"), &title TSRMLS_CC, SL("a"), 1); + zephir_update_static_property_array_multi_ce(phalcon_tag_ce, SL("_documentPrependTitle"), title TSRMLS_CC, SL("a"), 1); } ZEPHIR_MM_RESTORE(); @@ -1899,13 +2145,34 @@ PHP_METHOD(Phalcon_Tag, prependTitle) { */ PHP_METHOD(Phalcon_Tag, getTitle) { - HashTable *_9$$5, *_14$$8; - HashPosition _8$$5, _13$$8; - zval *_1; - zephir_fcall_cache_entry *_12 = NULL, *_17 = NULL; + zval _1; + zephir_fcall_cache_entry *_10 = NULL, *_13 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; - zval *tags_param = NULL, *items = NULL, *output = NULL, *title = NULL, *documentTitle = NULL, *documentAppendTitle = NULL, *documentPrependTitle = NULL, *documentTitleSeparator = NULL, *escaper = NULL, *_0 = NULL, *_2, *_3, *_4, *_6, *_5$$3, *_7$$4, *tmp$$5 = NULL, **_10$$5, *_11$$6 = NULL, **_15$$8, *_16$$9 = NULL, *_18$$12; + zval *tags_param = NULL, __$true, items, output, title, documentTitle, documentAppendTitle, documentPrependTitle, documentTitleSeparator, escaper, _0, _2, _3, _4, _6, _5$$3, _7$$4, tmp$$5, *_8$$5, _9$$6, *_11$$8, _12$$9, _14$$12; zend_bool tags; + zval *this_ptr = getThis(); + + ZVAL_BOOL(&__$true, 1); + ZVAL_UNDEF(&items); + ZVAL_UNDEF(&output); + ZVAL_UNDEF(&title); + ZVAL_UNDEF(&documentTitle); + ZVAL_UNDEF(&documentAppendTitle); + ZVAL_UNDEF(&documentPrependTitle); + ZVAL_UNDEF(&documentTitleSeparator); + ZVAL_UNDEF(&escaper); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_4); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_7$$4); + ZVAL_UNDEF(&tmp$$5); + ZVAL_UNDEF(&_9$$6); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_14$$12); + ZVAL_UNDEF(&_1); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 1, &tags_param); @@ -1917,84 +2184,84 @@ PHP_METHOD(Phalcon_Tag, getTitle) { } - ZEPHIR_INIT_VAR(_1); - zephir_create_array(_1, 1, 0 TSRMLS_CC); - zephir_array_update_string(&_1, SL("escape"), &ZEPHIR_GLOBAL(global_true), PH_COPY | PH_SEPARATE); - ZEPHIR_CALL_SELF(&_0, "getescaper", NULL, 0, _1); + ZEPHIR_INIT_VAR(&_1); + zephir_create_array(&_1, 1, 0 TSRMLS_CC); + zephir_array_update_string(&_1, SL("escape"), &__$true, PH_COPY | PH_SEPARATE); + ZEPHIR_CALL_SELF(&_0, "getescaper", NULL, 0, &_1); zephir_check_call_status(); - ZEPHIR_CPY_WRT(escaper, _0); - ZEPHIR_INIT_VAR(items); - array_init(items); - ZEPHIR_INIT_VAR(output); - ZVAL_STRING(output, "", 1); - _2 = zephir_fetch_static_property_ce(phalcon_tag_ce, SL("_documentTitle") TSRMLS_CC); - ZEPHIR_CALL_METHOD(&documentTitle, escaper, "escapehtml", NULL, 0, _2); + ZEPHIR_CPY_WRT(&escaper, &_0); + ZEPHIR_INIT_VAR(&items); + array_init(&items); + ZEPHIR_INIT_VAR(&output); + ZVAL_STRING(&output, ""); + zephir_read_static_property_ce(&_2, phalcon_tag_ce, SL("_documentTitle"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&documentTitle, &escaper, "escapehtml", NULL, 0, &_2); zephir_check_call_status(); - _3 = zephir_fetch_static_property_ce(phalcon_tag_ce, SL("_documentTitleSeparator") TSRMLS_CC); - ZEPHIR_CALL_METHOD(&documentTitleSeparator, escaper, "escapehtml", NULL, 0, _3); + zephir_read_static_property_ce(&_3, phalcon_tag_ce, SL("_documentTitleSeparator"), PH_NOISY_CC | PH_READONLY); + ZEPHIR_CALL_METHOD(&documentTitleSeparator, &escaper, "escapehtml", NULL, 0, &_3); zephir_check_call_status(); - ZEPHIR_OBS_VAR(_4); - zephir_read_static_property_ce(&_4, phalcon_tag_ce, SL("_documentAppendTitle") TSRMLS_CC); - if (Z_TYPE_P(_4) == IS_NULL) { - ZEPHIR_INIT_VAR(_5$$3); - array_init(_5$$3); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentAppendTitle"), &_5$$3 TSRMLS_CC); - } - ZEPHIR_OBS_VAR(documentAppendTitle); - zephir_read_static_property_ce(&documentAppendTitle, phalcon_tag_ce, SL("_documentAppendTitle") TSRMLS_CC); - ZEPHIR_OBS_VAR(_6); - zephir_read_static_property_ce(&_6, phalcon_tag_ce, SL("_documentPrependTitle") TSRMLS_CC); - if (Z_TYPE_P(_6) == IS_NULL) { - ZEPHIR_INIT_VAR(_7$$4); - array_init(_7$$4); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentPrependTitle"), &_7$$4 TSRMLS_CC); - } - ZEPHIR_OBS_VAR(documentPrependTitle); - zephir_read_static_property_ce(&documentPrependTitle, phalcon_tag_ce, SL("_documentPrependTitle") TSRMLS_CC); - if (!(ZEPHIR_IS_EMPTY(documentPrependTitle))) { - ZEPHIR_CALL_FUNCTION(&tmp$$5, "array_reverse", NULL, 455, documentPrependTitle); + ZEPHIR_OBS_VAR(&_4); + zephir_read_static_property_ce(&_4, phalcon_tag_ce, SL("_documentAppendTitle"), PH_NOISY_CC); + if (Z_TYPE_P(&_4) == IS_NULL) { + ZEPHIR_INIT_VAR(&_5$$3); + array_init(&_5$$3); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentAppendTitle"), &_5$$3); + } + ZEPHIR_OBS_VAR(&documentAppendTitle); + zephir_read_static_property_ce(&documentAppendTitle, phalcon_tag_ce, SL("_documentAppendTitle"), PH_NOISY_CC); + ZEPHIR_OBS_VAR(&_6); + zephir_read_static_property_ce(&_6, phalcon_tag_ce, SL("_documentPrependTitle"), PH_NOISY_CC); + if (Z_TYPE_P(&_6) == IS_NULL) { + ZEPHIR_INIT_VAR(&_7$$4); + array_init(&_7$$4); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentPrependTitle"), &_7$$4); + } + ZEPHIR_OBS_VAR(&documentPrependTitle); + zephir_read_static_property_ce(&documentPrependTitle, phalcon_tag_ce, SL("_documentPrependTitle"), PH_NOISY_CC); + if (!(ZEPHIR_IS_EMPTY(&documentPrependTitle))) { + ZEPHIR_CALL_FUNCTION(&tmp$$5, "array_reverse", NULL, 408, &documentPrependTitle); zephir_check_call_status(); - zephir_is_iterable(tmp$$5, &_9$$5, &_8$$5, 0, 0, "phalcon/tag.zep", 1229); - for ( - ; zend_hash_get_current_data_ex(_9$$5, (void**) &_10$$5, &_8$$5) == SUCCESS - ; zend_hash_move_forward_ex(_9$$5, &_8$$5) - ) { - ZEPHIR_GET_HVALUE(title, _10$$5); - ZEPHIR_CALL_METHOD(&_11$$6, escaper, "escapehtml", &_12, 0, title); + zephir_is_iterable(&tmp$$5, 0, "phalcon/tag.zep", 1229); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&tmp$$5), _8$$5) + { + ZEPHIR_INIT_NVAR(&title); + ZVAL_COPY(&title, _8$$5); + ZEPHIR_CALL_METHOD(&_9$$6, &escaper, "escapehtml", &_10, 0, &title); zephir_check_call_status(); - zephir_array_append(&items, _11$$6, PH_SEPARATE, "phalcon/tag.zep", 1227); - } - } - if (!(ZEPHIR_IS_EMPTY(documentTitle))) { - zephir_array_append(&items, documentTitle, PH_SEPARATE, "phalcon/tag.zep", 1232); - } - if (!(ZEPHIR_IS_EMPTY(documentAppendTitle))) { - zephir_is_iterable(documentAppendTitle, &_14$$8, &_13$$8, 0, 0, "phalcon/tag.zep", 1239); - for ( - ; zend_hash_get_current_data_ex(_14$$8, (void**) &_15$$8, &_13$$8) == SUCCESS - ; zend_hash_move_forward_ex(_14$$8, &_13$$8) - ) { - ZEPHIR_GET_HVALUE(title, _15$$8); - ZEPHIR_CALL_METHOD(&_16$$9, escaper, "escapehtml", &_17, 0, title); + zephir_array_append(&items, &_9$$6, PH_SEPARATE, "phalcon/tag.zep", 1227); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&title); + } + if (!(ZEPHIR_IS_EMPTY(&documentTitle))) { + zephir_array_append(&items, &documentTitle, PH_SEPARATE, "phalcon/tag.zep", 1232); + } + if (!(ZEPHIR_IS_EMPTY(&documentAppendTitle))) { + zephir_is_iterable(&documentAppendTitle, 0, "phalcon/tag.zep", 1239); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(&documentAppendTitle), _11$$8) + { + ZEPHIR_INIT_NVAR(&title); + ZVAL_COPY(&title, _11$$8); + ZEPHIR_CALL_METHOD(&_12$$9, &escaper, "escapehtml", &_13, 0, &title); zephir_check_call_status(); - zephir_array_append(&items, _16$$9, PH_SEPARATE, "phalcon/tag.zep", 1237); - } + zephir_array_append(&items, &_12$$9, PH_SEPARATE, "phalcon/tag.zep", 1237); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&title); } - if (ZEPHIR_IS_EMPTY(documentTitleSeparator)) { - ZEPHIR_INIT_NVAR(documentTitleSeparator); - ZVAL_STRING(documentTitleSeparator, "", 1); + if (ZEPHIR_IS_EMPTY(&documentTitleSeparator)) { + ZEPHIR_INIT_NVAR(&documentTitleSeparator); + ZVAL_STRING(&documentTitleSeparator, ""); } - if (!(ZEPHIR_IS_EMPTY(items))) { - ZEPHIR_INIT_NVAR(output); - zephir_fast_join(output, documentTitleSeparator, items TSRMLS_CC); + if (!(ZEPHIR_IS_EMPTY(&items))) { + ZEPHIR_INIT_NVAR(&output); + zephir_fast_join(&output, &documentTitleSeparator, &items TSRMLS_CC); } if (tags) { - ZEPHIR_INIT_VAR(_18$$12); - ZEPHIR_GET_CONSTANT(_18$$12, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", output, "", _18$$12); + ZEPHIR_INIT_VAR(&_14$$12); + ZEPHIR_GET_CONSTANT(&_14$$12, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &output, "", &_14$$12); RETURN_MM(); } - RETURN_CCTOR(output); + RETURN_CCTOR(&output); } @@ -2011,11 +2278,14 @@ PHP_METHOD(Phalcon_Tag, getTitle) { */ PHP_METHOD(Phalcon_Tag, getTitleSeparator) { - zval *_0; + zval _0; + zval *this_ptr = getThis(); + ZVAL_UNDEF(&_0); - _0 = zephir_fetch_static_property_ce(phalcon_tag_ce, SL("_documentTitleSeparator") TSRMLS_CC); - RETURN_CTORW(_0); + + zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("_documentTitleSeparator"), PH_NOISY_CC | PH_READONLY); + RETURN_CTORW(&_0); } @@ -2041,13 +2311,36 @@ PHP_METHOD(Phalcon_Tag, stylesheetLink) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool local; - zval *parameters = NULL, *local_param = NULL, *params = NULL, *code = NULL, *_10, *_11, *_0$$3, *_1$$5, *_2$$7, *_3$$8, *_4$$10, *_5$$11, *_6$$12 = NULL, *_7$$12 = NULL, *_8$$12, *_9$$13, *_12$$14, *_13$$14, *_14$$15, *_15$$15; + zval *parameters = NULL, parameters_sub, *local_param = NULL, __$null, params, code, _10, _11, _0$$3, _1$$5, _2$$7, _3$$8, _4$$10, _5$$11, _6$$12, _7$$12, _8$$12, _9$$13, _12$$14, _13$$14, _14$$15, _15$$15; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_11); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_4$$10); + ZVAL_UNDEF(&_5$$11); + ZVAL_UNDEF(&_6$$12); + ZVAL_UNDEF(&_7$$12); + ZVAL_UNDEF(&_8$$12); + ZVAL_UNDEF(&_9$$13); + ZVAL_UNDEF(&_12$$14); + ZVAL_UNDEF(&_13$$14); + ZVAL_UNDEF(&_14$$15); + ZVAL_UNDEF(&_15$$15); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, ¶meters, &local_param); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } if (!local_param) { local = 1; @@ -2057,75 +2350,74 @@ PHP_METHOD(Phalcon_Tag, stylesheetLink) { if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - zephir_create_array(params, 2, 0 TSRMLS_CC); - zephir_array_fast_append(params, parameters); - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_BOOL(_0$$3, local); - zephir_array_fast_append(params, _0$$3); + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 2, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, parameters); + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_BOOL(&_0$$3, local); + zephir_array_fast_append(¶ms, &_0$$3); } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - if (zephir_array_isset_long(params, 1)) { - ZEPHIR_OBS_VAR(_1$$5); - zephir_array_fetch_long(&_1$$5, params, 1, PH_NOISY, "phalcon/tag.zep", 1301 TSRMLS_CC); - local = zephir_get_boolval(_1$$5); + if (zephir_array_isset_long(¶ms, 1)) { + ZEPHIR_OBS_VAR(&_1$$5); + zephir_array_fetch_long(&_1$$5, ¶ms, 1, PH_NOISY, "phalcon/tag.zep", 1301 TSRMLS_CC); + local = zephir_get_boolval(&_1$$5); } else { - if (zephir_array_isset_string(params, SS("local"))) { - ZEPHIR_OBS_VAR(_2$$7); - zephir_array_fetch_string(&_2$$7, params, SL("local"), PH_NOISY, "phalcon/tag.zep", 1304 TSRMLS_CC); - local = zephir_get_boolval(_2$$7); - zephir_array_unset_string(¶ms, SS("local"), PH_SEPARATE); + if (zephir_array_isset_string(¶ms, SL("local"))) { + ZEPHIR_OBS_VAR(&_2$$7); + zephir_array_fetch_string(&_2$$7, ¶ms, SL("local"), PH_NOISY, "phalcon/tag.zep", 1304 TSRMLS_CC); + local = zephir_get_boolval(&_2$$7); + zephir_array_unset_string(¶ms, SL("local"), PH_SEPARATE); } } - if (!(zephir_array_isset_string(params, SS("type")))) { - ZEPHIR_INIT_VAR(_3$$8); - ZVAL_STRING(_3$$8, "text/css", 1); + if (!(zephir_array_isset_string(¶ms, SL("type")))) { + ZEPHIR_INIT_VAR(&_3$$8); + ZVAL_STRING(&_3$$8, "text/css"); zephir_array_update_string(¶ms, SL("type"), &_3$$8, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(params, SS("href")))) { - if (zephir_array_isset_long(params, 0)) { - zephir_array_fetch_long(&_4$$10, params, 0, PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1315 TSRMLS_CC); + if (!(zephir_array_isset_string(¶ms, SL("href")))) { + if (zephir_array_isset_long(¶ms, 0)) { + zephir_array_fetch_long(&_4$$10, ¶ms, 0, PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1315 TSRMLS_CC); zephir_array_update_string(¶ms, SL("href"), &_4$$10, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_INIT_VAR(_5$$11); - ZVAL_STRING(_5$$11, "", 1); + ZEPHIR_INIT_VAR(&_5$$11); + ZVAL_STRING(&_5$$11, ""); zephir_array_update_string(¶ms, SL("href"), &_5$$11, PH_COPY | PH_SEPARATE); } } if (local == 1) { ZEPHIR_CALL_SELF(&_6$$12, "geturlservice", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_8$$12, params, SL("href"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1325 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_7$$12, _6$$12, "getstatic", NULL, 0, _8$$12); + zephir_array_fetch_string(&_8$$12, ¶ms, SL("href"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1325 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_7$$12, &_6$$12, "getstatic", NULL, 0, &_8$$12); zephir_check_call_status(); zephir_array_update_string(¶ms, SL("href"), &_7$$12, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(params, SS("rel")))) { - ZEPHIR_INIT_VAR(_9$$13); - ZVAL_STRING(_9$$13, "stylesheet", 1); + if (!(zephir_array_isset_string(¶ms, SL("rel")))) { + ZEPHIR_INIT_VAR(&_9$$13); + ZVAL_STRING(&_9$$13, "stylesheet"); zephir_array_update_string(¶ms, SL("rel"), &_9$$13, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(_10); - ZVAL_STRING(_10, "", _12$$14); - zephir_concat_self(&code, _13$$14 TSRMLS_CC); + zephir_read_static_property_ce(&_11, phalcon_tag_ce, SL("_documentType"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_GT_LONG(&_11, 5)) { + ZEPHIR_INIT_VAR(&_12$$14); + ZEPHIR_GET_CONSTANT(&_12$$14, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_13$$14); + ZEPHIR_CONCAT_SV(&_13$$14, " />", &_12$$14); + zephir_concat_self(&code, &_13$$14 TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_14$$15); - ZEPHIR_GET_CONSTANT(_14$$15, "PHP_EOL"); - ZEPHIR_INIT_VAR(_15$$15); - ZEPHIR_CONCAT_SV(_15$$15, ">", _14$$15); - zephir_concat_self(&code, _15$$15 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_14$$15); + ZEPHIR_GET_CONSTANT(&_14$$15, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_15$$15); + ZEPHIR_CONCAT_SV(&_15$$15, ">", &_14$$15); + zephir_concat_self(&code, &_15$$15 TSRMLS_CC); } - RETURN_CCTOR(code); + RETURN_CCTOR(&code); } @@ -2151,13 +2443,31 @@ PHP_METHOD(Phalcon_Tag, javascriptInclude) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool local; - zval *parameters = NULL, *local_param = NULL, *params = NULL, *code = NULL, *_9 = NULL, *_10, *_0$$3, *_1$$5, *_2$$7, *_3$$8, *_4$$10, *_5$$11, *_6$$12 = NULL, *_7$$12 = NULL, *_8$$12; + zval *parameters = NULL, parameters_sub, *local_param = NULL, __$null, params, code, _9, _10, _0$$3, _1$$5, _2$$7, _3$$8, _4$$10, _5$$11, _6$$12, _7$$12, _8$$12; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&_9); + ZVAL_UNDEF(&_10); + ZVAL_UNDEF(&_0$$3); + ZVAL_UNDEF(&_1$$5); + ZVAL_UNDEF(&_2$$7); + ZVAL_UNDEF(&_3$$8); + ZVAL_UNDEF(&_4$$10); + ZVAL_UNDEF(&_5$$11); + ZVAL_UNDEF(&_6$$12); + ZVAL_UNDEF(&_7$$12); + ZVAL_UNDEF(&_8$$12); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, ¶meters, &local_param); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } if (!local_param) { local = 1; @@ -2167,61 +2477,60 @@ PHP_METHOD(Phalcon_Tag, javascriptInclude) { if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - zephir_create_array(params, 2, 0 TSRMLS_CC); - zephir_array_fast_append(params, parameters); - ZEPHIR_INIT_VAR(_0$$3); - ZVAL_BOOL(_0$$3, local); - zephir_array_fast_append(params, _0$$3); + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 2, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, parameters); + ZEPHIR_INIT_VAR(&_0$$3); + ZVAL_BOOL(&_0$$3, local); + zephir_array_fast_append(¶ms, &_0$$3); } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - if (zephir_array_isset_long(params, 1)) { - ZEPHIR_OBS_VAR(_1$$5); - zephir_array_fetch_long(&_1$$5, params, 1, PH_NOISY, "phalcon/tag.zep", 1375 TSRMLS_CC); - local = zephir_get_boolval(_1$$5); + if (zephir_array_isset_long(¶ms, 1)) { + ZEPHIR_OBS_VAR(&_1$$5); + zephir_array_fetch_long(&_1$$5, ¶ms, 1, PH_NOISY, "phalcon/tag.zep", 1375 TSRMLS_CC); + local = zephir_get_boolval(&_1$$5); } else { - if (zephir_array_isset_string(params, SS("local"))) { - ZEPHIR_OBS_VAR(_2$$7); - zephir_array_fetch_string(&_2$$7, params, SL("local"), PH_NOISY, "phalcon/tag.zep", 1378 TSRMLS_CC); - local = zephir_get_boolval(_2$$7); - zephir_array_unset_string(¶ms, SS("local"), PH_SEPARATE); + if (zephir_array_isset_string(¶ms, SL("local"))) { + ZEPHIR_OBS_VAR(&_2$$7); + zephir_array_fetch_string(&_2$$7, ¶ms, SL("local"), PH_NOISY, "phalcon/tag.zep", 1378 TSRMLS_CC); + local = zephir_get_boolval(&_2$$7); + zephir_array_unset_string(¶ms, SL("local"), PH_SEPARATE); } } - if (!(zephir_array_isset_string(params, SS("type")))) { - ZEPHIR_INIT_VAR(_3$$8); - ZVAL_STRING(_3$$8, "text/javascript", 1); + if (!(zephir_array_isset_string(¶ms, SL("type")))) { + ZEPHIR_INIT_VAR(&_3$$8); + ZVAL_STRING(&_3$$8, "text/javascript"); zephir_array_update_string(¶ms, SL("type"), &_3$$8, PH_COPY | PH_SEPARATE); } - if (!(zephir_array_isset_string(params, SS("src")))) { - if (zephir_array_isset_long(params, 0)) { - zephir_array_fetch_long(&_4$$10, params, 0, PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1389 TSRMLS_CC); + if (!(zephir_array_isset_string(¶ms, SL("src")))) { + if (zephir_array_isset_long(¶ms, 0)) { + zephir_array_fetch_long(&_4$$10, ¶ms, 0, PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1389 TSRMLS_CC); zephir_array_update_string(¶ms, SL("src"), &_4$$10, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_INIT_VAR(_5$$11); - ZVAL_STRING(_5$$11, "", 1); + ZEPHIR_INIT_VAR(&_5$$11); + ZVAL_STRING(&_5$$11, ""); zephir_array_update_string(¶ms, SL("src"), &_5$$11, PH_COPY | PH_SEPARATE); } } if (local == 1) { ZEPHIR_CALL_SELF(&_6$$12, "geturlservice", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_8$$12, params, SL("src"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1399 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_7$$12, _6$$12, "getstatic", NULL, 0, _8$$12); + zephir_array_fetch_string(&_8$$12, ¶ms, SL("src"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1399 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_7$$12, &_6$$12, "getstatic", NULL, 0, &_8$$12); zephir_check_call_status(); zephir_array_update_string(¶ms, SL("src"), &_7$$12, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(_9); - ZVAL_STRING(_9, "", _9); - zephir_concat_self(&code, _10 TSRMLS_CC); - RETURN_CCTOR(code); + ZEPHIR_INIT_NVAR(&_9); + ZEPHIR_GET_CONSTANT(&_9, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_10); + ZEPHIR_CONCAT_SV(&_10, ">", &_9); + zephir_concat_self(&code, &_10 TSRMLS_CC); + RETURN_CCTOR(&code); } @@ -2254,13 +2563,28 @@ PHP_METHOD(Phalcon_Tag, image) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool local; - zval *parameters = NULL, *local_param = NULL, *params = NULL, *code = NULL, *src = NULL, *_5, *_6, *_0$$5, *_1$$8, *_2$$9 = NULL, *_3$$9 = NULL, *_4$$9; + zval *parameters = NULL, parameters_sub, *local_param = NULL, __$null, params, code, src, _5, _6, _0$$5, _1$$8, _2$$9, _3$$9, _4$$9; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&src); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_6); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_1$$8); + ZVAL_UNDEF(&_2$$9); + ZVAL_UNDEF(&_3$$9); + ZVAL_UNDEF(&_4$$9); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 0, 2, ¶meters, &local_param); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } if (!local_param) { local = 1; @@ -2270,47 +2594,46 @@ PHP_METHOD(Phalcon_Tag, image) { if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - zephir_create_array(params, 1, 0 TSRMLS_CC); - zephir_array_fast_append(params, parameters); + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 1, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, parameters); } else { - ZEPHIR_CPY_WRT(params, parameters); - if (zephir_array_isset_long(params, 1)) { - ZEPHIR_OBS_VAR(_0$$5); - zephir_array_fetch_long(&_0$$5, params, 1, PH_NOISY, "phalcon/tag.zep", 1442 TSRMLS_CC); - local = zephir_get_boolval(_0$$5); + ZEPHIR_CPY_WRT(¶ms, parameters); + if (zephir_array_isset_long(¶ms, 1)) { + ZEPHIR_OBS_VAR(&_0$$5); + zephir_array_fetch_long(&_0$$5, ¶ms, 1, PH_NOISY, "phalcon/tag.zep", 1442 TSRMLS_CC); + local = zephir_get_boolval(&_0$$5); } } - if (!(zephir_array_isset_string(params, SS("src")))) { - ZEPHIR_OBS_VAR(src); - if (zephir_array_isset_long_fetch(&src, params, 0, 0 TSRMLS_CC)) { + if (!(zephir_array_isset_string(¶ms, SL("src")))) { + ZEPHIR_OBS_VAR(&src); + if (zephir_array_isset_long_fetch(&src, ¶ms, 0, 0 TSRMLS_CC)) { zephir_array_update_string(¶ms, SL("src"), &src, PH_COPY | PH_SEPARATE); } else { - ZEPHIR_INIT_VAR(_1$$8); - ZVAL_STRING(_1$$8, "", 1); + ZEPHIR_INIT_VAR(&_1$$8); + ZVAL_STRING(&_1$$8, ""); zephir_array_update_string(¶ms, SL("src"), &_1$$8, PH_COPY | PH_SEPARATE); } } if (local) { ZEPHIR_CALL_SELF(&_2$$9, "geturlservice", NULL, 0); zephir_check_call_status(); - zephir_array_fetch_string(&_4$$9, params, SL("src"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1458 TSRMLS_CC); - ZEPHIR_CALL_METHOD(&_3$$9, _2$$9, "getstatic", NULL, 0, _4$$9); + zephir_array_fetch_string(&_4$$9, ¶ms, SL("src"), PH_NOISY | PH_READONLY, "phalcon/tag.zep", 1458 TSRMLS_CC); + ZEPHIR_CALL_METHOD(&_3$$9, &_2$$9, "getstatic", NULL, 0, &_4$$9); zephir_check_call_status(); zephir_array_update_string(¶ms, SL("src"), &_3$$9, PH_COPY | PH_SEPARATE); } - ZEPHIR_INIT_VAR(_5); - ZVAL_STRING(_5, "") TSRMLS_CC); } else { zephir_concat_self_str(&code, SL(">") TSRMLS_CC); } - RETURN_CCTOR(code); + RETURN_CCTOR(&code); } @@ -2323,22 +2646,43 @@ PHP_METHOD(Phalcon_Tag, image) { */ PHP_METHOD(Phalcon_Tag, friendlyTitle) { - HashTable *_7$$6; - HashPosition _6$$6; zend_long ZEPHIR_LAST_CALL_STATUS; - zend_bool lowercase, _5$$4; - zval *text_param = NULL, *separator_param = NULL, *lowercase_param = NULL, *replace = NULL, *friendly = NULL, *locale = NULL, *search = NULL, _0 = zval_used_for_init, *_1 = NULL, *_13 = NULL, *_14, *_16 = NULL, _2$$3 = zval_used_for_init, _3$$3 = zval_used_for_init, *_4$$3 = NULL, **_8$$6, *_9$$7 = NULL, _10$$7 = zval_used_for_init, *_11$$8, _12$$8, *_15$$9, _17$$10; - zval *text = NULL, *separator = NULL; + zend_bool lowercase, _6$$4; + zval *text_param = NULL, *separator_param = NULL, *lowercase_param = NULL, *replace = NULL, replace_sub, __$null, friendly, locale, search, _0, _1, _12, _14, _2$$3, _3$$3, _4$$3, _5$$3, *_7$$6, _8$$7, _9$$7, _10$$8, _11$$8, _13$$9, _15$$10; + zval text, separator; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&text); + ZVAL_UNDEF(&separator); + ZVAL_UNDEF(&replace_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(&friendly); + ZVAL_UNDEF(&locale); + ZVAL_UNDEF(&search); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_12); + ZVAL_UNDEF(&_14); + ZVAL_UNDEF(&_2$$3); + ZVAL_UNDEF(&_3$$3); + ZVAL_UNDEF(&_4$$3); + ZVAL_UNDEF(&_5$$3); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_10$$8); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_15$$10); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 3, &text_param, &separator_param, &lowercase_param, &replace); - zephir_get_strval(text, text_param); + zephir_get_strval(&text, text_param); if (!separator_param) { - ZEPHIR_INIT_VAR(separator); - ZVAL_STRING(separator, "-", 1); + ZEPHIR_INIT_VAR(&separator); + ZVAL_STRING(&separator, "-"); } else { - zephir_get_strval(separator, separator_param); + zephir_get_strval(&separator, separator_param); } if (!lowercase_param) { lowercase = 1; @@ -2346,92 +2690,88 @@ PHP_METHOD(Phalcon_Tag, friendlyTitle) { lowercase = zephir_get_boolval(lowercase_param); } if (!replace) { - replace = ZEPHIR_GLOBAL(global_null); + replace = &replace_sub; + replace = &__$null; } - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "iconv", 0); - ZEPHIR_CALL_FUNCTION(&_1, "extension_loaded", NULL, 149, &_0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "iconv"); + ZEPHIR_CALL_FUNCTION(&_1, "extension_loaded", NULL, 129, &_0); zephir_check_call_status(); - if (zephir_is_true(_1)) { - ZEPHIR_SINIT_VAR(_2$$3); + if (zephir_is_true(&_1)) { ZVAL_LONG(&_2$$3, 6); - ZEPHIR_SINIT_VAR(_3$$3); - ZVAL_STRING(&_3$$3, "en_US.UTF-8", 0); - ZEPHIR_CALL_FUNCTION(&locale, "setlocale", NULL, 456, &_2$$3, &_3$$3); + ZEPHIR_INIT_VAR(&_3$$3); + ZVAL_STRING(&_3$$3, "en_US.UTF-8"); + ZEPHIR_CALL_FUNCTION(&locale, "setlocale", NULL, 409, &_2$$3, &_3$$3); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_2$$3); - ZVAL_STRING(&_2$$3, "UTF-8", 0); - ZEPHIR_SINIT_NVAR(_3$$3); - ZVAL_STRING(&_3$$3, "ASCII//TRANSLIT", 0); - ZEPHIR_CALL_FUNCTION(&_4$$3, "iconv", NULL, 410, &_2$$3, &_3$$3, text); + ZEPHIR_INIT_NVAR(&_3$$3); + ZVAL_STRING(&_3$$3, "UTF-8"); + ZEPHIR_INIT_VAR(&_4$$3); + ZVAL_STRING(&_4$$3, "ASCII//TRANSLIT"); + ZEPHIR_CALL_FUNCTION(&_5$$3, "iconv", NULL, 364, &_3$$3, &_4$$3, &text); zephir_check_call_status(); - zephir_get_strval(text, _4$$3); + zephir_get_strval(&text, &_5$$3); } if (zephir_is_true(replace)) { - _5$$4 = Z_TYPE_P(replace) != IS_ARRAY; - if (_5$$4) { - _5$$4 = Z_TYPE_P(replace) != IS_STRING; + _6$$4 = Z_TYPE_P(replace) != IS_ARRAY; + if (_6$$4) { + _6$$4 = Z_TYPE_P(replace) != IS_STRING; } - if (_5$$4) { + if (_6$$4) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Parameter replace must be an array or a string", "phalcon/tag.zep", 1497); return; } if (Z_TYPE_P(replace) == IS_ARRAY) { - zephir_is_iterable(replace, &_7$$6, &_6$$6, 0, 0, "phalcon/tag.zep", 1503); - for ( - ; zend_hash_get_current_data_ex(_7$$6, (void**) &_8$$6, &_6$$6) == SUCCESS - ; zend_hash_move_forward_ex(_7$$6, &_6$$6) - ) { - ZEPHIR_GET_HVALUE(search, _8$$6); - ZEPHIR_INIT_NVAR(_9$$7); - ZEPHIR_SINIT_NVAR(_10$$7); - ZVAL_STRING(&_10$$7, " ", 0); - zephir_fast_str_replace(&_9$$7, search, &_10$$7, text TSRMLS_CC); - zephir_get_strval(text, _9$$7); - } + zephir_is_iterable(replace, 0, "phalcon/tag.zep", 1503); + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(replace), _7$$6) + { + ZEPHIR_INIT_NVAR(&search); + ZVAL_COPY(&search, _7$$6); + ZEPHIR_INIT_NVAR(&_8$$7); + ZEPHIR_INIT_NVAR(&_9$$7); + ZVAL_STRING(&_9$$7, " "); + zephir_fast_str_replace(&_8$$7, &search, &_9$$7, &text TSRMLS_CC); + zephir_get_strval(&text, &_8$$7); + } ZEND_HASH_FOREACH_END(); + ZEPHIR_INIT_NVAR(&search); } else { - ZEPHIR_INIT_VAR(_11$$8); - ZEPHIR_SINIT_VAR(_12$$8); - ZVAL_STRING(&_12$$8, " ", 0); - zephir_fast_str_replace(&_11$$8, replace, &_12$$8, text TSRMLS_CC); - zephir_get_strval(text, _11$$8); + ZEPHIR_INIT_VAR(&_10$$8); + ZEPHIR_INIT_VAR(&_11$$8); + ZVAL_STRING(&_11$$8, " "); + zephir_fast_str_replace(&_10$$8, replace, &_11$$8, &text TSRMLS_CC); + zephir_get_strval(&text, &_10$$8); } } - ZEPHIR_INIT_VAR(_13); - ZVAL_STRING(_13, "/[^a-zA-Z0-9\\/_|+ -]/", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_INIT_VAR(_14); - ZVAL_STRING(_14, "", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&friendly, "preg_replace", NULL, 42, _13, _14, text); - zephir_check_temp_parameter(_13); - zephir_check_temp_parameter(_14); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "/[^a-zA-Z0-9\\/_|+ -]/"); + ZEPHIR_INIT_VAR(&_12); + ZVAL_STRING(&_12, ""); + ZEPHIR_CALL_FUNCTION(&friendly, "preg_replace", NULL, 35, &_0, &_12, &text); zephir_check_call_status(); if (lowercase) { - ZEPHIR_INIT_VAR(_15$$9); - zephir_fast_strtolower(_15$$9, friendly); - ZEPHIR_CPY_WRT(friendly, _15$$9); - } - ZEPHIR_INIT_NVAR(_13); - ZVAL_STRING(_13, "/[\\/_|+ -]+/", ZEPHIR_TEMP_PARAM_COPY); - ZEPHIR_CALL_FUNCTION(&_16, "preg_replace", NULL, 42, _13, separator, friendly); - zephir_check_temp_parameter(_13); + ZEPHIR_INIT_VAR(&_13$$9); + zephir_fast_strtolower(&_13$$9, &friendly); + ZEPHIR_CPY_WRT(&friendly, &_13$$9); + } + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "/[\\/_|+ -]+/"); + ZEPHIR_CALL_FUNCTION(&_14, "preg_replace", NULL, 35, &_0, &separator, &friendly); zephir_check_call_status(); - ZEPHIR_CPY_WRT(friendly, _16); - ZEPHIR_INIT_NVAR(_13); - zephir_fast_trim(_13, friendly, separator, ZEPHIR_TRIM_BOTH TSRMLS_CC); - ZEPHIR_CPY_WRT(friendly, _13); - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "iconv", 0); - ZEPHIR_CALL_FUNCTION(&_16, "extension_loaded", NULL, 149, &_0); + ZEPHIR_CPY_WRT(&friendly, &_14); + ZEPHIR_INIT_NVAR(&_0); + zephir_fast_trim(&_0, &friendly, &separator, ZEPHIR_TRIM_BOTH TSRMLS_CC); + ZEPHIR_CPY_WRT(&friendly, &_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "iconv"); + ZEPHIR_CALL_FUNCTION(&_14, "extension_loaded", NULL, 129, &_0); zephir_check_call_status(); - if (zephir_is_true(_16)) { - ZEPHIR_SINIT_VAR(_17$$10); - ZVAL_LONG(&_17$$10, 6); - ZEPHIR_CALL_FUNCTION(NULL, "setlocale", NULL, 456, &_17$$10, locale); + if (zephir_is_true(&_14)) { + ZVAL_LONG(&_15$$10, 6); + ZEPHIR_CALL_FUNCTION(NULL, "setlocale", NULL, 409, &_15$$10, &locale); zephir_check_call_status(); } - RETURN_CCTOR(friendly); + RETURN_CCTOR(&friendly); } @@ -2441,8 +2781,12 @@ PHP_METHOD(Phalcon_Tag, friendlyTitle) { PHP_METHOD(Phalcon_Tag, setDocType) { zend_bool _0; - zval *doctype_param = NULL, *_1$$3, *_2$$4; + zval *doctype_param = NULL, _1$$3, _2$$4; zend_long doctype; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); zephir_fetch_params(0, 1, 0, &doctype_param); @@ -2455,12 +2799,12 @@ PHP_METHOD(Phalcon_Tag, setDocType) { } if (_0) { ZEPHIR_INIT_ZVAL_NREF(_1$$3); - ZVAL_LONG(_1$$3, 5); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentType"), &_1$$3 TSRMLS_CC); + ZVAL_LONG(&_1$$3, 5); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentType"), &_1$$3); } else { ZEPHIR_INIT_ZVAL_NREF(_2$$4); - ZVAL_LONG(_2$$4, doctype); - zephir_update_static_property_ce(phalcon_tag_ce, SL("_documentType"), &_2$$4 TSRMLS_CC); + ZVAL_LONG(&_2$$4, doctype); + zend_update_static_property(phalcon_tag_ce, ZEND_STRL("_documentType"), &_2$$4); } } @@ -2470,91 +2814,112 @@ PHP_METHOD(Phalcon_Tag, setDocType) { */ PHP_METHOD(Phalcon_Tag, getDocType) { - zval *_0, *_1$$3, *_2$$4, *_3$$4, *_4$$5, *_5$$5, *_6$$6, *_7$$6, *_8$$7, *_9$$7, *_10$$8, *_11$$8, *_12$$9, *_13$$9, *_14$$10, *_15$$10, *_16$$11, *_17$$11, *_18$$12; + zval _0, _1$$3, _2$$4, _3$$4, _4$$5, _5$$5, _6$$6, _7$$6, _8$$7, _9$$7, _10$$8, _11$$8, _12$$9, _13$$9, _14$$10, _15$$10, _16$$11, _17$$11, _18$$12; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1$$3); + ZVAL_UNDEF(&_2$$4); + ZVAL_UNDEF(&_3$$4); + ZVAL_UNDEF(&_4$$5); + ZVAL_UNDEF(&_5$$5); + ZVAL_UNDEF(&_6$$6); + ZVAL_UNDEF(&_7$$6); + ZVAL_UNDEF(&_8$$7); + ZVAL_UNDEF(&_9$$7); + ZVAL_UNDEF(&_10$$8); + ZVAL_UNDEF(&_11$$8); + ZVAL_UNDEF(&_12$$9); + ZVAL_UNDEF(&_13$$9); + ZVAL_UNDEF(&_14$$10); + ZVAL_UNDEF(&_15$$10); + ZVAL_UNDEF(&_16$$11); + ZVAL_UNDEF(&_17$$11); + ZVAL_UNDEF(&_18$$12); ZEPHIR_MM_GROW(); - _0 = zephir_fetch_static_property_ce(phalcon_tag_ce, SL("_documentType") TSRMLS_CC); + zephir_read_static_property_ce(&_0, phalcon_tag_ce, SL("_documentType"), PH_NOISY_CC | PH_READONLY); do { - if (ZEPHIR_IS_LONG(_0, 1)) { - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_GET_CONSTANT(_1$$3, "PHP_EOL"); - ZEPHIR_CONCAT_SV(return_value, "", _1$$3); + if (ZEPHIR_IS_LONG(&_0, 1)) { + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_GET_CONSTANT(&_1$$3, "PHP_EOL"); + ZEPHIR_CONCAT_SV(return_value, "", &_1$$3); RETURN_MM(); } - if (ZEPHIR_IS_LONG(_0, 2)) { - ZEPHIR_INIT_VAR(_2$$4); - ZEPHIR_GET_CONSTANT(_2$$4, "PHP_EOL"); - ZEPHIR_INIT_VAR(_3$$4); - ZEPHIR_GET_CONSTANT(_3$$4, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", _3$$4); + if (ZEPHIR_IS_LONG(&_0, 2)) { + ZEPHIR_INIT_VAR(&_2$$4); + ZEPHIR_GET_CONSTANT(&_2$$4, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_3$$4); + ZEPHIR_GET_CONSTANT(&_3$$4, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &_3$$4); RETURN_MM(); } - if (ZEPHIR_IS_LONG(_0, 3)) { - ZEPHIR_INIT_VAR(_4$$5); - ZEPHIR_GET_CONSTANT(_4$$5, "PHP_EOL"); - ZEPHIR_INIT_VAR(_5$$5); - ZEPHIR_GET_CONSTANT(_5$$5, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", _5$$5); + if (ZEPHIR_IS_LONG(&_0, 3)) { + ZEPHIR_INIT_VAR(&_4$$5); + ZEPHIR_GET_CONSTANT(&_4$$5, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_5$$5); + ZEPHIR_GET_CONSTANT(&_5$$5, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &_5$$5); RETURN_MM(); } - if (ZEPHIR_IS_LONG(_0, 4)) { - ZEPHIR_INIT_VAR(_6$$6); - ZEPHIR_GET_CONSTANT(_6$$6, "PHP_EOL"); - ZEPHIR_INIT_VAR(_7$$6); - ZEPHIR_GET_CONSTANT(_7$$6, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", _7$$6); + if (ZEPHIR_IS_LONG(&_0, 4)) { + ZEPHIR_INIT_VAR(&_6$$6); + ZEPHIR_GET_CONSTANT(&_6$$6, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_7$$6); + ZEPHIR_GET_CONSTANT(&_7$$6, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &_7$$6); RETURN_MM(); } - if (ZEPHIR_IS_LONG(_0, 6)) { - ZEPHIR_INIT_VAR(_8$$7); - ZEPHIR_GET_CONSTANT(_8$$7, "PHP_EOL"); - ZEPHIR_INIT_VAR(_9$$7); - ZEPHIR_GET_CONSTANT(_9$$7, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", _9$$7); + if (ZEPHIR_IS_LONG(&_0, 6)) { + ZEPHIR_INIT_VAR(&_8$$7); + ZEPHIR_GET_CONSTANT(&_8$$7, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_9$$7); + ZEPHIR_GET_CONSTANT(&_9$$7, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &_9$$7); RETURN_MM(); } - if (ZEPHIR_IS_LONG(_0, 7)) { - ZEPHIR_INIT_VAR(_10$$8); - ZEPHIR_GET_CONSTANT(_10$$8, "PHP_EOL"); - ZEPHIR_INIT_VAR(_11$$8); - ZEPHIR_GET_CONSTANT(_11$$8, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", _11$$8); + if (ZEPHIR_IS_LONG(&_0, 7)) { + ZEPHIR_INIT_VAR(&_10$$8); + ZEPHIR_GET_CONSTANT(&_10$$8, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_11$$8); + ZEPHIR_GET_CONSTANT(&_11$$8, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &_11$$8); RETURN_MM(); } - if (ZEPHIR_IS_LONG(_0, 8)) { - ZEPHIR_INIT_VAR(_12$$9); - ZEPHIR_GET_CONSTANT(_12$$9, "PHP_EOL"); - ZEPHIR_INIT_VAR(_13$$9); - ZEPHIR_GET_CONSTANT(_13$$9, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", _13$$9); + if (ZEPHIR_IS_LONG(&_0, 8)) { + ZEPHIR_INIT_VAR(&_12$$9); + ZEPHIR_GET_CONSTANT(&_12$$9, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_13$$9); + ZEPHIR_GET_CONSTANT(&_13$$9, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &_13$$9); RETURN_MM(); } - if (ZEPHIR_IS_LONG(_0, 9)) { - ZEPHIR_INIT_VAR(_14$$10); - ZEPHIR_GET_CONSTANT(_14$$10, "PHP_EOL"); - ZEPHIR_INIT_VAR(_15$$10); - ZEPHIR_GET_CONSTANT(_15$$10, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", _15$$10); + if (ZEPHIR_IS_LONG(&_0, 9)) { + ZEPHIR_INIT_VAR(&_14$$10); + ZEPHIR_GET_CONSTANT(&_14$$10, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_15$$10); + ZEPHIR_GET_CONSTANT(&_15$$10, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &_15$$10); RETURN_MM(); } - if (ZEPHIR_IS_LONG(_0, 10)) { - ZEPHIR_INIT_VAR(_16$$11); - ZEPHIR_GET_CONSTANT(_16$$11, "PHP_EOL"); - ZEPHIR_INIT_VAR(_17$$11); - ZEPHIR_GET_CONSTANT(_17$$11, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", _17$$11); + if (ZEPHIR_IS_LONG(&_0, 10)) { + ZEPHIR_INIT_VAR(&_16$$11); + ZEPHIR_GET_CONSTANT(&_16$$11, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_17$$11); + ZEPHIR_GET_CONSTANT(&_17$$11, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &_17$$11); RETURN_MM(); } - if (ZEPHIR_IS_LONG(_0, 5) || ZEPHIR_IS_LONG(_0, 11)) { - ZEPHIR_INIT_VAR(_18$$12); - ZEPHIR_GET_CONSTANT(_18$$12, "PHP_EOL"); - ZEPHIR_CONCAT_SV(return_value, "", _18$$12); + if (ZEPHIR_IS_LONG(&_0, 5) || ZEPHIR_IS_LONG(&_0, 11)) { + ZEPHIR_INIT_VAR(&_18$$12); + ZEPHIR_GET_CONSTANT(&_18$$12, "PHP_EOL"); + ZEPHIR_CONCAT_SV(return_value, "", &_18$$12); RETURN_MM(); } } while(0); - RETURN_MM_STRING("", 1); + RETURN_MM_STRING(""); } @@ -2565,15 +2930,27 @@ PHP_METHOD(Phalcon_Tag, tagHtml) { zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool selfClose, onlyStart, useEol; - zval *tagName_param = NULL, *parameters = NULL, *selfClose_param = NULL, *onlyStart_param = NULL, *useEol_param = NULL, *params = NULL, *localCode = NULL, *_1, *_3$$11; - zval *tagName = NULL, *_0, *_2$$10; + zval *tagName_param = NULL, *parameters = NULL, parameters_sub, *selfClose_param = NULL, *onlyStart_param = NULL, *useEol_param = NULL, __$null, params, localCode, _1, _3$$11; + zval tagName, _0, _2$$10; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tagName); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_2$$10); + ZVAL_UNDEF(¶meters_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&localCode); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_3$$11); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 4, &tagName_param, ¶meters, &selfClose_param, &onlyStart_param, &useEol_param); - zephir_get_strval(tagName, tagName_param); + zephir_get_strval(&tagName, tagName_param); if (!parameters) { - parameters = ZEPHIR_GLOBAL(global_null); + parameters = ¶meters_sub; + parameters = &__$null; } if (!selfClose_param) { selfClose = 0; @@ -2593,18 +2970,18 @@ PHP_METHOD(Phalcon_Tag, tagHtml) { if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - zephir_create_array(params, 1, 0 TSRMLS_CC); - zephir_array_fast_append(params, parameters); + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 1, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, parameters); } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_INIT_VAR(_0); - ZEPHIR_CONCAT_SV(_0, "<", tagName); - ZEPHIR_CALL_SELF(&localCode, "renderattributes", NULL, 0, _0, params); + ZEPHIR_INIT_VAR(&_0); + ZEPHIR_CONCAT_SV(&_0, "<", &tagName); + ZEPHIR_CALL_SELF(&localCode, "renderattributes", NULL, 0, &_0, ¶ms); zephir_check_call_status(); - _1 = zephir_fetch_static_property_ce(phalcon_tag_ce, SL("_documentType") TSRMLS_CC); - if (ZEPHIR_GT_LONG(_1, 5)) { + zephir_read_static_property_ce(&_1, phalcon_tag_ce, SL("_documentType"), PH_NOISY_CC | PH_READONLY); + if (ZEPHIR_GT_LONG(&_1, 5)) { if (selfClose) { zephir_concat_self_str(&localCode, SL(" />") TSRMLS_CC); } else { @@ -2614,17 +2991,17 @@ PHP_METHOD(Phalcon_Tag, tagHtml) { if (onlyStart) { zephir_concat_self_str(&localCode, SL(">") TSRMLS_CC); } else { - ZEPHIR_INIT_VAR(_2$$10); - ZEPHIR_CONCAT_SVS(_2$$10, ">"); - zephir_concat_self(&localCode, _2$$10 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_2$$10); + ZEPHIR_CONCAT_SVS(&_2$$10, ">"); + zephir_concat_self(&localCode, &_2$$10 TSRMLS_CC); } } if (useEol) { - ZEPHIR_INIT_VAR(_3$$11); - ZEPHIR_GET_CONSTANT(_3$$11, "PHP_EOL"); - zephir_concat_self(&localCode, _3$$11 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_3$$11); + ZEPHIR_GET_CONSTANT(&_3$$11, "PHP_EOL"); + zephir_concat_self(&localCode, &_3$$11 TSRMLS_CC); } - RETURN_CCTOR(localCode); + RETURN_CCTOR(&localCode); } @@ -2638,13 +3015,17 @@ PHP_METHOD(Phalcon_Tag, tagHtml) { PHP_METHOD(Phalcon_Tag, tagHtmlClose) { zend_bool useEol; - zval *tagName_param = NULL, *useEol_param = NULL, *_0$$3; - zval *tagName = NULL; + zval *tagName_param = NULL, *useEol_param = NULL, _0$$3; + zval tagName; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&tagName); + ZVAL_UNDEF(&_0$$3); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, &tagName_param, &useEol_param); - zephir_get_strval(tagName, tagName_param); + zephir_get_strval(&tagName, tagName_param); if (!useEol_param) { useEol = 0; } else { @@ -2653,12 +3034,12 @@ PHP_METHOD(Phalcon_Tag, tagHtmlClose) { if (useEol) { - ZEPHIR_INIT_VAR(_0$$3); - ZEPHIR_GET_CONSTANT(_0$$3, "PHP_EOL"); - ZEPHIR_CONCAT_SVSV(return_value, "", _0$$3); + ZEPHIR_INIT_VAR(&_0$$3); + ZEPHIR_GET_CONSTANT(&_0$$3, "PHP_EOL"); + ZEPHIR_CONCAT_SVSV(return_value, "", &_0$$3); RETURN_MM(); } - ZEPHIR_CONCAT_SVS(return_value, ""); + ZEPHIR_CONCAT_SVS(return_value, ""); RETURN_MM(); } diff --git a/ext/phalcon/tag.zep.h b/ext/phalcon/tag.zep.h index c03b42ca39f..62a9da7fc3f 100644 --- a/ext/phalcon/tag.zep.h +++ b/ext/phalcon/tag.zep.h @@ -64,8 +64,16 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_getescaper, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, params, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_renderattributes, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_renderattributes, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_renderattributes, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, code, IS_STRING, 0) +#else ZEND_ARG_INFO(0, code) +#endif ZEND_ARG_ARRAY_INFO(0, attributes, 0) ZEND_END_ARG_INFO() @@ -73,18 +81,51 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_setdi, 0, 0, 1) ZEND_ARG_OBJ_INFO(0, dependencyInjector, Phalcon\\DiInterface, 0) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_tag_getdi, 0, 0, Phalcon\\DiInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_getdi, 0, 0, IS_OBJECT, "Phalcon\\DiInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_tag_geturlservice, 0, 0, Phalcon\\Mvc\\UrlInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_geturlservice, 0, 0, IS_OBJECT, "Phalcon\\Mvc\\UrlInterface", 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_phalcon_tag_getescaperservice, 0, 0, Phalcon\\EscaperInterface, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_getescaperservice, 0, 0, IS_OBJECT, "Phalcon\\EscaperInterface", 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_setautoescape, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, autoescape, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, autoescape) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_setdefault, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) +#else ZEND_ARG_INFO(0, id) +#endif ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_setdefaults, 0, 0, 1) ZEND_ARG_ARRAY_INFO(0, values, 0) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, merge, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, merge) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_displayto, 0, 0, 2) @@ -92,7 +133,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_displayto, 0, 0, 2) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_hasvalue, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_hasvalue, 0, 1, _IS_BOOL, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_hasvalue, 0, 1, _IS_BOOL, NULL, 0) +#endif ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() @@ -101,131 +146,270 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_getvalue, 0, 0, 1) ZEND_ARG_INFO(0, params) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_linkto, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_linkto, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_linkto, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_ARG_INFO(0, text) ZEND_ARG_INFO(0, local) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag__inputfield, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag__inputfield, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag__inputfield, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_INFO(0, parameters) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, asValue, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, asValue) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag__inputfieldchecked, 0, 0, 2) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag__inputfieldchecked, 0, 2, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag__inputfieldchecked, 0, 2, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0) +#else ZEND_ARG_INFO(0, type) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_colorfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_colorfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_colorfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_textfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_textfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_textfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_numericfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_numericfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_numericfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_rangefield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_rangefield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_rangefield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_emailfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_emailfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_emailfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_datefield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_datefield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_datefield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_datetimefield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_datetimefield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_datetimefield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_datetimelocalfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_datetimelocalfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_datetimelocalfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_monthfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_monthfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_monthfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_timefield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_timefield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_timefield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_weekfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_weekfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_weekfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_passwordfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_passwordfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_passwordfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_hiddenfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_hiddenfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_hiddenfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_filefield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_filefield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_filefield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_searchfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_searchfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_searchfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_telfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_telfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_telfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_urlfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_urlfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_urlfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_checkfield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_checkfield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_checkfield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_radiofield, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_radiofield, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_radiofield, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_imageinput, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_imageinput, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_imageinput, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_submitbutton, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_submitbutton, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_submitbutton, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_selectstatic, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_selectstatic, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_selectstatic, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_select, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_select, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_select, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_textarea, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_textarea, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_textarea, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_form, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_form, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_form, 0, 1, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) ZEND_END_ARG_INFO() +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_endform, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_endform, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_settitle, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, title, IS_STRING, 0) +#else ZEND_ARG_INFO(0, title) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_settitleseparator, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, titleSeparator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, titleSeparator) +#endif ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_appendtitle, 0, 0, 1) @@ -236,56 +420,154 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_prependtitle, 0, 0, 1) ZEND_ARG_INFO(0, title) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_gettitle, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_gettitle, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_gettitle, 0, 0, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tags, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, tags) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_gettitleseparator, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_gettitleseparator, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_stylesheetlink, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_stylesheetlink, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_stylesheetlink, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, local, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, local) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_javascriptinclude, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_javascriptinclude, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_javascriptinclude, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, local, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, local) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_image, 0, 0, 0) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_image, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_image, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_ARG_INFO(0, parameters) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, local, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, local) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_friendlytitle, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_friendlytitle, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_friendlytitle, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, text, IS_STRING, 0) +#else ZEND_ARG_INFO(0, text) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, separator, IS_STRING, 0) +#else ZEND_ARG_INFO(0, separator) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, lowercase, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, lowercase) +#endif ZEND_ARG_INFO(0, replace) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_setdoctype, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, doctype, IS_LONG, 0) +#else ZEND_ARG_INFO(0, doctype) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_getdoctype, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_getdoctype, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_taghtml, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_taghtml, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_taghtml, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tagName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tagName) +#endif ZEND_ARG_INFO(0, parameters) +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, selfClose, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, selfClose) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, onlyStart, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, onlyStart) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useEol, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useEol) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_tag_taghtmlclose, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_taghtmlclose, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_tag_taghtmlclose, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, tagName, IS_STRING, 0) +#else ZEND_ARG_INFO(0, tagName) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, useEol, _IS_BOOL, 0) +#else ZEND_ARG_INFO(0, useEol) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_tag_method_entry) { PHP_ME(Phalcon_Tag, getEscaper, arginfo_phalcon_tag_getescaper, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, renderAttributes, arginfo_phalcon_tag_renderattributes, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, setDI, arginfo_phalcon_tag_setdi, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Tag, getDI, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Tag, getUrlService, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Tag, getEscaperService, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Tag, getDI, arginfo_phalcon_tag_getdi, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Tag, getUrlService, arginfo_phalcon_tag_geturlservice, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Tag, getEscaperService, arginfo_phalcon_tag_getescaperservice, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, setAutoescape, arginfo_phalcon_tag_setautoescape, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, setDefault, arginfo_phalcon_tag_setdefault, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, setDefaults, arginfo_phalcon_tag_setdefaults, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) @@ -321,19 +603,19 @@ ZEPHIR_INIT_FUNCS(phalcon_tag_method_entry) { PHP_ME(Phalcon_Tag, select, arginfo_phalcon_tag_select, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, textArea, arginfo_phalcon_tag_textarea, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, form, arginfo_phalcon_tag_form, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Tag, endForm, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Tag, endForm, arginfo_phalcon_tag_endform, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, setTitle, arginfo_phalcon_tag_settitle, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, setTitleSeparator, arginfo_phalcon_tag_settitleseparator, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, appendTitle, arginfo_phalcon_tag_appendtitle, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, prependTitle, arginfo_phalcon_tag_prependtitle, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, getTitle, arginfo_phalcon_tag_gettitle, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Tag, getTitleSeparator, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Tag, getTitleSeparator, arginfo_phalcon_tag_gettitleseparator, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, stylesheetLink, arginfo_phalcon_tag_stylesheetlink, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, javascriptInclude, arginfo_phalcon_tag_javascriptinclude, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, image, arginfo_phalcon_tag_image, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, friendlyTitle, arginfo_phalcon_tag_friendlytitle, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, setDocType, arginfo_phalcon_tag_setdoctype, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Tag, getDocType, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Tag, getDocType, arginfo_phalcon_tag_getdoctype, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, tagHtml, arginfo_phalcon_tag_taghtml, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Tag, tagHtmlClose, arginfo_phalcon_tag_taghtmlclose, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END diff --git a/ext/phalcon/tag/select.zep.c b/ext/phalcon/tag/select.zep.c index a698905824b..5efdeefd7a3 100644 --- a/ext/phalcon/tag/select.zep.c +++ b/ext/phalcon/tag/select.zep.c @@ -47,80 +47,107 @@ PHP_METHOD(Phalcon_Tag_Select, selectField) { zend_bool _2$$21; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL, *_4 = NULL, *_9 = NULL, *_13 = NULL; - zval *parameters, *data = NULL, *params = NULL, *name = NULL, *id = NULL, *value = NULL, *useEmpty = NULL, *code = NULL, *emptyValue = NULL, *emptyText = NULL, *options = NULL, *using = NULL, *_3 = NULL, *_5 = NULL, *_0$$5, *_6$$23, *_7$$23, *_8$$24 = NULL, *_10$$24, *_11$$24, *_12$$26 = NULL, *_14$$26, *_15$$26; + zval *parameters, parameters_sub, *data = NULL, data_sub, __$null, params, name, id, value, useEmpty, code, emptyValue, emptyText, options, using, _3, _5, _0$$5, _6$$23, _7$$23, _8$$24, _10$$24, _11$$24, _12$$26, _14$$26, _15$$26; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(¶meters_sub); + ZVAL_UNDEF(&data_sub); + ZVAL_NULL(&__$null); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&name); + ZVAL_UNDEF(&id); + ZVAL_UNDEF(&value); + ZVAL_UNDEF(&useEmpty); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(&emptyValue); + ZVAL_UNDEF(&emptyText); + ZVAL_UNDEF(&options); + ZVAL_UNDEF(&using); + ZVAL_UNDEF(&_3); + ZVAL_UNDEF(&_5); + ZVAL_UNDEF(&_0$$5); + ZVAL_UNDEF(&_6$$23); + ZVAL_UNDEF(&_7$$23); + ZVAL_UNDEF(&_8$$24); + ZVAL_UNDEF(&_10$$24); + ZVAL_UNDEF(&_11$$24); + ZVAL_UNDEF(&_12$$26); + ZVAL_UNDEF(&_14$$26); + ZVAL_UNDEF(&_15$$26); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 1, ¶meters, &data); if (!data) { - data = ZEPHIR_GLOBAL(global_null); + data = &data_sub; + data = &__$null; } if (Z_TYPE_P(parameters) != IS_ARRAY) { - ZEPHIR_INIT_VAR(params); - zephir_create_array(params, 2, 0 TSRMLS_CC); - zephir_array_fast_append(params, parameters); - zephir_array_fast_append(params, data); + ZEPHIR_INIT_VAR(¶ms); + zephir_create_array(¶ms, 2, 0 TSRMLS_CC); + zephir_array_fast_append(¶ms, parameters); + zephir_array_fast_append(¶ms, data); } else { - ZEPHIR_CPY_WRT(params, parameters); + ZEPHIR_CPY_WRT(¶ms, parameters); } - ZEPHIR_OBS_VAR(id); - if (!(zephir_array_isset_long_fetch(&id, params, 0, 0 TSRMLS_CC))) { - zephir_array_fetch_string(&_0$$5, params, SL("id"), PH_NOISY | PH_READONLY, "phalcon/tag/select.zep", 52 TSRMLS_CC); + ZEPHIR_OBS_VAR(&id); + if (!(zephir_array_isset_long_fetch(&id, ¶ms, 0, 0 TSRMLS_CC))) { + zephir_array_fetch_string(&_0$$5, ¶ms, SL("id"), PH_NOISY | PH_READONLY, "phalcon/tag/select.zep", 52 TSRMLS_CC); zephir_array_update_long(¶ms, 0, &_0$$5, PH_COPY | PH_SEPARATE ZEPHIR_DEBUG_PARAMS_DUMMY); } - if (!(zephir_memnstr_str(id, SL("["), "phalcon/tag/select.zep", 58))) { - if (!(zephir_array_isset_string(params, SS("id")))) { + if (!(zephir_memnstr_str(&id, SL("["), "phalcon/tag/select.zep", 58))) { + if (!(zephir_array_isset_string(¶ms, SL("id")))) { zephir_array_update_string(¶ms, SL("id"), &id, PH_COPY | PH_SEPARATE); } } - ZEPHIR_OBS_VAR(name); - if (!(zephir_array_isset_string_fetch(&name, params, SS("name"), 0 TSRMLS_CC))) { + ZEPHIR_OBS_VAR(&name); + if (!(zephir_array_isset_string_fetch(&name, ¶ms, SL("name"), 0))) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } else { - if (!(zephir_is_true(name))) { + if (!(zephir_is_true(&name))) { zephir_array_update_string(¶ms, SL("name"), &id, PH_COPY | PH_SEPARATE); } } - ZEPHIR_OBS_VAR(value); - if (!(zephir_array_isset_string_fetch(&value, params, SS("value"), 0 TSRMLS_CC))) { - ZEPHIR_CALL_CE_STATIC(&value, phalcon_tag_ce, "getvalue", &_1, 6, id, params); + ZEPHIR_OBS_VAR(&value); + if (!(zephir_array_isset_string_fetch(&value, ¶ms, SL("value"), 0))) { + ZEPHIR_CALL_CE_STATIC(&value, phalcon_tag_ce, "getvalue", &_1, 0, &id, ¶ms); zephir_check_call_status(); } else { - zephir_array_unset_string(¶ms, SS("value"), PH_SEPARATE); + zephir_array_unset_string(¶ms, SL("value"), PH_SEPARATE); } - ZEPHIR_OBS_VAR(useEmpty); - if (zephir_array_isset_string_fetch(&useEmpty, params, SS("useEmpty"), 0 TSRMLS_CC)) { - ZEPHIR_OBS_VAR(emptyValue); - if (!(zephir_array_isset_string_fetch(&emptyValue, params, SS("emptyValue"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(emptyValue); - ZVAL_STRING(emptyValue, "", 1); + ZEPHIR_OBS_VAR(&useEmpty); + if (zephir_array_isset_string_fetch(&useEmpty, ¶ms, SL("useEmpty"), 0)) { + ZEPHIR_OBS_VAR(&emptyValue); + if (!(zephir_array_isset_string_fetch(&emptyValue, ¶ms, SL("emptyValue"), 0))) { + ZEPHIR_INIT_NVAR(&emptyValue); + ZVAL_STRING(&emptyValue, ""); } else { - zephir_array_unset_string(¶ms, SS("emptyValue"), PH_SEPARATE); + zephir_array_unset_string(¶ms, SL("emptyValue"), PH_SEPARATE); } - ZEPHIR_OBS_VAR(emptyText); - if (!(zephir_array_isset_string_fetch(&emptyText, params, SS("emptyText"), 0 TSRMLS_CC))) { - ZEPHIR_INIT_NVAR(emptyText); - ZVAL_STRING(emptyText, "Choose...", 1); + ZEPHIR_OBS_VAR(&emptyText); + if (!(zephir_array_isset_string_fetch(&emptyText, ¶ms, SL("emptyText"), 0))) { + ZEPHIR_INIT_NVAR(&emptyText); + ZVAL_STRING(&emptyText, "Choose..."); } else { - zephir_array_unset_string(¶ms, SS("emptyText"), PH_SEPARATE); + zephir_array_unset_string(¶ms, SL("emptyText"), PH_SEPARATE); } - zephir_array_unset_string(¶ms, SS("useEmpty"), PH_SEPARATE); + zephir_array_unset_string(¶ms, SL("useEmpty"), PH_SEPARATE); } - ZEPHIR_OBS_VAR(options); - if (!(zephir_array_isset_long_fetch(&options, params, 1, 0 TSRMLS_CC))) { - ZEPHIR_CPY_WRT(options, data); + ZEPHIR_OBS_VAR(&options); + if (!(zephir_array_isset_long_fetch(&options, ¶ms, 1, 0 TSRMLS_CC))) { + ZEPHIR_CPY_WRT(&options, data); } - if (Z_TYPE_P(options) == IS_OBJECT) { - ZEPHIR_OBS_VAR(using); - if (!(zephir_array_isset_string_fetch(&using, params, SS("using"), 0 TSRMLS_CC))) { + if (Z_TYPE_P(&options) == IS_OBJECT) { + ZEPHIR_OBS_VAR(&using); + if (!(zephir_array_isset_string_fetch(&using, ¶ms, SL("using"), 0))) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "The 'using' parameter is required", "phalcon/tag/select.zep", 105); return; } else { - _2$$21 = Z_TYPE_P(using) != IS_ARRAY; + _2$$21 = Z_TYPE_P(&using) != IS_ARRAY; if (_2$$21) { - _2$$21 = Z_TYPE_P(using) != IS_OBJECT; + _2$$21 = Z_TYPE_P(&using) != IS_OBJECT; } if (_2$$21) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "The 'using' parameter should be an array", "phalcon/tag/select.zep", 108); @@ -128,47 +155,46 @@ PHP_METHOD(Phalcon_Tag_Select, selectField) { } } } - zephir_array_unset_string(¶ms, SS("using"), PH_SEPARATE); - ZEPHIR_INIT_VAR(_5); - ZVAL_STRING(_5, "", _5); - if (zephir_is_true(useEmpty)) { - ZEPHIR_INIT_VAR(_6$$23); - ZEPHIR_GET_CONSTANT(_6$$23, "PHP_EOL"); - ZEPHIR_INIT_VAR(_7$$23); - ZEPHIR_CONCAT_SVSVSV(_7$$23, "\t", _6$$23); - zephir_concat_self(&code, _7$$23 TSRMLS_CC); + ZEPHIR_INIT_NVAR(&_5); + ZEPHIR_GET_CONSTANT(&_5, "PHP_EOL"); + ZEPHIR_INIT_VAR(&code); + ZEPHIR_CONCAT_VSV(&code, &_3, ">", &_5); + if (zephir_is_true(&useEmpty)) { + ZEPHIR_INIT_VAR(&_6$$23); + ZEPHIR_GET_CONSTANT(&_6$$23, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_7$$23); + ZEPHIR_CONCAT_SVSVSV(&_7$$23, "\t", &_6$$23); + zephir_concat_self(&code, &_7$$23 TSRMLS_CC); } - if (Z_TYPE_P(options) == IS_OBJECT) { - ZEPHIR_INIT_VAR(_10$$24); - ZEPHIR_GET_CONSTANT(_10$$24, "PHP_EOL"); - ZEPHIR_INIT_VAR(_11$$24); - ZEPHIR_CONCAT_SV(_11$$24, "", _10$$24); - ZEPHIR_CALL_SELF(&_8$$24, "_optionsfromresultset", &_9, 457, options, using, value, _11$$24); + if (Z_TYPE_P(&options) == IS_OBJECT) { + ZEPHIR_INIT_VAR(&_10$$24); + ZEPHIR_GET_CONSTANT(&_10$$24, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_11$$24); + ZEPHIR_CONCAT_SV(&_11$$24, "", &_10$$24); + ZEPHIR_CALL_SELF(&_8$$24, "_optionsfromresultset", &_9, 410, &options, &using, &value, &_11$$24); zephir_check_call_status(); - zephir_concat_self(&code, _8$$24 TSRMLS_CC); + zephir_concat_self(&code, &_8$$24 TSRMLS_CC); } else { - if (Z_TYPE_P(options) == IS_ARRAY) { - ZEPHIR_INIT_VAR(_14$$26); - ZEPHIR_GET_CONSTANT(_14$$26, "PHP_EOL"); - ZEPHIR_INIT_VAR(_15$$26); - ZEPHIR_CONCAT_SV(_15$$26, "", _14$$26); - ZEPHIR_CALL_SELF(&_12$$26, "_optionsfromarray", &_13, 458, options, value, _15$$26); + if (Z_TYPE_P(&options) == IS_ARRAY) { + ZEPHIR_INIT_VAR(&_14$$26); + ZEPHIR_GET_CONSTANT(&_14$$26, "PHP_EOL"); + ZEPHIR_INIT_VAR(&_15$$26); + ZEPHIR_CONCAT_SV(&_15$$26, "", &_14$$26); + ZEPHIR_CALL_SELF(&_12$$26, "_optionsfromarray", &_13, 411, &options, &value, &_15$$26); zephir_check_call_status(); - zephir_concat_self(&code, _12$$26 TSRMLS_CC); + zephir_concat_self(&code, &_12$$26 TSRMLS_CC); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Invalid data provided to SELECT helper", "phalcon/tag/select.zep", 139); return; } } zephir_concat_self_str(&code, SL("") TSRMLS_CC); - RETURN_CCTOR(code); + RETURN_CCTOR(&code); } @@ -182,113 +208,136 @@ PHP_METHOD(Phalcon_Tag_Select, selectField) { */ PHP_METHOD(Phalcon_Tag_Select, _optionsFromResultset) { - zval *_8$$16 = NULL, *_9$$16 = NULL; + zval _8$$16, _9$$16; zend_object_iterator *_2; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL, *_4 = NULL, *_5 = NULL; - zval *resultset, *using, *value, *closeOption, *code = NULL, *params = NULL, *option = NULL, *usingZero = NULL, *usingOne = NULL, *escaper = NULL, *optionValue = NULL, *optionText = NULL, *strValue = NULL, *strOptionValue = NULL, *_0 = NULL, *_3$$6 = NULL, *_6$$14 = NULL, *_7$$15 = NULL, *_10$$17 = NULL, *_11$$18 = NULL, *_12$$20 = NULL; + zval *resultset, resultset_sub, *using, using_sub, *value, value_sub, *closeOption, closeOption_sub, code, params, option, usingZero, usingOne, escaper, optionValue, optionText, strValue, strOptionValue, _0, _3$$6, _6$$14, _7$$15, _10$$17, _11$$18, _12$$20; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&resultset_sub); + ZVAL_UNDEF(&using_sub); + ZVAL_UNDEF(&value_sub); + ZVAL_UNDEF(&closeOption_sub); + ZVAL_UNDEF(&code); + ZVAL_UNDEF(¶ms); + ZVAL_UNDEF(&option); + ZVAL_UNDEF(&usingZero); + ZVAL_UNDEF(&usingOne); + ZVAL_UNDEF(&escaper); + ZVAL_UNDEF(&optionValue); + ZVAL_UNDEF(&optionText); + ZVAL_UNDEF(&strValue); + ZVAL_UNDEF(&strOptionValue); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_3$$6); + ZVAL_UNDEF(&_6$$14); + ZVAL_UNDEF(&_7$$15); + ZVAL_UNDEF(&_10$$17); + ZVAL_UNDEF(&_11$$18); + ZVAL_UNDEF(&_12$$20); + ZVAL_UNDEF(&_8$$16); + ZVAL_UNDEF(&_9$$16); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 4, 0, &resultset, &using, &value, &closeOption); - ZEPHIR_INIT_VAR(code); - ZVAL_STRING(code, "", 1); - ZEPHIR_INIT_VAR(params); - ZVAL_NULL(params); + ZEPHIR_INIT_VAR(&code); + ZVAL_STRING(&code, ""); + ZEPHIR_INIT_VAR(¶ms); + ZVAL_NULL(¶ms); if (Z_TYPE_P(using) == IS_ARRAY) { if (zephir_fast_count_int(using TSRMLS_CC) != 2) { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Parameter 'using' requires two values", "phalcon/tag/select.zep", 166); return; } - ZEPHIR_OBS_VAR(usingZero); + ZEPHIR_OBS_VAR(&usingZero); zephir_array_fetch_long(&usingZero, using, 0, PH_NOISY, "phalcon/tag/select.zep", 168 TSRMLS_CC); - ZEPHIR_OBS_VAR(usingOne); + ZEPHIR_OBS_VAR(&usingOne); zephir_array_fetch_long(&usingOne, using, 1, PH_NOISY, "phalcon/tag/select.zep", 168 TSRMLS_CC); } - ZEPHIR_CALL_CE_STATIC(&_0, phalcon_tag_ce, "getescaperservice", &_1, 459); + ZEPHIR_CALL_CE_STATIC(&_0, phalcon_tag_ce, "getescaperservice", &_1, 0); zephir_check_call_status(); - ZEPHIR_CPY_WRT(escaper, _0); + ZEPHIR_CPY_WRT(&escaper, &_0); _2 = zephir_get_iterator(resultset TSRMLS_CC); _2->funcs->rewind(_2 TSRMLS_CC); for (;_2->funcs->valid(_2 TSRMLS_CC) == SUCCESS && !EG(exception); _2->funcs->move_forward(_2 TSRMLS_CC)) { { - zval **ZEPHIR_TMP_ITERATOR_PTR; - _2->funcs->get_current_data(_2, &ZEPHIR_TMP_ITERATOR_PTR TSRMLS_CC); - ZEPHIR_CPY_WRT(option, (*ZEPHIR_TMP_ITERATOR_PTR)); + ZEPHIR_ITERATOR_COPY(&option, _2); } if (Z_TYPE_P(using) == IS_ARRAY) { - if (Z_TYPE_P(option) == IS_OBJECT) { - if ((zephir_method_exists_ex(option, SS("readattribute") TSRMLS_CC) == SUCCESS)) { - ZEPHIR_CALL_METHOD(&optionValue, option, "readattribute", NULL, 0, usingZero); + if (Z_TYPE_P(&option) == IS_OBJECT) { + if ((zephir_method_exists_ex(&option, SL("readattribute") TSRMLS_CC) == SUCCESS)) { + ZEPHIR_CALL_METHOD(&optionValue, &option, "readattribute", NULL, 0, &usingZero); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(&optionText, option, "readattribute", NULL, 0, usingOne); + ZEPHIR_CALL_METHOD(&optionText, &option, "readattribute", NULL, 0, &usingOne); zephir_check_call_status(); } else { - ZEPHIR_OBS_NVAR(optionValue); - zephir_read_property(&optionValue, option, SL("usingZero"), PH_NOISY_CC); - ZEPHIR_OBS_NVAR(optionText); - zephir_read_property(&optionText, option, SL("usingOne"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&optionValue); + zephir_read_property(&optionValue, &option, SL("usingZero"), PH_NOISY_CC); + ZEPHIR_OBS_NVAR(&optionText); + zephir_read_property(&optionText, &option, SL("usingOne"), PH_NOISY_CC); } } else { - if (Z_TYPE_P(option) == IS_ARRAY) { - ZEPHIR_OBS_NVAR(optionValue); - zephir_array_fetch(&optionValue, option, usingZero, PH_NOISY, "phalcon/tag/select.zep", 187 TSRMLS_CC); - ZEPHIR_OBS_NVAR(optionText); - zephir_array_fetch(&optionText, option, usingOne, PH_NOISY, "phalcon/tag/select.zep", 188 TSRMLS_CC); + if (Z_TYPE_P(&option) == IS_ARRAY) { + ZEPHIR_OBS_NVAR(&optionValue); + zephir_array_fetch(&optionValue, &option, &usingZero, PH_NOISY, "phalcon/tag/select.zep", 187 TSRMLS_CC); + ZEPHIR_OBS_NVAR(&optionText); + zephir_array_fetch(&optionText, &option, &usingOne, PH_NOISY, "phalcon/tag/select.zep", 188 TSRMLS_CC); } else { ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_tag_exception_ce, "Resultset returned an invalid value", "phalcon/tag/select.zep", 190); return; } } - ZEPHIR_CALL_METHOD(&_3$$6, escaper, "escapehtmlattr", &_4, 0, optionValue); + ZEPHIR_CALL_METHOD(&_3$$6, &escaper, "escapehtmlattr", &_4, 0, &optionValue); zephir_check_call_status(); - ZEPHIR_CPY_WRT(optionValue, _3$$6); - ZEPHIR_CALL_METHOD(&_3$$6, escaper, "escapehtml", &_5, 0, optionText); + ZEPHIR_CPY_WRT(&optionValue, &_3$$6); + ZEPHIR_CALL_METHOD(&_3$$6, &escaper, "escapehtml", &_5, 0, &optionText); zephir_check_call_status(); - ZEPHIR_CPY_WRT(optionText, _3$$6); + ZEPHIR_CPY_WRT(&optionText, &_3$$6); if (Z_TYPE_P(value) == IS_ARRAY) { - if (zephir_fast_in_array(optionValue, value TSRMLS_CC)) { + if (zephir_fast_in_array(&optionValue, value TSRMLS_CC)) { ZEPHIR_INIT_LNVAR(_6$$14); - ZEPHIR_CONCAT_SVSVV(_6$$14, "\t", _4$$4, _5$$4, "\t", _7$$4); - zephir_concat_self(&code, _8$$4 TSRMLS_CC); + ZEPHIR_CONCAT_SVSVVSV(&_8$$4, "\t", &_4$$4, &_5$$4, "\t", &_7$$4); + zephir_concat_self(&code, &_8$$4 TSRMLS_CC); continue; } if (Z_TYPE_P(value) == IS_ARRAY) { - if (zephir_fast_in_array(optionValue, value TSRMLS_CC)) { + if (zephir_fast_in_array(&optionValue, value TSRMLS_CC)) { ZEPHIR_INIT_LNVAR(_9$$6); - ZEPHIR_CONCAT_SVSVV(_9$$6, "\t
*/ - zend_declare_class_constant_long(phalcon_version_ce, SL("VERSION_MAJOR"), 0 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_version_ce, SL("VERSION_MAJOR"), 0); /** * The constant referencing the major version. Returns 1 @@ -49,7 +49,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Version) { * ); * */ - zend_declare_class_constant_long(phalcon_version_ce, SL("VERSION_MEDIUM"), 1 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_version_ce, SL("VERSION_MEDIUM"), 1); /** * The constant referencing the major version. Returns 2 @@ -60,7 +60,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Version) { * ); * */ - zend_declare_class_constant_long(phalcon_version_ce, SL("VERSION_MINOR"), 2 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_version_ce, SL("VERSION_MINOR"), 2); /** * The constant referencing the major version. Returns 3 @@ -71,7 +71,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Version) { * ); * */ - zend_declare_class_constant_long(phalcon_version_ce, SL("VERSION_SPECIAL"), 3 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_version_ce, SL("VERSION_SPECIAL"), 3); /** * The constant referencing the major version. Returns 4 @@ -82,7 +82,7 @@ ZEPHIR_INIT_CLASS(Phalcon_Version) { * ); * */ - zend_declare_class_constant_long(phalcon_version_ce, SL("VERSION_SPECIAL_NUMBER"), 4 TSRMLS_CC); + zephir_declare_class_constant_long(phalcon_version_ce, SL("VERSION_SPECIAL_NUMBER"), 4); return SUCCESS; @@ -100,26 +100,29 @@ ZEPHIR_INIT_CLASS(Phalcon_Version) { */ PHP_METHOD(Phalcon_Version, _getVersion) { - zval *_0 = NULL; + zval _0; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); zephir_create_array(return_value, 5, 0 TSRMLS_CC); - ZEPHIR_INIT_VAR(_0); - ZVAL_LONG(_0, 3); - zephir_array_fast_append(return_value, _0); - ZEPHIR_INIT_NVAR(_0); - ZVAL_LONG(_0, 4); - zephir_array_fast_append(return_value, _0); - ZEPHIR_INIT_NVAR(_0); - ZVAL_LONG(_0, 2); - zephir_array_fast_append(return_value, _0); - ZEPHIR_INIT_NVAR(_0); - ZVAL_LONG(_0, 4); - zephir_array_fast_append(return_value, _0); - ZEPHIR_INIT_NVAR(_0); - ZVAL_LONG(_0, 0); - zephir_array_fast_append(return_value, _0); + ZEPHIR_INIT_VAR(&_0); + ZVAL_LONG(&_0, 3); + zephir_array_fast_append(return_value, &_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, 4); + zephir_array_fast_append(return_value, &_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, 2); + zephir_array_fast_append(return_value, &_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, 4); + zephir_array_fast_append(return_value, &_0); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_LONG(&_0, 0); + zephir_array_fast_append(return_value, &_0); RETURN_MM(); } @@ -131,8 +134,11 @@ PHP_METHOD(Phalcon_Version, _getVersion) { */ PHP_METHOD(Phalcon_Version, _getSpecial) { - zval *special_param = NULL, *suffix = NULL; + zval *special_param = NULL, suffix; zend_long special; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&suffix); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &special_param); @@ -140,27 +146,27 @@ PHP_METHOD(Phalcon_Version, _getSpecial) { special = zephir_get_intval(special_param); - ZEPHIR_INIT_VAR(suffix); - ZVAL_STRING(suffix, "", 1); + ZEPHIR_INIT_VAR(&suffix); + ZVAL_STRING(&suffix, ""); do { if (special == 1) { - ZEPHIR_INIT_NVAR(suffix); - ZVAL_STRING(suffix, "ALPHA", 1); + ZEPHIR_INIT_NVAR(&suffix); + ZVAL_STRING(&suffix, "ALPHA"); break; } if (special == 2) { - ZEPHIR_INIT_NVAR(suffix); - ZVAL_STRING(suffix, "BETA", 1); + ZEPHIR_INIT_NVAR(&suffix); + ZVAL_STRING(&suffix, "BETA"); break; } if (special == 3) { - ZEPHIR_INIT_NVAR(suffix); - ZVAL_STRING(suffix, "RC", 1); + ZEPHIR_INIT_NVAR(&suffix); + ZVAL_STRING(&suffix, "RC"); break; } } while(0); - RETURN_CCTOR(suffix); + RETURN_CCTOR(&suffix); } @@ -173,34 +179,45 @@ PHP_METHOD(Phalcon_Version, _getSpecial) { */ PHP_METHOD(Phalcon_Version, get) { - zval *version = NULL, *major = NULL, *medium = NULL, *minor = NULL, *special = NULL, *specialNumber = NULL, *result = NULL, *suffix = NULL, *_1$$3; + zval version, major, medium, minor, special, specialNumber, result, suffix, _1$$3; zephir_fcall_cache_entry *_0 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&version); + ZVAL_UNDEF(&major); + ZVAL_UNDEF(&medium); + ZVAL_UNDEF(&minor); + ZVAL_UNDEF(&special); + ZVAL_UNDEF(&specialNumber); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&suffix); + ZVAL_UNDEF(&_1$$3); ZEPHIR_MM_GROW(); ZEPHIR_CALL_STATIC(&version, "_getversion", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(major); - zephir_array_fetch_long(&major, version, 0, PH_NOISY, "phalcon/version.zep", 139 TSRMLS_CC); - ZEPHIR_OBS_VAR(medium); - zephir_array_fetch_long(&medium, version, 1, PH_NOISY, "phalcon/version.zep", 140 TSRMLS_CC); - ZEPHIR_OBS_VAR(minor); - zephir_array_fetch_long(&minor, version, 2, PH_NOISY, "phalcon/version.zep", 141 TSRMLS_CC); - ZEPHIR_OBS_VAR(special); - zephir_array_fetch_long(&special, version, 3, PH_NOISY, "phalcon/version.zep", 142 TSRMLS_CC); - ZEPHIR_OBS_VAR(specialNumber); - zephir_array_fetch_long(&specialNumber, version, 4, PH_NOISY, "phalcon/version.zep", 143 TSRMLS_CC); - ZEPHIR_INIT_VAR(result); - ZEPHIR_CONCAT_VSVSVS(result, major, ".", medium, ".", minor, " "); - ZEPHIR_CALL_STATIC(&suffix, "_getspecial", &_0, 486, special); + ZEPHIR_OBS_VAR(&major); + zephir_array_fetch_long(&major, &version, 0, PH_NOISY, "phalcon/version.zep", 139 TSRMLS_CC); + ZEPHIR_OBS_VAR(&medium); + zephir_array_fetch_long(&medium, &version, 1, PH_NOISY, "phalcon/version.zep", 140 TSRMLS_CC); + ZEPHIR_OBS_VAR(&minor); + zephir_array_fetch_long(&minor, &version, 2, PH_NOISY, "phalcon/version.zep", 141 TSRMLS_CC); + ZEPHIR_OBS_VAR(&special); + zephir_array_fetch_long(&special, &version, 3, PH_NOISY, "phalcon/version.zep", 142 TSRMLS_CC); + ZEPHIR_OBS_VAR(&specialNumber); + zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/version.zep", 143 TSRMLS_CC); + ZEPHIR_INIT_VAR(&result); + ZEPHIR_CONCAT_VSVSVS(&result, &major, ".", &medium, ".", &minor, " "); + ZEPHIR_CALL_STATIC(&suffix, "_getspecial", &_0, 432, &special); zephir_check_call_status(); - if (!ZEPHIR_IS_STRING(suffix, "")) { - ZEPHIR_INIT_VAR(_1$$3); - ZEPHIR_CONCAT_VSV(_1$$3, suffix, " ", specialNumber); - zephir_concat_self(&result, _1$$3 TSRMLS_CC); + if (!ZEPHIR_IS_STRING(&suffix, "")) { + ZEPHIR_INIT_VAR(&_1$$3); + ZEPHIR_CONCAT_VSV(&_1$$3, &suffix, " ", &specialNumber); + zephir_concat_self(&result, &_1$$3 TSRMLS_CC); } - zephir_fast_trim(return_value, result, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); + zephir_fast_trim(return_value, &result, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); RETURN_MM(); } @@ -214,32 +231,43 @@ PHP_METHOD(Phalcon_Version, get) { */ PHP_METHOD(Phalcon_Version, getId) { - zval *version = NULL, *major = NULL, *medium = NULL, *minor = NULL, *special = NULL, *specialNumber = NULL, _0 = zval_used_for_init, *_1 = NULL, *_2 = NULL; + zval version, major, medium, minor, special, specialNumber, _0, _1, _2; zend_long ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&version); + ZVAL_UNDEF(&major); + ZVAL_UNDEF(&medium); + ZVAL_UNDEF(&minor); + ZVAL_UNDEF(&special); + ZVAL_UNDEF(&specialNumber); + ZVAL_UNDEF(&_0); + ZVAL_UNDEF(&_1); + ZVAL_UNDEF(&_2); ZEPHIR_MM_GROW(); ZEPHIR_CALL_STATIC(&version, "_getversion", NULL, 0); zephir_check_call_status(); - ZEPHIR_OBS_VAR(major); - zephir_array_fetch_long(&major, version, 0, PH_NOISY, "phalcon/version.zep", 169 TSRMLS_CC); - ZEPHIR_OBS_VAR(medium); - zephir_array_fetch_long(&medium, version, 1, PH_NOISY, "phalcon/version.zep", 170 TSRMLS_CC); - ZEPHIR_OBS_VAR(minor); - zephir_array_fetch_long(&minor, version, 2, PH_NOISY, "phalcon/version.zep", 171 TSRMLS_CC); - ZEPHIR_OBS_VAR(special); - zephir_array_fetch_long(&special, version, 3, PH_NOISY, "phalcon/version.zep", 172 TSRMLS_CC); - ZEPHIR_OBS_VAR(specialNumber); - zephir_array_fetch_long(&specialNumber, version, 4, PH_NOISY, "phalcon/version.zep", 173 TSRMLS_CC); - ZEPHIR_SINIT_VAR(_0); - ZVAL_STRING(&_0, "%02s", 0); - ZEPHIR_CALL_FUNCTION(&_1, "sprintf", NULL, 164, &_0, medium); + ZEPHIR_OBS_VAR(&major); + zephir_array_fetch_long(&major, &version, 0, PH_NOISY, "phalcon/version.zep", 169 TSRMLS_CC); + ZEPHIR_OBS_VAR(&medium); + zephir_array_fetch_long(&medium, &version, 1, PH_NOISY, "phalcon/version.zep", 170 TSRMLS_CC); + ZEPHIR_OBS_VAR(&minor); + zephir_array_fetch_long(&minor, &version, 2, PH_NOISY, "phalcon/version.zep", 171 TSRMLS_CC); + ZEPHIR_OBS_VAR(&special); + zephir_array_fetch_long(&special, &version, 3, PH_NOISY, "phalcon/version.zep", 172 TSRMLS_CC); + ZEPHIR_OBS_VAR(&specialNumber); + zephir_array_fetch_long(&specialNumber, &version, 4, PH_NOISY, "phalcon/version.zep", 173 TSRMLS_CC); + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "%02s"); + ZEPHIR_CALL_FUNCTION(&_1, "sprintf", NULL, 145, &_0, &medium); zephir_check_call_status(); - ZEPHIR_SINIT_NVAR(_0); - ZVAL_STRING(&_0, "%02s", 0); - ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 164, &_0, minor); + ZEPHIR_INIT_NVAR(&_0); + ZVAL_STRING(&_0, "%02s"); + ZEPHIR_CALL_FUNCTION(&_2, "sprintf", NULL, 145, &_0, &minor); zephir_check_call_status(); - ZEPHIR_CONCAT_VVVVV(return_value, major, _1, _2, special, specialNumber); + ZEPHIR_CONCAT_VVVVV(return_value, &major, &_1, &_2, &special, &specialNumber); RETURN_MM(); } @@ -257,8 +285,13 @@ PHP_METHOD(Phalcon_Version, getId) { PHP_METHOD(Phalcon_Version, getPart) { zephir_fcall_cache_entry *_0 = NULL; - zval *part_param = NULL, *version = NULL, *result = NULL, *_1$$4; + zval *part_param = NULL, version, result, _1$$4; zend_long part, ZEPHIR_LAST_CALL_STATUS; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&version); + ZVAL_UNDEF(&result); + ZVAL_UNDEF(&_1$$4); ZEPHIR_MM_GROW(); zephir_fetch_params(1, 1, 0, &part_param); @@ -270,13 +303,13 @@ PHP_METHOD(Phalcon_Version, getPart) { zephir_check_call_status(); do { if (part == 0 || part == 1 || part == 2 || part == 4) { - ZEPHIR_OBS_VAR(result); - zephir_array_fetch_long(&result, version, part, PH_NOISY, "phalcon/version.zep", 200 TSRMLS_CC); + ZEPHIR_OBS_VAR(&result); + zephir_array_fetch_long(&result, &version, part, PH_NOISY, "phalcon/version.zep", 200 TSRMLS_CC); break; } if (part == 3) { - zephir_array_fetch_long(&_1$$4, version, 3, PH_NOISY | PH_READONLY, "phalcon/version.zep", 204 TSRMLS_CC); - ZEPHIR_CALL_STATIC(&result, "_getspecial", &_0, 486, _1$$4); + zephir_array_fetch_long(&_1$$4, &version, 3, PH_NOISY | PH_READONLY, "phalcon/version.zep", 204 TSRMLS_CC); + ZEPHIR_CALL_STATIC(&result, "_getspecial", &_0, 432, &_1$$4); zephir_check_call_status(); break; } @@ -285,7 +318,7 @@ PHP_METHOD(Phalcon_Version, getPart) { break; } while(0); - RETURN_CCTOR(result); + RETURN_CCTOR(&result); } diff --git a/ext/phalcon/version.zep.h b/ext/phalcon/version.zep.h index 2e41314181b..c79680b159b 100644 --- a/ext/phalcon/version.zep.h +++ b/ext/phalcon/version.zep.h @@ -9,19 +9,56 @@ PHP_METHOD(Phalcon_Version, get); PHP_METHOD(Phalcon_Version, getId); PHP_METHOD(Phalcon_Version, getPart); -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_version__getspecial, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version__getversion, 0, 0, IS_ARRAY, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version__getversion, 0, 0, IS_ARRAY, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version__getspecial, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version__getspecial, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, special, IS_LONG, 0) +#else ZEND_ARG_INFO(0, special) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version_get, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version_get, 0, 0, IS_STRING, NULL, 0) +#endif +ZEND_END_ARG_INFO() + +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version_getid, 0, 0, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version_getid, 0, 0, IS_STRING, NULL, 0) +#endif ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_phalcon_version_getpart, 0, 0, 1) +#if PHP_VERSION_ID >= 70200 +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version_getpart, 0, 1, IS_STRING, 0) +#else +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_phalcon_version_getpart, 0, 1, IS_STRING, NULL, 0) +#endif +#if PHP_VERSION_ID >= 70200 + ZEND_ARG_TYPE_INFO(0, part, IS_LONG, 0) +#else ZEND_ARG_INFO(0, part) +#endif ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(phalcon_version_method_entry) { - PHP_ME(Phalcon_Version, _getVersion, NULL, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Version, _getVersion, arginfo_phalcon_version__getversion, ZEND_ACC_PROTECTED|ZEND_ACC_STATIC) PHP_ME(Phalcon_Version, _getSpecial, arginfo_phalcon_version__getspecial, ZEND_ACC_PROTECTED|ZEND_ACC_FINAL|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Version, get, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(Phalcon_Version, getId, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Version, get, arginfo_phalcon_version_get, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(Phalcon_Version, getId, arginfo_phalcon_version_getid, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME(Phalcon_Version, getPart, arginfo_phalcon_version_getpart, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/ext/php_phalcon.h b/ext/php_phalcon.h index 5922a47aa5a..6f07debc68d 100644 --- a/ext/php_phalcon.h +++ b/ext/php_phalcon.h @@ -14,7 +14,7 @@ #define PHP_PHALCON_VERSION "3.4.2" #define PHP_PHALCON_EXTNAME "phalcon" #define PHP_PHALCON_AUTHOR "Phalcon Team and contributors" -#define PHP_PHALCON_ZEPVERSION "0.10.14-975ad02db4" +#define PHP_PHALCON_ZEPVERSION "0.11.8-4495e75" #define PHP_PHALCON_DESCRIPTION "Web framework delivered as a C-extension for PHP" typedef struct _zephir_struct_db { @@ -66,10 +66,6 @@ ZEND_BEGIN_MODULE_GLOBALS(phalcon) /* Max recursion control */ unsigned int recursive_lock; - /* Global constants */ - zval *global_true; - zval *global_false; - zval *global_null; zephir_struct_db db; @@ -85,13 +81,14 @@ ZEND_END_MODULE_GLOBALS(phalcon) ZEND_EXTERN_MODULE_GLOBALS(phalcon) #ifdef ZTS - #define ZEPHIR_GLOBAL(v) TSRMG(phalcon_globals_id, zend_phalcon_globals *, v) + #define ZEPHIR_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(phalcon, v) #else #define ZEPHIR_GLOBAL(v) (phalcon_globals.v) #endif #ifdef ZTS - #define ZEPHIR_VGLOBAL ((zend_phalcon_globals *) (*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(phalcon_globals_id)]) + void ***tsrm_ls; + #define ZEPHIR_VGLOBAL ((zend_phalcon_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(phalcon_globals_id)]) #else #define ZEPHIR_VGLOBAL &(phalcon_globals) #endif